Skip to content

[quality] the CI supply-chain contract's scanners and retiring baselines are never exercised #1246

Description

@hivecommons-hive

Finding

tests/ci-supply-chain.test.mjs is the repository's workflow supply-chain
contract: SHA pinning, version comments, permissions:, persist-credentials,
timeout-minutes and runner-image pinning. It runs its scanners over
.github/workflows/** and asserts the offender list is empty.

Every workflow is currently compliant, and all three retiring baselines are
empty — KNOWN_PERSISTING_CHECKOUTS (line 174), KNOWN_UNBOUNDED_JOBS
(line 234) and KNOWN_FLOATING_RUNNERS (line 339) are each new Set([]).
Being compliant is the right outcome; the problem is what it leaves unexecuted.

The three "baseline retires itself" tests assert nothing. Each is a
for (const … of KNOWN_…) loop over an empty set, so its body never runs:

test lines iterations
the persist-credentials baseline retires itself 205-218 0
the timeout-minutes baseline retires itself 308-324 0
the runner pinning baseline retires itself 435-451 0

These are the guards that force an exception to be deleted in the same change
that fixes the workflow. They are the mechanism that stops a baseline from
becoming a permanent allowance, and not one line of that mechanism has ever
been executed. The first contributor to re-add an entry is the first person to
run this code.

The scanners' violation arms never run either. unpinned.push (61-62),
missing.push (81-82), unconstrained.push (96-99) and offenders.push
(192-193) are reached only by a non-compliant workflow, and there are none. A
scanner that stopped detecting — a continue that swallowed every step, a
regex that stopped matching, steps() returning [] — would leave this file
green while checking nothing, and no test in the repository would notice.

The pure predicates are not the gap: timeoutProblem, runnerLabels and
floatingRunnerProblem already have direct unit tests in this same file
(lines 277-290, 364-383, 385-400). The untested part is everything that walks
the workflow set and decides what counts as an offence.

Recommendation

Follow the shape this repository already uses for exactly this problem —
#1231 extracted docs-contract.test.mjs's readers into
tests/helpers-docs-links.mjs and pinned them from
tests/docs-link-helpers.test.mjs with inputs the real docs/ tree does not
supply.

  • Move the scanners and the three baseline guards from
    tests/ci-supply-chain.test.mjs into tests/helpers-ci-supply-chain.mjs,
    each returning its offender list instead of asserting inline.
  • Import them back into tests/ci-supply-chain.test.mjs so the contract
    over the real workflows is unchanged.
  • Add tests/ci-supply-chain-helpers.test.mjs driving each scanner over
    synthetic workflow documents that do offend, and each baseline guard
    over a non-empty baseline — covering both the "entry names a workflow
    that no longer exists" and the "entry is now compliant" arms.

Evidence and provenance

Priority

  • Impact: medium — a silently-broken supply-chain scanner is a green check over
    an unverified contract.
  • Effort: medium — mechanical extraction plus one new test file.

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 59ba83c

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Activity

  1. added
    qualityApproved by a Hive merger/owner for auto-merge on green CI
    testingApproved by a Hive merger/owner for auto-merge on green CI
    agent/qualityApproved by a Hive merger/owner for auto-merge on green CI
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 9, 2026
  2. added a commit that references this issue on Oct 10, 2026
    154f2c5
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/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions