KB-681B

PIDX Build Design — GO/NO-GO for Codex Review v0.1 (2026-06-23)

6 min read Revision 1
workflow-manageprocedure-indexpidxgo-no-gocodex-reviewdecision2T2Vv0.12026-06-23

PIDX Build Design — GO / NO-GO for Codex Review v0.1

Path: knowledge/dev/laws-new/workflow-manage/reports/pidx-build-design-go-no-go-v0.1.md Status: DECISION PACKET · NON-AUTHORIZING · read-only + KB-write only · 0 PG objects created · 0 PG/Directus/DOT mutation. Date: 2026-06-23 Verdict code: PIDX_BUILD_DESIGN_V0_1_GO_FOR_CODEX_REVIEW_2T2V Supersedes labeling in: reports/wf-procedure-index-go-no-go-v0.1.md (the ..._3T2V verdict string — corrected to 2T2V here).


1. Verdict: GO_FOR_CODEX_REVIEW

The hardening macro produced a construction-ready package. Hand pidx-build-design-v0.1.md + the four design companions + pidx-codex-review-packet-v0.1.md to Codex. After Codex clears it (no BLOCK), the package is ready for Owner DDL authorization via the governed path. This document does not authorize any build.


2. What this macro hardened (deltas from T3)

# Hardening Result
1 Naming wf_*pidx_* pidx_procedure, pidx_procedure_ingredient, v_pidx_inventory_current, v_pidx_procedure_readiness. Avoids collision with the live wf_* scanner/snapshot family; reads as "index", not "engine".
2 Scope label fix 2T2V (2 tables + 2 views), correcting the T3 3T2V verdict string. pidx_procedure_link deferred (links → links_jsonb note until M2M is queried).
3 Ref grammar v0.1 frozen 14 kinds, 2 normalization classes, per-kind probe/case/schema/fallback; 4-state distinction MISSING / UNKNOWN_SOURCE / INVALID_REF / READ_BLOCKED locked.
4 Candidate DDL Two tables (text only) with enum CHECKs, soft ingredient_ref + ref_status, FK child→parent, 3 indexes; constraint-strictness decision justified.
5 Inventory view v_pidx_inventory_current 14-column contract, 9 SAFE branches + label (PARTIAL); io/checker/template/report excluded; anti-monster guard.
6 Readiness view v_pidx_procedure_readiness per-ingredient precedence + per-procedure rollup; full 11-status set + 6 warning flags; anti-false-green rules; READY_WITH_WARNINGS added.
7 Seed slice 9 procedures (3 slices) instead of 39; designed to exercise every status; candidate INSERTs grounded on real dot_tools/apr_action_types.
8 Test plan 13 SELECT-only cases + 5 supplementary checks; expected output shapes; anti-false-green invariant query.
9 Rollback Ordered drop + 3 verification query groups (absence, non-damage, source-readability).
10 Codex packet 10-dimension checklist + 7 flagged open items.
11 Live re-verification pidx_* absent; dot_tools=309, apr 4 impl/10 unimpl, event_type_registry=52, collection_registry=168 (T3 counts refreshed; design reads live, never hardcodes).

3. Acceptance criteria (macro §6) — all met

# Required output Status Where
1 Final pidx_* object naming build-design §1.1
2 Clear 2T2V build scope build-design §1.3
3 Frozen ref grammar v0.1 summary build-design §3; readiness-logic §2
4 Candidate DDL as text only ddl-candidate §1–3
5 Candidate inventory/readiness SQL as text only ddl-candidate §4–5
6 Warning flags to avoid false READY readiness-logic §5, §7
7 Small 6–9 procedure seed slice seed-slice (9)
8 Test plan covering EXISTS/MISSING/UNKNOWN_SOURCE/INVALID_REF/READINESS_DRIFT test-plan §1 (T3,T4,T9,T8,T12)
9 Rollback/drop script ddl-candidate §6
10 Codex review packet/checklist codex-review-packet
11 GO/NO-GO recommendation this doc

No FAIL condition triggered: no PG object created/mutated; no workflow engine; no scheduler/bus; no RAG/vector/pg_trgm in v0.1; not all-39 seeded; pidx_* (not wf_*); Ingredient Map treated as cache; manifest/RAG/note cannot set READY; ref grammar present; false-READY risks addressed; rollback present.


4. Risks & unresolved decisions (none block Codex review)

  1. DDL is net-new → governed create. Owner must approve via patch_ops_code APR or a registered migration DOT. This package does not authorize it. (carried to Owner)
  2. template: source = NEEDS_OWNER_DECISION (iu_collection_template_registry vs design_templates vs none); stays UNKNOWN_SOURCE until decided.
  3. io/checker/report have no clean PG SSOT → permanently UNKNOWN_SOURCE in v0.1; Owner confirms acceptable.
  4. workflows overlapprocedure:WF-* is indexed, not migrated; confirm the two stores are intentionally distinct.
  5. function name-only existence and label facet ambiguity — v0.1 accepts name-only + OVERLOADED_FUNCTION/AMBIGUOUS_LABEL warnings; precise signatures/facets deferred to v0.2.
  6. SQL review items (correlated array_agg warning_flags, duplicated drift CASE, split_part segment-count safety) → Codex to adjudicate; expected CONCERN-level, not BLOCK.
  7. pg_trgm/vector deferred; owner-gated CREATE EXTENSION only if scale demands, two-step suggest→confirm only.

5. Files produced by this macro (KB)

design/pidx-build-design-v0.1.md
design/pidx-ddl-candidate-v0.1.sql.md
design/pidx-readiness-logic-v0.1.md
design/pidx-seed-slice-v0.1.md
design/pidx-test-plan-v0.1.md
design/pidx-codex-review-packet-v0.1.md   (optional companion)
reports/pidx-build-design-go-no-go-v0.1.md (this file)

6. Bottom line

GO_FOR_CODEX_REVIEW. A 2-table + 2-view (2T2V) pidx_* Procedure Index can be built entirely on what PG already exposes. The eye (index + readiness views) is fully specified; the hand (engine, governance, auto-fix, scheduler) stays out of scope. Truth remains PG-computed; declarations remain hints; readiness can never be silently green. Next gate: Codex review → then Owner-authorized governed DDL.