Repository navigation
Description
Goal
Find out, with a repeatable test, whether each keyword family in function_data measures what its contract says, show the answer as a graph on the README beside the function-finding and call-graph charts, and close the gaps. GitGalaxy's per-function signals (I/O, regex, time, decorators, bitwise, ...) are keyword families: regex rules per language in standards/language_standards/languages/. They feed the archetypes, the risk gauges and every study built on them, so a family that misses half of what it names, or fires on characters inside strings, quietly bends all of those.
The system (three parts)
- The contracts are the definitions.
gitgalaxy/standards/signal_contracts.pyholds a written contract for 71 families (43 declared, 16 stated, 12 draft), in nine phases. A family is scored against its contract, not against a guess; adraftcontract is a question for the maintainer (Keyword families: five definition questions for the owner (json, generators, closures, cleanup, telemetry) #8862). - The oracle harness (PR tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864,
tests/tools/family_oracle.pyandfamily_oracle_ts.py): a real parser says what each function does (Pythonast; tree-sitter for Go, Rust, JavaScript, TypeScript, Java, C so far); each family is scored per language on recall, precision and rank correlation, with the tokens it missed.--update-baselinemerges a result intotests/family_validity_baseline.json. - The grid (PR tests/tools: family_validity_chart draws the keyword-family accuracy grid (Part of #8863) #8876,
tests/tools/family_validity_chart.py->docs/self_scan/family_validity_chart.svg, embedded in the README): one column per language, one row per contracted family; N/A (the language has no rule) black, untested gray, scored cells a rainbow for the weaker of recall and precision; faded under 10 functions, hatched when the corpus is not a pinned crucible. A pure function of the baseline and the engine registry, likegraph_coverage_chart.py, with--checkand--history.
How much can be checked, and how thoroughly
- The grid: 79 language definitions (73 code languages) x 71 contracted families = 5,183 cells; 2,894 are defined (the language has a rule), 2,289 are N/A. 181 are measured against a parser today (6%), in 15 languages and 23 families; 677 more by the decoy test only; 2,036 not tested.
- Which languages: 53 of the 79 definitions have a tree-sitter grammar and can get an oracle with one
Speceach (about 100 lines). The other 26 (COBOL, JCL, HLASM, PL/I, REXX, ABAP, the SQL dialects, ...) need another oracle (for COBOL, the deterministic translator's parser) and stay gray until one exists. - Which families (my reading of the contracts, to be confirmed): roughly a third are syntactic (branch, args, closures, comprehensions, decorators, bitwise, casts, imports, globals, cleanup, doc, lazy, panics): a parser answers them exactly. Roughly half are callee or library lists (io, regex, time, serialization, sleeps, prints, telemetry, danger, concurrency, locks, events, llm/ml/dl, ...): the oracle needs its own per-language list, so it is a second reading of the contract, checkable but not independent proof. The rest (hardcoded secrets, rce funnel, exfiltration, memory scraping, dead code, the literate families) have no parser oracle: they need planted positives and negatives (what keyword-rosetta already does for presence) and a reviewed sample of real hits.
- Depth, in levels: L1 one real repository per language (today, exploratory, marked \u2020); L2 a pinned corpus with enough functions per cell that the number can be quoted (>= 10 now, a confidence interval later) and a written contract reading; L3 every disagreement checked against the real source with a verdict, kept in a ledger the way
tri_comparison_ledger.jsondoes it; L4 a second independent oracle (a compiler, an IDE index) on the families that matter most. Today is L1 for 181 cells. A reasonable target for the README is L2 on the syntactic and library families in the 10-15 largest tree-sitter languages.
What it has found so far (oracles aligned to the contracts, 2026-11-21; exploratory, one repository per language)
- Measure what they say (recall and precision >= 0.8 in most languages):
branch(except Rust and Swift, below),args(parameter count, 1.00 / 1.00 in five languages, which also checks the oracles),panics_and_aborts(except Rust and C),debug_prints,import,explicit_casts,lazy_evaluation,doc(Python, Go, Rust, Java, C). - Wrong in both directions:
bitwise_ops(bitwise_ops: counts closing generics as a shift and ignores & and | that its contract names; string text counts by design (#2535) against the contract #8866, Python: bitwise_ops counts characters inside strings and regexes (precision 0.32) #8861): closing generics counted as a shift and&and|ignored although the contract names them; Java precision 0.01, Rust 0.07, Python 0.15 / recall 0.43. Text inside strings also counts, which is documented engine behaviour (prism/detector: string-literal shielding is selective by signal family (if/try/open count inside a literal, eval does not) #2535, closed not-a-bug) that conflicts with the contracts: a decision, not a fix. - Contradicts its own contract:
serialization_parsing(serialization_parsing: the contract says JSON/YAML/XML/CSV/protobuf, the Python rule matches only pickle/marshal/literal_eval (0 of 72,044 functions fire, 699 call a codec) #8882): 0 of 72,044 Python functions fire; 699 call a JSON/YAML codec. - Never filled:
struct_decorators(Python: struct_decorators is 0 for every function (decorated_by is filled) #8857). - Miss constructs:
regex_execution(Python: arch_regex misses regex methods on compiled patterns (recall 0.53) #8858),time_date_logic(Python: arch_time misses perf_counter and other clocks (recall 0.54) #8859, and Go, Rust, Java in Keyword families in Go, Rust, JavaScript, TypeScript, Java, C: per-language differences that need a definition decision #8868),io(Python: arch_io misses Path I/O and over-counts os.path / sys.exit (recall 0.25, precision 0.43) #8860),high_risk_executionandglobals(Python: state_danger misses subprocess.check_output; arch_globals misses global statements #8865), Swiftbranchcounts optionals andforlabels (Swift: branch counts optional types and chaining (T?, x?.y), for as an argument label, and default/case outside a switch (precision 0.66) #8895). - Per-language differences that need a decision: Keyword families in Go, Rust, JavaScript, TypeScript, Java, C: per-language differences that need a definition decision #8868.
- Withdrawn: WITHDRAWN: Java complexity does not count catch (not a bug: branch contract corollary 1) #8867 (Java
catch): the branch contract says a handler is not a decision, so the engine was right and my oracle was wrong; two language agents hit the same contradiction independently. - Strings, a precedent: the branch contract (corollary 4) already shields string literals for
branchin 18 brace-family languages (outside_literals). That is whybranchcounts a keyword in a string in only 48% of decoy cells while nearly every other family counts it in over 90%. So literal shielding was decided once for one family; extending it is the open decision (prism/detector: string-literal shielding is selective by signal family (if/try/open count inside a literal, eval does not) #2535, bitwise_ops: counts closing generics as a shift and ignores & and | that its contract names; string text counts by design (#2535) against the contract #8866). - Eight more languages (C#, Kotlin, Scala, Swift, Ruby, PHP, Lua, shell; oracle specs written by two agents and gated on
argsandbranch): C#, Kotlin, Scala, Ruby, PHP and Lua pass the gate; Swift fails onbranchprecision (0.66, a real engine defect, Swift: branch counts optional types and chaining (T?, x?.y), for as an argument label, and default/case outside a switch (precision 0.66) #8895); shell misses onbranchprecision (0.84) because words inside strings and heredocs count (the prism/detector: string-literal shielding is selective by signal family (if/try/open count inside a literal, eval does not) #2535 behaviour).
Caveats: one repository per language, a naive oracle (a reading of the contract, with its own callee lists), no second oracle yet, and two rows first posted here were oracle errors (Go prints, C docs) and were removed.
The test (what this epic builds)
- Oracle test (above, tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864) per language, with a written contract reading per family.
- Cross-language consistency on keyword-rosetta. The same task is written in many languages there, so a family that fires for a task in 40 languages and not in the other 10 has a gap in those 10 without needing any oracle.
- Missing-keyword mining. Rank the tokens that are common in functions where the oracle sees the construct and the family is 0, per family and language. Those are the candidate additions, each to be timed before it is merged.
- Re-measure. After a fix, rerun: recall and precision up, CPU seconds on keyword-rosetta and language-crucible not up beyond the agreed budget.
Child issues
- Keyword families: five definition questions for the owner (json, generators, closures, cleanup, telemetry) #8862 contract readings to ratify and
draftcontracts to fill (several questions are answered by the contracts: see the comment) - Python: struct_decorators is 0 for every function (decorated_by is filled) #8857
struct_decoratorsnever filled - Python: arch_regex misses regex methods on compiled patterns (recall 0.53) #8858
arch_regexmisses regex methods - Python: arch_time misses perf_counter and other clocks (recall 0.54) #8859
arch_timemissesperf_counterand other clocks - Python: arch_io misses Path I/O and over-counts os.path / sys.exit (recall 0.25, precision 0.43) #8860
arch_iomisses Path I/O, over-countsos.path/sys.exit - Python: bitwise_ops counts characters inside strings and regexes (precision 0.32) #8861
bitwise_ops(Python) - Python: state_danger misses subprocess.check_output; arch_globals misses global statements #8865
state_dangermissessubprocess.check_output;arch_globalsmissesglobalstatements - bitwise_ops: counts closing generics as a shift and ignores & and | that its contract names; string text counts by design (#2535) against the contract #8866
bitwise_opsin seven languages - WITHDRAWN: Java complexity does not count catch (not a bug: branch contract corollary 1) #8867 withdrawn (not a bug: branch contract corollary 1)
- Swift: branch counts optional types and chaining (T?, x?.y), for as an argument label, and default/case outside a switch (precision 0.66) #8895 Swift
branchcounts optionals, optional chaining andforlabels - Keyword families in Go, Rust, JavaScript, TypeScript, Java, C: per-language differences that need a definition decision #8868 per-language differences that need a decision (Rust oracle reads the ? operator as a branch: last #8868 decision, precision 0.76 -> 0.99 (Part of #8863, #8868) #9369)
- serialization_parsing: the contract says JSON/YAML/XML/CSV/protobuf, the Python rule matches only pickle/marshal/literal_eval (0 of 72,044 functions fire, 699 call a codec) #8882
serialization_parsingcontract vs rule - the oracle harness as a repo tool: PR tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864 (draft)
- the grid on the README: PR tests/tools: family_validity_chart draws the keyword-family accuracy grid (Part of #8863) #8876 (draft)
- tree-sitter oracle: Go, Rust, JavaScript, TypeScript, Java, C (PR tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864)
- fold the oracle specs for C#, Kotlin, Scala, Swift, Ruby, PHP, Lua and shell into the repo (written and gated, in scratch for now; they need
family_oracle_ts.pygeneralised: receiver-aware callee matching, per-language call and operator node maps, doc rules, name aliases) and add C++ - pin a corpus with enough functions per language (language-crucible has 4 JavaScript and 28 C functions that the oracle can match) so more cells leave the hatched state
- register the chart in
merge_main.py's regenerate table and the history workflow (Register the keyword-family validity grid in merge_main and the graph history workflow (Part of #8863) #9270) - cross-language consistency report on keyword-rosetta (Keyword-rosetta consistency report: snapshot of both runs and the gap list (Part of #8863) #9271)
- missing-keyword mining report per family and language
- a non-tree-sitter oracle for JCL and assembler (COBOL is done: its paragraphs read through the translator's statement parser) (HLASM family-validity baseline: 5 cells scored on the pinned crucible (Part of #8863) #9390)
Rules
- Every keyword change is timed (CPU seconds, not wall) on keyword-rosetta and language-crucible, before and after, in the PR.
- If keyword-rosetta counts move,
rosetta:rebless-owedand rebless as usual. - A family is scored against its contract; where the contract is draft or silent the question goes to Keyword families: five definition questions for the owner (json, generators, closures, cleanup, telemetry) #8862 before a gap is called a bug.
- The pilot is discovery, not confirmation: predictions for each language are stated before its first run, and the pilot numbers are not reused as the confirmatory result.
Not in scope
Retraining the archetype models (a later step, once the families settle; see the train-archetypes skill), new families, and the speed study itself.
Red cells by language (one focus issue each)
Each language is its own issue so several can run at once (the gate holds one in-flight item per issue, so a single epic issue starves the focus whenever its one slice waits on a PR). Each issue carries the red cells from tests/family_validity_baseline.json on main and follows .claude/skills/family-validity-fix/SKILL.md; the nightly re-measure (tests/tools/family_sweep_nightly.py) refreshes the numbers.
- Keyword families (Kotlin): 7 red cells on the pinned crucible (Part of #8863) #9330 Kotlin
- Keyword families (Ruby): 7 red cells on the pinned crucible (Part of #8863) #9331 Ruby
- Keyword families (Scala): 7 red cells on the pinned crucible (Part of #8863) #9332 Scala
- Keyword families (C#): 6 red cells on the pinned crucible (Part of #8863) #9333 C#
- Keyword families (C): 5 red cells on the pinned crucible (Part of #8863) #9334 C
- Keyword families (C++): 5 red cells on the pinned crucible (Part of #8863) #9335 C++
- Keyword families (Java): 5 red cells on the pinned crucible (Part of #8863) #9336 Java
- Keyword families (PHP): 5 red cells on the pinned crucible (Part of #8863) #9337 PHP
- Keyword families (Shell): 5 red cells on the pinned crucible (Part of #8863) #9338 Shell
- Keyword families (Lua): 4 red cells on the pinned crucible (Part of #8863) #9339 Lua
- Keyword families (Rust): 4 red cells on the pinned crucible (Part of #8863) #9340 Rust
- Keyword families (Swift): 4 red cells on the pinned crucible (Part of #8863) #9341 Swift
- Keyword families (JavaScript): 3 red cells on the pinned crucible (Part of #8863) #9342 JavaScript
- Keyword families (Go): 2 red cells on the pinned crucible (Part of #8863) #9343 Go
- Keyword families (TypeScript): 2 red cells on the pinned crucible (Part of #8863) #9344 TypeScript
SOP-002 decoy leaks by language (one focus issue each)
The SOP-002 gap-cell decoy suites (PRs #9427, #9428, #9463, #9464, #9465, #9466) found about forty real engine leaks. Each leak is its own issue and is locked as a strict xfail in tests/decoys/test_decoy_<lang>.py; each language below is one focus issue, one PR, that fixes its leaks and removes the markers. Start a language only once its suite is on main.
- SOP-002 decoy leaks (PHP): 6 keyword-family leaks locked as strict xfails (Part of #8863) #9468 PHP
- SOP-002 decoy leaks (C): 2 keyword-family leaks locked as strict xfails (Part of #8863) #9469 C
- SOP-002 decoy leaks (C++): 2 keyword-family leaks locked as strict xfails (Part of #8863) #9470 C++
- SOP-002 decoy leaks (Rust): 1 keyword-family leak locked as strict xfails (Part of #8863) #9471 Rust
- SOP-002 decoy leaks (Go): 4 keyword-family leaks locked as strict xfails (Part of #8863) #9472 Go
- SOP-002 decoy leaks (Ruby): 6 keyword-family leaks locked as strict xfails (Part of #8863) #9473 Ruby
- SOP-002 decoy leaks (Lua): 2 keyword-family leaks locked as strict xfails (Part of #8863) #9474 Lua
- SOP-002 decoy leaks (Shell): 1 keyword-family leak locked as strict xfails (Part of #8863) #9475 Shell
- SOP-002 decoy leaks (Kotlin): 3 keyword-family leaks locked as strict xfails (Part of #8863) #9476 Kotlin
- SOP-002 decoy leaks (Java and C#): 1 keyword-family leak locked as strict xfails (Part of #8863) #9477 Java and C#
- SOP-002 decoy leaks (JavaScript and TypeScript): 7 keyword-family leaks locked as strict xfails (Part of #8863) #9478 JavaScript and TypeScript
- SOP-002 decoy leaks (Python): 5 keyword-family leaks locked as strict xfails (Part of #8863) #9479 Python
- SOP-002 decoy leaks (HLASM): 1 keyword-family leak locked as strict xfails (Part of #8863) #9480 HLASM
Activity
squid-protocol commentedon Nov 21, 2026
Now tracked in milestone Eagle Eye 🦅 — Structure Accuracy (https://github.com/squid-protocol/gitgalaxy/milestone/40).
Prior work in the same class, found one at a time under Friendly Fire: #8012 (~38
function_datasignal columns structurally zero) and #8009 (11 signal column names that misdescribe what their rules count). This epic is the measured counterpart: a parser's reading of the same functions (#8864), scored per family. The pilot's count that 54 of 110 function columns ever fire on GitGalaxy's own Python code, and the families it calls dead or misnamed, should be reconciled with those two issues before either is closed. Whether #8009/#8012 move into the new milestone is the maintainer's call; I have not moved them.tests/tools: family_oracle gains tree-sitter oracles for Go, Rust, Ja…
tests/tools: family_oracle follows the family contracts and records a…
tests/tools: family_oracle's Python bitwise reading leaves out type a…
squid-protocol commentedon Nov 21, 2026
Decoy matrix (parserless precision test), first version, 2026-11-21. For 45 keyword-rosetta languages and every token family in each language's generated menu, one keyword was inserted in the language's own syntax as bare code (a positive control), as a comment, and inside a string literal, and all 1,581 variants were scanned together.
branchcounts in 48%. This is the behaviour prism/detector: string-literal shielding is selective by signal family (if/try/open count inside a literal, eval does not) #2535 documented and closed as not-a-bug, now measured across families. It conflicts with the contracts ("at its invocation", "in operator position"), so shielding string literals for family rules, or amending the contracts, is a decision. It also explains part of the low precision in the oracle grid (tests/tools: family_validity_chart draws the keyword-family accuracy grid (Part of #8863) #8876).Write-up and scripts: temporal-crucible
docs/self_evolution/keyword_family_decoy_matrix.md(PR security: update ignore rules for yaml config #188). Not yet covered: identifier look-alikes, operator look-alikes (generics>>), structural families, and 5 languages without a usabledecoy:line. These cells are not on the grid yet; turning the matrix into a repo tool and a grid layer is the next step.family validity grid: add the decoy layer (721 more cells tested by a…
family validity chart: redesign after an independent review (Part of #…
family validity chart: 8 more languages, branch re-scored to the cont…
tests/tools: family_oracle's branch reading follows the branch contra…
228 remaining items
Shell family validity: re-measure the five red cells on the pinned cr…
Lua keyword families: bitwise_ops, thread_sleeps, io, regex_execution…
Kotlin family validity: re-measure #9330's seven cells, all at or abo…
test: SOP-002 gap-cell decoys for hlasm bitwise_ops, pointers, ssr_bo…
squid-protocol commentedon Nov 27, 2026
Claimed by promoter-bot host
melek, lease renewed 2026-11-27T01:01Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove theclaim:meleklabel.tests/decoys: SOP-002 gap-cell decoy suites for csharp, java, kotlin …
tests/decoys: SOP-002 gap-cell decoys for cpp, scala, php (6 cells) (…
tests/decoys: SOP-002 gap-cell decoy suites for go, rust and c (Part of
tests/decoys: SOP-002 gap-cell decoy suites, batch E (ruby, lua, shel…
tests/decoys: SOP-002 gap-cell decoy suites for python, typescript, j…
Charts and language sheets move into the generated-pages pipeline (#8863
Charts and language sheets move into the generated-pages pipeline (#8863