Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-11-15
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Design

## Decisions

- **Record the action left in `implement.left_action` in the marks of the stop.**: Only the stop knows the action left, because the default action of a class is not the action left, and `src/devops_cli/roadmap/implement/implement_run.py:1983:left = stop.action_left if stop.action_left is not None else left_action(klass, taken)` computes that value already.
- **Count the attempts of the stopped step as the `attempt` events of `implement.trace` whose step equals the recorded `implement.stopped`.**: The trace labels each event with the step that runs, `recorded_rows` of `src/devops_cli/roadmap/follow.py` groups them by that step, and the events of the last step survive the bound, so the record needs no second count key.
- **Print the class text that `implement.failure` holds, as it stands, and look up no table.**: The sample value `not_ticked` is no member of the failure classes, so a lookup would stop the report of an item that the job must still explain.
- **Treat a stop with no `implement.failure` and no `implement.left_action` as a stop whose record holds neither, and print that.**: A stop from an earlier runner image holds neither key, and naming a class or an action that the record does not hold would misstate the item.
- **Count no attempt when `implement.trace` cannot be decoded, and print the class and the action left anyway.**: A corrupt trace of one item must not stop the report or the whole inbox.
- **Put the class and the attempt count in `subject` and the action left in `clear` of `InboxLine`.**: `src/devops_cli/roadmap/inbox.py:def _render_line` prints the two fields, so the line keeps its shape and the tests of the line shape stay as they are.
- **Read the state of a stop in one new module, `src/devops_cli/roadmap/stop_state.py`.**: `src/devops_cli/roadmap/follow.py:def follow_command` is the same shape for the same two callers, so the class, the attempts and the action left are read once for the report and the inbox.
- **Clear `implement.left_action` on the retry path and in `_marks` of `src/devops_cli/roadmap/stop_clear.py`.**: Those two paths remove `implement.stopped` and `implement.failure`, so a value that names a stop that is gone cannot stay behind.
- **Print the state of a stop in the default report of `render_explanation`, not behind `--trace`.**: The trace holds a bound and drops its oldest events, and the default report is what a person reads for a stopped item.
- **Fill the stop state on the open path of `explain_item` only, and leave its early return for a closed item as it is.**: A closed item is no longer stopped, and its report keeps the refusal it prints today.
- **Seed the retry case with `implement.left_action` in the same `set_marks` call as the stop, so the case fails before the retry path clears the key.**: `tests/roadmap/implement/test_roadmap_implement_job.py:751:item, {ImplementRecordKey.STOPPED: "group 2", ImplementRecordKey.FAILURE: "types"}` seeds no such key, and an assertion on a key that the case never writes passes whether or not the retry clears it.
- **Build each repository of the request case with `GitHubFake` and its `files` and `seed_issue` body, and not with `seeded`.**: `tests/support/roadmap_github_store.py:109:def seeded(**issues: tuple[str, ...]) -> tuple[GitHubFake, GitHubRoadmapStore]:` takes labels only and writes `body="Text"`, so it can seed neither the labels file that `read_inbox` reads nor the record block that holds the stop.
- **Prove the request count of the inbox at the `gh` process edge over `GitHubFake`, with two repositories that differ only in the stop of their one blocked item.**: `tests/support/fakes/github_repository.py:287:self.calls.append(args)` records every request, so a read that the new line sends for a stop makes the two request lists differ.
- **Seed each issue of the request case with `priority/p2-medium` beside `status/blocked`, and assert that each run holds one blocked line.**: `src/devops_cli/roadmap/stores/store.py:975:if item.priority is not None` keeps only an issue that holds a Priority, so an issue with `status/blocked` alone is no Item, neither run would hold a blocked line, and the case would compare two runs that prove nothing.
- **Name `tests/roadmap/test_roadmap_limit_classes.py` in the task of group 4 and read it there, beside the `CONST_ROADMAP_LABELS_PATH` that the request case seeds.**: That test declares the `CONST_ROADMAP_` prefix in its `REGISTRY_COUNTS` table, so the registry gate matches the constant that the case names and requires the declared path in a task; the plan adds no counted constant, and the group reads the test that covers the one it names.

## Rejected alternatives

- **Read the default action of the failure class at read time instead of recording it.**: `src/devops_cli/roadmap/failure.py:368:return FailureAction.WAIT if taken is default else default` shows that the default names an action the job took, not the action left.
- **Read the action left from the `attempt` event of the trace.**: `render_trace` of `src/devops_cli/roadmap/explain.py` prints the events of the trace within its bound, so an old stop would show no attempt event and no action.
- **Add a field for the class and the action to `InboxLine`.**: `src/devops_cli/roadmap/inbox.py:def _render_line` prints `subject` and `clear`, and each test that holds the shape of a line would change for no new information.
- **Show the state of a stop only under `explain --trace`.**: The issue states that the trace holds a limit and is no summary, and the default report of `src/devops_cli/roadmap/explain.py:def render_explanation` is what a person reads.
- **Name `ci_infra` for a stop whose record holds no class.**: `classify_failure` of `src/devops_cli/roadmap/failure.py` gives `ci_infra` to a failure that it reads, and a stop with no recorded class was never classified, so the line says that the record holds no class.
- **Prove that the inbox makes no new request with the static plan of `inbox_requests`.**: `tests/roadmap/test_roadmap_inbox_requests.py:50:reads, writes = inbox_requests(REPO)` builds the same plan from `src/devops_cli/roadmap/request_plan.py` whatever the inbox code does, so the case passes for a line that reads the item and cannot fail.
- **Prove the request count over the in-memory store of `tests/support/fakes/roadmap_store.py`, by comparing its reads.**: `tests/support/fakes/roadmap_store.py:646:def comments_on(self, number: int) -> list[IssueComment]:` appends nothing to its reads, so the comparison cannot fail for a read of a comment or a second listing.
- **Extend `seeded` of `tests/support/roadmap_github_store.py` with a files argument for the request case.**: `tests/support/roadmap_github_store.py:109:def seeded(**issues: tuple[str, ...]) -> tuple[GitHubFake, GitHubRoadmapStore]:` is shared by many test modules, and `tests/support/fakes/github_repository.py:63:files: dict[str, str | tuple[int, str]] | None = None,` lets the case seed the labels file directly, so no shared helper changes.
- **Assert that a retry clears `implement.left_action` without seeding the key in the retry case.**: `tests/roadmap/implement/test_roadmap_implement_job.py:751:item, {ImplementRecordKey.STOPPED: "group 2", ImplementRecordKey.FAILURE: "types"}` seeds no such key, so the assertion holds before and after the change.
- **Seed the request case with `status/blocked` alone and compare the requests of two runs.**: `src/devops_cli/roadmap/stores/store.py:975:if item.priority is not None` drops an issue with no Priority, so neither run would hold a blocked line and the two request lists would be equal whatever the new line does.
Loading