Skip to content

fix(core): remove MAX_SATELLITES cap on function extraction - #1063

Merged
squid-protocol merged 1 commit into
mainfrom
fix-1054-max-satellites-truncation
Aug 5, 2026
Merged

fix(core): remove MAX_SATELLITES cap on function extraction#1063
squid-protocol merged 1 commit into
mainfrom
fix-1054-max-satellites-truncation

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • detector.py's MAX_SATELLITES = 250 cap silently discarded any functions beyond the 250th in a single file, enforced both via early-exit breaks in _slice_by_labels/_slice_by_braces/_slice_by_indentation and a final truncation in _function_slice — with no flag, log, or trace for consumers.
  • Only 5 files in the ~935-file language-crucible corpus ever hit it (csharp/roslyn/LanguageParser.cs, dart/flutter/semantics.dart, zig/zig/InternPool.zig, rust/wasmtime/wasmtime_pulley_interp.rs, agc_assembly/apollo-11/PINBALL_GAME_BUTTONS_AND_LIGHTS.agc), but their real function counts (406–607, confirmed locally) were frozen at exactly 250, understating file_impact/mass and blinding downstream risk ranking for high-function-density files.
  • Removes the cap entirely (option A from the issue) rather than just surfacing a truncation flag: finditer() already scans every match unconditionally regardless of the cap, so the only added cost is _calculate_block_metrics on the extra matches for those 5 files — negligible against the corpus as a whole.

Why the golden master diff is large

Per the repo's Differential Scan protocol, both tests/golden_master_audit.json and tests/golden_master_zero_dep_audit.json were regenerated via tests/tools/update_golden_master.py --yes and re-verified clean with tests/tools/crucible_check.py (both full-precision and zero-dependency venvs). The diff is ~309 entries, but single-cause: those 5 files' true structural mass now ripples into repo-wide health/composition summary stats and the 3D spatial layout (X/Y/Z coordinates are relative across the whole corpus via PageRank/blast-radius, so any file's mass shift nudges everyone else's position slightly). No unrelated files' function counts or content changed.

Test plan

  • python -m pytest tests/core_engine/ tests/extraction/ — 5194 passed
  • python -m pytest tests/ (full suite) — 5447 passed, 0 failures
  • python tests/tools/audit_check.py --regenerate — clean (ruff baseline absorbed pure line-shifts only, mypy unaffected)
  • python tests/tools/crucible_check.py — PASS on both full_precision and zero_dependency venvs after re-blessing golden masters
  • Manually confirmed real function counts for the 5 previously-capped files (550, 406, 437, 607) now exceed the old 250 ceiling

Closes #1054

🤖 Generated with Claude Code

detector.py silently discarded functions beyond the 250th in any single
file, both via early-exit breaks in each slicing mode and a final
truncation in _function_slice. Only 5 files in the ~935-file crucible
corpus ever hit it, but those files' real function counts (406-607) were
being frozen at exactly 250 with no signal that anything was dropped,
understating file_impact/mass and blinding downstream risk ranking for
high-function-density files.

Removes the cap entirely rather than surfacing a truncation flag, since
so few files are affected that the extra _calculate_block_metrics cost is
negligible against finditer() already scanning every match unconditionally.

Golden masters re-blessed (crucible_check.py verified clean after): the
diff is large (309 entries) but single-cause -- those 5 files' true mass
now ripples into repo-wide health stats and the 3D spatial layout, whose
coordinates are relative across the whole corpus.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 60849d0 into main Aug 5, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the fix-1054-max-satellites-truncation branch August 5, 2026 21:02
squid-protocol added a commit that referenced this pull request Aug 5, 2026
…ers (#1065)

Prompted by #1054/#1063: the issue text already quoted exact lines to
change in detector.py, so the fix skipped the self-scan DB and
architecture brief entirely -- reasonable under the existing wording
("reach for these... when the question is really how big/risky/
depended-on is this thing"), since locating the code wasn't in
question. But it also meant a free orientation check (detector.py
turned out to sit at 100% exposure in the brief's risk lists) went
unused. Makes explicit that knowing where to edit isn't the same as
knowing a file's risk standing, so the orientation step still applies.

Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

bug(core): MAX_SATELLITES cap silently truncates function extraction in dense files

1 participant