Skip to content

fix(roadmap): check the item label before the implement row reports a Job #5551

Closed

Description

@dan-petty

Problem

The implement row of the Service reads the name of a runner Job from the record block in the body of an item (implement.job), and _report_ended (src/devops_cli/roadmap/implement/implement_submit.py) posts a comment with the log tail of that Job on the item. The record block is text of the issue, and the author of the issue can edit it. Intake gives a Priority to any open issue, so an issue of an outside account can become an Item.

An outside author can write implement.job in the record of their own issue with the name of the ended runner Job of another item. The next round of the row then posts the log tail of that Job on the issue of the outside author, and records a state on it. The row deletes no Job, so this is a disclosure of a log tail, not a stop of work.

The stage row had the same pattern, with a delete of a running Job. #4559 fixes it there: the row acts on a listed Job only when the item label of the Job, which the Service sets, names the item of the check-out.

Proposed fix

  • Before _report reads the log of a Job, check that a label of the Job that the Service sets names the item of the record (the runner Job has the repository label now; feat(roadmap): label Service Jobs by repository and item #4558 adds the item label). Skip the item, and write nothing, when the label names another item.
  • Test first: a record on item A that names the ended runner Job of item B posts no comment on A and reads no log.

Acceptance criteria

  • A test: a record on one item that names the runner Job of another item makes no comment, reads no log and records no state.
  • The report of a Job whose label names its item does not change.

Source: #4559

Proposed design

Problem statement

The implement row trusts the implement.job text in an issue body. An outside author can point it at the ended runner Job of another item. The round then posts that Job's log tail on the author's issue. The fix checks the item label of the Job before the round reads the log or writes a comment or state.

Acceptance criteria

Requirement: Skip a Job of another item

The implement round SHALL check the Job item label against the recording item before it reads the log or writes a comment or state.

Scenario: Record names another item's Job

  • WHEN Item A records the name of an ended runner Job whose item label names item B
  • THEN The round posts no comment on A, reads no log of that Job and records no implement.job_state on A.

Requirement: Skip a Job with no item label

The implement round SHALL skip a runner Job that has no item label.

Scenario: Record names a Job with no item label

  • WHEN Item A records the name of an ended runner Job that has no item label
  • THEN The round posts no comment on A, reads no log of that Job and records no implement.job_state on A.

Requirement: Report a Job of the recording item

The implement round SHALL report an ended runner Job whose item label names the item that records it.

Scenario: Record names its own Job

  • WHEN Item A records the name of an ended runner Job whose item label names A
  • THEN The round posts the usual report comment on A and records implement.job_state on A.

Existing Tool Considered

No alternatives check has run. The Kubernetes API already provides Job labels and label selectors. No open, maintained tool or library covers an in-repo guard that checks a runner Job label against a roadmap item. The project builds the guard itself. Written cost: about 2,000 tokens to build, 500 tokens to keep and fix, and 0.5 day elapsed.

Key questions

  • Which label SHALL the guard use to tie a runner Job to an item?: The guard SHALL use the item label that feat(roadmap): label Service Jobs by repository and item #4558 adds. The repository label alone cannot tell item A from item B. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py]
  • Where SHALL the round make the label check?: The round SHALL check in _report_ended, after it finds the held Job and before it calls _report. The check then runs before the log read and all writes. A skipped Job is not reported. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py:446, src/devops_cli/roadmap/implement/implement_submit.py:315, src/devops_cli/roadmap/implement/implement_submit.py:297]
    • Chosen: In _report_ended before _report. The guard runs before the log read and the comment. The skipped Job is not added to the reported tuple.
    • Rejected: In _report before _log_of. It protects the log read, but _report_ended still adds the skipped Job to its reported tuple.
  • What SHALL the round do when the recorded Job is gone from the cluster?: The round SHALL keep the current gone report. A gone Job has no log to disclose and no label to compare. The round writes the usual gone state. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py:315, src/devops_cli/roadmap/implement/implement_submit.py:446]
    • Chosen: Keep the gone report. The report holds no log, and a legitimate item whose Job is gone still gets a state.
    • Rejected: Skip every Job that is not held. It leaves a legitimate record unresolved, and the round repeats it every time.
  • What SHALL the round do when the recorded Job has no item label?: The round SHALL skip the Job and write nothing. A Job with no item label cannot show that it belongs to the recording item. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py:446, src/devops_cli/roadmap/implement/implement_submit.py:315]
    • Chosen: Skip the Job. The guard fails closed, and no log or state reaches the item.
    • Rejected: Fall back to the repository label. The repository label is on every Job of the repository, so it does not tie the Job to one item.
  • Which code path reads the log before the report?: _report calls _log_of before it writes the comment and the state. [sources: src/devops_cli/roadmap/implement/implement_submit.py:315, src/devops_cli/roadmap/implement/implement_submit.py:297]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4558

Activity

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

    @dan-petty
    OwnerAuthor
    • Priority: P1-High. An outside author can disclose another item's runner Job log tail, an active information-disclosure vulnerability.
    • Related: fix(roadmap): the implement row logs why it leaves out a plan #5216, which asks for a different change. Both target the implement row, but 5216 adds a skip-reason log while the candidate adds a label check to prevent cross-item log disclosure.
  4. added
    priority/p1-high
    on Nov 13, 2026
  5. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at ffce5d9 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.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/k8s/cluster_job.py.

  6. added
    owner/agent
    on Nov 14, 2026
  7. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  8. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 14, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 14, 2026
  10. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 23:18 UTC

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/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions