Skip to content

Commit ac5d6c3

Browse files
NickCirvclaude
andcommitted
release: v4.2.0 "Loop" — close the agent's research loop (grep + read-dedup)
Ships the token-saving work that was stranded on main since v4.1.0: Grep interception (symbol greps → call-site lines from the reference graph, gated to content-mode + >=4 callers), same-session read dedup (recall-safe, PreCompact + SessionStart reset), richer find-usages call sites, and the deterministic session-level bench. npm users on 4.1.0 had none of it. Version 4.1.0 → 4.2.0 across package.json + lock + server.json (×2). CHANGELOG [Unreleased] → [4.2.0] "Loop". README + install.html: v4.2 "Loop" callout/ showcase (grep→call-sites, read dedup, honest session bench); banner, hero pill, nav, npx commitment, test badge (1025→1100) all bumped. server.json description notes the read/grep/re-read interception. Honest framing preserved: structural context-token reduction, not a bill saving; no '89%' as cost; 'ranked' applies only to PageRank query results, never the alphabetical grep caller list. Audit: tsc clean; full suite 1100/1100; build clean; npm pack engramx-4.2.0.tgz 53 files no junk; npm audit 0 vulns. Fresh-clone verifier: RELEASE-READY (1100 green + all 3 features smoke-verified from clean checkout). Leak-audit 0 hits + clean-room subagent verdict CLEAN. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 618409d commit ac5d6c3

6 files changed

Lines changed: 44 additions & 47 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ All notable changes to engram are documented here. Format based on
66

77
## [Unreleased]
88

9+
## [4.2.0] — 2026-06-03 — "Loop"
10+
911
### Added
1012
- **Same-session read dedup (ADR-0003).** Within a session, the Read handler
1113
records every full read; a subsequent read of the **same, byte-unchanged**

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="assets/banner-v3.png" alt="engramx — the universal context spine for AI coding tools (v4.1 'Compass')" width="100%">
2+
<img src="assets/banner-v3.png" alt="engramx — the universal context spine for AI coding tools (v4.2 'Loop')" width="100%">
33
</p>
44

55
<p align="center">
@@ -58,7 +58,7 @@
5858
<a href="https://open-vsx.org/extension/nickcirv/engram-vscode"><img src="https://img.shields.io/open-vsx/v/nickcirv/engram-vscode?color=blue&label=OpenVSX" alt="OpenVSX engram-vscode"></a>
5959
<img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License">
6060
<img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node">
61-
<img src="https://img.shields.io/badge/tests-1025%20passing-brightgreen" alt="Tests">
61+
<img src="https://img.shields.io/badge/tests-1100%20passing-brightgreen" alt="Tests">
6262
<img src="https://img.shields.io/badge/per--file%20reduction-53--89%25-orange" alt="53-89% per-file structural reduction">
6363
<img src="https://img.shields.io/badge/native%20deps-zero-green" alt="Zero native deps">
6464
<img src="https://img.shields.io/badge/LLM%20cost-$0-green" alt="Zero LLM cost">
@@ -86,8 +86,8 @@ mkdir -p /tmp/engram-demo && cd /tmp/engram-demo && \
8686
echo "export const buggy = () => null;" > src.ts && \
8787
git add -A && git commit -q -m "feat: add buggy helper returning null causing form crashes" && \
8888
git revert --no-edit HEAD > /dev/null && \
89-
npx --yes engramx@4.1.0 init . && \
90-
npx --yes engramx@4.1.0 mistakes
89+
npx --yes engramx@4.2.0 init . && \
90+
npx --yes engramx@4.2.0 mistakes
9191
```
9292

9393
You should see, within 30 seconds, the **bi-temporal pre-mortem** engram auto-captured from your revert:
@@ -119,9 +119,9 @@ On engramx's own repo the **per-file structural context reduction is ~89%** (89.
119119

120120
Works in 8 IDEs and counting — Claude Code, Cursor, Cline, Continue.dev, Aider, Windsurf, Zed, OpenAI Codex CLI. One install, one graph, every tool benefits. Apache 2.0. Local SQLite. Nothing leaves your machine.
121121

122-
> **v4.1 "Compass" shipped 2026-06-03 — engram now ranks the graph.** A real cross-file reference graph (tree-sitter `calls` edges) is built at `engram init`, and query results are ranked by **personalized PageRank** over it — importance flows from who-references-you, recursively, biased toward your query, instead of raw edge-degree. engram is the only tool in its category that *ranks* the graph rather than dumping it. New traversal commands `engram callers <symbol>`, `engram callees <symbol>`, and `engram impact <symbol>` walk the same edges.
122+
> **v4.2 "Loop" shipped 2026-06-03 — engram now closes the agent's investigation loop.** The original Context Spine goal was to collapse the whole `grep → read → read` loop, not just the single file read. v4.2 ships the rest: a **Grep interception** that answers a content-mode symbol search from the reference graph with the actual `file:line: code` call sites — smaller than the raw grep (`init` is 573 vs 9,317 tokens on engram's own repo) while showing the real usage — and **same-session read dedup** that returns a pointer instead of re-serving an unchanged file the agent already read.
123123
>
124-
> Also new: **day-1 mistakes** — a bug-fix-commit miner (`fix:` / `fixes #N`, not just rare reverts) means a fresh `engram init` surfaces real landmines immediately, and a **per-session value line** (Stop hook) shows what engram kept out of context each session. And the **honesty pass**: every surface now frames the per-file win as a *structural context-packet reduction, not a cost saving* (engram's net agent-loop cost over prompt caching is ~0); the Read hook is size-guarded so a reported reduction is never negative, and `bench/real-world.ts` self-discloses its baseline. Incremental re-index now maintains the reference graph atomically, so ranking stays fresh between full inits. 1074 tests passing. See [CHANGELOG.md](CHANGELOG.md) for the full v4.1 diff (and v4.0 "Skill Pack" — bi-temporal mistakes from git-revert history).
124+
> Both are **recall-safe by construction** (an `rg -n` escalation path; byte-unchanged + PreCompact/SessionStart reset guards) and **gated so they only fire when they genuinely save tokens** — a default `files_with_matches` grep, a low-usage symbol, or a tiny file all pass straight through. Honest framing throughout: a *structural* context-token reduction, not a bill saving (engram's net agent-loop cost over prompt caching is ~0). A new deterministic **session-level bench** (`bench/session-level.ts`) models the saving as a function of how often the agent re-fetches raw content, instead of quoting one number. 1100 tests passing. See [CHANGELOG.md](CHANGELOG.md) for the full v4.2 diff (and v4.1 "Compass" — PageRank-ranked graph + `callers`/`callees`/`impact` traversal).
125125
126126
<details>
127127
<summary><strong>Earlier release notes (v3.4 "Universal Spine", May 2)</strong></summary>

docs/install.html

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
66
<meta name="color-scheme" content="dark">
7-
<title>Install · engramx v4.1 "Compass" — ranked code-graph context for every AI coding tool</title>
7+
<title>Install · engramx v4.2 "Loop" — closes the agent's research loop for every AI coding tool</title>
88
<meta name="description" content="One install. Works in Claude Code, Cursor, Cline, Continue, Aider, Codex, Windsurf, Zed. Bi-temporal mistakes auto-fire before your agent repeats them. Auto-captured from git revert history. Auto-installed on engram init. Up to ~89% fewer context tokens (structural, codebase-dependent — not a bill saving). Local SQLite, zero cloud, Apache 2.0.">
99
<link rel="canonical" href="https://github.com/NickCirv/engram/blob/main/docs/install.html">
1010

11-
<meta property="og:title" content="engramx v4.1 'Compass' — ranked code-graph context for every AI coding tool. PageRank over a real cross-file reference graph, plus mistakes memory that fires before your agent repeats a fix the repo already reverted.">
11+
<meta property="og:title" content="engramx v4.2 'Loop' — closes the agent's grep → read investigation loop. Symbol greps answered from the reference graph with real call sites; same-session re-reads deduped. Recall-safe and gated to only fire when it saves tokens.">
1212
<meta property="og:description" content="npm install -g engramx → engram init. Auto-installs the Sentinel hook. Auto-captures bi-temporal mistakes from git revert. Up to ~89% fewer context tokens (structural, codebase-dependent — not a bill saving). Local SQLite, zero cloud. Apache 2.0.">
1313
<meta property="og:image" content="https://raw.githubusercontent.com/NickCirv/engram/main/assets/banner-v3.png">
1414
<meta name="twitter:card" content="summary_large_image">
@@ -847,7 +847,7 @@
847847
eng<span class="accent">r</span><span class="accent">a</span>m
848848
</a>
849849
<ul class="nav-links">
850-
<li><a class="nav-link" href="#coming-next">v4.1</a></li>
850+
<li><a class="nav-link" href="#coming-next">v4.2</a></li>
851851
<li><a class="nav-link" href="#whats-new">v3.4</a></li>
852852
<li><a class="nav-link" href="#install">Install</a></li>
853853
<li><a class="nav-link" href="#how">How it works</a></li>
@@ -867,7 +867,7 @@
867867
<div class="container">
868868
<div class="hero-grid">
869869
<div>
870-
<span class="hero-pill">● v4.1 "Compass" · shipped 2026-06-03 · ranked context graph · 1074 tests</span>
870+
<span class="hero-pill">● v4.2 "Loop" · shipped 2026-06-03 · grep + read-dedup interception · 1100 tests</span>
871871

872872
<h1 class="hero-headline reveal">
873873
your AI agent<br>
@@ -944,58 +944,53 @@ <h1 class="hero-headline reveal">
944944
</div>
945945
</section>
946946

947-
<!-- ================== WHAT SHIPPED IN v4.1 ================== -->
947+
<!-- ================== WHAT SHIPPED IN v4.2 ================== -->
948948
<section class="block" id="coming-next" style="border-top: 1px solid var(--border);">
949949
<div class="container">
950950
<div class="section-head">
951951
<div>
952-
<div class="section-eyebrow">// v4.1 · shipped 2026-06-03</div>
953-
<h2 class="section-title">Compass: engram ranks the graph.</h2>
952+
<div class="section-eyebrow">// v4.2 · shipped 2026-06-03</div>
953+
<h2 class="section-title">Loop: engram closes the research loop.</h2>
954954
</div>
955-
<div class="section-meta">1074 tests passing · PageRank ranking · the only ranked tool in its category</div>
955+
<div class="section-meta">1100 tests passing · grep + read-dedup interception · recall-safe + gated</div>
956956
</div>
957957

958958
<p style="color: var(--text-secondary); max-width: 720px; margin-bottom: 2rem;">
959-
Earlier versions returned graph neighbours by raw edge-degree. v4.1 builds a real
960-
cross-file reference graph at <code>engram init</code> — tree-sitter call extraction into
961-
<code>calls</code> edges — and ranks query results by <em>personalized PageRank</em> over
962-
it: importance flows from who-references-you, recursively, biased toward your query. Most
963-
tools in this space dump the graph; engram is the only one that ranks it. The per-file
964-
structural context reduction stays high (~89% on this repo, 50–90% across real OSS repos)
965-
and is now size-guarded — engram only replaces a read when its packet is genuinely smaller,
966-
so a reported reduction is never negative. Structural, codebase-dependent, not a bill saving.
959+
The original goal was to collapse the agent's whole <code>grep → read → read</code>
960+
investigation loop, not just the single file read. v4.2 ships the rest — and every piece
961+
is gated so it only fires when it genuinely saves tokens, with an escalation path so it
962+
can never blind the agent. Structural context-token effect, not a bill saving.
967963
</p>
968964

969965
<div class="v3-grid">
970966
<article class="v3-card">
971-
<div class="v3-card-tag">ranked</div>
972-
<h3 class="v3-card-title"><span class="accent"></span> PageRank context</h3>
967+
<div class="v3-card-tag">grep</div>
968+
<h3 class="v3-card-title"><span class="accent"></span> Symbol greps → call sites</h3>
973969
<p class="v3-card-body">
974-
A real cross-file reference graph (<code>calls</code> edges from tree-sitter) is built at
975-
init, and query results are ranked by personalized PageRank over it — importance flows
976-
from who-references-you, recursively, biased toward your query. The most-referenced
977-
symbols surface first instead of a flat edge-degree dump.
970+
A content-mode grep for a well-referenced symbol is answered from the reference graph
971+
with the actual <code>file:line: code</code> call sites — smaller than the raw grep
972+
(<code>init</code>: 573 vs 9,317 tokens on this repo) while showing the real usage.
973+
Default filename greps and low-usage symbols pass straight through.
978974
</p>
979975
</article>
980976

981977
<article class="v3-card">
982-
<div class="v3-card-tag">traversal</div>
983-
<h3 class="v3-card-title"><span class="accent"></span> callers · callees · impact</h3>
978+
<div class="v3-card-tag">dedup</div>
979+
<h3 class="v3-card-title"><span class="accent"></span> Same-session read dedup</h3>
984980
<p class="v3-card-body">
985-
<code>engram callers &lt;symbol&gt;</code>, <code>engram callees &lt;symbol&gt;</code>, and
986-
<code>engram impact &lt;symbol&gt;</code> walk the same reference graph — trace what calls a
987-
function, what it calls, and the blast radius of a change, straight from the CLI or MCP.
981+
Re-read an unchanged file you already read this session and engram returns a pointer
982+
("it's still in your context above"), not the file again. Byte-unchanged guard, full
983+
reads only, and a PreCompact / SessionStart reset so it never points at evicted content.
988984
</p>
989985
</article>
990986

991987
<article class="v3-card">
992-
<div class="v3-card-tag">day-1</div>
993-
<h3 class="v3-card-title"><span class="accent"></span> Day-1 mistakes</h3>
988+
<div class="v3-card-tag">measured</div>
989+
<h3 class="v3-card-title"><span class="accent"></span> Honest session bench</h3>
994990
<p class="v3-card-body">
995-
A bug-fix-commit miner reads <code>fix:</code> / <code>fixes #N</code> commits — not just
996-
rare reverts — so a fresh <code>engram init</code> surfaces real landmines immediately. A
997-
per-session value line then shows what engram kept out of context each session. (v4.0's
998-
bi-temporal revert mistakes still ship — see CHANGELOG.)
991+
A deterministic <code>bench/session-level.ts</code> models the session saving as a curve
992+
over how often the agent re-fetches raw content — instead of quoting one number. The
993+
break-even is the honest headline: engram nets positive unless that fallback rate is high.
999994
</p>
1000995
</article>
1001996
</div>
@@ -1018,7 +1013,7 @@ <h3 class="v3-card-title"><span class="accent">★</span> Day-1 mistakes</h3>
10181013
<div class="section-eyebrow">// v3.0 · what's new</div>
10191014
<h2 class="section-title">Six upgrades that make v3.0 land.</h2>
10201015
</div>
1021-
<div class="section-meta">11 of 12 scope items · 1074 tests · up to ~89% structural reduction (own repo)</div>
1016+
<div class="section-meta">11 of 12 scope items · 1100 tests · up to ~89% structural reduction (own repo)</div>
10221017
</div>
10231018

10241019
<div class="v3-grid">
@@ -1178,7 +1173,7 @@ <h3 class="step-title">Pull the binary from npm</h3>
11781173
</div>
11791174
<div class="terminal-body">
11801175
<pre id="step-01"><span class="prompt">$</span><span class="cmd">npm install -g engramx</span>
1181-
<span class="out-dim"></span> <span class="out-info">added engramx@4.1.0 in 4s</span></pre>
1176+
<span class="out-dim"></span> <span class="out-info">added engramx@4.2.0 in 4s</span></pre>
11821177
</div>
11831178
</div>
11841179
</article>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "engramx",
3-
"version": "4.1.0",
3+
"version": "4.2.0",
44
"mcpName": "io.github.NickCirv/engram",
55
"description": "The context spine for AI coding agents. 9 built-in providers + mcpConfig plugin contract (wrap any MCP server in 10 lines), generic MCP-client aggregator (stdio), pre-mortem mistake-guard, bi-temporal mistake memory, Anthropic Auto-Memory bridge, SSE streaming context packets, dual-emit AGENTS.md+CLAUDE.md. Up to ~89% per-file structural context reduction (codebase-dependent; reproducible bench included). Local SQLite, zero cloud.",
66
"repository": {

server.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "io.github.NickCirv/engram",
4-
"description": "Ranked local code-graph context for AI coding tools. Works in 8 IDEs. Up to ~89% structural context reduction (varies by repo). Local SQLite, zero cloud, Apache 2.0.",
4+
"description": "Ranked local code-graph context for AI coding tools — intercepts file reads, symbol greps, and re-reads. Works in 8 IDEs. Up to ~89% structural context reduction (varies by repo). Local SQLite, zero cloud, Apache 2.0.",
55
"repository": {
66
"url": "https://github.com/NickCirv/engram",
77
"source": "github"
88
},
9-
"version": "4.1.0",
9+
"version": "4.2.0",
1010
"packages": [
1111
{
1212
"registryType": "npm",
1313
"identifier": "engramx",
14-
"version": "4.1.0",
14+
"version": "4.2.0",
1515
"transport": {
1616
"type": "stdio"
1717
},

0 commit comments

Comments
 (0)