Repository navigation
Description
Problem or Motivation
The implement job leaves out an item whose plan the reader or the gates refuse, and the Service logs no reason.
_Judge.judgeruns_plan_reasonbefore_pull_reason(src/devops_cli/roadmap/implement/implement.py:353-357)._plan_reasonreturnsplan_check_readfor aPlanReadError(implement.py:425-441).- The implement row logs only a claimed item and new needs-fix items (
src/devops_cli/roadmap/run.py:718-724). Only the CLI report shows the reason (render_implement_plan,implement.py:606-630). - On origin/main, 6 of the 24 active plans fail the reader: 1327, 2162, 2526, 3060, 3230 and 3236. The job leaves them out with no log line. The tree test accepts each refusal (
tests/roadmap/test_roadmap_plan_read.py:308-325), so no check reports them. - A plan that a person merges with a defect of the reader is left out the same way on the Planned path (
implement.py:399).
Proposed Solution & Architectural Design
- Move
log_left_outand its state fromsrc/devops_cli/roadmap/stage/stage_left_out.pytosrc/devops_cli/roadmap/left_out_log.py. It gets ajobargument (RoadmapJob) and keys the last kind by job, repository and item. The line is<job> left out: repo=<owner/repo> item=#<n> reason=<kind> detail=<text>, so the stage line does not change.LeftOutKindstays instage_left_out.py. - Add
ImplementLeftOutKindbeside_Judge, with one value for each source of a reason (the branch, the plan read, the plan gates, git, the pull request, a stop, a claim) andother. SubmitResultgetsleft_out, the kind and the reason of each item that the round left out._run_implement_adapter(run.py:700-731) callslog_left_outwithRoadmapJob.IMPLEMENT. The detail is masked withredact_textand cut to 300 characters.- The line repeats only when the kind of the item changes, as in the stage job (fix(roadmap): stage metric and log give no left-out reason #4521).
- The change does not change which items the judge selects.
Target Subsystem
Roadmap: the implement row of the Service (src/devops_cli/roadmap/run.py, src/devops_cli/roadmap/implement/).
Existing Tool Considered
The log of the stage job (stage_left_out.log_left_out, #4521) already does this. The fix moves it to one shared module and adds no library. Cost to build (estimate): 0.3 M tokens and 1.5 hours elapsed. Keep: none. Fix: about 0.1 M tokens.
Acceptance Criteria
-
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_an_unreadable_plan_logs_its_reason_oncepasses: the line names the item and theplan_check_readreason, and a second round with the same kind logs nothing. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_a_changed_reason_logs_againpasses. -
uv run pytest tests/roadmap/stage/test_roadmap_stage_job.pypasses, and the stage line keeps its text. -
uv run devops ci fail-to-pass --base origin/mainshows thattest_an_unreadable_plan_logs_its_reason_onceandtest_a_changed_reason_logs_againfail on the base and pass on the head. The stage job tests are guards that pass on both. The new tests importleft_out_loginside their bodies, so the module collects on the base. The PR cites the run. - After the merge, the Loki stream of the Service (namespace
devops) holds oneimplement left out:line for each item that the row left out in 24 hours, once for each kind. A PR comment lists them. -
uv run devops ci test tests/roadmap/implementanduv run devops docs checkpass.
Files
- src/devops_cli/roadmap/left_out_log.py (new)
- src/devops_cli/roadmap/stage/stage_left_out.py
- src/devops_cli/roadmap/stage/stage.py (the import and the call)
- src/devops_cli/roadmap/implement/implement.py
- src/devops_cli/roadmap/implement/implement_submit.py
- src/devops_cli/roadmap/run.py
- tests/conftest.py (the reset of the log state)
- tests/roadmap/implement/test_roadmap_implement_left_log.py (new)
- docs/roadmap/implement.md
- k8s/README.md (the item of the implement row)
Dependencies
-
chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
-
feat(roadmap): fix-plan asks if each finding still holds #5215
The stage job leaves this item out until that issue closes. The earlier PRs of this set change stage.py and k8s/README.md.
Related
Source: #5211
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches for a library that logs a reason once per key and for structured job-skip logging returned only unrelated MDN documentation pages; no open tool covers this project-specific left-out line and dedupe keyed by job, repository and item.
Lacks:
- Line format
implement left out: repo= item= reason= detail= - Deduplication per job, repository and item until the kind changes
- Implement-specific kinds such as plan_check_read and plan gates
- Masking and truncation of the detail to 300 characters
Proposed design
Problem statement
The implement row leaves out an item when its plan is unreadable or a gate refuses it. The Service writes no log line for that item, so a person cannot see why the row is idle. Only the CLI report shows the reason, and the Service runs no CLI report. The fix moves the stage left-out logger to a shared module and writes one implement left out: line for each item and kind.
Acceptance criteria
Requirement: Shared logger keys by job
The shared left-out logger SHALL keep the last logged kind for each job, repository and item.
Scenario: Two jobs leave one item out
- WHEN The stage row and the implement row log a reason for the same repository and item.
- THEN
uv run pytest tests/roadmap/test_roadmap_left_out_log.py::test_the_logger_keys_by_jobpasses and the captured log holds onestage left out:line and oneimplement left out:line.
Requirement: Repeated kind logs once
The shared left-out logger MUST log an item again only when its kind changes for the same job and repository.
Scenario: Two rounds report the same kind
- WHEN Two implement rounds leave one item out with the same kind.
- THEN
uv run pytest tests/roadmap/test_roadmap_left_out_log.py::test_a_repeated_kind_logs_oncepasses and the captured log holds oneimplement left out:line.
Requirement: Stage line keeps its text
The stage row SHALL write the stage left out: line with the same text after the logger moves.
Scenario: A stage round leaves an item out
- WHEN A stage round leaves an item out for a first kind and then for a second kind.
- THEN
uv run pytest tests/roadmap/stage/test_roadmap_stage_job.py::test_a_round_logs_the_reason_of_a_left_out_item_once_until_it_changespasses and each captured line starts withstage left out:.
Requirement: Unreadable plan logs its reason
The implement row SHALL log the kind plan_check_read with the item number and the detail when _plan_reason catches a PlanReadError.
Scenario: A plan fails the reader
- WHEN A Planned item's plan fails the reader in one round.
- THEN
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_an_unreadable_plan_logs_its_reason_oncepasses and the captured line holdsitem=#<n>andreason=plan_check_read.
Requirement: Changed kind logs again
The implement row MUST log an item again when its left-out kind changes between rounds.
Scenario: The kind changes between two rounds
- WHEN Two rounds leave one item out for two different kinds.
- THEN
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_a_changed_reason_logs_againpasses and the second captured line holds the new kind.
Requirement: Detail is masked and bounded
The implement left-out line SHALL mask the detail with redact_text and cut it to 300 characters.
Scenario: A plan error holds a token and a long text
- WHEN The reason of a left-out item holds a token and a text longer than 300 characters.
- THEN
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_the_detail_is_masked_and_boundedpasses and the captured line holds no token and a detail of at most 300 characters.
Requirement: Each reason source has a kind
ImplementLeftOutKind SHALL hold one value for each reason source: the branch, the plan read, the plan gates, git, the pull request, a stop, a claim and other.
Scenario: The enum is read
- WHEN A test reads the members of
ImplementLeftOutKind. - THEN
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_each_reason_source_has_a_kindpasses and the member values equal the expected set.
Requirement: Selection does not change
The change MUST NOT change which items the implement judge selects.
Scenario: A round leaves out an unreadable plan
- WHEN A round judges a set of items that holds one unreadable plan.
- THEN
uv run pytest tests/roadmap/implement/test_roadmap_implement_left_log.py::test_the_judge_selection_does_not_changepasses and the selected item numbers equal the expected list, with the unreadable item inSubmitResult.left_out.
Requirement: New tests fail on base and pass on head
The pull request MUST show that the two new implement log tests fail on origin/main and pass on its head.
Scenario: The fail-to-pass command runs
- WHEN
uv run devops ci fail-to-pass --base origin/mainruns on the head. - THEN The command shows
test_an_unreadable_plan_logs_its_reason_onceandtest_a_changed_reason_logs_againfail on the base and pass on the head.
Requirement: Roadmap tests and docs check pass
The change SHALL pass the roadmap implement tests and the documentation check.
Scenario: The local checks run
- WHEN
uv run devops ci test tests/roadmap/implementanduv run devops docs checkrun. - THEN Both commands exit 0.
Existing Tool Considered
The alternatives check of 2026-11-22 in the issue body records the verdict none and names no tool. Its Lacks: list holds the capabilities that no library covers. No open, maintained library covers this need. The change moves the project's own stage_left_out.log_left_out to src/devops_cli/roadmap/left_out_log.py and reuses it for the implement row. Cost to build: about 0.3 M tokens and 1.5 hours elapsed. Keep cost: none. Fix cost: about 0.1 M tokens.
Key questions
- What does the implement row log when it leaves an item out today?:
_run_implement_adapterlogs a claimed item and new needs-fix items only. The reason of a left-out item appears inrender_implement_planfor the CLI report, and the Service runs no CLI report. [sources: src/devops_cli/roadmap/run.py:718-724, src/devops_cli/roadmap/implement/implement.py:606-630] - Where does the shared left-out logger live, and how does it key its state?: Move
log_left_out,_loggedandreset_left_out_logtosrc/devops_cli/roadmap/left_out_log.py. The first argument isjob: RoadmapJob. The state key is(job, repo, item). The line prefix isjob.value, so the stage line keeps the textstage left out:.LeftOutKindstays instage_left_out.py. (best practice) [sources: src/devops_cli/roadmap/stage/stage_left_out.py, src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/job_result.py:61]- Chosen: Shared module. The stage and implement rows need the same deduplication and the same line format.
- Rejected: Import the logger from the stage module. It makes the implement row depend on a stage module and hides the shared contract.
- Rejected: Copy the logger into the implement package. It duplicates the state and the line format in two places.
- How does the implement row name the reason of a left-out item?: Add
ImplementLeftOutKindbeside_Judgeinimplement.py, with one value for each reason source: branch, plan read, plan gates, git, pull request, stop, claim andother. ExtendSubmitResultwithleft_out, a mapping from item number to the kind and the detail. (best practice) [sources: src/devops_cli/roadmap/implement/implement.py:353-357, src/devops_cli/roadmap/implement/implement.py:425-441, src/devops_cli/roadmap/implement/implement_submit.py:165]- Chosen: New implement enum. The reasons are implement-specific and the stage enum holds stage-specific values.
- Rejected: Reuse
LeftOutKind. It adds implement-only values to the stage metric label and mixes two jobs. - Rejected: Free-form reason strings. They give no stable value for deduplication or tests.
- Where does the implement row call the shared logger?: In
_run_implement_adapterinrun.py, withRoadmapJob.IMPLEMENTandSubmitResult.left_out. The judge keeps its selection and returns the reasons as data. (best practice) [sources: src/devops_cli/roadmap/run.py:700-731, src/devops_cli/roadmap/implement/implement.py:353-357, src/devops_cli/roadmap/implement/implement_submit.py:165]- Chosen: Log in the adapter. The adapter owns the Service row and already handles the result of the round.
- Rejected: Log inside
_Judge.judge. It puts a logging side effect in the judge and makes the tests harder. - Rejected: Log only in the CLI report. The Service does not run the CLI report.
- How does the line keep the detail safe and short?: Mask the detail with
redact_text, cut it to 300 characters and writenonefor an empty detail. The line format stays<job> left out: repo=<owner/repo> item=#<n> reason=<kind> detail=<text>. (best practice) [sources: src/devops_cli/roadmap/stage/stage_left_out.py, src/devops_cli/roadmap/run.py:718-724]- Chosen: Mask and cut the detail. It keeps the line useful and keeps a secret out of the log.
- Rejected: Write the raw detail. It can write a token or a path that the reader should not show.
- Rejected: Write no detail. It hides the plan error that a person needs to fix.
- Which tests prove the new lines and the fail-to-pass gate?: Add
tests/roadmap/test_roadmap_left_out_log.pyfor the shared key, andtests/roadmap/implement/test_roadmap_implement_left_log.pyfor the implement lines. The new tests importleft_out_loginside the test body, so the module collects on the base and fails at the import. Runuv run devops ci fail-to-pass --base origin/mainand cite the run in the pull request. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_job.py, tests/roadmap/test_roadmap_plan_read.py:308-325, src/devops_cli/roadmap/stage/stage_left_out.py]- Chosen: New focused tests and a fail-to-pass run. They prove the new line and the deduplication on the real base.
- Rejected: Only the existing stage tests. They do not cover the implement row.
- Rejected: Only the CLI report. The Service log is the missing behavior.
- Does the post-merge Loki check stay in this item?: No. Defer it to a new issue. The check needs the merged change, a deployed Service, live traffic and 24 hours of Loki history. The pull request proves the line with captured-log tests. (best practice) [sources: src/devops_cli/roadmap/run.py:700-731, src/devops_cli/roadmap/stage/stage_left_out.py]
- Chosen: Defer the Loki check to a new issue. A pull request cannot prove a line that only a deployed Service writes.
- Rejected: Keep the Loki check in this item. It has no pre-merge proof and would hold the item.
- Rejected: Drop the Loki check. The live behavior still needs a check after the merge.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both add a left-out log line with a reason; #4521 covers the stage job, this covers the implement job.devops-cli-service commentedon Nov 16, 2026
Alternatives check: none
Reason: Three web searches for a logging library that logs a per-item reason once and only again when the reason changes returned only unrelated Docker Hub image pages, no relevant tool. The issue asks for an in-repository change: move the project's own
stage_left_out.log_left_outto a shared module and reuse it for the implement row, and it states that it adds no library.Tool: none found
Lacks:
Searches run:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 485e4cd 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.
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.