Skip to content

feat(roadmap): implement writes a typed result and hands off its log #4071

Open

Description

@dan-petty

Problem

Two faults in what a runner Job leaves for the next Job and for the Service.

  1. The Job does not tell the Service how its run ended.
    • _Ended (implement_run.py) has the values ready, stopped, yielded and returned. The Job does not write it.
    • The Service guesses from the item (_settles_as_stop in 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_failure from the text.
    • A stop that the runner wrote has its class on record (implement.failure). A Job that wrote nothing has only its log.
  2. 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.py and _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.result to ImplementRecordKey. 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 result yielded or returned is 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 in implement.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.

  • _start reads implement.check_log and implement.conflict before it clears them (target.retry).
  • It gives both to the first step of the run. Use a new input of run_step and a new section in the prompt roadmap_implement_step.md.
  • stop_clear.py clears 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 writes implement.result at the end of each run. The Service reads it. A Job with result yielded makes 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 - every ImplementRecordKey member 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

  1. added
    type/featureNew user-facing functionality or capability addition
    scope/roadmapThe roadmap jobs: intake, refine, stage, implement and the Service that runs them
    status/newStatus New: the item is not ready yet
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Blocked by open issues and improves reliability without breaking existing behaviour.
    • Value: Medium. Reduces Service guessing and ensures the next Job receives the prior stop log, but a fallback path exists.
    • Effort: Medium. Touches runner, Service, stop_clear, tests, and docs across several files.
    • Related: feat(roadmap): implement keeps phase marks and the spend of a killed Job #4070, which asks for a different change. 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.
  3. added
    priority/p2-mediumStandard priority feature work and architectural improvements
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumEffort Mediumpriority/p2-mediumStandard priority feature work and architectural improvementsscope/roadmapThe roadmap jobs: intake, refine, stage, implement and the Service that runs themsource/agentFiled by an agentstatus/newStatus New: the item is not ready yettype/featureNew user-facing functionality or capability additionvalue/mediumValue Medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions