Skip to content

ci: implement cross-platform matrix testing - #1

Merged
squid-protocol merged 10 commits into
mainfrom
feature/matrix_tests
Apr 24, 2026
Merged

squid-protocol merged 10 commits into
mainfrom
feature/matrix_tests

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Apr 23, 2026 •

Copy link
Copy Markdown
Owner

Description of Structural Changes

Visual Observatory Testing

  • I tested the output JSON on GitGalaxy.io OR the Airgap Observatory.
  • Flexbox constraints, HUD elements, and 3D rendering remain intact.

The Differential Scan Acknowledgement

  • I understand that my PR will be subjected to a Full Differential Scan.
  • I have provided the link to the specific repository this PR addresses so it can be tested alongside the 80-repo calibrated baseline.
  • I believe these changes will measurably improve the engine's Accuracy, Speed, Utility, or Ethos without causing regressions.

@squid-protocol
squid-protocol merged commit 98bc53f into main Apr 24, 2026
12 checks passed
@squid-protocol
squid-protocol deleted the feature/matrix_tests branch July 7, 2026 22:06
squid-protocol added a commit that referenced this pull request Jul 24, 2026
…al (#365) (#380)

The "Over-Permissioned Agent Binding" rule gated on equations.get("ai_tools",
0) > 0 -- but "ai_tools" was deliberately removed from SIGNAL_SCHEMA in #323,
which explicitly called out this exact consequence: "Feeding inputs into
security-critical rules (e.g. AIAppSecSensor's 'over-permissioned agent'
detector -- see companion issue) that can never be honestly computed even
once the plumbing is fixed." That companion issue was never filed until
#325's dead key audit found it independently as #365.

#323's own reasoning rules out simply reintroducing an "ai_tools" signal:
agent tool-CALLING is behavior (an autonomous execution pattern), not
library identity, and a regex-based structural signature engine can't
reliably detect behavior -- that's precisely why the category was removed
rather than left broken. So the fix isn't a rename like #364's; it's
picking a signal this engine CAN honestly compute.

ai_orchestrator (equations["llm_orchestrator"], detecting langchain/
llama_index imports) is that signal: those are specifically the frameworks
whose entire purpose is binding an LLM to tools/actions, so "this file
imports an agent orchestration framework" is a defensible, lexically-
detectable proxy for "this file has agentic tool-binding capability" --
library-identity detection, exactly the kind of signal #323 said this
engine is good at. It's also already computed one line above in this same
function for rule #1, so this is a one-line change to rule #2's condition,
not a new detector.

Tests: the existing Over-Permissioned Agent test updated to mock
"llm_orchestrator" instead of the dead "ai_tools" key (matching what the
real engine can now produce), plus a new regression guard proving a mocked
"ai_tools" value alone can no longer trigger the rule -- locking in that
the dead key has zero remaining effect, not just that a live key works.

tests/dead_key_audit_baseline.json: "ai_tools" removed now that it's fixed
(`python tests/dead_key_audit.py --ci` confirmed clean at 13 baselined
keys, zero regressions).

Full suite: 856 passed, 1 pre-existing xfail.

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Jul 26, 2026
Items 1, 2, 3, 6, 7, 9 from a README review, plus a matching change to
the LLM report template itself (item 10):

1. "...provide risk exposures and actionable fixes to lower those
   exposures" directly contradicted the README's own later section
   (GitGalaxy never executes code or verifies exploitability). Replaced
   with "prioritized refactoring targets" -- which today's scan review
   confirmed is real and verifiable (see #9).

2. Cut "Our unique engine allows for the unique ways to scan for
   several CWEs families... which is a unique edge..." -- triple
   "unique" in one sentence, redundant with the better-substantiated
   "Weakness Classes, Not Just Known CVEs" section already in the doc.
   Also dropped "Unique" from the section header above it for the same
   reason.

3. Replaced "Proven Metric" (x3) and "Mainframe Proven: 100%..." with
   "Benchmark" -- these are real, specific, verifiable measurements;
   "Proven" oversells a single batch test as general/statistical proof.

6. Added one clause to the COBOL-to-Java compile-success claim:
   compiling is a necessary but not sufficient signal of a correct
   translation, not a guarantee of semantic equivalence.

7. Fixed typos/grammar undercutting the professionalism angle:
   "determistically" -> "deterministically", "which is offers... a
   repos" -> "which offers... a repo", plus several trailing spaces
   left over from prior edits.

9. Named the bus-factor-risk and refactoring-hotspot detection
   explicitly in the main description. Verified today by running the
   current engine on Flask: it correctly identified Flask's real lead
   maintainer (David Lord) as having 100% isolated ownership of
   app.py/ctx.py/cli.py -- a genuine, checkable claim worth stating
   directly instead of leaving implied under generic "architecture"
   language.

10. Softened the "Top 5 Structural Pillars" section of the LLM report
    template (llm_recorder.py) itself, not just the README: comparing
    Flask's report (46 inbound connections on the #1 file -- clearly
    real signal) against Express's (1-2 connections, all examples/
    demo scripts, no real differentiation) showed the same confident
    "core load-bearing infrastructure" framing regardless of whether
    the underlying signal was strong or just noise on a flatter-
    architected repo. Now frames it as relative to the repo and asks
    the reader to compare the connection counts before treating it as
    a verdict.

Item 8 (the bolded stat-summary block) and item 4 (the "50k+ LOC/s"
speed badge, which didn't match the 17k-36k LOC/s this session
actually measured) were left alone per direction -- 8 by request, 4
pending a real benchmark source.

Full suite: 869 passed, 1 pre-existing xfail. Ruff baseline regenerated
for line-shift (no new findings).

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Jul 29, 2026
Adds strict positive/negative, ambiguity-sweep, and ReDoS regression
coverage in tests/core_engine/test_language_standards_strict.py for all 39
non-None html structural signatures (54 tests). Found and fixed 8 real bugs
in html's rules dict, all the same root shape: a `\b` sitting adjacent to a
non-word character inside a shared alternation group.

Also found and filed a separate, real pipeline bug as issue #733 before
writing any tests: html is tagged `line_exclusive` but should be
`block_exclusive` (its own inline comment already says so), and
block_exclusive's own delimiter config is empty/broken -- net effect,
<!-- --> comments are never actually stripped from code_stream for html
today. Not fixed here (matches the epic's established pattern of keeping
per-language issues scoped to the rules-dict regexes and filing pipeline
gaps separately, e.g. #691/#694/#697). Tests below are written against
html's real (unstripped) code_stream behavior -- dead_code/macros search
for the literal "<!--" prefix directly, which is why they still work
despite the pipeline bug.

Real bugs found and fixed (8, all the shared-`\b`-next-to-non-word-char trap):

1. `branch`: `*ngIf` (Angular) was inside `\b(...)"[^"]*"` -- `*` is always
   preceded by whitespace in real markup, so the leading `\b` (boundary
   between two non-word chars) never fired. Never matched.
2. `comprehensions`: `*ngFor`, identical shape to #1.
3. `safety`: `pattern="..."`/`sandbox="..."`/`rel="noopener..."`/
   `integrity="..."` all ended on `"` inside a shared `\b(...)\b` group --
   the char after a closing attribute quote is also non-word, so the
   trailing `\b` never fired. 4 of 7 alternatives were dead.
4. `concurrency`: `loading="lazy"`/`fetchpriority="high"/"low"`, same shape
   as #3 (`decoding="async"` happened to self-heal via a coincidental
   substring match on the separate bare "async" alternative -- not a real
   rescue, still fixed for the right reason).
5. `immutability_locks`: `aria-disabled="true"`, same shape as #3 (also
   self-healed via "disabled" being a substring of "aria-disabled" --
   matched regardless of true/false value, which was never the intent).
6. `dependency_injection`: `<script type="importmap"\b` -- trailing `\b`
   right after the closing `"`. Never matched at all, unconditionally.
7. `decorators`: `hidden`/`inert` are true boolean attributes almost always
   written bare (`<div hidden>`); the pattern required `[ \t]*=`
   unconditionally, so the dominant real-world bare form never matched.
   Found while writing this test's own positive case.
8. `reflection_metaprogramming`: `style="[^"]*;"` required a literal
   trailing semicolon before the closing quote -- CSS allows omitting the
   last declaration's semicolon and most real inline styles don't carry
   one. Dropped the requirement.

All 8 independently verified: old-pattern-reproduces / new-pattern-fixes
for each regression, including the two "self-heals but for the wrong
reason" cases (concurrency's decoding=async, immutability_locks'
aria-disabled=true).

Noted but NOT fixed (deliberate scope, not a bug): every attribute-value
pattern in this file assumes double-quoted values only (`"[^"]*"`). HTML
permits single quotes too. Double-quotes are the dominant real-world/
tooling-enforced convention; fixing this would mean doubling nearly every
one of the 39 patterns rather than a narrow, isolated change -- flagged for
awareness, not attempted here.

Verification: strict test file (1502 passed), full default suite (2446
passed, 1 deselected, 1 xfailed, no regressions), ruff/mypy/dead-key audits
clean (3 pre-existing, non-deterministic mypy findings in untouched files
confirmed unrelated), golden_crucible via tests/tools/crucible_check.py:
real diff found (118 differences, confined to exactly 5 real .html files
across 3 different corpus repos), fixtures regenerated and re-verified
clean in both venvs.

Part of #518, closes #587. Pipeline bug filed separately as #733.

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Jul 30, 2026
Adds strict positive/negative, ambiguity-sweep, and ReDoS regression
coverage in tests/core_engine/test_language_standards_strict.py for all
51 non-None rust structural signatures (63 tests). This language
previously had only one isolated regression test (the Rust half of
test_thermodynamic_operator_collisions, covering bitwise_ops vs
closures), not the full per-signature template -- found and fixed 12
real bugs, the largest single-language count in this epic so far.

Real bugs found and fixed:

10 rules shared the identical root cause: Rust's macro-invocation syntax
(`name!(...)`) means the literal `!` is always immediately followed by
`(`/whitespace/`{` in real code, never a word character -- but each of
these rules wrapped a `!`-ending macro-name alternative inside a shared
`\b(...)\b` group with word-ending siblings, so `\b` could never fire.
None of the affected macros ever matched, including some of the most
common constructs in any real Rust file:

1. high_risk_execution: panic!/todo!/unimplemented! never matched.
2. test: assert!/assert_eq!/assert_ne! never matched.
3. globals: lazy_static! never matched.
4. reflection_metaprogramming: macro_rules! never matched.
5. macros: macro_rules! never matched (independent copy of #4).
6. inline_asm: ALL FOUR alternatives (core::arch::asm!/std::arch::asm!/
   asm!/global_asm!) never matched -- the only way to write inline
   assembly in Rust was completely invisible to this signature.
7. telemetry: info!/warn!/error!/debug!/trace!/span! never matched.
8. debug_prints: ALL FIVE alternatives (println!/print!/eprintln!/
   eprint!/dbg!) never matched -- arguably the single most common
   construct in any real Rust codebase.
9. panics_and_aborts: panic! never matched (independent copy of #1).
10. ui_framework: html!/rsx!/view! (Yew/Dioxus/Leptos templating macros)
    never matched.

Plus 2 more, different shapes:

11. dead_code: only checked `//`, missing rust's other real
    recursive_block comment style (nested `/* */`), so block-commented-
    out code was invisible (Engine Rule 12).
12. func_start: the flat `[^>]*` generic step-over broke on nested angle
    brackets in a trait bound -- both one level
    (`fn foo<T: Into<String>>`) and two levels
    (`fn foo<T: Clone + Into<Vec<u8>>>`), both common realistic Rust
    patterns -- silently failed to match the WHOLE function, not just
    the generic part. Widened to tolerate two levels of self-nesting.

Also the now-familiar spec_exposure ReDoS (7th language this epic:
embedded_python, css, tcl, matlab, scheme, typescript, now rust).

Also covers the issue's 2 known ambiguity patterns (bitwise_ops vs
closures -- confirmed no false collision, already independently regression-
tested for Rust's `|a| a+1` case; explicit_casts vs pointers -- confirmed
no false collision), several intentional double-classifications found via
a systematic pairwise token-overlap sweep (pub fn as api+encapsulation,
struct as class_start+structural_boundaries, async fn as concurrency+
func_start, .await as concurrency+structural_boundaries, const fn as
func_start+immutability_locks, panic! as high_risk_execution+
panics_and_aborts, *const as pointers+immutability_locks, macro_rules! as
macros+reflection_metaprogramming), and a full ReDoS scaling sweep.

Golden master fixtures regenerated via tests/tools/crucible_check.py
--update; on-target diff (568 differences, the largest in this round --
rust's corpus spans 6 real subprojects: tokio, bevy, holylang, serde,
syn, wasmtime) confirmed confined entirely to those 6 rust repos, with
count increases exactly matching the fixes' direction (e.g.
wasmtime_pulley_interp.rs: Unit Test Assertions 1->14, Fatal Aborts &
Exceptions 0->1, Preprocessor Macros 0->2, Metaprogramming & Reflection
0->2; custom_keyword.rs: Metaprogramming & Reflection and Preprocessor
Macros both 0->9).

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Aug 12, 2026
…1266 (#1307)

* fix(core): bound prism.py's unbounded single-quote shield -- closes #1302

_strip_nested_comments (the file-level comment/code splitter for scala,
rust, swift via "recursive_block", haskell via "recursive_block_haskell",
and scheme via "recursive_block_lisp") shielded string/char literals with
the shared LITERAL_MASK_PATTERN's unbounded single-quote branch
('(?:\\.|[^'\\])*') before stripping comments. Every one of these
languages has a common source of unpaired single quotes that are NOT real
char literals -- an English contraction inside a comment ("it's"), Scala
Symbol literals ('foo), Haskell's trailing-apostrophe identifiers (x'),
Scheme's quote syntax ('expr) -- and any of these paired up with the next,
completely unrelated, quote anywhere later in the file, masking everything
in between as one giant fake "string". Confirmed on real corpus files:
one Scala file's code_stream dropped to 13.75% of its original size, one
Swift file to 11.06%.

Same bug class already fixed for detector.py's Mode C/D/E shields and
prism.py's own generic REGEX_MATRIX stripper (#1184/#1192/#1222) -- just
never applied to this code path. Fix bounds the single-quote branch's
width to 10 characters, mirroring the already-proven-safe fix
_build_brace_safe_stream applies for Rust's lifetime-annotation 'a
(detector.py). Real char literals in every affected language are at most
a few characters, so the bound can't break a legitimate one while making
the unbounded cascade structurally impossible.

Found while investigating #1266 (scala/matlab/haskell func_start
broadening) -- this fix alone, with zero regex changes, took scala's
func_start recall from 41%->78% and rust's from 78%->99% against
tree_sitter_accuracy_audit.py's committed baselines.

tests/golden_master_audit.json / tests/golden_master_zero_dep_audit.json
regenerated via crucible_check.py --update --yes: 2594/2593 differences,
verified via a structural diff of "6. Parsed Files" confined to raw
signature-count changes only for scala/rust/swift/haskell/scheme files
(a handful of single-file hits in other languages are pre-existing
embedded/misclassified files, e.g. a PowerShell file inside cpp/NVDA,
changed only in globally-derived Topological Coordinates/Testing Exposure
fields, not raw counts). tree_sitter_accuracy_baseline_{scala,rust,swift,
haskell}.json regenerated to reflect the improved recall; rust and swift
also picked up a handful of new extra_functions/extra_classes false
positives now that more code reaches their own func_start regexes for the
first time -- pre-existing per-language false-positive gaps newly exposed,
not caused by this fix, and out of scope to fix here.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(core): bounding alone wasn't enough for backtick -- fold comment recognition into the same atomic shield pass

Bounding the single-quote/backtick branches (previous commit) closed the
worst multi-thousand-character cascades, but a follow-up real-corpus check
(SocketServer.scala) showed it wasn't sufficient on its own: two unrelated
backtick-marked references inside nearby comments -- a realistic, even
common, distance in real files -- can still fall within the same bound and
falsely pair with each other, still swallowing real functions (e.g. a
stray backtick in `// 'protected` to allow override for testing` pairing
with a same-file, few-lines-away `` `counts` `` reference).

Fixed properly by matching the established atomic-pass idiom this bug
class has been fixed with everywhere else (#1184/#1192/#1222, and Mode
B's `_build_brace_safe_stream`, which already includes `//`/`/*` as
alternatives in its own combined pattern): fold single-line-comment
recognition into the SAME regex pass as the string/char/backtick
alternatives, instead of running them as two sequential passes. Since a
comment marker always appears at or before any quote character later on
the same physical line, the comment alternative -- being the leftmost
possible match start -- claims the whole line before the scanner can ever
reach a quote/backtick inside it, regardless of how far away an unrelated
real quote/backtick happens to sit. The width bounds stay as a second,
complementary layer of defense.

Also bounds detector.py's `_build_brace_safe_stream` (Mode B) backtick
branch, gated to scala only (JS/TS's real, legitimately-long/multi-line
template literals must stay unbounded there) -- same shape as the
existing rust-only single-quote bound just above it.

2 new regression tests added (stray unpaired backtick in a comment;
real short backtick-quoted identifier still shielded correctly) --
7 total in tests/core_engine/test_prism_issue_1302.py, all passing.

tests/golden_master_audit.json / tests/golden_master_zero_dep_audit.json
regenerated (crucible_check.py --update --yes) and re-verified confined to
scala/rust/swift/haskell/scheme via the same structural-diff methodology
as the previous commit. tree_sitter_accuracy_baseline_{scala,rust,swift}.json
regenerated for the further recall improvement (scala func_start: 389->415
found; haskell's baseline is unchanged this round -- its own regex is the
remaining bottleneck there, tracked in #1266).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(core): broaden scala/matlab/haskell func_start recall -- closes #1266

Each language's low recall turned out to have a different root cause once
investigated -- none of them were simply "the regex is too narrow" on
their own, though scala's had one genuine regex gap too.

## scala (41% -> 100% func_start recall, 0 false positives)

Two fixes, both in addition to the prism.py apostrophe-swallowing fix
(#1302, stacked underneath this branch) that alone took scala from 41% to
78%:

1. `func_start`'s modifier alternation didn't accept Scala's `private[X]`/
   `protected[X]` scope-qualifier idiom (`private[kafka]`, `private[this]`)
   -- a mainstream idiom, not a rare one. The bare `private`/`protected`
   alternative required trailing whitespace immediately after the
   keyword, so `private[network] def foo` never matched `def` at all: a
   total miss, not a partial one.
2. `_slice_by_braces` (Mode B) assumed every function has a `{` body. Scala's
   idiomatic parenthesis-less/single-expression method body
   (`def foo(x: Int): Int = x + 1`, no braces at all) was silently dropped
   whenever no `{` happened to appear later in the search window. Mirrors
   #789's csharp expression-bodied-member fix (same shape, `=>` there vs.
   bare `=` here) -- since Scala has no reliable terminator, a brace-less
   match's body is bounded by the next `def`/`class` match instead.

(A regex-anchor deletion accidentally introduced while writing fix #1 --
caught by the existing `test_scala_func_start_invalid` gauntlet tests
during full-suite verification, not by the accuracy tool -- is fixed in
this same commit; verified via the adversarial payloads that caught it.)

## matlab (30% -> 100% func_start recall)

Not a regex problem at all: MATLAB was never registered in
`ScopeParsingRegistry`, so it silently fell through to the default Mode B
(brace-based) dispatch -- structurally wrong, since MATLAB uses
`function...end`/`if...end`-style keyword-delimited scopes, not braces
(its only brace usage is unrelated `{}` cell-array literals). `func_start`
itself already matched every real function signature correctly.

Registered matlab as a new Mode D (keyword-scope-tracking) language,
alongside shell/ruby/lua/elixir/vb -- openers include `properties`/
`methods`/`events`/`enumeration` (classdef sub-blocks) so methods-block-
nested functions get their own satellites via the existing
`function_opener` mechanism (#1262), the same way Ruby's nested `def`s do.
Also: added matlab name extraction to `_extract_semantic_name`; added
matlab's `%` comment marker to `_apply_literal_shield` (previously
hardcoded to `#`/`--`/`//` only) and fixed that function's call site to
actually pass `lang_id` through (it was silently always `None`, which also
means ruby/perl/elixir/shell/bash's heredoc-protection branch -- explicitly
gated on `lang_id in [...]` -- had never been reachable either; now it is,
verified via `crucible_check.py` as a genuine, confined improvement for
ruby specifically, no other Mode D language's real corpus output changed);
and special-cased Mode D's EOF-truncation handling so a function that's the
last (or only) one in a file omitting its closing `end` -- valid, common
MATLAB syntax when no local function in the file uses `end` either --
isn't misreported as `name_[Truncated]` (which both hid the real name from
being found AND double-counted as a bogus "extra" name).

Known residual: matlab's classdef sub-block openers (`properties`/
`methods`/etc.) are bare-keyword-matched like every other Mode D language's
openers, so a script calling the builtin introspection functions
`properties(x)`/`methods(x)` inline could false-open a scope -- the same
accepted bare-call-vs-declaration ambiguity class already documented for
other languages (recurring bug class #7 in
`tests/extraction/how_to_harden_extraction.md`), not attempted here.

## haskell (4.3% -> 55.3% func_start recall)

Same root cause shape as matlab: Haskell's indentation-based layout rule
(the "off-side rule") was also falling through to brace-based Mode B.
Routed haskell to Mode C (`_slice_by_indentation`, previously python/yaml
only) instead -- `func_start` already correctly matches a function's
top-level type-signature line (`foo :: Int -> Int`); Mode C's dedent-
boundary scan then needs to extend that match through the actual
equation(s) below it.

That alone wasn't sufficient: Haskell's convention of putting the type
signature and the defining equation on SEPARATE column-0 lines (unlike
Python, where the body is always more-indented than its `def`) meant the
dedent scan stopped at the very next line (the equation itself, also
column 0), capturing only the 1-line signature -- which then failed Mode
C's existing `< 2 lines` floor and got dropped. Added a haskell-specific
check: a dedent-terminating line that starts with the SAME function name
(a continuation clause/equation, not a new definition) doesn't end the
block.

Also extended `_build_indentation_safe_stream` (previously hardcoded to
`#`-comments only) with a haskell branch using `--` comments and a bounded
single-quote (mirrors the #1302 fix's reasoning: Haskell's idiomatic
trailing-apostrophe identifiers, `x'`/`map'`, are a comment/apostrophe-
cascade risk like every other unbounded-quote instance found this session).

Known residual, NOT attempted here: `extra_functions` rose from 2 to 32.
Inspected every sample -- all are point-free top-level VALUE bindings with
a non-function type (`defaultKaTeXURL :: Text` / `defaultKaTeXURL = "..."`,
no `->` in the signature), which GitGalaxy's `func_start` currently treats
identically to a real function (`htmlFormat :: Text -> Bool` / `htmlFormat
= ...`, correctly matched). Tree-sitter's ground truth excludes plain
value bindings. Requiring an eventual `->` in the signature before matching
is a real, scopeable follow-up (bounded lookahead across a possibly
multi-line signature) but risks its own correctness bugs under time
pressure -- left as documented future work rather than rushed here.

## Verification

- New regression tests: `tests/core_engine/test_prism_issue_1302.py` (on
  the stacked branch, not this commit) plus the existing
  `tests/extraction/languages/test_scala.py`/`test_matlab_strict.py`/
  `test_haskell_strict.py` gauntlets, all passing.
- ReDoS scaling check (linear) on every new/changed quantifier: scala's
  `=`-detection lookaround, the haskell continuation-clause check.
- `python tests/tools/audit_check.py`: ruff/mypy/dead-key/ast-accuracy all
  clean (ruff baseline regenerated for pure line-shifts only).
- Full `pytest tests/`: 6826 passed, 2 skipped, 1 deselected, 11 xfailed,
  3 xpassed.
- `python tests/tools/crucible_check.py`: both modes pass after
  regenerating both golden masters. Structural diff of `"6. Parsed Files"`
  confirms every raw-signature-count change is confined to scala/matlab/
  haskell files, plus the one documented ruby side effect (the dormant
  heredoc-gate fix) -- both directly verified, not just eyeballed.
- `tree_sitter_accuracy_baseline_{scala,matlab,haskell}.json` regenerated
  to reflect the measured recall/precision above.

Closes #1266.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Aug 13, 2026
…rect string/comment shielding (#1447)

* fix(powershell): exclude 'param' from func_start + use powershell-correct string/comment shielding (#1436)

Two overlapping bugs:

1. func_start's 2nd/3rd alternatives had no keyword exclusion for
   'param' (unlike if/elseif/while/etc.), so a script-level
   [CmdletBinding(...)]\nparam(...) block matched as if it were a
   function definition.

2. A second, previously-unknown bug in _build_brace_safe_stream: it
   applied C-family string/comment shielding (//, /* */, backslash-
   escaped "...") to powershell, which actually uses #, <# #>, and
   backtick escaping. A backtick-escaped quote inside a real Write-Error
   string caused the shielder to mis-parse a "closed" string early, then
   treat the next literal " as opening an unterminated string spanning
   dozens of lines -- swallowing the real function's own opening brace
   entirely, hiding it from func_start.finditer() itself. This compounded
   with bug #1 so the phantom 'param' match then ran brace-matching
   against a stream where the real function was invisible, consuming the
   rest of the file as its own bogus body.

found_functions 76->110 (exact match on real_functions=110), extra_functions
6->1 (the one remaining is an unrelated audit-tool ground-truth mismatch).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Gemini 3.1 Pro <[email protected]>

* chore(1436): ruff format fix, regenerate powershell accuracy baseline + summary table + golden masters + ruff baseline

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
Co-authored-by: Gemini 3.1 Pro <[email protected]>
squid-protocol added a commit that referenced this pull request Aug 28, 2026
#2378)

* fix(#368): make scan_binary's findings reach the binary_anomaly column

#368 (binary_anomaly SQLite column permanently 0) was closed by #381,
which read equations["sec_extension_mismatch"], then reopened by
population-scale validation (#1144). Two bugs, not one:

1. galaxyscope.py's Binary Analysis Sensor block builds a hit_vector from
   scan_binary()'s output and then never attaches it to
   observation["data"] -- a dead local variable. The signal only ever
   left on the non-durable "equations" dict, so it never survived to
   record_keeper.py. Now attaches hit_vector + a zeroed risk_vector, the
   same way the critical-leak / tensor-scan synthetic artifacts just
   below it do.

2. record_keeper.py read the non-durable equations dict (same root cause
   as #367) -- and neither real producer even writes there:
   signal_processor.py's extension-spoof detection writes raw_signals ->
   hit_vector, and the binary sensor (post-fix #1) now writes hit_vector
   too. Read the durable hit_vector["sec_extension_mismatch"] slot, the
   one already backing the threat_extension_mismatch column. equations
   kept as a fallback. sec_high_risk_execution / entropy stay out per the
   existing double-count reasoning.

Tests: test_record_keeper.py gets a durable-path positive (mock equations
has no sec_extension_mismatch key) + test_binary_anomaly_zero_without_signal
negative guard; test_galaxyscope.py gets test_binary_threat_attaches_hit_vector
proving the observation exposes the signal on a real hit_vector slot.
crucible_check.py: PASS (full_precision + zero_dependency), no golden
master drift.

Closes #368.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* chore: regen ruff/mypy baselines for record_keeper.py line-shift

The #368 fix inserts lines in record_keeper.py and galaxyscope.py above
pre-existing baselined findings; audit_check.py --regenerate confirms all
are pure line-shifts. The regen also drops one stale mypy entry
(full_api_network_map.py:32) that no longer reproduces on current main.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Aug 29, 2026
… badge, 3 engine fixes (#2412)

livecode is a gg_only language (no tree-sitter, no ctags), so the tri-comparison
tool has nothing to reconcile against -- verified by direct source cross-check
against the whole ../language-crucible/data/livecode corpus (97 ingested files).

## class_start -- 57/57 precision, earns a G badge

Every one of the 57 class objects GitGalaxy claims was checked against its
declaration line: 24 `.livecodescript` `script "Name"` + 33 `.lcb`
`module com.x.y`, zero false positives. `map.lcb` is correctly not counted (its
module line is commented out). Recorded in manual_verification.json; the chart
now renders `57/57**` with a GitGalaxy badge for livecode Class Precision.

## Fixes shipped

1. `args` regex was compiled `re.I` only, missing the `re.M` its
   structurally-identical `func_start` sibling carries. The `^`-anchored pattern
   therefore only matched the start of the file -- ZERO `args` matches across the
   entire corpus (every file has a license header before its first handler). The
   pattern itself was already correct on a single line, which is why every prior
   single-line test missed it.
2. `class_start` captured barewords only. `.livecodescript` object exports open
   with `script "Name"` (quoted) -- the dominant form for the Script half of the
   corpus (~63 files), matched by NONE of them. Added a real quoted-name capture
   branch as its own alternation arm; `_resolve_class_start_match` already
   handles the group-1-or-group-2 shape (fortran/lua/abap precedent).
3. livecode was missing from `_CLASS_START_NAMED_EXTRACTION_LANGS` in detector.py,
   so even with the regex fixed the named class list stayed empty (the generic
   fallback regex is lowercase `class|struct|interface|trait|enum`). Added.

New regressions: test_livecode_args_multiline_anchor_regression (would have caught
#1), and quoted-name assertions in the class_start dotted-name regression test.

## Filed, not fixed (out of scope for this pass)

- #2409 -- func_start/args miss LiveCode Builder `handler` syntax entirely
  (0 of 471 `.lcb` handlers detected).
- #2410 -- no ScopeParsingRegistry entry -> Mode B brace-slice fallthrough drops
  780/781 named functions (needs its own if/then/else depth guards, design work).
- #2411 -- leading UTF-8 BOM never stripped -> defeats `^`-anchored line-1
  extraction; 38 more real livecode classes missed (58 BOM files across 6
  languages corpus-wide, engine-wide gap).

## Verification

livecode extraction gauntlet + strict (113 passed), core-engine suite (674
passed), audit_check (ruff/mypy/dead-key/ast-accuracy clean), crucible_check
against the full ~80-repo corpus (all diffs livecode-only: Function Parameters
0 -> real, Class/Entity 0 -> 1, plus topological/structural-magnitude ripple
recomputing from the corrected counts -- zero diffs in any other language),
both golden masters re-blessed. See docs/language_status/livecode.md section 9.

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Aug 30, 2026
…er shapes validated (#2513)

Closes out the tri-skill validation pass (harden-language-extraction,
harden-strict-signatures, tri-comparison-ledger-sweep) on sqlite, the newest
crucible language category (PR #13/#17).

**Real bug #1 (recall):** sqlite was never added to detector.py's
_CLASS_START_NAMED_EXTRACTION_LANGS, so its already-hardened epic #813/#836
class_start regex (CREATE TABLE) never reached named-entity output --
class_data stayed permanently empty (0 of 73 real tables) despite the regex
itself working. Added sqlite to the allowlist.

**Real bug #2 (precision):** the newly-populated class names came out with
their SQLite quote characters still attached ("User" instead of User) for
any double/backtick/bracket-quoted table -- class_start's capture group
includes the quotes by design (epic #813/#836 kept them in a single group to
preserve the "group 2 == inheritance parent" convention every other
allowlisted language relies on). Added a sqlite-scoped quote-strip in
splice() so the stored name is the bare identifier, matching ctags/SQLite
itself.

**Real bug #3 (dependency-graph precision):** _dependency_capture's
`.import`/`.read`/`.load` alternative captured the first whitespace-
delimited token unconditionally -- SQLite CLI's real `.import` accepts
leading flags (`-csv`, `-colsep ","`, `-skip N`, ...), so
`.import -csv file1.csv t4` captured the flag `-csv` itself as the
"dependency path", a real false positive. Fixed by requiring the captured
token not start with `-` (trades a miss for never a wrong path, matching
this signal's existing bias elsewhere in the file).

Verified against the live tri-comparison gatherer (not just the regex in
isolation): class existence is now 73/73 (100% recall) against ctags'
66/73, a strict superset -- the 7 gitgalaxy-only occurrences are all
independently confirmed real tables ctags' SQL parser misses (virtual
tables, tables after a leading `BEGIN;`, backtick-quoted identifiers).
Function existence (262 gitgalaxy `*_Statement` satellites vs. ctags' 0
`f`/`p` tags) is a genuine different-question case, same "closest
function-shaped construct this language has" precedent as css's at-rules --
SQLite has no CREATE FUNCTION/PROCEDURE syntax for ctags to find.

Both docs/self_scan/tri_comparison_ledger.json shapes recorded as
`validated` with full investigation writeups (class: credit gitgalaxy;
function: no credit, since crediting would misstate "ctags should have
agreed" rather than "nothing for ctags to find"). Chart/report regenerated
--all --write per repo convention; only sqlite's two shapes changed
(verified via structural diff against main), no other language disturbed.

audit_strict_coverage.py confirms sqlite's strict-signature suite (epic
#1069) already has zero gaps (43/43 applicable signatures, 81 cases) --
harden-strict-signatures needed no changes.

Filed #2512 separately (not fixed here, out of this PR's scope): two
aperture heuristics (infra_path_pattern's `generated`/`scripts` segments,
the content-based "Machine-Generated Source Code Signature" gate) silently
exclude 33 of the sqlite corpus's 73 git-tracked .sql files from ever being
scanned -- a real corpus-utilization gap, but pre-existing and orthogonal to
this pass's extraction-correctness fixes.

Verification: crucible_check.py clean on both venvs (no golden-master
diff), audit_check.py clean, full extraction+strict+detector+core_engine
suites pass (166 sqlite gauntlet/strict tests + 1 new detector-level
allowlist/quote-strip test, 859 passed across the broader suite).


Claude-Session: https://claude.ai/code/session_014BKXKcW29F3pTm7To2wMwS

Co-authored-by: Claude Sonnet 5 <[email protected]>
squid-protocol added a commit that referenced this pull request Nov 7, 2026
…ime) replaces galaxy; clearer file green; agents files labelled and contained

- lattice: single-column Yes/No fingerprint; a real growth-tree chain (#14 -> #1 -> #2 -> #5 -> #12 -> #13 -> #26), each
  step one family with its real function count and level; then the whole 200-shape family. Refuses non-one-family steps.
- call graph + agents: files in a distinct green (34,197,94) vs blue functions
- agents: file circles computed from final dot positions (always contain their dots), separated in screen space,
  every file labelled (the 1-function files are real shell scripts: build.sh, engine)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY
squid-shepherd Bot pushed a commit that referenced this pull request Nov 8, 2026
…tour + call-graph zoom-out), rendered from real engine output (#8036)

* docs/media: animations of what the engine reads (function explainer in C/Python/Java/COBOL, call-graph zoom-out) + generators

Rendered from real engine output: scripts/media/function_explainer.py scans the file, takes the function's
DB row, locates every counted keyword-rule match on the engine's comment-free code stream and refuses to
render if a highlight count differs from the engine's; scripts/media/callgraph_explainer.py animates the
scan's graph output (calls_out_to + imports) from one function to the whole codebase. README gets the C
explainer under the headline table. zlib sources attributed (zlib license); the other examples are ours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media: separate size/comments and fingerprint bands, larger legends; galaxy styling for the call graph

Function explainer: the record panel now has three non-overlapping bands (legend rows at 19/28 px,
size & comments, fingerprint). Call graph: deep-navy sky, glowing per-file clusters in cool tones, glowing
cyan calls / violet cross-file calls / pink imports, amber traced path, larger legend and status text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media: call graph in four plain colours (functions blue, files green, calls red, imports yellow)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media: five more explainers from real data (galaxy, same-job agents, DOOM ports, copy-finding, COBOL->Java ladder)

- galaxy: gzeof's shape (#13 of the population lattice, 54,522 functions) and the 200-shape lattice, with GitGalaxy's
  real week-to-week shape moves
- agents-same-job: agent-habits Java chess by Sonnet / Haiku / Codex, call graphs + shape mix, with the WILD caveat
- doom-ports: DOOM's DNA wiring kept per port vs shuffled baseline (docs/wiki/museum-of-code/doom-dna/data.json)
- copyfinding: OpenSSL -> BoringSSL C++ by structure, ranks recomputed with the LAY scorer; leads with the general
  44% (572 copies), the study's 94% labelled as the CVE subset
- proof-ladder: COUSR01C at L5 from the published evidence report, levels never called proven
docs/media/README.md documents each with sources and caption caveats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media: lattice explainer (shapes built one keyword family at a time) replaces galaxy; clearer file green; agents files labelled and contained

- lattice: single-column Yes/No fingerprint; a real growth-tree chain (#14 -> #1 -> #2 -> #5 -> #12 -> #13 -> #26), each
  step one family with its real function count and level; then the whole 200-shape family. Refuses non-one-family steps.
- call graph + agents: files in a distinct green (34,197,94) vs blue functions
- agents: file circles computed from final dot positions (always contain their dots), separated in screen space,
  every file labelled (the 1-function files are real shell scripts: build.sh, engine)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media: no intro slides + GitGalaxy corner mark on every film; lattice ends with real-size unlabelled dots, alternate parentage and a closing title

- scripts/media/_brand.py: plain 'GitGalaxy' bottom-right on every frame; every generator's title card removed
- lattice: after the chain, dots are unlabelled and sized by functions sharing the shape; light grey dotted lines
  show the 219 alternate-parent links (148 of 200 shapes), the chain's own alternates highlighted; closing title
  '6.9 million functions · 571 repositories · 56 languages · 14 shape families' (counts from the population DB)
- attribution lines shortened so they never run into the corner mark

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media lattice: closing title at the bottom without a box, headline 'half (49.7%) fall into the 200 shapes drawn'; purple shapes; subtle grey alternate parents

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media lattice: portrait 1280x1440, packed level columns (no overlap), every circle the same purple and transparency at the end

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media lattice: after the example path, the left panel shows the final results; the chain fades into the plain lattice (no history); legend shows only what is on screen

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media function films: constant title 'How GitGalaxy Reads a Function' on every frame

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* docs/media: new illustration 'Did someone copy your function?' (made-up sea of repos/files/functions, 50 misses, then a renamed match)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

* README: fingerprint-match illustration under the function film; proof-ladder film in CICS to Java; call-graph film in Graph validation

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvh3Fv4eomruTgx3VvY

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-protocol added a commit that referenced this pull request Nov 9, 2026
…s, template holes, Go scoping, overload filter, and more (Part of #8161) (#8175)

* calls: a same-name call through another receiver is not recursion (X1, Part of #8161)

The detector dropped every callee spelled like its own unit, whatever the
receiver, so `super().m()` in `m`, `w.next.Close()` in Go's `Close`,
`self.repo.save()` in `save`, `Base::Put(k)` in `Put` and zod's
`inst.optional = () => optional(inst)` all vanished. Now a same-name call is
recursion only when it is bare or on the unit's own receiver (`self`, `this`,
`cls`, `Self`, `static`, the Go method's receiver variable); otherwise it is
kept with only its foreign qualifiers, and the resolver prunes any link that
still lands on the unit itself (as it already did for #5628 / #5699).

- Python: a `super(...)` receiver is recorded as `super`, so the resolver's
  parent-class walk runs (every subclass `__init__` regains its parent edge).
- JS/TS: a `member`-shaped unit (object-literal method, `inst.f =` arrow)
  counts as a method for the #5699 bare-name rule, and a bare `f(` past an
  arrow is a body call (a member-assignment header never spells `f(`).
- Objective-C is left out: the resolver cannot narrow by a send's receiver.

Gates (call_graph_resolution, before -> after):
- python crucible: recall 51.2 -> 52.6, resolution recall 97.8 -> 96.3,
  ambiguous precision 60.0 -> 45.0 (166 new unconfirmed receiver rows);
  flask lane: recall 40.4 -> 41.0, precision 99.7 -> 99.4
- typescript: recall 68.8 -> 70.4, resolution recall 88.6 -> 88.3
- javascript: recall 77.8 -> 78.0; java: recall 72.5 -> 72.7
- rust: recall 60.4 -> 60.7, precision 93.7 -> 93.5 (two `fmt` trait
  delegations land on another `fmt`), resolution recall 65.0 -> 61.2
- cpp: recall 30.9 -> 31.4, precision 85.8 -> 85.2 (newly kept
  `fmt::format`-style calls take the same arity-only overload guess as every
  other caller: 16 agree, 11 wrong), resolution recall 55.8 -> 54.6
- go: resolution recall 80.0 -> 78.9

Resolution recall falls by composition: the newly extracted names enter its
denominator before the resolver can type their receivers. Baselines
regenerated; golden masters re-blessed (calls_out_to and the call-derived
graph metrics move). Level-1 call_graph_accuracy is unchanged (it drops the
unit's own name on both sides).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* calls: built-in and standard-library guards for Go, Rust and C++ (X2, Part of #8161)

- Go's predeclared functions (`len`, `append`, `cap`, `make`, `new`, `copy`,
  `delete`, `close`, `clear`, `min`, `max`, `panic`, `recover`, `print`,
  `println`, `complex`, `real`, `imag`) join `_BARE_BUILTINS`: a bare call
  never links to a repo method of that name (prometheus' #1 hub was
  `(*memChunk).len`, fed by 248 bare `len(`). A free function of the name in
  the caller's own package still shadows the builtin, as in Go.
- A Go method (`func (s *S) f(`) is now `member`-shaped, so a bare Go call
  reaches free functions only, like every other language with owners. A
  method's bare self-name call with no free function to reach stays pruned
  as recursion (#5699).
- Standard-library / interface method names on an UNTYPED receiver are the
  ambiguous `receiver` guess (the #3756 rule, extended): Go `Close`, `Error`,
  `String`, `Lock`/`Unlock`/`RLock`/`RUnlock`, `Load`, `Store`, `Next`,
  `Err`; Rust `len`, `iter`, `clone`, `into`, `unwrap`, `as_ref`, `fmt`;
  C++ `size`, `data`, `begin`, `end`, `push_back`, `c_str`. Java's
  `toString`/`equals`/`hashCode` were already listed.

Gates (call_graph_resolution, before -> after):
- go: precision 98.7 -> 98.8, strict precision 90.3 -> 94.5, ambiguous
  precision 61.2 -> 61.7, recall 70.4 -> 70.2, resolution recall 78.9 -> 78.6
- cpp: precision 85.2 -> 86.7, strict precision 75.1 -> 76.8, recall
  31.4 -> 31.1, resolution recall 54.6 -> 54.1
- rust: precision 93.5 -> 93.7, strict precision 88.1 -> 88.6, ambiguous
  precision 58.9 -> 56.9 (all from `fmt`: two `Display::fmt` delegations no
  longer land on another `fmt`; serde has no untyped `len`/`iter` link)
- typescript: resolution recall 88.3 -> 88.4; others unchanged.

Baselines regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* calls: template-literal and f-string holes are calls; JS regex literals shielded (X6, Part of #8161)

The literal shield blanked a JS/TS template literal or a Python f-string
whole, so `${helper(n)}` and `f"{helper(n)}"` never reached the calls scan
(zod: 29 edges alone, ~125 more behind the arrow-span cut). The new
`template_holes` module does for them what `csharp_interpolation` does for
C# (#6266): each literal becomes `""` plus its hole expressions as `+(expr)`
terms before the shield runs, so nested strings and templates inside a hole
stay blanked and the call pattern finds the calls. Python handles r/b/f
prefixes, triple quotes, `{{` escapes and `!r` / `:spec` / `=` endings.

The JS/TS regex-literal bug is fixed with it: a `/.../` literal in value
position (after `( , = : [ ! & | ? { ; ~`, `=>`, or a keyword such as
`return`) is now shielded, in the literal shield and in the brace-safe
slicing stream (same length, the preceding character kept). A quote or
backtick inside one (`/^[a-z`{|}~-]+$/`) no longer pairs with a later one
and hides every unit in between (zod's core/regexes.ts, axios'
AxiosHeaders.js).

Gates (call_graph_resolution, before -> after):
- typescript: recall 70.4 -> 72.2, resolution recall 88.4 -> 88.7,
  ambiguous precision 20.0 -> 20.2; 1883 -> 1930 judged, precision 99.5
- javascript: recall 78.0 -> 81.8, resolution recall 90.1 -> 91.6, strict
  precision 97.4 -> 97.5; 415 -> 435 judged, precision 99.3
- python crucible: recall 52.6 -> 52.7; flask lane: recall 41.0 -> 41.2,
  resolution recall 88.8 -> 88.9
New confident links: 20 + 47 agree, 0 wrong (JS + TS). import_graph_accuracy
unchanged. Baselines regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* TS/JS: a block-bodied arrow ends at its balanced brace, not at a nested function (T1, Part of #8161)

`_ts_js_arrow_body_end` capped a `{` body at the next `func_start` match, so
`const C = () => { function g() {} ... }` ended at `g` and every call after
it belonged to no unit: zod's 61 `error` arrows in src/v4/locales (256
reference edges), and every React component that declares a handler with
`function`. #3642 (C8) already moves a nested unit's own calls out of its
parent, so the cap is no longer needed for correctness. An expression body
keeps the cap.

Gates (call_graph_resolution, before -> after):
- typescript: recall 72.2 -> 82.1, resolution recall 88.7 -> 89.8;
  1930 -> 2197 judged, precision 99.5 (unchanged)
- javascript: recall 81.8 -> 87.9, resolution recall 91.6 -> 91.9;
  435 -> 467 judged, precision 99.3 -> 99.4
tree_sitter_accuracy_audit and tri_comparison (typescript, javascript)
match their baselines. Baselines regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* TS: a namespace alias reaches the module's export, not an object-literal member (T3a, Part of #8161)

`ns.f()` through `import * as ns` (#3788) took any owner-less definition of
`f` in the aliased module, members included: 9 of the 10 confident wrong
links on zod were `z.set(...)` landing on a descriptor's `set(...)` and
`z.toJSONSchema(...)` on a class-less object's method. The alias branch of
`_resolve_one` now leaves `member`-shaped definitions out in TypeScript. In
JavaScript a member yields to a real export but is kept when the module has
nothing else of the name, because a CommonJS module's exports ARE members
(`exports.f = function`; excluding them outright cost 4 correct axios links).

Gates (call_graph_resolution, before -> after):
- typescript: precision 99.5 -> 100.0, strict precision 99.5 -> 100.0,
  recall 82.1 -> 82.3, resolution recall 89.8 -> 89.9, ambiguous precision
  20.2 -> 20.0; 2197 -> 2190 judged
- javascript: unchanged
Baselines regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Rust: `Self::f()` is a self call, `super::f()` the parent module (R3, Part of #8161)

`Self` was no self receiver, so `Self::double(x)` inside an impl searched
methods only and found nothing (94 missed edges over the study's 3 repos).
`super` was read as a parent CLASS (`_SUPER_RECEIVERS`), so with no lineage
every `super::helper()` in a test module resolved to `none`. Now, in Rust:

- `Self::f()` takes the `self.f()` path (`_IMPL_SELF_LANGS`: any visible
  definition, the caller's own file first);
- `super::f()` is a bare lookup of a free function: the caller's own file
  first (an inline `mod tests` sits in its parent's file), then the files
  that can hold the parent module (`mod.rs`, `lib.rs` / `main.rs`,
  `<dir>.rs`) -- a sibling module's `f` is not reached; else the usual
  ladder, a lone definition elsewhere being `unseen`;
- `super::m::f()` drops the `super` segments and resolves `m::f()`.

Gates: rust (serde-rs/json) precision 93.7 and recall 60.7 unchanged, ambiguous
precision 56.9 -> 56.7 (3 new ambiguous rows): its
only `Self::` / `super::` sites have no rust-analyzer function to map to.
Baseline regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Go: a bare call follows Go's scoping -- own file, own package, dot imports (G3, Part of #8161)

A bare Go call ran the generic ladder: own file, then any IMPORTED file
(so `New()` in package util linked to an imported `labels.New`, 41
confident-wrong links on prometheus), then `unique`, then `nearest`/`tie`
(758 + 100 same-package calls left ambiguous on prometheus). Go puts only
the caller's own package, and the packages it dot-imports, in bare scope:

- own file -> `file`;
- own package directory -> `import`, confident even when other packages
  define the name (several files of the package defining it are build-tag
  variants: `tie`);
- dot-imported packages (`import . "pkg"`, now recorded as namespace
  imports `{". " + path: path}` and resolved like JS namespace aliases)
  -> `import`;
- anything else -> the ambiguous `unseen` guess. An ordinary import never
  reaches a bare call.

Gates (call_graph_resolution, go: cobra + gin, before -> after):
precision 98.8 -> 98.9, strict precision 94.5 -> 94.6, recall 70.2 -> 71.4,
resolution recall 78.6 -> 80.0, ambiguous precision 61.7 -> 58.0 (the 54
right same-package guesses became confident). +55 confident agree, -1
confident wrong. import_graph_accuracy unchanged. Baseline regenerated;
golden masters re-blessed. test_call_resolver's same-package case now
expects `import` (scoped) instead of `unique`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Java/C++: the overload guess fits the argument count, and overload rows join the file graph (J2, Part of #8161)

When a call's argument count still matches several overloads, the
ambiguous `overload` row kept the class's first overload as its guess,
whatever its arity (`indexOf(array, v)` guessed the 3-parameter
`indexOf(int[], int, int)`). The guess is now an overload the count fits.
In 1,637 of 1,637 gson overload rows the file was already right (every
candidate is in that file, on one class), so an `overload` row now joins the
FILE graph (`confident_file_pairs`): file PageRank and blast radius see the
calls into overload-heavy utility classes. It never joins the function
graph.

Gates (call_graph_resolution, before -> after):
- java: ambiguous precision 13.6 -> 34.3 (study prediction: 35.3);
  confident metrics unchanged (99.8 / 72.7)
- cpp: unchanged
Baselines regenerated; golden masters re-blessed (file-graph metrics move).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* calls: split a recorded parent clause into one lineage key per parent (J5, Part of #8161)

A class header's whole parent clause was recorded, and used, as ONE
lineage key: Java's `Holder<String> implements Scaled, Serializable` (62%
of gson's inheriting classes), Python's `Base, Mixin, metaclass=M`, C#'s
`Base<int>, IFoo`. It matched no class, so an inherited method reached by a
bare or `self.` call was unreachable (`hold()` in `Impl`: no row). The
resolver now reads each entry through `_parent_names`: type arguments,
subscripts and call parentheses go, the list splits on commas and keywords
(`extends`, `implements`, access specifiers), and a `name=value` keyword
argument is no parent. Applied in `_ancestry` and the per-file parent map
alike; the recorded class data is unchanged.

Gates (call_graph_resolution, before -> after):
- java: recall 72.7 -> 72.9, resolution recall 73.2 -> 73.3, ambiguous
  precision 34.3 -> 34.5; 5728 -> 5740 judged, precision 99.8
- python crucible: resolution recall 96.3 -> 96.4; 1880 -> 1881 judged
- cpp, typescript, javascript unchanged
Baselines regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Java: field types come from field declarations only, not other methods' locals (Part of #8161)

A receiver a Java function does not declare is read as a field and typed
from the file's declarations. Those were read over the WHOLE file, locals of
every method included, so `os.forEach(c -> c.area())` on a `List<Other>`
took the type of another method's `Tool c` and made a false confident
`typed` link to `Tool.area`. The file-wide map is now built from
`_java_field_text`: the file with every method, constructor, lambda and
initializer body and every parenthesised list blanked (same length), so
only class-level field declarations remain. A name only other methods
declare gets no type (it used to get the "" of a clash when two of them
disagreed: test_detector's `twice` case is updated to say so).

Gates (call_graph_resolution, java): precision 99.8, recall 72.9 and the
other gated metrics unchanged; confident links scip-java resolves outside
the repo 105 -> 104. Baseline regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* C: the nearest-path pick among several definitions is confident (`proximate`, C5, Part of #8161)

In C, `nearest` almost always means "the variant in my own platform
directory": aix.c calling `uv_mutex_lock` links unix/thread.c, not
win/thread.c. Across the study's 5 C repos the picks were 363 of 363 agree,
0 wrong. For C only, `_ladder` now returns that pick as the new confident
step `proximate` (resolution `unique`; ranked after `unique`), so it joins
the function and file graphs. Every other language keeps the ambiguous
`nearest` guess. The edge-kind contract lists the new step.

Gates (call_graph_resolution, c: libuv + hiredis, before -> after):
recall 47.5 -> 50.1, resolution recall 51.8 -> 54.6; 6313 -> 6653 judged,
precision 100.0 and strict precision 100.0 unchanged. import_graph_accuracy
unchanged. test_call_resolver's generic nearest-guess case now uses C++.
Baseline regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Python: every module-level instance types its name in the file's functions (Y1, Part of #8161)

`app = FastAPI()` at the top of a file typed `app` in every function only
when some module-level statement also called a method on it: the module
unit computed receiver types for the qualifiers it calls itself. A test
file whose decorators and calls all sit inside test functions (`@app.get`
nested, `client.get()`) got ambiguous `receiver` rows. The module unit now
types every column-0 binding (`name = ...`, `name: T = ...`) with the same
`_python_receiver_types` rule (a name bound twice differently stays "", and
the resolver keeps only a class it knows).

Gates (call_graph_resolution, python crucible, before -> after): recall
52.7 -> 52.8, resolution recall 96.4 -> 96.5, ambiguous precision
45.0 -> 35.3 (right receiver guesses became confident `typed` links);
1881 -> 1884 judged, precision 99.9; decorator links 575 -> 580 judged,
100% precise; recall over all kinds 78.5 -> 78.7. Flask lane unchanged.
Baseline regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Python: a reference opening a continuation line is a reference (Y5, Part of #8161)

`_python_references` stripped only spaces and tabs before a candidate, so a
function used as a value at the start of a continuation line -- Black's
`register(\n    handler,\n)`, a multi-line default `partial(\n gen_id\n)`,
`self._emit_pool_metrics,` -- left the text before it ending in a newline
and failed every position test. When the line before ends in `(` or `,`, the
newline is now skipped too; a name on a line of its own, or after a block's
`:`, is still no reference.

Gates (call_graph_resolution, python, before -> after): reference links
(not gated) crucible 345 -> 363 judged at 99.7%, flask 105 -> 117 judged at
100%; recall over all kinds 78.7 -> 79.2 (crucible). Gated call metrics
unchanged. Baseline regenerated; golden masters re-blessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* README: call resolution is measured in eight languages; numbers from the baselines (Part of #8161)

The "Accuracy, measured" call-resolution bullet listed only Python,
TypeScript and Java, with numbers from September (Java 93.2% precision /
44.2% recall; the baseline now says 99.8 / 72.9). It now gives all eight
measured languages -- C, C++, Go, Java, JavaScript, Python (crucible and the
flask lane), Rust, TypeScript -- each with its reference tool and version,
corpus, confident precision, judged links and recall, read from the
committed tests/call_graph_resolution_*baseline.json at this commit. The
recall-gap plan points at epic #8161; epic #3772 stays as the plan for
measuring more languages. The coverage chart is regenerated from the
baselines by its workflow and is not touched here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* detector: test the JS regex-literal branch by `lastgroup`, not a groupdict read (Part of #8161)

The brace-safe stream's `fast_shield` asked `m.groupdict().get("jsrx")`
to see whether the X6 regex-literal alternative matched. dead_key_audit
reads that as a dict key with no writer (the named group lives in a regex
string). The alternative's literal is the pattern's last named group, so
`m.lastgroup == "jsrx"` says the same thing without a key read, and the
shield's output is unchanged (rx_pair.ts keeps both units; no golden moves).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* calls: a parent clause cut inside its type arguments still names its parent (fixes J5, Part of #8161)

The Java detector records `extends DoomColumnFunction<byte[],short[]>` as
`DoomColumnFunction<byte` (its regex stops at `[`). J5's `_parent_names`
required every list entry to be a whole identifier, so that unbalanced
entry was dropped, the class lost its only parent, and `_expand_super_ctor`
no longer turned a constructor's `super(...)` into a call to the parent's
constructor. DOOM-rosetta's mochadoom showed it: 71 `super(...)` edges
missing against the tree-sitter body oracle (recall 1.0 -> 0.986, PERFECT
-> 6/7). A list entry now names the identifier it starts with (an entry
holding `=` is still a keyword argument, not a parent); mochadoom is back
to recall 1.0 / PERFECT. Two regression cases join test_parent_list_split.

Gates: java 5740 -> 5741 judged, every gated metric unchanged (baseline
regenerated); golden masters unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* DOOM-rosetta: the tree-sitter body oracle reads template and f-string holes as code (Part of #8161)

X6 made the engine scan JS template `${...}` and Python f-string `{...}`
holes. ts_callgraph_oracle still skipped every string node whole, so each
call in a hole became a scored "comment/string" engine-only edge: mood 1
(`{game_state.to_cobol_format()}`), room4doom 1 (`{len(verts)}`), sqldoom 7
(`{snapshot_health(...)}`, `{weight(...)}`, `{radius(...)}`,
`{stage_names(...)}`, `${stamp()}` x3). Each was read in the port's source:
all are real calls that run when the string is built, so the engine is right
and the oracle was wrong. The oracle now walks a string node's
`interpolation` / `template_substitution` children as code (a plain string
naming a function stays text); a regression test covers both languages.
mood, room4doom and sqldoom match their goldens again.

Re-blessed golden: cssdoom, src/renderer/scene/scene.js func_hash only:
`preloadTextures` complexity 9 -> 8. Verified in the source: the function
has 7 branch points (four `for`, three `if`), so 8 is right. The old 9
counted a `?` inside the regex literal `/url\(['"]?([^'")\s]+)['"]?\)/`,
which the X6 JS regex-literal shield now blanks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* call-graph gate: the flask lane's baseline takes CI's pyan reference numbers (Part of #8161)

graph-accuracy-audit's call-python job failed the flask (`import_graph`)
lane: resolution recall 88.9 -> 88.3. The engine side is identical on CI
and locally (312 judged links, 99.4% precision); the difference is the
reference: pyan3 2.9.0 under CI's Python 3.12 yields 749 flask edges (326
named), the local run 752 (324), deterministic across hash seeds and with
the cache off, on the same flask commit d73fa1cd. The offset predates this
PR: on PR 1's head CI read 88.7 / 40.6 against the locally made baseline of
89.2 / 40.4, inside the 0.5 pp tolerance only by luck. The lane's section
now holds CI's numbers (taken from run 42649894567's JSON through
`gated_metrics`): pyan edges 749, recall 41.4, resolution recall 88.3,
recall with decorators 47.9, all kinds 63.6; the rest unchanged. The local
run (41.2 / 88.9) passes against it. The crucible lane already matched CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant