Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: facts_drain joins the phase sequence pins, goldens and e2e map; drain config keys live in drain-config.ts

garrytan1da881a39590
diff --git a/scripts/e2e-test-map.ts b/scripts/e2e-test-map.ts
index bc0610d25f..dc98e5ee65 100644
--- a/scripts/e2e-test-map.ts
+++ b/scripts/e2e-test-map.ts
@@ -262,6 +262,7 @@ export const E2E_TEST_MAP: Record<string, string[]> = {
],
// Any minions queue/worker/handler change exercises all minion E2E.
"src/core/minions/**": [
+ "test/e2e/job-deferral-postgres.test.ts",
"test/e2e/minions-legacy-coalesce-postgres.test.ts",
"test/e2e/minions-legacy-journey-postgres.test.ts",
"test/e2e/worker-readiness-cli.test.ts",
diff --git a/src/commands/config.ts b/src/commands/config.ts
index f5ba8578fd..11df342431 100644
--- a/src/commands/config.ts
+++ b/src/commands/config.ts
@@ -292,7 +292,7 @@ async function setConfigWithDecideHooks(engine: BrainEngine, key: string, value:
}
if (key === 'auto_chronicle' || key.startsWith('chronicle.')) await refuseInvalidChronicleValue(key, value, force);
if (key.startsWith('facts.drain_')) {
- const { validateFactsDrainConfigValue } = await import('../core/facts/drain.ts');
+ const { validateFactsDrainConfigValue } = await import('../core/facts/drain-config.ts');
const err = validateFactsDrainConfigValue(key, value);
if (err) { console.error(`[config] ${err}`); process.exit(1); }
}
diff --git a/src/core/facts/drain-config.ts b/src/core/facts/drain-config.ts
new file mode 100644
index 0000000000..f94dc76a8e
--- /dev/null
+++ b/src/core/facts/drain-config.ts
@@ -0,0 +1,27 @@
+/** Config keys of the automatic facts drain (drain.ts) and their `config set` validation. */
+interface NumericKeySpec { fallback: number; min: number; max: number; integer: boolean; meaning: string }
+export const FACTS_DRAIN_KEYS = {
+ 'facts.drain_budget_usd': { fallback: 1, min: 0.01, max: 100, integer: false, meaning: 'USD cap for one automatic drain run' },
+ 'facts.drain_daily_budget_usd': { fallback: 5, min: 0.01, max: 1000, integer: false, meaning: 'USD cap for automatic drain runs per rolling 24 hours' },
+ 'facts.drain_max_jobs': { fallback: 50, min: 1, max: 1000, integer: true, meaning: 'jobs one automatic drain run takes at most' },
+} as const satisfies Record<string, NumericKeySpec>;
+export type FactsDrainKey = keyof typeof FACTS_DRAIN_KEYS;
+
+export function parseFactsDrainKey(key: FactsDrainKey, raw: string): number | null {
+ const spec: NumericKeySpec = FACTS_DRAIN_KEYS[key];
+ const text = raw.trim();
+ if (!/^\d+(\.\d+)?$/.test(text)) return null;
+ const n = Number(text);
+ if (spec.integer && !Number.isInteger(n)) return null;
+ return n >= spec.min && n <= spec.max ? n : null;
+}
+
+/** `config set` validation for facts.drain_*; the refusal text, or null when valid. */
+export function validateFactsDrainConfigValue(key: string, value: string): string | null {
+ if (!(key in FACTS_DRAIN_KEYS)) return null;
+ const k = key as FactsDrainKey;
+ const spec: NumericKeySpec = FACTS_DRAIN_KEYS[k];
+ return parseFactsDrainKey(k, value) !== null ? null
+ : `${key} must be ${spec.integer ? 'a whole number' : 'a number'} from ${spec.min} to ${spec.max} (${spec.meaning}; default ${spec.fallback}) (got '${value}'). Nothing was written.`;
+}
+
diff --git a/src/core/facts/drain.ts b/src/core/facts/drain.ts
index 41cb137749..4d7bcc08e0 100644
--- a/src/core/facts/drain.ts
+++ b/src/core/facts/drain.ts
@@ -26,6 +26,9 @@ import { randomUUID } from 'node:crypto';
import type { BrainEngine } from '../engine.ts';
import type { Action, Notice } from '../agent-output.ts';
import type { MinionJob } from '../minions/types.ts';
+import { FACTS_DRAIN_KEYS, parseFactsDrainKey, type FactsDrainKey } from './drain-config.ts';
+export { FACTS_DRAIN_KEYS, validateFactsDrainConfigValue, type FactsDrainKey } from './drain-config.ts';
+
export const FACTS_DRAIN_JOB = 'facts-absorb';
export const FACTS_DRAIN_QUEUE = 'default';
@@ -38,32 +41,6 @@ export const FACTS_DRAIN_WALL_MS = 5 * 60_000;
const PROMPT_OVERHEAD_TOKENS = 1_500;
const RUN_HISTORY = 20;
-interface NumericKeySpec { fallback: number; min: number; max: number; integer: boolean; meaning: string }
-export const FACTS_DRAIN_KEYS = {
- 'facts.drain_budget_usd': { fallback: 1, min: 0.01, max: 100, integer: false, meaning: 'USD cap for one automatic drain run' },
- 'facts.drain_daily_budget_usd': { fallback: 5, min: 0.01, max: 1000, integer: false, meaning: 'USD cap for automatic drain runs per rolling 24 hours' },
- 'facts.drain_max_jobs': { fallback: 50, min: 1, max: 1000, integer: true, meaning: 'jobs one automatic drain run takes at most' },
-} as const satisfies Record<string, NumericKeySpec>;
-export type FactsDrainKey = keyof typeof FACTS_DRAIN_KEYS;
-
-function parseKey(key: FactsDrainKey, raw: string): number | null {
- const spec: NumericKeySpec = FACTS_DRAIN_KEYS[key];
- const text = raw.trim();
- if (!/^\d+(\.\d+)?$/.test(text)) return null;
- const n = Number(text);
- if (spec.integer && !Number.isInteger(n)) return null;
- return n >= spec.min && n <= spec.max ? n : null;
-}
-
-/** `config set` validation for facts.drain_*; the refusal text, or null when valid. */
-export function validateFactsDrainConfigValue(key: string, value: string): string | null {
- if (!(key in FACTS_DRAIN_KEYS)) return null;
- const k = key as FactsDrainKey;
- const spec: NumericKeySpec = FACTS_DRAIN_KEYS[k];
- return parseKey(k, value) !== null ? null
- : `${key} must be ${spec.integer ? 'a whole number' : 'a number'} from ${spec.min} to ${spec.max} (${spec.meaning}; default ${spec.fallback}) (got '${value}'). Nothing was written.`;
-}
-
export interface FactsDrainSettings {
enabled: boolean;
budgetUsd: number;
@@ -79,7 +56,7 @@ export async function factsDrainSettings(engine: BrainEngine): Promise<FactsDrai
let explicitCap = false;
for (const key of Object.keys(FACTS_DRAIN_KEYS) as FactsDrainKey[]) {
const raw = await engine.getConfig(key).catch(() => null);
- const parsed = raw == null || raw.trim() === '' ? null : parseKey(key, raw);
+ const parsed = raw == null || raw.trim() === '' ? null : parseFactsDrainKey(key, raw);
values[key] = parsed ?? FACTS_DRAIN_KEYS[key].fallback;
if (parsed !== null && key !== 'facts.drain_max_jobs') explicitCap = true;
}
diff --git a/test/core/cycle.serial.test.ts b/test/core/cycle.serial.test.ts
index 63830babf1..7fc181caa6 100644
--- a/test/core/cycle.serial.test.ts
+++ b/test/core/cycle.serial.test.ts
@@ -463,7 +463,8 @@ describe('runCycle — yieldBetweenPhases hook', () => {
// between conversation_facts_backfill and embed — both landed in this merge).
// #2653: 23 phases (added `drift` between calibration_profile and
// conversation_facts_backfill). #5876: 24 (added `chronicle` after drift).
- expect(hookCalls).toBe(24);
+ // GBRA-40 Lane D: 25 (added `facts_drain` after chronicle).
+ expect(hookCalls).toBe(25);
});
test('hook exceptions do not abort the cycle', async () => {
@@ -478,8 +479,8 @@ describe('runCycle — yieldBetweenPhases hook', () => {
// v0.39.0.0: 17 phases (T12 schema-suggest phase between orphans and purge).
// v0.41.11.0: 20 phases (+extract_atoms, +synthesize_concepts, +conversation_facts_backfill).
// v0.41.39 (#1700) + v0.42.0.0: 22 phases (+enrich_thin, +skillopt).
- // #2653: 23 phases (+drift). #5876: 24 (+chronicle).
- expect(report.phases.length).toBe(24);
+ // #2653: 23 phases (+drift). #5876: 24 (+chronicle). GBRA-40 Lane D: 25 (+facts_drain).
+ expect(report.phases.length).toBe(25);
});
});
diff --git a/test/e2e/dream-cycle-phase-order-pglite.test.ts b/test/e2e/dream-cycle-phase-order-pglite.test.ts
index 31fdc9197f..8039542313 100644
--- a/test/e2e/dream-cycle-phase-order-pglite.test.ts
+++ b/test/e2e/dream-cycle-phase-order-pglite.test.ts
@@ -144,6 +144,7 @@ const EXPECTED_PHASES: CyclePhase[] = [
'calibration_profile', // v0.36.1.0
'drift', // #2653 — drift detection (default OFF, report-only)
'chronicle', // #5876 — Life Chronicle events (default ON)
+ 'facts_drain', // GBRA-40 Lane D — automatic facts drain (PGLite)
'conversation_facts_backfill', // v0.41.11.0 — opt-in conversation backfill
'enrich_thin', // v0.41.39 (#1700) — brain-internal stub enrichment (default OFF)
'skillopt', // v0.42.0.0 — self-evolving skills (default OFF)
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index 8c613f7b27..cbfe96d68e 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 196835,
- "stdoutSha256": "7c6a8f58d1ecf9152a0bef45fe6b85d84ea6bc81c4610fc65b2a65eeec68370a",
+ "stdoutBytes": 196872,
+ "stdoutSha256": "f3f521d380697ea70f77982759504f2538ce69d96b7e3ea7c0fb37e36546472d",
"toolNames": [
"remember",
"entity",
@@ -6267,6 +6267,7 @@
"backup_coverage",
"degraded_dedup",
"empty_retrieval",
+ "facts_drain_first_run",
"features_auto_fix",
"listing_truncated",
"local_transcripts",
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 9ebd3e303b..316ef797f6 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -1558,6 +1558,25 @@
"severity": "info",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "backlog": {
+ "active": 0,
+ "delayed": 0,
+ "waiting": 0
+ },
+ "daily_spent_usd": 0,
+ "docs": "docs/guides/facts-drain.md",
+ "health": "not_applicable",
+ "last_run": null
+ },
+ "message": "Postgres brains run facts-absorb jobs on the job worker (gbrain jobs supervisor), not the automatic drain.",
+ "name": "facts_drain",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -1721,7 +1740,7 @@
"category": "meta",
"details": {
"counts": {
- "global": 10,
+ "global": 11,
"mixed": 2,
"source": 12
},
@@ -1737,6 +1756,7 @@
"extract": "source",
"extract_atoms": "source",
"extract_facts": "source",
+ "facts_drain": "global",
"grade_takes": "global",
"lint": "source",
"orphans": "global",
@@ -1752,7 +1772,7 @@
"synthesize_concepts": "global"
}
},
- "message": "Phase taxonomy: 12 source-scoped, 10 brain-global, 2 mixed. Source-safe: [lint, backlinks, sync, extract, extract_facts, extract_atoms, recompute_emotional_weight, consolidate, propose_takes, conversation_facts_backfill, enrich_thin, schema-suggest]. Brain-global: [resolve_symbol_edges, synthesize_concepts, grade_takes, calibration_profile, drift, chronicle, skillopt, embed, orphans, purge]. Mixed: [synthesize, patterns].",
+ "message": "Phase taxonomy: 12 source-scoped, 11 brain-global, 2 mixed. Source-safe: [lint, backlinks, sync, extract, extract_facts, extract_atoms, recompute_emotional_weight, consolidate, propose_takes, conversation_facts_backfill, enrich_thin, schema-suggest]. Brain-global: [resolve_symbol_edges, synthesize_concepts, grade_takes, calibration_profile, drift, chronicle, facts_drain, skillopt, embed, orphans, purge]. Mixed: [synthesize, patterns].",
"name": "cycle_phase_scope",
"status": "ok"
},
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index fb4aa5732c..bca7109f3d 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -5282,6 +5282,7 @@
"claim: (lockToken: string, lockDurationMs: number, queue: string, registeredNames: string[]) => Promise<MinionJob | null>",
"classifyPrivateQueueForRecovery: (queueName: string) => Promise<\"orphan\" | \"live\" | \"unowned\" | \"not_orphan\">",
"completeJob: (id: number, lockToken: string, result?: Record<string, unknown>) => Promise<MinionJob | null>",
+ "deferJob: (id: number, lockToken: string, note: string, delayMs: number) => Promise<MinionJob | null>",
"deleteAttachment: (jobId: number, filename: string) => Promise<boolean>",
"ensureSchema: () => Promise<void>",
"failJob: (id: number, lockToken: string, errorText: string, newStatus: \"delayed\" | \"failed\" | \"dead\", backoffMs?: number) => Promise<MinionJob | null>",
@@ -5359,6 +5360,7 @@
"private configurationDeadline",
"private configurationDrainFinished",
"private cpuCores",
+ "private deferJob",
"private drainConfiguration",
"private eldHistogram",
"private emitUnhealthy",
@@ -5625,7 +5627,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
+ "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
diff --git a/test/serve-idle-sweep-source.serial.test.ts b/test/serve-idle-sweep-source.serial.test.ts
index 226280e4eb..0cc5a28212 100644
--- a/test/serve-idle-sweep-source.serial.test.ts
+++ b/test/serve-idle-sweep-source.serial.test.ts
@@ -90,6 +90,7 @@ describe('serve idle sweep source resolution (#4679)', () => {
mcpStdio: false,
bootTimeoutMs: 0,
sweepEnabled: true,
+ factsDrain: false, // its own 10-minute timer is covered by test/facts-drain-scheduler.test.ts
};
process.chdir(dir);