Skip to content

pregate: a removed test named by a package.json script or Makefile runs that file's unrelated tests (same blind spot on main for edits) #3537

Open

Description

@capy-ai

Pregate lanes: when a removed test is named by a runner-config file, such as a package.json script or a Makefile target, pregate runs that file's own tests, for example a version or format test, instead of the script that names the test. Main has the same blind spot when that script is edited. Found by the GSTA-137 adversarial pass at f943239 (fixtures P1 and P1py).

#3534 makes a removed test run the tests of every remaining non-Markdown file that mentions its name (without the extension). When that file is package.json ("smoke": "node --test test/alpha.test.js") or a Makefile (python3 -m unittest tests.test_alpha), "its tests" are whatever tests exercise package.json or the Makefile. Those are usually version or format checks, not the smoke script. So the removal passes, and running the stale script (npm run smoke, make smoke) then fails. Main 6f27f0c refuses the removal with PREGATE_NO_LANE.

On main, editing that same script so it breaks also runs only package.json's own tests. So this is a general gap: pregate does not know that a runner-config entry invokes a test. It is not specific to removals.

Possible fixes:

  • Treat package.json scripts, Makefile targets and workflow run: steps that name a test as invoking it. Run that test when it exists; refuse a removed test such an entry names unless a dependencies entry covers it.
  • Or have pregate run any script or target that names a touched test.

Listed as a known limit in #3534.

Activity

  1. added
    S3
    on Oct 31, 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

    S3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions