diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 39fe148..1f97457 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,7 +10,7 @@ "name": "agent-memory", "source": "./", "description": "Durable cross-repository memory for coding agents — built to survive an IT security review. Zero runtime dependencies, zero dev dependencies, no install script: nothing runs when you install it, and granting it your agents is a separate explicit command. Independently scanned, with a passing verdict. Adds /handoff, /remember and /recall over one local markdown store. Requires the CLI: npm install -g @vib795/agent-memory (Node >= 22.5).", - "version": "0.7.3", + "version": "0.7.4", "author": { "name": "Utkarsh Singh", "url": "https://github.com/vib795" diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index c6c3783..9c578e4 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "agent-memory", "displayName": "agent-memory", - "version": "0.7.3", + "version": "0.7.4", "description": "Durable cross-repository memory for coding agents — built to survive an IT security review. Zero runtime dependencies, zero dev dependencies, no install script: nothing runs when you install it, and granting it your agents is a separate explicit command. Independently scanned, with a passing verdict. Adds /handoff, /remember and /recall over one local markdown store. Requires the CLI: npm install -g @vib795/agent-memory (Node >= 22.5).", "author": { "name": "Utkarsh Singh", diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b317c8a..30f98ee 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -3,8 +3,8 @@ How agent-memory is built, and why it is built that way. Every figure here was read from the source rather than written from memory, at -v0.6.4: 15 modules, 3,574 lines of JavaScript, zero runtime dependencies and zero -dev dependencies, 97 tests. +v0.7.4: 15 modules, 4,168 lines of JavaScript, zero runtime dependencies and zero +dev dependencies, 111 tests. --- @@ -242,7 +242,7 @@ quietly ending. --- -## Two-tier routing +## Three-tier routing The expensive resource is not disk or CPU. It is the model's context window, and the premium request budget behind it. @@ -472,22 +472,22 @@ The properties that must stay true. Each is covered by the test suite. | Module | Lines | Responsibility | |---|--:|---| -| `cli.js` | 980 | 13 commands; one process, one answer | +| `cli.js` | 1114 | 14 commands; one process, one answer | +| `digest.js` | 559 | tiers 1 and 2: both descriptions, tree, brief | +| `compact.js` | 372 | dedupe, supersede, decay, regenerate | | `index-db.js` | 317 | SQLite cache: DDL, reindex, FTS5 search | +| `setup.js` | 297 | install into detected agent surfaces | | `pii.js` | 274 | export-time disclosure control | | `store.js` | 256 | notes as source of truth; frontmatter; atomic upsert | -| `compact.js` | 283 | dedupe, supersede, decay, regenerate | -| `setup.js` | 282 | install into detected agent surfaces | | `staleness.js` | 213 | commit-distance staleness and capture gap | -| `digest.js` | 209 | two-tier routing: description + tree | -| `config.js` | 191 | engagement resolution; two-file config split | +| `config.js` | 197 | engagement resolution; two-file config split | | `targets.js` | 140 | where each agent looks for instructions | | `graph.js` | 99 | recursive CTE traversal + retrieval budget | | `schema.js` | 98 | validate and normalize; reports every problem | | `redact.js` | 97 | capture-time fail-closed secret redaction | | `promptfile.js` | 78 | VS Code prompt files derived from SKILL.md | | `atomic.js` | 57 | atomic write; imports nothing from this package | -| **total** | **3,574** | zero dependencies, 97 tests | +| **total** | **4,168** | zero dependencies, 111 tests | `atomic.js` deliberately imports nothing from the package: `store.js` already imports `config.js`, so putting the atomic write in either would create a cycle. diff --git a/README.md b/README.md index a327232..6a2dd8d 100644 --- a/README.md +++ b/README.md @@ -440,7 +440,7 @@ equivalent and is not: npm links the global install to that folder rather than c it, which shows up as an arrow in `npm list -g`: ``` -`-- @vib795/agent-memory@0.6.5 -> .\..\..\..\agent-memory +`-- @vib795/agent-memory@0.7.4 -> .\..\..\..\agent-memory ``` Move or delete the clone afterwards and the global install points at nothing — the same diff --git a/package-lock.json b/package-lock.json index 8574c65..feacffd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vib795/agent-memory", - "version": "0.7.3", + "version": "0.7.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vib795/agent-memory", - "version": "0.7.3", + "version": "0.7.4", "license": "MIT", "bin": { "agent-memory": "src/cli.js" diff --git a/package.json b/package.json index 6647ee3..0b29c29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vib795/agent-memory", - "version": "0.7.3", + "version": "0.7.4", "description": "Durable cross-repo knowledge graph for GitHub Copilot and Claude Code. Markdown source of truth, disposable SQLite index, zero runtime dependencies.", "keywords": [ "github-copilot", diff --git a/src/digest.js b/src/digest.js index b6c511b..7f0ab5b 100644 --- a/src/digest.js +++ b/src/digest.js @@ -3,22 +3,25 @@ import { createHash } from 'node:crypto'; import { captureGap, currentRepo } from './staleness.js'; /** - * Two-tier routing. + * Tiers 1 and 2 of a three-tier ladder. * - * Tier 1 is the `recall` skill's description, which is loaded into every chat - * whether or not memory is ever used. It is standing cost, so it has to read like - * a description rather than a document. + * Tier 1 is a skill description, loaded into every chat whether or not memory is ever + * used. It is standing cost, so it has to read like a description rather than a + * document. It has two occupants, not one: `recall`'s description advertises what the + * store knows; `remember`'s advertises what it is missing. Both are the same mechanism + * — a line of frontmatter that code regenerates and every conversation loads — + * pointed at opposite halves of the same problem. * - * Tier 2 is the tree, printed only when `recall` actually fires. Per-invocation - * cost, paid once, and only when someone is already looking something up. + * Tier 2 is printed only when a skill actually fires: the tree for `recall`, the + * capture brief for `remember`. Per-invocation cost, paid once, and only when someone + * is already looking something up or about to write one down. * - * Neither tier costs a premium request. A request is charged per prompt, not per - * tool call, so both of these ride inside a turn that was already paid for. + * Tier 3 — note bodies, and the colliding note that `write` hands back — lives + * outside this module, because by then the question is which note rather than which + * of them. * - * Tier 1 has two occupants, not one. `recall`'s description advertises what the store - * knows; `remember`'s advertises what it is missing. Both are the same mechanism — a - * line of frontmatter that code regenerates and every conversation loads — pointed at - * opposite halves of the same problem. + * Neither tier here costs a premium request. A request is charged per prompt, not per + * tool call, so both of these ride inside a turn that was already paid for. */ // Never dropped from either tier. A constraint is what stops an agent from burning