Skip to content

CI inference: planForPurpose picks a matrix instance whose test step is skipped and refuses TEST #184

Closed

Description

@FredApps

What happens

planForPurpose (src/ci-inference/jobs.ts) chooses the provider job for a purpose by fewest blocked operations, with ties going to workflow-then-job order. jobProvides counts a step whose if: evaluates FALSE for that instance, so a matrix instance that skips its only test step still "provides TEST". When it comes first, it gets chosen, and the plan is refused even though another instance runs the step and is fully executable.

Repro

A job with matrix: { os: [windows-latest, ubuntu-latest] }, steps npm ci and npx jest with if: matrix.os == 'ubuntu-latest', and a committed package-lock.json:

ci.yml#test-oswindows-latest  provides [INSTALL, TEST]  ops [install willExecute:true, test willExecute:false]
ci.yml#test-osubuntu-latest   provides [INSTALL, TEST]  ops [install willExecute:true, test willExecute:true]

planForPurpose(jobs, "TEST") on main (40aa308):
  jobId: ci.yml#test-oswindows-latest
  executable: false
  refusal: "no executable operation in this path causally provides TEST; ..."

Swap the matrix order to [ubuntu-latest, windows-latest] and the same workflow is planned executable from the ubuntu instance. The verdict depends on axis order alone.

Impact

A false refusal: TEST, and likewise any other purpose, is reported not executable for a common pattern, a step gated to one OS or Node version of a matrix. This fails closed, but it hides a path that is fully modelled and executable.

Failing test

tests/ci-inference/jobs.test.ts in the linked PR. Output on main:

✖ TEST is planned from the matrix instance that runs the test step, not one whose condition skips it
    actual: 'ci.yml#test-oswindows-latest',
    expected: 'ci.yml#test-osubuntu-latest',
✔ when every instance skips the test step, TEST is still refused

Activity

  1. added a commit that references this issue on Nov 18, 2026
    ff340f1
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions