Skip to content

ci: check:pr's affected fast invariants miss runtime-build-selection when a runtime test hook is added #3967

Open

Description

@schlessera

Context

Two PRs in a row passed bun run check:pr --base origin/main locally, then failed hosted unit (1) on the same check: #3955 (the persona-settings-runtime test) and #3956 (the live-service-runtime test). Each added a packages/ui-react/tests/*-runtime.test.ts that calls runtimePackageBuild( but did not list it in runtimeTestBuilds in scripts/runtime-test-builds.ts.

The guard that caught it is the first test in tests/runtime-build-selection.test.ts. It counts the runtime-package hooks (expect(hooks).toHaveLength(22)) and requires them to equal Object.keys(runtimeBuildInventory) (runtimeBuildInventory, scripts/runtime-test-builds.ts:13).

The preflight's "affected fast invariants" check (scripts/check-pr.ts:30 and scripts/check-pr.ts:45) runs plan.tests, and for both PRs that list did not include tests/runtime-build-selection.test.ts. The guard reads every file in packages/ui-react/tests/, so a newly added hook is one of its inputs even though the test imports none of it. Each miss cost one hosted proof run and a lease cycle.

Out of scope

  • Changing what runtime-build-selection.test.ts asserts.
  • Generating the inventory automatically.
  • Other directory-scanning guards, apart from listing them (see Scope).

Scope

  • Make the affected-test planner select tests/runtime-build-selection.test.ts whenever a change adds, removes or renames a file under packages/ui-react/tests/ that contains runtimePackageBuild(, or touches scripts/runtime-test-builds.ts.
  • If other fast tests have the same blind spot, because they scan a directory instead of importing it, list them in the PR. File a follow-up for them, or cover them the same way.

Acceptance criteria

  • bun run check:pr --base origin/main --plan lists tests/runtime-build-selection.test.ts for a branch that only adds a new packages/ui-react/tests/x-runtime.test.ts calling runtimePackageBuild(.
  • A planner unit test asserts that selection, and fails before the change.
  • A branch that touches neither those files nor scripts/runtime-test-builds.ts does not newly select the test.

Verification

  • A planner unit test with a failing-first receipt.
  • One --plan run on a scratch branch.

Contract impact

None.

Activity

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ciCI workflows, the gates they run, release scripts, packaging.
    priority: p3Someday. Needs a driving use case before it starts.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 11, 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

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ciCI workflows, the gates they run, release scripts, packaging.priority: p3Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions