Skip to content

Capture prompt lists already-stored rows (dedup context) #341

Closed

Description

@abogartz

Part of #334. Reference implementation: branch retrieval-fix-20261107 @ 6f03e2d, commit item (3).

Problem

Capture re-mined the whole transcript on every trigger and offered the same facts again. The write gate collapsed them (moat intact), but each retry spent a capture-model call and an evidence line to store nothing — the dominant cost of repeated idle capture on long sessions.

Change

buildCapturePrompt gains a 4th argument: a compact list of rows the repo already keeps (knownRowsFor in the capture runtime: visible injectable rows, newest first, 15 rows / 90 chars each / 1400 total). The prompt names it as a do-not-repeat list. Empty store → no block, prompt unchanged.

Acceptance

  • Unit tests: the list rides the prompt when the store is non-empty; absent when empty; e2e: a seeded row's text appears in the capture prompt.
  • Evidence after merge: auto_capture_collapsed rate per session drops on repeat captures (record before/after from the bench stores).

Footguns

  • REVIEW ITEM before merge: the known list is rendered from store rows and passed through buildCapturePrompt WITHOUT redactSecrets (the transcript and prose arms are redacted; this arm is not). Store rows are gate-scrubbed at write time, so this is defense-in-depth, but add redactSecrets(known) inside buildCapturePrompt to keep the invariant "every block that reaches the capture model is redacted there, once".
  • The list is visibility-filtered (repo + global via readerFromSid). Do not widen it — global rows are already visible to the session anyway.
  • Keep the helper fail-soft: a store read failure must degrade to an empty list, never skip the capture.

Activity

  1. added
    capture
    severity:medium
    agent:ready
    on Nov 7, 2026
  2. abogartz commented on Nov 8, 2026

    @abogartz
    OwnerAuthor

    Landed via #362 including the review item (redactSecrets(known) inside buildCapturePrompt, main src/capture/prompt.ts:49). Dedup evidence from bench stores: auto_capture_collapsed = 0 on every run before and after (11 promoted rows results-attr-t3x5, 12 results-rules-t3x5, conflict runs 5+4+10) — nothing duplicated in those windows, so the rate had nothing to drop; no regression observed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readycaptureseverity:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions