# AGENT-PROMPT-v5-P1-1b — Piece A attempt #2 test-plan gate: Miguel's approval

**Date:** 2026-08-06
**Follows:** `docs/AGENT-PROMPT-v5-P1-1b-o10-amendment-5.md` (the test-plan gate),
`docs/p1-1b-status.md` (the 20-item checklist→test mapping as corrected at commit `6d1e24a…`),
`docs/p1-1b-o10-independent-review.md` (Reject #1), `docs/PROJECT-STATE.md`
**Authority:** Miguel. This is the explicit gate decision amendment 5's ordered instruction 2
requires. It reopens no decision and changes no baseline: the five expected completeness
baselines remain 119 / 119 / 52 / 221 / **2,787**, the two pinned `Routine` rows still import
verbatim, and the immutable source pin remains `b91768513fc638381fbde91f0b576b08220a98f6`.

## Decision: **Approved**, with one named addition

The 20-item checklist→test mapping recorded in `docs/p1-1b-status.md` at commit `6d1e24a…` —
the 16 Reject #1 disposition rows in the review's own order plus A-R1…A-R4 — is **approved as
the binding attempt-#2 test plan**. The A-R1 gate shape is confirmed as intended: the four new
fail-closed validator tests across DOCEFL/DOCFLG × imported/native, the two new
failure-outcome check identifiers (`docefl.item-class.vocabulary`,
`docflg.snapshot-item-class.vocabulary`) joining the data-check list, the cross-independence
assertions between the two row classes, and the strengthened five-warning test proving honest
NULL remains an observation and that known values pass. The closed D8 vocabulary is confirmed
against the normative annex as exactly `Annotation`, `Decision`, `Status`.

### The two reported observations — decided

1. **"Both" versus four accepted `ImportEvidenceRow` unique constraints.** A-R4's word "both"
   is corrected on the record: it inherited the review's wording and undercounted. The accepted
   P1-1a DDL declares **four** UNIQUE constraints on `ImportEvidenceRow`, and the plan's
   resolution — asserting **all four** by exact name and `pg_get_constraintdef` text, plus every
   `pg_indexes` definition — is a strict superset of any reading and is **approved**.
2. **Store-type parity scope.** The six-column scope (`ENTMST.DirectDebit`,
   `ENTMST.TaxIdVerificationStatus`, `DOCEFL.ItemClass`, `DOCFLG.ItemClass`,
   `DOCFLG.ImportEvidenceRowId`, `DOCFLG.ImportTargetTable`) is confirmed as the intended
   reading of *"every column Piece A adds or alters"*. **Project-wide store-type parity is
   explicitly out of attempt #2's scope**; if ever wanted, it needs its own authorization and
   is not implied by this approval.

### One named addition, authorized here so it is in scope

Item 6's DOCFLG coverage nick is closed by name: the disposable test
`Piece_a_database_constraints_enforce_honest_history_and_prospective_completeness` (or a
companion assertion in the same disposable class) **additionally inserts all six governed
`ReviewPriority` literals as DOCFLG rows and proves the seventh literal `'Normal'` raises
`check_violation` at DOCFLG**, mirroring the existing DOCEFL half. This is a test-only
strengthening explicitly authorized by this approval; it changes no migration, model, or
validator content. With it, item 6's status wording may state the widened coverage — and, per
proof-pattern rule 1, must state exactly that and no more. No other addition beyond
A-R1…A-R4 and this named item is authorized; an apparent need for one remains a
stop-and-report.

## What is now authorized

Ordered instruction 3 of amendment 5: implement Piece A attempt #2 as a **remediation of
candidate `6f86023d…`** under the amendment-4 reformulated preflight, applying A-R1…A-R4
exactly plus the named DOCFLG strengthening above; full ordinary, focused, and disposable
suites green; build 0 warnings; 0 residual containers; the status evidence map keyed to the
20-item checklist item by item, with measured counts only; commit and push. Then ordered
instruction 4: the focused independent re-review (full adversarial depth on A-R1…A-R4 and the
named addition; regression confirmation that every Reject #1 Pass row still holds on the new
diff), verdict recorded. On Accept, stop and report — Piece B still needs its own go-ahead. On
Reject, neutralize per amendment 3, stop, and escalate to Miguel: attempt #2 is the second and
final attempt before escalation.

## What this approval does not authorize

Starting Piece B, C, or D. Any content change beyond A-R1…A-R4 and the single named DOCFLG
test strengthening. Resurrecting any part of the three named monolithic rejects. Any prototype
write or post-pin read. Reopening any closed decision or changing any baseline. Any
shared/live database write. Production go-live (O5 remains the only other open item). History
rewrite in either repository.

## Records instruction

Record this approval in `docs/p1-1b-status.md` and update `docs/PROJECT-STATE.md` **in the
same commit** (header, changelog; the amendment-5 rule that these records move together is in
force), track this file, push before implementation code — then proceed with instruction 3.
