test: corpus metamorphic gate — determinism, cold==incremental, permutation and path invariance on real repos #42
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/code-index#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
P2 — regression protection with a measured 0-defect starting point.
From
_prdoc/records/brainstorm-2026-07-28-oss-corpus-test-system.md§2.1. Depends on #40.Honest framing
The 2026-07-28 spike already ran determinism and cold==incremental against 7 real repos and they were clean. So this is explicitly not a bug hunt — it is a guard that locks in a property currently verified only by an ad-hoc shell script that lives in a scratchpad. Do not oversell it in the mission record.
Verified clean on 2026-07-28 (v0.8.7 @
855710d):Invariants to encode
/a/bvs/x/y/z/wThe three untested ones are the actual value of this issue.
Comparison method (reuse from the spike)
Compare on an id-independent projection — refs must render their target as
tf.path||'#'||ts.name||'@'||ts.start_line, nevertarget_id, or rowid ordering masks real differences. This is how the spike avoided a false green.Acceptance
Landed —
crates/indexer/tests/corpus_metamorphic.rsFive asserting tests over all 7 tier-1 repos, all comparing on the id-independent projection (a ref's target rendered
path#name@line, nevertarget_id):corpus_determinismcorpus_path_invariance/svs/d/e/e/p/e/r/still)corpus_cold_equals_incremental_editcorpus_cold_equals_incremental_deletecorpus_cold_equals_incremental_renameThe three mutation kinds are split one per test rather than applied together, so a failure names the responsible operation instead of leaving three suspects. That split is what localised #52.
It found a real defect: #52
The combined test failed on cs-dapper. Isolating the three mutations showed the rename alone was responsible: renaming
Dapper/SqlMapper.cs— semantically a no-op in C# — leaves 3 refs inCommandDefinition.csresolved toSqlMapper.Settings.csthat a cold index of the identical tree declines to resolve. Root-caused to sticky resolution (target_id IS NULLgating) plus name-only invalidation. Filed as #52, deliberately not fixed here.Those 3 sites are enumerated in
known_incoherence()with a written reason and an issue reference — theoracle.tomlname_fallback_ceilingdevice.assert_same_excepttolerates only those exact(path, name, kind, line, col)sites; symbol differences are never tolerated, and any other ref difference still fails. Verified non-vacuous: the run reports6 known-incoherence ref difference(s) tolerated(3 sites × both sides of the symmetric difference), so a stale list cannot pass silently. The list must shrink to empty when #52 lands.Deviation from the issue's plan
Permutation invariance is NOT implemented. The walk order isn't externally controllable, so there is no honest way to test it without a walker seed knob. I'd rather say so than ship something that looks like the invariant but isn't. Split invariance (single project vs primary+link) is also not covered yet. Both remain open on this issue.
Path invariance — the one invariant here the spike never tested — is clean on all 7.
Acceptance: boxes 2, 3, 4, 5 met; box 1 partially (4 of 6 invariants).