Repository navigation
Description
What happens
The detector finds a function only where a definition starts a line. When several definitions share one physical line, only the first is recorded. The others are lost from function_data, and with them their calls, complexity and signals.
#7503 (Fixes #7501) made dense hand-written files reach the detector instead of being excluded as minified. That made this limit visible on real code. Three Codex-written programs from the agent-habits study, scanned with #7503's engine, each compared with a formatter-wrapped copy of the same source (where GitGalaxy and ctags agree):
| file | lines | GG functions, as written | GG = ctags, wrapped copy |
|---|---|---|---|
chess engine, Rust (2nd run), src/main.rs |
36 | 21 | 30 |
chess engine, C, engine.c |
55 | 22 | 23 |
chess engine, Rust, src/main.rs |
34 | 19 | 20 |
The same limit appears in Java: methods written on one line inside a class body (class M { int f(){…} int g(){…} }) are missed. That was seen as 4 functions across the study's Java runs, 3 of them by Sonnet, so it isn't one author's style only.
Why it matters
- Per-function metrics are wrong for dense code: function counts, complexity per function, fan-out and the call graph.
- The loss isn't neutral between authors. In the agent-habits study, one agent writes much denser code than the others. Any per-function comparison is biased against it, even after Scan dense hand-written source instead of excluding it as minified (Fixes #7501) #7503.
- AI-written code is a growing share of what gets scanned.
Scope and constraints
- This is a detector-wide change (Mode A slicing / function-start detection), so expect golden drift. Bless via
crucible_check.py --update --yeswith the drift attributed. - It must stay ReDoS-safe on long lines. Scan dense hand-written source instead of excluding it as minified (Fixes #7501) #7503's
gitgalaxy/core/dense_source.pyalready has a bounded, linear inline-definition scan that may be reusable. - Ordinary one-function-per-line code must stay byte-identical. Prove this with golden masters on the crucible.
- Sweep the class: which languages allow several definitions per line (C/C++, Rust, Go, Java, C#, Kotlin, Swift, Scala, JS/TS), and which slicing modes (
_cobol_*, brace languages, Python).
Acceptance
- Synthetic fixtures with 2-10 definitions per line in at least C, Rust and Java. GG matches tree-sitter and ctags on name and parameter count.
- Each function's span is correct (start/end on the shared line; the next function's span does not swallow the previous one).
- Goldens re-blessed with the drift attributed; ordinary files unchanged.
- The agent-habits Codex programs above reach the wrapped-copy counts (30, 23, 20) as written.
Activity
squid-protocol commentedon Nov 3, 2026
Claimed by promoter-bot host
melek, lease renewed 2026-11-03T14:01Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove theclaim:meleklabel.