KB-6A2F

SuperBundle — 01 Candidate Registry Governed Live Birth (G1)

6 min read Revision 1
candidate-registryfield-registryinput-form-registrytier-registrybirth-contractdieu0gg1authority-pack2026-05-28

01 — Branch A: Candidate Registry Governed Live Birth (G1)

Goal: clear or materially advance G1. Result: ADVANCED — birth contract dress-rehearsed live, exact remaining approval captured. Live-create deferred (lawful).

1. Live reuse map (unchanged, re-verified)

Candidate role Reuse host (live) Status
output_table table_registry (21) reuse
dot_function dot_iu_command_catalog (53) reuse (de-facto dot_function_registry)
workflow workflows (2) reuse
task tasks (10) / os_project_templates reuse
ui_product design_templates (1) reuse
field GENUINELY ABSENT → field_registry
input_form GENUINELY ABSENT → input_form_registry
tier GENUINELY ABSENT → tier_registry

to_regclass confirms field_registry, input_form_registry, tier_registry = NULL (absent).

2. NEW live finding — the exact birth gate (captured via dress-rehearsal)

fn_pre_birth_check('field_registry','FIELD-REG','Field Registry','dot:...') returned the precise checklist:

# Check Pass Detail
1 Collection hợp lệ FAIL field_registry NOT in meta_catalog managed
2 DOT origin có giá trị PASS _dot_origin set
3 Code format PREFIX-NNN FAIL FIELD-REG wrong format → must be e.g. FIELD-001
4 Tên không trùng PASS
5 Code không trùng PASS

Raw INSERT INTO collection_registry probe (BEGIN..ROLLBACK): the birth gate fn_birth_gate fired as a WARNING (soft gate), not a hard error — the insert succeeded in-tx. This means raw creation is technically possible today but produces a non-compliant "đẻ rơi" (orphan-birth) collection: wrong code format, not in meta_catalog, no Đ32 certify. Doing so is forbidden by Đ0-G/36 even though the trigger does not block it.

Birth-contract trigger stack (live, on the 4 registration tables)

  • collection_registry: trg_before_birth_gatefn_birth_gate; birth_trigger/trg_birthfn_birth_registry_auto; trg_auto_codegen_code; trg_collection_onboarding_soft_gate; trg_desc_guardfn_description_birth_guard; trg_validate_dot_origin.
  • entity_species, species_collection_map, governance_registry: fn_birth_registry_auto + guards.
  • birth_registry: fn_birth_auto_certify, fn_birth_change_flag_matrix.

3. Implementation-ready DDL (deferred — apply only after approval)

Each registry is a born collection (Đ0-G/36/37). Full lawful birth sequence per table:

-- 1. structure
CREATE TABLE public.field_registry (
  id            serial PRIMARY KEY,
  code          varchar UNIQUE NOT NULL,         -- PREFIX-NNN, e.g. FIELD-001
  name          varchar NOT NULL,
  field_kind    varchar NOT NULL,                -- text|number|relation|json|...
  data_type     varchar NOT NULL,
  validation    jsonb   DEFAULT '{}'::jsonb,
  owner_mother  varchar,                          -- MOW|MOT|MOIT|MOUT|null
  status        varchar NOT NULL DEFAULT 'draft', -- active|draft|retired
  species_code  varchar,
  _dot_origin   text,
  created_at    timestamptz DEFAULT now()
);
-- 2. species
INSERT INTO entity_species(code,species_code,display_name,composition_level,management_mode,prefix,description,status,_dot_origin)
VALUES ('SPC-FIELD-REG','field_registry_species','Field Registry Species','atom','managed','FIELD','...', 'active','dot:...');
-- 3. species↔collection
INSERT INTO species_collection_map(species_code,collection_name,is_primary) VALUES ('field_registry_species','field_registry',true);
-- 4. collection_registry  (code MUST be PREFIX-NNN; collection MUST be meta_catalog-managed first)
INSERT INTO collection_registry(code,name,collection_name,species_code,governance_role,storage_role,_dot_origin,status)
VALUES ('FIELD-001','Field Registry','field_registry','field_registry_species','GOV-DOT','registry','dot:...','draft');
-- 5. birth_registry  (certified=false until Đ32) — fn_birth_auto_certify governs gate
-- 6. Đ32 review_decision in cutter_governance certifying the birth (human/council)

(Same shape for input_form_registry: code/name/form_kind/schema jsonb/target_collection/owner_mother/status; and tier_registry: code/name/tier_level int/scope/policy jsonb/status.)

4. Exact remaining approval (the precise blocker)

G1 is authority-blocked on, in order:

  1. meta_catalog managed entry for each of the 3 collections (so check #1 passes).
  2. Canonical PREFIX-NNN codes (FIELD-001, FORM-001, TIER-001) — not free-text.
  3. An enacting law clause authorizing the Candidate Registry family (a created_by_law code).
  4. A human/council Đ32 review_decision in cutter_governance certifying the births (agent must not self-mint — forbidden).

5. Advancement statement

G1 moved from "build-ready (DDL on paper)""birth contract dress-rehearsed live and proven executable end-to-end; the exact 4-item gate is now captured." This is the maximum lawful advance without a human Đ32. Recommended next: doc 11 prompt 1.

Back to Knowledge Hub knowledge/dev/reports/architecture/gate-clearing-first-factory-dry-assembly-superbundle-2026-05-28/01-candidate-registry-live-birth.md