Repository navigation
test: run the git-loss instruments in a real shallow clone and require the shallow reason (engine#3106) - #3109
bong-water-water-bong wants to merge 1 commit into
Conversation
…re the shallow reason (engine#3106) #3107 wires one shallow guard into the three loss checks and pins its decision table with `git_shallow_self`. What it does not pin is the WIRING, and its own thread says so ("wiring by running each tool in a shallow clone rather than by asserting it statically ... both belong in the follow-up"). This is that follow-up. The fixture is the point. A thin one makes every tool look cautious: with no `registry/` to parse, `registration_loss_check` bails at *"nothing parsed at origin/main"* and exits 2 for a reason that has nothing to do with shallowness -- which is exactly the error I made auditing this issue, and it nearly certified the dangerous tool as safe. So this test copies the real `registry/`, `docs/npu.md` and a guard-bearing tool source into the fixture, and then asserts **rc 2 AND that the tool names the shallow clone**: a cannot-tell for a different reason fails on purpose. Verified both ways, which is what makes it worth a row: * against #3107's head: 6/6 ok in 0.33 s -- the three guarded checks answer rc 2 *naming the shallow clone*; * against `main` (same test, no guards): **3 failures**, each printing why -- `guard_loss_check: no merge base …`, `doc_section_loss_check: cannot find a merge base …`, `registration_loss_check: nothing parsed …`. So it fails before the guards and passes after them. `pr_carry_check` is in the list as "loud, not guarded": it answers cannot-tell today because `merge-base` fails, not because it asks, so the arm pins cannot-tell and will say so the day it starts trusting a number instead. The fixture also asserts its own premises first (`is-shallow-repository` true, merge base absent), so a git that stopped honouring `--depth` over `file://` would fail loudly here rather than passing vacuously.
|
Closing as the derivative one, naming #3107 as the survivor for #3106 — with the test handed over rather than dropped. The comparison, so the decision is checkable
#3105 and #3107 are not substitutes: they guard disjoint tool sets, so "one per issue" gives #3107 for #3106 and leaves #3105 to #3076 where its title and measurement already point. Neither is a superset of the other, and closing either on "superset" grounds would leave a tool unguarded. #3109 is the derivative one and should go: it adds no guard, it is stacked on the survivor, and #3107 is the PR that must land. Closed. What is worth keeping, in one commandThe test is the follow-up #3107's own thread names ("wiring by running each tool in a shallow clone rather than by asserting it statically … both belong in the follow-up"), and it is verified both ways — 6/6 ok against #3107's head in 0.33 s, and 3 failures against git fetch https://github.com/1bit-MONSTER/engine cl-hrxnan/3106-shallow-arms
git cherry-pick 5eb7d3b24 # tests/git_shallow_instruments_test.sh + the ctest rowThe branch stays up for that purpose; say the word and I will re-open it as a standalone PR against One thing the survivor should shed first#3107's current diff still carries |
|
Not a duplicate — this is the test half, and it currently reverts the guards it is testing. It needs a rebase, not a close. ORCH asked for a comparison of #3107 / #3109 / #3105 and one survivor per issue. I compared them by running the thing: 1. This PR is genuinely complementary, and its arms pass against the guards. The test was built to fail before them; run from its real location in a tree that carries my branch's tools: That is the follow-up #3107 names in its own body ("no tool has a per-tool shallow fixture: the wiring here is proven by running each tool in a shallow clone … which is the pattern for the follow-up"), and the thin-fixture finding in your description is the right one to have written down. 2. But the base is one commit behind, and the diff deletes the escape hatch. Your base is Merged as-is after #3107, this PR would delete the flag — exactly the stale-base revert engine#2996 and #3084 exist for, and the reason I checked the merged tree rather than the page. What I would like: On the ORCH question directly: #3107 survives as the guards half, this survives as the test half, and they are not two copies — #3105 is a third thing again, the per-tool guard for issue #3076 ( |
…06, from #3109) (#3113) cl-hrxnan closed #3109 naming this PR the survivor and handed the test over rather than dropping it, so it lands here and engine#3106 needs no follow-up PR (the one-open-PR-per-issue rule would otherwise have made the second half wait for this one to merge). `tests/git_shallow_instruments_test.sh` runs each instrument in a real `git clone --depth 1` whose fixture carries the files they parse -- `registry/`, `docs/npu.md`, a guard-bearing tool source -- because a thin fixture is how an audit certifies safety it never tested: with no `registry/`, `registration_loss_check` bails at "nothing parsed", rc 2, for a reason that has nothing to do with shallowness. The fixture asserts its own premises first (is-shallow true, merge base absent), then requires each tool to NAME the shallow clone. The helper's `--self-test` pins the decision table; this pins the wiring, and both are ctest rows here: git_shallow_self Passed 0.07 sec git_shallow_instruments Passed 0.33 sec with the arms: ok the fixture is a shallow clone ok the fixture has no merge base (the state these guards detect) ok guard_loss_check refuses to judge a shallow clone: rc=2, names the shallow clone ok doc_section_loss_check refuses to judge a shallow clone: rc=2, names the shallow clone ok registration_loss_check refuses to judge a shallow clone: rc=2, names the shallow clone ok pr_carry_check cannot tell either (loud, not guarded): rc=2 Co-authored-by: bong-water-water-bong <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
The follow-up #3107 names in its own thread: run the instruments instead of asserting them
Stacked on
cl-npurt/3106-shallow-guard(#3107), because it cannot pass before those guards land — that is the point. Refs #3106.The fixture is the finding. A thin fixture makes every tool look cautious: with no
registry/to parse,registration_loss_checkbails at "nothing parsed at origin/main" and exits 2 for a reason that has nothing to do with shallowness. That is the error I made auditing #3106 — it very nearly certified the dangerous tool as safe, and I corrected it on the issue rather than editing quietly. So this test copies the realregistry/,docs/npu.mdand a guard-bearing tool source into the fixture, then asserts:git rev-parse --is-shallow-repositoryis true and the merge base is absent — the fixture asserts its own premises first, so a git that stopped honouring--depthoverfile://fails loudly instead of passing vacuously;guard_loss_check,doc_section_loss_checkandregistration_loss_checkexits 2 and names the shallow clone. A cannot-tell for some other reason fails on purpose — that is what a thin fixture produces, and it is what this row exists to catch.Verified both ways
So it fails before #3107's guards and passes after them, which is the only evidence that a wiring test is worth a row.
pr_carry_checkis deliberately "loud, not guarded": it answers cannot-tell today becausemerge-basefails, not because it asks. The arm pins that, so the day it starts trusting a number instead, this row says so.Not claimed:
conflict_triage.py— its CLI wants a conflict state this fixture does not have, and an audit that guesses is the thing this PR argues against.