test: remaining corpus metamorphic gates — permutation, project split and plugin generations #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.
Depends on
Reference
h-dv/code-index#42
Loading…
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?
Current state
The corpus metamorphic suite already ships id-independent comparisons for:
It found #52’s sticky-resolution defect. #52 is now closed, so the temporary known-incoherence allowance must be absent or removed as part of this issue’s next verification.
The original unimplemented invariants remain:
#75 adds package/generation invariants that belong in the same real-corpus gate.
Remaining goal
Prove that irrelevant ordering, absolute location, project routing and plugin-generation construction do not change the canonical active semantic projection.
All comparisons render targets by stable semantic identity such as path/name/span/package generation, never SQLite ids.
Required invariants
Existing-suite cleanup
Walk permutation
Add an explicit deterministic walker-order test seam. Index each corpus under multiple committed seeds/orders.
Assert identical:
The seam is test-only and cannot affect production default order.
Project split
Compare the same source tree represented as:
Do not demand cross-project edges that the product explicitly does not support. Instead define and compare the per-project projections and fan-out merge contract. Assert no fabricated cross-project target.
Also test differing package sets per linked project; no process-global plugin registry may leak eligibility or language profiles across them.
Plugin generation construction
For exact activation identity G compare:
Use XAML and the complete migrated-language package from #80. Include package-only changes with unchanged source bytes, precedence swaps and embedded-language files.
Encoding/hostile content
Retain fixture-scale encoding guards and add corpus mutations for CRLF/BOM and one content-refused path. Permanent refusal must be disclosed consistently rather than compared as an empty index.
Positive controls
Every run proves:
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).
test: corpus metamorphic gate — determinism, cold==incremental, permutation and path invariance on real reposto test: remaining corpus metamorphic gates — permutation, project split and plugin generationsAcceptance clause 1 is now GRADED, not just true. The rest of the issue is untouched.
Branch
worktree-agent-a9fb463736bf2b59d, based on master1d81180. Not pushed.What I found
known_incoherenceincrates/indexer/tests/corpus_metamorphic.rsalready returnsvec![], and its doc already says "Empty, and it must stay empty… do not add entries to make a red run green." So the first half of clause 1 ("verify the allowlist is empty") held.The second half — "and fails if reintroduced unnecessarily" — was enforced by nothing. Prose is not a gate. And the shape of the hole is this project's own: the suites that CONSUME the allowance are corpus suites, so without
COSI_CORPUS_DIRthey reportexecuted=0 unavailable=1and pass. An entry could have been added, reviewed, merged and never once executed.What I added
the_known_incoherence_allowance_is_empty— a sweep over the tier-1 roster requiring the allowance to be empty for every repo. It needs no corpus:corpus::tierreads the checked-in manifest, so it runs on every push and an entry appears the moment it is written.It is a waiver gate, not a ban. An entry there is a documented product defect and there may one day be a right one; adding it now has to be a decision recorded next to the emptiness it breaks, rather than a quiet accommodation inside a suite nobody runs locally. Same shape as
ignored_test_reachability.Two mutations, both run:
The second is the one that matters: a sweep over an empty roster passes, so the floor is what stops this test from being the very thing it exists to prevent.
Explicitly NOT done — state of the rest of this issue on
1d81180corpus_metamorphic.rstoday ships determinism, cold-vs-incremental edit / delete / add / rename, and path invariance (7 tests). Of the remaining goal:grepfor a walker-order seam finds onlygeneration_equivalence.rs's influence-row permutation, which is a different thing.generation_equivalence.rscovers adjacent ground at fixture scale, not on the corpus.Those are the substantive remainder and I did not start them; this comment is only so the first acceptance clause stops being a promise.