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.
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.