Skip to content

fix(roadmap): a cached issue delays the closed-issue clear #7945

Backlog

Description

@dan-petty

Problem Description

The clear of the closed issues keeps the labels of a closed issue for up to about 1 hour when no delivery refreshed the cached issue. clear_closed_labels (src/devops_cli/roadmap/status_sync.py) reads the issue again with store.issue(number). That read gives the cached issue while the entry is younger than DEFAULT_BRAIN_ISSUE_MAX_AGE_SECONDS (3600 s). A stale entry says that the issue is open, so the function returns and removes no label.

The requirement "A closed issue holds no Status and no Owner label" of the spec roadmap-item-labels says that the row reads the issue again before it removes a label.

Reproduction Steps

All times are 2026-11-30, UTC, on release v0.259.0. The Service got no issues delivery in this time.

  1. fix(ci): pass the title scopes in the PR title caller infra#283 closed at 19:49:06. The rounds at 19:58, 20:04, 20:12 and 20:19 logged The clear of the closed issues of dan-petty/infra read 1 issue(s) and failed for 0 and removed no label. The Service removed status/in-review at 20:27:28 and owner/agent at 20:27:59.
  2. fix(ci): the tests of each Feature take more than 6 minutes devcontainer-features#44 closed at 19:49:21. The Service removed the two labels at 20:27:07 and 20:27:39.
  3. ci: replace the curl actionlint step with the shared lint vibes#334 closed at 20:08:50. The Service removed the two labels at 20:40:22 and 20:40:48.

The code on main holds the same read.

Expected vs Actual Behavior

Expected: the next round of the row implement removes each status/* label and each owner/* label of a closed issue.

Actual: the removal came 32 to 39 minutes after the close, and the log counted the issue as read with no failure in each earlier round.

Change

  • clear_closed_labels reads with fresh=True, as docs/CLUSTER.md asks of a caller that must see a change from outside the Service.
  • docs/adr/0042-issues-labels-and-body-records-hold-roadmap-state.md names the workflow .github/workflows/clear-status.yml as the remover. The repository holds no such file. Correct the sentence.

Acceptance criteria

  • A test holds a cached open issue and a closed issue on GitHub. One round removes the status/* and owner/* labels.
  • ADR 0042 names the Service as the remover.

Source

Source: dan-petty/devtools#147

Proposed design

Problem statement

The closed-issue clear uses a cached issue. A cache entry younger than 3600 s can say open after the close. Then the clear removes no label. The change reads the issue fresh and corrects ADR 0042.

Acceptance criteria

Requirement: Clear reads a closed issue fresh

The closed-issue clear SHALL read the issue with fresh=True before it removes a label.

Scenario: Cached issue is open and GitHub issue is closed

  • WHEN the store holds a cached open issue, the GitHub issue is closed, and one round of clear_closed_issues runs
  • THEN the test sees the read with fresh=True and no status/* or owner/* label remains on the issue.

Requirement: The clear removes both label families

The closed-issue clear MUST remove each status/* label and each owner/* label of a closed issue.

Scenario: Closed issue holds both label families

  • WHEN the cached issue says open, the fresh issue says closed, and the issue holds status/in-review and owner/agent
  • THEN the test sees one removal for each label and the issue holds no label from either family.

Requirement: ADR names the Service

ADR 0042 MUST name the roadmap Service as the remover of the labels of a closed issue.

Scenario: ADR 0042 text names the remover

  • WHEN the documentation test reads docs/adr/0042-issues-labels-and-body-records-hold-roadmap-state.md
  • THEN the test finds the Service as the remover and no reference to .github/workflows/clear-status.yml.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this fix. The fix changes one cached read and one ADR sentence. The written cost is about 1,000 tokens and 10 minutes, with no new component to keep.

Key questions

  • Should clear_closed_labels read the issue with fresh=True?: Yes. Read with fresh=True. The clear must see a close from outside the Service. (best practice) [sources: src/devops_cli/roadmap/status_sync.py:275, docs/CLUSTER.md, docs/adr/0042-issues-labels-and-body-records-hold-roadmap-state.md]
    • Chosen: Read with fresh=True. The cache can say open for 3600 s. A fresh read sees the close and removes the labels.
    • Rejected: Keep the cached read. The reproduction shows a 32 to 39 minute delay and no label removal.
  • Which component removes the status/* and owner/* labels of a closed issue?: The roadmap Service removes them through clear_closed_issues in status_sync.py. The repository holds no .github/workflows/clear-status.yml. [sources: src/devops_cli/roadmap/status_sync.py, docs/adr/0042-issues-labels-and-body-records-hold-roadmap-state.md]
  • Should ADR 0042 change from the workflow to the Service?: Yes. ADR 0042 must name the Service. No workflow file takes part. (best practice) [sources: docs/adr/0042-issues-labels-and-body-records-hold-roadmap-state.md, src/devops_cli/roadmap/status_sync.py]
    • Chosen: Name the Service. The code runs in the Service, and the named workflow does not exist.
    • Rejected: Keep the workflow name. .github/workflows/clear-status.yml is absent.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 30, 2026
  4. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    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/lowpriority/p2-mediumscope/roadmapsource/agentstatus/newtype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions