Repository navigation
v1.91.295.0 fix(pregate): deleting or renaming a test no longer fails lanes - #3534
Merged
Merged
Conversation
…_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>
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>
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>
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-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>
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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…te lanes) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…it owes (D3 narrowed by the controller) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…thout the extension (pregate lanes) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…xtension (pregate lanes) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…released]); the slot call stamps 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>
…ate-removed-paths Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
… lanes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
13 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Deleting or renaming a test used to fail
laneswith PREGATE_NO_LANE. Now each removed path prints why it owes no lane, and the deleted test's owning suite runs.Before/after as text: Deleting or renaming a test used to fail lanes with PREGATE_NO_LANE; now each removed path prints why it owes no lane and the owning suite runs
Why
"Pregate: deleted test files get PREGATE_NO_LANE" (#3529). A cleanup PR that removed or renamed a test failed the gate, because the removed path had no lane of its own. Every such PR needed a hand-written
dependenciesentry. Now a renamed test runs under its new name, a deleted test runs the remaining tests of the files it exercised, and either one runs the tests of any file that still names it. Every other removal still fails closed, as on main.Scope (D3 changed by the Captain, not Garry)
Garry approved a plan that also waived removed non-test code. During the fix cycles, GStack Minder narrowed design decision D3 to removed tests only, deleted or renamed. This was the Captain's call, recorded as a D3 change by the Captain and not by Garry. Any other removed path, including a renamed source file's old name, keeps main's behavior and fails PREGATE_NO_LANE until a test or a
dependenciesentry covers it. Safe handling of those paths is #3535.Blast radius
Only
lanesingstack-pregatechanges, and only for removed tests that no remaining test already selects. Every other path takes the old route untouched. A removed test is waived only when all of these hold: it is a JS, TS, Python, Dart or bats test, no remaining file imports it, and every remaining non-Markdown file that contains its name without the final extension (a plain substring, soalpha.testortest_alpha) has a test, which then runs. Go and Ruby tests, unreadable deleted tests, and every removed non-test path are refused as on main. On gstack's 1514 test files, the substring match gives 3 tests new namers and adds 24 selections in total, with no newly refused removal.Approvals
Summary
Deleting or renaming a test file failed pregate even when the change could not break anything, so cleanup PRs had to add a
dependenciesentry to get through (#3529). Each waived test now printsremoved (no lane owed): <path> — <why>. A deleted test runs its owning suite, and when a file loses its last test the output sayscoverage removed: <file> has no remaining test, so lost coverage shows instead of hiding. Any remaining non-Markdown file that still names the removed test, such as a curation list or a duration table, has its tests run, and the removal fails closed when that file has no test.The PR is unstamped. VERSION, package.json and the agents digest stay at main's 1.91.294.0, and the CHANGELOG entry sits under
[Unreleased]for the slot call to stamp.Test Coverage
New
test/pregate-removed-paths.test.tshas 47 cases: the waived tests plus the fail-closed negative controls. Every case added in review was shown failing on the commit before its fix, including the cycle 8 cases for a JSON-escaped tab and a URL-encoded path.Tests ran: removed-paths 47 (47 pass)
Focused local suites: 316 of 317 green; the other one is a
test/pregate-regate.test.tscase hitting bun's 5000 ms timeout on this 4-core machine, which also happens on unchanged main 6f27f0c (remote_gate runs it green)Tests ran: remote_gate (Ubicloud, $0.07) 10661 (10661 pass, 0 fail) at 3a953f4
Pre-Landing Review
Two full specialist passes ran, then 5 native adversarial passes and a gpt-6.1-sol outside voice. The fix cycles past the cap ran under GStack Minder's rule 23 grants. Every blocking finding was a fail-open: a removal that passed while a remaining test or importer broke. Each one was either fixed with a failing-first case or recorded as a known limit by the Captain. The last fix-check (gpt-6.1-sol, at 9c2821a) found nothing. The last adversarial pass found one case that meets the cycle 8 bar, a removed test linked from a link-checked Markdown doc, and the Captain recorded it as a known limit (#3538). The commits after 9c2821a touch only VERSION, package.json, the agents digest and CHANGELOG.md, plus a merge of main (4b8c03b) that changes no file in this PR's product diff.
REVIEW_LOOP: passes=2 blocking_found=14 deferred=4 noted=3 fixed=15 scope=frozen fix_checks=7 dispatches=19
Gate edits: none detected (one new test file; no existing test, threshold, allowlist or skip changed)
Outside review: gpt-6.1-sol (Capy subagent, cross-family), completed; its High findings were fixed or filed, and the final fix-check found nothing. The Codex CLI is not installed on this machine, so the structured Codex review did not run.
Known limits
Each of these is waived on this branch, while main refuses it. The Captain accepted each one for this PR.
dependenciesentry, or a remaining test that names it) skips the namer check (pregate: a removed test that maps to a test skips the files-naming-it check (pre-existing on main) #3536). The same blind spot exists on main.git grepdoes not read symlinks, so a symlinked test can dangle. gstack has no instance of either today.require('./lib/' + name)) are invisible to the graph and the name search.Exploratory QA
On this repo at 641bc8f (product code unchanged at 3a953f4), deleting
test/pregate-dart.test.tsand renamingtest/pregate-rust.test.tsgiveslanesrequires-remote, prints both removed paths (owning suite runs; old name of the new path), and exits 0. The same change at main 6f27f0c gives PREGATE_NO_LANE and exits 1.Design Review
No frontend files changed, so design review was skipped.
Eval Results
No prompt-related files changed, so evals were skipped.
Plan Completion
All plan items for removed tests are done. The removed non-test code items were dropped when the Captain narrowed D3, and #3535 tracks them. The gbrain handoff note (CREW rule 26) has been rewritten for the narrowed scope.
Issues
Fixes #3529
Refs #3535
Refs #3536
Refs #3537
Refs #3538
Verification Results
The plan's verification obligations ran as the fixture cases and the repo QA above. Everything passes except the pre-existing regate timeout named under Test Coverage.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. docs/pregate.md and docs/troubleshooting.md describe the removed-test waiver as shipped: which tests are waived, the namer check over non-Markdown files, the owning suite and lost-coverage lines, and that every other removal still fails PREGATE_NO_LANE. I checked every claim in both docs against lib/pregate/lane-selection.ts at 3a953f4. README.md, CLAUDE.md, CONTRIBUTING.md and AGENTS.md make no removed-path claims. The CHANGELOG entry is under
[Unreleased].Test plan
bun test test/pregate-removed-paths.test.ts: 47 pass, 0 failbun run typecheckandbun run typecheck:test: exit 0gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commandsat 3a953f4 (main 4b8c03b merged in, CHANGELOG-only conflict, rule 19 grant): remote_gate 10661 tests, 0 failed ($0.07); macos-named-regressions cleared from CI run 40693559813 and windows-free-shard from CI run 40693559812;gstack-pregate verifyok for tree 5cf6a115ed1c