Skip to content

Hint channel: user-stated facts ride injection regardless of vocabulary overlap #339

Closed

Description

@abogartz

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

Problem

The shipped matcher ranks by exact word overlap. A user-stated value ("the correct sales tax rate is 8.25% (0.0825)") shares zero vocabulary with the next session's task prompt ("identify the injected bug so the hidden suite passes"), so the row carrying the guidance can never be selected. Measured twice on the wire: rows present in the store, block non-empty, needle absent from pass-2 request bytes, warm pass fails what the guided pass passed.

Change

  1. Capture contract: candidates carry guided: true ONLY when the user stated the fact in their own words (a user: line or the REQUESTS block). Parsing is strict — only a literal true counts; junk yields an untagged candidate.
  2. Promotion: guided candidates carry the tag user-guided (constant in src/core/tags.ts, next to auto-capture).
  3. Injection: selectRelevant gains opts.guidedCap; the epoch passes 3. Guided rows ride newest-first, ahead of the lexical picks, deduped against them; capToBudget keeps the last word. Recall (memory_recall) and contextual pull leave the option off and stay query-driven.

Acceptance

  • Unit tests: guided rides a zero-overlap prompt; cap holds at 3 newest-first; untagged rows still need real overlap (no bleed); parseCandidates strictness.
  • Hint-chain bench on the merged branch: L6h (needle on a via auto-capture wire line) and L7 pass.

Footguns

  • The cap counts ROWS, not chars; one 600-char guided row can squeeze the lexical picks inside the 1200-char budget. Acceptable at cap 3; revisit if the budget shrinks.
  • selectRelevant no longer early-returns on an empty prompt before loadAll (guided rows must ride even with no prompt). Only the epochs caller is affected; do not "restore" the early return.
  • The bench's L6h check greps the via auto-capture marker from formatMemory's PROVENANCE_TAGS. Changing that marker text breaks the bench check silently — grep-couple them in the test.
  • Tag reservation for tool-authored writes is a separate ticket (security): until it lands, memory_remember can mint its own user-guided.

Activity

  1. added
    capture
    retrieval
    severity:high
    on Nov 7, 2026
  2. abogartz commented on Nov 8, 2026

    @abogartz
    OwnerAuthor

    Bench evidence (posted per the evidence-comment protocol): L6h (needle on a via auto-capture line) and L7 pass in every completed run since merge — results-conf-t3x5 49/50 links, results-attr-t3x5 43/50 (the one miss was a harness teardown race, fixed bench@c393da6), results-rules-t3x5 50/50. Unit tests on main via #360.

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

    captureretrievalseverity:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions