08 — Reconstruction & Containment Workflows (deterministic, integrity-testable)
08 — Reconstruction & Containment Workflows (deterministic, integrity-testable)
Package:
one-roof-axis-auth-proposal-operational-hardening-build-ready-design-2026-06-02Mode: DESIGN ONLY · READ-ONLY · NO COMMIT · NO MUTATION Hardens: prior…-2026-06-01/07-reconstruction-and-containment-axis-workflow.md. Closes GPT review gap (reconstruction/containment operationally clear and integrity-testable).
8.0 Both axes are deterministic — workflow is validation, not proposal
AX-RECON and AX-CONTAINMENT are structural axes (doc 04 §4.2): assignment is intrinsic (computed from structure), there is no confidence/zone, and the operating workflow is detect-and-fix (validation). A position either reconstructs correctly or it does not; a parent either exists or dangles. There is no "candidate reconstruction". Graph = truth; tree = projection.
8.1 AX-RECON — reconstruction axis
- Anchors (live
information_unit):doc_code,section_code,section_type,sort_order. The reconstruction order is intrinsic to these. - Operation:
fn_iu_reconstruct_source(doc_code)returns the ordered IU sequence that rebuilds the original document. - Non-exemptable invariant (verbatim intent): for a document, reconstruction must return every source position
1..Nexactly once — contiguous and unique,sort_orderstrictly monotonic,gap_before_count = 0. This invariant is never exemptable (a document that cannot be exactly rebuilt is corrupt). - Fingerprint (integrity test):
Recomputable; changes iff body or order changes. Store the expected fingerprint; a mismatch =recon_fingerprint(doc_code) := md5( string_agg( canonical_address || ':' || content_hash, '|' ORDER BY source_position ) )reconstruction_integrity_fail(critical). - Owner: GOV-SIV (system integrity, Điều 31).
Note:
information_unit.canonical_addressis used within a single document's ordered agg (where it is populated for IUs), not as a global key — distinct frombirth_registry.canonical_addresswhich is globally NULL (doc 01 §1.5). The global candidate key remainscollection:entity_code(doc 05 §5.3).
8.2 AX-CONTAINMENT — containment axis
- Primary parent:
information_unit.parent_or_container_ref(the canonical single parent). - Graph (multi-parent truth):
iu_relationwithrelation_type='contains'(live: all 60 rows arecontains). An IU may belong to multiple parents (graph). - Closure (tree projection):
iu_tree_path(root_unit_id, parent_id, depth, path_ids[], path_addresses[], sibling_order, path_hash). The tree is a projection of the graph for one chosen parent spine. - Change logs:
iu_tree_change_log,iu_structure_operation,iu_piece_collection,iu_piece_membership. - Owner: GOV-SIV.
8.3 Integrity detectors (feed doc 09; severity computed)
| Detector | Meaning | Severity |
|---|---|---|
reconstruction_gap |
missing source position (gap_before_count > 0) | critical |
reconstruction_duplicate |
a position appears twice | high |
reconstruction_integrity_fail |
fingerprint mismatch | critical (non-exemptable) |
containment_dangling_parent |
parent_or_container_ref points at a non-existent IU |
high |
containment_cycle |
a containment cycle (recursive-CTE detect) | critical |
containment_primary_ambiguous |
multiple primary parents claimed | high |
iu_object_orphan |
an IU/object with no owner / not covered | medium-high |
8.4 Operational workflows
WF-R — Reconstruction axis: validate original document restoration
- Input:
doc_code. Output: ordered reconstruction + integrity verdict. Store:information_unit(anchors) + stored fingerprint. Owner: GOV-SIV. Approval: read/validate = none; a structural fix (re-order, fill gap) = high ⇒ L2/L3. Agents: Quality (runfn_iu_reconstruct_source+ fingerprint), Critique, Sync (apply fix under grant). Quality checks: contiguity + uniqueness + monotonicsort_order+ fingerprint match. Rollback: change-set reverse; deprecate-not-delete. UI: reconstruction reader (doc 10) shows the rebuilt document + integrity badge. Coverage trigger: a failing fingerprint opens a criticalreconstruction_integrity_fail(doc 09).
WF-C — Containment axis: parent/child/multi-parent/tree projection
- Input: an IU or root. Output: containment tree (and the multi-parent graph). Store:
iu_relation(contains) +iu.parent_or_container_ref+iu_tree_path. Owner: GOV-SIV. Approval: read = none; cut/split/merge = high ⇒ L2/L3. Agents: Quality (cycle/dangling/ambiguity detect), Sync (structural edit under grant). Quality checks: no cycle, no dangling parent, one primary parent, closure consistent with graph. Rollback:iu_structure_operationreverse +iu_tree_change_log; deprecate-not-delete. UI: containment tree + graph browser (doc 10). Coverage trigger: a cycle/dangling opens a critical/high issue (doc 09).
8.5 Integrity-test procedure (how to validate, build-ready)
- Reconstruction: recompute
recon_fingerprint(doc_code)and compare to the stored expected value; independently assert contiguity (min=1,max=N,count(distinct position)=N,gap_before_count=0) and strict monotonicsort_order. - Containment cycle: recursive CTE over
iu_relation(contains) detecting a node reachable from itself. - Dangling parent:
parent_or_container_refnot matched ininformation_unit. - Closure consistency:
iu_tree_pathpaths must be derivable from the liveiu_relationgraph for the chosen primary spine. All four are pure read-only checks runnable by a Quality agent or a coverage DOT (doc 09); none require mutation.
8.6 Structural edits route the ladder
Cut / split / merge / re-order are high-risk (they change reconstruction and containment truth). They are L2-approved and L3-granted, carry a rollback plan, and are deprecate-not-delete. Reconstruction integrity, relation integrity, vector consistency, and governance coverage are the non-exemptable integrity classes — no exception row can waive them.
Forbidden-compliance: design-only; no reconstruction/containment row written; no structural edit applied; read-only.