Skip to content

ci(roadmap): run plan-check on each plan pull request of the Service #3103

Closed

Description

@dan-petty

Problem

A pull request that the roadmap Service opens can merge in minutes. The Service made 34 plan pull requests with defects out of 37 on 2026-11-01, and no CI job looks at a plan before it merges. The first design of this issue was a commit status service-vetted, set by the independent review and required by a ruleset. It cannot be built: no review workflow exists in this repository, the independent review runs outside it, and the token of the Service App has no statuses permission. A ruleset also selects on ref_name only, so it cannot select a Service pull request by branch or label.

Expected

The workflow .github/workflows/pr-title.yml has a job plan-check for a docs(openspec) plan pull request of the Service. The job needs semantic-title, uses always() so that a failed title still reaches it, holds the permissions checks, contents and pull-requests (all read), and runs devops roadmap plan-check. Its condition selects the author devops-cli-service[bot] and a title that starts with docs(openspec): plan #. Any other pull request skips the job and passes. The job is advisory: it shows the form problems of a plan and claims no review. It posts no service-vetted status.

Acceptance criteria

  • A test holds the needs, always(), the permissions, the condition and the steps of the job.
  • A test runs the condition for a plan of the Service, and for an implement, a person, another bot and a release pull request.
  • A test holds the login in the condition equal to the login of the Service App bot (devops-cli-service[bot], from the pull request API of a real plan pull request).
  • docs/roadmap/plan-check.md and docs/ROADMAP_WORKFLOW.md describe the job and say that it is advisory.

Existing Tool Considered

GitHub Actions and the existing command devops roadmap plan-check. They need no new tool. palantir/policy-bot could host a blocking gate, but it only consumes an approval and does not run the check. That gate is out of this scope.

Out of scope

Related

#2867 (where the independent review runs), #2877.

Alternatives check of 2026-11-05: partly.
Tool: palantir/policy-bot (https://github.com/palantir/policy-bot), Apache-2.0, last activity 2026-11-03, maintained.

Proposed design

Problem statement

A Service plan pull request can merge with defects and no check stops it. The service-vetted status poster in the original design cannot be built: no review workflow exists, the independent review runs outside the repository, and the Service App token is scoped to permissions that do not include statuses. This change adds an automated plan-check job for plan pull requests from devops-cli-service[bot] and defers the blocking gate to palantir/policy-bot.

Acceptance criteria

Existing Tool Considered

palantir/policy-bot (https://github.com/palantir/policy-bot), Apache-2.0, last activity 2026-11-03, maintained. It covers the blocking gate in part: it posts a status check on the pull request head commit that a repository ruleset can require, selects a pull request by label, author, title or changed files, resets the check to pending on a new push with invalidate_on_push, and runs as its own GitHub App. It lacks the independent review itself: it only consumes an approval review or comment from a configured user, team or organization, it does not run devops roadmap plan-check, and a person must write the policy file and add the check to the required checks of the ruleset. The plan-check job uses the existing devops roadmap plan-check command and the GitHub Actions check run, so it needs no new library. The original status poster would cost about 40k tokens and 2 hours to build; policy-bot removes that code.

Key questions

  • Who makes plan-check a required check?: A person, in practice the owner, changes the main ruleset. ADR 0014 records that only a person changes the ruleset. Make plan-check required after the plan reader false alarms are fixed; until then the job stays advisory. (a person decides) [sources: docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md:16, docs/ROADMAP_WORKFLOW.md:13]
  • Which open, maintained tool covers the blocking gate?: palantir/policy-bot (Apache-2.0, last activity 2026-11-03). It posts a required status check on the head commit, selects a pull request by author and title, resets on a push with invalidate_on_push, and runs as its own GitHub App. It lacks the review itself: it consumes an approval from a configured user or team, does not run plan-check, and a person must write the policy file and add the check to the ruleset. The web search gave no result, so the tool facts stay as the alternatives check recorded them. (proposed)
    • Chosen: palantir/policy-bot. It covers the status check, the selection and the reset on a push, and it runs as its own GitHub App.
    • Rejected: Build a status poster. The Service App token is scoped to permissions without statuses. The poster costs about 40k tokens and 2 hours.
    • Rejected: No tool. The need has a maintained tool. A hand-built poster costs more.

Open questions

  • Who makes plan-check a required check? (a person decides)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor

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

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P2-Medium. It prevents defective Service pull requests from merging but does not block the project or expose a security risk.
    • Value: Medium. It stops bad plans from merging and blocking later jobs, reducing rework for the team.
    • Effort: Low. The body estimates about 60 lines of status poster code, one test, and a ruleset change.
    • Related: feat(roadmap): Add a draft PR evaluator for issue and rules #2867, which asks for a different change. Both concern review of Service pull requests before they proceed, but 2867 delivers the evaluation decision while the candidate delivers the merge-blocking enforcement via a status check and ruleset.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  5. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    Evaluation of 2026-11-04. This design cannot work as written, and a plan check does not replace the independent review.

    What is wrong.

    • Step 1 names a review workflow that does not exist. .github/workflows holds ci, cleanup-devcontainer, clear-status, codeql, copilot-setup-steps, defect-pr-hardening-audit, fail-to-pass, pr-title and release. A search of the repository finds service-vetted only in the archived plan of fix(roadmap): the implement job watch reads commit statuses, which the App token may not read #2877, and in no code and no workflow. The review exists only on the agent side, outside the repository.
    • Step 2 cannot work. The GitHub documentation of repository rulesets describes conditions on ref_name only, so a ruleset cannot select a pull request by head branch or by label.
    • The stage plan of fix(roadmap): the implement job watch reads commit statuses, which the App token may not read #2877 already notes that the implement watch does not read a commit status, and that this item must post a check run if it must hold the Job (openspec/changes/archive/2026-11-03-2877-the-implement-job-watch-reads-commit/proposal.md:37).

    Keep this item for the independent review. The owner rule of 2026-11-01 asks for a review of each Service pull request, plan or implement. devops roadmap plan-check does not prove that. It builds no model client and it reports form. In the window 22 of 31 plan pull requests pass it with exit 0, and one of them, PR #3396, was later closed because its premise was false at the base. So no check named service-vetted can rest on it, and the safe-and-vetted call stays with a person.

    Add a first step with an honest name.

    1. A CI job plan-check runs devops roadmap plan-check on a plan pull request. It needs no model. It reports through the check run of the job.
    2. A job-level if: selects a Service plan pull request by author and title. A job that its condition skips reports Success (header of .github/workflows/fail-to-pass.yml), so other pull requests pass, also person and release pull requests. Confirm this on a test pull request first.
    3. A new push gets a new run, so no status poster is necessary.
    4. The job waits for Semantic PR title or runs after it, because _check_problems (src/devops_cli/roadmap/plan_check.py:186-220) reports a problem when that check is missing or has not passed.
    5. Implement pull requests stay outside this step. plan_check.py:160-165 returns a body problem when the body has no Plans #, so an implement pull request always fails.
    6. Only a person makes the job a required check (ADR 0014).

    Open points.

    • Add a ### Dependencies heading above the refine block with the number of the new issue fix(roadmap): the plan reader reports each bad plan with no crash, because plan-check gives false alarms today.
    • feat(roadmap): Add a draft PR evaluator for issue and rules #2867 marks ready and blocks no merge today, and it waits on its question about the cost per pull request. Decide with it where the independent review runs.
    • The refine block holds the stub x. Do not edit text inside the markers. A body edit starts a new refine round, and the cause of the stubs is unverified, so a new stub can follow.
  6. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

    • Who makes plan-check a required check? (a person decides)
  7. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    The premise of this item fails at origin/main. The item cannot be built as written.

    Evidence:

    • The directory .github/workflows holds nine files. None of them posts a review or a commit status.
    • The name service-vetted appears only in an archived proposal: openspec/changes/archive/2026-11-03-2877-the-implement-job-watch-reads-commit/proposal.md:37.
    • The independent review runs outside this repository. No check in this repository can read its verdict.
    • A workflow job uses GITHUB_TOKEN. The App token that the Service uses lacks the statuses scope (src/devops_cli/github/check_verdict.py:383-384). So the Service cannot post the status that the gate needs.

    The plan-check part of the refined design holds. The functions plan_check.py:186-217 and commands/roadmap.py:758 exist.

    A person must decide the next step. Either accept a narrower plan-check job, or name the gate that the independent review drives.

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

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: palantir/policy-bot (https://github.com/palantir/policy-bot)

    • License: Apache-2.0
    • Last activity: 2026-11-03
    • Maintained: yes

    Covers:

    • Posts a status check on the pull request head commit that a repository ruleset can require, so the merge stays blocked until the check passes
    • Rule predicates on labels, author, title and changed files let a rule select only the Service pull requests, which a ruleset condition on ref_name cannot do
    • The invalidate_on_push option makes a new commit reset the approval, so the check returns to pending when the head changes
    • Runs as its own GitHub App, so posting the status does not depend on the Service App token's statuses permission

    Lacks:

    • Does not perform the independent review; it only consumes an approval review or comment from a configured user, team or organization, and that review still runs outside the repository
    • No plan-check of the roadmap plan body or title, so the devops roadmap plan-check job and its Semantic PR title dependency remain a CI job
    • A person must still write the policy file and add the check to the required checks of the ruleset

    Searches run:

    • open source GitHub app posts status check that blocks merge until review approval policy bot
    • github ruleset required status check reset on new commit dismiss approval on push
    • policy-bot .policy.yml labels predicate disapprove on push new commits invalidate approval
    • palantir policy-bot rule "labels" predicate rule requires changes author

    Sources:

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

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

    @devops-cli-service
    Contributor

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

    • Who makes plan-check a required check? (a person decides)
  10. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

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

    • Who makes plan-check a required check? (a person decides)
  11. added
    owner/agent
    on Nov 6, 2026
  12. changed the title [-]feat(ci): a service-vetted status check blocks the merge of a Service pull request until the independent review passes[/-] [+]ci(roadmap): run plan-check on each plan pull request of the Service[/+] on Nov 6, 2026
  13. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards, under the owner's instruction of 2026-11-05.

    Question: Who makes plan-check a required check?

    Answer: A person. Only a person changes the repository settings, and the required checks of main are a ruleset setting. The rule is ADR 0014 (docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md, "Owner steps") and AGENTS.md ("Only a person ... changes secrets, repository settings and hosts").

    Recommendation: Make Plan Check a required check only after the plan reader gives no false alarm. Until then the job stays advisory. Keep this in mind: the check is a form check, so its pass does not mean that a plan is vetted. 22 of 31 plan pull requests passed it in one window, and one was later closed because its premise was false.

    Scope change. The gate service-vetted cannot be built here, because the independent review runs outside this repository and the Service App token has no statuses permission. So I re-scoped the issue (title and body) to the advisory job plan-check in .github/workflows/pr-title.yml. It needs semantic-title, uses always(), holds checks, contents and pull-requests read, and runs devops roadmap plan-check. No service-vetted status is posted.

    Bot login. It is devops-cli-service[bot]. I read it from the pull request API of the real plan pull request #3261 (user type Bot), and a test holds it equal to the login that the settings give for the slug of the Service App.

    The branch is committed locally; the pull request follows after the full checks.

  14. added
    status/in-progress
    and removed
    status/new
    on Nov 6, 2026
  15. added
    status/in-review
    and removed
    status/in-progress
    on Nov 6, 2026
  16. removed
    status/in-review
    owner/agent
    on Nov 6, 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/lowpriority/p2-mediumscope/cisource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions