P3D Pack 1 Phase 4C — Prompt rev2 No-Hardcode Selector Patch Report
P3D Pack 1 Phase 4C — Prompt rev2 No-Hardcode Selector Patch Report
Date: 2026-05-11 Author: Opus 4.7 Directive:
gpt-directive-opus-p3d-pack1-phase4c-prompt-rev2-no-hardcode-selectors-2026-05-11.md
1. Status flags
phase4c_prompt_rev2_status=PATCHED
phase4c_design_recommendation_downgraded=true
scope_block_declared=true
species_code_names_removed_from_selectors=true
composition_list_derived_from_live=true
phase4b_labels_marked_for_reverify=true
scale_brittleness_self_audit_added=true
each_goal_has_authoritative_source_selector_skip_output=true
requires_GPT_User_review_before_dispatch=true
2. Paths
| Artifact | Path | Rev |
|---|---|---|
| Design (patched §J) | ...design/p3d-pack1-phase4c-species-mapping-strategy-qt001-backfill-design.md |
2 |
| Mission prompt (rev2 rewrite) | ...prompts/p3d-pack1-phase4c-readonly-dryrun-species-mapping-qt001-prompt.md |
2 |
| This report | ...reports/p3d-pack1-phase4c-prompt-rev2-no-hardcode-selector-patch-report.md |
1 |
3. Top 7 corrections from rev1
-
SCOPE BLOCK declared once at §0 — the ONLY hardcoded identifiers in the prompt:
target_collection_primary='information_unit',target_collection_subordinate='unit_version',target_unit_kind_committed='law_unit',discriminator_candidate_column='unit_kind'. These are Pack 1 scope definitions (approved design artifacts), not value lookups. All other names removed. -
SPE-GOV / SPE-LAW / atom-molecule-compound removed from selectors — rev1 used these names in goal descriptions and example dry-runs. rev2 eliminates them entirely from the decision path. Goals describe CRITERIA (e.g., "all species in entity_species") not NAMES.
-
Authoritative source per goal — every G1-G10 now declares: where to derive values from, what selector rule applies, what triggers skip/STOP, what output shape is expected. No vague "agent implements queries."
-
Composition levels derived live — rev1 used "atom/molecule/compound" as if a fixed list. rev2 explicitly:
SELECT DISTINCT composition_level FROM entity_speciesis the only valid source. Even Điều 0-B's canonical 6 levels are NOT hardcoded — agent reads live. -
Phase 4B labels marked for re-verification — rev1 treated Phase 4B findings (e.g., "40 species", "12 NULL rows") as facts. rev2 says these are LABELS only; re-verify live before using as facts.
-
Scale brittleness self-audit section — agent must answer 8 self-audit questions before submitting report (did I list anything from memory? did I assume counts/patterns? would my queries adapt if species was renamed/added?). Fails-safe against scale brittleness.
-
Design §J downgraded — "Opus recommended strategy" → "Options pending dry-run". Four options (O1-O4) presented for GPT/User to choose. No locked recommendation.
4. Scale brittleness analysis (why rev2 was needed)
Identifiers in rev1 that would break under scale:
| rev1 hardcode | Break scenario |
|---|---|
SPE-GOV as suggested species |
If renamed/deprecated; if multiple gov species exist; if SPE-GOV's composition_level changes |
SPE-LAW as suggested species |
Same — and SPE-LAW could be split into multiple law-domain species |
atom/molecule/compound list |
If Điều 0-B's 6 levels (atom→building) are activated; if a level is renamed |
species_code='law' selector |
If law domain splits; if species_code naming convention changes |
| "40 species" count | Already changed: 21 (v1.2 doc) → 40 (Phase 3) → unknown next |
| "12 NULL rows" count | Changes per pilot lifecycle; new pilot rows can be added |
| "SPE-XXX" prefix pattern | If new prefix scheme adopted (e.g., longer codes) |
rev2 eliminates ALL of these by deriving everything from live queries with criteria-based selectors.
5. What is preserved from rev1
- Goal count and intent (G1-G10) — same exploration scope
- Discriminator runtime finding (fn_birth_registry_auto doesn't read discriminators) — re-emphasized
- Read-only/dry-run mode
- No-seed/no-backfill/no-migration boundaries
- Mission-prompt style (design-level, not bash)
- Reference to legal alignment addendum
6. Single nuance (not a disagreement)
The §0 SCOPE BLOCK retains 4 hardcoded identifiers: information_unit, unit_version, law_unit, unit_kind. Justification:
information_unit/unit_version= Pack 1 TARGET COLLECTIONS, defined by approved Pack 1 design. They are scope boundaries, not value lookups. Without them, the prompt has no subject.law_unit= vocab value already committed to production via Phase 4 (vocab.unit_kind.law_unit). It's a contract value, verified to exist.unit_kind= column name in information_unit (verified via G6 introspection in this prompt).
These are NOT scale-brittle because they are Pack 1 scope definitions, not assumptions about the wider system. If Pack 2 targets different collections, that pack's prompt declares its own scope block. If unit_kind column doesn't exist, G6 catches it and the discriminator path collapses safely.
7. Confirmation
phase4c_design=ACCEPTED_DIRECTIONALLY_RECOMMENDATION_DOWNGRADED
phase4c_prompt=REV2_READY_FOR_GPT_REVIEW
next_action=GPT_REVIEW_PHASE4C_PROMPT_REV2
GPT + User review required before dispatch. No agent, no seed, no migration.