KB-5D18

GPT Review — P3D Pack1 Phase4 Discovery + No-Hardcode Decisions

7 min read Revision 1
gpt-reviewp3dpack1phase4discoveryno-hardcodedecisions2026-05-11

GPT Review — P3D Pack 1 Phase 4 Discovery + No-Hardcode Decisions

Date: 2026-05-11 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed:

  • knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase4-governance-vocab-discovery-report.md
  • Opus verification after Agent discovery

Verdict

Discovery accepted. Phase 4 remains PARTIAL because implementation decisions are now required. Migration remains blocked.

The Agent report is sufficiently detailed and no-hardcode compliant. It confirms the system must not proceed to TAC→IU migration until governed-prep is executed and reviewed.

No-hardcode enforcement decision

From this point forward, any implementation prompt that contains manually enumerated seed lists without a live-delta generation step is rejected.

Allowed pattern:

live discovery query → compute delta → execute delta only → report exact rows inserted/updated

Rejected pattern:

INSERT fixed list copied from a report/design/memory

Numeric counts may appear only as run snapshots, not constants or logic conditions.

Accepted discovery findings

  • The current live delta snapshot reported 14 missing vocab candidates: unit_kind, publication_type, and section_type candidates.
  • The number 14 is not a constant; it is the result of this discovery run.
  • SPE-LAW exists in entity_species as a governed law-domain species, but no mapping exists for IU/UV.
  • information_unit / unit_version are still observed / pilot in collection_registry.
  • TAC hierarchy is clean in the snapshot, but depth/root/child counts are snapshots only.
  • No real source_hash column exists; unit_version.content_profile is the current JSONB carrier candidate.

Four decisions

D1 — Vocab seed policy

Approved in principle, not approved as fixed 14-row seed.

Phase 4 implementation may seed IU vocab deltas only by recomputing live deltas at execution time.

The required categories are:

  • missing vocab.unit_kind.* needed by the active migration contract;
  • missing vocab.section_type.* derived from live TAC-used section types;
  • missing vocab.publication_type.* derived from live TAC-used publication types.

STOP if:

  • live delta differs from the discovery report and the prompt has no rule to handle it;
  • target dot_config schema is not exactly (key,value,description,updated_at) or compatible;
  • any candidate key already exists with a conflicting value.

D2 — Species mapping policy

Approved in principle using live-discovered species and target collections.

Do not hardcode “2 rows”. Phase 4 implementation may seed species_collection_map for the discovered target collections that require mapping, using a uniquely resolved law species.

Resolution rule:

  1. Discover target collections from collection_registry where collection name is in the current native IU target set for migration.
  2. Resolve law species from entity_species using live query, preferring a unique governed law-domain species such as species_code='law' / prefix LAW / code='SPE-LAW' if uniquely found.
  3. Use discovered composition_level from the species row, not a typed constant.

STOP if:

  • zero or multiple plausible law species are found;
  • target collection rows are missing;
  • existing species_collection_map rows conflict;
  • required columns differ from expected discovered schema.

D3 — Parent/composition policy

Parent pointer is approved for migration design; edge materialization remains deferred.

For Phase 5 pilot migration design:

  • copy TAC parent_id into IU parent_or_container_ref through an ID mapping, not by assuming depth;
  • verify no orphans/cycles at execution time;
  • do not materialize universal_edges in the first migration unless a separate edge-materialization design is reviewed.

composition_role must not be hardcoded from a fixed layer model. If stored, it must be derived from a registry-backed composition contract or marked as deferred. For the next implementation-prep pack, treat composition role as deferred unless a live registry/contract source is found.

D4 — Hash provenance target

Use unit_version.content_profile JSONB as the provisional traceability carrier, but only after a namespaced key contract is documented and tested.

Do not create a new column in Phase 4. Do not use content_hash for TAC source hash.

Recommended JSONB path:

content_profile.source_hashes.tac_v1

Required fields at migration time:

source_hashes.tac_v1.algorithm
source_hashes.tac_v1.input_recipe
source_hashes.tac_v1.value
source_hashes.tac_v1.source_table
source_hashes.tac_v1.source_id

This is not a migration approval. It is a design decision for the next prompt.

Phase 4 next action

Opus must revise/create a Phase 4 implementation-prep prompt that is safe to dispatch for governance/vocab/species preparation only.

The prompt must:

  1. recompute live deltas at execution time;
  2. seed only computed deltas;
  3. seed species mapping only if unique law species and target collections are resolved live;
  4. avoid collection governance promotion for now;
  5. avoid migration;
  6. avoid universal_edges materialization;
  7. document the content_profile.source_hashes.tac_v1 contract but not backfill any TAC data yet;
  8. include STOP gates and rollback.

What remains blocked

  • TAC→IU migration.
  • collection_registry promotion to governed/active.
  • edge materialization.
  • birth-gate expansion.
  • direct species/composition enforcement at birth.
  • any hardcoded seed list.

Status

phase4_discovery=ACCEPTED_PARTIAL
no_hardcode_policy=ENFORCED
vocab_seed_policy=APPROVED_IN_PRINCIPLE_DISCOVERY_DELTA_ONLY
species_mapping_policy=APPROVED_IN_PRINCIPLE_LIVE_UNIQUE_RESOLUTION_ONLY
parent_pointer_policy=APPROVED_FOR_PHASE5_DESIGN
edge_materialization=DEFERRED
hash_provenance_target=CONTENT_PROFILE_SOURCE_HASHES_TAC_V1_CONTRACT
migration_allowed=false
next_action=OPUS_PATCH_PHASE4_IMPLEMENTATION_PREP_PROMPT_FROM_DECISIONS
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-p3d-pack1-phase4-discovery-and-decisions-no-hardcode-2026-05-11.md