plan: Phase 0 design-lock for quality-gate structured-marker contract#226
Conversation
Phase 0 design-lock for issue #185 (Adopt structured marker contract for quality-gate). Implements Option A (HTML-comment JSON block). Locks 8 design decisions made during planning conversation: schema format, marker placement, verdict source, shadow-mode mechanism, cutover criterion, Phase 4 marker-missing handling, #183 disposition, plan-file location. Phases 1-4 are separate PRs; this one ships the plan only. References #222/#223 reproducer; PR #222's review body becomes Phase 2's regression fixture. Refs #185, #183, #223. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @cbeaulieu-gt's task in 2m 44s —— View job PR Review CompleteI've reviewed the Phase 0 design-lock plan for the quality-gate structured-marker contract. This is a well-structured design document with clear decisions and phasing. Below are my findings organized by severity. ✅ Strengths
🟡 Medium-Priority Concerns1. Schema validation specification missing (Phase 2)Location: Lines 226-234 (Phase 2 deliverable) The plan specifies what the marker parser should do but not how it validates the schema. Should explicitly specify:
Recommendation: Add a "Schema validation rules" subsection under "Marker schema (v1)" that specifies: 2. Cutover criterion tracking mechanism unclearLocation: Line 291-295 (Phase 3 cutover criterion) Phase 3 requires "≥20 reviews across ≥5 PRs" to be documented, but there's no aggregator script mentioned (unlike Phase 2-3 which has Recommendation: Add to Phase 2's deliverables: extend 3. Phase 1 manual validation is fragileLocation: Lines 208-209 (Phase 1 acceptance) "After merge, the next 5 PR reviews on this repo each contain the marker block (manual visual check)" assumes the persona will work correctly. If there's a turn-budget regression, reviews might silently omit the marker. Recommendation: Consider adding a Phase 1.5 validation script that greps recent bot comments for the marker sentinel and alerts if missing. This could run weekly and open an issue, similar to 4. Backward compatibility for future schema versions unspecifiedLocation: Lines 136-138 (Backward compatibility) The plan says "The gate MUST accept
Recommendation: Add a forward-compatibility rule to the schema section: 5. Phase 4 K=10 tracking has no automationLocation: Line 353 (Phase 4 acceptance) "K=10 consecutive marker-authoritative runs across ≥3 distinct PRs since Phase 3 cutover documented in PR body" has no tracking script mentioned. Recommendation: Reuse the 🔵 Low-Priority / Clarifications6. Turn reservation discipline is vagueLocation: Line 58 (locked decision #2) "Reserve final Recommendation: Change to "Reserve final 2-3 turns" or "Reserve at least 2 final turns" for clarity. 7. Verdict rule doesn't explicitly state the zero-findings caseLocation: Lines 125-130 (Verdict rule) The rule says Recommendation: Add an explicit example: 8. Multi-bot collision acknowledged but not mitigatedLocation: Lines 371-374 (Out of scope) The plan explicitly defers multi-bot scenarios. This is fine for Phase 0, but the gate currently fetches "most recent comment authored by github-actions[bot]" (line 238-249 of Recommendation: Add a note in "Out of scope" that if multi-bot support is needed in the future, the marker sentinel should include a bot-specific prefix (e.g., 9. PR #222 comment ID should be verifiedLocation: Line 142-143 (Regression fixture) The plan references "issue-comment id Recommendation: In Phase 2 PR, include a verification step that fetches this comment ID and confirms it contains the expected text ("Critical Issues Found 🚨"). 📋 Questions for Author (from PR body)The PR body asks for reviewer input on two questions: Q1: "Reviewer eye on whether the JSON schema matches what the persona will reasonably emit" ✅ Answer: The schema is minimal and reasonable. The persona should be able to emit this reliably. However:
Q2: "Reviewer eye on whether the cutover criterion (≥20/≥5/zero) is achievable given current PR cadence"
If the repo averages 5+ PRs per month with automated reviews, this is achievable in 1-2 months. If cadence is lower, it could take 3-6 months. Recommendation: Run a historical query to check how many PRs with automated reviews occurred in the last 3 months. ✅ Phase 0 Acceptance Criteria StatusChecking against the plan's own Phase 0 acceptance criteria (lines 161-164):
🎯 RecommendationAPPROVE with requested changes. The plan is sound and well-structured. Address the medium-priority concerns (especially #1 schema validation and #2 cutover tracking) before Phase 1 implementation. The low-priority items can be refined during Phase 1-2 implementation. 📝 SummaryThis is a high-quality design document that locks a concrete solution to the prose-regex fragility problem. The phasing is well-thought-out, and the fail-closed approach in Phase 4 is the right call. The main gaps are around schema validation specification and automated tracking for the cutover criteria. Once those are addressed in the plan or in Phase 1/2 implementation, this should be a smooth rollout. |
Summary
Phase 0 design-lock for issue #185 (Adopt structured marker contract for quality-gate). Ships the implementation plan only; no code changes. Phases 1-4 are separate PRs.
Refs #185, #183, #223. Closures land in Phase 4 (#185, #183, #223).
Background
Issue #223 is the concrete reproducer: PR #222's review used
### Critical Issues Found 🚨heading +**two critical inconsistencies**lowercase phrasing; the gate's prose-regex didn't match either pattern; gate postedsuccessdespite blocker findings. The strategic fix has been long-tracked as #185 (Option A: HTML-comment JSON), but no schema or rollout had been locked. This plan locks 8 design decisions and phases the implementation.Locked design decisions (full table in plan file)
claude-pr-review-summary-v1, requiredschemaVersion+findings.{critical,high,medium,low}blockingifcritical>0 OR high>0)claude-pr-review/quality-gate-shadow, advisorygh run rerundocs/superpowers/plans/2026-05-06-quality-gate-structured-marker.mdPhasing
Why Option A (HTML-comment JSON), not B or C
#185 originally proposed three options:
jq-parseable; survives Markdown rendering invisibly.anthropics/claude-code-actioncooperation; out of our control.Files
docs/superpowers/plans/2026-05-06-quality-gate-structured-marker.md(+406 lines, new file)Test plan
issue-185-quality-gate-structured-marker(notmain)closes #185,closes #183,closes #223gh apifailure #182 and multi-bot collisionOut of scope (carried forward in plan)
gh apifailure #182 (gate fails open on transientgh apifailure) — orthogonal failure modeanthropics/claude-code-action— Option A doesn't need it🤖 Generated by Claude Code on behalf of @cbeaulieu-gt