Skip to content

fix(roadmap): the jobs trust the items that the Service App opens #3502

Closed

Description

@dan-petty

Problem

The roadmap jobs treat an item from the Service App or from github-actions[bot] as text from an outsider. Refine writes no comment, so a part that refine split off itself stops with no signal. A person can run devops roadmap refine --item <n>, but stage and implement still leave the item out. So the harm is a silent wait.

Security point: this change widens the trust rule of #2478, and the repository is public. Refine gives the replies of any account to the model: _replies_for_model (refine.py:2048) has no filter on author_association. The model writes the split-offs. With this change, text from an outside reply can reach a Ready split-off with no person. The same path already exists for the parent item, and this change adds a hop. AGENTS.md rule 5 says that only the owner can lower a security threshold, so the owner decides at merge.

Expected

The 4 item readers trust an item whose author login equals service.github_app.bot_login. Other bots and outside accounts stay out, and the job says so on the issue one time. The rule of #2478 against text from an outside account stays. implement.py:198, which judges an implement: retry comment, does not change, so a bot gains no retry right. intake.py:264 does not change, because it also tests the source/agent label.

Acceptance criteria

  • A test for each of the 4 readers: an item by the configured App login is taken.
  • A test: an item by another bot or an outside account is not taken, and it gets one comment. A second round writes no second comment.
  • Item and IssueRecord hold the author login, and a test reads it from the store. They hold no login now (store.py:283, :334).
  • A test: a login that only resembles the App login is not trusted. With no App slug set, bot_login is None and no bot item is trusted.
  • A test: an implement: retry comment by the App login does not start a retry.
  • A test: refine reads only the replies of trusted authors, or a split-off keeps the trust of its parent only when each reply that refine read came from a trusted author.
  • SECURITY.md states the security reason.

Existing tool considered

Existing project code: GitHubAppConfig.bot_login (config/settings.py:854) already gives the exact login, and implement.py:233 already reads it. The GitHub user.login field gives the author. No new tool and no new setting.

Related

Related: #2478, #2475

Owner decision (2026-11-05)

The owner answered the question of refine: "bot filed work can proceed automatically, we just need an agentic judge step to verify/approve the issue and proposed solutions". So the trust rule includes the bot logins, and an owner decision covers the security point above. This section replaces "Other bots ... stay out" in Expected.

  • Who is trusted: an item whose author login is exactly service.github_app.bot_login or github-actions[bot]. Other bots and outside accounts stay out, under the rule of fix(roadmap): refine leaves an issue from an outside account waiting on a person, and neutralizes comment markers, bare links and cross-repository references #2478.
  • The judge: a bot-filed item goes to Ready only when a judge approves the issue and the proposal of refine. The judge is the existing verification pass of the stage job (src/devops_cli/roadmap/stage_verify.py, verify, task slot ai.tasks.verification). No new model and no new tool.
  • The verdict: an approval is recorded on the item. A refusal keeps the item New, and one comment gives each finding with its evidence. The judge looks again only after the body changes.
  • Other jobs: stage, implement and the alternatives check take a bot-filed item only with a recorded approval.
  • The judge is no security control: it is a model, so text in a reply can mislead it. The acceptance criterion that refine reads only the replies of trusted authors stays, for each bot-filed item.
  • Unchanged: a person still merges each pull request. A bot comment gives no implement: retry right.

Added acceptance criteria:

  • A test: a bot-filed New item with an approval goes to Ready, and with a refusal it stays New with one comment.
  • A test: a second round with an unchanged body makes no second judge call and no second comment.
  • A test: stage and implement leave out a bot-filed item that has no recorded approval.
  • A test: an item by the owner has no judge call, so its path does not change.
  • A test: a login that only resembles a trusted bot login is not trusted.

Measured at 2026-11-05T14:24Z: 38 of 154 New items wait on this rule, 27 from the Service App, all Split from #, and 11 from github-actions[bot], all hardening titles. None is P0 or P1.

Proposed design

Problem statement

The roadmap jobs treat an item that the Service App or github-actions[bot] opens as text from an outsider. Refine writes no comment, so a part that refine split off stops with no signal. The change trusts the two bot logins, writes one reason comment for every other author, and reads only trusted replies. A bot-filed item reaches Ready only when the verification pass of the stage job approves the issue and the proposal, and the approval holds the body hash.

Acceptance criteria

Requirement: Trusted bot logins

Each of the four item readers SHALL take an item whose author login equals service.github_app.bot_login or github-actions[bot].

Scenario: Each reader takes a bot-authored item

  • WHEN The refine, implement, stage and alternatives readers each evaluate an open item whose author login equals the configured App login or github-actions[bot].
  • THEN Each reader returns the item as taken.

Requirement: Lookalike login is rejected

The trust check SHALL compare the author login with exact equality and SHALL NOT trust a login that only resembles a trusted bot login.

Scenario: Prefix and superstring logins

  • WHEN An item author login is a prefix or a superstring of the configured App login or of github-actions[bot].
  • THEN Each reader leaves the item out.

Requirement: Unset App login trusts no App bot

The trust check SHALL trust no item by the App login when service.github_app.bot_login is unset.

Scenario: No App login configured

  • WHEN bot_login is None and an item author login is devops-cli-service[bot].
  • THEN The reader leaves the item out.

Requirement: Store carries the author login

Item and IssueRecord SHALL hold the author login, and the GitHub store SHALL read it from user.login.

Scenario: Store exposes the author login

  • WHEN The GitHub store reads an issue whose user.login is devops-cli-service[bot].
  • THEN The returned Item and IssueRecord both report that login.

Requirement: Outside author gets one comment

Each reader SHALL leave out an item by any other bot or outside account and SHALL write one reason comment with a stable marker.

Scenario: Outside author gets one comment

  • WHEN A reader evaluates an item by another bot or an outside account and the issue holds no comment with the marker.
  • THEN The reader leaves the item out and writes exactly one comment with the marker.

Requirement: Exclusion comment is written once

Each reader SHALL write no second exclusion comment when the marker is present.

Scenario: Second round writes no second comment

  • WHEN A reader evaluates the same outside-author item again and the issue holds the marker.
  • THEN The reader leaves the item out and writes no comment.

Requirement: Judge approves a bot-filed item

A bot-filed New item SHALL go to Ready only when the verification pass of the stage job approves the issue and the proposal.

Scenario: Approved bot item reaches Ready

  • WHEN Refine refines a New item whose author login is a trusted bot login and the verification pass returns no open finding.
  • THEN Refine records the approval with the body hash and sets the item Ready.

Requirement: Judge refusal keeps the item New

Refine SHALL keep a bot-filed item New and SHALL write one comment with each finding and its evidence when the verification pass refuses the item.

Scenario: Refused bot item stays New

  • WHEN Refine refines a bot-filed New item and the verification pass returns an open finding.
  • THEN The item stays New and the issue holds one comment that lists each finding with its quote.

Requirement: Judge runs once for each body

Refine SHALL make no second judge call and write no second refusal comment while the body is unchanged.

Scenario: Unchanged body makes no second call

  • WHEN Refine looks again at a refused bot-filed item whose body hash equals the recorded hash.
  • THEN Refine makes no judge call and writes no comment.

Requirement: Other jobs need a recorded approval

The stage job, the implement job and the alternatives check SHALL take a bot-filed item only when its job record holds an approval.

Scenario: No approval leaves the item out

  • WHEN A bot-filed item holds no approval record and each of the three jobs judges it.
  • THEN Each job leaves the item out with its reason.

Requirement: Approval is bound to the body

An approval SHALL hold the body hash that refine saw, and the jobs SHALL take no item whose body hash differs from the recorded one.

Scenario: Body edit after approval

  • WHEN A person edits the body of a bot-filed item after refine recorded an approval and the stage and implement jobs judge it before refine looks again.
  • THEN Both jobs leave the item out, and refine approves the new body before either job takes it.

Requirement: Owner item skips the judge

Refine SHALL make no judge call for an item that the owner, a member or a collaborator opens.

Scenario: Owner item has no judge call

  • WHEN Refine refines an item whose author association is OWNER.
  • THEN Refine makes no judge call and follows its current path.

Requirement: Bot login cannot retry implement

The implement: retry check SHALL NOT accept a comment by a trusted bot login.

Scenario: Bot retry comment is ignored

  • WHEN A stopped item holds an implement: retry comment by the configured App login.
  • THEN No retry starts.

Requirement: Refine reads only trusted replies

Refine SHALL give the model only replies whose author association is trusted or whose author login is a trusted bot login.

Scenario: Outside reply is filtered

  • WHEN An issue holds one trusted reply and one reply from an outside account.
  • THEN The model input holds the trusted reply and does not hold the outside reply.

Requirement: Security policy states the trust rule

SECURITY.md SHALL state why the two bot logins are trusted, why other bots and outside accounts are not, and that the judge is no security control.

Scenario: Security policy documents the rule

  • WHEN A person reads SECURITY.md.
  • THEN The policy names the two exact bot logins, the approval gate and the reply filter.

Existing Tool Considered

No alternatives check has run on this item. The need is a repository-specific trust rule, and no open tool or library covers it. The project already holds every part: GitHubAppConfig.bot_login in src/devops_cli/config/settings.py gives the exact App login, implement.py already reads it, and the verification pass of src/devops_cli/roadmap/stage_verify.py (task slot ai.tasks.verification) is the judge that the owner names. The change builds only the glue: a trust predicate, the author login on Item and IssueRecord, the one-time exclusion comment, and the approval record. That glue costs about 40,000 tokens to build, about 6,000 tokens for each later change to keep and fix, and about one day of elapsed time. It adds no new tool, no new setting and no new model.

Key questions

  • Which setting gives the exact login of the Service App bot?: GitHubAppConfig.bot_login reads service.github_app.bot_login, and the implement job already reads that login. [sources: src/devops_cli/config/settings.py, src/devops_cli/roadmap/implement.py]
  • Which readers apply the trusted-author rule today?: The refine, implement, stage and alternatives readers compare the author association with CONST_ROADMAP_TRUSTED_AUTHORS. [sources: src/devops_cli/config/constants.py, src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/implement.py, src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/alternatives.py]
  • Which GitHub API field gives the issue author login?: The issue object gives the author login in user.login, and the GitHub store is the one reader of it. [sources: src/devops_cli/roadmap/github_store.py]
  • Which store models hold the issue author today?: Item and IssueRecord hold no author login now, so the change adds the field to both. [sources: src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/github_store.py]
  • Which job and task slot hold the judge that the owner names?: The verification pass verify of the stage job, with the task slot ai.tasks.verification, judges the issue and the plan before the draft opens. [sources: src/devops_cli/roadmap/stage_verify.py, src/devops_cli/roadmap/stage.py]
  • Which workflow opens items as github-actions[bot]?: The Defect PR Hardening Audit workflow runs devops gh issues create with the runner token, so GitHub records github-actions[bot] as the author. [sources: .github/workflows/defect-pr-hardening-audit.yml]
  • Which retry path must stay closed to the bot logins?: The implement: retry check at implement.py:198 must not accept a comment by a trusted bot login. The intake reader at intake.py:264 stays as it is, because it also tests the source/agent label. [sources: src/devops_cli/roadmap/implement.py, src/devops_cli/roadmap/intake.py]
  • Which bot logins does the trust rule include?: The owner decided that "bot filed work can proceed automatically, we just need an agentic judge step to verify/approve the issue and proposed solutions". The rule trusts exactly service.github_app.bot_login and github-actions[bot]; other bots and outside accounts stay out, under the rule of fix(roadmap): refine leaves an issue from an outside account waiting on a person, and neutralizes comment markers, bare links and cross-repository references #2478. (best practice) [sources: AGENTS.md, SECURITY.md]
    • Chosen: The configured App login and github-actions[bot]. The owner decision names both logins, and each one is a project identity with the least privilege.
    • Rejected: The configured App login only. The owner decision also covers the hardening workflow items, which github-actions[bot] opens.
    • Rejected: Any author of type Bot. It trusts bots outside the control of the project.
  • Which job approves a bot-filed item, and where does the approval go?: The verification pass of the stage job approves the issue and the proposal. Refine records the approval in the job record of the item with the body hash, and the jobs read it there. (best practice) [sources: src/devops_cli/roadmap/stage_verify.py, src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/stage.py]
    • Chosen: The existing verification pass of the stage job. The owner names this pass, and it needs no new model and no new tool.
    • Rejected: A new judge model call. It adds a model and a cost that the owner decision does not ask for.
    • Rejected: A person reviews each bot-filed item. It stops the automatic progress that the owner decided.
  • How does a recorded approval stay valid after a body edit?: The review reply decides that the approval is keyed to the body hash. is_approved reads the recorded body hash with the approval, so a body edit after an approval leaves the item out of the stage and implement jobs until refine records a new approval. A test proves this. (best practice) [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/stage.py]
    • Chosen: Key the approval to the body hash. The reply asks for it, and refine already records the body hash of each item.
    • Rejected: Keep the approval until a person clears it. A stale approval reaches a ready pull request.
    • Rejected: Store the approval in the body block. A body write of refine erases it, and the block is no record.
  • How does a reader write one exclusion comment and no second?: Write a comment with a stable hidden marker, and search the existing comments for that marker before a write. (best practice) [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/store.py]
    • Chosen: A hidden marker in the comment. It is idempotent, needs no body write and works for an item that is not on the roadmap.
    • Rejected: A mark in the issue body job record. An outside item has no job record, and the body write is more invasive.
    • Rejected: A mark in process memory. A new round or another process writes a second comment.
  • Should Item and IssueRecord carry the author login?: Yes. Add the login to both models, and read it from user.login in the GitHub store. (best practice) [sources: src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/github_store.py]
    • Chosen: Add the field to both models. The readers already receive these models, so no extra GitHub request is needed.
    • Rejected: Fetch the author login in each reader. It adds requests and repeats the same parsing.
    • Rejected: Read the login from a comment or the body. It is indirect and can be wrong.
  • How does refine keep outside text from a trusted split-off?: Filter the replies before the model call to the trusted associations and the two trusted bot logins. (best practice) [sources: src/devops_cli/roadmap/refine.py, AGENTS.md, SECURITY.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

  3. added
    priority/p1-high
    on Nov 4, 2026
  4. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at e272a33 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Does the owner allow the trust rule to include the configured App login at merge? (a person decides)
  5. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    Review check for the pull request of this item (found by another session, not tested):

    is_approved reads only the RefineRecordKey.JUDGE value. Show with a test that a body edit after an approval does not let the stage job or the implement job take the item on the old approval before refine looks at the item again. If it does, fix it in the same pull request.

  6. added
    status/ready
    and removed
    status/new
    on Nov 5, 2026
  7. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 66a8a63 (see proposed design in issue body).

  8. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 5, 2026
  9. removed
    status/in-review
    on Nov 5, 2026
  10. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-05 19:48 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/mediumpriority/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