KB-681B

PIDX Build Design — GO/NO-GO for Codex Static Re-review v0.2 (2026-06-23)

7 min read Revision 1
workflow-manageprocedure-indexpidxgo-no-gocodex-reviewdecision2T2Vready-for-codexv0.22026-06-23

PIDX Build Design — GO / NO-GO for Codex Static Re-review v0.2

Path: knowledge/dev/laws-new/workflow-manage/reports/pidx-build-design-go-no-go-v0.2.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_2_READY_FOR_CODEX_STATIC_REVIEW_2T2V Supersedes: reports/pidx-build-design-go-no-go-v0.1.md (..._GO_FOR_CODEX_REVIEW → re-reviewed PASS_WITH_CAVEATS_REQUIRES_PATCH → now patched to v0.2).


1. Verdict: READY_FOR_CODEX_STATIC_REVIEW_V0_2

The patch round resolved every Codex BLOCK (5/5) and HIGH (7/7) item, plus all MEDIUM (5/5), preserving the 2T2V architecture. The candidate SQL is complete (no abbreviated branches), the readiness logic is one strict parser/resolver, and every new negative test has a deterministic, live-verified expected output. The resolver was additionally executed read-only against live directus (0 objects created) and matched 21/21 per-ingredient + per-procedure outcomes (patch-report §5) — proving the patched SQL parses and computes, not merely looks parseable. The only open governance item (Điều 33 classification) is a build-gate Owner decision, not a SQL/logic blocker.

This document does not authorize any build. The only expected next step is Codex static re-review of v0.2.


2. Acceptance criteria (macro §9) — status

# Criterion Status Evidence
1 All Codex BLOCK resolved or escalated ✅ 5/5 RESOLVED patch-report §1
2 All HIGH resolved or justified ✅ 7/7 RESOLVED patch-report §2
3 2T2V scope kept build-design §1.2
4 No build/mutation ✅ 0 DDL/DML all files header
5 Candidate SQL complete for static review ddl §2–7 (no "etc.")
6 READY cannot come from declaration/manifest/note/RAG/seed logic §7; tests S1,S2
7 Zero-required cannot be silent READY logic §4; tests T14,T15,S1
8 Invalid refs caught before probing logic §1.1; tests T4,T5
9 Collection logical/physical mismatch surfaced ddl §5,§6; tests T8,T9,S4
10 Label ambiguity surfaced ✅ (armed; inert on data, proven) logic §6; test T13
11 Approval handler unimplemented surfaced ✅ (required→NOT_READY) logic §6; test T10
12 Warning flags PostgreSQL-safe aggregation ddl §5 proc_warn; logic §5
13 Rollback/test plan hardened ddl §7; test-plan §1–2
14 LEGO separation preserved logic §0; build-design §6
15 No hardcoded truth; only contracts build-design §7
16 Automation = visibility/readiness/routing only build-design §8; logic §8
17 DOT/governed-path discipline for future mutation build-design §9,§11

No FAIL condition triggered: no DDL/DML executed; scope unchanged (2T2V); no engine/scheduler/vector/Nuxt/governance/KG/birth dependency added; no BLOCK ignored; no false-READY path left; SQL patched (not prose); SQL complete; not collapsed into an engine; truth computed not hardcoded; no auto-execution implied; read-only vs future-mutation authority kept distinct.


3. What this round hardened (deltas from v0.1)

# Hardening Result
1 Strict parser/resolver prefix=kind + exact arity + no empty segment, independent of ref_status; kills prefix-mismatch & split_part arity false-EXISTS
2 Collection physical/logical physical=truth; logical separate; XOR mismatch; logical-only→MISSING; inventory FULL OUTER JOIN
3 Label facet grammar label:<facet_id>.<code> + bare; AMBIGUOUS_LABEL on bare multi-match
4 Zero-required required_count=0 → UNMAPPED
5 Usability/lifecycle usable tri-state; required-not-usable → NOT_READY
6 Approval gating required unimplemented handler → NOT_READY (safe rule)
7 warning_flags clean per-proc CTE aggregation; causally complete; green invariant
8 Identity/delete RESTRICT FK + surrogate id + immutable procedure_code
9 Điều 33 classified + canonical column shape
10 Rollback preflight + transactional + fail-closed + exact fingerprint
11 Tests 19 deterministic + 6 invariants; live-verified; no hidden DML / no >=0
12 READ_BLOCKED privilege-derived (has_schema_privilege)

4. Risks & open items (none block Codex static re-review)

  1. DDL authorization — net-new objects → governed create (patch_ops_code APR or registered migration DOT). Not authorized here. (carried to Owner)
  2. Điều 33 classification — recommended PG-native technical index; governed-entity path fully specified. NEEDS_OWNER_DECISION at the build gate only.
  3. AMBIGUOUS_LABEL / STALE_SOURCE / dot SOURCE_NOT_USABLE — implemented but data-inert today (0 multi-facet codes; pure views fresh; no retired DOTs). Proven by deterministic pre-checks, not fabricated.
  4. template:/io/checker/report — no clean PG SSOT → UNKNOWN_SOURCE; Owner confirms acceptable / supplies a source later.
  5. function name-only — overload warned, READY_WITH_WARNINGS non-authorizing; signature precision deferred to v0.3.
  6. Plan verificationEXPLAIN hot-path narrowness (test S6) is UNVERIFIED until the objects exist (build acceptance, not static review).
  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 + local repo)

design/pidx-build-design-v0.2.md
design/pidx-ddl-candidate-v0.2.sql.md
design/pidx-readiness-logic-v0.2.md
design/pidx-seed-slice-v0.2.md
design/pidx-test-plan-v0.2.md
design/pidx-codex-review-packet-v0.2.md
reports/pidx-build-design-patch-round1-2026-06-23.md
reports/pidx-build-design-go-no-go-v0.2.md   (this file)

v0.1 files are not deleted.


6. Bottom line

READY_FOR_CODEX_STATIC_REVIEW_V0_2. Every BLOCK/HIGH/MEDIUM Codex finding is patched in candidate SQL and logic, on a still-thin 2T2V pidx_* Procedure Index. The eye now parses strictly, distinguishes physical from logical, respects lifecycle, refuses to green a zero-required or unusable procedure, and aggregates warnings in PostgreSQL-safe form. Truth stays PG-computed; declarations stay hints; readiness can never be silently green. Next gate: Codex static re-review of v0.2 → then Owner-authorized governed DDL.