Repository navigation
test(corpus): make box-corpus tests hermetic on a box-submodule-less checkout - #78
Conversation
…checkout TestCandySourceDirs_OverrideAnchorsRemoteApk and TestCueBox_Corpus iterate the box/<distro> submodule corpus and HARD-FAILED on a checkout where box/* is not inited, reddening go test ./... through no fault of the code under test. Root cause: an un-inited git submodule leaves an EMPTY gitlink placeholder dir, so 'checked out' must be detected by the box/<distro>/charly.yml MANIFEST, not by os.Stat on the dir (a false positive on the empty placeholder). - Add ONE shared helper boxSubmoduleCheckedOut(boxDir) (R3) — manifest-based. - TestCandySourceDirs: skip when box/cachyos manifest is absent. - TestCueBox_Corpus: skip on an empty glob ONLY when NO box submodule is checked out; if a box IS present but the glob matched nothing, fall through to the existing ok==0 t.Fatal (a genuine glob/path regression still fails loudly). - TestCueKinds_Corpus was already hermetic — unchanged. Verified both directions live: box-less -> both skip, full go test ./... green (54s); box-inited -> both run and pass (candySourceDirs resolves the APK via 134 dirs; TestCueBox_Corpus validates 79/79 box entities), full go test ./... green (57s). golangci-lint 0; gofmt + fmt --diff clean. Assisted-by: Claude (analysed on a live system) Claude-Session: https://claude.ai/code/session_01LnxJjgvxzR2WePdDhAp7Wb
pr-validator — APPROVED ✅(Fresh independent re-validation, superproject-rooted. I re-derived every claim and re-ran both submodule states live — trusting nothing.) Change class: charly Go — test-only (2 Branch: The load-bearing adversarial checks
Checklist (all PASS or N/A)
Gates I re-ran (verbatim)Decision: APPROVED. The fix is genuine root-cause hermeticity (manifest-based detection), not a masking skip — the real glob/path regression still fails loudly, the corpus is never vacuously skipped, and both box-states are green on my own independent re-run of the update-branch'd tree. Finalizing the merge-time CalVer, merging Assisted-by: Claude (analysed on a live system) |
Evaluator version stamp for PR #78 — test(corpus) box-corpus test hermeticity on a box-submodule-less checkout. Renames the placeholder CHANGELOG to the merge-time CalVer and aligns its H1. No behavior change. Assisted-by: Claude (analysed on a live system) Claude-Session: https://claude.ai/code/session_014ykuqUwq8WCYeBmmzm5VDk
Box-corpus tests are hermetic on a box-submodule-less checkout (#32)
TestCandySourceDirs_OverrideAnchorsRemoteApkandTestCueBox_Corpus(bothcharly/) iterate thebox/<distro>submodule corpus and hard-failed on a checkout where the box submodules are not inited (a dev who clones charly + sdk to work on core but does not pull the five distro repos), sogo test ./...was red through no fault of the code under test.Root cause
An un-inited git submodule leaves an empty gitlink placeholder directory, not an absent path:
TestCandySourceDirs…guarded onos.Stat(box/cachyos)— which succeeds on the empty placeholder, so the skip never fired andLoadUnified(box/cachyos)then hard-failed (ok=false) on the missingcharly.ymlmanifest.TestCueBox_Corpusglobbed../box/*/box/*/charly.yml→ empty →ok==0→t.Fatal("no box entities validated").TestCueKinds_Corpuswas already hermetic (reads../charly.yml+ the embeddedcharly.yml,continues past unreadable box files) — unchanged.Fix — detect "checked out" by the MANIFEST, not the dir (R3: one shared helper)
boxSubmoduleCheckedOut(boxDir)returns whetherbox/<distro>/charly.ymlexists (the reliable signal; an empty placeholder dir is a false positive).TestCandySourceDirs…skips whenboxSubmoduleCheckedOut(box/cachyos)is false.TestCueBox_Corpusskips on an empty glob only when no box submodule is checked out (filepath.Glob("../box/*")∩boxSubmoduleCheckedOut); if a box is present yet the discovery glob matched nothing, it falls through to the existingok==0t.Fatal, so a genuine glob/path regression still fails loudly. Skip is granted only when the corpus is genuinely absent (root-cause hermeticity, not a blanket skip).Verification (both directions, live — pasted)
TestCueKinds_CorpusPASS; fullgo test ./... -count=1green (54s). No other box-dependent hard-failure — every other box-referencing test uses comments / ref-strings / temp fixtures, not the real corpus.TestCandySourceDirs…resolves the committed APK via 134 candy source dirs;TestCueBox_Corpusvalidates 79/79 discovered box entities; fullgo test ./... -count=1green (57s).golangci-lint run0 issues;gofmtclean;golangci-lint fmt --diffclean.Change class: test-only Go (two
*_test.gofiles). No runtime/behavior surface — no bed applies; the gate isgo test ./...exercised in both submodule states.Assisted-by: Claude (analysed on a live system)