feat(recall): source-aware session briefing, targeted recall hints, freshness labels, hook output contract - #129
Merged
Merged
Conversation
…reshness labels, hook output contract Four native-integration items from the 2026-09-10 web survey (claude-mem hook lifecycle, Claude Code SessionStart source field, arXiv 2608.15008 on over-retrieval): - SessionStart shapes its notice by source (startup/clear, resume, compact) and ends every shape with one capped recovery line: memories.search when config.toml has [memories] dedicated_tools = true (read through codexHome(), fail-open false), otherwise the cxc chat/memory search commands. Budgets and the repo-key project block from #127 are unchanged. - UserPromptSubmit appends "Suggested recall terms: ..." when recall intent fires, extracted from the prompt (versions, filenames, error codes, CamelCase, quoted spans; max 4). No search runs in the hook; extraction on an 8,000-char prompt stays under 20 ms. Five trigger idioms added; bare "그때" stays out. - memory search text output labels each hit [age: Nd] and marks a hit whose distinctive tokens also appear in a newer hit in another file with [newer: <relpath>]. Ranking is untouched. - Hook output contract: assertLegalHookResult({stdout, stderr, code}) is pinned by a child-process test over dist/cli.js hook <event> with an empty temp CODEX_HOME (exit 0, no ANSI on stderr, stdout empty or a JSON object). cxc doctor reports trusted_hash drift as WARN with file_sha256 evidence; a missing trust entry stays FAIL.
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.
Four native-integration items from the 2026-09-10 web survey (claude-mem's hook lifecycle, the Claude Code SessionStart
sourcefield, arXiv 2608.15008 on over-retrieval), implemented on the existing hooks and SQLite index with no background worker.source(startup/clear, resume, compact) and ends every shape with one capped recovery line:memories.searchwhenconfig.tomlhas[memories] dedicated_tools = true(resolved throughcodexHome(), fail-open false), otherwise thecxc chat/memory searchcommands. Budgets and the repo-key project block from feat(recall): key project scope by normalized git origin so managed worktrees join their main checkout #127 are unchanged.Suggested recall terms: …when recall intent fires, extracted from the prompt (versions, filenames, error codes, CamelCase, quoted spans; max 4). No search runs inside the hook; extraction on an 8,000-char prompt stays under 20 ms.memory searchtext output marks each hit[age: Nd]and a hit superseded by a newer hit in another file[newer: <relpath>]. Ranking is untouched.assertLegalHookResult({stdout, stderr, code})is pinned by a child-process test overdist/cli.js hook <event>in an empty temp home (the claude-mem #621 failure shape — ANSI on stderr, non-zero exit — is what it rejects).cxc doctorreportstrusted_hashdrift as WARN withfile_sha256evidence; a missing trust entry stays FAIL.Validation. recall 191 + cxc-ops 199 pass (+15); dist-freshness, packaging, hook-e2e, recall-skill-synopsis 38 pass. Activation receipt: three SessionStart shapes through the dist CLI (exit 0, no ANSI, recovery line present),
dedicated_tools=truefixture →memories.searchline, UserPromptSubmit hint carrieshook.ts/2.49.0, live2.49.0 SLSAoutput shows 4 age and 3 newer labels. Tests badge 2993→3007. Observations for the plan's §10 (compaction re-injection 7/11, rollout_summaries at the 256 cap, msgs_fts 1.25 GB) are recorded in076_wp6_receipt.md.Stack (merge order; all PRs target
dev): #123 → #124 → #125 → #126 → #127 → #128 → this PR (last).Plan:
devlog/_plan/260910_memory-followup-roadmap/060_wp6_native-integration.md.