Repository navigation
fix(#4110): one shared definition of "a function" for counting and listing - #4113
Merged
Merged
Conversation
…sting The audit's "5. Function Analysis" listed 48,318 functions on language-crucible while the scan DB's function_data held 45,550. Both filter the same list, on different flags: the DB (and every per-function statistic, #2691) excludes all slicer-synthesized units (`is_synthetic_slice`), while the audit excluded only `calls_only` -- so `__global_context__` buckets, `Anonymous_Block`s and Mode E statement slices (`CREATE_Statement`, `Declarative_Block`, ...) were reported as functions in 555 files (shell, lua, livecode, sql, ...). - gitgalaxy/core/function_population.py: is_population_function / population_functions, the single predicate. - Used by every site that counts or lists functions for reporting: the audit's Function Analysis, the LLM brief's top-impact and per-file function lists, the function rankings, the folder roll-up func_count, and record_keeper's per-file population (whose comment wrongly said buckets keep function_data rows -- they go to synthetic_unit_data). - Deliberately unchanged: file mass/impact (buckets carry mass), the composition archetype's log_function_count (a trained feature -- changing it needs trainer parity), and language-identity's named-structure check. Golden masters re-blessed: only 5_function_analysis moves; both fixtures now list exactly 45,550 functions, matching function_data. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts: # gitgalaxy/recorders/audit_recorder.py # gitgalaxy/recorders/llm_recorder.py # gitgalaxy/recorders/record_keeper.py
Contributor
squid-protocol
added a commit
that referenced
this pull request
Oct 2, 2026
…4123) The loop guard skipped the bot's own record merge, but a queued-then-skipped run still displaced (cancelled) the pending run of the real engine change ahead of it in the concurrency group -- #4113's merge was never measured that way. Exclude the record file from the trigger paths so those merges never queue. Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #4110.
Problem
On language-crucible the audit's "5. Function Analysis" listed 48,318 functions; the scan DB's
function_dataheld 45,550. Both filter the same list, on different flags:record_keeper) and every per-function statistic (functions_found counts the slicer's synthetic __global_context__ buckets, inflating every per-function descriptor for 5 languages #2691) exclude everything the slicer stampsis_synthetic_slice.calls_only(Python's module-level bucket).So 2,768 synthetic units (
__global_context__buckets,Anonymous_Block, Mode E slices likeCREATE_Statement/Declarative_Block) were reported as functions across 555 files, mostly shell, lua, livecode and SQL. The golden master was tracking a different population from the one the DB and archetypes use.Fix
gitgalaxy/core/function_population.py:is_population_function/population_functions, the one predicate (not is_synthetic_slice and not calls_only)._generate_function_rankings, the folder roll-upfunc_count, and record_keeper's per-file population. Also corrected the record_keeper comment that said buckets keepfunction_datarows; they go tosynthetic_unit_data.log_function_count: it's a trained feature, and changing it without trainer parity would move composition labels (tracked by the Create a CI harness to auto-detect and mark archetype drift when changes break it #4100 drift harness).statistical_auditor's named-structure language-identity check: changing it can reclassify script files.Golden master
Re-blessed against crucible v1.6.0. Only
6_parsed_files_scanned_artifacts/files/5_function_analysismoves in each fixture, and both now list exactly 45,550 functions, matchingfunction_data. No signal, risk, archetype or summary value changed.Tests
tests/core_engine/test_function_population.py: predicate cases, plus a guard that the reporting modules use the shared predicate and have no hand-rolledcalls_onlyfilter.tests/tools_recorders/test_audit_recorder.py::test_function_analysis_lists_the_db_population.🤖 Generated with Claude Code