KB-ADCC
P3D Pack 1 Phase 4 — DRAFT v3 Patch Report
3 min read Revision 1
p3dpack1phase4v3patchreportno-hardcode
P3D Pack 1 Phase 4 — DRAFT v3 Patch Report
Date: 2026-05-11 | Author: Opus 4.7
7 Fixes v2 → v3
| # | v2 lỗi | v3 fix |
|---|---|---|
| 1 | INSERT created_at (column doesn't exist) |
GATE 0 introspect dot_config columns → agent adapts INSERT to match actual schema |
| 2 | Literal 'information_unit', 'unit_version' in INSERT |
Derive from collection_registry via _iu_target_collections temp table |
| 3 | Literal 'subordinate' |
Derive from collection_registry.birth_code_strategy or entity_species.composition_level |
| 4 | HAVING count(*)=1 without GROUP BY | Subquery (SELECT count(*) FROM _law_species) = 1 in WHERE |
| 5 | Rollback by description prefix | Exact key capture in _inserted_vocab_keys + _inserted_species; unique run_marker per execution |
| 6 | ON CONFLICT without introspect | GATE 1/3 introspect unique constraints before any INSERT |
| 7 | STOP if delta ≠ expected (snapshot comparison) | STOP only on schema conflict, uniqueness failure, or species ambiguity — NOT on count mismatch with previous snapshot |
Additional v3 improvements
run_marker= unique per execution (p3d-phase4-seed-YYYYMMDD-HHMMSS)SAVEPOINTper section (vocab / species) — partial rollback possiblelaw_unitexplicitly noted as contract-required from Pack1 EVOLVE design, not a TAC-discovered value- Species seed uses CROSS JOIN from derived tables, not literal VALUES
- Fallback rollback uses exact run_marker string, not prefix pattern
No-Hardcode Self-Audit v3
| Check | Status |
|---|---|
| Any literal table name in INSERT VALUES? | ❌ No — all from _iu_target_collections |
| Any literal composition level? | ❌ No — from birth_code_strategy or entity_species |
| Schema columns assumed? | ❌ No — GATE 0/2 introspect first, agent adapts |
| Any count as logic constant? | ❌ No — only count=1 check for unique species resolution |
| Container/DB hardcoded? | ❌ No — env vars |
| Rollback targets exact rows? | ✅ Yes — via _inserted_* temp tables + run_marker |
Status
draft_version=v3
no_hardcode_violations=0
schema_introspected=true
exact_rollback=true
next_action=GPT_REVIEW_DRAFT_V3
v3 Patch Report | 2026-05-11