Repository navigation
fix(retain): ground an email author's explicit reference through its own item - #263
Merged
Merged
Conversation
…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]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, mostlycontext_witness_invalid, followed bytime_witness_invalidandsemantic_inconsistent. None was a model outage: each verifier call completed normally. A failed batch holds both of its candidates asdiscourse_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-lunaon 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:resolution: explicit,source_nameequal to the body frame's own author label, andname_originpointing at theFrom:header frame of the same item, where that label literally occurs. Onlyname_originequal to the source frame was accepted.Ada Marlowfor the author labelAda Marlow <[email protected]>. Only the exact full label was accepted.Change
In
retentionContextWitness:explicitreference 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 asname_origin.retentionAuthorNamesgives 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:
explicit-across-frames);Ada.The verifier contract and
RETAIN_VERIFIER_VERSIONare unchanged.Evidence
All data below is invented, and every model call used
gpt-6-luna.retain-variantsbenchmark runs changes, neither newly grounded nor lost.The remaining live failures are genuine. For example, the verifier writes
Bo Wintersfor 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) andpnpm check:repositorypass.pnpm knipfails 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 inpackages/core/src/ops/context.tsonmain.runRetaincase where a header-anchored author verdict no longer fails its batch. The four positive cases fail on the old code.🤖 Generated with Claude Code