Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
P8: withdrawal review on by default after its held-out pass; ship the held-out reference calibration
garrytan6f9d87a2f58e
diff --git a/docs/architecture/key-files/core-services-2.md b/docs/architecture/key-files/core-services-2.mdindex 098ec4920f..ad951d3c68 100644--- a/docs/architecture/key-files/core-services-2.md+++ b/docs/architecture/key-files/core-services-2.md@@ -15,7 +15,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/core/facts/queue.ts:FactsQueue.drainPending` — method `drainPending({timeout?: number}): Promise<{drained, unfinished}>`. Semantically distinct from `shutdown()` (which calls `this.internalAbort.abort()` and would abort the very facts:absorb worker trying to log its post-completion event). Drain lets in-flight finish; only the wait is bounded. Default timeout `1000ms` so commands that don't enqueue facts pay one fast 0ms check before exit. `src/cli.ts` op-dispatch finally block awaits `getFactsQueue().drainPending({timeout: 1000})` BEFORE `engine.disconnect()`. Lazy-import keeps the facts-queue module off the hot path for ops that never touch it. Prevents a trailing `'No database connection'` line after `gbrain capture` (a post-page-write facts:absorb outliving the CLI process). Pinned by `test/facts-queue-drain-pending.test.ts` (4 cases: empty fast-path, in-flight settled without abort, unfinished count on timeout, default timeout = 1000ms).-- `src/core/facts/withdrawal.ts` + `withdrawal-schema.ts` + `withdrawal-discovery.ts` — durable withdrawal key is `(source_id, visibility, subject, SHA256(normalized claim))`. `subject` is the forgotten row's `entity_slug`; '*' (all subjects) covers subjectless facts and rows recorded before v169. A withdrawal matches when `subject = '*' OR subject = entity_slug`, so forgetting one entity's claim never touches the same claim about another entity. Fence rows belong to their page's entity: the import overlay, prepared-import check (`preserveWithdrawnFenceRows` / `assertPreparedFactWithdrawals`), snapshot overlay and Markdown export match on the page slug. `updateSlug` (both engines, via `moveSlugBindings`) and the phantom-redirect merge move subjects to the new slug (`MOVE_WITHDRAWAL_SUBJECT_SQL`), so rename and index recreation do not restore a claim. Normalization (`gbrain_fact_normalize`, mirrored in JS by `normalizeLoweredClaim`) folds case, whitespace and an explicit punctuation set, not meaning (migration v174); `+`, `#` and in-word dots are kept ("C++" ≠ "C"); pre-v174 ledger rows keep their exact `gbrain_fact_fingerprint_v1` hash and every ledger match checks both. v174 adds a folded row wherever a fact row still holds the claim text, expires facts that became matching, and builds `idx_facts_withdrawal_fingerprint` (the fingerprint inlines normalization: index builds use a restricted search_path). Discovery (`withdrawal-discovery.ts`) is keyed on claim, subject and fingerprint: SQL shortlists pages and chunks whose lowercased text contains every normalized token of the claim (necessary for any match; nothing is normalized in SQL), streams them by keyset, then verifies exactly; a subject-scoped claim reads only its entity's page plus provenance of that entity's facts. There is no source-inventory limit (#5674): refusals come from the matched set (>256 pages, reported with the count and sample slugs), the 10s scan budget, per-batch input limits or matching malformed evidence. Only an existing withdrawal covering the same subject skips discovery. Only affected page revisions/chunks are invalidated. The source row lock serializes withdrawal with the facts trigger; the trigger prevents insert/update from reactivating a matching claim. Import and snapshot overlays cover every complete legacy fence, including inactive rows; withdrawal markers precede preserved context and retain earlier expiry dates before hashing/chunking; malformed fences retain their existing diagnostics and the DB trigger still protects derived facts. `writeSingleFact` refuses an identical withdrawn claim for the resolved entity before embedding, using the protocol error envelope. `writeFactsToFence` rechecks each input under the page lock and drops claims withdrawn for the page's entity (reporting `withdrawnSkipped`), and the backstop skips them in phase 1, so a withdrawn claim is never appended to Markdown as an active row (audit B-10). TTL/supersession expiry creates no withdrawal; backfill trusts only explicit `forgotten:` markers; Markdown-only copies do not preserve DB-only withdrawals. Pinned by `test/facts-withdrawal-subject.test.ts`, `test/fact-withdrawal-normalized.test.ts`, `test/withdrawal-bounded-safety.test.ts` (both engines) and the Postgres scale gate `test/e2e/fact-withdrawal-scope-postgres.test.ts`. `recordFactWithdrawal(…, { semanticReview })` also queues a `withdraw` review row in `decide_review_queue` inside the same transaction when `decide.slots.conflict.review_withdraw` is on and the caller did not opt out, and runs every `registerWithdrawalInvalidation` hook in that transaction for projections beyond pages and chunks. `src/core/facts/similar-active.ts` — `similarActiveAfterForget`: after a committed `forget`, up to five active facts with the same source, entity and visibility (world only for remote callers) at cosine >= 0.80 to the withdrawn fact's stored embedding, returned as ids and scores with the overnight review state and a `next` line (zero model calls; pinned by `test/decide/review-withdraw.serial.test.ts`).+- `src/core/facts/withdrawal.ts` + `withdrawal-schema.ts` + `withdrawal-discovery.ts` — durable withdrawal key is `(source_id, visibility, subject, SHA256(normalized claim))`. `subject` is the forgotten row's `entity_slug`; '*' (all subjects) covers subjectless facts and rows recorded before v169. A withdrawal matches when `subject = '*' OR subject = entity_slug`, so forgetting one entity's claim never touches the same claim about another entity. Fence rows belong to their page's entity: the import overlay, prepared-import check (`preserveWithdrawnFenceRows` / `assertPreparedFactWithdrawals`), snapshot overlay and Markdown export match on the page slug. `updateSlug` (both engines, via `moveSlugBindings`) and the phantom-redirect merge move subjects to the new slug (`MOVE_WITHDRAWAL_SUBJECT_SQL`), so rename and index recreation do not restore a claim. Normalization (`gbrain_fact_normalize`, mirrored in JS by `normalizeLoweredClaim`) folds case, whitespace and an explicit punctuation set, not meaning (migration v174); `+`, `#` and in-word dots are kept ("C++" ≠ "C"); pre-v174 ledger rows keep their exact `gbrain_fact_fingerprint_v1` hash and every ledger match checks both. v174 adds a folded row wherever a fact row still holds the claim text, expires facts that became matching, and builds `idx_facts_withdrawal_fingerprint` (the fingerprint inlines normalization: index builds use a restricted search_path). Discovery (`withdrawal-discovery.ts`) is keyed on claim, subject and fingerprint: SQL shortlists pages and chunks whose lowercased text contains every normalized token of the claim (necessary for any match; nothing is normalized in SQL), streams them by keyset, then verifies exactly; a subject-scoped claim reads only its entity's page plus provenance of that entity's facts. There is no source-inventory limit (#5674): refusals come from the matched set (>256 pages, reported with the count and sample slugs), the 10s scan budget, per-batch input limits or matching malformed evidence. Only an existing withdrawal covering the same subject skips discovery. Only affected page revisions/chunks are invalidated. The source row lock serializes withdrawal with the facts trigger; the trigger prevents insert/update from reactivating a matching claim. Import and snapshot overlays cover every complete legacy fence, including inactive rows; withdrawal markers precede preserved context and retain earlier expiry dates before hashing/chunking; malformed fences retain their existing diagnostics and the DB trigger still protects derived facts. `writeSingleFact` refuses an identical withdrawn claim for the resolved entity before embedding, using the protocol error envelope. `writeFactsToFence` rechecks each input under the page lock and drops claims withdrawn for the page's entity (reporting `withdrawnSkipped`), and the backstop skips them in phase 1, so a withdrawn claim is never appended to Markdown as an active row (audit B-10). TTL/supersession expiry creates no withdrawal; backfill trusts only explicit `forgotten:` markers; Markdown-only copies do not preserve DB-only withdrawals. Pinned by `test/facts-withdrawal-subject.test.ts`, `test/fact-withdrawal-normalized.test.ts`, `test/withdrawal-bounded-safety.test.ts` (both engines) and the Postgres scale gate `test/e2e/fact-withdrawal-scope-postgres.test.ts`. `recordFactWithdrawal(…, { semanticReview })` also queues a `withdraw` review row in `decide_review_queue` inside the same transaction when `decide.slots.conflict.review_withdraw` is on (unset counts as on; `reviewWithdrawOn`) and the caller did not opt out, and runs every `registerWithdrawalInvalidation` hook in that transaction for projections beyond pages and chunks. `src/core/facts/similar-active.ts` — `similarActiveAfterForget`: after a committed `forget`, up to five active facts with the same source, entity and visibility (world only for remote callers) at cosine >= 0.80 to the withdrawn fact's stored embedding, returned as ids and scores with the overnight review state and a `next` line (zero model calls; pinned by `test/decide/review-withdraw.serial.test.ts`).- `src/core/facts/write-single.ts` — `writeSingleFact(fact, ctx)`: the zero-LLM single-fact seam behind `remember`. `runFactsPipeline` is extraction-first (LLM-gated) and cannot back a pre-formed fact; this reuses the pipeline's post-extraction stages directly: resolve → embedding-cosine dedup (same 0.95 threshold) → fence-first write with the same legacy DB-only fallbacks (thin-client, unparented, stub-guard). Supersession: deterministic rule — same entity_slug + same kind + similarity ≥ threshold + DIFFERENT text ⇒ the new fact supersedes (fence path: append new + `forgetFactInFence(old, { supersededBy })`, which strikes the old row with a page-local `#N` supersession reference and records no withdrawal, + superseded_by link; DB path: engine insertFact supersedeId). Pinned by `test/facts-supersede-not-withdrawal.test.ts`. Provenance lands on NewFact.source verbatim (no FactsBackstopCtx). No embedding provider ⇒ `degraded_dedup: true` (near-duplicates may insert — documented). `isNullLikeEntity(entity)` (exported) normalizes null-like entity tokens (`"null"`, `"undefined"`, `"none"`, `"n/a"`, `"nil"`, `"-"`, empty/whitespace) to ABSENT before resolution — applied here rather than only at the verb boundary so EVERY writeSingleFact caller gets the guard and the `resolved?.slug ?? entityRef` fallback can never adopt `"null"` as a slug. On a managed brain, after the withdrawal check and embedding, the fact publishes through `publishManagedEntityFacts` (`src/core/facts/managed-fact-write.ts`, the `managed_facts_entity` intent: fence row, index row and file together, dedup at publication, and the same-kind near-duplicate supersession rule via the intent's `supersede` flag, which strikes the old fence row and expires and links the old fact in the same transaction; an explicit per-fact context is kept; an entity without a live page lands database-only on `memory/unattributed` and, through the intent's opt-in `attribute_fallback` flag, which only writeSingleFact sets, keeps the resolver's fallback slug as `entity_slug` with no row number, so dedup and withdrawal checks stay per entity; the facts backstop never sets it and keeps those rows unattributed). `writeFactsToFence` (`fence-write.ts`) takes the same path on a managed brain, after dropping withdrawn claims.- `src/core/facts/managed-fact-write.ts` — `publishManagedEntityFacts(engine, sourceId, entity, facts)` builds one managed facts session per visibility (request identity derived from the write, so a retried job replays its receipt; `attributeFallback` sets the intent's `attribute_fallback`), keeps a caller's vector only when it matches the brain's facts embedding signature, and returns ids in input order; `managedFactWritePreflight` runs the same session checks before a caller's model call.diff --git a/docs/eval/decisions/p8/SEALED_VERDICTS.md b/docs/eval/decisions/p8/SEALED_VERDICTS.mdindex 6460af9852..cae549abf9 100644--- a/docs/eval/decisions/p8/SEALED_VERDICTS.md+++ b/docs/eval/decisions/p8/SEALED_VERDICTS.md@@ -7,7 +7,7 @@ Each part's held-out result, measured by the custodian (P0) against the gates in|---|---|---|---|---|| Write cost (section 2) | commit-path generative attempts = 0 in both arms | 0 in the extraction-on and extraction-off arms | PASS | Guard on; cost published || Quote grounding (section 6) | supported spans wrongly flagged, Wilson 95% upper bound ≤ 5% | 4.7% wrongly flagged, upper bound 7.6% | FAIL | `think.quote_verify` and `dream.quote_verify` off by default (opt-in) |-| Semantic withdrawal review (section 3) | precision LB ≥ 0.90, end-to-end recall ≥ 0.60, zero proposals on corrected values, N5 unchanged | pending (paraphrase sourcing amended 2026-10-05) | — | `review_withdraw` off |+| Semantic withdrawal review (section 3) | precision LB ≥ 0.90, end-to-end recall ≥ 0.60, zero proposals on corrected values, N5 unchanged | precision LB 0.970 (124/124 eval families, 248 actions), end-to-end recall 0.977, 0 proposals on corrected values, N5 contracts pass | PASS | `review_withdraw` on (proposes where the conflict slot is on with a TypeSafe key); reference calibration shipped || Advertised tool surface (section 7) | pooled success ≥ control − 3 pts, no leak rise, hidden-tool family ≥ control − 5 pts | pending | — | new installs advertise `full` || HTTP graph freshness (report-only) | remote `put_page`: timeline row at commit; mention links after the `links` effect; typed edges only after extract | as stated, on PGLite (`test/remote-graph-freshness.test.ts`) | REPORT | no switch || Duplicate review kinds (section 4) | per kind, as section 3 | not run until P1/P5 enqueue candidates | — | off |@@ -48,3 +48,17 @@ no brain or source row lock (the `remember.replaces` target-fact lock lives insithe review queue row commits inside the withdrawal transaction, and attribution is async context only), so thereis no inverted order. The P8 Postgres E2E and #6025's links-effect E2E pass together on direct Postgres and throughtransaction-mode PgBouncer.++## Semantic withdrawal review++Held-out record: gbrain-evals `docs/benchmarks/2026-10-05-heldout-verdicts/p8-withdraw-heldout-2026-10-05.json`+(build 6c958d6e2, reviewer TypeSafe `jev-1.13.0`). 240 families with disjoint name and value pools: 66 paraphrase+pairs written by Google Gemini and checked one by one by the custodian (7 rewritten, 0 dropped; the 2026-10-05+amendment), 414 model restatements, and 240 each of corrected values, negations, past-tense versions, compound+claims and independent facts. Calibrated on the 116-family half (threshold 0.62, precision and recall 1.0);+qualified on the 124-family half: 124/124 families correct over 248 withdraw actions (Wilson lower bound 0.970).+Retrieval at the 0.80 cosine floor finds 97.7% of restatements (model 404/414, custodian-checked 65/66).++Default: `decide.slots.conflict.review_withdraw` is on unless turned off, and the binary ships the held-out+calibration as reference `conflict-review-withdraw-jev-1.13.0-2026-10-05`, so the lane proposes wherever the+conflict slot is on with a TypeSafe key. It never withdraws on its own: every proposal needs the owner's accept.diff --git a/docs/guides/system-one.md b/docs/guides/system-one.mdindex 4099fe2aac..0d87e63b49 100644--- a/docs/guides/system-one.md+++ b/docs/guides/system-one.md@@ -283,16 +283,22 @@ site, calibration and qualification:| `duplicate_page` | `decide.slots.conflict.review_duplicate_page` | page pairs the page-duplicate detector queued | runs the registered merge or link action, or records your verdict || `duplicate_entity` | `decide.slots.conflict.review_duplicate_entity` | entity pairs deterministic entity dedup left ambiguous | same as `duplicate_page` |-Each switch is off by default. A kind proposes only when its calibration for-call site `review_<kind>` is qualified for action precision+`withdraw` is on by default: its held-out qualification passed (action+precision lower bound 0.970, end-to-end recall 0.977), and the binary ships+that reference calibration for TypeSafe `jev-1.13.0`, so it proposes wherever+the contradiction slot is on with a TypeSafe key. Turn it off with+`gbrain config set decide.slots.conflict.review_withdraw false`. The duplicate+kinds are off by default. A kind proposes only when its calibration for call+site `review_<kind>` is qualified for action precision(`decide.slots.conflict.min_action_precision`, default 0.90); until then itdoes not call the provider at all. An operator `decide.slots.conflict.threshold`-override does not count as a qualification for review kinds.+override does not count as a qualification for review kinds. To qualify a kind+on your own data:```bash-gbrain decide calibrate --slot conflict --call-site review_withdraw --dataset withdraw.jsonl-gbrain decide qualify --slot conflict --call-site review_withdraw --dataset withdraw.jsonl-gbrain config set decide.slots.conflict.review_withdraw true+gbrain decide calibrate --slot conflict --call-site review_duplicate_page --dataset pairs.jsonl+gbrain decide qualify --slot conflict --call-site review_duplicate_page --dataset pairs.jsonl+gbrain config set decide.slots.conflict.review_duplicate_page true```Work is queued in the same transaction as the event that creates it: adiff --git a/src/core/ai/decide/reference-calibrations.ts b/src/core/ai/decide/reference-calibrations.tsindex 1327b3d5b9..c953a74b10 100644--- a/src/core/ai/decide/reference-calibrations.ts+++ b/src/core/ai/decide/reference-calibrations.ts@@ -59,6 +59,17 @@ export const REFERENCE_CALIBRATIONS: readonly ReferenceCalibration[] = [pack_shape: 'v1:order=rank-id:max=budget:slots=conflict', dataset_hash: '37fe4083e9722308', split_hash: '2ec631956c4b9e33', proposal_floor: 0.65,verdict: 'win', shipped_in: '0.60.17.0',},+ {+ // P8 withdrawal review (conflict slot, review_withdraw call site): held-out qualification by the custodian,+ // gbrain-evals docs/benchmarks/2026-10-05-heldout-verdicts/p8-withdraw-heldout-2026-10-05.json. 240 families+ // (66 custodian-checked model-written paraphrase pairs per the 2026-10-05 amendment); threshold calibrated on the+ // 116-family calibrate half (precision and recall 1.0); 124/124 eval families correct over 248 withdraw actions.+ // The record reports no retest/repack spread (dev seed A measured 0.000) and no dataset hashes: the ids name it.+ id: 'conflict-review-withdraw-jev-1.13.0-2026-10-05', slot: 'conflict', call_site: 'review_withdraw', provider: 'typesafe:jev-1.13.0', model_resolved: 'jev-1.13.0',+ threshold: 0.62, min_keep: null, retest_sd: 0, repack_sd: 0, action_precision_lb: 0.970, policy_fingerprint: null,+ pack_shape: 'v1:order=rank-id:max=budget:slots=conflict', dataset_hash: 'heldout:p8-withdraw-2026-10-05', split_hash: 'heldout:p8-withdraw-2026-10-05',+ verdict: 'win', shipped_in: 'P8',+ },];/**diff --git a/src/core/ai/decide/review-lane.ts b/src/core/ai/decide/review-lane.tsindex 3ca2f4104f..157a3fdeee 100644--- a/src/core/ai/decide/review-lane.ts+++ b/src/core/ai/decide/review-lane.ts@@ -28,6 +28,7 @@ import { hasTypesafeKey, runDecide } from './index.ts';import { packShape } from './pack.ts';import { resolveSlotPolicy, type SlotPolicy } from './policy.ts';import { writeReceipts } from './receipts.ts';+import { reviewWithdrawOn } from '../../facts/withdrawal.ts';import { flushDecideWrites, hmacRef, listCalibrations, receiptSalt, recentResolvedModels } from './store.ts';import { DecideError, type ChoiceAnswer, type DecideQuestion, type EvidenceItem } from './types.ts';@@ -74,8 +75,10 @@ export interface ReviewLaneResult {const truthy = (v: string | undefined | null) => ['true', 'on', '1', 'yes'].includes((v ?? '').trim().toLowerCase());+/** `withdraw` is on unless turned off (held-out qualification passed); the duplicate kinds stay opt-in. */export function reviewKindEnabled(snapshot: Record<string, string | undefined> | null, kind: ReviewKind): boolean {- return truthy(snapshot?.[REVIEW_CONFIG_KEYS[kind]]);+ const raw = snapshot?.[REVIEW_CONFIG_KEYS[kind]];+ return kind === 'withdraw' ? reviewWithdrawOn(raw) : truthy(raw);}// ---------------------------------------------------------------------------diff --git a/src/core/facts/similar-active.ts b/src/core/facts/similar-active.tsindex 982c188171..30c4cb6ef7 100644--- a/src/core/facts/similar-active.ts+++ b/src/core/facts/similar-active.ts@@ -10,7 +10,7 @@ import { loadConfigSnapshot } from '../config-snapshot.ts';import { readDecideConfig, providerKind } from '../ai/decide/config.ts';import { hasTypesafeKey } from '../ai/decide/index.ts';import { CONFLICT_MIN_COSINE } from '../ai/decide/conflict.ts';-import { REVIEW_WITHDRAW_KEY } from './withdrawal.ts';+import { REVIEW_WITHDRAW_KEY, reviewWithdrawOn } from './withdrawal.ts';export const SIMILAR_ACTIVE_LIMIT = 5;@@ -26,7 +26,7 @@ export interface SimilarActive {async function reviewState(engine: BrainEngine, optedOut: boolean): Promise<SemanticReviewState> {if (optedOut) return 'opted_out';const snapshot = await loadConfigSnapshot(engine);- if (!['true', 'on', '1', 'yes'].includes((snapshot?.[REVIEW_WITHDRAW_KEY] ?? '').trim().toLowerCase())) return 'off';+ if (!reviewWithdrawOn(snapshot?.[REVIEW_WITHDRAW_KEY])) return 'off';const cfg = readDecideConfig(snapshot, { typesafeKey: hasTypesafeKey() });if (cfg.slots.conflict.mode === 'off') return 'off';const kind = providerKind(cfg.slots.conflict.provider);diff --git a/src/core/facts/withdrawal.ts b/src/core/facts/withdrawal.tsindex 698603f50f..3976e66947 100644--- a/src/core/facts/withdrawal.ts+++ b/src/core/facts/withdrawal.ts@@ -24,6 +24,16 @@ export function registerWithdrawalInvalidation(fn: WithdrawalInvalidation): void/** The DB-plane switch for overnight semantic withdrawal review (decide review lane). */export const REVIEW_WITHDRAW_KEY = 'decide.slots.conflict.review_withdraw';+/**+ * `decide.slots.conflict.review_withdraw`: on unless explicitly turned off. The+ * held-out qualification passed (docs/eval/decisions/p8/SEALED_VERDICTS.md); the+ * lane still proposes only where the conflict slot is on with a decision provider.+ */+export function reviewWithdrawOn(raw: string | null | undefined): boolean {+ const v = (raw ?? '').trim().toLowerCase();+ return v === '' || ['true', 'on', '1', 'yes'].includes(v);+}+export async function recordFactWithdrawal(engine: BrainEngine, id: number, sourceId: string, worldOnly = false,opts: { requestId?: string; semanticReview?: boolean } = {},@@ -61,7 +71,7 @@ export async function recordFactWithdrawal(if (!inserted.length) return { withdrawn: false, pages: [] };// Overnight semantic review (decide review lane): queued with the ledger row so a late commit is never skipped.// Not queued when the caller opted out (`semantic_review: false`, also used by review-accepted withdrawals).- if (opts.semanticReview !== false && ['true', 'on', '1', 'yes'].includes(((await tx.getConfig(REVIEW_WITHDRAW_KEY)) ?? '').trim().toLowerCase())) {+ if (opts.semanticReview !== false && reviewWithdrawOn(await tx.getConfig(REVIEW_WITHDRAW_KEY))) {await tx.executeRaw(`INSERT INTO decide_review_queue(kind,source_id,a_ref) VALUES ('withdraw',$1,$2) ON CONFLICT DO NOTHING`, [sourceId, String(id)]);}// Logical revision and projection invalidation commit with the withdrawal.diff --git a/test/decide/reference-calibrations.test.ts b/test/decide/reference-calibrations.test.tsindex 686ed8128c..7940aeea54 100644--- a/test/decide/reference-calibrations.test.ts+++ b/test/decide/reference-calibrations.test.ts@@ -10,6 +10,7 @@ import { REFERENCE_CALIBRATIONS } from '../../src/core/ai/decide/reference-calibimport { readDecideConfig } from '../../src/core/ai/decide/config.ts';import { packShape } from '../../src/core/ai/decide/pack.ts';import { resolveSlotPolicy } from '../../src/core/ai/decide/policy.ts';+import { reviewGate } from '../../src/core/ai/decide/review-lane.ts';import { SLOT_SPECS } from '../../src/core/ai/decide/slots.ts';import { cycleSlotPackShape } from '../../src/core/cycle/decide-slot.ts';@@ -43,4 +44,11 @@ describe('reference calibrations', () => {if (r.proposal_floor !== undefined) expect(policy.calibration?.proposal_floor).toBe(r.proposal_floor);}});++ test('the withdrawal review lane opens on a fresh brain with only a TypeSafe key', () => {+ const cfg = readDecideConfig({}, { typesafeKey: true });+ const policy = resolveSlotPolicy({ cfg, slot: 'conflict', callSite: 'review_withdraw', packShape: packShape('conflict'), calibrations: [], hasTypesafeKey: true });+ expect(policy.calibration?.ref).toBe('ref:conflict-review-withdraw-jev-1.13.0-2026-10-05');+ expect(reviewGate(policy, cfg)).toEqual({ effective: 'on' });+ });});diff --git a/test/decide/review-withdraw.serial.test.ts b/test/decide/review-withdraw.serial.test.tsindex 686de3ef63..275dfb59ea 100644--- a/test/decide/review-withdraw.serial.test.ts+++ b/test/decide/review-withdraw.serial.test.ts@@ -136,11 +136,13 @@ afterEach(async () => {});describe('queueing and the forget response', () => {- test('a withdrawal queues review only when the kind is on and the caller did not opt out', async () => {+ test('a withdrawal queues review unless the kind is turned off or the caller opted out (on by default)', async () => {+ await setConfig({ 'decide.slots.conflict.review_withdraw': 'false' });const a = await remember('[g1] Alice Example prefers tea.');await forget(a);expect(await queue()).toEqual([]);await setConfig(BASE);+ await engine.unsetConfig('decide.slots.conflict.review_withdraw');const b = await remember('[g2] Alice Example lives in Lisbon.');await forget(b);const c = await remember('[g3] Alice Example dislikes flying.');diff --git a/test/fixtures/goldens/decide/status-keyless-all-off.json b/test/fixtures/goldens/decide/status-keyless-all-off.jsonindex 57068c40fa..cf1cc6693d 100644--- a/test/fixtures/goldens/decide/status-keyless-all-off.json+++ b/test/fixtures/goldens/decide/status-keyless-all-off.json@@ -303,7 +303,7 @@},{"accepted_30d": 0,- "enabled": false,+ "enabled": true,"kind": "withdraw","oldest_pending_days": null,"pending": 0,