Skip to content

refactor(roadmap): one Status writer for every job - #5109

Merged
dan-petty merged 2 commits into
mainfrom
refactor/5018-status-writer
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
refactor/5018-status-writer

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Every job and command writes the Status label through write_status in status_sync.py. It derives the Status from the facts of its caller, writes the label only when it differs, and reads the issue again after the write, so a lost write fails with ROADMAP_STATUS_LOST. A dry run sends no request.

StatusFacts gets needs_refine (New), pull_ready (In Review) and pull_open (In Progress), so one rule names every Status. The 14 direct writes and the Status write of intake now call the writer. The store gets issue(number), so the read-back also works on a candidate with no Priority. The dry-run plans list the read-back. A structural test fails when another module writes a Status label.

Closes #5018

Change: openspec/changes/archive/2026-11-12-5018-one-status-writer-for-every-job/

Every job and command writes the Status label through write_status of
status_sync.py. It derives the Status from the facts of its caller,
writes the label only when it differs, and reads the issue again after
the write. A label that another writer changed in between raises
RoadmapStatusLostError (ROADMAP_STATUS_LOST). A dry run sends no request.

StatusFacts gets needs_refine (New), pull_ready (In Review) and
pull_open (In Progress). The store gets issue(number), so the read-back
also works on a candidate with no Priority. A structural test fails when
another module writes a Status label.
@dan-petty dan-petty added type/refactor Type refactor: a new structure, same behavior scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence for this pull request (base 310981773).

Tests (local, after the rebase)

  • uv run pytest tests/roadmap -k status_writer: the new tests pass. Before the change they cannot import write_status, StatusWrite or RoadmapStatusLostError.
  • uv run pytest tests/invariants/test_architectural_invariants.py -k status_writer: before the change of the callers, the structural test named 14 direct Status writes (implement_run.py 3, implement_submit.py 1, stop_clear.py 1, pull_status.py 1, refine.py 2, repair.py 1, return_item.py 1, stage.py 4). Now it passes, with the import-cycle tests.
  • uv run pytest tests/roadmap tests/commands/test_pr.py tests/commands/test_pr_dry_run.py -n 4: 7141 passed, 1 skipped, 1 failed. The failure is tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window: the lizard fact is skipped in this worktree. The test imports no module that this change touches.
  • The 46 test modules outside tests/roadmap that import a changed module, tests/invariants/test_architectural_invariants.py and tests/lang: 1405 passed.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree: all rows pass. uv run mypy on the 17 changed source files: no issues.

Premise check

Merge gate

The Service runs this code (the rows stage, stage_ready, implement, intake and refine). The pull request waits for the owner's "safe and vetted" call before a merge.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 14:55
@dan-petty
dan-petty merged commit 24cfedc into main Nov 12, 2026
24 checks passed
@dan-petty
dan-petty deleted the refactor/5018-status-writer branch November 12, 2026 15:08
@dan-petty

Copy link
Copy Markdown
Owner Author

The review finding on write_status (the equal path wrote marks and a body with no ADR 0002 guard) is confirmed: a test on main with InMemoryRoadmapStore wrote the marks and the body of an old read and raised no error. This pull request merged before the fix, so the fix is in #5116 for #5114.

dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
dan-petty added a commit that referenced this pull request Nov 12, 2026
When the label equals the derived Status, `write_status` writes only the
marks and the body of its caller with `set_marks`, which had no ADR 0002
guard. So refine, which calls a model for minutes between its read and
its write, wrote its marks, its body and its Ready comment for an item
whose Status another writer changed in that time. Before #5109,
`set_field` refused that write.

`set_marks` gets the keyword `unchanged`. The store compares that field
at its read before the write with the value that it read, as `set_field`
does, and raises `RoadmapItemChangedError` before any write.
`write_status` gives `unchanged=ItemField.STATUS` on the equal path.
That path still writes no label and records no Status, and the guard
sends no new request.

Both stores implement the guard, and the store contract test runs it on
both.

Closes #5114

Change:
`openspec/changes/archive/2026-11-12-5114-the-status-writer-guards-an-equal/`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/refactor Type refactor: a new structure, same behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(roadmap): one Status writer for every job

1 participant