Repository navigation
Description
Problem
Two faults in what a runner Job leaves for the next Job and for the Service.
- The Job does not tell the Service how its run ended.
_Ended(implement_run.py) has the valuesready,stopped,yieldedandreturned. The Job does not write it.- The Service guesses from the item (
_settles_as_stopin implement_submit.py). - A Job that leaves the item out (a claim by a person or an agent) exits 0.
- A Job that the kernel killed leaves the item In Progress. The Service then reads the log of the Job and picks a class with
classify_failurefrom the text. - A stop that the runner wrote has its class on record (
implement.failure). A Job that wrote nothing has only its log.
- The failed check log and the files of a conflict are written at a stop (
implement.check_log,implement.conflict). They are only cleared:stop_clear.pyand_start(target.retry) set them to None. The first step of the next Job never reads them. So it starts without the log that the stop recorded.
Some keys have no reader in code: implement.group, implement.sha and implement.wip. The spec roadmap-implement-job (line 231) keeps them as a record for a person to read.
Expected
This issue is blocked by #3677. #3677 is open and has no pull request. It changes _start and _groups. Start this issue after #3677 and after the issue #4070.
Typed result.
- Add the key
implement.resulttoImplementRecordKey. The values are those of_Ended:ready,stopped,yielded,returned. - The runner writes it as the last mark of each item run, in the marks write of the end.
- The Service reads it in
_report. A Job with the resultyieldedorreturnedis not a stop. - A Job with no result (killed, evicted or gone) uses the log and
classify_failure, as today. The class of a stop that the runner wrote stays inimplement.failure. - fix(roadmap): read the pod status to find an out-of-memory kill #3727 stays the owner of the pod exit status for the class
oom. This change reads the result only.
Hand-off.
_startreadsimplement.check_logandimplement.conflictbefore it clears them (target.retry).- It gives both to the first step of the run. Use a new input of
run_stepand a new section in the prompt roadmap_implement_step.md. stop_clear.pyclears the two keys only after the new Job writes its first mark.
Keys with no reader. Add a test that lists the members of ImplementRecordKey. For each member, the test names the function that reads it. Or it lists the member as "record for a person" with the name of the spec line that requires it. A new key with neither fails the test. Do not remove group, sha and wip.
Update docs/ROADMAP_WORKFLOW.md and the spec roadmap-implement-job for the new key.
Acceptance criteria
-
uv run pytest tests/roadmap/implement/test_roadmap_implement_typed_result.py -k typed_result- the runner writesimplement.resultat the end of each run. The Service reads it. A Job with resultyieldedmakes no stop. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_typed_result.py -k no_result- a Job with no result still gets a class from its log, as before. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_typed_result.py -k handoff- the first step of a retry gets the check log and the conflict files of the earlier stop. The keys are cleared only after the first mark of the new Job. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_record_readers.py- everyImplementRecordKeymember has a named reader or a named spec line. A test key with neither fails.
Every command above fails on the unchanged code. The pull request cites the fail-to-pass run (devops ci fail-to-pass --base <ref>).
Feasibility
I read these files at origin/main:
- implement_run.py:
_Ended,_implement_item,_start,stop. - implement_submit.py:
_settles_as_stop,_recorded_failure,_failure_of,_report. - stop_clear.py.
- stores/store.py:
ImplementRecordKey. - The spec roadmap-implement-job (lines 231 and 975).
I did not run the code.
I checked that #3677 is open and that no open pull request holds a branch for it.
An earlier plan wanted a typed StepName for the implement stop. That is dropped. implement.stopped holds the step label that stop_clear.py matches. A change there is a larger rewrite with no fault that needs it.
Existing tool considered
_Ended, implement.failure (#3065) and the record marks. No library is needed.
Cost
Build: about 80k tokens and 4 h (one key, one reader, one hand-off input, the test of keys). Keep: about 3k tokens per quarter. Fix: about 20k tokens and 1.5 h.
Related
Part of #3027. Blocked by #3677 (must merge first). #3727 (pod exit status for oom), #3105, #1535, #3997. Order: after the issue #4070.
Proposed design
Problem statement
The implement Job does not tell the Service how its run ended. The Service guesses the outcome from the item and from the text of the Job log. A run that a claim ended, or that a false premise returned, can then look like a stop. A retry also starts without the check log and the conflict files that its stop recorded. This change writes a typed result into the job record, reads it in the Service, and hands the recorded log and files to the first step of the new run.
Acceptance criteria
Requirement: The result is the last mark of a run
The runner SHALL write implement.result in the record write that ends each item run, with the value of _Ended.
Scenario: A yielded run writes its result
- WHEN A run ends because an agent or a person claimed the item
- THEN The job record holds
implement.resultequal toyielded.
Requirement: A new run clears the earlier result
The runner MUST clear implement.result in the first record write of a new run.
Scenario: A stale result does not survive the start
- WHEN A run starts on an item whose record holds
implement.resultequal toready - THEN The first record write of the run holds no
implement.result.
Requirement: The Service reads the typed result
The Service SHALL read implement.result in _report and SHALL make no stop for the values ready, yielded and returned.
Scenario: A yielded result makes no stop
- WHEN The record holds
implement.resultequal toyieldedand the item is In Progress - THEN
_reportrecords no stop for the item.
Requirement: A Job with no result uses its log
The Service MUST take the class of a Job with no implement.result from the tail of its log with classify_failure.
Scenario: A killed Job keeps the class of its log
- WHEN A Job ends with no
implement.resultand its log holds an out-of-memory line - THEN The Service records the class
oom.
Requirement: Hand-off of the recorded stop
_start SHALL read implement.check_log and implement.conflict before its record write and SHALL give both to the first step of the run.
Scenario: The first step of a retry reads the earlier stop
- WHEN An item with a recorded check log and recorded conflict files starts a new run
- THEN The first step receives both values in its input.
Requirement: Clear of the hand-off keys
The runner MUST clear implement.check_log and implement.conflict only in the first record write of the new run.
Scenario: The stop clear keeps the hand-off keys
- WHEN
stop_clear.pyclears the stop of an item - THEN The record still holds
implement.check_logandimplement.conflict.
Requirement: The prompt holds the hand-off section
The prompt roadmap_implement_step.md SHALL hold a section that states what the hand-off input contains.
Scenario: The prompt names the hand-off input
- WHEN A test reads the prompt of the step
- THEN The prompt holds the section for the check log and the conflict files.
Requirement: A reader for every record key
A test MUST name a reader or a requirement of the spec for every member of ImplementRecordKey.
Scenario: A new key with no reader fails the test
- WHEN The table of the test holds a key with no reader and no spec requirement
- THEN The test fails.
Requirement: The documents name the new key
docs/ROADMAP_WORKFLOW.md and the spec roadmap-implement-job SHALL name implement.result.
Scenario: The record-key table names the new key
- WHEN A test reads
docs/ROADMAP_WORKFLOW.mdand the specroadmap-implement-job - THEN Both name
implement.resultin the record keys of the implement job.
Existing Tool Considered
No alternatives check has run. No open library covers the need. The change extends the record marks and the stop path that the repository already holds, in src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/roadmap/implement/implement_submit.py and src/devops_cli/roadmap/stores/store.py. The written cost to build it is about 80k tokens and 4 hours. The cost to keep it is about 3k tokens per quarter. The cost to fix it is about 20k tokens and 1.5 hours.
Key questions
- Which record key holds the result of an item run, and which values does it take?: Add
implement.resulttoImplementRecordKey. It takes the four values of_Ended:ready,stopped,yieldedandreturned. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/roadmap/stores/store.py, docs/ROADMAP_WORKFLOW.md]- Chosen: A new key
implement.resultwith the_Endedvalues. The four values already exist in_Ended, and a new key holds them without a change of the stop path. - Rejected: A second value on
implement.stopped.implement.stoppedholds the step label that the stop path reads and thecontinuerule compares withjob, so a result value there breaks the clear. - Rejected: A boolean key
implement.finished. It loses the four values, so the Service cannot tell a yield from a return.
- Chosen: A new key
- In which record write does the runner write each of the four values?:
_readywritesready,stopwritesstopped,_return_to_newwritesreturned, andyield_towritesyieldedin a marks-only write. Each is the last record write of its run, and the marks-only write changes no field and no owner. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, openspec/specs/roadmap-implement-job/spec.md]- Chosen: One write site for each of the four values. Each value ends a different path.
yield_toand_return_to_newhave no record write of the end today, so the change adds one toyield_to. - Rejected: One write in
_implement_itemafter the run returns. The run raises for two of the four paths, so this option needs a second write path and a new return value.
- Chosen: One write site for each of the four values. Each value ends a different path.
- Does the runner clear
implement.resultwhen a run starts?: Yes. The first record write of a run clearsimplement.result. A killed Job then leaves no result, and the Service uses the log. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, openspec/changes/archive/2026-11-03-3032-a-trace-of-every-run-kept/proposal.md]- Chosen: Clear at the start and write at the end. It is the pattern of
implement.trace, and a killed Job cannot leave the result of an earlier run. - Rejected: Write at the end only. A killed Job then keeps the result of an earlier run, and the Service reads it as the result of this run.
- Chosen: Clear at the start and write at the end. It is the pattern of
- Which results make no stop for the Service?: The values
ready,yieldedandreturnedmake no stop. A record with no result, or withstopped, keeps the rule of the item. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Read the result first and keep
_settles_as_stopas the fallback. A Job that the kernel killed writes no result, so the item and the log are the only evidence left for it. - Rejected: Replace
_settles_as_stopwith the result alone. A killed Job writes no result, so the Service would never stop the item.
- Chosen: Read the result first and keep
- What does the Service do when a Job writes no result?: It reads the tail of the Job log and takes the class with
classify_failure. A class that the runner wrote stays inimplement.failure. fix(roadmap): read the pod status to find an out-of-memory kill #3727 owns the pod exit status. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Keep the log fallback. A killed or evicted Job writes no record, so its log is the only evidence.
- Rejected: Read the pod exit status now. It adds a Kubernetes read to the Service, and fix(roadmap): read the pod status to find an out-of-memory kill #3727 owns that work.
- How does the first step of a new run get the check log and the conflict files of the earlier stop?:
_startreads both keys before its record write. It passes both torun_stepas a new optional input. A new section ofroadmap_implement_step.mdstates what the input holds. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/ai/tasks/roadmap_implement_step.md]- Chosen: A new optional input of
run_step. The inputs of a step are fixed, and a new input is the path that the step already takes for its context. - Rejected: A file in the checkout. The step refuses a stray file at the root, and the file adds a path that the plan does not name.
- Rejected: A read of the issue in the step. The step writes nothing to GitHub and reads no issue.
- Chosen: A new optional input of
- When does a new run clear
implement.check_logandimplement.conflict?:stop_clear.pyleaves both keys. The first record write of the new run clears both, after_startread them. (best practice) [sources: src/devops_cli/roadmap/stop_clear.py, src/devops_cli/roadmap/implement/implement_run.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Clear both in the first record write of the new run. The first step reads the keys before the clear, so no run starts without the log that its stop recorded.
- Rejected: Clear both with the stop, as today. The new run then starts without the log, which is the fault of this item.
- Rejected: Clear both when the first group passes. A stop before that point loses the log again.
- How does the test keep a reader or a spec requirement for every member of
ImplementRecordKey?: The test holds one row for each member. A row names the function that reads it, or the requirement ofroadmap-implement-jobthat requires it as a record for a person. A new member with neither fails the test. (best practice) [sources: src/devops_cli/roadmap/stores/store.py, openspec/specs/roadmap-implement-job/spec.md]- Chosen: A table in the test, one row for each member. The table shows a missing reader at the row of the new member, and it names a spec requirement where no code reads the key.
- Rejected: A comment on each member of the enum. A comment is no test: nothing fails when a new member has no reader.
- Rejected: Remove the members with no reader. The spec keeps them as a record for a person, and the body forbids their removal.
- Does this change add members to
StepNamefor the implement stop?: No.implement.stoppedkeeps the step label that the stop path reads and that thecontinuerule compares withjob.StepNamekeeps its two members,planandapply. (best practice) [sources: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/stop_clear.py, openspec/changes/archive/2026-11-08-4056-record-the-failure-class-and-step/design.md]- Chosen: Keep the step label as a string. A typed step changes the value that
stop_clear.pycompares withjob, and no fault in this item needs it. - Rejected: Add the implement steps to
StepName. It changes the stop path and the clear, which this item does not fix.
- Chosen: Keep the step label as a string. A typed step changes the value that
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.Blocked by open issues and improves reliability without breaking existing behaviour.Reduces Service guessing and ensures the next Job receives the prior stop log, but a fallback path exists.Touches runner, Service, stop_clear, tests, and docs across several files.Both modify the implement Job record and _start, but #4070 adds phase marks and spend tracking while the candidate adds the typed result key and log hand-off.devops-cli-service commentedon Nov 8, 2026
Refine cannot set this item to Ready at c8990be while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/implement/implement_run.py.devops-cli-service commentedon Nov 8, 2026
Refine cannot set this item to Ready at c20f73d while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/implement/implement_run.py.devops-cli-service commentedon Nov 9, 2026
Released in v0.99.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.99.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 10:07 UTC