Skip to content

tests-step-takes-its-own-leftover-work/1: A tests step over its own leftover tests is not judged as writing nothing - #995

Merged
bwmatson merged 3 commits into
mainfrom
spec/tests-step-takes-its-own-leftover-work/1
Nov 17, 2026
Merged

bwmatson merged 3 commits into
mainfrom
spec/tests-step-takes-its-own-leftover-work/1

Conversation

@bwmatson

Copy link
Copy Markdown
Owner

Start here

Already verified by the pipeline

  • Tests were committed first and seen to fail first.
  • unit-test result: passed
  • Review took 2 review rounds

Review tier: light — the planned estimate is light

Why

On 2026-11-17 the units restack-regenerates-generated-files/3 and report-views-usage-and-coverage/7 failed at their tests step with "the tests step wrote no test, twice: the tree is unchanged". For the first, the tests were in the tree: a docs test that an earlier run of the same step had written and left staged, and the pipeline resumed over it ("resuming over uncommitted work in 1 file(s)"). The agent reviewed the file, kept it as right and wrote nothing more. The tests step took a digest of

… The full reason is in openspec/changes/tests-step-takes-its-own-leftover-work/proposal.md.

What this pull request does

A tests step that was killed and then resumed over its own uncommitted test or document files now keeps that work, instead of being judged as having written nothing.

  • BuildPath.wrote_nothing treats a test or document file left over in the tree when the step resumed as written work. This holds even for a group that requires tests, so the step goes on to the stub checks and commits the file.
  • When only a source file is left over, the step still counts as having written nothing: it is asked once more, then stops with the wrote-nothing cause.
  • A new private helper, BuildPath._is_test, replaces three inline test-path lambdas: in the restack kinds, the outside-commits note and wrote_nothing.
  • New graph tests cover four leftover cases: a test file, a test file plus a source file, a document file, and a source file alone. They also check that a leftover test file kept unchanged becomes the group's test: commit.

Based on main, with nothing unmerged beneath it — ready to merge whenever the checks look right.

Unit tests-step-takes-its-own-leftover-work/1 of change tests-step-takes-its-own-leftover-work, task group(s) 1.
Spec: openspec/changes/tests-step-takes-its-own-leftover-work/ in the planning repo.

Assumptions

This unit assumes nothing unmerged: everything it builds on is already in main.

Verification

This is a unit-test unit: everything it needs is fakes, fixtures or throwaway containers, so GitHub Actions runs the whole of it. No e2e-test run was required.

How this was built

Tests were committed first and seen to fail before any implementation existed; the commit order is checked mechanically; lint, formatting and types pass at the tip.


Opened by the spec-driven pipeline. The build agent never merges. The pipeline merges only
a unit review classified auto and policy allowed; a person merges any other, after checking
the stack order above.

…ng nothing

The tests come first and fail until the implementation.

On 2026-11-17 the units `restack-regenerates-generated-files/3` and `report-views-usage-and-coverage/7` failed at their tests step with "the tests step wrote no test, twice: the tree is unchanged".

Unit: tests-step-takes-its-own-leftover-work/1
…ng nothing

With this in, the tests of the previous commit pass.

On 2026-11-17 the units `restack-regenerates-generated-files/3` and `report-views-usage-and-coverage/7` failed at their tests step with "the tests step wrote no test, twice: the tree is unchanged".

Unit: tests-step-takes-its-own-leftover-work/1
…g nothing (review round 1)

Unit: tests-step-takes-its-own-leftover-work/1
@bwmatson bwmatson added change-tests-step-takes-its-own-leftover-work The change this pull request belongs to checking In review, but its checks are still running review-light Review asks for a light look from a person labels Nov 17, 2026
@bwmatson
bwmatson merged commit 9cdc612 into main Nov 17, 2026
5 checks passed
@bwmatson bwmatson added settling Merged; waiting for its checks to complete and removed checking In review, but its checks are still running settling Merged; waiting for its checks to complete labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change-tests-step-takes-its-own-leftover-work The change this pull request belongs to review-light Review asks for a light look from a person

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant