Skip to content

feat(memory): note, status, and read_memory MCP tool — kill agent cold-start#233

Merged
manojmallick merged 3 commits into
developfrom
feat/memory-tools-read-memory-note-status
Jun 8, 2026
Merged

feat(memory): note, status, and read_memory MCP tool — kill agent cold-start#233
manojmallick merged 3 commits into
developfrom
feat/memory-tools-read-memory-note-status

Conversation

@manojmallick

Copy link
Copy Markdown
Owner

Targets v6.16.0 (Phase 1.5). Implements the Memory milestone from .personal/BACKEND_IMPLEMENTATION.md — closes the cold-start gap so an agent can recall what we were doing and why without re-scanning the repo.

What's in it

sigmap note "<text>" — append to a cross-session decision log stored as append-only NDJSON at .context/notes.ndjson (text + ISO timestamp + git branch). Bare note lists recent (--list <N>, --json). Positional parsing is value-flag-aware so --cwd <dir> never leaks into the note text. New module src/session/notes.js.

sigmap status — repo state at a glance: branch (with unborn-branch symbolic-ref fallback), dirty-file count, last index run (time/version/file-count) with a staleness signal (tracked files modified since the last index), and notes summary. --json supported.

read_memory MCP tool (11th) — returns recent notes (most-recent first) plus the last ask session focus, formatted for agents. Registered in tools.js / handlers.js / server.js.

Bundle--mcp runs the server from __require('./src/mcp/server') (always the bundle), so the mcp/{tools,handlers,server} factories were re-synced from src/ and src/session/notes inserted. Verified over the MCP wire in a no-src/ binary-equivalent run (11 tools, read_memory returns a seeded note). Build pre-flight passes.

Tests

  • test/integration/memory-tools.test.js — 13 cases: notes store (append/read/limit/corrupt-line/clear), note/status CLI (incl. the --cwd-leak regression), and read_memory over the MCP wire.
  • Updated MCP tool-count gates 10 → 11 in get-lines / server / tools-v14 tests (+ assert read_memory present).
  • Wired memory-tools into npm run test:integration; fixed a pre-existing broken mcp-server.test.js path → mcp/server.test.js.
  • npm test, npm run test:integration, all MCP tests, and the VitePress docs build pass.

Notes

  • Follows the existing .context/ state convention (not .sigmap/ as the plan draft said) and NDJSON pattern; complements src/session/memory.js rather than duplicating it.
  • Version bump (6.16.0) + CHANGELOG header left to /update-docs at release.

🤖 Generated with Claude Code

…d-start

Add the Phase 1.5 memory tools (targets v6.16.0) so an agent can recall what
was being worked on across sessions without re-scanning the repo:

- src/session/notes.js: append-only decision log at .context/notes.ndjson
  (text + ISO timestamp + git branch). addNote/readNotes/formatNotes/clearNotes.
- sigmap note "<text>": append a note; bare 'note' lists recent (--list N,
  --json). Value-flag-aware positional parsing so --cwd never leaks into text.
- sigmap status: branch (unborn-branch fallback), dirty-file count, last index
  run + staleness (tracked files modified since), notes summary. --json.
- read_memory MCP tool (11th): recent notes + last ask() session focus.
  Registered in tools.js/handlers.js/server.js; bundled for the standalone
  binary (verified over the MCP wire in a no-src run).
- Bundle: re-synced mcp/{tools,handlers,server} factories from src and inserted
  src/session/notes; build pre-flight passes.
- Tests: test/integration/memory-tools.test.js (13 cases); update MCP tool-count
  gates 10 -> 11; wire memory-tools into test:integration; fix pre-existing
  broken mcp-server.test.js path.
- Docs: docs-vp/guide/memory.md + sidebar; CHANGELOG [Unreleased].
# Conflicts:
#	CHANGELOG.md
#	gen-context.js
#	package.json
…sion.json + mcp.md

CI auto-discovers all integration tests; several asserted the old 10-tool
count outside test/integration/mcp/. Update impact.test.js, retrieval.test.js,
version-json.test.js (mcp_tools 10->11), and docs-sync.test.js, plus the
mcp.md guide (counts + read_memory row + example list) and version.json.
@manojmallick manojmallick merged commit 2c32f58 into develop Jun 8, 2026
5 checks passed
@manojmallick manojmallick deleted the feat/memory-tools-read-memory-note-status branch June 8, 2026 21:44
lguzzon pushed a commit to lguzzon-scratchbook/sigmap that referenced this pull request Jun 10, 2026
- CHANGELOG: v6.15.0 section (verify-ai-output Reliable MVP manojmallick#232 + Memory
  tools manojmallick#233); version synced across package.json ×3, gen-context.js,
  src/mcp/server.js, version.json (mcp_tools 11).
- Benchmarks re-run (sigmap-v6.15-main, 2026-06-09): token reduction 97.1%,
  hit@5 75.6%, lift 5.6x, task success 51.1%, prompt reduction 39.0%,
  1.73 prompts/task. Propagated to version.json, README, index hero,
  benchmark/retrieval/quality/task guides, generalization, compare-alternatives,
  methodology, how-i-built, and the comparison-chart + impact-banner SVGs.
- Docs: new CLI sections (note, status, verify-ai-output --report); mcp.md
  read_memory (11 tools); roadmap v6.15.0 entry + next-milestone; memory guide.
- Tests: content-consistency gates (readme-structure, version-json, docs-sync)
  updated to the new metrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant