Skip to content

fix(roadmap): the implement row logs why it leaves out a plan #5216

Not planned

Description

@dan-petty

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.judge runs _plan_reason before _pull_reason (src/devops_cli/roadmap/implement/implement.py:353-357). _plan_reason returns plan_check_read for a PlanReadError (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_out and its state from src/devops_cli/roadmap/stage/stage_left_out.py to src/devops_cli/roadmap/left_out_log.py. It gets a job argument (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. LeftOutKind stays in stage_left_out.py.
  • Add ImplementLeftOutKind beside _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) and other.
  • SubmitResult gets left_out, the kind and the reason of each item that the round left out. _run_implement_adapter (run.py:700-731) calls log_left_out with RoadmapJob.IMPLEMENT. The detail is masked with redact_text and 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_once passes: the line names the item and the plan_check_read reason, 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_again passes.
  • uv run pytest tests/roadmap/stage/test_roadmap_stage_job.py passes, and the stage line keeps its text.
  • uv run devops ci fail-to-pass --base origin/main shows that test_an_unreadable_plan_logs_its_reason_once and test_a_changed_reason_logs_again fail on the base and pass on the head. The stage job tests are guards that pass on both. The new tests import left_out_log inside 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 one implement 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/implement and uv run devops docs check pass.

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

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

#4521, #3393, #4963, #5032.

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_job passes and the captured log holds one stage left out: line and one implement 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_once passes and the captured log holds one implement 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_changes passes and each captured line starts with stage 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_once passes and the captured line holds item=#<n> and reason=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_again passes 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_bounded passes 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_kind passes 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_change passes and the selected item numbers equal the expected list, with the unreadable item in SubmitResult.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/main runs on the head.
  • THEN The command shows test_an_unreadable_plan_logs_its_reason_once and test_a_changed_reason_logs_again fail 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/implement and uv run devops docs check run.
  • 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_adapter logs a claimed item and new needs-fix items only. The reason of a left-out item appears in render_implement_plan for 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, _logged and reset_left_out_log to src/devops_cli/roadmap/left_out_log.py. The first argument is job: RoadmapJob. The state key is (job, repo, item). The line prefix is job.value, so the stage line keeps the text stage left out:. LeftOutKind stays in stage_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 ImplementLeftOutKind beside _Judge in implement.py, with one value for each reason source: branch, plan read, plan gates, git, pull request, stop, claim and other. Extend SubmitResult with left_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_adapter in run.py, with RoadmapJob.IMPLEMENT and SubmitResult.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 write none for 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.py for the shared key, and tests/roadmap/implement/test_roadmap_implement_left_log.py for the implement lines. The new tests import left_out_log inside the test body, so the module collects on the base and fails at the import. Run uv run devops ci fail-to-pass --base origin/main and 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.

Dependencies

#6521, #5215

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    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_out to a shared module and reuse it for the implement row, and it states that it adds no library.

    Tool: none found

    Lacks:

    • No third-party library was found that logs a left-out reason once per job, repository and item and again only when the kind changes
    • The work is a refactor of the project's own stage left-out logger plus new implement-side reason kinds, not a library adoption

    Searches run:

    • python structured logging library log a skip reason once per item per run, results: 5
    • python logging library deduplicate repeated log lines with a key and only log when a value changes, results: 5
    • structlog or loguru deduplicate log messages by key state change logging helper library, results: 5

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

  6. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    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.

  7. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    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.

  8. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    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.

  9. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    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.

  10. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    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.

  11. removed
    status/new
    on Nov 30, 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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions