Repository navigation
Description
Description
Found investigating why the tri-comparison chart reports "yacc -- corpus has no real yacc files, treating as awaiting data" despite language-crucible/data/yacc/freebsd/ containing two real, non-trivial .y grammar files (jailparse.y, 276 lines; config.y, 503 lines).
Confirmed this is NOT a language-routing/ingestion problem -- running galaxyscope directly against this corpus shows the extraction pipeline DOES process both files and DOES find real functions in them (debug output: GG SPLICE FUNCS: ['newopt', 'newdev', 'newenvvar', 'rmdev_schedule', 'rmopt_schedule', 'finddev', 'findopt', 'yywrap', 'newfile', 'newoptionsfile', 'devopt', 'yyerror'] for one file, ['conf', 'jail_name', 'name', 'string', 'value', 'param', 'jail'] for the other -- real yacc/bison C-action function names). But the run's own summary log says:
Anomaly sweep concluded | Stable Files Mapped: 1 | Collapsed to Exclusion Queue: 2
and the final file_data table (queried directly from the produced sqlite DB) contains only freebsd/COPYRIGHT (correctly classified plaintext) -- both .y files are missing entirely, not misclassified as some other language.
Root cause (partially isolated, not fully pinned down)
gitgalaxy/metrics/statistical_auditor.py runs a per-language-cohort anomaly sweep (README.md's "Quality Gate" section: the Impossible Density Law at rho > 3.0 for loc > 30, a Zero-Density hard floor, and a robust Z-score/MAD check for everything else -- see lines 382-405). The yacc corpus has exactly 2 real code files total in this pinned snapshot. A per-cohort statistical check (median/MAD-based Z-score, or any relative-density comparison) computed over a population of 2 is close to a degenerate case -- either file being denser or sparser than the other by any margin can produce an extreme Z-score purely from having almost no comparison population, independent of whether the file is actually anomalous.
I was not able to fully isolate which of the three specific checks (Zero-Density Threshold, Packed Payload Guard/Impossible Density Law, or the Z-score/MAD branch) is the one actually firing for these two files without deeper instrumentation than this pass covered -- the log line that would say (relegation_reason, set at statistical_auditor.py:385/393/405) isn't surfaced at the log level galaxyscope --db-only runs at by default.
Suggested next step
Add debug-level logging of relegation_reason (or run with a debug logger) against this exact corpus to confirm which check fires, then decide the real fix: most likely the Z-score/MAD branch needs a minimum-cohort-size guard (skip the statistical check entirely below some N, same spirit as the file already bypassing checks for "heavy polyglot" files) rather than applying a population-relative statistic to an n=2 population.
Impact
This is why yacc has never had any tri-comparison coverage at all (tri_comparison_chart.py reports "no real yacc files" and skips it) despite ctags_reader.py's own documented intent that GitGalaxy has real functions to find here that ctags structurally cannot see ("yacc": set() in CTAGS_FUNC_KINDS, with the comment "GitGalaxy has functions to find here, ctags structurally cannot see them"). The corpus and the extraction both work; only this exclusion step is blocking any comparison at all.
Evidence
Reproduced directly: galaxyscope language-crucible/data/yacc --db-only --output /tmp/yacc_test_scan.json, then querying the resulting sqlite DB's file_data table.
Activity
docs(self-scan): validate m4 (3/3) and scheme (partial) ledger shapes (…
fix(core): yacc `.y` grammar files silently excluded from output (#1926…
squid-protocol commentedon Aug 27, 2026
Root-caused and fixed in #2324 (merged).
The earlier "MAD branch on an n=2 population" hypothesis was wrong — that branch never runs for these files. Actual cause:
.yis a collision extension (c+yacc), and the classifier had nointernal_discriminatorfor yacc, so an action-heavy grammar resolved either tocor to a Tier-4"Collision Resolved"lock.statistical_auditor.py's Heuristic Extension Consensus triage (tier >= 4 or "Collision" in proof→ambiguous_artifacts) then banished it atstatistical_auditor.py:218— the ecosystem loop-back can only rescue an ambiguous file via a vote from confidently-parsed siblings of the same extension, which for.ycan never exist. Confirmed to have hitcobol/gnucobol_internals/parser.ytoo, not just the yacc corpus.Fix (#2324):
language_standards.py— yacc gets aninternal_discriminator(%{/%}/%%/%token/%union/…)..ygrammars now classify asyaccat Tier 2 with the extension matched, passing the consensus triage as confident artifacts.statistical_auditor.py— the consensus loop-back's "banish" branch now keeps a decisively-resolved collision file (extension collision + confidence ≥ 0.85 + real extracted structure) instead of deleting it.jailparse.y(7 rules),config.y(11),gnucobol parser.y(781) now appear infile_dataasyacc. Golden masters re-blessed. Thetri-comparison-historycompanion will add yacc chart/ledger coverage on the next main push (GitGalaxy-only there — ctags' YACC parser sees only labels/tokens, no tree-sitter grammar).Two incidental findings spun out (see #2324's description): the consensus engine silently deleting cleanly-extracted files, and
StatisticalAuditorbeing constructed withoutlang_defsatgalaxyscope.py:722(which makes GATE C / GATE D / dead-code detection dead code in production).fix(core): retain ambiguous files that extracted real structure (#2326)…