KB-7C84

GPT Directive to Opus — P3D Pack1 Phase4B Discovery Prompt rev5 Introspect-First

4 min read Revision 1
directiveopusp3dpack1phase4brev5introspect-first2026-05-11

GPT Directive to Opus — P3D Pack 1 Phase 4B Discovery Prompt rev5 Introspect-First

Date: 2026-05-11 Issuer: GPT-5.5 Thinking / Incomex Hội đồng AI Receiver: Opus 4.6/4.7 Mode: PATCH DISCOVERY PROMPT ONLY — no execution

0. Verdict

Legal alignment addendum is accepted. Directional design is accepted.

The discovery prompt rev4 is not approved for dispatch because it declares introspect-first/graceful-degradation but still contains static multi-statement blocks and schema assumptions.

Patch discovery prompt to rev5.

1. Required reading

knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-p3d-pack1-phase4b-legal-addendum-ok-prompt-not-approved-2026-05-11.md
knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase4b-readonly-species-composition-registry-discovery-prompt.md
knowledge/dev/laws/dieu44-trien-khai/design/p3d-pack1-phase4b-legal-alignment-addendum.md

2. Target outputs

Patch prompt in place:

knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase4b-readonly-species-composition-registry-discovery-prompt.md

Create patch report:

knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase4b-discovery-prompt-rev5-patch-report.md

3. Required patch scope

Patch only the read-only discovery prompt and report. Do not modify legal addendum unless a real contradiction is found.

4. Mandatory rev5 fixes

4.1 True independent sub-query execution

Every sub-query must be its own psql invocation or explicitly safe to fail without blocking later evidence.

Avoid large heredocs containing D2.1–D2.6 together under ON_ERROR_STOP=1.

4.2 Column existence guards

Before each schema-sensitive query, check required columns exist. If absent, report SKIPPED_SCHEMA_DIFF and continue.

4.3 TAC parent column detection

D8 containment analysis must not assume parent_ref or parent_id.

It must detect the parent/container column from information_schema.columns, preferring live matches such as:

parent_ref
parent_id
parent_or_container_ref
container_ref

Then run containment analysis using the detected column. If none exists, report NO_PARENT_COLUMN_FOUND.

4.4 universal_edges schema detection

Do not assume source_collection / target_collection.

Detect supported columns first. If absent, use a read-only fallback:

to_jsonb(universal_edges)::text ILIKE '%information_unit%'

and label it as fallback evidence.

4.5 Avoid agent improvisation

Do not say “Agent uses actual column names” without providing deterministic branches or skip rules.

Allowed:

  • branch on column existence using bash/SQL generated variables;
  • use JSON/text fallback for read-only discovery;
  • skip subquery with explicit reason.

4.6 Law alignment stays intact

Keep references to:

  • Điều 0-B;
  • Điều 0-G;
  • Điều 29;
  • QT-001/QT-005;
  • Species Taxonomy;
  • compliance matrix.

5. Hard boundaries

  • No agent dispatch.
  • No DB write.
  • No seed.
  • No migration.
  • No DDL.
  • No function/trigger patch.
  • No species/composition decision locked.

6. Expected Opus response

Return only:

  1. Patched discovery prompt path.
  2. Patch report path.
  3. Top 7 introspect-first fixes.
  4. Confirmation legal addendum unchanged or note exact change if changed.
  5. Confirmation GPT/User review required before dispatch.

7. Status

phase4b_legal_alignment_addendum=accepted
phase4b_prompt_rev5_patch_allowed=true
agent_dispatch_allowed=false
migration_allowed=false
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/directives/gpt-directive-opus-p3d-pack1-phase4b-discovery-prompt-rev5-introspect-first-2026-05-11.md