Skip to content

feat(roadmap): count attempts across retry layers in result lines #7077

Backlog

Description

@devops-cli-service

Split from #5500.

ProblemThe attempt field must count the attempts of one item across the model-client, unit and row retry layers. The result writer has no such counter. The existing attempt key is a count for FIX_CHECKS. A new attempt key collides with that count.### Why deferredNo counter spans the model-client, unit and row layers. The sweep layer of #4574 is not built. The change needs one source for the count. It also needs a rule for the existing FIX_CHECKS count.### Acceptance criteria- A first attempt writes attempt=1.- A second attempt of one item after one retry writes attempt=2.- One line holds one attempt key.- A test proves each criterion offline.

Proposed design

Problem statement

A roadmap result line does not count the attempts of its item. The attempt key holds only the count of the FIX_CHECKS repairs, and the model-client, unit and row retry layers share no counter. This change adds one counter to the job record of the item. Each result line writes it as attempt. The fix-checks count moves to fix_checks_attempt. No outside gate applies: the retry layers and the job record exist today.

Acceptance criteria

Requirement: First attempt

The result writer SHALL write attempt=1 in the result line of the first attempt of an item.

Scenario: First attempt of one item

  • WHEN a test writes the result line of the first attempt of an item
  • THEN the parsed line holds attempt equal to 1

Requirement: Second attempt

The result writer SHALL write attempt=2 in the result line of the second attempt of the same item after one retry.

Scenario: One retry of one item

  • WHEN a test increments the attempt counter once and writes the next result line of the same item
  • THEN the parsed line holds attempt equal to 2

Requirement: One counter across the retry layers

A retry at the model-client, unit or row layer SHALL increment the one attempt counter of the item by one.

Scenario: One retry at each layer

  • WHEN a test makes one retry at the model-client layer, then one at the unit layer, then one at the row layer, for one item
  • THEN the attempt counter of the item is 4 and the last result line holds attempt equal to 4

Requirement: One attempt key

A result line MUST hold exactly one attempt key.

Scenario: Fix-checks result line

  • WHEN a test writes the result line of a fix-checks attempt
  • THEN the raw line holds one "attempt" key and one "fix_checks_attempt" key

Requirement: Fix-checks count

The fix-checks count SHALL move to the key fix_checks_attempt with its value unchanged.

Scenario: Third repair of one check

  • WHEN a test writes the result line of the third repair attempt of one check
  • THEN the parsed line holds fix_checks_attempt equal to 3

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers the need: the count is the state of one item across the model-client, unit and row layers of this repository, and it goes into this repository's result line. The change builds one counter in the job record of the item and reads it in the result writer. The written cost is about 3,000 tokens to build, keep and fix that code, and less than one working day.

Key questions

  • Which module writes the JSON result line of a roadmap job?: src/devops_cli/roadmap/job_result.py writes it, and tests/roadmap/test_job_result.py tests it. [sources: src/devops_cli/roadmap/job_result.py, tests/roadmap/test_job_result.py]
  • Which single source holds the attempt count of one item across the three retry layers?: One counter of the item, held in the job record of the item and carried in the attempt context. The unit writes it at the start of an attempt and the result writer reads it. Each retry layer increments it once before the next attempt starts. (best practice) [sources: CONTEXT.md, docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md, tests/roadmap/test_roadmap_attempt_context.py, src/devops_cli/roadmap/job_result.py]
    • Chosen: One counter in the job record of the item, carried in the attempt context. A retry can start in another process, and the job record is the durable state of the item that each unit reads at its start.
    • Rejected: One field for each layer, summed by a reader. The body requires one attempt key, and a sum cannot tell the order of the retries.
    • Rejected: A count derived from the Loki lines after the attempt. The acceptance criteria require the line itself to hold the number.
  • Which key holds the count of the FIX_CHECKS repairs after the new attempt key takes the item count?: fix_checks_attempt. (best practice) [sources: src/devops_cli/github/repo_ref.py:71, src/devops_cli/roadmap/fix_checks_row.py:275, src/devops_cli/roadmap/job_result.py, tests/roadmap/test_roadmap_fix_checks_row.py]
    • Chosen: fix_checks_attempt. It names the row that owns the count, FIX_CHECKS, whose value is fix-checks, and it leaves one flat attempt key.
    • Rejected: check_attempt. check is the term for a CI check, so the key does not say that the fix-checks row owns the count.
    • Rejected: A nested fix_checks object with attempt. It changes the shape of every result line and breaks the flat queries of the existing lines.
  • Does the attempt count wait for the sweep of feat(roadmap): run the reconcile sweep on a cluster schedule #4574?: No. Until feat(roadmap): run the reconcile sweep on a cluster schedule #4574 merges, the poll of the Service runs the rows of the sweep, so the row retry exists today. The counter attaches to that retry. feat(roadmap): run the reconcile sweep on a cluster schedule #4574 changes where the row runs, not what counts as a retry. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/fix_checks_row.py]
    • Chosen: Build the counter on the layers that exist today. The model-client, unit and row retries exist, and the job record of the item holds the count across them.
    • Rejected: Wait for the sweep of feat(roadmap): run the reconcile sweep on a cluster schedule #4574. The sweep replaces where the rows run. It adds no retry layer that the count needs.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    on Nov 25, 2026
  2. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor
  3. added
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 25, 2026
  4. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions