Skip to content

feat(capture): passive answer-memory for sessions - #489

Merged
plind-junior merged 1 commit into
testfrom
feat/passive-answer-memory
Jul 15, 2026
Merged

feat(capture): passive answer-memory for sessions#489
plind-junior merged 1 commit into
testfrom
feat/passive-answer-memory

Conversation

@plind-junior

Copy link
Copy Markdown
Member

makes the zero-friction memory loop run end to end: ask a question in one
session and the answer is saved with no human; a fresh session recalls it from
memory without re-reading the project files.

builds directly on #485 (phase-d receipt-gated auto-approve + vouch ingest).
the read path (recall, context-hook) and the auto-approve path already
existed — the only missing link was a passive session trigger, which this adds.

what changed

  • new claude-code Stop hook → vouch capture answer.
  • capture.last_exchange(transcript_path) — pure extraction of the turn's
    (question, answer), same host-wrapper filtering as first_user_prompt.
  • capture.capture_answer(...) — ingests the answer as a content-addressed
    source, files a receipt-backed claim per quotable span via
    extract.extract_receipt_claims, and self-approves only what
    proposals.approve already allows (review.approver_role: trusted-agent or
    review.auto_approve_on_receipt, whose receipts verify by construction).
    with neither opt-in the claims stay pending — no parallel write path, the
    review gate holds.
  • idempotent (same answer bytes skipped) and length-guarded (short
    acknowledgements skipped), so the every-turn Stop hook never duplicates or
    floods the kb.

verification

drove the real two-session flow through the cli, not just unit tests: session 1
vouch capture answer → 4 claims filed, 4 auto-approved, 0 pending;
fresh-process recall + context-hook inject the roadmap answer with 0 tool
calls. probes: re-fire → already-captured, short answer → answer-too-short. 12
new unit tests; full pytest + mypy + ruff green.

known limit

selection is coarse — one claim per sentence, same stance as #485. bounded by a
length floor and max-claims; smarter selection is a follow-up quality knob.

wire the session path into phase-d's receipt-gated auto-approve (#485) so the
zero-friction loop runs end to end: ask a question in one session and the answer
is saved with no human; a fresh session recalls it from memory without
re-reading the project files.

a new claude-code Stop hook runs `vouch capture answer`. capture.last_exchange
pulls the turn's (question, answer) from the transcript; the answer is ingested
as a content-addressed source; extract.extract_receipt_claims files a
receipt-backed claim per quotable span; and each is self-approved only where
proposals.approve already allows it (review.approver_role: trusted-agent or
review.auto_approve_on_receipt, whose receipts verify by construction). with
neither opt-in the claims stay pending — the review gate is honoured, never
bypassed, and no parallel write path is added.

quiet and idempotent by design: answers below a length floor (acknowledgements)
are skipped, and an answer already ingested (same bytes) is not re-captured, so
the every-turn Stop hook never duplicates or floods the kb. selection stays
coarse — one claim per sentence, same stance as #485 — a later quality knob.

the existing tool-activity page capture is untouched.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 36fd8fd0-9192-4190-b566-6a4278ff5e20

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/passive-answer-memory

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added docs documentation, specs, examples, and repo guidance cli command line interface adapters agent host adapters and install manifests tests tests and fixtures size: M 200-499 changed non-doc lines labels Jul 15, 2026
@plind-junior
plind-junior merged commit 5b8f2d4 into test Jul 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adapters agent host adapters and install manifests cli command line interface docs documentation, specs, examples, and repo guidance size: M 200-499 changed non-doc lines tests tests and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant