05 — G4 Factory Rows draft→active Flip Packet + Dependency Chain
05 — G4 Factory Rows draft→active Flip Packet + Dependency Chain (Branch E)
Authority status: NOT_FOUND + dependencies unmet (doc 01) → agent does NOT flip. Final packet.
1. Live state (verified)
4 factory rows present, all status='draft', gov_type='factory', gov_group='mother', capability.can_create disjoint (no-double-ownership already proven):
| code | name | can_create | must_not_own |
|---|---|---|---|
| GOV-MOW | Mother of Workflows | workflows | tasks, input_form_registry, design_templates, information_unit |
| GOV-MOT | Mother of Tasks | tasks | workflows, information_unit, design_templates |
| GOV-MOIT | Mother of Input Templates | input_form_registry, field_registry | workflows, tasks, design_templates |
| GOV-MOUT | Mother of UI/Output Templates | design_templates | workflows, tasks, input_form_registry |
chk_gov_registry_status allows {active, draft, retired}; 'proposed' is rejected. So the flip is a simple status='draft' → 'active' UPDATE — but only when dependencies + authority exist.
2. Dependency chain (hard)
G1 (Candidate Registry born: field/input_form/tier) ──┐
G2 (Đ37-H human-org-role law enacted) ──┼──> G4 authority (flip approval) ──> draft→active flip
G4-authority (flip-authorizing decision) ──┘
- G1 required because MOIT's can_create references field_registry/input_form_registry which must exist as born registries before MOIT is "active" and meaningful.
- G2 required because an active factory needs a lawful human ownership/permission context (who operates it).
- G4-authority required: a decision authorizing the flip (lawfully a Đ32-class decision via G3's approve path).
3. Flip procedure (human session, once dependencies + authority exist)
BEGIN;
-- one row at a time, verify no-double-ownership invariant holds after each
UPDATE governance_registry SET status='active' WHERE code='GOV-MOW' AND status='draft';
-- ... repeat for MOT/MOIT/MOUT ...
-- invariant check: every output target owned by exactly one mother
SELECT * FROM fn_phase0_cockpit(); -- factories[].status should read 'active'
COMMIT;
No runtime is enabled by this flip — it only marks the factories lawful-to-operate; runtime gates (composer/operator/delivery/job_substrate) stay closed.
4. Post-verify + no-double-ownership proof
- Re-run cockpit: 4 factories active, can_create still disjoint.
- Assert: union of can_create sets is a partition (no output target appears in two mothers).
- Mother events (9, currently active=0): activation of factory rows does not auto-activate event types — that is a separate Đ45 step and remains deferred.
5. Reversal
UPDATE governance_registry SET status='draft' WHERE code IN (...) AND status='active'; — trivial, no cascade (status column only). Safe.
6. FOUND_VALID definition
G4 active = G1 born + G2 enacted + flip-authority decision present, then 4 rows flipped to active with the no-double-ownership invariant verified. Runtime stays NO-GO regardless.