Skip to content

feat(recall): source-aware session briefing, targeted recall hints, freshness labels, hook output contract - #129

Merged
lidge-jun merged 3 commits into
devfrom
codex/memory-l1-wp6-native
Sep 10, 2026
Merged

feat(recall): source-aware session briefing, targeted recall hints, freshness labels, hook output contract#129
lidge-jun merged 3 commits into
devfrom
codex/memory-l1-wp6-native

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Four native-integration items from the 2026-09-10 web survey (claude-mem's hook lifecycle, the Claude Code SessionStart source field, arXiv 2608.15008 on over-retrieval), implemented on the existing hooks and SQLite index with no background worker.

  • Source-aware briefing. 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 (resolved through codexHome(), fail-open false), otherwise the cxc chat/memory search commands. 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.
  • Targeted recall hint. 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 inside the hook; extraction on an 8,000-char prompt stays under 20 ms.
  • Freshness labels. memory search text output marks each hit [age: Nd] and a hit superseded by a newer hit in another file [newer: <relpath>]. Ranking is untouched.
  • Hook output contract + doctor. assertLegalHookResult({stdout, stderr, code}) is pinned by a child-process test over dist/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 doctor reports trusted_hash drift as WARN with file_sha256 evidence; 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=true fixture → memories.search line, UserPromptSubmit hint carries hook.ts / 2.49.0, live 2.49.0 SLSA output 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 in 076_wp6_receipt.md.

Stack (merge order; all PRs target dev): #123#124#125#126#127#128this PR (last).

Plan: devlog/_plan/260910_memory-followup-roadmap/060_wp6_native-integration.md.

…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.
@lidge-jun
lidge-jun merged commit 9cd5276 into dev Sep 10, 2026
12 checks passed
@lidge-jun
lidge-jun deleted the codex/memory-l1-wp6-native branch September 10, 2026 02:12
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