Repository navigation
fix(detection): resolve same-extension collisions by sibling content (#3137, closes #3132) - #3190
Merged
Merged
Conversation
… not extension counts (#3137, closes #3132) Ecosystem gravity resolved a neighbourhood by counting extensions. For a same-extension collision (python/embedded_python .py, sqlite/db2_sql .sql, matlab/objc .m, batch/rexx .cmd) that is information-free: both rivals score over the identical contested-extension files, and the only tie-breaker left is a discriminators self-reference (python lists its own .py), which manufactured the reported '72% Local Dominance' for 4 MicroPython files. Add a sibling-classification vote: when a neighbourhood carries no different extension-shaped anchor, weigh what the siblings actually resolved to via their own content (shebang / internal discriminator) instead of their filenames, and abstain to Tier 3 when that vote is empty or split. Mixed-extension neighbourhoods (.h beside .c, .asm beside .jcl/.cbl) keep the extension-count physics untouched. Memoised per directory+ext and deterministic: any file that reaches gravity has already failed content resolution. #3117 detection-accuracy harness: determinable accuracy 3226/3231 (0.9985) -> 3231/3231 (1.0); confusion pairs {embedded_python->python:4, hlasm->assembly:1} -> none. sqlite/matlab/objc/rexx all unchanged at 1.0. Baseline re-pinned. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ections (#3137) The sibling-content vote reclassifies the 4 residual meow_turtle files (diagnostics/logging/meowprotocol/tester) python -> embedded_python. Drift is exactly those 4 language flips plus their downstream metric/proof changes; zero language flips elsewhere in the 3531-file corpus. Full-precision and zero-dependency masters reblessed via update_golden_master.py. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Ecosystem gravity resolved a neighbourhood by counting extensions. For a same-extension collision that is information-free by construction: both rivals score over the identical set of contested-extension files, so the base-mass fallback counts the same files for each, and the only tie-breaker left is a
discriminatorsself-reference —pythonlists its own.py, which is literally where the reported "72% Local Dominance" came from (pythonbase 14 + 14×2 = 42 vsembedded_python's 14 + 1×2 = 16).This adds a sibling-classification vote (#3137): when a neighbourhood carries no different extension-shaped ecosystem anchor — the exact regime where extension counting is blind — gravity now weighs what the siblings actually resolved to via their own content (shebang / internal discriminator), not their filenames. A sibling that classified as
embedded_pythonbecause it importsmachineis real evidence about its neighbours; a sibling that merely shares the contested extension is not evidence and casts no vote. An empty or split neighbourhood abstains to Tier 3 rather than lettingmax()iteration order pick a winner (the #3118 silent order-dependence).The mixed-extension neighbourhoods gravity was built for —
.hbeside.c,.asmbeside.jcl/.cbl— carry a real cross-extension signal and keep the extension-count physics untouched.Why this is the fix #3132 needed
#3132's residual 4 files (
diagnostics.py,logging.py,meowprotocol.py,tester.py) import nothing MicroPython-specific and are genuinely indistinguishable per-file — the exact case neighbourhood context exists to solve. Its comment thread measured three cheap fixes and all three lost (abstain → 32 sqlite files fall to db2_sql; strip the contested ext from discriminators → same loss; remove only python's.pyself-reference → breaks 7 plain-python files). This is the "weigh sibling classifications, not extension counts" change #3137 asked for, which those cheap versions could not substitute for.Closes #3137. Closes #3132.
Measured (#3117 detection-accuracy harness, pinned language-crucible)
{embedded_python→python: 4}No regressions on the previously-correct contested extensions:
sqlite(n=76),matlab,objective-c,rexx,python(n=269) all stay at precision/recall 1.0. The one deterministic property that makes this safe:sqlitehas no content signal, so its.sqlfiles cast no vote and the neighbourhood abstains to the untouched physics — sqlite is resolved exactly as before.Why is this cheap to trust? Any file that reaches gravity has already failed content resolution (a Tier 2 internal-discriminator match locks at tier 2 and never calls gravity), so the neighbourhood verdict is independent of which sibling triggered it — the vote is memoised once per directory+extension and is deterministic.
Golden masters
Reblessed both
golden_master_audit.json(full-precision) andgolden_master_zero_dep_audit.json(zero-dep). The drift is exactly the 4 intended language corrections (python → embedded_python) plus their downstream metric/proof changes; zero language flips anywhere else in the 3,531-file corpus.tests/detection_accuracy_baseline.jsonre-pinned to the new 1.0 numbers (also drops a stalehlasm→assemblyentry that currentmainno longer produces).🤖 Generated with Claude Code