{{ message }}
Repository navigation
An errata agent reviews each document's typed facts, structure first, through the gate - #885
Merged
Merged
Conversation
… through the gate Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <145302500+WaylandYang@users.noreply.github.com>
…oved and what it cost Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <145302500+WaylandYang@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <145302500+WaylandYang@users.noreply.github.com>
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.

The sixth cut of 0044 — decision 7: an errata agent reviews the typed graph after extraction, through the 0027 gate. The prototype measured what such an agent buys (judged precision 76.1% → 89.5% on 99 documents) and what it costs (278 retractions, about a quarter of them correct); this builds it so the cost can be governed rather than accepted.
What it does
domain/range(an end outside the property's declared kinds, through the class hierarchy),name_absent(a name that does not occur in the document),no_date(a date property without a date). Flagged facts go to the model first; the rest is sampled. The classification is one SQL query with the ancestor closure computed in it, no model call.errata_reviewjob sends the document, the ontology's properties and the numbered facts (with their flags and the quote each was read from) in batches of 20, at most two requests per document. The model answerskeep/retract/revisefor every fact and mayaddonly once every given fact is answered (the parser refuses additions otherwise). Every retract, revise and add must quote the document's own words; the store verifies the quote against the document text and records a quote that is not there — or a name not in the base, or a property that does not exist — asrefused, never applied. The agent creates nothing.execution_gategainsimpact_of_fact(derived facts resting on it, answers that named its subject) andimpact_of_write(a one-value property that would get two values, 0027 §5's yardstick). A held action goes to a new errata queue on the Review page — document, proposed change, quote, the reason it was held in 0027's wording — where a person applies or rejects it (POST /kbs/{id}/review/errata/{action_id}). An applied retraction usesreject_fact(invalidated, evidence kept); a revision retracts the old row and writes a typed row that inherits its validity; an addition writes one anchored on the document's date; new rows get the quote as evidence on the chunk that contains it.errata_runsrecords per document what was flagged and sampled, how many requests were made and the endpoint's token usage (utopia_llm::Replynow carriesusagefrom the stream's last frame; absent means none reported, not zero).errata_actionsrecords every verdict,keepincluded, so a fact is reviewed once.scripts/bench/typed.mjs --errataruns the agent after alignment and reports the account, scores again, and with--judgesends the retracted rows to the judge: facts it calls stated are the ones removed wrongly. That is 0044's measure for this cut, precision gained against correct facts removed, at what cost. Not yet run with a model (the bench in A typed-graph bench on Re-DocRED measures what alignment recovers against the record's thresholds #880 has not been either).Schema (migration 0074):
errata_runs,errata_actions.CURRENT_SCHEMA_VERSION→ 73.Verified against pgvector/pgvector:pg16 on a fresh database:
New coverage: the four structural flags land on the right facts and flagged ones come first, a reviewed fact is not offered again and a document leaves the due list only when all its facts are reviewed; a retraction survives a second materialisation while the statement and binding stay, and a retraction whose quote is not in the document is refused and touches nothing; a retraction with a derived fact resting on it is held, listed on the queue with its reason, and a person's rejection keeps the row while an approval retracts it (answered once); a revision retracts the old row and writes a new one with the quote as evidence, an addition writes a value, an unknown name and an unknown property are refused, and an addition under a one-value property that already has a value is held as a contradiction; the parser gives every fact one verdict, counts malformed rows without believing them, requires a quote for retract/revise/add and refuses additions until every fact is answered; the server job (scripted model) puts the flagged fact first in the prompt, applies the retraction, records keep, applies an addition with a real quote and refuses one without, books one request with the endpoint's tokens, and asks nothing on a second run; an unreadable reply leaves every fact unreviewed and the job reports failure so it retries; the route answers 403 to a viewer, 404 in another base, lists the held action with its counts, applies it on approve and 404s once answered.
Not in this PR, said in the record: reverting an applied errata action (the ledger has the row; the undo is the same path as a manual retraction); a revision table for
keepverdicts; evidence beyond the quote's chunk for quotes that span chunks (they fall back to the document's first chunk).🤖 Generated with Claude Code