Repository navigation
Description
What happened
A pull request that only adds a plan under openspec/changes/<issue>-<slug>/ runs the full test suite. The stage job opens one such pull request for each Ready P0 and P1 bug. On 2026-10-31 the three plan pull requests ran the job Tests & Coverage for 361 s (#2857), 371 s (#2858) and 297 s (#2859). They hold no source or test change. AGENTS.md rule 5 treats a check that averages more than 5 minutes as a P0 bug.
ci.yml already scopes work by what changed: the job Docs Site Build uses dorny/paths-filter, always runs, gates its steps and reports success; the image jobs skip when no image content changed.
A few tests read the change folders and must still run for a plan: tests/invariants/test_change_folders.py (names and forms), tests/invariants/test_committed_addresses.py (private addresses in committed files, which matters because a model writes the plan text), tests/invariants/test_pull_request_template.py and tests/invariants/test_architectural_invariants.py.
What should happen
In the job test of .github/workflows/ci.yml:
- A paths-filter step finds a plan-only pull request: every changed file is under
openspec/changes/and none is underopenspec/changes/archive/,openspec/specs/,openspec/config.yamlor.github/. - A plan-only pull request runs
tests/invariantsand nothing more of the test suite. Every other pull request, every push tomainand every schedule run the full suite as today. - The job keeps its name and reports success, so the required check
Tests & Coverageis met. The step for changed-line coverage passes when no Python line changed. - No escape: the filter is a path rule, not a label or a title rule. A pull request that implements an item archives its change folder with its code, so it runs everything.
- Do not extend the rule to
docs/**or the README. Tests read those files (the docs inventory, the AGENTS.md claims, links). That needs its own issue.
Evidence
- Check runs of docs(openspec): plan #2147 move three volumes off control-plane #2857, docs(openspec): plan #2735 refuse LESS in subprocess env guard #2858 and docs(openspec): plan #2739 refuse GH_TELEMETRY_ENDPOINT_URL #2859.
Docs Site Buildand the image jobs in.github/workflows/ci.ymlas the precedent.tests/invariants/as the set of tests that read change folders.
Acceptance criteria
- A test of
ci.yml(the existing workflow contract tests) fails when the filter is missing, or when a path outsideopenspec/changes/<new folder>/counts as plan-only. - A plan-only pull request shows
Tests & Coverageas success with a run time under 150 s (measured on the pull request). - A pull request that changes a source, test, spec or workflow file still runs the full suite.
- The CI section of CONTRIBUTING.md or docs/SDLC.md names the rule.
-
uv run devops cipasses.
Proposed design
Problem statement
A pull request that only adds a plan under openspec/changes/-/ runs the full test suite. The stage job opens one such pull request for each Ready P0 and P1 bug. On 2026-10-31 three plan pull requests ran Tests & Coverage for 361 s, 371 s, and 297 s. They hold no source or test change. AGENTS.md rule 5 treats a check that averages more than 5 minutes as a P0 bug. The test job in ci.yml needs a path-based filter that runs only tests/invariants for a plan-only pull request, and the full suite for every other pull request, push, and schedule run.
Acceptance criteria
Requirement: Plan-only detection
The test job SHALL detect a plan-only pull request when every changed file is under openspec/changes/ and none is under openspec/changes/archive/, openspec/specs/, openspec/config.yaml, or .github/.
Scenario: A pull request adds only a plan folder
- WHEN A pull request changes only files under
openspec/changes/-/ - THEN The detection step sets the output
plan_onlytotrue
Requirement: Invariants-only test run
A plan-only pull request SHALL run only the tests/invariants tests and report the job as success.
Scenario: A plan-only pull request runs invariants
- WHEN The detection step sets
plan_onlytotrue - THEN The test step runs
tests/invariantsand the job reports success
Requirement: Full suite for non-plan pull requests
A pull request that changes a source, test, spec, or workflow file SHALL run the full test suite.
Scenario: A pull request changes a source file
- WHEN A pull request changes a file under
src/ - THEN The test step runs
devops ci --check --no-cache --only test
Requirement: Workflow contract test
A test of ci.yml SHALL fail when the plan-only filter is missing or when a path outside openspec/changes// counts as plan-only.
Scenario: The filter is missing
- WHEN The
ci.ymltest job has no plan-only detection step - THEN The workflow contract test fails
Requirement: Documentation names the rule
The CI section of CONTRIBUTING.md or docs/SDLC.md SHALL name the plan-only test scoping rule.
Scenario: The documentation describes the rule
- WHEN A reader reads the CI section of CONTRIBUTING.md
- THEN The section states that a plan-only pull request runs only
tests/invariants
Requirement: Changed-line coverage passes for plan-only
The changed-line coverage step SHALL pass when no Python line changed.
Scenario: A plan-only pull request has no Python changes
- WHEN A plan-only pull request changes no
.pyfiles - THEN The changed-line coverage step exits with status 0
Existing Tool Considered
No alternatives check has run. The repo already uses the shell-based git diff --name-only path detection in the image jobs, changed-tests, and rule-pack jobs of .github/workflows/ci.yml. The dorny/paths-filter action (v4.0.3) is also a dependency. The change reuses the existing shell pattern; no new external tool is needed.
Key questions
- Which method detects a plan-only pull request?: The shell-based
git diff --name-onlypattern, already used in the image jobs,changed-tests, andrule-packjobs of the same workflow. (best practice) [sources: .github/workflows/ci.yml]- Chosen: shell
git diff --name-only. Already in the repo in four jobs. Handles the "all files must match and none match exclusions" logic naturally in a shell loop. - Rejected:
dorny/paths-filter. Its "any file matches" semantics do not express "all files must match and none match exclusions." It would need a second filter for the exclusions and a comparison of the two outputs.
- Chosen: shell
- What is the set of paths that makes a pull request plan-only?: Every changed file is under
openspec/changes/and none is underopenspec/changes/archive/,openspec/specs/,openspec/config.yaml, or.github/. [sources: openspec/config.yaml] - Which tests run for a plan-only pull request?: The
tests/invariantsdirectory:test_change_folders.py,test_committed_addresses.py,test_pull_request_template.py, andtest_architectural_invariants.py. [sources: tests/invariants/test_change_folders.py, tests/invariants/test_committed_addresses.py, tests/invariants/test_pull_request_template.py, tests/invariants/test_architectural_invariants.py] - How does the changed-line coverage step behave for a plan-only pull request?: The step runs as today. It passes because no Python line changed, so
diff-coverhas no changed lines to measure. (best practice) [sources: .github/workflows/ci.yml]- Chosen: Keep the step; it passes. No Python lines changed means
diff-coverhas nothing to measure and exits 0. No conditional branch needed. - Rejected: Skip the step for plan-only. Adds a conditional branch for no benefit. The step already passes.
- Chosen: Keep the step; it passes. No Python lines changed means
- Where does the documentation name the rule?: The CI section of CONTRIBUTING.md, section 3. (best practice) [sources: CONTRIBUTING.md]
- Chosen: CONTRIBUTING.md. It is the primary contributing guide and already describes the CI checks and the
devops cicommand. - Rejected: docs/SDLC.md. It is the enterprise SDLC framework. The rule is a CI detail, not a lifecycle phase.
- Chosen: CONTRIBUTING.md. It is the primary contributing guide and already describes the CI checks and the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 31, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
ciprefix of the title gives the type.test, and .github/labels.yml declares no scope/test label. Add the label to the file to give the scope to this item.AGENTS.md rule 5 classifies a check over 5 minutes as a P0 bug, and three runs exceeded that threshold.It saves CI minutes on plan-only pull requests but does not change user-facing behaviour.The filter logic has a precedent in the same workflow, but contract tests and the invariant-test subset need care.Both reduce unnecessary test execution in CI, but 2164 moves specific checks out of pytest while the candidate skips the full suite for plan-only PRs via a paths-filter.devops-cli-service commentedon Oct 31, 2026
Status set to Ready at 7ea2d5f (see proposed design in issue body).