Skip to content

feat(memory): consolidation via direct Haiku API — Pillar C complete (0.19.0)#36

Merged
Shahinyanm merged 1 commit into
mainfrom
feat/memory-consolidation-p32
Jun 13, 2026
Merged

feat(memory): consolidation via direct Haiku API — Pillar C complete (0.19.0)#36
Shahinyanm merged 1 commit into
mainfrom
feat/memory-consolidation-p32

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

What

task-journal consolidate distils a project's recurring decisions/constraints into durable semantic/procedural facts, stored in a per-project "Project conventions (consolidated)" task with provenance, surfaced in ask/recall. Completes Pillar C and the core memory platform.

Cost & safety

  • Manual, opt-in. One direct Anthropic Haiku API call per run, only when you run it — never on a hook, cannot spend automatically. ~1¢/run.
  • Direct API, not 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.
  • No 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

…(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>
@Shahinyanm Shahinyanm merged commit 657c5e2 into main Jun 13, 2026
7 checks passed
@Shahinyanm Shahinyanm deleted the feat/memory-consolidation-p32 branch June 13, 2026 08:58
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