GPT Review — 22-P1 Prompt rev4 Final Fragility Check
GPT Review — 22-P1 Prompt rev4 Final Fragility Check
Date: 2026-05-06 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed:
knowledge/dev/laws/dieu44-trien-khai/prompts/22-p1-iu-native-create-helper-functions-prompt.mdrev4
Verdict
P1 rev4 is production-shaped, but still needs a very small rev5 patch before dispatch.
The major safety concerns are resolved. Remaining issues are small but important because they can create false failures later as runtime data changes.
Required rev5 patches
P1 — Do not hardcode vocab test value design_doc_section
Rev4 test uses:
SELECT fn_iu_resolve_default('design_doc_section', ...)
This is a runtime vocab value, not a permanent truth. If vocab changes, P1 test fails even though the helper is correct.
Patch:
Before tests, dynamically select one valid unit_kind token:
SELECT substring(key from length('vocab.unit_kind.') + 1) AS sample_unit_kind
FROM public.dot_config
WHERE left(key, length('vocab.unit_kind.')) = 'vocab.unit_kind.'
ORDER BY key
LIMIT 1;
Then test explicit-valid using the sampled token. If no token exists, skip explicit-valid test and report warning; do not invent a token.
P2 — Do not hardcode pilot canonical address in helper tests
Rev4 tests use pilot.iu0.test-001. The current pilot row exists now, but future cleanup or environment reset can remove it, causing false fail.
Patch:
Before tests, discover one existing IU address:
SELECT canonical_address
FROM public.information_unit
ORDER BY date_created NULLS LAST, canonical_address
LIMIT 1;
- If found, use it for classify/verify existing tests.
- If none found, skip existing-row tests and only test nonexistent/invalid-input paths.
- Do not create a pilot row in P1.
P3 — Fix OR precedence in post-rollback helper check
Rev4 rollback check:
WHERE n.nspname='public' AND proname LIKE 'fn_iu%' OR proname='fn_content_hash'
Due to SQL operator precedence, this can match fn_content_hash outside public.
Patch:
SELECT n.nspname, p.proname
FROM pg_proc p
JOIN pg_namespace n ON n.oid=p.pronamespace
WHERE n.nspname='public'
AND (p.proname LIKE 'fn_iu%' OR p.proname='fn_content_hash')
ORDER BY p.proname;
P4 — Clarify skipped tests are not failures
If no vocab token exists or no existing IU row exists, skipped tests should be reported as SKIPPED, not FAIL, because P1 does not own seed data or pilot rows.
Directive to Opus
Patch P1 prompt to rev5 with P1–P4. After rev5, it is dispatchable.
Hard boundaries remain
- helper function DDL only;
- no row DML;
- no table/index/constraint DDL;
- no DOT adapter;
- no default seeding;
- no retry/improvise on failure.
Summary
P1 is ready in principle. These rev5 patches remove the last test hardcodes so the prompt stays valid when vocab/pilot data changes.