Skip to content

fix(ci): Plan Check judges the pull request as the event saw it #3829

Closed

Description

@dan-petty

Problem Description

Plan Check can judge a delivery pull request as if it were a plan. The plan-check job of .github/workflows/pr-title.yml decides to run from the title in the event payload (startsWith(github.event.pull_request.title, 'docs(openspec): plan #')). The command devops roadmap plan-check then reads the live title and body. The implement job turns the plan draft into the delivery pull request with one edit of the title and body. A run that the event started before that edit reads the delivery form and fails.

Evidence: run 42259947563 (Plan Check, head 3bf7e41 of #3808, 2026-11-06 17:16) printed title: The title is not docs(openspec): plan #3808 <summary>. and body: The body needs the line Plans #3808, and it has none., and exited 1. The pull request was a delivery pull request (fix(review): ..., Closes #3536) at that time. The Service answered in #3808 with a change that made the command judge only pull requests with a plan title or a Plans # line. That change also let a plan pull request with a wrong title and no Plans # line pass, so a person removed it from the pull request.

Reproduction Steps

  1. The Service opens a plan draft. Plan Check starts on the event.
  2. The implement job edits the title and the body to the delivery form while the run is in progress or queued.
  3. The command reads the new title and fails.

Expected vs Actual Behavior

Expected: the job judges the pull request as the event described it, or it does not run once the pull request is no plan.

Actual: a red Plan Check on a delivery pull request, and a fix attempt that weakens the check.

Environment Diagnostics

devops-cli 0.70.0, GitHub Actions, 2026-11-06.

Proposed Solution & Architectural Design

  1. Give the workflow a concurrency group for the pull request with cancel-in-progress: true, so the event of the edit cancels the run that read the plan form. The later event skips the job through its if.
  2. If the cancel is not enough, pass the title of the event to the command with a --title option and judge that text. Do not add a content test that makes the command skip a pull request.
  3. Add a workflow test that checks the group key and cancel-in-progress.

Existing Tool Considered

GitHub Actions concurrency covers the need. No code of the command changes for option 1.

Proposed design

Problem statement

Plan Check can fail on a delivery pull request. A plan-check run starts from a plan title in the event payload. The implement job then edits the live title and body to the delivery form. The stale run reads them and fails.

Acceptance criteria

Requirement: Plan-check concurrency group

The plan-check job SHALL declare a concurrency group keyed to the pull request number and set cancel-in-progress to true.

Scenario: Workflow declares cancellation

  • WHEN the workflow contract test reads .github/workflows/pr-title.yml
  • THEN it finds the plan-check concurrency group with github.event.pull_request.number and cancel-in-progress: true.

Requirement: Event-title job condition

The plan-check job MUST decide to run only from the title in the event payload.

Scenario: Delivery event skips the job

  • WHEN the event payload title is not docs(openspec): plan #...
  • THEN the job condition is false and the job does not start.

Requirement: No content-test weakening

The plan-check command MUST NOT skip a pull request because its live title and body look like a delivery pull request.

Scenario: Malformed plan still fails

  • WHEN a plan pull request has a wrong title and no Plans # line
  • THEN the command reports the title and body problems and exits with a non-zero status.

Requirement: Workflow contract test

The workflow contract test SHALL fail when the plan-check concurrency group or cancel-in-progress is absent.

Scenario: Missing cancellation fails

  • WHEN the test reads a workflow with the plan-check job and no concurrency cancellation
  • THEN the test reports a failure.

Existing Tool Considered

No alternatives check has run. GitHub Actions concurrency with cancel-in-progress: true covers the need. It cancels the stale run when the same pull request gets the edit event. It lacks nothing for this fix, so no new command code is necessary.

Key questions

  • How does Plan Check stop a stale run after the implement job edits the pull request?: Use a job-level concurrency group ${{ github.workflow }}-${{ github.event.pull_request.number }} with cancel-in-progress: true. Keep the job condition on the event payload title. Do not add a --title option or a content test. (best practice) [sources: .github/workflows/pr-title.yml]
    • Chosen: GitHub Actions concurrency. Native workflow feature. It needs no command change and cancels the run that read the plan form.
    • Rejected: Pass the event title with --title. Adds a command option and a second title source for a race that concurrency removes.
    • Rejected: Add a content test in the command. The attempted fix let a malformed plan pass. It weakens the check.
  • Does the plan-check job condition read the title from the event payload?: Yes. The condition uses startsWith(github.event.pull_request.title, 'docs(openspec): plan #'). [sources: .github/workflows/pr-title.yml]
  • Which test file holds workflow contract checks?: tests/invariants/test_workflow_contracts.py holds workflow contract checks. [sources: tests/invariants/test_workflow_contracts.py]
  • Should devops roadmap plan-check accept a --title option for this fix?: No. The concurrency group cancels the stale run, so the command needs no second title source. (best practice) [sources: .github/workflows/pr-title.yml]
    • Chosen: Keep the command unchanged. The event cancellation removes the race, and the command keeps one live source.
    • Rejected: Add a --title option. It adds a parameter for a race that concurrency handles and creates a second title source.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P2-Medium. A false CI failure blocks a delivery pull request but does not corrupt data. The failed run 42259947563 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Value: Medium. It removes a recurring false failure that delays delivery pull requests.
    • Effort: Low. The fix is a concurrency block in one workflow file and an optional flag.
    • Related: ci(roadmap): run plan-check on each plan pull request of the Service #3103, which asks for a different change. Both concern the Plan Check CI job, but #3103 adds the job and the candidate fixes a race in it.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  5. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 734e060 (see proposed design in issue body).

  6. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  7. removed
    status/in-review
    on Nov 14, 2026
  8. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor
  9. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 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/p2-mediumscope/cisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions