Skip to content

Facts and conflicts are governed like duplicates - #699

Open
WaylandYang wants to merge 3 commits into
devfrom
feat/every-queue-is-governed
Open

WaylandYang wants to merge 3 commits into
devfrom
feat/every-queue-is-governed

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

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.rs in the server). The govern job runs in order:

  1. duplicate rounds;
  2. low-confidence and stale facts, in batches of eight;
  3. open conflicts.

It uses the same switch, the same fuse (reverts of any kind count), and the same hourly scan (governance::due also 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:

  • Facts: confirm goes through temporal::set_confidence; reject goes through temporal::retract.
  • Conflicts:
    • close_old, keep_both and reject_new go through temporal::resolve_conflict.
    • retime_new goes through correct_interval + reconcile. It is for a successor whose start was taken from the wrong date.

The model decides, the server checks (utopia_extract::queue_agent builds the prompts). Each item carries its evidence (document, the document's own date, quote) and recent human decisions of that queue as precedents. At AUTO_CONF an action is applied; below it, it is proposed. Nothing the model says is taken on trust where it can be checked:

  • A date for close_old or retime_new must be the fact's start, a document's own date, or a day the quote writes out.
  • A stale fact is confirmed only by a quote that appears in the current version of its document; that quote becomes its new evidence.

A failed check holds the item as a proposal that says why.

Every applied action is revertible. agent_decisions.detail records the undo:

Action Undo
Confirm a low-confidence fact Restore the prior confidence
Confirm a stale fact Remove the attached evidence
Reject a fact temporal::restore
close_old, retime_new temporal::undo_rewrite, then the original arrives again so its conflict is recorded again
keep_both, reject_new Reopen the conflict (and restore the fact for reject_new)

summary keeps 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_confidence locks 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. A low_confidence conflict the recompute no longer holds is withdrawn.

  • Migration 0058: widens the agent_decisions target and action checks, and adds summary and detail.
  • Decision records: 0043 is new, the index row is added, and 0025's "other queues" open question points at it.

Interface (minimal, needs a look before merge):

  • Agent rows for facts and conflicts show their summary instead of two names.
  • A proposal offers that queue's own actions.
  • Revert appears on any applied fact or conflict decision.
  • en/zh labels for the new actions.

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".
    • After the governor runs: the successor is confirmed and takes over, and its conflict is withdrawn. The unsupported fact is rejected. The later tenant is retimed to 2021-06-01, and the first tenant ends there. No conflicts remain open, and there are three applied rows with summaries.
    • After a person reverts all three: the deadline is back to 0.7 and the predecessor is open again. The fact is back. The tenant's start is back, and the simultaneous conflict is open again. The second revert trips the fuse.
  • Unit tests:
    • dates accepted only from evidence;
    • audit action names;
    • prompt shape for both queues, and verdict parsing;
    • precedent rendering.
  • Suites: cargo test -p utopia-store 264, -p utopia-server 281, -p utopia-extract 57, on a fresh database migrated to 0058.
  • Lint: clippy -D warnings and fmt are clean.
  • Web: style guard, tsc, vitest 51.
  • The lease bench on a build with this, A confident merge waits for no one, and a succession clashes with nothing #696 and A value written in a table is stated #697 follows.

🤖 Generated with Claude Code

WaylandYang and others added 3 commits September 14, 2026 14:09
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>
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