Skip to content

v7.15.0

Choose a tag to compare

@aovestdipaperino aovestdipaperino released this 07 Oct 07:00

A minor release: on first launch the new binary silently reinstalls your agent integrations, refreshing the rules text and the git-hook sections. No schema change and no forced reindex. C# and TypeScript projects get the new edges on tokensave sync -f, or file by file as they change. Full detail in CHANGELOG.md.

Added

  • tokensave_read takes an if_digest argument (#650). Every response that carries a body also carries its digest. A client that still holds that content passes the digest back as if_digest; when it matches the current body for the same mode and range, the short unchanged: true stub is returned instead of the body, and otherwise the body is. Requested by @xorets.

Changed

  • The installed agent rules now say what tokensave_search with literal: true finds, and when grep is the right tool (#653). The rules named tokensave_search only for a known symbol, and never said when grep fits, so agents reached for grep to find call sites. A new "Searching code" section in the shared rules text says that by default tokensave_search returns where a name is defined, ranked, with its kind and signature, and that with literal: true it finds exact text: .Name( for calls through an object, Name( for every call, : IName for implementers. Grep is for a regex, or a file type the index skips. Claude's "When the hook denies a search" section now offers {"query": ".Name(", "literal": true} next to tokensave_callers for a symbol's uses, and the MCP server's initialize instructions carry the same two points in one sentence. Every agent that installs rules text gets the new section (Claude, Augment, Codex, Copilot, Droid, Gemini, Grok, Kimi, Kiro, OMP, OpenCode, Pi, Qwen, Vibe), and existing installs pick it up on the next tokensave install or reinstall, or the silent resync after a minor upgrade. In the reporter's A/B test the two lines cut tool calls by about 25% and lowered cost. Suggested by @xorets.
  • tokensave_read numbers the lines it returns (#652). full and lines modes now prefix every line with its real file line number, right-aligned, then a tab, as Claude Code's Read tool does, so a lines slice from 120 starts at 120. map and signatures are unchanged. Because the body changed, a digest from an earlier release no longer matches. Requested by @xorets.
  • tokensave_read always returns the body unless if_digest matches (#650). The server used to remember every file it had sent, across sessions, and answer a repeat read with an unchanged: true stub. It cannot know what the client still holds after a context compaction, a rewind, a new session or a subagent, so the stub could leave an agent with no copy of the file. That server-side record is gone and the read_cache table is no longer read or written. force is still accepted but deprecated: the body is now the default, and force: true only makes the server ignore if_digest.
  • tokensave_body lists candidates for an ambiguous name instead of returning every body, and accepts Type.Member (#651). A bare name shared by several definitions, such as three RefreshAsync methods, used to return up to three full bodies, the wanted one possibly last. When more than one definition of the best kind matches (a function or type still outranks a same-named field or import), the tool now returns no body but a candidate list with each candidate's qualified name without its file prefix (App::Coordinator::RefreshAsync), kind, file, 1-based line range and node id, plus a hint to re-call with a qualified name or the id. Exactly one match returns its body as before. . is now accepted as a member separator alongside ::: Coordinator.RefreshAsync and App.Coordinator.RefreshAsync resolve by matching trailing segments, and the literal name is tried first so names that really contain dots still match. The match treats . and :: alike on both sides, so C# namespaces stored as App.Tests match Tests::FakeCoordinator::RefreshAsync too. A new node_id parameter (alias id) fetches one node's body directly; the truncated-snippet handle tokensave_body node_id=… that tokensave_context emits now works as written. limit now caps the candidate list (default 20, max 50), and symbol is no longer a schema-required field since node_id can replace it. Reported in #651.

Fixed

  • Git hooks shell-quote the tokensave binary path (#636). The post-commit, post-merge and post-checkout sections put the path into the sh script unquoted, so an install path with a space split into two words and the hook did nothing, and a ;, $(...) or backtick in it would run as a command on every git operation. The path is now single-quoted, which turns off every shell expansion. Existing sections are rewritten in place by install, reinstall, githooks on and the upgrade resync, and the post-checkout block's version stamp goes to v3.
  • The MCP server caps a request line at 64 MiB (#636). Its stdin reader buffered a line of any length, so a host that never sent a newline could make the server use all available memory. A longer line is now discarded and answered with a JSON-RPC parse error, and the server keeps serving.
  • Name lookups no longer read _ and % in a name as wildcards. The LIKE fallback of search_nodes and the :: suffix scan of get_nodes_by_qualified_name passed the query to SQL unescaped, so my_function also matched myXfunction.
  • The grep hook's denial now gives the call to make, with the symbol filled in (#649, #654). It used to send usages to tokensave_callers_for, which takes node ids and is not a core tool, so agents that followed it failed. A denied symbol search now spells out copyable calls for the symbol taken from the command: tokensave_search {"query": "MySymbol"} for the definition, tokensave_search {"query": ".MySymbol(", "literal": true} for method-call uses, and tokensave_search {"query": "MySymbol(", "literal": true} for every call. A def/class/fn-anchored pattern gets the definition call only, and an alternation gets one call per name. Reported by @xorets.
  • More shell shapes that search for a symbol are redirected (#648). git grep is now treated as the working-tree search it is, unless it names a revision (git grep Sym HEAD~3, or any positional before -- that is not an existing path), which still passes through as a history search. A search batched beside a read-only command is redirected: sed -n 1,20p notes.md; grep -rn Sym src, and a prose grep next to a symbol grep, where the prose grep used to count as work. A search piped into read-only filters (| head, | sort | uniq, | wc -l) is redirected too; a pipe into anything that writes (| xargs, | tee, sort -o) still passes through, as does any chain with a side-effecting segment (#475). An alternation is a symbol search when any branch is symbol-shaped (MySymbol\|throw new Error), and a call pattern may carry text after the paren (MySymbol(name), though not when the paren follows a space or a control keyword (if (x). Non-code targets (--include='*.md', docs/) and TOKENSAVE_DISABLE_GREP_HOOK behave as before. Reported by @xorets.
  • tokensave_search with ids: true prints the ids in the default text format (#646). The ids only appeared with format: "json", so a text answer could not feed tokensave_callers, tokensave_callees, tokensave_impact or tokensave_node. A ranked hit now reads file:line: Foo (interface) [id: <id>] — signature, and a literal match appends [in <enclosing>, id: <enclosing_id>] when it falls inside a symbol. Without ids, the text is unchanged.
  • A literal tokensave_search says when limit cut its matches (#645). The scan stopped at limit and reported count: <limit> with nothing to say that 70 more matches existed. It now keeps counting past the limit (a substring test per line, without building the extra matches), and the JSON carries total and truncated beside count; the text header reads count: 5 of 73 (truncated; raise limit to see more). The ranked search fetches one result past limit, and when that one survives the filters its text header reads count: 10 (truncated: more matches exist; raise limit to see them); its JSON stays a bare array.
  • tokensave_read in map and signatures mode finds a file's symbols again on Windows and for non-plain paths (#644). The mode looks symbols up by the file's path relative to the project, but that path was cut from the canonical file path with the separators of the host, so on Windows a graph_root read of src/x/Service.cs looked up src\x\Service.cs, which the indexer (it stores forward slashes) never wrote, and returned symbol_count: 0. The served project could miss too: when its root was not in canonical form (a symlinked directory, or no \\?\ prefix on Windows) the raw argument was used as given, so ./src/x.rs, src/../src/x.rs or an absolute path found nothing. The lookup key, the echoed file and the read-cache key are now always derived from the canonical root and file and use forward slashes. tokensave_entities uses the same key. The containment check from #636 is unchanged. Reported on Windows 11.
  • TypeScript imports written with a .js specifier now link to the .ts source (#647). Under "module": "NodeNext" (and the bundler resolution mode) TypeScript requires relative imports to name the emitted file, so src/lib/hash.ts is imported as ../../src/lib/hash.js. The import's uses edge never resolved, because the specifier was matched as a symbol name (its trailing segment, js), and the reachability gate on JS/TS calls compared the callee's module stem (hash) against that same segment, so a call into another directory was dropped as unreachable. tokensave_affected therefore reported no tests for the module, and file_dependents, impact and the module import graph missed the dependency. A relative import from a JS/TS/Vue/Svelte/Astro file now binds to the File node of the file it names, applying TypeScript's mapping (.js to .ts/.tsx/.d.ts, .jsx to .tsx, .mjs to .mts, .cjs to .cts; extensionless specifiers try each source extension and then the directory's index file), with the new relative-import provenance. A TypeScript importer prefers the TypeScript source when a same-named .js file also exists; a JavaScript importer prefers the file it names. A relative specifier that names no indexed file no longer falls through to a bare-name match on its last dotted segment. Calls into an imported file now pass the reachability gate, and incremental sync re-resolves an import when the file it names is added or re-extracted. Reported in #647.
  • C# property, indexer and event accessors now record the calls they make (#637). The C# extractor walked method and constructor bodies for call sites but not property bodies, so a call inside a get/set/init accessor, an expression-bodied accessor (get => ...), an expression-bodied property (string Short => Helper.Format(Id);) or a property initializer (= new Holder()) produced no calls edge and no unresolved reference, and its callee could look dead. These calls are now attributed to the csharp_property node. Indexers (T this[int i] { ... }), which were not extracted at all, are now csharp_property nodes named this (signature T this[int i]) with their accessor calls attributed to them, and calls in an event's add/remove accessors are attributed to the event. Attributes on the declaration are not walked, so nameof(...) inside one is not recorded as a call. A read of a property from another member (h.Label) still produces no edge. Existing C# projects pick the new edges up on their next full reindex (tokensave sync --force) or as files change.
  • tokensave_implementations finds the implementers of a C# interface, generic or not (#643). A C# base list (class A : X, IY) cannot tell a base class from an interface, so the extractor recorded a class's first base as extends, and tokensave_implementations, which reads implements edges, found nothing for a class whose only or first base was the interface. The resolver now stores that edge as implements when its target is an interface; a base class stays extends. A generic base (IProducer<TRecord>, App.IProducer<int>) was also recorded with its type arguments, so it never matched the IProducer declaration and neither tokensave_implementations nor tokensave_type_hierarchy saw it; type arguments are now dropped from base-list names. No schema change: an existing index picks this up for a C# file when that file is next re-indexed, or for the whole project with tokensave sync --force.
  • A C# call resolves through its receiver's static type (#642, follow-up to #634). coordinator.RefreshAsync(...) was matched on the method name alone, so a primary-constructor parameter or a var local gave no edge as soon as a second RefreshAsync existed, and inside the class that declared one the same-file bonus bound the call to the caller's own method. The extractor now records the receiver's type next to the call, from the enclosing type's fields, properties and primary-constructor parameters, the method's parameters, explicitly typed locals, and var locals initialised by new T(...), a cast, as, or a call or member read (writerFactory.CreateWriter<T>(...), await opener.OpenAsync()); a class name used as a receiver (Factory.Create()) types a static call. The resolver looks the method up on that type, reading declared return, field and property types from the signatures, unwrapping Task<T>/ValueTask<T> after await, and walking the base list for an inherited member. When the type is not indexed or lacks the member (an extension method, for instance), the name-based match decides as before, except that a call on a receiver other than this/base no longer binds to a method of the caller's own class. Type arguments are dropped from callee names, so f.Create<T>(x) now reaches Create. A sync -f is needed to pick this up for files already indexed. Reported by @xorets and @t-macabee.