@@ -1058,6 +1058,11 @@ window.__ModuleLoader__.load({
10581058 "memory.features.bm25SearchEnabled.hint": "关键词一路的词法检索,与语义互补。",
10591059 "memory.features.conflictFreezeEnabled": "矛盾冻结",
10601060 "memory.features.conflictFreezeEnabled.hint": "整理发现矛盾先冻结待确认,不自动裁决。",
1061+ "memory.features.conflictLedgerMode": "矛盾处理档位",
1062+ "memory.features.conflictLedgerMode.hint": "off:矛盾走人审队列(现状)。shadow:分诊只记账零处置,先跑一周看分布。enforce:确定性处置(近重复自动归档、演进落取代链、矛盾注入标注),人审与 LLM 裁决退出。与「矛盾冻结」互斥,同开时冻结让位。",
1063+ "memory.features.conflictLedgerMode.off": "off(人审队列)",
1064+ "memory.features.conflictLedgerMode.shadow": "shadow(只记账)",
1065+ "memory.features.conflictLedgerMode.enforce": "enforce(确定性处置)",
10611066 "memory.features.scopeEnabled": "来源标注",
10621067 "memory.features.scopeEnabled.hint": "每条记忆标上来自哪个 Agent / 工作区。",
10631068 "memory.features.strictScope": "严格隔离",
@@ -1276,6 +1281,15 @@ window.__ModuleLoader__.load({
12761281 "memory.status.conflictQueue.markReviewed": "仅标记已处理",
12771282 "memory.status.conflictQueue.applyHint": "确认后:保留方正文追加已否决注记,另一方归档。",
12781283 "memory.status.conflictQueue.missing": "(该记忆已不存在)",
1284+ "memory.status.ledger.title": "矛盾账本(分诊 · 只读)",
1285+ "memory.status.ledger.dist": "分诊分布:",
1286+ "memory.status.ledger.total": "累计",
1287+ "memory.status.ledger.status": "状态",
1288+ "memory.status.ledger.loadError": "账本加载失败",
1289+ "memory.status.ledger.tier.dup": "近重复",
1290+ "memory.status.ledger.tier.cross-scope-dup": "跨作用域",
1291+ "memory.status.ledger.tier.evolution": "时序演进",
1292+ "memory.status.ledger.tier.conflict": "真矛盾",
12791293 "memory.status.conflictQueue.goto": "查看待确认冲突队列",
12801294 "memory.status.conflictQueue.resolved": "已裁决:保留{name}",
12811295 "memory.status.conflictQueue.refresh": "刷新队列",
@@ -2166,6 +2180,11 @@ window.__ModuleLoader__.load({
21662180 "memory.features.bm25SearchEnabled.hint": "Lexical keyword retrieval alongside semantics.",
21672181 "memory.features.conflictFreezeEnabled": "Conflict freeze",
21682182 "memory.features.conflictFreezeEnabled.hint": "Freezes contradictions for review instead of auto-deciding.",
2183+ "memory.features.conflictLedgerMode": "Conflict handling mode",
2184+ "memory.features.conflictLedgerMode.hint": "off: conflicts go to the human review queue (status quo). shadow: triage only records — zero disposition; run a week and inspect the distribution first. enforce: deterministic resolution (near-dups auto-archived, evolution chained, conflict pairs annotated); human review and LLM adjudication step out. Mutually exclusive with conflict freeze — freeze yields when both are on.",
2185+ "memory.features.conflictLedgerMode.off": "off (review queue)",
2186+ "memory.features.conflictLedgerMode.shadow": "shadow (record only)",
2187+ "memory.features.conflictLedgerMode.enforce": "enforce (deterministic)",
21692188 "memory.features.scopeEnabled": "Scope tagging",
21702189 "memory.features.scopeEnabled.hint": "Tags each memory with its agent/workspace origin.",
21712190 "memory.features.strictScope": "Strict isolation",
@@ -2384,6 +2403,15 @@ window.__ModuleLoader__.load({
23842403 "memory.status.conflictQueue.markReviewed": "Mark reviewed only",
23852404 "memory.status.conflictQueue.applyHint": "On confirm: a veto note is appended to the kept side and the other side is archived.",
23862405 "memory.status.conflictQueue.missing": "(memory no longer exists)",
2406+ "memory.status.ledger.title": "Conflict ledger (triage · read-only)",
2407+ "memory.status.ledger.dist": "Triage distribution:",
2408+ "memory.status.ledger.total": "total",
2409+ "memory.status.ledger.status": "status",
2410+ "memory.status.ledger.loadError": "Ledger failed to load",
2411+ "memory.status.ledger.tier.dup": "Near-dup",
2412+ "memory.status.ledger.tier.cross-scope-dup": "Cross-scope",
2413+ "memory.status.ledger.tier.evolution": "Evolution",
2414+ "memory.status.ledger.tier.conflict": "Conflict",
23872415 "memory.status.conflictQueue.goto": "View pending conflict queue",
23882416 "memory.status.conflictQueue.resolved": "Resolved: kept {name}",
23892417 "memory.status.conflictQueue.refresh": "Refresh queue",
@@ -5236,7 +5264,26 @@ window.__ModuleLoader__.load({
52365264 h(Icon, { name: showAdv ? "chevronDown" : "chevronRight", size: 12 }),
52375265 t("memory.features.advancedToggle"))
52385266 ),
5239- showAdv && FEATURE_ADVANCED_BOOLS.map((k) => boolRow(k))
5267+ showAdv && h(react.Fragment, null,
5268+ FEATURE_ADVANCED_BOOLS.map((k) => boolRow(k)),
5269+ // conflictLedgerMode(#641):三档枚举,紧挨 conflictFreezeEnabled
5270+ // 摆——两者语义关联(enforce 与 freeze 互斥,同开时冻结让位),
5271+ // 隔开摆放会让人以为各自独立。枚举键没有通用渲染器,手写下拉
5272+ // (choroSub 同款)。
5273+ h("div", { className: "mneme-featsub" },
5274+ h("div", { className: "mneme-featnum" },
5275+ h("span", { className: "mneme-featnumlabel" }, t("memory.features.conflictLedgerMode")),
5276+ h("select", {
5277+ className: "mneme-select",
5278+ value: eff.conflictLedgerMode || "off",
5279+ disabled: busy,
5280+ onChange: (e) => put({ conflictLedgerMode: e.target.value })
5281+ },
5282+ ["off", "shadow", "enforce"].map((v) => h("option", { key: v, value: v }, t(`memory.features.conflictLedgerMode.${v}`))))
5283+ ),
5284+ h("div", { className: "mneme-featsubhint" }, t("memory.features.conflictLedgerMode.hint"))
5285+ )
5286+ )
52405287 )
52415288 );
52425289 })()
@@ -7676,6 +7723,44 @@ window.__ModuleLoader__.load({
76767723 }));
76777724 }
76787725
7726+ // --- 矛盾分诊账本(#641,状态页只读卡)----------------------------------
7727+ // 与上面的冲突队列互补:队列是「等人来」的待办(freeze 模式),账本是
7728+ // 「机器观察/处置过什么」的只读面(shadow 记账、enforce 处置)。行不是
7729+ // 待办——处置由 enforce 档自动完成,这里只回答「账本里有什么、分布如何」。
7730+ // 空账本整块不渲染(与冲突队列同款:不打扰无矛盾实例)。
7731+ function ConflictLedger({ t }) {
7732+ const [data, setData] = useState(null);
7733+ const [loadError, setLoadError] = useState(false);
7734+ const load = () => {
7735+ apiFetch("/api/dsh-mneme/conflicts/ledger?limit=50")
7736+ .then((res) => { if (!res.ok) throw new Error("http"); return res.json(); })
7737+ .then((d) => { setData(d); setLoadError(false); })
7738+ .catch(() => { setData(null); setLoadError(true); });
7739+ };
7740+ useEffect(() => { load(); }, []);
7741+ if (loadError) {
7742+ return h("div", { className: "mneme-statuscard mneme-set-hint" }, t("memory.status.ledger.loadError"));
7743+ }
7744+ if (!data) return null;
7745+ const counts = data.counts || {};
7746+ const total = typeof data.total === "number" ? data.total : 0;
7747+ if (total === 0) return null;
7748+ const tierKey = (v) => "memory.status.ledger.tier." + v;
7749+ const tiers = [["dup"], ["cross-scope-dup"], ["evolution"], ["conflict"]];
7750+ const rows = (data.items || []).slice(0, 8);
7751+ return h("div", { className: "mneme-statuscard" },
7752+ h("div", { className: "mneme-set-h3" }, t("memory.status.ledger.title")),
7753+ h("div", { className: "mneme-set-hint" },
7754+ t("memory.status.ledger.dist")
7755+ + " " + tiers.map(([k]) => `${t(tierKey(k))} ${counts[k] ?? 0}`).join(" · ")
7756+ + " · " + t("memory.status.ledger.total") + " " + total),
7757+ h("div", { className: "mneme-conflictq" },
7758+ rows.map((r) => h("div", { key: r.memory_a + "|" + r.memory_b, className: "mneme-conflict-item" },
7759+ h("div", { className: "mneme-conflict-reason" },
7760+ `${t(tierKey(r.tier))} · ${t("memory.status.ledger.status")}: ${r.status} · ${String(r.first_seen_at || "").slice(0, 10)}`))))
7761+ );
7762+ }
7763+
76797764 // --- 状态页工作台:让用户切实看见插件在干活 ---
76807765 // 活动流合并 llm_audit 里 autoDream/autoSummarize 的后台调用(状态、
76817766 // token、沉淀条数);沉淀记忆列表用 audit 行携带的 related_memory_ids
@@ -8099,6 +8184,7 @@ window.__ModuleLoader__.load({
80998184 h("div", { className: "mneme-statushead" }, t("memory.status.sec.maintenance")),
81008185 h("div", { className: "mneme-statusgrid" }, h(MaintenanceCard, { t })),
81018186 h("div", { ref: queueRef }, h(ConflictsQueue, { t })),
8187+ h(ConflictLedger, { t }),
81028188 h(WorkbenchSection, { t, onBrowse })
81038189 );
81048190 }
0 commit comments