Skip to content

TDD 0073: requirements review gate (coverage scan, prd-lint, requirements-reviewer, overrides) - #200

Merged
cahenesy merged 6 commits into
masterfrom
build/20261012-165626/0073-requirements-review-gate
Oct 15, 2026
Merged

cahenesy merged 6 commits into
masterfrom
build/20261012-165626/0073-requirements-review-gate

Conversation

@cahenesy

Copy link
Copy Markdown
Owner

Implements TDD 0073: the requirements review gate for /prd-author (PRD FR-102–FR-105, FR-110; refs #195). Plugin 3.54.0 → 3.55.0.

Bottom of a sequential stack. 0074 (tdd-lint grounding) and 0075 (reviewer contracts) will be stacked on this branch.

What it adds

  • Interview coverage scan (FR-102). The interview covers nine categories, marking each initial/final Clear, Partial or Missing, ranked by impact × uncertainty. The result goes in a ## Coverage scan table in the PR body.
  • scripts/lib/prd-lint.sh + prd_lint.py (FR-103), built on 0070's requirement parser.
    • Delta: computed against the integration branch with git -C … ls-tree/show.
    • Rules: they apply only inside ## Requirements. placeholder fires only on new lines. acceptance.missing handles line breaks. id.duplicate and id.malformed require a digit after the hyphen, and the retired-marker form is accepted. override.rationale enforces 20–400 characters. vague.term reports as info.
    • Degrading: with no git, no commits, or an unparseable base, it reports instead of stopping. With no integration branch it falls back to HEAD. Every such case prints a degrade line, and only a real git failure is rc 2.
  • agents/requirements-reviewer.md (FR-104, FR-110).
    • Scope: it reviews only the delta, one requirement at a time, and also checks it as a set against the whole PRD.
    • Lenses: product owner, implementer, tester and stakeholder, plus rubric grading.
    • Output: findings in the shared R-n <severity> — docs/PRD.md:<line> — <finding> format, ### Non-findings with quotes, and REQUIREMENTS_REVIEW: PASS|BLOCK.
  • Overrides (FR-105). An override is written into Open questions as - "<finding>" — overridden: <rationale>. A fresh reviewer re-checks it on the next run, so a boilerplate rationale gets re-blocked.
  • /prd-author. The tl:prd-lint block, the review step (fresh mktemp, dispatched by prompt file, never reused on resume), the override loop, and the new PR-body sections.

Gates (run 20261012-165626)

Gate Result
test-first PASS
ci-checks PASS (prd-lint 42/0, requirements-review 60/0, ux-record 64/0; 17 suites, 0 failed)
runtime-verify PASS. All mechanical obs pass. This repo's PRD lints rc 0. tl_ux_ui_reqs is byte-identical before and after the parser refactor.
review PASS (security checklist): no shell injection, -I -B isolation, no parse failure reads as clean; all 10 declared deviations accepted

Reviewer behaviour (parent-dispatched fixtures, obs 10–12):

  • Ambiguous FR → BLOCK citing the line.
  • Clean FR → PASS, with a correctly formatted quoted non-finding.
  • Boilerplate override → rejected.
  • Specific override → accepted as overridden.

The first "clean" fixture was itself contradictory, and the reviewer correctly blocked it. That is recorded as a fixture defect.

Post-review fix (N1): when prd-lint.sh was sourced by a relative path, its cd into the linted repo made it run that repo's own scripts/lib/prd_lint.py. The script dir is now resolved absolutely. Test 7e2443b (the planted script must never run) went red, then fix 583eba5 made it green. Gates were re-recorded on the new HEAD.

Deviations (accepted)

  1. --degraded flag.
  2. tl_prd_delta sends degrade lines to stderr.
  3. Headings already empty on the base are never reported.
  4. The delta is scoped to ## Requirements.
  5. Placeholder tokens are case-sensitive.
  6. Digits inside requirement ids don't count as quantities.
  7. id.malformed checks every new line in ## Requirements.
  8. The retired marker must read **<ID>** *Retired….
  9. prd_lint.py is located by the script's own directory.
  10. The eval registration is in the feat commit.

Non-blocking residuals

  • Parse-error message wording (prd-lint: <msg>, not prd-lint: internal error: …).
  • A TBD line newly added under ## Open questions is flagged major. That conflicts with the "move it to Open questions" self-review advice and is a design follow-up.
  • A subdirectory TL_REPO is out of contract.
  • Indented requirement ids aren't parsed.
  • A few test gaps.
  • Temp files aren't cleaned up on a signal.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NpGG21Y2VGGhTQaFr4oshB

cahenesy and others added 6 commits October 12, 2026 13:02
Observations 1-9c and 13-19 of TDD 0073's Verification plan: the PRD
pre-pass driven in temp git repos, the tl:prd-lint block under env -i, the
requirements-reviewer contract and the /prd-author skill text. Red against
master: prd-lint.sh, prd_lint.py, the agent and the skill step do not exist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NpGG21Y2VGGhTQaFr4oshB
- ux_record.py: expose parse_requirements(); parse_prd is built on it and
  tl_ux_ui_reqs output is byte-identical (obs 9).
- prd_lint.py + prd-lint.sh: the mechanical PRD pre-pass (delta, check:
  placeholder, acceptance.missing, id.duplicate, id.malformed,
  override.rationale, info vague.term), scoped to ## Requirements, with
  line-level newness against the integration branch's PRD, the retired-id
  marker, and the documented degrade lines (FR-103, FR-105).
- agents/requirements-reviewer.md: the fixed reviewer prompt, R-n cited
  findings, override re-check, ### Non-findings, REQUIREMENTS_REVIEW verdict
  (FR-104, FR-105, FR-110, FR-87).
- skills/prd-author: coverage scan (FR-102), the tl:prd-lint block, fresh
  mktemp reviewer dispatch by prompt file, the override flow, and the
  ## Coverage scan / ## Requirements review commit-body sections.
- implement-gate: register the prd-lint and requirements-review evals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NpGG21Y2VGGhTQaFr4oshB
…s script)

A relative BASH_SOURCE dir plus the helpers' cd into the linted repo made
tl_prd_lint run <linted-repo>/scripts/lib/prd_lint.py when the library
was sourced by a relative path. Found in the 0073 build review (N1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NpGG21Y2VGGhTQaFr4oshB
@cahenesy
cahenesy merged commit 7469035 into master Oct 15, 2026
1 check passed
@cahenesy
cahenesy deleted the build/20261012-165626/0073-requirements-review-gate branch October 15, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant