fix(core): remove MAX_SATELLITES cap on function extraction - #1063
Merged
Conversation
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>
Contributor
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>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
detector.py'sMAX_SATELLITES = 250cap 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_indentationand a final truncation in_function_slice— with no flag, log, or trace for consumers.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, understatingfile_impact/mass and blinding downstream risk ranking for high-function-density files.finditer()already scans every match unconditionally regardless of the cap, so the only added cost is_calculate_block_metricson 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.jsonandtests/golden_master_zero_dep_audit.jsonwere regenerated viatests/tools/update_golden_master.py --yesand re-verified clean withtests/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/Zcoordinates 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 passedpython -m pytest tests/(full suite) — 5447 passed, 0 failurespython tests/tools/audit_check.py --regenerate— clean (ruff baseline absorbed pure line-shifts only, mypy unaffected)python tests/tools/crucible_check.py— PASS on bothfull_precisionandzero_dependencyvenvs after re-blessing golden mastersCloses #1054
🤖 Generated with Claude Code