feat(memory): consolidation via direct Haiku API — Pillar C complete (0.19.0)#36
Merged
Merged
Conversation
…(0.19.0) `task-journal consolidate` distils a project's recurring decisions and constraints into durable semantic/procedural facts (bd claude-memory-8oy). - tj-core::consolidate: a strict summarisation prompt + parser + a direct Anthropic Haiku API call (mockito-tested). Direct API, not `claude -p`: post-2026-06-15 both bill as extra usage, but claude -p also boots the whole environment (~tens of k tokens) per call — the direct API sends only our ~7k-token prompt (~1c/run vs 5-10c). - tj-core::db: high_signal_events / find_task_by_title / task_event_texts. - tj-cli `consolidate [--max-facts N]`: gathers decisions/constraints/ rejections, calls Haiku once, stores facts as events (tier=semantic| procedural, consolidated=true, derived_from=<source ids>) in a reusable per-project "Project conventions (consolidated)" task, then embeds + syncs them to the global recall index. De-dups on re-run. SAFETY: manual command only, one call per run, never on a hook → cannot spend automatically. No ANTHROPIC_API_KEY => skips cleanly, writes nothing. No heuristic fallback (would manufacture noise). Tests: parse/build/empty/mock API call (core, 5); CLI consolidate stores + de-dups + surfaces in recall, and skips without a key spending nothing (2). Clean on default and --no-default-features. This completes Pillar C (preferences + consolidation) and the core memory platform. 1.0 remains a separate, later decision (real-world soak + API freeze + WSL project_hash fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
task-journal consolidatedistils a project's recurring decisions/constraints into durable semantic/procedural facts, stored in a per-project "Project conventions (consolidated)" task with provenance, surfaced inask/recall. Completes Pillar C and the core memory platform.Cost & safety
claude -p: post-2026-06-15 both bill extra, but claude -p boots the whole env (~tens of k tokens) per call; direct API sends only the ~7k prompt.ANTHROPIC_API_KEY→ skips cleanly, writes nothing. No heuristic fallback. Re-running de-dups.Tests
Core (5): prompt/parse/empty/mock API. CLI (2): stores + de-dups + surfaces in
recall; skips without a key spending nothing. Clean on default and--no-default-features.Not 1.0
Core platform complete; 1.0 stays a later decision (soak + API freeze + WSL project_hash fix).
🤖 Generated with Claude Code