A chunk reads the opening of its document, and a date keeps the contract format - #680
Merged
Merged
Conversation
This was referenced Sep 13, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
…s not evidence Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
WaylandYang
force-pushed
the
fix/a-chunk-reads-its-document-opening
branch
from
September 13, 2026 15:17
c55dc3c to
316a7ea
Compare
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Contributor
Author
|
Recall bench (NVIDIA corpus, DeepSeek-V3 through SiliconFlow) before merging. Both rounds ran tonight under the same heavy throttling, 45–47 rate-limit warnings and 4 chunks skipped per round:
Flat within one standard deviation (about 2.7). An earlier round on c55dc3c scored 38/52, but that one was disturbed by a concurrent run (70 warnings, 7 chunks skipped) and doesn't count. Both scores sit well below this morning's 49/52; that drop is being attributed separately, because it appears on dev as well. Also reviewed:
🤖 Generated with Claude Code |
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.
Two extraction contract fixes found on a real lease amendment chain. Each chunk now sees the opening of its document, and a date keeps the contract format even though other literals keep their units.
A chunk reads the opening of its document
A chunk was extracted on its own. The Blackbaud HQ lease's fifth amendment puts the new deadlines in a table in its third chunk, which says only "the Existing Dates in Article 13 are extended". Which lease, and from which date, are both in the first chunk.
Without them, the model made the deadline name itself the subject, and the server dropped it as
subject_not_declared. Or it wrote a deadline with no start, which the temporal engine cannot use to close the old value.build_messages_with_openingadds the first chunk, capped at 1,500 characters, to every later chunk as read-only context before the known entities.build_messagesis unchanged and delegates with no opening, so its output is identical. Rule 10 now says a value changed by a document takes effect when the change does, by default the document's own effective date. Rule 1a adds that a name ends where a description of the thing's history begins.After review.
documents::opening_chunk) and compared by id. It used to be the first chunk not yet extracted, so re-extracting chunks 3 and 7 of a changed document gave chunk 7 chunk 3 as its opening, and a retry after a failed chunk did the same.quote_from_opening, along with any declaration only that fact referenced. It would otherwise cite chunk 0's words as evidence from chunk k.A date keeps the contract format
Rule 8a told the model to keep a literal as written, with its units, and listed a date among the literals. Rule 3 and the attribute rule require
YYYY-MM-DD. The model followed 8a, wrote "June 23, 2020", and the attribute datatype check dropped the fact. Across the bench runs that happened more than 20 times, and it was the largest single loss of deadline values. 8a now makes dates the exception and says a deadline stated relative to an event is not a date. Rule 8c qualifiers take the same exception.Checks
cargo test -p utopia-extract --lib: 48 passed, includinga_later_chunk_reads_the_opening_of_its_document,a_long_opening_is_cut_on_a_character_boundary,a_literal_keeps_its_units_but_a_date_takes_the_contract_formatanda_fact_quoting_the_opening_is_dropped_with_its_orphan.a_document_opening_is_its_first_live_chunk(database): the opening skips a superseded chunk and ignoresextracted_at.cargo test -p utopia-server --bins: 267 passed.-D warningsand fmt are clean.Measured
Contract bench (set up as in #679), right answers of 18:
With the opening, deadline facts carry the amendment's effective date as
valid_from; on dev they had none. With the date carve-out, all five extended deadlines were extracted in a run for the first time. The total moves less than recall does, because the engine still misordered late values. #679 fixes that. Runs vary by about 3 questions, and this chain has not been run through the NVIDIA recall bench.🤖 Generated with Claude Code