Skip to content

check-affected: a fresh worktree's first verify run fails on missing npm dependencies #9122

Closed

Description

@kyle-sexton

Problem

In a freshly created worktree, the first scripts/check-affected.sh --tests run fails on missing npm dependencies rather than on the change. The failures are environmental:

  • check-read-caller-keys: the yaml package is not installed; run npm ci --prefix .github/standards/runner-policy
  • the structure check printed nothing; is .github/standards/runner-policy installed?
  • check-html-assets: htmlhint not found at <worktree>/node_modules/.bin/htmlhint (run npm ci)

On 2026-10-22 this happened in two new worktrees in a row. Each time, one full verify cycle was wasted before the cause was clear: npm ci at the root and under .github/standards/runner-policy, then a rerun.

Expected

check-affected.sh either installs what its selected suites need, or stops at the start with one line naming the exact npm ci commands to run, before spending minutes on suites that cannot pass.

Suggested fix

Have check-affected.sh check that node_modules exists at the root and under .github/standards/runner-policy before it runs suites that need them. If either is missing, either run npm ci itself under nice, or fail fast and name the commands.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 22, 2026
  2. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; a maintainer confirms or changes it.

    Understood: in a fresh worktree, scripts/check-affected.sh --tests fails on missing npm dependencies (root node_modules and .github/standards/runner-policy), which wastes a full verify cycle. You'd like it to either install what the selected suites need or stop up front with one line naming the npm ci commands. Nothing seems to be missing from the report. Related but not identical open issues: #8814 (check-affected --tests passes without running the selected Node suites), #8780 (CI passes when suites skip for missing dependencies) and #9051 (check-affected.sh can report 0 changed files). None of them looks like a duplicate.

    Automated triage. A maintainer reviews it.

  3. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 22, 2026
  4. kyle-sexton commented on Oct 22, 2026

    @kyle-sexton
    MemberAuthor

    Two more occurrences 2026-10-22: #9144 (htmlhint missing, root node_modules) and #9173 (runner-policy yaml missing; the rerun took about 21 minutes because the scripts/pipefail-grep-q-baseline.txt edit selected 154 suites). Both diffs were fine; each cost a full verify rerun.

  5. kyle-sexton commented on Oct 22, 2026

    @kyle-sexton
    MemberAuthor

    Hit again three times on 2026-10-22, each a fresh worktree's ready-flow verify failing until npm ci ran there: #9072 (htmlhint missing for check-html-assets), #9182 (Cannot find module 'yaml' under .github/standards/runner-policy, 7 suites), and #9107. Each cost a failed verify plus a manual install in the agent's run.

  6. kyle-sexton commented on Oct 24, 2026

    @kyle-sexton
    MemberAuthor

    Hit again 2026-10-24 on #9661's fresh worktree: scripts/check-script-contract.test.sh failed 2 cases with htmlhint not found ... (run npm ci), so check-affected.sh --tests recorded fail; after npm ci the same head passed (12 passed, 2 skipped). Third occurrence across the git-hooks unify sessions.

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

    priority: mediumReal value, no hard deadline; normal backlog flow.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions