Facts and conflicts are governed like duplicates - #699
WaylandYang wants to merge 3 commits into
Conversation
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>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
|
Review before the dev → main merge. Holding this PR out of the release. It merges cleanly with current
Smaller issues:
Item 3 needs fixing before anything else merges on top of this, since it changes reconcile for every base. 🤖 Generated with Claude Code |
|
Closing for now. Since this was opened, extraction moved to the open graph (#731, #735, #736): typed facts come only from alignment (0044 cut 2), so the queues this PR governs (facts, conflicts) will be fed by the alignment layer and the typed path this branch edits is gone. 0043 stays the decision; it re-lands on top of the alignment slices rather than being rebased across the rewrite. The branch is kept. |
Cut 1 of #695. Low-confidence facts, stale facts and temporal conflicts are handled by the governor, the same way duplicate pairs are (0025). This is recorded as 0043. Nods (
pending_facts, 0015) stay with people. Violations, ontology defects and concept mappings are cut 2.Why
On the Blackbaud lease bench, the amendments' new deadlines came out at confidence 0.7. A value that doubtful may not take over from the one before it (0022, #679), so the conflict and the fact both waited for a person. The as-of question came back with two answers. Only duplicate pairs had an agent.
What changes
The same governor, more queues (
queue_agent.rsin the server). Thegovernjob runs in order:It uses the same switch, the same fuse (reverts of any kind count), and the same hourly scan (
governance::duealso looks for fact and conflict backlog). Extraction on a governed base enqueues the job after every document.Each queue's own actions, through the people's paths:
confirmgoes throughtemporal::set_confidence;rejectgoes throughtemporal::retract.close_old,keep_bothandreject_newgo throughtemporal::resolve_conflict.retime_newgoes throughcorrect_interval+ reconcile. It is for a successor whose start was taken from the wrong date.The model decides, the server checks (
utopia_extract::queue_agentbuilds the prompts). Each item carries its evidence (document, the document's own date, quote) and recent human decisions of that queue as precedents. AtAUTO_CONFan action is applied; below it, it is proposed. Nothing the model says is taken on trust where it can be checked:close_oldorretime_newmust be the fact's start, a document's own date, or a day the quote writes out.A failed check holds the item as a proposal that says why.
Every applied action is revertible.
agent_decisions.detailrecords the undo:temporal::restoreclose_old,retime_newtemporal::undo_rewrite, then the original arrives again so its conflict is recorded againkeep_both,reject_newreject_new)summarykeeps what the item looked like when decided. A person answers from the Agent queue (POST /review/agent/{id}): accept, override with the queue's own action, or revert.Confidence is part of the timeline.
set_confidencelocks the fact's timelines, changes the value and recomputes.graph::confirm_fact, the human button, now uses it too, so confirming a doubtful successor lets it take over. Alow_confidenceconflict the recompute no longer holds is withdrawn.agent_decisionstarget and action checks, and addssummaryanddetail.Interface (minimal, needs a look before merge):
Checks
the_agent_settles_facts_and_conflicts_and_a_person_can_take_it_back(server, scripted model endpoint). The fixture is the lease shape: a 0.9 deadline, a 0.7 successor, an unsupported fact, and two tenants starting on the same day. The later tenant's evidence says "became the tenant on June 1, 2021".cargo test -p utopia-store264,-p utopia-server281,-p utopia-extract57, on a fresh database migrated to 0058.-D warningsand fmt are clean.tsc, vitest 51.🤖 Generated with Claude Code