v1.91.295.0 fix(pregate): deleting or renaming a test no longer fails lanes (#3534)

* fix(pregate): removed paths owe no lane instead of failing PREGATE_NO_LANE

A deleted file or a rename's old name that no remaining test selects now prints
'removed (no lane owed): <path> — <why>' in lanes: a deleted test runs its owning
suite or names the files that lost their last test; a modified file whose only
test was deleted still fails, and an unreadable deleted test fails closed.

Fixes: #3529
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(pregate): pre-landing review fixes for removed paths

A removal owes what an edit owes: manifests, lockfiles, config, fixtures,
goldens, workflows and files a config still names keep PREGATE_NO_LANE. A test
reading a fully deleted directory is selected again, a deleted Rust module
selects its crate's tests, a test renamed to a non-test path is accounted as
deleted, and the owning suite is the tests that directly exercise the same files.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(pregate): a removed file remaining code still imports fails closed

Pass-2 red-team: namedBy matched only full repo paths, so a deleted module
imported by a relative, extensionless or dotted specifier from untested code
was waived. removedPath now refuses when the import graph shows a remaining
dependent. Stale headers updated to say other removals owe what an edit owes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(pregate): removals the graph cannot see stay fail-closed

Step 11 adversarial and outside-voice findings: the waiver trusted SOURCE_EXT,
so Go, Ruby, shell, Rust and bin removals, files loaded by name and files a
nested config names relative to itself passed with no test; a rename's old
name skipped every check. Now every removed path is refused while a remaining
file imports it (directory references included); only JS, TS, Python and Dart
code is waived, never a file loaded by name; namedBy also matches paths
relative to each ancestor directory; Go and Ruby tests are refused; a rename's
old name goes through the same checks unless it is a test renamed to a test.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(pregate): basename mentions and Go/Ruby test renames fail closed

Fix-check 2 (cycle 4, rule 23 grant from GStack Minder): a deleted file a
tested loader reached by path.join(__dirname, 'lib', 'value.js') was waived,
and a Go helper test renamed into another directory got the test-rename
exemption. namedBy now greps the basename repo-wide (non-Markdown); the Go and
Ruby test refusal runs before the rename exemption.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(pregate): align removed-path prose with the waiver rules

Ship docs audit (gsta137-docs-1): name the snapshot, baseline and .gstack/
trees the waiver excludes, add usercustomize.py to the loaded-by-name list,
and give the unreadable-deleted-test explain line.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore: bump version and changelog (v1.91.292.0)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: a removed test runs the tests of files that still name it (pregate lanes)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: pregate waives only removed tests; other removals owe what an edit owes (D3 narrowed by the controller)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: a removed test is named by any whole-word mention of its name without the extension (pregate lanes)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: a removed test is named by any mention of its name without the extension (pregate lanes)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore: unstamp (VERSION back to 1.91.291.0, CHANGELOG entry under [Unreleased]); the slot call stamps

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: CHANGELOG [Unreleased] entry passes the prose-lint gate

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* v1.91.295.0 fix(pregate): deleting or renaming a test no longer fails lanes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-10-28 15:15:38 +00:00
1 parent 4b8c03bea9
commit 61e201ec08
10 files changed
+543 -24

No files matched your search

+24
View File
@@ -195,6 +195,30 @@ Two stages with separate clocks, both printed:
no lane, and a workspace-only Cargo.toml or Cargo.lock needs a `dependencies` entry),
transitively through
non-test files; deleted and renamed files select the tests that named them.
A removed test (a deleted one, or a rename's old name) that no remaining
test selects owes no lane, and prints `removed (no lane owed): <path> —
<why>` (the `lanes` detail adds `N removed path(s)`), when it is a JS, TS,
Python, Dart or bats test and no remaining file imports it (directly or
through a directory it reads; otherwise `still imported by …`). It runs
the tests of each remaining non-Markdown file that mentions its name
without the final extension anywhere (`alpha.test`, `test_alpha`:
a path with or without the extension, or a dotted module), such as a curation list (`files naming it run: …`), and fails closed when
such a file has no test (`still named by …, which no test covers`). A test
renamed to another test path then defers to its new name (`old name of
<new>`). A deleted test, or one renamed to a non-test path, also runs its
owning suite, the remaining tests that directly exercise the files its
merge-base text exercised (`owning suite runs: …`; test helpers and
fixtures are not subjects), and names each file left with no test at all
(`coverage removed: <file> has no remaining test`, and `M subject(s) lost
their last test` in the detail). Every other removal owes what an edit
owes, as before: a deleted or renamed Go or Ruby test (it may define
helpers its package still uses), a deleted test whose merge-base text
cannot be read (a symlink, invalid UTF-8, over 1 MiB), and any removed
non-test path, a renamed source file's old name included, are still
`PREGATE_NO_LANE` until a test or a `dependencies` entry covers them. A
modified file whose only test the branch deleted still has no lane, and a
remaining test that reads a deleted file or directory is selected. /review
lists a deleted test as a gate edit (RH-1) either way.
An extensionless JS/TS import (relative, a tsconfig/jsconfig `paths` alias or
`baseUrl`) tries the exact path, then `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`,
`.cjs`, `.mts`, `.cts`, then `index.ts`, `index.tsx`, `index.js`, `index.jsx`
+12
View File
@@ -3211,6 +3211,18 @@ versions, line endings or any non-version byte changed, one under a test,
fixture, golden, `.gstack/` or workflow tree, or one added, deleted, renamed
or re-moded, is still this error; `--explain` prints `not version-stamp-only (<reason>)`
for it.
A test the branch removed is usually not this error either: a deleted or
renamed JS, TS, Python, Dart or bats test that nothing remaining imports prints
`removed (no lane owed): <path> — <why>` instead. It runs the tests of files
that still name it, and a deleted test runs its owning suite or says
`coverage removed: <file> has no remaining test`. These are still this error:
a removed test that remaining code imports or that a file with no test still
names, a deleted or renamed Go or Ruby test, a deleted test whose merge-base
text cannot be read (a symlink, invalid UTF-8, over 1 MiB), any other removed
path (a renamed source file's old name included), and a modified file whose
only test the branch deleted. `--explain` prints the reason as `<path>:
removed, but …` (`<path>: removed test whose merge-base text could not be
read …` for an unreadable deleted test).
**Fix.** Add a test that names the file, or declare its lane (an explicit `[]`
for files with no behaviour) under `dependencies` in `.gstack/pregate.json` (or the user-owned file the message names).