diff --git a/CHANGELOG.md b/CHANGELOG.md index d485ea0..9723f1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Callers and impact analysis no longer silently under-count a function that calls the same callee many times. When one caller contained several call sites to the same callee and an internal resolution batch boundary happened to split them, cleanup after the first batch removed the later sites' pending rows before they were ever attempted — their edges were never created, deterministically, and which edges went missing shifted with unrelated changes to the project's total reference count. Post-pass cleanup now targets the exact database row each processed reference came from. Found while validating the operator-call fix on nlohmann/json, where `write_cbor`'s 11 calls to `to_char_type` indexed as 10. (#1269) - C++ explicit operator calls — `a.operator+(b)`, `p->operator+(b)`, `a.operator[](3)`, and the other symbolic forms — now produce a `calls` edge to the operator method, so an operator invoked only through the explicit syntax no longer looks uncalled in callers and impact analysis. tree-sitter parses these call sites with the operator name stranded in an error node (never as a normal member access), so the call's target was silently read as just the receiver variable; the operator name is now recovered from the error node and resolved through receiver-type inference like any other member call — a same-named operator on an unrelated class can never capture the edge. Infix uses (`a + b`, `a[i]`) need real type inference and are tracked separately. (#1247) +- `codegraph init` and `codegraph index` no longer look hung after "Resolving refs" reaches 100%. The dynamic-dispatch linking that runs after resolution (callbacks, React re-renders, C function pointers, and the rest) had no progress display, so on repos where it takes a while — large C codebases especially — the bar just sat frozen at 100% until it finished. That work now shows as its own "Linking dynamic dispatch" progress phase. +- Indexing no longer prints repeated "SQLite is an experimental feature" warnings that garbled the progress display. The warning comes from Node's built-in SQLite and fired once per parsing worker; it's now suppressed on every launch path. ## [1.4.1] - 2026-07-10 diff --git a/__tests__/synthesis-progress.test.ts b/__tests__/synthesis-progress.test.ts new file mode 100644 index 0000000..f747880 --- /dev/null +++ b/__tests__/synthesis-progress.test.ts @@ -0,0 +1,67 @@ +/** + * Progress reporting for the callback-edge synthesis tail. + * + * Synthesis runs AFTER the resolution bar reaches 100%, so before this it had + * no progress surface at all — on synthesizer-heavy repos (e.g. large C + * codebases hitting the fn-pointer pass) the CLI sat frozen at + * "Resolving refs 100%" long enough that users concluded the index hung and + * killed it. These tests pin (a) that indexing emits the dedicated 'linking' + * phase with monotonic per-pass progress, and (b) that the advertised step + * total stays in sync with the synthesizer's actual pass list. + */ +import { describe, it, expect } from 'vitest'; +import * as fs from 'fs'; +import * as os from 'os'; +import * as path from 'path'; +import { CodeGraph, IndexProgress } from '../src/index'; +import { SYNTH_PROGRESS_STEPS } from '../src/resolution/callback-synthesizer'; + +describe('synthesis progress ("Linking dynamic dispatch" phase)', () => { + it('SYNTH_PROGRESS_STEPS matches the synthesizer’s actual __mark() step count', () => { + // The constant is cosmetic (progress denominator), but drift makes the bar + // end early or jump to 100% — adding a pass must bump it. Every step site + // calls __mark('