@remnic/core 9.3.722 → 9.3.724
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-boundary.d.ts +6 -11
- package/dist/access-boundary.js +9 -9
- package/dist/access-cli.js +29 -23
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +19 -14
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +18 -13
- package/dist/access-operations-batch.js +16 -10
- package/dist/access-operations.d.ts +5 -5
- package/dist/access-operations.js +17 -11
- package/dist/{access-service-Dj3I-VBS.d.ts → access-service-B2PlPtxh.d.ts} +3 -3
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +8 -8
- package/dist/access-surface-catalog.d.ts +5 -5
- package/dist/access-surface-catalog.js +82 -82
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-F-OEVbRQ.d.ts → catalog-CzUb-GyD.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +4 -4
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-EVPNWN7Z.js → chunk-4R3CGCI5.js} +2 -2
- package/dist/{chunk-UO5ZHIIH.js → chunk-4WZ3J7M6.js} +2 -2
- package/dist/{chunk-PD42EYQN.js → chunk-5OPYYPJN.js} +2 -2
- package/dist/{chunk-EEJMD2L2.js → chunk-6CWGS2LY.js} +2 -2
- package/dist/{chunk-7CTNUVHZ.js → chunk-6SQQOJ4U.js} +2 -2
- package/dist/{chunk-ILFSEIRT.js → chunk-7AG54AF3.js} +1 -1
- package/dist/{chunk-ILFSEIRT.js.map → chunk-7AG54AF3.js.map} +1 -1
- package/dist/{chunk-UIXXE6NI.js → chunk-C6BWLYW5.js} +24 -15
- package/dist/chunk-C6BWLYW5.js.map +1 -0
- package/dist/{chunk-A5XNBK2D.js → chunk-DF3I6JGP.js} +6 -6
- package/dist/{chunk-GJSL4WG2.js → chunk-F3XZN24Z.js} +2 -2
- package/dist/{chunk-J3JPB7ZI.js → chunk-FACTVMXQ.js} +2 -2
- package/dist/{chunk-B7WISIAJ.js → chunk-FN6QP7JQ.js} +154 -1067
- package/dist/chunk-FN6QP7JQ.js.map +1 -0
- package/dist/{chunk-EBDA5TYA.js → chunk-FXCIOLRB.js} +2 -2
- package/dist/{chunk-TXQCG6SE.js → chunk-H7HUQIY7.js} +3 -3
- package/dist/{chunk-QD6QP5P6.js → chunk-I2HL5M6T.js} +17 -17
- package/dist/{chunk-M7R5R6OJ.js → chunk-IAIPNEHD.js} +20 -2
- package/dist/{chunk-M7R5R6OJ.js.map → chunk-IAIPNEHD.js.map} +1 -1
- package/dist/{chunk-Z4RU5VPM.js → chunk-J334N6QV.js} +2 -2
- package/dist/{chunk-NXRUUDUF.js → chunk-JJJCVCCQ.js} +2 -2
- package/dist/{chunk-GDUOCHCD.js → chunk-KGZF2VO3.js} +10 -10
- package/dist/{chunk-LA3HZKES.js → chunk-KLFYKC3K.js} +448 -49
- package/dist/chunk-KLFYKC3K.js.map +1 -0
- package/dist/{chunk-LLUGAZ3B.js → chunk-NT36GU6X.js} +30 -4
- package/dist/chunk-NT36GU6X.js.map +1 -0
- package/dist/{chunk-OHTOPFRF.js → chunk-SC2YAWRF.js} +2 -2
- package/dist/{chunk-YEE5KJQQ.js → chunk-T55EGZSJ.js} +2 -2
- package/dist/{chunk-N77ELJ2D.js → chunk-TT5U3UDO.js} +4 -4
- package/dist/{chunk-6FAMMBQ3.js → chunk-UBHVAGO7.js} +2 -2
- package/dist/chunk-VI5SGGXB.js +420 -0
- package/dist/chunk-VI5SGGXB.js.map +1 -0
- package/dist/{chunk-EDOQM4E4.js → chunk-WAFDHKES.js} +2 -2
- package/dist/{chunk-EXUCUPV2.js → chunk-WM7DNKBD.js} +2 -2
- package/dist/{dreams-ledger-3WSCI5V4.js → chunk-YF6FMLBT.js} +5 -6
- package/dist/{dreams-ledger-3WSCI5V4.js.map → chunk-YF6FMLBT.js.map} +1 -1
- package/dist/{chunk-WQYSDPMA.js → chunk-YQMPUYHE.js} +2 -2
- package/dist/{chunk-5O42UKXI.js → chunk-YUYPWJD3.js} +2 -2
- package/dist/{chunk-VCLGUIFM.js → chunk-Z3FGC3QE.js} +2 -2
- package/dist/{chunk-A7TJZLPK.js → chunk-ZK2L72VN.js} +2 -2
- package/dist/{chunk-BXEOHV7K.js → chunk-ZOHMPFOB.js} +3 -3
- package/dist/{graph-edge-decay-QPRJQ7DL.js → chunk-ZQNCHPTZ.js} +4 -5
- package/dist/{graph-edge-decay-QPRJQ7DL.js.map → chunk-ZQNCHPTZ.js.map} +1 -1
- package/dist/{cli-P_GaYcCY.d.ts → cli-IOlDHSBT.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +31 -26
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +3 -3
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +3 -3
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/dreams-ledger-6UODQOX6.js +22 -0
- package/dist/dreams-ledger-6UODQOX6.js.map +1 -0
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +3 -3
- package/dist/entity-schema.d.ts +1 -1
- package/dist/event-time.d.ts +33 -1
- package/dist/event-time.js +3 -1
- package/dist/explicit-capture.d.ts +4 -4
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-decay-RXUCJIN4.js +22 -0
- package/dist/graph-edge-decay-RXUCJIN4.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +58 -56
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +2 -2
- package/dist/namespaces/migrate.js +4 -4
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +3 -3
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +8 -8
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +5 -5
- package/dist/{orchestrator-f5xv19kp.d.ts → orchestrator-C_OMSIMZ.d.ts} +34 -3
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +17 -17
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-BQm1e1Pn.d.ts → semantic-consolidation-B8LiYtvx.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +2 -2
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-DwO1Ot4n.d.ts → types-DmTaqob2.d.ts} +14 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +3 -3
- package/package.json +2 -2
- package/src/access-boundary.ts +36 -2
- package/src/access-http.ts +17 -8
- package/src/access-mcp.ts +149 -1189
- package/src/access-operations-batch.ts +227 -1439
- package/src/access-surface-catalog.test.ts +4 -15
- package/src/access-surface-catalog.ts +82 -82
- package/src/bitemporal-dedup-backfill.test.ts +169 -0
- package/src/event-time.ts +57 -0
- package/src/extraction-eventtime-wiring.test.ts +101 -1
- package/src/orchestrator.ts +238 -43
- package/src/recall/archive-scoring.ts +526 -0
- package/src/types.ts +14 -0
- package/dist/chunk-B7WISIAJ.js.map +0 -1
- package/dist/chunk-EM2LDXJ2.js +0 -1315
- package/dist/chunk-EM2LDXJ2.js.map +0 -1
- package/dist/chunk-LA3HZKES.js.map +0 -1
- package/dist/chunk-LLUGAZ3B.js.map +0 -1
- package/dist/chunk-UIXXE6NI.js.map +0 -1
- /package/dist/{chunk-EVPNWN7Z.js.map → chunk-4R3CGCI5.js.map} +0 -0
- /package/dist/{chunk-UO5ZHIIH.js.map → chunk-4WZ3J7M6.js.map} +0 -0
- /package/dist/{chunk-PD42EYQN.js.map → chunk-5OPYYPJN.js.map} +0 -0
- /package/dist/{chunk-EEJMD2L2.js.map → chunk-6CWGS2LY.js.map} +0 -0
- /package/dist/{chunk-7CTNUVHZ.js.map → chunk-6SQQOJ4U.js.map} +0 -0
- /package/dist/{chunk-A5XNBK2D.js.map → chunk-DF3I6JGP.js.map} +0 -0
- /package/dist/{chunk-GJSL4WG2.js.map → chunk-F3XZN24Z.js.map} +0 -0
- /package/dist/{chunk-J3JPB7ZI.js.map → chunk-FACTVMXQ.js.map} +0 -0
- /package/dist/{chunk-EBDA5TYA.js.map → chunk-FXCIOLRB.js.map} +0 -0
- /package/dist/{chunk-TXQCG6SE.js.map → chunk-H7HUQIY7.js.map} +0 -0
- /package/dist/{chunk-QD6QP5P6.js.map → chunk-I2HL5M6T.js.map} +0 -0
- /package/dist/{chunk-Z4RU5VPM.js.map → chunk-J334N6QV.js.map} +0 -0
- /package/dist/{chunk-NXRUUDUF.js.map → chunk-JJJCVCCQ.js.map} +0 -0
- /package/dist/{chunk-GDUOCHCD.js.map → chunk-KGZF2VO3.js.map} +0 -0
- /package/dist/{chunk-OHTOPFRF.js.map → chunk-SC2YAWRF.js.map} +0 -0
- /package/dist/{chunk-YEE5KJQQ.js.map → chunk-T55EGZSJ.js.map} +0 -0
- /package/dist/{chunk-N77ELJ2D.js.map → chunk-TT5U3UDO.js.map} +0 -0
- /package/dist/{chunk-6FAMMBQ3.js.map → chunk-UBHVAGO7.js.map} +0 -0
- /package/dist/{chunk-EDOQM4E4.js.map → chunk-WAFDHKES.js.map} +0 -0
- /package/dist/{chunk-EXUCUPV2.js.map → chunk-WM7DNKBD.js.map} +0 -0
- /package/dist/{chunk-WQYSDPMA.js.map → chunk-YQMPUYHE.js.map} +0 -0
- /package/dist/{chunk-5O42UKXI.js.map → chunk-YUYPWJD3.js.map} +0 -0
- /package/dist/{chunk-VCLGUIFM.js.map → chunk-Z3FGC3QE.js.map} +0 -0
- /package/dist/{chunk-A7TJZLPK.js.map → chunk-ZK2L72VN.js.map} +0 -0
- /package/dist/{chunk-BXEOHV7K.js.map → chunk-ZOHMPFOB.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/access-operations-batch.ts"],"sourcesContent":["/**\n * Batch migration of remaining access-surface handlers through the boundary\n * (issue #1525 / #1668). Each operation routes MCP/HTTP/CLI dispatch through\n * the shared validation + error-mapping layer in access-boundary.ts.\n *\n * Strict per-tool Zod schemas replace the earlier permissive looseSchema (#1668).\n * Each schema validates known field types; .passthrough() tolerates MCP client\n * context injection (cwd/projectTag/sessionKey) without silent type coercion.\n * The stripNulls preprocessor handles the OpenAI-schema null-for-absent gotcha.\n */\n\nimport { randomUUID } from \"node:crypto\";\nimport { z } from \"zod\";\nimport type { DreamsPhase, RecallDisclosure, RecallPlanMode } from \"./types.js\";\nimport type { RemnicChatGptMemoryInspectorInput } from \"./mcp-memory-inspector-app.js\";\nimport { defineOperation } from \"./access-boundary.js\";\nimport { EngramAccessInputError, type EngramAccessService } from \"./access-service.js\";\nimport { projectTagProjectId } from \"./coding/coding-namespace.js\";\nimport { expandTildePath } from \"./utils/path.js\";\nimport { resolvePrincipal } from \"./namespaces/principal.js\";\nimport { validateBriefingFormat } from \"./briefing.js\";\nimport {\n buildChatGptMemoryInspectorActionRequest,\n buildChatGptMemoryInspectorResult,\n} from \"./mcp-memory-inspector-app.js\";\nimport { listPairs, isDefaultReviewNamespace } from \"./contradiction/contradiction-review.js\";\nimport { executeResolution, isValidResolutionVerb } from \"./contradiction/resolution.js\";\nimport { runContradictionScan } from \"./contradiction/contradiction-scan.js\";\nimport { runGraphEdgeDecayMaintenanceAcrossNamespaces } from \"./maintenance/graph-edge-decay.js\";\nimport { normalizeDreamsStatusWindowHours } from \"./maintenance/dreams-ledger.js\";\n\n// ---------------------------------------------------------------------------\n// Shared helpers\n// ---------------------------------------------------------------------------\n\nfunction stripNulls(data: unknown): unknown {\n if (data !== null && typeof data === \"object\" && !Array.isArray(data)) {\n const obj = data as Record<string, unknown>;\n const cleaned: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== null) cleaned[key] = value;\n }\n return cleaned;\n }\n return data;\n}\n\nfunction strictSchema<T extends z.ZodRawShape>(shape: T): z.ZodType<Record<string, unknown>> {\n return z.preprocess(stripNulls, z.object(shape).passthrough()) as unknown as z.ZodType<Record<string, unknown>>;\n}\n\nfunction optStr(v: unknown): string | undefined { return typeof v === \"string\" ? v : undefined; }\nfunction reqStr(v: unknown, field: string): string {\n if (typeof v !== \"string\" || v.length === 0) throw new EngramAccessInputError(field + \" is required and must be a non-empty string\");\n return v;\n}\nfunction defStr(v: unknown, d: string): string { return typeof v === \"string\" ? v : d; }\nfunction optNum(v: unknown): number | undefined { return typeof v === \"number\" && Number.isFinite(v) ? v : undefined; }\nfunction optBool(v: unknown): boolean | undefined { return typeof v === \"boolean\" ? v : undefined; }\nfunction optStrArr(v: unknown): string[] | undefined { return Array.isArray(v) && v.every((x) => typeof x === \"string\") ? v : undefined; }\n\nconst S = {\n str: z.string().optional(),\n num: z.number().optional(),\n // Accept numbers and numeric strings (MCP clients sometimes send \"7\" for 7).\n flexNum: z.union([z.number(), z.string()]).optional(),\n bool: z.boolean().optional(),\n strArr: z.array(z.string()).optional(),\n};\n\n// === RECALL ===\ndefineOperation({ name: \"recall\", description: \"Semantic recall.\", schema: strictSchema({ query: S.str, sessionKey: S.str, namespace: S.str, topK: S.num, mode: S.str, includeDebug: S.bool, disclosure: S.str, cwd: S.str, projectTag: S.str, asOf: S.str, tags: S.strArr, tagMatch: S.str }),\n handler: async (input, ctx) => {\n let disclosure: RecallDisclosure | undefined;\n if (input.disclosure !== undefined) { if (typeof input.disclosure !== \"string\") throw new EngramAccessInputError(\"disclosure must be a string\"); disclosure = input.disclosure as RecallDisclosure; }\n if (input.cwd !== undefined && typeof input.cwd !== \"string\") throw new EngramAccessInputError(\"cwd must be a string\");\n if (input.projectTag !== undefined && typeof input.projectTag !== \"string\") throw new EngramAccessInputError(\"projectTag must be a string\");\n if (input.asOf !== undefined && typeof input.asOf !== \"string\") throw new EngramAccessInputError(\"asOf must be a string\");\n let tags: string[] | undefined;\n if (input.tags !== undefined) { if (!Array.isArray(input.tags) || !input.tags.every((t) => typeof t === \"string\")) throw new EngramAccessInputError(\"tags must be an array of strings\"); tags = input.tags; }\n let tagMatch: \"any\" | \"all\" | undefined;\n if (input.tagMatch !== undefined) { if (input.tagMatch !== \"any\" && input.tagMatch !== \"all\") throw new EngramAccessInputError(\"tagMatch must be one of: any, all\"); tagMatch = input.tagMatch; }\n const result = await ctx.service.recall({ query: typeof input.query === \"string\" ? input.query : \"\", sessionKey: optStr(input.sessionKey), authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), topK: optNum(input.topK), mode: optStr(input.mode) as RecallPlanMode | \"auto\" | undefined, includeDebug: input.includeDebug === true, disclosure, cwd: optStr(input.cwd), projectTag: optStr(input.projectTag), asOf: optStr(input.asOf), ...(tags ? { tags } : {}), ...(tagMatch ? { tagMatch } : {}) });\n return { result };\n },\n});\ndefineOperation({ name: \"recall_explain\", description: \"Explain recall plan.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.recallExplain({ sessionKey: optStr(input.sessionKey), namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"set_coding_context\", description: \"Set coding context.\", schema: z.preprocess((data) => { // Strip null from all fields EXCEPT codingContext (null = clear context).\n if (data !== null && typeof data === \"object\" && !Array.isArray(data)) { const o = data as Record<string, unknown>; const c: Record<string, unknown> = {}; for (const [k, v] of Object.entries(o)) { if (v !== null || k === \"codingContext\") c[k] = v; } return c; } return data; }, z.object({ sessionKey: S.str, codingContext: z.union([z.null(), z.object({ projectId: S.str, branch: z.union([z.string(), z.null()]).optional(), rootPath: S.str, defaultBranch: z.union([z.string(), z.null()]).optional() }).passthrough()]).optional(), projectTag: S.str }).passthrough()) as unknown as z.ZodType<Record<string, unknown>>,\n handler: async (input, ctx) => {\n const sessionKey = defStr(input.sessionKey, \"\");\n const projectTag = optStr(input.projectTag);\n const hasProjectTag = projectTag !== undefined && projectTag.trim().length > 0;\n const hasCodingContext = \"codingContext\" in input;\n if (!hasCodingContext && hasProjectTag) { const tag = projectTag!.trim(); const pid = projectTagProjectId(tag); ctx.service.setCodingContext({ sessionKey, codingContext: { projectId: pid, branch: null, rootPath: pid, defaultBranch: null } }); return { result: { ok: true } }; }\n if (!hasCodingContext && !hasProjectTag) throw new EngramAccessInputError(\"set_coding_context requires either codingContext or projectTag\");\n const rawCtx = (input as Record<string, unknown>).codingContext;\n let codingContext: { projectId: string; branch: string | null; rootPath: string; defaultBranch: string | null } | null = null;\n if (rawCtx !== null) { if (typeof rawCtx !== \"object\") throw new EngramAccessInputError(\"codingContext must be an object or null\"); const o = rawCtx as Record<string, unknown>; const branch = o.branch === null ? null : optStr(o.branch); const dB = o.defaultBranch === null ? null : optStr(o.defaultBranch); if (branch === undefined) throw new EngramAccessInputError(\"codingContext.branch must be a string or null\"); if (dB === undefined) throw new EngramAccessInputError(\"codingContext.defaultBranch must be a string or null\"); codingContext = { projectId: defStr(o.projectId, \"\"), branch, rootPath: defStr(o.rootPath, \"\"), defaultBranch: dB }; }\n ctx.service.setCodingContext({ sessionKey, codingContext });\n return { result: { ok: true } };\n },\n});\ndefineOperation({ name: \"recall_tier_explain\", description: \"Explain recall tiers.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str }), handler: async (input, ctx) => { const sk = optStr(input.sessionKey); const ns = optStr(input.namespace); return { result: await ctx.service.recallTierExplain(sk && sk.length > 0 ? sk : undefined, ns && ns.length > 0 ? ns : undefined, ctx.authenticatedPrincipal) }; } });\ndefineOperation({ name: \"recall_xray\", description: \"X-ray recall.\", schema: strictSchema({ query: S.str, sessionKey: S.str, namespace: S.str, budget: z.unknown().optional(), disclosure: S.str }),\n handler: async (input, ctx) => {\n let budget: number | undefined;\n if (input.budget !== undefined) { const p = typeof input.budget === \"number\" ? input.budget : typeof input.budget === \"string\" ? Number(input.budget) : undefined; if (p === undefined || !Number.isFinite(p) || p <= 0 || !Number.isInteger(p)) throw new EngramAccessInputError(\"recall_xray: budget expects a positive integer\"); budget = p; }\n const dr = optStr(input.disclosure);\n return { result: await ctx.service.recallXray({ query: defStr(input.query, \"\"), sessionKey: optStr(input.sessionKey), namespace: optStr(input.namespace), budget, authenticatedPrincipal: ctx.authenticatedPrincipal, ...(dr && dr !== \"\" ? { disclosure: dr as RecallDisclosure } : {}) }) };\n },\n});\n\n// === WEARABLES ===\ndefineOperation({ name: \"wearables_status\", description: \"Wearables status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.wearablesStatus() }) });\ndefineOperation({ name: \"wearables_sync\", description: \"Sync wearables.\", schema: strictSchema({ source: S.str, date: S.str, days: S.flexNum, forceMemories: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.wearablesSync({ source: optStr(input.source), date: optStr(input.date), days: typeof input.days === \"number\" ? input.days : typeof input.days === \"string\" && Number.isFinite(Number(input.days)) ? Number(input.days) : undefined, forceMemories: optBool(input.forceMemories) }) }) });\ndefineOperation({ name: \"transcript_day\", description: \"Transcript for a day.\", schema: strictSchema({ date: S.str, source: S.str }), handler: async (input, ctx) => { const d = defStr(input.date, \"\"); if (d.trim().length === 0) throw new EngramAccessInputError(\"transcript_day: date is required (YYYY-MM-DD)\"); return { result: await ctx.service.wearablesTranscriptDay({ date: d, source: optStr(input.source) }) }; } });\ndefineOperation({ name: \"transcript_search\", description: \"Search transcripts.\", schema: strictSchema({ query: S.str, source: S.str, from: S.str, to: S.str, limit: S.flexNum }), handler: async (input, ctx) => { const q = defStr(input.query, \"\"); if (q.trim().length === 0) throw new EngramAccessInputError(\"transcript_search: query is required\"); return { result: await ctx.service.wearablesTranscriptSearch({ query: q, source: optStr(input.source), from: optStr(input.from), to: optStr(input.to), limit: typeof input.limit === \"number\" ? input.limit : typeof input.limit === \"string\" && Number.isFinite(Number(input.limit)) ? Number(input.limit) : undefined }) }; } });\ndefineOperation({ name: \"transcript_memories\", description: \"Transcript memories.\", schema: strictSchema({ source: S.str, date: S.str, limit: S.flexNum }), handler: async (input, ctx) => ({ result: await ctx.service.wearablesTranscriptMemories({ source: optStr(input.source), date: optStr(input.date), limit: typeof input.limit === \"number\" ? input.limit : typeof input.limit === \"string\" && Number.isFinite(Number(input.limit)) ? Number(input.limit) : undefined }) }) });\n\n// === ACTION CONFIDENCE + INSPECTOR + CAPSULE ===\ndefineOperation({ name: \"action_confidence\", description: \"Action confidence.\", schema: strictSchema({ intendedAction: S.str, confidence: S.num, risk: S.str, contextReadiness: S.str, currentContextScopes: S.strArr, userRules: z.array(z.unknown()).optional(), retrievedMemories: z.array(z.unknown()).optional() }), handler: async (input, ctx) => { const req: Record<string, unknown> = {}; if (input.intendedAction !== undefined) req.intendedAction = optStr(input.intendedAction); if (input.confidence !== undefined) req.confidence = optNum(input.confidence); if (input.risk !== undefined) req.risk = optStr(input.risk) as \"low\" | \"medium\" | \"high\" | \"irreversible\" | \"restricted\" | undefined; if (input.contextReadiness !== undefined) req.contextReadiness = optStr(input.contextReadiness) as \"none\" | \"partial\" | \"sufficient\" | undefined; if (input.currentContextScopes !== undefined) req.currentContextScopes = optStrArr(input.currentContextScopes); if (input.userRules !== undefined) req.userRules = input.userRules; if (input.retrievedMemories !== undefined) req.retrievedMemories = input.retrievedMemories; return { result: await ctx.service.actionConfidence(req) }; } });\ndefineOperation({ name: \"chatgpt_memory_inspector\", description: \"Memory inspector.\", schema: strictSchema({ query: S.str, sessionKey: S.str, namespace: S.str, currentContextScopes: S.strArr, allowUnverifiedPreview: S.bool }),\n handler: async (input, ctx) => {\n const q = defStr(input.query, \"\");\n if (q.trim().length === 0) throw new EngramAccessInputError(\"chatgpt_memory_inspector requires a non-empty query string\");\n const ii: RemnicChatGptMemoryInspectorInput = { query: q.trim() };\n if (typeof input.sessionKey === \"string\" && input.sessionKey.trim().length > 0) ii.sessionKey = input.sessionKey;\n if (typeof input.namespace === \"string\" && input.namespace.trim().length > 0) ii.namespace = input.namespace;\n if (input.currentContextScopes !== undefined) ii.currentContextScopes = input.currentContextScopes as string[];\n if (input.allowUnverifiedPreview !== undefined) ii.allowUnverifiedPreview = input.allowUnverifiedPreview as boolean;\n const rsk = ii.sessionKey ?? (ctx.authenticatedPrincipal ? \"remnic:chatgpt-memory-inspector:\" + randomUUID() : undefined);\n const xr = await ctx.service.recallXray({ query: ii.query, sessionKey: rsk, namespace: ii.namespace, currentContextScopes: ii.currentContextScopes, authenticatedPrincipal: ctx.authenticatedPrincipal, mode: \"full\", disclosure: \"chunk\", includeRecall: true });\n const x = xr.snapshotFound === true ? (xr.snapshot ?? null) : null;\n const r = xr.recall ?? { query: ii.query, namespace: ii.namespace ?? x?.namespace ?? \"global\", context: \"\", count: 0, memoryIds: [], results: [], fallbackUsed: false, sourcesUsed: [], disclosure: \"chunk\" as const };\n const ac = await ctx.service.actionConfidence(buildChatGptMemoryInspectorActionRequest(ii, r, x));\n return { result: buildChatGptMemoryInspectorResult(ii, r, x, ac) };\n },\n});\ndefineOperation({ name: \"day_summary\", description: \"Day summary.\", schema: strictSchema({ memories: S.str, sessionKey: S.str, namespace: S.str, timeZone: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => { const req: Record<string, unknown> = {}; if (input.memories !== undefined) req.memories = optStr(input.memories); if (input.sessionKey !== undefined) req.sessionKey = optStr(input.sessionKey); if (input.namespace !== undefined) req.namespace = optStr(input.namespace); if (input.timeZone !== undefined) req.timeZone = optStr(input.timeZone); return { result: await ctx.service.daySummary(req) }; } });\ndefineOperation({ name: \"capsule_export\", description: \"Export capsule.\", schema: strictSchema({ name: S.str, namespace: S.str, since: S.str, includeKinds: S.strArr, peerIds: S.strArr, includeTranscripts: S.bool, encrypt: S.bool, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.capsuleExport({ name: optStr(input.name) ?? \"\", namespace: optStr(input.namespace), since: optStr(input.since), includeKinds: optStrArr(input.includeKinds), peerIds: optStrArr(input.peerIds), includeTranscripts: optBool(input.includeTranscripts as unknown), encrypt: optBool(input.encrypt as unknown), principal: ctx.authenticatedPrincipal } as unknown as Parameters<EngramAccessService[\"capsuleExport\"]>[0]) }) });\ndefineOperation({ name: \"capsule_import\", description: \"Import capsule.\", schema: strictSchema({ archivePath: S.str, namespace: S.str, mode: S.str, passphrase: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.capsuleImport({ archivePath: expandTildePath(optStr(input.archivePath) ?? \"\"), namespace: optStr(input.namespace), mode: optStr(input.mode) as \"skip\" | \"overwrite\" | \"fork\" | undefined, passphrase: optStr(input.passphrase), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"capsule_list\", description: \"List capsules.\", schema: strictSchema({ namespace: S.str, sessionKey: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => {\n const rp = ctx.authenticatedPrincipal ?? (typeof input.sessionKey === \"string\" && input.sessionKey.length > 0 && ctx.service.configRef ? resolvePrincipal(input.sessionKey, ctx.service.configRef) : undefined);\n return { result: await ctx.service.capsuleList({ namespace: optStr(input.namespace), principal: rp }) };\n} });\n\n// === GOVERNANCE ===\ndefineOperation({ name: \"memory_governance_run\", description: \"Run governance.\", schema: strictSchema({ namespace: S.str, mode: S.str, recentDays: S.num, maxMemories: S.num, batchSize: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.governanceRun({ namespace: optStr(input.namespace), mode: optStr(input.mode) === \"apply\" ? \"apply\" : \"shadow\", recentDays: optNum(input.recentDays), maxMemories: optNum(input.maxMemories), batchSize: optNum(input.batchSize), authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"procedure_mining_run\", description: \"Run procedure mining.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.procedureMiningRun({ namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"pattern_reinforcement_run\", description: \"Run pattern reinforcement.\", schema: strictSchema({ namespace: S.str, force: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.patternReinforcementRun({ namespace: optStr(input.namespace), force: input.force === true, authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"procedural_stats\", description: \"Procedural stats.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.procedureStats({ namespace: optStr(input.namespace) }, ctx.authenticatedPrincipal) }) });\n\n// === MEMORY/ENTITY/OBSERVE/LCM ===\ndefineOperation({ name: \"memory_timeline\", description: \"Memory timeline.\", schema: strictSchema({ memoryId: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.memoryTimeline(optStr(input.memoryId) ?? \"\", optStr(input.namespace), optNum(input.limit) ?? 200, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"suggestion_submit\", description: \"Submit suggestion.\", schema: strictSchema({ schemaVersion: S.num, idempotencyKey: S.str, dryRun: S.bool, sessionKey: S.str, content: S.str, category: S.str, confidence: S.num, namespace: S.str, tags: S.strArr, entityRef: S.str, ttl: S.str, sourceReason: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.suggestionSubmit({ schemaVersion: optNum(input.schemaVersion), idempotencyKey: optStr(input.idempotencyKey), dryRun: input.dryRun === true, sessionKey: optStr(input.sessionKey), authenticatedPrincipal: ctx.authenticatedPrincipal, content: optStr(input.content) ?? \"\", category: optStr(input.category), confidence: optNum(input.confidence), namespace: optStr(input.namespace), tags: optStrArr(input.tags), entityRef: optStr(input.entityRef), ttl: optStr(input.ttl), sourceReason: optStr(input.sourceReason), cwd: optStr(input.cwd), projectTag: optStr(input.projectTag) }) }) });\ndefineOperation({ name: \"entity_get\", description: \"Get entity.\", schema: strictSchema({ name: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.entityGet(optStr(input.name) ?? \"\", optStr(input.namespace)) }) });\ndefineOperation({ name: \"review_queue_list\", description: \"List review queue.\", schema: strictSchema({ runId: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.reviewQueue(optStr(input.runId) ?? \"\", optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"observe\", description: \"Observe messages.\", schema: strictSchema({ sessionKey: S.str, messages: z.array(z.object({ role: z.string(), content: z.string(), parts: z.array(z.unknown()).optional(), rawContent: z.unknown().optional(), sourceFormat: z.string().optional() }).passthrough()), skipExtraction: S.bool, idempotencyKey: S.str, namespace: S.str, cwd: S.str, projectTag: S.str }),\n handler: async (input, ctx) => ({ result: await ctx.service.observe({ sessionKey: defStr(input.sessionKey, \"\"), messages: (input.messages as unknown[]).map((m: unknown) => { const r = m as Record<string, unknown>; return { role: String(r.role), content: String(r.content), parts: r.parts as unknown[], rawContent: r.rawContent as string | undefined, sourceFormat: r.sourceFormat as string | undefined }; }) as never, skipExtraction: input.skipExtraction === true, idempotencyKey: optStr(input.idempotencyKey), namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal, cwd: optStr(input.cwd), projectTag: optStr(input.projectTag) }, ctx.hooks?.enforceWriteQuota ? { enforceWriteQuota: ctx.hooks.enforceWriteQuota } : undefined) }),\n});\ndefineOperation({ name: \"lcm_search\", description: \"Search LCM.\", schema: strictSchema({ query: S.str, sessionKey: S.str, sessionPrefix: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.lcmSearch({ query: defStr(input.query, \"\"), sessionKey: optStr(input.sessionKey), sessionPrefix: optStr(input.sessionPrefix), namespace: optStr(input.namespace), limit: optNum(input.limit), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"lcm_compaction_flush\", description: \"Flush LCM compaction.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionFlush({ sessionKey: optStr(input.sessionKey) ?? \"\", namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"lcm_compaction_record\", description: \"Record LCM compaction.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str, tokensBefore: S.num, tokensAfter: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionRecord({ sessionKey: optStr(input.sessionKey) ?? \"\", namespace: optStr(input.namespace), tokensBefore: optNum(input.tokensBefore) ?? 0, tokensAfter: optNum(input.tokensAfter) ?? 0, authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\n\n// === CONTINUITY/IDENTITY ===\ndefineOperation({ name: \"continuity_audit_generate\", description: \"Continuity audit.\", schema: strictSchema({ period: S.str, key: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityAuditGenerate({ period: optStr(input.period) === \"monthly\" ? \"monthly\" : optStr(input.period) === \"weekly\" ? \"weekly\" : undefined, key: optStr(input.key) }) }) });\ndefineOperation({ name: \"continuity_incident_open\", description: \"Open incident.\", schema: strictSchema({ symptom: S.str, namespace: S.str, triggerWindow: S.str, suspectedCause: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityIncidentOpen({ symptom: optStr(input.symptom) ?? \"\", namespace: optStr(input.namespace), triggerWindow: optStr(input.triggerWindow), suspectedCause: optStr(input.suspectedCause), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"continuity_incident_close\", description: \"Close incident.\", schema: strictSchema({ id: S.str, namespace: S.str, fixApplied: S.str, verificationResult: S.str, preventiveRule: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityIncidentClose({ id: optStr(input.id) ?? \"\", namespace: optStr(input.namespace), fixApplied: optStr(input.fixApplied) ?? \"\", verificationResult: optStr(input.verificationResult) ?? \"\", preventiveRule: optStr(input.preventiveRule), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"continuity_incident_list\", description: \"List incidents.\", schema: strictSchema({ state: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => { const st = optStr(input.state); return { result: await ctx.service.continuityIncidentList({ state: st === \"closed\" ? \"closed\" : st === \"all\" ? \"all\" : st === \"open\" ? \"open\" : undefined, namespace: optStr(input.namespace), limit: optNum(input.limit), principal: ctx.authenticatedPrincipal }) }; } });\ndefineOperation({ name: \"continuity_loop_add_or_update\", description: \"Add/update loop.\", schema: strictSchema({ id: S.str, cadence: S.str, purpose: S.str, status: S.str, killCondition: S.str, namespace: S.str, lastReviewed: S.str, notes: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityLoopAddOrUpdate({ id: optStr(input.id) ?? \"\", cadence: (optStr(input.cadence) as \"daily\" | \"weekly\" | \"monthly\" | \"quarterly\") ?? \"weekly\", purpose: optStr(input.purpose) ?? \"\", status: (optStr(input.status) as \"active\" | \"paused\" | \"retired\") ?? \"active\", killCondition: optStr(input.killCondition) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, lastReviewed: optStr(input.lastReviewed), notes: optStr(input.notes) }) }) });\ndefineOperation({ name: \"continuity_loop_review\", description: \"Review loop.\", schema: strictSchema({ id: S.str, namespace: S.str, status: S.str, notes: S.str, reviewedAt: S.str }), handler: async (input, ctx) => { const st = optStr(input.status); return { result: await ctx.service.continuityLoopReview({ id: optStr(input.id) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, status: st === \"active\" || st === \"paused\" || st === \"retired\" ? st as \"active\" | \"paused\" | \"retired\" : undefined, notes: optStr(input.notes), reviewedAt: optStr(input.reviewedAt) }) }; } });\ndefineOperation({ name: \"identity_anchor_get\", description: \"Get identity anchor.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.identityAnchorGet({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"identity_anchor_update\", description: \"Update identity anchor.\", schema: strictSchema({ namespace: S.str, identityTraits: S.str, communicationPreferences: S.str, operatingPrinciples: S.str, continuityNotes: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.identityAnchorUpdate({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, identityTraits: optStr(input.identityTraits), communicationPreferences: optStr(input.communicationPreferences), operatingPrinciples: optStr(input.operatingPrinciples), continuityNotes: optStr(input.continuityNotes) }) }) });\ndefineOperation({ name: \"memory_identity\", description: \"Memory identity.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryIdentity({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\n\n// === WORK/SHARED ===\ndefineOperation({ name: \"work_task\", description: \"Manage work task.\", schema: strictSchema({ action: S.str, id: S.str, title: S.str, description: S.str, status: S.str, priority: S.str, owner: S.str, assignee: S.str, projectId: S.str, tags: S.strArr, dueAt: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.workTask({ action: (optStr(input.action) as \"update\" | \"list\" | \"get\" | \"create\" | \"delete\" | \"transition\") ?? \"list\", id: optStr(input.id), title: optStr(input.title), description: optStr(input.description), status: optStr(input.status), priority: optStr(input.priority), owner: optStr(input.owner), assignee: optStr(input.assignee), projectId: optStr(input.projectId), tags: optStrArr(input.tags), dueAt: optStr(input.dueAt) }) }) });\ndefineOperation({ name: \"work_project\", description: \"Manage work project.\", schema: strictSchema({ action: S.str, id: S.str, name: S.str, description: S.str, status: S.str, owner: S.str, tags: S.strArr, taskId: S.str, projectId: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.workProject({ action: (optStr(input.action) as \"update\" | \"list\" | \"get\" | \"create\" | \"delete\" | \"link_task\") ?? \"list\", id: optStr(input.id), name: optStr(input.name), description: optStr(input.description), status: optStr(input.status), owner: optStr(input.owner), tags: optStrArr(input.tags), taskId: optStr(input.taskId), projectId: optStr(input.projectId) }) }) });\ndefineOperation({ name: \"work_board\", description: \"Manage work board.\", schema: strictSchema({ action: S.str, projectId: S.str, snapshotJson: S.str, linkToMemory: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.workBoard({ action: (optStr(input.action) as \"export_markdown\" | \"export_snapshot\" | \"import_snapshot\") ?? \"export_markdown\", projectId: optStr(input.projectId) ?? \"\", snapshotJson: optStr(input.snapshotJson) ?? \"\", linkToMemory: input.linkToMemory === true }) }) });\ndefineOperation({ name: \"shared_context_write_output\", description: \"Write shared output.\", schema: strictSchema({ agentId: S.str, title: S.str, content: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedContextWriteOutput({ agentId: optStr(input.agentId) ?? \"\", title: optStr(input.title) ?? \"\", content: optStr(input.content) ?? \"\" }) }) });\ndefineOperation({ name: \"shared_feedback_record\", description: \"Record shared feedback.\", schema: strictSchema({ agent: S.str, decision: S.str, reason: S.str, date: S.str, learning: S.str, outcome: S.str, severity: S.str, confidence: S.num, workflow: S.str, tags: S.strArr, evidenceWindowStart: S.str, evidenceWindowEnd: S.str, refs: S.strArr }), handler: async (input, ctx) => { const sv = optStr(input.severity); return { result: await ctx.service.sharedFeedbackRecord({ agent: optStr(input.agent) ?? \"\", decision: (optStr(input.decision) as \"rejected\" | \"approved\" | \"approved_with_feedback\") ?? \"approved\", reason: optStr(input.reason) ?? \"\", date: optStr(input.date), learning: optStr(input.learning), outcome: optStr(input.outcome), severity: sv === \"low\" || sv === \"medium\" || sv === \"high\" ? sv as \"low\" | \"medium\" | \"high\" : undefined, confidence: optNum(input.confidence), workflow: optStr(input.workflow), tags: optStrArr(input.tags), evidenceWindowStart: optStr(input.evidenceWindowStart), evidenceWindowEnd: optStr(input.evidenceWindowEnd), refs: optStrArr(input.refs) }) }; } });\ndefineOperation({ name: \"shared_priorities_append\", description: \"Append priorities.\", schema: strictSchema({ agentId: S.str, text: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedPrioritiesAppend({ agentId: optStr(input.agentId) ?? \"\", text: optStr(input.text) ?? \"\" }) }) });\ndefineOperation({ name: \"shared_context_cross_signals_run\", description: \"Run cross signals.\", schema: strictSchema({ date: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedContextCrossSignalsRun({ date: optStr(input.date) }) }) });\ndefineOperation({ name: \"shared_context_curate_daily\", description: \"Curate daily.\", schema: strictSchema({ date: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedContextCurateDaily({ date: optStr(input.date) }) }) });\ndefineOperation({ name: \"compounding_weekly_synthesize\", description: \"Weekly synthesize.\", schema: strictSchema({ weekId: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.compoundingWeeklySynthesize({ weekId: optStr(input.weekId) }) }) });\ndefineOperation({ name: \"compounding_promote_candidate\", description: \"Promote candidate.\", schema: strictSchema({ weekId: S.str, candidateId: S.str, dryRun: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.compoundingPromoteCandidate({ weekId: optStr(input.weekId) ?? \"\", candidateId: optStr(input.candidateId) ?? \"\", dryRun: input.dryRun === true }) }) });\ndefineOperation({ name: \"compression_guidelines_optimize\", description: \"Optimize guidelines.\", schema: strictSchema({ dryRun: S.bool, eventLimit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.compressionGuidelinesOptimize({ dryRun: input.dryRun === true, eventLimit: optNum(input.eventLimit) }) }) });\ndefineOperation({ name: \"compression_guidelines_activate\", description: \"Activate guidelines.\", schema: strictSchema({ expectedContentHash: S.str, expectedGuidelineVersion: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.compressionGuidelinesActivate({ expectedContentHash: optStr(input.expectedContentHash), expectedGuidelineVersion: optNum(input.expectedGuidelineVersion) }) }) });\n\n// === MEMORY DEBUG/GRAPH/FEEDBACK ===\ndefineOperation({ name: \"memory_profile\", description: \"Memory profile.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryProfile(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_entities_list\", description: \"List entities.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryEntitiesList(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_questions\", description: \"Memory questions.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryQuestions(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_last_recall\", description: \"Last recall.\", schema: strictSchema({ sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.lastRecallSnapshot(optStr(input.sessionKey)) }) });\ndefineOperation({ name: \"memory_intent_debug\", description: \"Debug intent.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.intentDebug(optStr(input.namespace)) }) });\ndefineOperation({ name: \"memory_qmd_debug\", description: \"Debug QMD.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.qmdDebug(optStr(input.namespace)) }) });\ndefineOperation({ name: \"memory_graph_explain\", description: \"Explain graph.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.graphExplainLastRecall(optStr(input.namespace)) }) });\ndefineOperation({ name: \"graph_snapshot\", description: \"Graph snapshot.\", schema: strictSchema({ namespace: S.str, limit: S.num, since: S.str, focusNodeId: S.str, categories: S.strArr }), handler: async (input, ctx) => ({ result: await ctx.service.graphSnapshot({ namespace: optStr(input.namespace), limit: optNum(input.limit), since: optStr(input.since), focusNodeId: optStr(input.focusNodeId), categories: optStrArr(input.categories) }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_feedback\", description: \"Record feedback.\", schema: strictSchema({ memoryId: S.str, vote: S.str, note: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryFeedback({ memoryId: optStr(input.memoryId) ?? \"\", vote: optStr(input.vote) === \"down\" ? \"down\" : \"up\", note: optStr(input.note) }) }) });\ndefineOperation({ name: \"memory_promote\", description: \"Promote memory.\", schema: strictSchema({ memoryId: S.str, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryPromote({ memoryId: optStr(input.memoryId) ?? \"\", namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"memory_outcome\", description: \"Record outcome.\", schema: strictSchema({ memoryId: S.str, outcome: S.str, namespace: S.str, sessionKey: S.str, timestamp: S.str }), handler: async (input, ctx) => { const o = optStr(input.outcome); if (o !== \"success\" && o !== \"failure\") throw new EngramAccessInputError(\"memory_outcome: outcome must be \\\"success\\\" or \\\"failure\\\"; got \" + JSON.stringify(o)); return { result: await ctx.service.memoryOutcome({ memoryId: optStr(input.memoryId) ?? \"\", outcome: o, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), timestamp: optStr(input.timestamp), principal: ctx.authenticatedPrincipal }) }; } });\ndefineOperation({ name: \"memory_action_apply\", description: \"Apply action.\", schema: strictSchema({ action: S.str, outcome: S.str, reason: S.str, memoryId: S.str, namespace: S.str, sessionKey: S.str, content: S.str, category: S.str, linkTargetId: S.str, linkType: S.str, linkStrength: S.num, artifactType: S.str, execute: S.bool, sourcePrompt: S.str, dryRun: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.memoryActionApply({ action: optStr(input.action) ?? \"\", outcome: optStr(input.outcome), reason: optStr(input.reason), memoryId: optStr(input.memoryId) ?? \"\", namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), content: optStr(input.content), category: optStr(input.category), linkTargetId: optStr(input.linkTargetId), linkType: optStr(input.linkType), linkStrength: optNum(input.linkStrength), artifactType: optStr(input.artifactType), execute: optBool(input.execute), sourcePrompt: optStr(input.sourcePrompt), dryRun: input.dryRun === true, principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"context_checkpoint\", description: \"Context checkpoint.\", schema: strictSchema({ sessionKey: S.str, context: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.contextCheckpoint({ sessionKey: optStr(input.sessionKey) ?? \"\", context: optStr(input.context) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"briefing\", description: \"Daily briefing.\", schema: strictSchema({ since: S.str, focus: S.str, namespace: S.str, format: S.str, maxFollowups: S.num }), handler: async (input, ctx) => { const rf = optStr(input.format); const fe = validateBriefingFormat(rf); if (fe) throw new EngramAccessInputError(fe); return { result: await ctx.service.briefing({ since: optStr(input.since), focus: optStr(input.focus), namespace: optStr(input.namespace), format: rf as \"json\" | \"markdown\" | undefined, maxFollowups: optNum(input.maxFollowups), principal: ctx.authenticatedPrincipal }) }; } });\n\n// === CONTRADICTION/REVIEW ===\ndefineOperation({ name: \"review_list\", description: \"List review pairs.\", schema: strictSchema({ filter: S.str, namespace: S.str, limit: S.num }),\n handler: async (input, ctx) => {\n const VF = new Set([\"all\", \"unresolved\", \"contradicts\", \"independent\", \"duplicates\", \"needs-user\"]);\n const rf = optStr(input.filter) ?? \"unresolved\";\n if (!VF.has(rf)) throw new EngramAccessInputError(\"Invalid filter '\" + rf + \"'. Valid: \" + [...VF].join(\", \"));\n const ns = optStr(input.namespace);\n const resolved = await ctx.service.getReadableStorageForNamespace(ns, ctx.authenticatedPrincipal);\n const rn = ctx.service.configRef.namespacesEnabled ? resolved.namespace : undefined;\n const iun = Boolean(rn && isDefaultReviewNamespace(ctx.service.configRef.defaultNamespace, ns, rn));\n return { result: await listPairs(ctx.service.memoryDir, { filter: rf as \"all\" | \"unresolved\" | \"contradicts\" | \"independent\" | \"duplicates\" | \"needs-user\", namespace: rn, includeUnscopedForNamespace: iun, limit: optNum(input.limit) ?? 50 }) };\n },\n});\ndefineOperation({ name: \"review_resolve\", description: \"Resolve pair.\", schema: strictSchema({ pairId: S.str, verb: S.str, mergedMemoryId: S.str, mergedContent: S.str }),\n handler: async (input, ctx) => {\n const pid = defStr(input.pairId, \"\"); const vb = defStr(input.verb, \"\");\n if (!pid) throw new EngramAccessInputError(\"pairId is required\");\n if (!vb) throw new EngramAccessInputError(\"verb is required\");\n if (!isValidResolutionVerb(vb)) throw new EngramAccessInputError(\"Invalid verb: \" + vb);\n return { result: await executeResolution(ctx.service.memoryDir, ctx.service.storageRef, pid, vb, { mergedMemoryId: optStr(input.mergedMemoryId), mergedContent: optStr(input.mergedContent), storageForNamespace: async (namespace) => { const r = await ctx.service.getWritableStorageForNamespace(namespace, ctx.authenticatedPrincipal); return r.storage; }, onMergedMemoryWritten: () => {} }) };\n },\n});\ndefineOperation({ name: \"contradiction_scan_run\", description: \"Run scan.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await runContradictionScan({ storage: ctx.service.storageRef, config: ctx.service.configRef, memoryDir: ctx.service.memoryDir, embeddingLookupFactory: ctx.service.embeddingLookupFactoryRef, storageForNamespace: (ns) => ctx.service.getWritableStorageForNamespace(ns ?? undefined, ctx.authenticatedPrincipal), localLlm: ctx.service.localLlmRef, fallbackLlm: ctx.service.fallbackLlmRef, namespace: optStr(input.namespace) }) }) });\ndefineOperation({ name: \"graph_edge_decay_run\", description: \"Run edge decay.\", schema: strictSchema({ dryRun: S.bool }), handler: async (input, ctx) => { const cfg = ctx.service.configRef; if (!cfg.graphEdgeDecayEnabled) return { result: { ranAt: new Date().toISOString(), disabled: true, reason: \"graphEdgeDecayEnabled is false\" } }; return { result: { results: await runGraphEdgeDecayMaintenanceAcrossNamespaces(ctx.service.memoryDir, { windowMs: cfg.graphEdgeDecayWindowMs, perWindow: cfg.graphEdgeDecayPerWindow, floor: cfg.graphEdgeDecayFloor, visibilityThreshold: cfg.graphEdgeDecayVisibilityThreshold, dryRun: input.dryRun === true, namespacesEnabled: cfg.namespacesEnabled === true, defaultNamespace: cfg.defaultNamespace }) } }; } });\n\n// === SUMMARIZE/PROFILING/PEERS/CONSOLE/DREAMS ===\ndefineOperation({ name: \"memory_summarize_hourly\", description: \"Hourly summarize.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.memorySummarizeHourly() }) });\ndefineOperation({ name: \"conversation_index_update\", description: \"Update conv index.\", schema: strictSchema({ sessionKey: S.str, hours: S.num, embed: S.bool }), handler: async (input, ctx) => { if (input.sessionKey !== undefined && typeof input.sessionKey !== \"string\") throw new EngramAccessInputError(\"sessionKey must be a string when provided\"); return { result: await ctx.service.conversationIndexUpdate({ sessionKey: optStr(input.sessionKey), hours: optNum(input.hours), embed: optBool(input.embed) }) }; } });\ndefineOperation({ name: \"profiling_report\", description: \"Profiling report.\", schema: strictSchema({ format: S.str, limit: S.num }), handler: async (input, ctx) => { if (input.format !== undefined && typeof input.format !== \"string\") throw new EngramAccessInputError(\"format must be a string when provided\"); if (input.limit !== undefined && typeof input.limit !== \"number\") throw new EngramAccessInputError(\"limit must be a number when provided\"); return { result: await ctx.service.profilingReport({ format: optStr(input.format), limit: optNum(input.limit) }) }; } });\ndefineOperation({ name: \"live_connectors_run\", description: \"Run connectors.\", schema: strictSchema({ force: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.liveConnectorsRun({ authenticatedPrincipal: ctx.authenticatedPrincipal, force: input.force === true }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"peer_list\", description: \"List peers.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.peerList() }) });\ndefineOperation({ name: \"peer_get\", description: \"Get peer.\", schema: strictSchema({ id: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_get: id is required\"); return { result: await ctx.service.peerGet(id) }; } });\ndefineOperation({ name: \"peer_set\", description: \"Set peer.\", schema: strictSchema({ id: S.str, kind: S.str, displayName: S.str, notes: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_set: id is required\"); if (input.kind !== undefined && typeof input.kind !== \"string\") throw new EngramAccessInputError(\"peer_set: kind must be a string when provided\"); if (input.displayName !== undefined && typeof input.displayName !== \"string\") throw new EngramAccessInputError(\"peer_set: displayName must be a string when provided\"); if (input.notes !== undefined && typeof input.notes !== \"string\") throw new EngramAccessInputError(\"peer_set: notes must be a string when provided\"); return { result: await ctx.service.peerSet({ id, kind: optStr(input.kind), displayName: optStr(input.displayName), notes: optStr(input.notes) }) }; } });\ndefineOperation({ name: \"peer_delete\", description: \"Delete peer.\", schema: strictSchema({ id: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_delete: id is required\"); return { result: await ctx.service.peerDelete(id) }; } });\ndefineOperation({ name: \"peer_profile_get\", description: \"Get peer profile.\", schema: strictSchema({ id: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_profile_get: id is required\"); return { result: await ctx.service.peerProfileGet(id) }; } });\ndefineOperation({ name: \"peer_forget\", description: \"Forget peer.\", schema: strictSchema({ id: S.str, confirm: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_forget: id is required\"); const c = optStr(input.confirm) ?? \"\"; if (c !== \"yes\") throw new EngramAccessInputError(\"peer_forget: confirm must be 'yes' to prevent accidental data loss\"); return { result: await ctx.service.peerForget(id, { confirm: \"yes\" }) }; } });\ndefineOperation({ name: \"console_state\", description: \"Console state.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.consoleState(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"dreams_status\", description: \"Dreams status.\", schema: strictSchema({ windowHours: S.num, namespace: S.str }), handler: async (input, ctx) => { let wh = 24; try { wh = normalizeDreamsStatusWindowHours(input.windowHours); } catch { throw new EngramAccessInputError(\"dreams_status: windowHours must be a positive integer. Got: \" + String(input.windowHours)); } return { result: await ctx.service.dreamsStatus({ windowHours: wh, namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }; } });\ndefineOperation({ name: \"dreams_run\", description: \"Run dreams.\", schema: strictSchema({ phase: S.str, dryRun: S.bool, namespace: S.str }), handler: async (input, ctx) => { const VP = [\"lightSleep\", \"rem\", \"deepSleep\"]; const ph = optStr(input.phase) ?? \"\"; if (!ph || !VP.includes(ph)) throw new EngramAccessInputError(\"dreams_run: phase must be one of: \" + VP.join(\", \")); if (input.dryRun !== undefined && typeof input.dryRun !== \"boolean\") throw new EngramAccessInputError(\"dreams_run: dryRun must be boolean\"); return { result: await ctx.service.dreamsRun({ phase: ph as DreamsPhase, dryRun: input.dryRun === true, namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }; } });\n\ndefineOperation({ name: \"correction_pending\", description: \"List pending corrections (HTTP GET).\", schema: strictSchema({ namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.correctionListPending({ namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), principal: ctx.authenticatedPrincipal }) }) });\n\n// === HTTP-ONLY ===\ndefineOperation({ name: \"offline_sync_snapshot\", description: \"Offline sync snapshot.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.offlineSyncSnapshot() }) });\ndefineOperation({ name: \"offline_sync_files\", description: \"Offline sync files.\", schema: strictSchema({ paths: S.strArr, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncFiles({ paths: optStrArr(input.paths) ?? [], namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"offline_sync_file_content\", description: \"Read file content.\", schema: strictSchema({ path: S.str, namespace: S.str, offset: S.num, length: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncFileContent({ path: optStr(input.path) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, offset: optNum(input.offset), length: optNum(input.length) }) }) });\ndefineOperation({ name: \"offline_sync_apply_file_content\", description: \"Apply file content.\", schema: strictSchema({ sourceId: S.str, path: S.str, sha256: S.str, bytes: S.num, mtimeMs: S.num, offset: S.num, baseSha256: S.str, content: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncApplyFileContent({ sourceId: optStr(input.sourceId) ?? \"\", path: optStr(input.path) ?? \"\", sha256: optStr(input.sha256) ?? \"\", bytes: optNum(input.bytes) ?? 0, mtimeMs: optNum(input.mtimeMs) ?? 0, offset: optNum(input.offset), baseSha256: optStr(input.baseSha256), content: Buffer.from(defStr(input.content, \"\"), \"base64\"), namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"offline_sync_apply\", description: \"Apply sync.\", schema: strictSchema({ changeset: z.unknown().optional(), namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncApply({ changeset: input.changeset, namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"lcm_status\", description: \"LCM status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.lcmStatus() }) });\ndefineOperation({ name: \"memory_list\", description: \"List memories.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.memoryBrowse() }) });\ndefineOperation({ name: \"entity_list\", description: \"List entities.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.entityList() }) });\ndefineOperation({ name: \"maintenance_status\", description: \"Maintenance status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.maintenance() }) });\ndefineOperation({ name: \"quality_status\", description: \"Quality status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.quality() }) });\ndefineOperation({ name: \"trust_zones_status\", description: \"Trust-zone status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.trustZoneStatus() }) });\ndefineOperation({ name: \"trust_zones_records\", description: \"Browse trust-zone records.\", schema: strictSchema({ namespace: S.str, limit: S.num, offset: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.trustZoneBrowse({ namespace: optStr(input.namespace), limit: optNum(input.limit), offset: optNum(input.offset) }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"review_disposition\", description: \"Review disposition.\", schema: strictSchema({ memoryId: S.str, status: S.str, reasonCode: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.reviewDisposition({ memoryId: optStr(input.memoryId) ?? \"\", status: (optStr(input.status) ?? \"archived\") as never, reasonCode: optStr(input.reasonCode) ?? \"\", namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"trust_zones_promote\", description: \"Promote trust-zone.\", schema: strictSchema({ recordId: S.str, targetZone: S.str, promotionReason: S.str, dryRun: S.bool, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.trustZonePromote({ recordId: optStr(input.recordId) ?? \"\", targetZone: (optStr(input.targetZone) ?? \"working\") as never, promotionReason: optStr(input.promotionReason) ?? \"\", dryRun: input.dryRun === true, namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"trust_zones_demo_seed\", description: \"Demo seed.\", schema: strictSchema({ scenario: S.str, dryRun: S.bool, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.trustZoneDemoSeed({ scenario: optStr(input.scenario), dryRun: input.dryRun === true, namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"citations_observed\", description: \"Record citations.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });\ndefineOperation({ name: \"contradiction_detail\", description: \"Contradiction detail.\", schema: strictSchema({ id: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await listPairs(ctx.service.memoryDir, { filter: \"all\" as const, namespace: optStr(input.namespace), includeUnscopedForNamespace: false, limit: 1 }) }) });\ndefineOperation({ name: \"offline_sync_snapshot_stream\", description: \"SSE stream.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.offlineSyncSnapshotStream() }) });\ndefineOperation({ name: \"graph_events\", description: \"SSE graph events.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: \"sse\" } }) });\ndefineOperation({ name: \"chat_message\", description: \"Chat message.\", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });\ndefineOperation({ name: \"chat_events\", description: \"SSE chat events.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: \"sse\" } }) });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,kBAAkB;AAC3B,SAAS,SAAS;AAuBlB,SAAS,WAAW,MAAwB;AAC1C,MAAI,SAAS,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,GAAG;AACrE,UAAM,MAAM;AACZ,UAAM,UAA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,SAAS,OAAO,IAAI,UAAU,EAAE,QAAQ,EAAE,QAAQ,MAAM,EAAE,GAAG,CAAC;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-TBBDFYXW.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4R3CGCI5.js";
|
|
7
7
|
import {
|
|
8
8
|
assertPathInsideRoot
|
|
9
9
|
} from "./chunk-5GPPACXK.js";
|
|
@@ -751,4 +751,4 @@ export {
|
|
|
751
751
|
listMemoryGovernanceRuns,
|
|
752
752
|
readMemoryGovernanceRunArtifact
|
|
753
753
|
};
|
|
754
|
-
//# sourceMappingURL=chunk-
|
|
754
|
+
//# sourceMappingURL=chunk-WAFDHKES.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultNamespaceRoot,
|
|
3
3
|
resolveNamespaceStorageRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SC2YAWRF.js";
|
|
5
5
|
import {
|
|
6
6
|
getConfiguredNamespaces
|
|
7
7
|
} from "./chunk-J6BH2OBA.js";
|
|
@@ -1946,4 +1946,4 @@ export {
|
|
|
1946
1946
|
runNamespaceMaintenancePlan,
|
|
1947
1947
|
runNamespaceMaintenanceBatchPlan
|
|
1948
1948
|
};
|
|
1949
|
-
//# sourceMappingURL=chunk-
|
|
1949
|
+
//# sourceMappingURL=chunk-WM7DNKBD.js.map
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "./chunk-PZ5AY32C.js";
|
|
2
|
-
|
|
3
1
|
// src/maintenance/dreams-ledger.ts
|
|
4
2
|
import path from "path";
|
|
5
3
|
import { appendFile, lstat, mkdir, readdir, readFile } from "fs/promises";
|
|
@@ -274,14 +272,15 @@ async function listMemoryFiles(memoryDir) {
|
|
|
274
272
|
await walk(memoryDir);
|
|
275
273
|
return out;
|
|
276
274
|
}
|
|
275
|
+
|
|
277
276
|
export {
|
|
278
|
-
appendDreamsLedgerEntry,
|
|
279
277
|
dreamsLedgerPath,
|
|
280
|
-
|
|
281
|
-
normalizeDreamsStatusWindowHours,
|
|
278
|
+
appendDreamsLedgerEntry,
|
|
282
279
|
readDreamsLedgerEntries,
|
|
280
|
+
normalizeDreamsStatusWindowHours,
|
|
281
|
+
getDreamsStatus,
|
|
283
282
|
recordDreamsPhaseRun,
|
|
284
283
|
runDreamsPhase,
|
|
285
284
|
summarizeGovernanceResultForDreams
|
|
286
285
|
};
|
|
287
|
-
//# sourceMappingURL=
|
|
286
|
+
//# sourceMappingURL=chunk-YF6FMLBT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/maintenance/dreams-ledger.ts"],"sourcesContent":["/**\n * dreams-ledger.ts — per-phase telemetry for the Dreams consolidation pipeline.\n *\n * Every scheduled or manual phase run appends one JSONL entry to\n * <memoryDir>/state/dreams-ledger.jsonl\n *\n * The entry records which phase ran, how long it took, and a small\n * itemsProcessed counter so `remnic dreams status` can aggregate the last\n * 24-hour window without scanning the full memory corpus.\n *\n * This module is intentionally side-effect-free on import (no fs calls at\n * module load time) so tests can import it without touching the filesystem.\n */\n\nimport path from \"node:path\";\nimport { appendFile, lstat, mkdir, readdir, readFile } from \"node:fs/promises\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** The three named phases of the Dreams consolidation pipeline. */\nexport type DreamsPhase = \"lightSleep\" | \"rem\" | \"deepSleep\";\n\n/**\n * One entry written to the dreams ledger for every phase run.\n * Older entries that predate this field simply won't have it (no backfill).\n */\nexport interface DreamsLedgerEntry {\n /** Schema version — always 1 for entries written by this module. */\n schemaVersion: 1;\n /** ISO-8601 timestamp when the phase run started. */\n startedAt: string;\n /** ISO-8601 timestamp when the phase run completed. */\n completedAt: string;\n /** Wall-clock duration in milliseconds. */\n durationMs: number;\n /**\n * Which Dreams phase this entry represents.\n * - `lightSleep` — recent activity scoring + clustering\n * - `rem` — cross-session synthesis, supersession, consolidation\n * - `deepSleep` — tier migration, page-version snapshots, archive\n */\n phase: DreamsPhase;\n /** How many memory items were evaluated (scored / clustered / migrated). */\n itemsProcessed: number;\n /** Whether this was a dry-run (no writes committed). */\n dryRun: boolean;\n /**\n * How the phase was triggered.\n * - `scheduled` — invoked by the governance cron or orchestrator maintenance pass\n * - `manual` — invoked via `remnic dreams run`\n */\n trigger: \"scheduled\" | \"manual\";\n /** Free-form notes for debugging (optional, never required). */\n notes?: string;\n}\n\n/** Aggregated stats for a single phase over a time window. */\nexport interface DreamsPhaseStatus {\n phase: DreamsPhase;\n /** Number of phase runs in the window. */\n runCount: number;\n /** Total wall-clock milliseconds across all runs in the window. */\n totalDurationMs: number;\n /** Total items processed across all runs in the window. */\n totalItemsProcessed: number;\n /** ISO-8601 timestamp of the most recent completed run, or null if none. */\n lastRunAt: string | null;\n /** Duration of the most recent run in ms, or null if none. */\n lastDurationMs: number | null;\n}\n\n/** Shape returned by `getDreamsStatus` — the canonical telemetry response. */\nexport interface DreamsStatusResult {\n /** ISO-8601 start of the query window (inclusive). */\n windowStart: string;\n /** ISO-8601 end of the query window (exclusive). */\n windowEnd: string;\n /** Per-phase summaries, always present for all three phases. */\n phases: {\n lightSleep: DreamsPhaseStatus;\n rem: DreamsPhaseStatus;\n deepSleep: DreamsPhaseStatus;\n };\n}\n\n// ── Path helpers ──────────────────────────────────────────────────────────────\n\nexport function dreamsLedgerPath(memoryDir: string): string {\n return path.join(memoryDir, \"state\", \"dreams-ledger.jsonl\");\n}\n\n// ── Writer ────────────────────────────────────────────────────────────────────\n\n/**\n * Append a single entry to the dreams ledger.\n * Creates the file (and its parent directory) if needed.\n * Uses `appendFile` (O_APPEND) so concurrent callers never overwrite each other.\n */\nexport async function appendDreamsLedgerEntry(\n memoryDir: string,\n entry: DreamsLedgerEntry,\n): Promise<void> {\n const ledgerPath = dreamsLedgerPath(memoryDir);\n await mkdir(path.dirname(ledgerPath), { recursive: true });\n await appendFile(ledgerPath, JSON.stringify(entry) + \"\\n\", \"utf-8\");\n}\n\n// ── Reader ────────────────────────────────────────────────────────────────────\n\n/**\n * Parse all valid `DreamsLedgerEntry` rows from the ledger file.\n * Malformed lines are silently skipped (resilience over strictness for telemetry).\n */\nexport async function readDreamsLedgerEntries(memoryDir: string): Promise<DreamsLedgerEntry[]> {\n const ledgerPath = dreamsLedgerPath(memoryDir);\n let raw: string;\n try {\n raw = await readFile(ledgerPath, \"utf-8\");\n } catch (err) {\n const code = (err as NodeJS.ErrnoException).code;\n if (code === \"ENOENT\") return [];\n throw err;\n }\n\n const entries: DreamsLedgerEntry[] = [];\n for (const line of raw.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n try {\n const parsed = JSON.parse(trimmed) as Partial<DreamsLedgerEntry>;\n if (typeof parsed !== \"object\" || parsed === null) continue;\n if (\n typeof parsed.phase === \"string\" &&\n (parsed.phase === \"lightSleep\" || parsed.phase === \"rem\" || parsed.phase === \"deepSleep\") &&\n typeof parsed.startedAt === \"string\" &&\n typeof parsed.completedAt === \"string\" &&\n typeof parsed.durationMs === \"number\" &&\n typeof parsed.itemsProcessed === \"number\"\n ) {\n entries.push({\n schemaVersion: 1,\n startedAt: parsed.startedAt,\n completedAt: parsed.completedAt,\n durationMs: parsed.durationMs,\n phase: parsed.phase,\n itemsProcessed: parsed.itemsProcessed,\n dryRun: parsed.dryRun === true,\n trigger: parsed.trigger === \"manual\" ? \"manual\" : \"scheduled\",\n notes: typeof parsed.notes === \"string\" ? parsed.notes : undefined,\n });\n }\n } catch {\n // Malformed line — skip.\n }\n }\n return entries;\n}\n\n// ── Aggregator ────────────────────────────────────────────────────────────────\n\nconst ALL_PHASES: DreamsPhase[] = [\"lightSleep\", \"rem\", \"deepSleep\"];\nconst MAX_WINDOW_HOURS = 24 * 365 * 100;\n\nexport function normalizeDreamsStatusWindowHours(value: unknown, fallback = 24): number {\n const raw = value === undefined || value === null ? fallback : value;\n if (\n typeof raw !== \"number\" ||\n !Number.isFinite(raw) ||\n !Number.isInteger(raw) ||\n raw < 1 ||\n raw > MAX_WINDOW_HOURS\n ) {\n throw new RangeError(`windowHours must be a positive integer no greater than ${MAX_WINDOW_HOURS}`);\n }\n return raw;\n}\n\n/**\n * Build per-phase 24-hour summary.\n *\n * @param memoryDir The memory directory (parent of `state/`).\n * @param windowHours How many hours to look back (default 24).\n * @param now Reference time (default `new Date()`).\n */\nexport async function getDreamsStatus(\n memoryDir: string,\n windowHours = 24,\n now: Date = new Date(),\n): Promise<DreamsStatusResult> {\n const boundedWindowHours = normalizeDreamsStatusWindowHours(windowHours);\n const nowMs = now.getTime();\n if (!Number.isFinite(nowMs)) {\n throw new RangeError(\"now must be a valid Date\");\n }\n const windowMs = boundedWindowHours * 60 * 60 * 1000;\n const windowStart = new Date(nowMs - windowMs);\n const windowEnd = now;\n if (!Number.isFinite(windowStart.getTime())) {\n throw new RangeError(\"windowHours produces an invalid status window\");\n }\n\n const entries = await readDreamsLedgerEntries(memoryDir);\n\n // Filter to entries within the window based on completedAt.\n const windowEntries = entries.filter((e) => {\n const ts = Date.parse(e.completedAt);\n return Number.isFinite(ts) && ts >= windowStart.getTime() && ts < windowEnd.getTime();\n });\n\n const statusMap = new Map<DreamsPhase, DreamsPhaseStatus>();\n for (const phase of ALL_PHASES) {\n statusMap.set(phase, {\n phase,\n runCount: 0,\n totalDurationMs: 0,\n totalItemsProcessed: 0,\n lastRunAt: null,\n lastDurationMs: null,\n });\n }\n\n for (const entry of windowEntries) {\n const status = statusMap.get(entry.phase);\n if (!status) continue;\n status.runCount += 1;\n status.totalDurationMs += entry.durationMs;\n status.totalItemsProcessed += entry.itemsProcessed;\n\n // Track the most recent run (by completedAt).\n if (\n status.lastRunAt === null ||\n Date.parse(entry.completedAt) > Date.parse(status.lastRunAt)\n ) {\n status.lastRunAt = entry.completedAt;\n status.lastDurationMs = entry.durationMs;\n }\n }\n\n return {\n windowStart: windowStart.toISOString(),\n windowEnd: windowEnd.toISOString(),\n phases: {\n lightSleep: statusMap.get(\"lightSleep\")!,\n rem: statusMap.get(\"rem\")!,\n deepSleep: statusMap.get(\"deepSleep\")!,\n },\n };\n}\n\n// ── Phase runner (PR 4/4: manual invocation) ─────────────────────────────────\n\nexport interface DreamsRunOptions {\n memoryDir: string;\n phase: DreamsPhase;\n dryRun?: boolean;\n}\n\n/** Public result shape — identical to what HTTP, MCP, and CLI surfaces expose. */\nexport interface DreamsRunResult {\n phase: DreamsPhase;\n dryRun: boolean;\n durationMs: number;\n itemsProcessed: number;\n notes?: string;\n}\n\n/** Internal result shape returned by `runDreamsPhase` — includes the raw ledger entry. */\nexport interface DreamsRunResultInternal extends DreamsRunResult {\n ledgerEntry?: DreamsLedgerEntry;\n}\n\nexport async function recordDreamsPhaseRun(options: {\n memoryDir: string;\n phase: DreamsPhase;\n trigger: DreamsLedgerEntry[\"trigger\"];\n dryRun?: boolean;\n itemsProcessed: number;\n notes?: string;\n startedAt?: string;\n completedAt?: string;\n}): Promise<DreamsLedgerEntry> {\n const startedAt = options.startedAt ?? new Date().toISOString();\n const completedAt = options.completedAt ?? new Date().toISOString();\n const durationMs = Math.max(0, Date.parse(completedAt) - Date.parse(startedAt));\n const ledgerEntry: DreamsLedgerEntry = {\n schemaVersion: 1,\n startedAt,\n completedAt,\n durationMs: Number.isFinite(durationMs) ? durationMs : 0,\n phase: options.phase,\n itemsProcessed: Math.max(0, Math.floor(options.itemsProcessed)),\n dryRun: options.dryRun === true,\n trigger: options.trigger,\n notes: options.notes,\n };\n if (!ledgerEntry.dryRun) {\n await appendDreamsLedgerEntry(options.memoryDir, ledgerEntry);\n }\n return ledgerEntry;\n}\n\n/**\n * Manually invoke a single Dreams phase pass.\n *\n * For light sleep and REM: runs a lightweight scan against the observation\n * ledger and returns a count of items that would be (or were, if not dry-run)\n * processed. The actual heavy consolidation is long-running and orchestrator-\n * bound; the manual surface delegates to existing ledger utilities and returns\n * the phase telemetry so callers get the same shape as a scheduled run.\n *\n * For deep sleep: delegates to the memory governance run (shadow mode when\n * dryRun is true, apply mode otherwise).\n */\nexport async function runDreamsPhase(\n options: DreamsRunOptions,\n governanceRunner?: (opts: { memoryDir: string; dryRun: boolean }) => Promise<{ scannedMemories: number; appliedActionCount: number; notes?: string }>,\n phaseRunner?: (opts: { memoryDir: string; phase: Exclude<DreamsPhase, \"deepSleep\"> }) => Promise<{ itemsProcessed: number; notes?: string }>,\n): Promise<DreamsRunResultInternal> {\n const { memoryDir, phase, dryRun = false } = options;\n const startedAt = new Date().toISOString();\n\n let itemsProcessed = 0;\n let notes: string | undefined;\n\n if (phase === \"lightSleep\") {\n // Dry-run light sleep counts recent observation entries as a preview.\n // Live runs must be backed by the orchestrator phase runner so the command\n // never reports success without executing the phase.\n if (!dryRun) {\n if (!phaseRunner) {\n throw new Error(\"light-sleep manual runs require a phase runner\");\n }\n const result = await phaseRunner({ memoryDir, phase });\n itemsProcessed = Math.max(0, Math.floor(result.itemsProcessed));\n notes = result.notes ?? `scored ${itemsProcessed} memories`;\n } else {\n // Light sleep: count observation ledger entries from the last 24h as a\n // proxy for \"items scored\". The live value-scoring pass runs through the\n // phase runner above.\n try {\n const ledgerPath = path.join(memoryDir, \"state\", \"observation-ledger\", \"rebuilt-observations.jsonl\");\n let raw = \"\";\n try {\n raw = await readFile(ledgerPath, \"utf-8\");\n } catch {\n // No ledger yet — zero items.\n }\n const lines = raw.split(\"\\n\").filter((l) => l.trim().length > 0);\n const nowMs = Date.now();\n const cutoff = nowMs - 24 * 60 * 60 * 1000;\n itemsProcessed = lines.filter((line) => {\n try {\n const obj = JSON.parse(line) as {\n hour?: string;\n timestamp?: string;\n ts?: string;\n };\n const timestamp = typeof obj.hour === \"string\"\n ? obj.hour\n : typeof obj.ts === \"string\"\n ? obj.ts\n : typeof obj.timestamp === \"string\"\n ? obj.timestamp\n : null;\n if (!timestamp) return false;\n const ms = Date.parse(timestamp);\n return Number.isFinite(ms) && ms >= cutoff && ms < nowMs;\n } catch {\n return false;\n }\n }).length;\n notes = `dry-run: would score ${itemsProcessed} observation entries`;\n } catch (err) {\n throw new Error(`light-sleep scan failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n } else if (phase === \"rem\") {\n if (!dryRun) {\n if (!phaseRunner) {\n throw new Error(\"REM manual runs require a phase runner\");\n }\n const result = await phaseRunner({ memoryDir, phase });\n itemsProcessed = Math.max(0, Math.floor(result.itemsProcessed));\n notes = result.notes ?? `REM pass assessed ${itemsProcessed} memories`;\n } else {\n // REM dry-runs estimate candidates without synthesizing or archiving.\n try {\n const stateFilePath = path.join(memoryDir, \"state\", \"semantic-consolidation-last-run.json\");\n let lastRunAt: string | null = null;\n try {\n const stateRaw = await readFile(stateFilePath, \"utf-8\");\n const stateData = JSON.parse(stateRaw) as { lastRunAt?: string };\n lastRunAt = stateData.lastRunAt ?? null;\n } catch {\n // No state file — never run.\n }\n const memFiles = await listMemoryFiles(memoryDir);\n itemsProcessed = memFiles.length;\n notes = `dry-run: ${itemsProcessed} memories would enter REM consolidation pass${lastRunAt ? ` (last run: ${lastRunAt})` : \" (never run)\"}`;\n } catch (err) {\n throw new Error(`REM scan failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n } else {\n // deep sleep\n if (governanceRunner) {\n try {\n const result = await governanceRunner({ memoryDir, dryRun });\n itemsProcessed = result.scannedMemories;\n notes = result.notes ?? (dryRun ? `dry-run: ${result.appliedActionCount} actions proposed` : `${result.appliedActionCount} actions applied`);\n } catch (err) {\n throw new Error(`deep-sleep governance run failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n } else {\n // Fallback: count memory files.\n const memFiles = await listMemoryFiles(memoryDir);\n itemsProcessed = memFiles.length;\n notes = dryRun\n ? `dry-run: ${itemsProcessed} memories eligible for deep-sleep governance`\n : `assessed ${itemsProcessed} memories for deep-sleep governance`;\n }\n }\n\n const completedAt = new Date().toISOString();\n const durationMs = Math.max(0, Date.parse(completedAt) - Date.parse(startedAt));\n let ledgerEntry: DreamsLedgerEntry | undefined;\n try {\n ledgerEntry = await recordDreamsPhaseRun({\n memoryDir,\n startedAt,\n completedAt,\n phase,\n itemsProcessed,\n dryRun,\n trigger: \"manual\",\n notes,\n });\n } catch {\n // Telemetry is best-effort: the phase work has already completed.\n }\n\n return {\n phase,\n dryRun,\n durationMs: ledgerEntry?.durationMs ?? durationMs,\n itemsProcessed,\n notes,\n ledgerEntry,\n };\n}\n\n// ── Shared governance result mapping ──────────────────────────────────────────\n\nexport function summarizeGovernanceResultForDreams(\n govResult: {\n summary?: { scannedMemories?: number };\n proposedActions: unknown[];\n appliedActions: unknown[];\n reviewQueue: unknown[];\n },\n dryRun: boolean,\n): { scannedMemories: number; appliedActionCount: number; notes?: string } {\n const proposedCount = govResult.proposedActions.length;\n const appliedCount = govResult.appliedActions.length;\n const scannedCount =\n typeof govResult.summary?.scannedMemories === \"number\" &&\n Number.isFinite(govResult.summary.scannedMemories)\n ? Math.max(0, Math.floor(govResult.summary.scannedMemories))\n : govResult.reviewQueue.length;\n return {\n scannedMemories: scannedCount,\n appliedActionCount: appliedCount,\n notes: dryRun\n ? `shadow mode: ${proposedCount} actions proposed`\n : `applied ${appliedCount} actions`,\n };\n}\n\n// ── Internal helpers ──────────────────────────────────────────────────────────\n\nasync function listMemoryFiles(memoryDir: string): Promise<string[]> {\n const out: string[] = [];\n try {\n const root = await lstat(memoryDir);\n if (root.isSymbolicLink()) {\n throw new Error(`memoryDir must not be a symlink: ${memoryDir}`);\n }\n if (!root.isDirectory()) return out;\n } catch (err) {\n if (err instanceof Error && /must not be a symlink/.test(err.message)) {\n throw err;\n }\n return out;\n }\n\n async function walk(dir: string): Promise<void> {\n let entries: Array<{ name: string; isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }>;\n try {\n entries = (await readdir(dir, { withFileTypes: true })) as typeof entries;\n } catch {\n return;\n }\n for (const entry of entries) {\n if (entry.isSymbolicLink()) continue;\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n // Skip state/ and archive/ subdirs.\n if (\n entry.name === \"state\" ||\n entry.name === \"archive\" ||\n entry.name === \"namespaces\" ||\n entry.name === \".git\"\n ) continue;\n await walk(full);\n } else if (entry.isFile() && entry.name.endsWith(\".md\")) {\n out.push(full);\n }\n }\n }\n\n await walk(memoryDir);\n return out;\n}\n"],"mappings":";;;AAcA,OAAO,UAAU;AACjB,SAAS,YAAY,OAAO,OAAO,SAAS,gBAAgB;AAwErD,SAAS,iBAAiB,WAA2B;AAC1D,SAAO,KAAK,KAAK,WAAW,SAAS,qBAAqB;AAC5D;AASA,eAAsB,wBACpB,WACA,OACe;AACf,QAAM,aAAa,iBAAiB,SAAS;AAC7C,QAAM,MAAM,KAAK,QAAQ,UAAU,GAAG,EAAE,WAAW,KAAK,CAAC;AACzD,QAAM,WAAW,YAAY,KAAK,UAAU,KAAK,IAAI,MAAM,OAAO;AACpE;AAQA,eAAsB,wBAAwB,WAAiD;AAC7F,QAAM,aAAa,iBAAiB,SAAS;AAC7C,MAAI;AACJ,MAAI;AACF,UAAM,MAAM,SAAS,YAAY,OAAO;AAAA,EAC1C,SAAS,KAAK;AACZ,UAAM,OAAQ,IAA8B;AAC5C,QAAI,SAAS,SAAU,QAAO,CAAC;AAC/B,UAAM;AAAA,EACR;AAEA,QAAM,UAA+B,CAAC;AACtC,aAAW,QAAQ,IAAI,MAAM,IAAI,GAAG;AAClC,UAAM,UAAU,KAAK,KAAK;AAC1B,QAAI,CAAC,QAAS;AACd,QAAI;AACF,YAAM,SAAS,KAAK,MAAM,OAAO;AACjC,UAAI,OAAO,WAAW,YAAY,WAAW,KAAM;AACnD,UACE,OAAO,OAAO,UAAU,aACvB,OAAO,UAAU,gBAAgB,OAAO,UAAU,SAAS,OAAO,UAAU,gBAC7E,OAAO,OAAO,cAAc,YAC5B,OAAO,OAAO,gBAAgB,YAC9B,OAAO,OAAO,eAAe,YAC7B,OAAO,OAAO,mBAAmB,UACjC;AACA,gBAAQ,KAAK;AAAA,UACX,eAAe;AAAA,UACf,WA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BAAgB,WAAsC;AACnE,QAAM,MAAgB,CAAC;AACvB,MAAI;AACF,UAAM,OAAO,MAAM,MAAM,SAAS;AAClC,QAAI,KAAK,eAAe,GAAG;AACzB,YAAM,IAAI,MAAM,oCAAoC,SAAS,EAAE;AAAA,IACjE;AACA,QAAI,CAAC,KAAK,YAAY,EAAG,QAAO;AAAA,EAClC,SAAS,KAAK;AACZ,QAAI,eAAe,SAAS,wBAAwB,KAAK,IAAI,OAAO,GAAG;AACrE,YAAM;AAAA,IACR;AACA,WAAO;AAAA,EACT;AAEA,iBAAe,KAAK,KAA4B;AAC9C,QAAI;AACJ,QAAI;AACF,gBAAW,MAAM,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;AAAA,IACvD,QAAQ;AACN;AAAA,IACF;AACA,eAAW,SAAS,SAAS;AAC3B,UAAI,MAAM,eAAe,EAAG;AAC5B,YAAM,OAAO,KAAK,KAAK,KAAK,MAAM,IAAI;AACtC,UAAI,MAAM,YAAY,GAAG;AAEvB,YACE,MAAM,SAAS,WACf,MAAM,SAAS,aACf,MAAM,SAAS,gBACf,MAAM,SAAS,OACf;AACF,cAAM,KAAK,IAAI;AAAA,MACjB,WAAW,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,KAAK,GAAG;AACvD,YAAI,KAAK,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAEA,QAAM,KAAK,SAAS;AACpB,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/maintenance/dreams-ledger.ts"],"sourcesContent":["/**\n * dreams-ledger.ts — per-phase telemetry for the Dreams consolidation pipeline.\n *\n * Every scheduled or manual phase run appends one JSONL entry to\n * <memoryDir>/state/dreams-ledger.jsonl\n *\n * The entry records which phase ran, how long it took, and a small\n * itemsProcessed counter so `remnic dreams status` can aggregate the last\n * 24-hour window without scanning the full memory corpus.\n *\n * This module is intentionally side-effect-free on import (no fs calls at\n * module load time) so tests can import it without touching the filesystem.\n */\n\nimport path from \"node:path\";\nimport { appendFile, lstat, mkdir, readdir, readFile } from \"node:fs/promises\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** The three named phases of the Dreams consolidation pipeline. */\nexport type DreamsPhase = \"lightSleep\" | \"rem\" | \"deepSleep\";\n\n/**\n * One entry written to the dreams ledger for every phase run.\n * Older entries that predate this field simply won't have it (no backfill).\n */\nexport interface DreamsLedgerEntry {\n /** Schema version — always 1 for entries written by this module. */\n schemaVersion: 1;\n /** ISO-8601 timestamp when the phase run started. */\n startedAt: string;\n /** ISO-8601 timestamp when the phase run completed. */\n completedAt: string;\n /** Wall-clock duration in milliseconds. */\n durationMs: number;\n /**\n * Which Dreams phase this entry represents.\n * - `lightSleep` — recent activity scoring + clustering\n * - `rem` — cross-session synthesis, supersession, consolidation\n * - `deepSleep` — tier migration, page-version snapshots, archive\n */\n phase: DreamsPhase;\n /** How many memory items were evaluated (scored / clustered / migrated). */\n itemsProcessed: number;\n /** Whether this was a dry-run (no writes committed). */\n dryRun: boolean;\n /**\n * How the phase was triggered.\n * - `scheduled` — invoked by the governance cron or orchestrator maintenance pass\n * - `manual` — invoked via `remnic dreams run`\n */\n trigger: \"scheduled\" | \"manual\";\n /** Free-form notes for debugging (optional, never required). */\n notes?: string;\n}\n\n/** Aggregated stats for a single phase over a time window. */\nexport interface DreamsPhaseStatus {\n phase: DreamsPhase;\n /** Number of phase runs in the window. */\n runCount: number;\n /** Total wall-clock milliseconds across all runs in the window. */\n totalDurationMs: number;\n /** Total items processed across all runs in the window. */\n totalItemsProcessed: number;\n /** ISO-8601 timestamp of the most recent completed run, or null if none. */\n lastRunAt: string | null;\n /** Duration of the most recent run in ms, or null if none. */\n lastDurationMs: number | null;\n}\n\n/** Shape returned by `getDreamsStatus` — the canonical telemetry response. */\nexport interface DreamsStatusResult {\n /** ISO-8601 start of the query window (inclusive). */\n windowStart: string;\n /** ISO-8601 end of the query window (exclusive). */\n windowEnd: string;\n /** Per-phase summaries, always present for all three phases. */\n phases: {\n lightSleep: DreamsPhaseStatus;\n rem: DreamsPhaseStatus;\n deepSleep: DreamsPhaseStatus;\n };\n}\n\n// ── Path helpers ──────────────────────────────────────────────────────────────\n\nexport function dreamsLedgerPath(memoryDir: string): string {\n return path.join(memoryDir, \"state\", \"dreams-ledger.jsonl\");\n}\n\n// ── Writer ────────────────────────────────────────────────────────────────────\n\n/**\n * Append a single entry to the dreams ledger.\n * Creates the file (and its parent directory) if needed.\n * Uses `appendFile` (O_APPEND) so concurrent callers never overwrite each other.\n */\nexport async function appendDreamsLedgerEntry(\n memoryDir: string,\n entry: DreamsLedgerEntry,\n): Promise<void> {\n const ledgerPath = dreamsLedgerPath(memoryDir);\n await mkdir(path.dirname(ledgerPath), { recursive: true });\n await appendFile(ledgerPath, JSON.stringify(entry) + \"\\n\", \"utf-8\");\n}\n\n// ── Reader ────────────────────────────────────────────────────────────────────\n\n/**\n * Parse all valid `DreamsLedgerEntry` rows from the ledger file.\n * Malformed lines are silently skipped (resilience over strictness for telemetry).\n */\nexport async function readDreamsLedgerEntries(memoryDir: string): Promise<DreamsLedgerEntry[]> {\n const ledgerPath = dreamsLedgerPath(memoryDir);\n let raw: string;\n try {\n raw = await readFile(ledgerPath, \"utf-8\");\n } catch (err) {\n const code = (err as NodeJS.ErrnoException).code;\n if (code === \"ENOENT\") return [];\n throw err;\n }\n\n const entries: DreamsLedgerEntry[] = [];\n for (const line of raw.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n try {\n const parsed = JSON.parse(trimmed) as Partial<DreamsLedgerEntry>;\n if (typeof parsed !== \"object\" || parsed === null) continue;\n if (\n typeof parsed.phase === \"string\" &&\n (parsed.phase === \"lightSleep\" || parsed.phase === \"rem\" || parsed.phase === \"deepSleep\") &&\n typeof parsed.startedAt === \"string\" &&\n typeof parsed.completedAt === \"string\" &&\n typeof parsed.durationMs === \"number\" &&\n typeof parsed.itemsProcessed === \"number\"\n ) {\n entries.push({\n schemaVersion: 1,\n startedAt: parsed.startedAt,\n completedAt: parsed.completedAt,\n durationMs: parsed.durationMs,\n phase: parsed.phase,\n itemsProcessed: parsed.itemsProcessed,\n dryRun: parsed.dryRun === true,\n trigger: parsed.trigger === \"manual\" ? \"manual\" : \"scheduled\",\n notes: typeof parsed.notes === \"string\" ? parsed.notes : undefined,\n });\n }\n } catch {\n // Malformed line — skip.\n }\n }\n return entries;\n}\n\n// ── Aggregator ────────────────────────────────────────────────────────────────\n\nconst ALL_PHASES: DreamsPhase[] = [\"lightSleep\", \"rem\", \"deepSleep\"];\nconst MAX_WINDOW_HOURS = 24 * 365 * 100;\n\nexport function normalizeDreamsStatusWindowHours(value: unknown, fallback = 24): number {\n const raw = value === undefined || value === null ? fallback : value;\n if (\n typeof raw !== \"number\" ||\n !Number.isFinite(raw) ||\n !Number.isInteger(raw) ||\n raw < 1 ||\n raw > MAX_WINDOW_HOURS\n ) {\n throw new RangeError(`windowHours must be a positive integer no greater than ${MAX_WINDOW_HOURS}`);\n }\n return raw;\n}\n\n/**\n * Build per-phase 24-hour summary.\n *\n * @param memoryDir The memory directory (parent of `state/`).\n * @param windowHours How many hours to look back (default 24).\n * @param now Reference time (default `new Date()`).\n */\nexport async function getDreamsStatus(\n memoryDir: string,\n windowHours = 24,\n now: Date = new Date(),\n): Promise<DreamsStatusResult> {\n const boundedWindowHours = normalizeDreamsStatusWindowHours(windowHours);\n const nowMs = now.getTime();\n if (!Number.isFinite(nowMs)) {\n throw new RangeError(\"now must be a valid Date\");\n }\n const windowMs = boundedWindowHours * 60 * 60 * 1000;\n const windowStart = new Date(nowMs - windowMs);\n const windowEnd = now;\n if (!Number.isFinite(windowStart.getTime())) {\n throw new RangeError(\"windowHours produces an invalid status window\");\n }\n\n const entries = await readDreamsLedgerEntries(memoryDir);\n\n // Filter to entries within the window based on completedAt.\n const windowEntries = entries.filter((e) => {\n const ts = Date.parse(e.completedAt);\n return Number.isFinite(ts) && ts >= windowStart.getTime() && ts < windowEnd.getTime();\n });\n\n const statusMap = new Map<DreamsPhase, DreamsPhaseStatus>();\n for (const phase of ALL_PHASES) {\n statusMap.set(phase, {\n phase,\n runCount: 0,\n totalDurationMs: 0,\n totalItemsProcessed: 0,\n lastRunAt: null,\n lastDurationMs: null,\n });\n }\n\n for (const entry of windowEntries) {\n const status = statusMap.get(entry.phase);\n if (!status) continue;\n status.runCount += 1;\n status.totalDurationMs += entry.durationMs;\n status.totalItemsProcessed += entry.itemsProcessed;\n\n // Track the most recent run (by completedAt).\n if (\n status.lastRunAt === null ||\n Date.parse(entry.completedAt) > Date.parse(status.lastRunAt)\n ) {\n status.lastRunAt = entry.completedAt;\n status.lastDurationMs = entry.durationMs;\n }\n }\n\n return {\n windowStart: windowStart.toISOString(),\n windowEnd: windowEnd.toISOString(),\n phases: {\n lightSleep: statusMap.get(\"lightSleep\")!,\n rem: statusMap.get(\"rem\")!,\n deepSleep: statusMap.get(\"deepSleep\")!,\n },\n };\n}\n\n// ── Phase runner (PR 4/4: manual invocation) ─────────────────────────────────\n\nexport interface DreamsRunOptions {\n memoryDir: string;\n phase: DreamsPhase;\n dryRun?: boolean;\n}\n\n/** Public result shape — identical to what HTTP, MCP, and CLI surfaces expose. */\nexport interface DreamsRunResult {\n phase: DreamsPhase;\n dryRun: boolean;\n durationMs: number;\n itemsProcessed: number;\n notes?: string;\n}\n\n/** Internal result shape returned by `runDreamsPhase` — includes the raw ledger entry. */\nexport interface DreamsRunResultInternal extends DreamsRunResult {\n ledgerEntry?: DreamsLedgerEntry;\n}\n\nexport async function recordDreamsPhaseRun(options: {\n memoryDir: string;\n phase: DreamsPhase;\n trigger: DreamsLedgerEntry[\"trigger\"];\n dryRun?: boolean;\n itemsProcessed: number;\n notes?: string;\n startedAt?: string;\n completedAt?: string;\n}): Promise<DreamsLedgerEntry> {\n const startedAt = options.startedAt ?? new Date().toISOString();\n const completedAt = options.completedAt ?? new Date().toISOString();\n const durationMs = Math.max(0, Date.parse(completedAt) - Date.parse(startedAt));\n const ledgerEntry: DreamsLedgerEntry = {\n schemaVersion: 1,\n startedAt,\n completedAt,\n durationMs: Number.isFinite(durationMs) ? durationMs : 0,\n phase: options.phase,\n itemsProcessed: Math.max(0, Math.floor(options.itemsProcessed)),\n dryRun: options.dryRun === true,\n trigger: options.trigger,\n notes: options.notes,\n };\n if (!ledgerEntry.dryRun) {\n await appendDreamsLedgerEntry(options.memoryDir, ledgerEntry);\n }\n return ledgerEntry;\n}\n\n/**\n * Manually invoke a single Dreams phase pass.\n *\n * For light sleep and REM: runs a lightweight scan against the observation\n * ledger and returns a count of items that would be (or were, if not dry-run)\n * processed. The actual heavy consolidation is long-running and orchestrator-\n * bound; the manual surface delegates to existing ledger utilities and returns\n * the phase telemetry so callers get the same shape as a scheduled run.\n *\n * For deep sleep: delegates to the memory governance run (shadow mode when\n * dryRun is true, apply mode otherwise).\n */\nexport async function runDreamsPhase(\n options: DreamsRunOptions,\n governanceRunner?: (opts: { memoryDir: string; dryRun: boolean }) => Promise<{ scannedMemories: number; appliedActionCount: number; notes?: string }>,\n phaseRunner?: (opts: { memoryDir: string; phase: Exclude<DreamsPhase, \"deepSleep\"> }) => Promise<{ itemsProcessed: number; notes?: string }>,\n): Promise<DreamsRunResultInternal> {\n const { memoryDir, phase, dryRun = false } = options;\n const startedAt = new Date().toISOString();\n\n let itemsProcessed = 0;\n let notes: string | undefined;\n\n if (phase === \"lightSleep\") {\n // Dry-run light sleep counts recent observation entries as a preview.\n // Live runs must be backed by the orchestrator phase runner so the command\n // never reports success without executing the phase.\n if (!dryRun) {\n if (!phaseRunner) {\n throw new Error(\"light-sleep manual runs require a phase runner\");\n }\n const result = await phaseRunner({ memoryDir, phase });\n itemsProcessed = Math.max(0, Math.floor(result.itemsProcessed));\n notes = result.notes ?? `scored ${itemsProcessed} memories`;\n } else {\n // Light sleep: count observation ledger entries from the last 24h as a\n // proxy for \"items scored\". The live value-scoring pass runs through the\n // phase runner above.\n try {\n const ledgerPath = path.join(memoryDir, \"state\", \"observation-ledger\", \"rebuilt-observations.jsonl\");\n let raw = \"\";\n try {\n raw = await readFile(ledgerPath, \"utf-8\");\n } catch {\n // No ledger yet — zero items.\n }\n const lines = raw.split(\"\\n\").filter((l) => l.trim().length > 0);\n const nowMs = Date.now();\n const cutoff = nowMs - 24 * 60 * 60 * 1000;\n itemsProcessed = lines.filter((line) => {\n try {\n const obj = JSON.parse(line) as {\n hour?: string;\n timestamp?: string;\n ts?: string;\n };\n const timestamp = typeof obj.hour === \"string\"\n ? obj.hour\n : typeof obj.ts === \"string\"\n ? obj.ts\n : typeof obj.timestamp === \"string\"\n ? obj.timestamp\n : null;\n if (!timestamp) return false;\n const ms = Date.parse(timestamp);\n return Number.isFinite(ms) && ms >= cutoff && ms < nowMs;\n } catch {\n return false;\n }\n }).length;\n notes = `dry-run: would score ${itemsProcessed} observation entries`;\n } catch (err) {\n throw new Error(`light-sleep scan failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n } else if (phase === \"rem\") {\n if (!dryRun) {\n if (!phaseRunner) {\n throw new Error(\"REM manual runs require a phase runner\");\n }\n const result = await phaseRunner({ memoryDir, phase });\n itemsProcessed = Math.max(0, Math.floor(result.itemsProcessed));\n notes = result.notes ?? `REM pass assessed ${itemsProcessed} memories`;\n } else {\n // REM dry-runs estimate candidates without synthesizing or archiving.\n try {\n const stateFilePath = path.join(memoryDir, \"state\", \"semantic-consolidation-last-run.json\");\n let lastRunAt: string | null = null;\n try {\n const stateRaw = await readFile(stateFilePath, \"utf-8\");\n const stateData = JSON.parse(stateRaw) as { lastRunAt?: string };\n lastRunAt = stateData.lastRunAt ?? null;\n } catch {\n // No state file — never run.\n }\n const memFiles = await listMemoryFiles(memoryDir);\n itemsProcessed = memFiles.length;\n notes = `dry-run: ${itemsProcessed} memories would enter REM consolidation pass${lastRunAt ? ` (last run: ${lastRunAt})` : \" (never run)\"}`;\n } catch (err) {\n throw new Error(`REM scan failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n } else {\n // deep sleep\n if (governanceRunner) {\n try {\n const result = await governanceRunner({ memoryDir, dryRun });\n itemsProcessed = result.scannedMemories;\n notes = result.notes ?? (dryRun ? `dry-run: ${result.appliedActionCount} actions proposed` : `${result.appliedActionCount} actions applied`);\n } catch (err) {\n throw new Error(`deep-sleep governance run failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n } else {\n // Fallback: count memory files.\n const memFiles = await listMemoryFiles(memoryDir);\n itemsProcessed = memFiles.length;\n notes = dryRun\n ? `dry-run: ${itemsProcessed} memories eligible for deep-sleep governance`\n : `assessed ${itemsProcessed} memories for deep-sleep governance`;\n }\n }\n\n const completedAt = new Date().toISOString();\n const durationMs = Math.max(0, Date.parse(completedAt) - Date.parse(startedAt));\n let ledgerEntry: DreamsLedgerEntry | undefined;\n try {\n ledgerEntry = await recordDreamsPhaseRun({\n memoryDir,\n startedAt,\n completedAt,\n phase,\n itemsProcessed,\n dryRun,\n trigger: \"manual\",\n notes,\n });\n } catch {\n // Telemetry is best-effort: the phase work has already completed.\n }\n\n return {\n phase,\n dryRun,\n durationMs: ledgerEntry?.durationMs ?? durationMs,\n itemsProcessed,\n notes,\n ledgerEntry,\n };\n}\n\n// ── Shared governance result mapping ──────────────────────────────────────────\n\nexport function summarizeGovernanceResultForDreams(\n govResult: {\n summary?: { scannedMemories?: number };\n proposedActions: unknown[];\n appliedActions: unknown[];\n reviewQueue: unknown[];\n },\n dryRun: boolean,\n): { scannedMemories: number; appliedActionCount: number; notes?: string } {\n const proposedCount = govResult.proposedActions.length;\n const appliedCount = govResult.appliedActions.length;\n const scannedCount =\n typeof govResult.summary?.scannedMemories === \"number\" &&\n Number.isFinite(govResult.summary.scannedMemories)\n ? Math.max(0, Math.floor(govResult.summary.scannedMemories))\n : govResult.reviewQueue.length;\n return {\n scannedMemories: scannedCount,\n appliedActionCount: appliedCount,\n notes: dryRun\n ? `shadow mode: ${proposedCount} actions proposed`\n : `applied ${appliedCount} actions`,\n };\n}\n\n// ── Internal helpers ──────────────────────────────────────────────────────────\n\nasync function listMemoryFiles(memoryDir: string): Promise<string[]> {\n const out: string[] = [];\n try {\n const root = await lstat(memoryDir);\n if (root.isSymbolicLink()) {\n throw new Error(`memoryDir must not be a symlink: ${memoryDir}`);\n }\n if (!root.isDirectory()) return out;\n } catch (err) {\n if (err instanceof Error && /must not be a symlink/.test(err.message)) {\n throw err;\n }\n return out;\n }\n\n async function walk(dir: string): Promise<void> {\n let entries: Array<{ name: string; isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }>;\n try {\n entries = (await readdir(dir, { withFileTypes: true })) as typeof entries;\n } catch {\n return;\n }\n for (const entry of entries) {\n if (entry.isSymbolicLink()) continue;\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n // Skip state/ and archive/ subdirs.\n if (\n entry.name === \"state\" ||\n entry.name === \"archive\" ||\n entry.name === \"namespaces\" ||\n entry.name === \".git\"\n ) continue;\n await walk(full);\n } else if (entry.isFile() && entry.name.endsWith(\".md\")) {\n out.push(full);\n }\n }\n }\n\n await walk(memoryDir);\n return out;\n}\n"],"mappings":";AAcA,OAAO,UAAU;AACjB,SAAS,YAAY,OAAO,OAAO,SAAS,gBAAgB;AAwErD,SAAS,iBAAiB,WAA2B;AAC1D,SAAO,KAAK,KAAK,WAAW,SAAS,qBAAqB;AAC5D;AASA,eAAsB,wBACpB,WACA,OACe;AACf,QAAM,aAAa,iBAAiB,SAAS;AAC7C,QAAM,MAAM,KAAK,QAAQ,UAAU,GAAG,EAAE,WAAW,KAAK,CAAC;AACzD,QAAM,WAAW,YAAY,KAAK,UAAU,KAAK,IAAI,MAAM,OAAO;AACpE;AAQA,eAAsB,wBAAwB,WAAiD;AAC7F,QAAM,aAAa,iBAAiB,SAAS;AAC7C,MAAI;AACJ,MAAI;AACF,UAAM,MAAM,SAAS,YAAY,OAAO;AAAA,EAC1C,SAAS,KAAK;AACZ,UAAM,OAAQ,IAA8B;AAC5C,QAAI,SAAS,SAAU,QAAO,CAAC;AAC/B,UAAM;AAAA,EACR;AAEA,QAA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G;AACvD,YAAI,KAAK,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAEA,QAAM,KAAK,SAAS;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-UFS7OXGL.js";
|
|
5
5
|
import {
|
|
6
6
|
StorageManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4R3CGCI5.js";
|
|
8
8
|
import {
|
|
9
9
|
parseContinuityImprovementLoops
|
|
10
10
|
} from "./chunk-LDXUBPMO.js";
|
|
@@ -1261,4 +1261,4 @@ export {
|
|
|
1261
1261
|
defaultTierMigrationCycleBudget,
|
|
1262
1262
|
CompoundingEngine
|
|
1263
1263
|
};
|
|
1264
|
-
//# sourceMappingURL=chunk-
|
|
1264
|
+
//# sourceMappingURL=chunk-YQMPUYHE.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
compareEntityTimestamps,
|
|
6
6
|
normalizeEntityName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4R3CGCI5.js";
|
|
8
8
|
import {
|
|
9
9
|
sanitizeMemoryContent
|
|
10
10
|
} from "./chunk-5GKPFL3S.js";
|
|
@@ -679,4 +679,4 @@ export {
|
|
|
679
679
|
entityIndexVersion,
|
|
680
680
|
entityRecentTranscriptLookbackHours
|
|
681
681
|
};
|
|
682
|
-
//# sourceMappingURL=chunk-
|
|
682
|
+
//# sourceMappingURL=chunk-YUYPWJD3.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
enqueuePassiveCorrectionNotification
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4WZ3J7M6.js";
|
|
4
4
|
import {
|
|
5
5
|
stripAttributesSuffix
|
|
6
6
|
} from "./chunk-SVOZFLIQ.js";
|
|
@@ -1685,4 +1685,4 @@ export {
|
|
|
1685
1685
|
capturePassiveCorrections,
|
|
1686
1686
|
clusterByKey
|
|
1687
1687
|
};
|
|
1688
|
-
//# sourceMappingURL=chunk-
|
|
1688
|
+
//# sourceMappingURL=chunk-Z3FGC3QE.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-3UXOZBHV.js";
|
|
8
8
|
import {
|
|
9
9
|
StorageManager
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4R3CGCI5.js";
|
|
11
11
|
import {
|
|
12
12
|
isSafeRouteNamespace
|
|
13
13
|
} from "./chunk-U3PN77QT.js";
|
|
@@ -118,4 +118,4 @@ export {
|
|
|
118
118
|
runCodexMaterialize,
|
|
119
119
|
runPostConsolidationMaterialize
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
//# sourceMappingURL=chunk-ZK2L72VN.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseXrayFormat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6SQQOJ4U.js";
|
|
4
4
|
import {
|
|
5
5
|
RECALL_DISCLOSURE_LEVELS,
|
|
6
6
|
isRecallDisclosure
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7AG54AF3.js";
|
|
8
8
|
|
|
9
9
|
// src/recall-xray-cli.ts
|
|
10
10
|
function parseXrayDisclosureFlag(value) {
|
|
@@ -50,4 +50,4 @@ export {
|
|
|
50
50
|
parseXrayBudgetFlag,
|
|
51
51
|
parseXrayCliOptions
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-ZOHMPFOB.js.map
|
|
@@ -11,11 +11,9 @@ import {
|
|
|
11
11
|
decayEdgeConfidence,
|
|
12
12
|
readEdgeConfidence
|
|
13
13
|
} from "./chunk-2LSZVONP.js";
|
|
14
|
-
import "./chunk-DEUNUKTD.js";
|
|
15
14
|
import {
|
|
16
15
|
isSafeRouteNamespace
|
|
17
16
|
} from "./chunk-U3PN77QT.js";
|
|
18
|
-
import "./chunk-PZ5AY32C.js";
|
|
19
17
|
|
|
20
18
|
// src/maintenance/graph-edge-decay.ts
|
|
21
19
|
import {
|
|
@@ -196,12 +194,13 @@ async function runGraphEdgeDecayMaintenanceAcrossNamespaces(memoryDir, options)
|
|
|
196
194
|
}
|
|
197
195
|
return results;
|
|
198
196
|
}
|
|
197
|
+
|
|
199
198
|
export {
|
|
200
199
|
DEFAULT_VISIBILITY_THRESHOLD,
|
|
201
|
-
discoverGraphNamespaceRoots,
|
|
202
200
|
graphEdgeDecayStatusPath,
|
|
203
|
-
readGraphEdgeDecayStatus,
|
|
204
201
|
runGraphEdgeDecayMaintenance,
|
|
202
|
+
readGraphEdgeDecayStatus,
|
|
203
|
+
discoverGraphNamespaceRoots,
|
|
205
204
|
runGraphEdgeDecayMaintenanceAcrossNamespaces
|
|
206
205
|
};
|
|
207
|
-
//# sourceMappingURL=
|
|
206
|
+
//# sourceMappingURL=chunk-ZQNCHPTZ.js.map
|