Skip to content

fix(retain): ground an email author's explicit reference through its own item - #263

Merged
tenphi merged 1 commit into
mainfrom
fix/verifier-witness-failures
Nov 25, 2026
Merged

tenphi merged 1 commit into
mainfrom
fix/verifier-witness-failures

Conversation

@tenphi

@tenphi tenphi commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Problem

In production, about a third of automatic retains on busy days end degraded: ['retain_verification_failed']. Every failing verifier batch over the last two weeks failed one of Akno's own answer checks, mostly context_witness_invalid, followed by time_witness_invalid and semantic_inconsistent. None was a model outage: each verifier call completed normally. A failed batch holds both of its candidates as discourse_uncertain.

The failures cluster on a client's daily scheduled email report. Its email items start with header lines (From: Name <address>, To: …), and the extractor includes that header line as one of the candidate's discourse frames.

What the verifier does

I reproduced the failure live with gpt-6-luna on an invented source of the same shape (three emails plus the assistant's report) and diagnosed each rejected verdict. Most rejections were the verifier naming an email's first-person author correctly, but in a form the context witness refuses:

  • Header frame as anchor: resolution: explicit, source_name equal to the body frame's own author label, and name_origin pointing at the From: header frame of the same item, where that label literally occurs. Only name_origin equal to the source frame was accepted.
  • Display name: Ada Marlow for the author label Ada Marlow <[email protected]>. Only the exact full label was accepted.

Change

In retentionContextWitness:

  • An explicit reference whose name is one of the source frame's own author names is grounded by that label, whichever frame of the same item it cites as name_origin.
  • retentionAuthorNames gives the names an author label establishes: the label and, for a mailbox-style label, its display name. Part of a display name is not included.

Every verdict accepted before is still accepted, and these stay rejected:

  • an explicit name that isn't the frame's own author, cited from another frame (explicit-across-frames);
  • an explicit anchor in another item;
  • a neighbouring frame's speaker label;
  • a short form such as Ada.

The verifier contract and RETAIN_VERIFIER_VERSION are unchanged.

Evidence

All data below is invented, and every model call used gpt-6-luna.

Runs with a failed batch Failed verifier batches Facts saved per run
Before, live (3 runs) 3 of 3 4 of 12 3.3
After, live (6 runs) 2 of 6 3 of 24 4.3
  • Replay with identical model output: 5 of the 8 rejected verdicts from the three "before" runs are now grounded. The other 3 are genuine wrong anchors and stay rejected.
  • Replay of the October benchmark: none of the 548 verdicts from the 224 recorded retain-variants benchmark runs changes, neither newly grounded nor lost.

The remaining live failures are genuine. For example, the verifier writes Bo Winters for a "your" or "Hi Bo," reference while citing a frame that doesn't contain that name. They stay fail-closed. The live samples are small; the replay is the stronger evidence that nothing else moved.

Checks

  • pnpm typecheck, pnpm lint, pnpm test (5,081 tests) and pnpm check:repository pass.
  • pnpm knip fails locally only on an untracked local script that isn't in this branch, so CI's clean checkout won't see it.
  • pnpm format:check, which CI doesn't run, flags only existing drift in packages/core/src/ops/context.ts on main.
  • New tests cover each accepted and each still-rejected form, plus a full runRetain case where a header-anchored author verdict no longer fails its batch. The four positive cases fail on the old code.

🤖 Generated with Claude Code

…own item

The context witness rejected two legitimate forms of one reference as
context_witness_invalid, failing the whole verification batch and holding
both candidates as discourse_uncertain:

- an explicit first-person reference to the frame's own author that cites
  another frame of the same item, such as an email's From: header line, as
  its name anchor;
- the display name of a mailbox-style author label, such as Ada Marlow for
  "Ada Marlow <[email protected]>".

A frame's own author label grounds its explicit author by itself, so the
cited anchor within the same item cannot change the identity. The existing
rules stay: an explicit name that is not the frame's own author must occur
in its own frame, an anchor in another item is rejected, a neighboring
frame's speaker cannot be borrowed and part of a display name is not
accepted. Every accepted verdict was already accepted before.

Replaying recorded live verifier responses, 5 of 8 rejected verdicts in
three runs of an invented scheduled email report are now grounded, and none
of the 548 verdicts from 224 recorded benchmark runs changes. The verifier
contract is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tenphi
tenphi merged commit dd5c894 into main Nov 25, 2026
5 checks passed
@tenphi
tenphi deleted the fix/verifier-witness-failures branch November 25, 2026 21:01
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
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