Skip to content

World's first open-source enterprise world model.

The agent judges on its own; history moves the bar or blocks (0025 decision 4 revised) (#446)

WaylandYang39cd9028f0fb
diff --git a/crates/utopia-extract/src/lib.rs b/crates/utopia-extract/src/lib.rs
index b47f3694..86d18c0d 100644
--- a/crates/utopia-extract/src/lib.rs
+++ b/crates/utopia-extract/src/lib.rs
@@ -498,12 +498,14 @@ pub fn parse_response(raw: &str) -> anyhow::Result<Extraction> {
// ---------------------------------------------------------------------------
/// 待裁决的一侧:名字 + 类型 + 事实摘要行。
+#[derive(Debug, Clone)]
pub struct AdjudicationSide {
pub name: String,
pub type_label: String,
pub facts: Vec<String>,
}
+#[derive(Debug, Clone)]
pub struct AdjudicationPair {
pub left: AdjudicationSide,
pub right: AdjudicationSide,
diff --git a/crates/utopia-server/src/governance.rs b/crates/utopia-server/src/governance.rs
index cebe088a..8c15b217 100644
--- a/crates/utopia-server/src/governance.rs
+++ b/crates/utopia-server/src/governance.rs
@@ -1,6 +1,7 @@
//! 治理任务(0025):开关开着就把等人的重复对按先进先出过一遍,先读台账再裁。
//!
-//! 两层。第一层是攒批:队头带着它的簇进一次模型调用,先例已经在提示词里;过闸的
+//! 人裁过的一对(同一对实体,或名字不同的同一对名字)照人的定,不问模型。
+//! 其余两层。第一层是攒批:队头带着它的簇进一次模型调用,先例已经在提示词里;过闸的
//! 自己动手(合并可撤、分开可再合)。第二层(第二刀)只接第一层**判不定**的对:
//! 逐条带工具再看一遍——一侧的全部事实、原文片段、台账里人对这个名字的决定、
//! 同名的其他实体——看完要么 decide,要么 defer 留一个具体的问题给人。硬规则拦下
@@ -30,8 +31,9 @@ use uuid::Uuid;
const BATCH_SIZE: i64 = 12;
/// 一个任务最多走几轮,之后再排一个接着走——让别的库的任务也轮得上
const MAX_ROUNDS: usize = 20;
-/// 每库每天第二层最多花几次模型调用。用完了,判不定的对照第一刀写成建议
-const LOOP_DAILY_CALLS: i64 = 300;
+/// 每库每天第二层最多花几次模型调用。用完了,判不定的对照第一刀写成建议。
+/// 300 在一次 229 块的导入上第一轮就用光了(132 对花了 301 次),所以是 2000
+const LOOP_DAILY_CALLS: i64 = 2000;
/// 一次工具结果最多给模型多少字:原文片段与事实列表都可能很长
const TOOL_OUTPUT_CHARS: usize = 3000;
@@ -69,6 +71,18 @@ impl Look {
}
}
+ /// 人裁过这一对:照人的定,不问模型
+ fn from_people(merged: bool) -> Self {
+ Look {
+ same: Some(merged),
+ conf: 1.0,
+ why: Some("a person decided this same pair before".into()),
+ question: None,
+ trace: Vec::new(),
+ calls: 0,
+ }
+ }
+
/// 第一层没定:没判决,或置信度不到线
fn uncertain(&self) -> bool {
self.same.is_none() || self.conf < AUTO_CONF
@@ -123,30 +137,55 @@ pub async fn govern(state: &AppState, kb_id: Uuid) -> anyhow::Result<()> {
.zip(&precedents)
.map(|(item, p)| pair_of(item, p))
.collect();
- let messages = utopia_extract::build_adjudication_messages(&pairs);
- let reply = {
- let _permit = permit(&ctx).await;
- // 调用/解析失败 → 任务按退避重试;重试耗尽后这些对留在队列里,人照样能裁
- client.chat(&messages).await?
- };
- let verdicts = utopia_extract::parse_adjudication(&reply)?;
- let by_i: HashMap<usize, &utopia_extract::AdjudicationVerdict> =
- verdicts.iter().map(|v| (v.i, v)).collect();
+ // 人定过的直接照办,不问模型;剩下的才攒批
+ let mut asked: Vec<usize> = Vec::new();
for (idx, item) in items.iter().enumerate() {
- let look = match by_i.get(&idx) {
- Some(v) => Look::from_batch(
- match v.verdict.as_str() {
- "same" => Some(true),
- "different" => Some(false),
- _ => None,
- },
- v.confidence.unwrap_or(0.5).clamp(0.0, 1.0),
- v.why.clone(),
- ),
- None => Look::from_batch(None, 0.0, None),
+ let prior =
+ gov::decided_before(&state.pool, kb_id, item.left.id, item.right.id).await?;
+ match gov::settled_by_people(&item.left.name, &item.right.name, &precedents[idx], prior)
+ {
+ Some(merged) => {
+ settle(
+ &ctx,
+ item,
+ &pairs[idx],
+ &precedents[idx],
+ Look::from_people(merged),
+ )
+ .await?
+ }
+ None => asked.push(idx),
+ }
+ }
+ if !asked.is_empty() {
+ let batch: Vec<utopia_extract::AdjudicationPair> =
+ asked.iter().map(|&i| pairs[i].clone()).collect();
+ let messages = utopia_extract::build_adjudication_messages(&batch);
+ let reply = {
+ let _permit = permit(&ctx).await;
+ // 调用/解析失败 → 任务按退避重试;重试耗尽后这些对留在队列里,人照样能裁
+ client.chat(&messages).await?
};
- settle(&ctx, item, &pairs[idx], &precedents[idx], look).await?;
+ let verdicts = utopia_extract::parse_adjudication(&reply)?;
+ let by_i: HashMap<usize, &utopia_extract::AdjudicationVerdict> =
+ verdicts.iter().map(|v| (v.i, v)).collect();
+
+ for (n, &idx) in asked.iter().enumerate() {
+ let look = match by_i.get(&n) {
+ Some(v) => Look::from_batch(
+ match v.verdict.as_str() {
+ "same" => Some(true),
+ "different" => Some(false),
+ _ => None,
+ },
+ v.confidence.unwrap_or(0.5).clamp(0.0, 1.0),
+ v.why.clone(),
+ ),
+ None => Look::from_batch(None, 0.0, None),
+ };
+ settle(&ctx, &items[idx], &pairs[idx], &precedents[idx], look).await?;
+ }
}
state.emit_review(kb_id);
}
diff --git a/crates/utopia-store/src/governance.rs b/crates/utopia-store/src/governance.rs
index d1c6fc49..5500852c 100644
--- a/crates/utopia-store/src/governance.rs
+++ b/crates/utopia-store/src/governance.rs
@@ -19,6 +19,8 @@ use crate::resolution::{assemble_reviews, ReviewRow};
/// 自己动手的置信度线。比攒批裁决器的 0.8 高一点:那一档只看这一对,这里是替人做主
pub const AUTO_CONF: f32 = 0.85;
+/// 历史同意时的线:人对这一对、这个名字或这种类型对做过同样的决定,agent 的把握可以低一点
+pub const SUPPORTED_CONF: f32 = 0.75;
/// 类型对的习惯要有多少笔人的决定才算数
pub const TYPE_PAIR_MIN: i64 = 5;
/// 每族先例最多带几条进提示词
@@ -249,38 +251,94 @@ pub enum Gate {
Propose,
}
-/// 硬规则先于置信度:类型冲突不合、有撤回只建议、与人对这一对的决定相反只建议。
-/// 合并要有先例撑着——这一对合过、这个名字合过且从没分过、或这种类型对有明显的
-/// 合并习惯且没撤回过;分开只要置信度。一个库里没有任何人的历史,就不会自己合
+impl Precedents {
+ /// 历史同意这个判决:这一对被人这么裁过、这个名字每次都这么裁、或这种类型对有
+ /// 这个习惯(够 TYPE_PAIR_MIN 笔;合并的习惯还要求没撤回过)
+ pub fn supports(&self, same: bool) -> bool {
+ let pair = self.same_pair.iter().any(|x| x.merged() == same);
+ let name = !self.same_name.is_empty() && self.same_name.iter().all(|x| x.merged() == same);
+ let habit = self.type_pair.as_ref().is_some_and(|t| {
+ t.merged + t.kept >= TYPE_PAIR_MIN
+ && if same {
+ t.merged >= t.kept && t.reverted == 0
+ } else {
+ t.kept > t.merged
+ }
+ });
+ pair || name || habit
+ }
+}
+
+/// agent 按自己的把握判,历史是参考(0025 决定 4,2026-09-06 修订)。历史反对就拦住:
+/// 人分开过这一对却说合、合过却说分、涉及任一名字的撤回。历史同意就把线放低。其余
+/// 按 agent 自己的把握。类型冲突永远不合——那是规则,不是把握
pub fn gate(same: Option<bool>, conf: f32, types_conflict: bool, p: &Precedents) -> Gate {
let Some(same) = same else {
return Gate::Propose;
};
- if conf < AUTO_CONF || !p.reverts.is_empty() {
+ if !p.reverts.is_empty() || p.same_pair.iter().any(|x| x.merged() != same) {
return Gate::Propose;
}
- if p.same_pair.iter().any(|x| x.merged() != same) {
+ if same && types_conflict {
return Gate::Propose;
}
- if !same {
- return Gate::Apply;
- }
- if types_conflict {
- return Gate::Propose;
- }
- let pair_support = p.same_pair.iter().any(|x| x.merged());
- let name_support =
- p.same_name.iter().any(|x| x.merged()) && p.same_name.iter().all(|x| x.merged());
- let habit = p.type_pair.as_ref().is_some_and(|t| {
- t.merged + t.kept >= TYPE_PAIR_MIN && t.merged >= t.kept && t.reverted == 0
- });
- if pair_support || name_support || habit {
+ let bar = if p.supports(same) {
+ SUPPORTED_CONF
+ } else {
+ AUTO_CONF
+ };
+ if conf >= bar {
Gate::Apply
} else {
Gate::Propose
}
}
+/// 同一对实体,人裁过没有:Some(true) 合过、Some(false) 分过、None 没裁过。
+/// 按实体 id 认,不按名字——名字一样的两个「张伟」不是同一个问题
+pub async fn decided_before(
+ pool: &PgPool,
+ kb_id: Uuid,
+ a: Uuid,
+ b: Uuid,
+) -> AppResult<Option<bool>> {
+ let merged: Option<bool> = sqlx::query_scalar(
+ "SELECT status = 'merged' FROM resolution_reviews
+ WHERE kb_id = $1 AND decided_by IS NOT NULL AND status IN ('merged', 'kept')
+ AND ((left_id = $2 AND right_id = $3) OR (left_id = $3 AND right_id = $2))
+ ORDER BY decided_at DESC LIMIT 1",
+ )
+ .bind(kb_id)
+ .bind(a)
+ .bind(b)
+ .fetch_optional(pool)
+ .await?;
+ Ok(merged)
+}
+
+/// 人已经定过的一对,照人的定:同一对实体裁过;或者名字不同的一对名字,人对这一对
+/// 名字的决定一致(「OpenAI OpCo ≟ OpenAI」合过就是合)。同名的一对不算——那只说明
+/// 库里有过重名,不说明眼前这两个是谁。有撤回的不走这条路
+pub fn settled_by_people(
+ left_name: &str,
+ right_name: &str,
+ p: &Precedents,
+ prior: Option<bool>,
+) -> Option<bool> {
+ if !p.reverts.is_empty() {
+ return None;
+ }
+ if let Some(m) = prior {
+ return Some(m);
+ }
+ if left_name.to_lowercase() == right_name.to_lowercase() {
+ return None;
+ }
+ let mut it = p.same_pair.iter();
+ let first = it.next()?.merged();
+ it.all(|x| x.merged() == first).then_some(first)
+}
+
/// 有一条开着的建议的对不进队列:agent 已经问过了,等人答
const OPEN_PROPOSAL: &str = "NOT EXISTS (SELECT 1 FROM agent_decisions d
WHERE d.target_kind = 'review' AND d.target_id = rr.id AND d.status = 'proposed')";
@@ -710,37 +768,96 @@ mod tests {
}
#[test]
- fn merging_needs_precedent() {
+ fn the_agent_judges_and_history_moves_the_bar() {
+ // 没有任何历史:agent 自己的把握够就合,不够就问
let none = Precedents::default();
- assert_eq!(gate(Some(true), 0.99, false, &none), Gate::Propose);
+ assert_eq!(gate(Some(true), 0.9, false, &none), Gate::Apply);
+ assert_eq!(gate(Some(true), 0.8, false, &none), Gate::Propose);
+ // 历史同意:线降到 SUPPORTED_CONF
let pair = Precedents {
same_pair: vec![p("review.merge")],
..Default::default()
};
- assert_eq!(gate(Some(true), 0.9, false, &pair), Gate::Apply);
+ assert_eq!(gate(Some(true), 0.8, false, &pair), Gate::Apply);
+ assert_eq!(gate(Some(true), 0.7, false, &pair), Gate::Propose);
let name = Precedents {
same_name: vec![p("merge.manual"), p("review.merge")],
..Default::default()
};
- assert_eq!(gate(Some(true), 0.9, false, &name), Gate::Apply);
+ assert_eq!(gate(Some(true), 0.8, false, &name), Gate::Apply);
+ // 同名的决定有合有分:不算同意,回到 agent 自己的线
let mixed = Precedents {
same_name: vec![p("review.merge"), p("review.keep")],
..Default::default()
};
- assert_eq!(gate(Some(true), 0.9, false, &mixed), Gate::Propose);
+ assert_eq!(gate(Some(true), 0.8, false, &mixed), Gate::Propose);
+ assert_eq!(gate(Some(true), 0.9, false, &mixed), Gate::Apply);
+ // 类型对的习惯
assert_eq!(
- gate(Some(true), 0.9, false, &with_stats(6, 2, 0)),
+ gate(Some(true), 0.8, false, &with_stats(6, 2, 0)),
Gate::Apply
);
assert_eq!(
- gate(Some(true), 0.9, false, &with_stats(3, 1, 0)),
+ gate(Some(true), 0.8, false, &with_stats(3, 1, 0)),
Gate::Propose,
"习惯要够 {TYPE_PAIR_MIN} 笔才算"
);
assert_eq!(
- gate(Some(true), 0.9, false, &with_stats(6, 2, 1)),
+ gate(Some(true), 0.8, false, &with_stats(6, 2, 1)),
Gate::Propose,
- "撤回过的类型对不算习惯"
+ "撤回过的类型对不算合并的习惯"
+ );
+ // 分开那一边同样:人一直分开的名字,分开的线也低
+ assert_eq!(gate(Some(false), 0.8, false, &none), Gate::Propose);
+ let kept = Precedents {
+ same_pair: vec![p("review.keep")],
+ ..Default::default()
+ };
+ assert_eq!(gate(Some(false), 0.8, false, &kept), Gate::Apply);
+ assert_eq!(
+ gate(Some(false), 0.8, false, &with_stats(1, 8, 0)),
+ Gate::Apply
+ );
+ }
+
+ #[test]
+ fn a_pair_people_decided_skips_the_agent() {
+ let none = Precedents::default();
+ assert_eq!(
+ settled_by_people("Apple", "Apple Inc.", &none, Some(true)),
+ Some(true)
+ );
+ assert_eq!(
+ settled_by_people("Zhang Wei", "Zhang Wei", &none, Some(false)),
+ Some(false)
+ );
+ assert_eq!(settled_by_people("Apple", "Apple Inc.", &none, None), None);
+ let merged = Precedents {
+ same_pair: vec![p("review.merge"), p("merge.manual")],
+ ..Default::default()
+ };
+ assert_eq!(
+ settled_by_people("Apple", "Apple Inc.", &merged, None),
+ Some(true)
+ );
+ assert_eq!(
+ settled_by_people("Zhang Wei", "Zhang Wei", &merged, None),
+ None,
+ "同名的一对:名字上的先例说不了眼前这两个是谁"
+ );
+ let mixed = Precedents {
+ same_pair: vec![p("review.merge"), p("review.keep")],
+ ..Default::default()
+ };
+ assert_eq!(settled_by_people("Apple", "Apple Inc.", &mixed, None), None);
+ let reverted = Precedents {
+ same_pair: vec![p("review.merge")],
+ reverts: vec![p("merge.revert")],
+ ..Default::default()
+ };
+ assert_eq!(
+ settled_by_people("Apple", "Apple Inc.", &reverted, Some(true)),
+ None
);
}
diff --git a/crates/utopia-store/tests/a_governor_reads_the_ledger.rs b/crates/utopia-store/tests/a_governor_reads_the_ledger.rs
index 4de9b784..9704817a 100644
--- a/crates/utopia-store/tests/a_governor_reads_the_ledger.rs
+++ b/crates/utopia-store/tests/a_governor_reads_the_ledger.rs
@@ -346,6 +346,21 @@ async fn run(pool: &PgPool, s: &Seed) -> anyhow::Result<()> {
// 人裁了张伟 1 对 2:同簇的张伟 2 对 3 的建议作废、回到队列;Apple 的不受影响
utopia_store::resolution::decide_review(pool, s.kb, s.zw12, "keep", s.user).await?;
+ // 同一对实体人裁过:不分左右;别的对没有
+ let zw = by_id(s.zw12);
+ assert_eq!(
+ governance::decided_before(pool, s.kb, zw.left.id, zw.right.id).await?,
+ Some(false)
+ );
+ assert_eq!(
+ governance::decided_before(pool, s.kb, zw.right.id, zw.left.id).await?,
+ Some(false)
+ );
+ let ap = by_id(s.apple);
+ assert_eq!(
+ governance::decided_before(pool, s.kb, ap.left.id, ap.right.id).await?,
+ None
+ );
assert_eq!(governance::supersede_siblings(pool, s.kb, s.zw12).await?, 1);
assert_eq!(
governance::get(pool, s.kb, d_zw23).await?.status,
diff --git a/docs/decisions/0025-governance-reads-the-ledger-before-it-decides.md b/docs/decisions/0025-governance-reads-the-ledger-before-it-decides.md
index e8362bee..d96f1298 100644
--- a/docs/decisions/0025-governance-reads-the-ledger-before-it-decides.md
+++ b/docs/decisions/0025-governance-reads-the-ledger-before-it-decides.md
@@ -1,6 +1,6 @@
# 0025 · Governance reads the ledger before it decides
-- **Status**: cut 1 implemented (#434) · migration 0035 adds `knowledge_bases.governance` and `agent_decisions`; `governance` in the store holds the precedent families, the first-in-first-out queue with its clusters, the gate and the table; the `govern` job in the server reads the switch, calls the model with precedents and applies or proposes; `?queue=agent`, `ReviewCounts.agent` and `POST /kbs/{id}/review/agent/{decision_id}` on the API · cut 3 (UI, #437) implemented: the switch in base settings, the Agent queue with its rows and answers, the proposal chip on a duplicate card whose Merge / Keep answers the proposal, the Agent section on the Overview · cut 2 implemented: migration 0036 adds `question`, `trace` and `calls` to `agent_decisions`; `governor` in the extract crate holds the tools, the opening and the step reader; `investigate` in the server job runs the loop for pairs the batch could not settle (decision 8) · cut 4 implemented: migration 0037 adds `knowledge_bases.governance_since`; `fuse` in the server job turns the switch off after two reverts of the agent's merges since it was turned on, within seven days, raises `governance.tripped` and writes the ledger (decision 9)
+- **Status**: decision 4 revised 2026-09-06 (the agent's own confidence decides, history moves the bar or blocks) · cut 1 implemented (#434) · migration 0035 adds `knowledge_bases.governance` and `agent_decisions`; `governance` in the store holds the precedent families, the first-in-first-out queue with its clusters, the gate and the table; the `govern` job in the server reads the switch, calls the model with precedents and applies or proposes; `?queue=agent`, `ReviewCounts.agent` and `POST /kbs/{id}/review/agent/{decision_id}` on the API · cut 3 (UI, #437) implemented: the switch in base settings, the Agent queue with its rows and answers, the proposal chip on a duplicate card whose Merge / Keep answers the proposal, the Agent section on the Overview · cut 2 implemented: migration 0036 adds `question`, `trace` and `calls` to `agent_decisions`; `governor` in the extract crate holds the tools, the opening and the step reader; `investigate` in the server job runs the loop for pairs the batch could not settle (decision 8) · cut 4 implemented: migration 0037 adds `knowledge_bases.governance_since`; `fuse` in the server job turns the switch off after two reverts of the agent's merges since it was turned on, within seven days, raises `governance.tripped` and writes the ledger (decision 9)
- **Written**: 2026-09-06 (conventions in the [README](README.md))
- **Related**: [0016](0016-close-the-open-seams-before-cutting-new-ones.md) C2 gave a base its first automation switch, `auto_type_resolution`, and this record copies its shape; #428 asked for bulk and automatic handling of same-name pairs and got the batch path (#429, #430) this builds on; [0020](0020-an-auditor-reads-it-without-us.md) made the ledger complete enough to be read back; [0015](0015-recording-a-sentence-is-not-asserting-a-fact.md) keeps a person's own sentences out of any machine's reach.
@@ -32,6 +32,8 @@ The queue is every pending pair without an open proposal, oldest first. The head
### 4. Merging needs precedent, keeping apart needs confidence, hard rules come first
+> **Revised 2026-09-06, after the first big-file run.** Eight interlocking Wikipedia articles (229 chunks) went into two fresh bases. With the switch off, the adjudicator merged 146 pairs on its own and left 50 for people; with the switch on, this rule let the agent merge nothing, because a fresh base has no precedent, and 200 pairs waited. That inverted the request: the agent was asked to decide with history as *reference*, and this rule had made history a *prerequisite*. The gate now reads: history that contradicts the verdict (a person kept this pair apart, merged it, or reverted a merge on either name) blocks; history that agrees (the same pair, the same name every time, or the type pair's habit) lowers the bar from 0.85 to 0.75; otherwise the agent's own confidence decides, for merging and keeping alike. Types that conflict still never merge. And a pair people already decided does not go to the model at all: the same two entities decided before, or a pair of *different* names people decided the same way every time (identical names carry no such claim; three "Zhang Wei"s are three questions) is applied as the people decided it. The text below is the original and stays as written.
+
The gate is a pure function of the verdict, its confidence, whether the two types conflict, and the precedents. In order: an `unsure` verdict is proposed; confidence below 0.85 is proposed; any reverted merge involving either name is proposed; a verdict that contradicts what a person decided on this same pair is proposed. A `different` verdict that survives those is applied. A `same` verdict is proposed when the types conflict, and otherwise applied only with support: this pair was merged before, this name was merged before and never kept apart, or this type pair has at least five human decisions, merges at least as many as keeps, and no reverts. A base with no human history therefore never merges on its own; it proposes, and the answers become the history.
Keeping apart is cheap: it changes no fact and a manual merge undoes it. Merging moves facts and a revert has to unwind them, so it is the side that needs a person to have gone first. The threshold sits above the adjudicator's 0.8 because the adjudicator judges one pair in isolation and the governor is standing in for a person.
diff --git a/docs/decisions/README.md b/docs/decisions/README.md
index fccbfc79..315bebba 100644
--- a/docs/decisions/README.md
+++ b/docs/decisions/README.md
@@ -48,7 +48,7 @@ The test for writing one: if someone (including us) looks at a piece of code in
| 0022 | [An unknown date is not an open one](0022-an-unknown-date-is-not-an-open-one.md) | Implemented in two cuts (#394 and the derived cut) · `world_axis` predicate beside `record_axis`, `facts.attested_at` anchors a missing start or an undated end at the document that attests it, every read and both client filters on the read interval, an undated ending closes the dated row it ends, derived rows intersect premise intervals as read and carry no precision on an anchored bound · two anchors (`attested_from` / `attested_to`), so a bare open row closes too (#393) |
| 0023 | [RSS observations are not documents](0023-rss-observations-are-not-documents.md) | Implemented in #326 |
| 0024 | [The world axis reaches the second](0024-the-world-axis-reaches-the-second.md) | Implemented · the precision ladder runs year → second (not below: no source states less), a stored value is truncated to its precision by CHECK on all three tables, a clock time without a zone is a date, one list spells the ladder in the extractor, the renderers, the export and the evaluator; a derived bound takes the precision of the premise that set it |
-| 0025 | [Governance reads the ledger before it decides](0025-governance-reads-the-ledger-before-it-decides.md) | Cut 1 implemented · a per-base `governance` switch, a `govern` job that works the duplicates queue first in, first out with each head's cluster, precedents pulled from the ledger into the prompt, a gate that merges only with precedent, every look a row in `agent_decisions`, answers through the person's own decide path · the switch, the Agent queue, the proposal chip and the Overview section in the UI · a pair the batch cannot settle is looked at again with tools and then decided or asked about, within a daily budget · two reverts in a week turn the switch off and raise an alert |
+| 0025 | [Governance reads the ledger before it decides](0025-governance-reads-the-ledger-before-it-decides.md) | Cut 1 implemented · a per-base `governance` switch, a `govern` job that works the duplicates queue first in, first out with each head's cluster, precedents pulled from the ledger into the prompt, a gate where the agent's own confidence decides and history lowers the bar or blocks (revised after the first big-file run), every look a row in `agent_decisions`, answers through the person's own decide path · the switch, the Agent queue, the proposal chip and the Overview section in the UI · a pair the batch cannot settle is looked at again with tools and then decided or asked about, within a daily budget · two reverts in a week turn the switch off and raise an alert |
## Not a decision record