Skip to content

feat: project-level gate criteria overrides - #69

Merged
tonmoy007 merged 1 commit into
mainfrom
feat/project-gate-overrides
Sep 23, 2026
Merged

tonmoy007 merged 1 commit into
mainfrom
feat/project-gate-overrides

Conversation

@tonmoy007

Copy link
Copy Markdown
Owner

Summary

  • check-gate.py reads pipeline/gate-criteria.md from the project. A stage defined there replaces the plugin's criteria for that stage; other stages fall back to references/gate-criteria.md. Output adds criteria_source (and source per criterion).
  • Project script_returns_zero criteria resolve script in the project first, then the plugin — ship a project check, or reuse a plugin script with project argv. Missing script stays inconclusive + blocker (REQ-GATESTUB-001).
  • check_srs_acceptance.py: new --id-pattern, --acceptance-pattern, --row-scoped for SRSs with non-REQ-NNN IDs or table-row requirements. Defaults unchanged.
  • why.py honours the same override. _load_stage_criteria(plugin_dir, stage) keeps its plugin-only contract (used by the gate-criteria audit test).
  • Mirrored to forge-opencode/scripts/; references/gate-criteria.md and CHANGELOG updated.

Motivation

A project whose SRS is generated in its own layout (e.g. | **REQ-F-001** | … | Given … when … then … | rows) failed G1-002/G1-003/G1-004 with no way to adapt the gate short of /forge:force-advance on every advance. The default acceptance checker also splits blocks at every ID mention, which misfires on table layouts and cross-references.

Test plan

  • python3 -m pytest tests/ -q — 2042 passed
  • python3 scripts/validate-plugin.py — OK
  • Real project with override: Stage 1 gate 7/7, criteria_source: project; blanking one acceptance cell flags exactly that requirement

🤖 Generated with Claude Code

check-gate.py now reads pipeline/gate-criteria.md from the project when
present. A stage defined there replaces the plugin's criteria for that
stage; stages it omits fall back to references/gate-criteria.md. Output
reports criteria_source (and source per criterion). Project
script_returns_zero criteria resolve scripts in the project first, then
the plugin, so a project can ship its own check or reuse a plugin script
with its own argv. A missing script stays inconclusive and is promoted
to blocker (REQ-GATESTUB-001). why.py explains overridden criteria the
same way. _load_stage_criteria keeps its plugin-only contract.

check_srs_acceptance.py gains --id-pattern, --acceptance-pattern and
--row-scoped so SRSs with other ID schemes or requirements held in
markdown table rows can reuse G1-003. Defaults are unchanged.

Mirrored to forge-opencode/scripts. Tests cover override replace and
fallback, project/plugin script resolution, the inconclusive path, the
table-row mode, and why.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tonmoy007
tonmoy007 merged commit 7057489 into main Sep 23, 2026
3 checks passed
@tonmoy007
tonmoy007 deleted the feat/project-gate-overrides branch September 23, 2026 18:46
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