5.1.1
Combines the 5.0.0 functional jump with a chromium-scale tokensave_dead_code perf fix.
What's new (since 4.14.11)
9 new MCP tools
tokensave_read— mode-aware file read (full/lines/map/signatures) with cross-session cache. A re-call on an unchanged file returns a ~30-token{"unchanged": true, …}stub.tokensave_outline— flat list of every top-level symbol in a file, with optional kind filter.tokensave_implementations— every type implementing a trait, or every body of a method.tokensave_unsafe_patterns—.unwrap()/.expect()/panic!/todo!/unimplemented!/unsafe { }sites with anin_testflag.tokensave_diagnostics— runs cargo / tsc / pyright and returns structured errors mapped to graph nodes. Forces.tokensave/target/so it can't race with interactive cargo runs.tokensave_config— TOML / JSON queries by dotted key path. DB-free.tokensave_signature_search— find functions / methods by return type, params, async flag.tokensave_constructors— every struct-literal site withmissing_fieldsrelative to the current definition.tokensave_field_sites— partition every.<field>reference into reads and writes.
Console-friendly tokensave bench
Default tokensave bench is now a fixed-width colored table — compact k/M units, tier-colored savings (green ≥80 %, yellow ≥50 %, red <50 %). --json unchanged.
Schema v9
read_cachetable — backstokensave_read's cross-session cache.Containsedges denormalized intonodes.parent_id— single forward-only migration. Cleaner queries; extractors keep emitting Contains and the storage layer hoists at insert time. Recovery path for downstream consumers still reading Contains directly:tokensave sync -f.
Performance — chromium-scale tokensave_dead_code
find_dead_code rewritten as a three-step resolve via two TEMP tables (temp.test_markers, temp.test_annotated_targets). Probed against the real chromium DB (7.5 GB, 4.4 M nodes, 411 K annotates edges):
| call | before | after |
|---|---|---|
dead_code {} |
timeout | 2.45 s |
dead_code {limit: 10} |
timeout | 1.10 s |
dead_code {path: "src"} |
timeout | 1.10 s |
Pre-fix was 5/5 TIMEOUT at the 25 s ceiling and cascade-poisoned every subsequent MCP tool. On scirs (76 K annotation_usage): 0.6 s vs the 0.097 s pre-4.14.8 baseline — regression-acceptable given chromium went from >25 s to <1.1 s steady-state. Inline comment on find_dead_code documents three prior failed shapes (pre-4.14.8 wildcard, 4.14.8 CTE inline, single-temp-table) so future refactors don't repeat them.
Upgrade detection no longer races CI
fetch_latest_version() now verifies the current platform's archive is uploaded to the release before announcing it. Releases whose binaries haven't finished building are silently skipped — clients see "you're up to date" until the asset matching their platform is present. The existing per-attempt download check (which already produced a clear error) is preserved as belt-and-suspenders.
Migration
- Schema v9 is forward-only. First sync after upgrade auto-applies the migration, populates
parent_idfrom existingContainsrows, and deletes those rows. - External SQLite consumers reading the
edgestable should switch fromkind='contains'filters tonodes.parent_idjoins. - If anything else goes sideways:
tokensave sync -frebuilds the graph from source under the new schema.