@remnic/core 1.1.9 → 1.1.10
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-cli.js +35 -32
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +8 -7
- package/dist/access-http.js +17 -14
- package/dist/access-mcp.d.ts +8 -7
- package/dist/access-mcp.js +16 -13
- package/dist/{access-service-BJCIjVRY.d.ts → access-service-BTTNyo1i.d.ts} +5 -3
- package/dist/access-service.d.ts +8 -7
- package/dist/access-service.js +15 -12
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +2 -1
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +7 -6
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/calibration.d.ts +4 -1
- package/dist/calibration.js +10 -5
- package/dist/calibration.js.map +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-consolidation.d.ts +5 -2
- package/dist/causal-consolidation.js +14 -8
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-ICULSMDG.js → chunk-2YMTO4ZJ.js} +2 -2
- package/dist/{chunk-XL3UCAZA.js → chunk-363MWCD3.js} +35 -35
- package/dist/{chunk-PHQH2VUO.js → chunk-36CTNQY7.js} +7 -7
- package/dist/{chunk-XN4D6Z7X.js → chunk-4DXC6HQQ.js} +5 -3
- package/dist/chunk-4DXC6HQQ.js.map +1 -0
- package/dist/{chunk-OWGGXPKV.js → chunk-57QNCUEZ.js} +5 -5
- package/dist/{chunk-FPWUENQH.js → chunk-5GCNE7CN.js} +90 -486
- package/dist/chunk-5GCNE7CN.js.map +1 -0
- package/dist/{chunk-LOBRX7VD.js → chunk-5UM2VJ6D.js} +12 -1
- package/dist/chunk-5UM2VJ6D.js.map +1 -0
- package/dist/{chunk-KMWZXT5T.js → chunk-6XA7UN4Z.js} +2 -2
- package/dist/{chunk-G6NX57V2.js → chunk-C5HUWVH2.js} +2 -2
- package/dist/{chunk-NN3TS5BM.js → chunk-D54LZC5L.js} +4 -4
- package/dist/{chunk-3VRIIII5.js → chunk-ERUDW6DU.js} +65 -5
- package/dist/chunk-ERUDW6DU.js.map +1 -0
- package/dist/{chunk-U4SZXGEO.js → chunk-EYNQTST2.js} +2 -2
- package/dist/chunk-HJYHRE4S.js +647 -0
- package/dist/chunk-HJYHRE4S.js.map +1 -0
- package/dist/{chunk-M3DK45UM.js → chunk-I6BQZSML.js} +4 -4
- package/dist/chunk-IBX3VFOM.js +446 -0
- package/dist/chunk-IBX3VFOM.js.map +1 -0
- package/dist/{chunk-G3G3LY22.js → chunk-KBYWQWSB.js} +7 -7
- package/dist/chunk-KWBPHZUU.js +83 -0
- package/dist/chunk-KWBPHZUU.js.map +1 -0
- package/dist/{chunk-CTYRIJ5E.js → chunk-LIO5X3CM.js} +2 -2
- package/dist/{chunk-MJLUHRSF.js → chunk-MCC6KDQF.js} +2 -2
- package/dist/{chunk-J3P6WSFZ.js → chunk-O4XJUPSF.js} +2 -2
- package/dist/{chunk-6OAQEOGV.js → chunk-PB5KW5PL.js} +2 -2
- package/dist/{chunk-Y3VT6ZCP.js → chunk-PHNGXFQ6.js} +5 -3
- package/dist/chunk-PHNGXFQ6.js.map +1 -0
- package/dist/{chunk-2MVUXO4H.js → chunk-RXTFCYQF.js} +2 -2
- package/dist/{chunk-Q7FJ5ZHM.js → chunk-S3IP6R6K.js} +8 -2
- package/dist/{chunk-Q7FJ5ZHM.js.map → chunk-S3IP6R6K.js.map} +1 -1
- package/dist/{chunk-ET4BL42V.js → chunk-VQXK37XA.js} +1 -1
- package/dist/{chunk-ET4BL42V.js.map → chunk-VQXK37XA.js.map} +1 -1
- package/dist/{chunk-FLBYSB2V.js → chunk-VX2IUQFE.js} +94 -8
- package/dist/chunk-VX2IUQFE.js.map +1 -0
- package/dist/{chunk-QPLYTPYL.js → chunk-WGK4VHGP.js} +77 -15
- package/dist/chunk-WGK4VHGP.js.map +1 -0
- package/dist/{chunk-7SFAENUZ.js → chunk-WTFWLUSX.js} +2 -2
- package/dist/{chunk-A6PGANSE.js → chunk-Y5KDIOKF.js} +3 -3
- package/dist/{chunk-KIF7QNKL.js → chunk-Z5S5HNGY.js} +5 -3
- package/dist/chunk-Z5S5HNGY.js.map +1 -0
- package/dist/{chunk-BIHCWSWA.js → chunk-ZL4S7ARC.js} +3 -3
- package/dist/{cli-BojuyOOp.d.ts → cli-BrEwQTnW.d.ts} +4 -4
- package/dist/cli.d.ts +9 -8
- package/dist/cli.js +27 -25
- package/dist/codex-cli-fallback.d.ts +44 -0
- package/dist/codex-cli-fallback.js +12 -0
- package/dist/{codex-materialize-YVC2wb6n.d.ts → codex-materialize-CQlLTzke.d.ts} +1 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/day-summary.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/{engine-EDFFOWDD.js → engine-FOC3IJLA.js} +4 -4
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +3 -3
- package/dist/entity-schema.d.ts +2 -1
- package/dist/explicit-capture.d.ts +7 -6
- package/dist/explicit-cue-recall.js +1 -1
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +6 -4
- package/dist/fallback-llm.d.ts +8 -1
- package/dist/fallback-llm.js +5 -3
- package/dist/identity-continuity.d.ts +2 -1
- package/dist/importance.d.ts +2 -1
- package/dist/index-1qIcnbG1.d.ts +34 -0
- package/dist/index.d.ts +15 -13
- package/dist/index.js +57 -50
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm.d.ts +2 -1
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/{memory-governance-AAQPBZEP.js → memory-governance-F3QOJGEY.js} +4 -4
- package/dist/memory-governance-F3QOJGEY.js.map +1 -0
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/{memory-projection-store-BW8u5U0u.d.ts → memory-projection-store-CY8TU40w.d.ts} +1 -1
- package/dist/memory-projection-store.d.ts +3 -2
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/objective-state-writers.d.ts +23 -1
- package/dist/objective-state-writers.js +10 -306
- package/dist/objective-state-writers.js.map +1 -1
- package/dist/objective-state.d.ts +7 -1
- package/dist/objective-state.js +3 -1
- package/dist/operator-toolkit.d.ts +3 -2
- package/dist/operator-toolkit.js +6 -6
- package/dist/{orchestrator-CYqmqxco.d.ts → orchestrator-6IvQ-Phj.d.ts} +4 -3
- package/dist/orchestrator.d.ts +7 -6
- package/dist/orchestrator.js +29 -27
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/{port-Br27H8dy.d.ts → port-B6VEDIkC.d.ts} +1 -1
- package/dist/qmd-recall-cache.d.ts +3 -2
- package/dist/qmd.d.ts +3 -2
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resolve-provider-secret.d.ts +2 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +3 -3
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/{semantic-consolidation-GPcLr9BQ.d.ts → semantic-consolidation-ByBXb-sf.d.ts} +2 -2
- package/dist/semantic-consolidation.d.ts +4 -3
- package/dist/semantic-consolidation.js +3 -3
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/signal.d.ts +2 -1
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +2 -2
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +6 -4
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +4 -3
- package/dist/tier-routing.d.ts +2 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/types.d.ts +2693 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3VRIIII5.js.map +0 -1
- package/dist/chunk-FLBYSB2V.js.map +0 -1
- package/dist/chunk-FPWUENQH.js.map +0 -1
- package/dist/chunk-KIF7QNKL.js.map +0 -1
- package/dist/chunk-LOBRX7VD.js.map +0 -1
- package/dist/chunk-QPLYTPYL.js.map +0 -1
- package/dist/chunk-XN4D6Z7X.js.map +0 -1
- package/dist/chunk-Y3VT6ZCP.js.map +0 -1
- package/dist/types-Bmp9ssU2.d.ts +0 -2714
- /package/dist/{chunk-ICULSMDG.js.map → chunk-2YMTO4ZJ.js.map} +0 -0
- /package/dist/{chunk-XL3UCAZA.js.map → chunk-363MWCD3.js.map} +0 -0
- /package/dist/{chunk-PHQH2VUO.js.map → chunk-36CTNQY7.js.map} +0 -0
- /package/dist/{chunk-OWGGXPKV.js.map → chunk-57QNCUEZ.js.map} +0 -0
- /package/dist/{chunk-KMWZXT5T.js.map → chunk-6XA7UN4Z.js.map} +0 -0
- /package/dist/{chunk-G6NX57V2.js.map → chunk-C5HUWVH2.js.map} +0 -0
- /package/dist/{chunk-NN3TS5BM.js.map → chunk-D54LZC5L.js.map} +0 -0
- /package/dist/{chunk-U4SZXGEO.js.map → chunk-EYNQTST2.js.map} +0 -0
- /package/dist/{chunk-M3DK45UM.js.map → chunk-I6BQZSML.js.map} +0 -0
- /package/dist/{chunk-G3G3LY22.js.map → chunk-KBYWQWSB.js.map} +0 -0
- /package/dist/{chunk-CTYRIJ5E.js.map → chunk-LIO5X3CM.js.map} +0 -0
- /package/dist/{chunk-MJLUHRSF.js.map → chunk-MCC6KDQF.js.map} +0 -0
- /package/dist/{chunk-J3P6WSFZ.js.map → chunk-O4XJUPSF.js.map} +0 -0
- /package/dist/{chunk-6OAQEOGV.js.map → chunk-PB5KW5PL.js.map} +0 -0
- /package/dist/{chunk-2MVUXO4H.js.map → chunk-RXTFCYQF.js.map} +0 -0
- /package/dist/{chunk-7SFAENUZ.js.map → chunk-WTFWLUSX.js.map} +0 -0
- /package/dist/{chunk-A6PGANSE.js.map → chunk-Y5KDIOKF.js.map} +0 -0
- /package/dist/{chunk-BIHCWSWA.js.map → chunk-ZL4S7ARC.js.map} +0 -0
- /package/dist/{engine-EDFFOWDD.js.map → codex-cli-fallback.js.map} +0 -0
- /package/dist/{memory-governance-AAQPBZEP.js.map → engine-FOC3IJLA.js.map} +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1 +1,2693 @@
|
|
|
1
|
-
|
|
1
|
+
import { L as LcmMessagePartInput, M as MessagePartSourceFormat } from './index-1qIcnbG1.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* dreams-ledger.ts — per-phase telemetry for the Dreams consolidation pipeline.
|
|
5
|
+
*
|
|
6
|
+
* Every scheduled or manual phase run appends one JSONL entry to
|
|
7
|
+
* <memoryDir>/state/dreams-ledger.jsonl
|
|
8
|
+
*
|
|
9
|
+
* The entry records which phase ran, how long it took, and a small
|
|
10
|
+
* itemsProcessed counter so `remnic dreams status` can aggregate the last
|
|
11
|
+
* 24-hour window without scanning the full memory corpus.
|
|
12
|
+
*
|
|
13
|
+
* This module is intentionally side-effect-free on import (no fs calls at
|
|
14
|
+
* module load time) so tests can import it without touching the filesystem.
|
|
15
|
+
*/
|
|
16
|
+
/** The three named phases of the Dreams consolidation pipeline. */
|
|
17
|
+
type DreamsPhase = "lightSleep" | "rem" | "deepSleep";
|
|
18
|
+
/** Aggregated stats for a single phase over a time window. */
|
|
19
|
+
interface DreamsPhaseStatus {
|
|
20
|
+
phase: DreamsPhase;
|
|
21
|
+
/** Number of phase runs in the window. */
|
|
22
|
+
runCount: number;
|
|
23
|
+
/** Total wall-clock milliseconds across all runs in the window. */
|
|
24
|
+
totalDurationMs: number;
|
|
25
|
+
/** Total items processed across all runs in the window. */
|
|
26
|
+
totalItemsProcessed: number;
|
|
27
|
+
/** ISO-8601 timestamp of the most recent completed run, or null if none. */
|
|
28
|
+
lastRunAt: string | null;
|
|
29
|
+
/** Duration of the most recent run in ms, or null if none. */
|
|
30
|
+
lastDurationMs: number | null;
|
|
31
|
+
}
|
|
32
|
+
/** Shape returned by `getDreamsStatus` — the canonical telemetry response. */
|
|
33
|
+
interface DreamsStatusResult {
|
|
34
|
+
/** ISO-8601 start of the query window (inclusive). */
|
|
35
|
+
windowStart: string;
|
|
36
|
+
/** ISO-8601 end of the query window (exclusive). */
|
|
37
|
+
windowEnd: string;
|
|
38
|
+
/** Per-phase summaries, always present for all three phases. */
|
|
39
|
+
phases: {
|
|
40
|
+
lightSleep: DreamsPhaseStatus;
|
|
41
|
+
rem: DreamsPhaseStatus;
|
|
42
|
+
deepSleep: DreamsPhaseStatus;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Public result shape — identical to what HTTP, MCP, and CLI surfaces expose. */
|
|
46
|
+
interface DreamsRunResult {
|
|
47
|
+
phase: DreamsPhase;
|
|
48
|
+
dryRun: boolean;
|
|
49
|
+
durationMs: number;
|
|
50
|
+
itemsProcessed: number;
|
|
51
|
+
notes?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type ReasoningEffort = "none" | "low" | "medium" | "high";
|
|
55
|
+
type TriggerMode = "smart" | "every_n" | "time_based";
|
|
56
|
+
type SignalLevel = "none" | "low" | "medium" | "high";
|
|
57
|
+
type MemoryCategory = "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
|
|
58
|
+
type ConsolidationAction = "ADD" | "MERGE" | "UPDATE" | "INVALIDATE" | "SKIP";
|
|
59
|
+
type ConfidenceTier = "explicit" | "implied" | "inferred" | "speculative";
|
|
60
|
+
type PrincipalFromSessionKeyMode = "map" | "prefix" | "regex";
|
|
61
|
+
type RecallPlanMode = "no_recall" | "minimal" | "full" | "graph_mode";
|
|
62
|
+
type CronRecallMode = "all" | "none" | "allowlist";
|
|
63
|
+
type CronConversationRecallMode = "auto" | "always" | "never";
|
|
64
|
+
type IdentityInjectionMode = "recovery_only" | "minimal" | "full";
|
|
65
|
+
type CaptureMode = "implicit" | "explicit" | "hybrid";
|
|
66
|
+
type MemoryOsPresetName = "conservative" | "balanced" | "research-max" | "local-llm-heavy";
|
|
67
|
+
type ExtractionPassSource = "base" | "proactive";
|
|
68
|
+
/**
|
|
69
|
+
* Scope classification for extracted facts (issue #XXX).
|
|
70
|
+
*
|
|
71
|
+
* - `"project"` — knowledge specific to one codebase: file paths, environment
|
|
72
|
+
* configs, deployment details, project-specific workarounds, team/stakeholder
|
|
73
|
+
* info tied to one project.
|
|
74
|
+
* - `"global"` — knowledge that applies across projects: core framework bugs,
|
|
75
|
+
* library behavior, API patterns, user preferences, tool configurations,
|
|
76
|
+
* general coding patterns, infrastructure knowledge.
|
|
77
|
+
*
|
|
78
|
+
* Default is `"project"` when a coding context is active, `"global"` when no
|
|
79
|
+
* coding context is present.
|
|
80
|
+
*/
|
|
81
|
+
type MemoryScope = "project" | "global";
|
|
82
|
+
type SlotMismatchMode = "error" | "warn" | "silent";
|
|
83
|
+
type CodexCompactionFlushMode = "signal" | "heuristic" | "auto";
|
|
84
|
+
type DreamingNarrativePromptStyle = "reflective" | "diary" | "analytical";
|
|
85
|
+
type HeartbeatDetectionMode = "runtime-signal" | "heuristic" | "auto";
|
|
86
|
+
type ActiveRecallQueryMode = "message" | "recent" | "full";
|
|
87
|
+
type ActiveRecallPromptStyle = "balanced" | "strict" | "contextual" | "recall-heavy" | "precision-heavy" | "preference-only";
|
|
88
|
+
type ActiveRecallThinking = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "adaptive";
|
|
89
|
+
type ActiveRecallChatType = "direct" | "group" | "channel";
|
|
90
|
+
type ActiveRecallModelFallbackPolicy = "default-remote" | "resolved-only";
|
|
91
|
+
/**
|
|
92
|
+
* Retrieval tier ladder (issue #518). Identifies which tier served a recall
|
|
93
|
+
* result. Ordered top-to-bottom by cost, but routing is not strictly
|
|
94
|
+
* sequential — callers may jump straight to a lower tier when eligibility
|
|
95
|
+
* does not hold.
|
|
96
|
+
*/
|
|
97
|
+
type RetrievalTier = "exact-cache" | "fuzzy-cache" | "direct-answer" | "hybrid" | "rerank-graph" | "agentic";
|
|
98
|
+
/**
|
|
99
|
+
* Per-recall annotation describing which retrieval tier served a result,
|
|
100
|
+
* why that tier was chosen, and what was filtered along the way. Added as
|
|
101
|
+
* part of issue #518 (direct-answer tier + `query --explain`).
|
|
102
|
+
*
|
|
103
|
+
* Not to be confused with the existing `recallExplain` operation
|
|
104
|
+
* (graph-path explanation) — that is a user-invoked RPC; this is a
|
|
105
|
+
* per-result annotation that can be attached to any recall response.
|
|
106
|
+
*/
|
|
107
|
+
interface RecallTierExplain {
|
|
108
|
+
tier: RetrievalTier;
|
|
109
|
+
tierReason: string;
|
|
110
|
+
filteredBy: string[];
|
|
111
|
+
candidatesConsidered: number;
|
|
112
|
+
latencyMs: number;
|
|
113
|
+
sourceAnchors?: Array<{
|
|
114
|
+
path: string;
|
|
115
|
+
lineRange?: [number, number];
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Recall disclosure depth (issue #677). Selects how much content each
|
|
120
|
+
* recall result returns:
|
|
121
|
+
*
|
|
122
|
+
* - `"chunk"` — semantic chunk excerpt (cheapest; default).
|
|
123
|
+
* - `"section"` — full markdown section / memory body (current pre-#677 behavior).
|
|
124
|
+
* - `"raw"` — raw transcript / archive excerpts from `lcm/` when present.
|
|
125
|
+
*
|
|
126
|
+
* Disclosure is **orthogonal** to the retrieval-tier ladder
|
|
127
|
+
* (`RetrievalTier` / `RETRIEVAL_TIERS`). The tier ladder controls *which
|
|
128
|
+
* pipeline stage served a result*; disclosure controls *how deep into the
|
|
129
|
+
* underlying memory the result reaches*. A request can mix any retrieval
|
|
130
|
+
* tier with any disclosure depth.
|
|
131
|
+
*
|
|
132
|
+
* Default is `"chunk"` when the caller omits the field; this preserves the
|
|
133
|
+
* existing recall behavior because callers that did not request a disclosure
|
|
134
|
+
* level continue to receive the same chunk-shaped previews they always had.
|
|
135
|
+
* Surfaces (CLI / HTTP / MCP) and downstream telemetry are wired in later
|
|
136
|
+
* PRs of #677.
|
|
137
|
+
*/
|
|
138
|
+
type RecallDisclosure = "chunk" | "section" | "raw";
|
|
139
|
+
/**
|
|
140
|
+
* Ordered list of disclosure levels, cheapest to most expensive. Used for
|
|
141
|
+
* validation, escalation policy comparisons, and future telemetry rollups.
|
|
142
|
+
* Treat this as the single source of truth — do not hard-code disclosure
|
|
143
|
+
* strings elsewhere.
|
|
144
|
+
*/
|
|
145
|
+
declare const RECALL_DISCLOSURE_LEVELS: readonly RecallDisclosure[];
|
|
146
|
+
/**
|
|
147
|
+
* Default disclosure level when a caller omits `disclosure`. Set to `chunk`
|
|
148
|
+
* so callers that did not opt in to deeper disclosure see the same
|
|
149
|
+
* preview-shaped behavior as before #677.
|
|
150
|
+
*/
|
|
151
|
+
declare const DEFAULT_RECALL_DISCLOSURE: RecallDisclosure;
|
|
152
|
+
declare function isRecallDisclosure(value: unknown): value is RecallDisclosure;
|
|
153
|
+
interface RecallSectionConfig {
|
|
154
|
+
id: string;
|
|
155
|
+
enabled?: boolean;
|
|
156
|
+
maxChars?: number | null;
|
|
157
|
+
maxHints?: number;
|
|
158
|
+
maxSupportingFacts?: number;
|
|
159
|
+
maxRelatedEntities?: number;
|
|
160
|
+
consolidateTriggerLines?: number;
|
|
161
|
+
consolidateTargetLines?: number;
|
|
162
|
+
maxEntities?: number;
|
|
163
|
+
maxResults?: number;
|
|
164
|
+
recentTurns?: number;
|
|
165
|
+
maxTurns?: number;
|
|
166
|
+
maxTokens?: number;
|
|
167
|
+
lookbackHours?: number;
|
|
168
|
+
maxCount?: number;
|
|
169
|
+
topK?: number;
|
|
170
|
+
timeoutMs?: number;
|
|
171
|
+
maxPatterns?: number;
|
|
172
|
+
maxRubrics?: number;
|
|
173
|
+
}
|
|
174
|
+
interface RecallPipelineConfig {
|
|
175
|
+
recallBudgetChars: number;
|
|
176
|
+
pipeline: RecallSectionConfig[];
|
|
177
|
+
}
|
|
178
|
+
interface SessionObserverBandConfig {
|
|
179
|
+
maxBytes: number;
|
|
180
|
+
triggerDeltaBytes: number;
|
|
181
|
+
triggerDeltaTokens: number;
|
|
182
|
+
}
|
|
183
|
+
interface FileHygieneConfig {
|
|
184
|
+
enabled: boolean;
|
|
185
|
+
lintEnabled: boolean;
|
|
186
|
+
lintBudgetBytes: number;
|
|
187
|
+
lintWarnRatio: number;
|
|
188
|
+
lintPaths: string[];
|
|
189
|
+
rotateEnabled: boolean;
|
|
190
|
+
rotateMaxBytes: number;
|
|
191
|
+
rotateKeepTailChars: number;
|
|
192
|
+
rotatePaths: string[];
|
|
193
|
+
archiveDir: string;
|
|
194
|
+
runMinIntervalMs: number;
|
|
195
|
+
warningsLogEnabled: boolean;
|
|
196
|
+
warningsLogPath: string;
|
|
197
|
+
indexEnabled: boolean;
|
|
198
|
+
indexPath: string;
|
|
199
|
+
}
|
|
200
|
+
interface NativeKnowledgeConfig {
|
|
201
|
+
enabled: boolean;
|
|
202
|
+
includeFiles: string[];
|
|
203
|
+
maxChunkChars: number;
|
|
204
|
+
maxResults: number;
|
|
205
|
+
maxChars: number;
|
|
206
|
+
stateDir: string;
|
|
207
|
+
obsidianVaults: NativeKnowledgeObsidianVaultConfig[];
|
|
208
|
+
openclawWorkspace?: NativeKnowledgeOpenClawWorkspaceConfig;
|
|
209
|
+
}
|
|
210
|
+
interface NativeKnowledgeFolderRuleConfig {
|
|
211
|
+
pathPrefix: string;
|
|
212
|
+
namespace?: string;
|
|
213
|
+
privacyClass?: string;
|
|
214
|
+
}
|
|
215
|
+
interface NativeKnowledgeObsidianVaultConfig {
|
|
216
|
+
id: string;
|
|
217
|
+
rootDir: string;
|
|
218
|
+
includeGlobs: string[];
|
|
219
|
+
excludeGlobs: string[];
|
|
220
|
+
namespace?: string;
|
|
221
|
+
privacyClass?: string;
|
|
222
|
+
folderRules: NativeKnowledgeFolderRuleConfig[];
|
|
223
|
+
dailyNotePatterns: string[];
|
|
224
|
+
materializeBacklinks: boolean;
|
|
225
|
+
}
|
|
226
|
+
interface NativeKnowledgeOpenClawWorkspaceConfig {
|
|
227
|
+
enabled: boolean;
|
|
228
|
+
bootstrapFiles: string[];
|
|
229
|
+
handoffGlobs: string[];
|
|
230
|
+
dailySummaryGlobs: string[];
|
|
231
|
+
automationNoteGlobs: string[];
|
|
232
|
+
workspaceDocGlobs: string[];
|
|
233
|
+
excludeGlobs: string[];
|
|
234
|
+
sharedSafeGlobs: string[];
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* OpenClaw SecretRef shape (issue #757).
|
|
238
|
+
*
|
|
239
|
+
* OpenClaw resolves these at runtime via its built-in secret resolver
|
|
240
|
+
* (e.g. exec providers like `kc_*` for macOS Keychain). Plugins receive
|
|
241
|
+
* the raw object in `pluginConfig` and must call the gateway's resolver
|
|
242
|
+
* before using the value. Standalone Remnic does NOT resolve SecretRefs;
|
|
243
|
+
* operators must use plain strings or `${ENV_VAR}` expansion instead.
|
|
244
|
+
*/
|
|
245
|
+
interface SecretRef {
|
|
246
|
+
source: string;
|
|
247
|
+
provider?: string;
|
|
248
|
+
id?: string;
|
|
249
|
+
command?: unknown;
|
|
250
|
+
[key: string]: unknown;
|
|
251
|
+
}
|
|
252
|
+
type AgentAccessAuthToken = string | SecretRef;
|
|
253
|
+
interface AgentAccessHttpConfig {
|
|
254
|
+
enabled: boolean;
|
|
255
|
+
host: string;
|
|
256
|
+
port: number;
|
|
257
|
+
/**
|
|
258
|
+
* Bearer token. Either a literal string (env-expanded) or an unresolved
|
|
259
|
+
* SecretRef object preserved verbatim from openclaw.json — resolved at
|
|
260
|
+
* service-start time via {@link resolveAgentAccessAuthToken}.
|
|
261
|
+
*/
|
|
262
|
+
authToken?: AgentAccessAuthToken;
|
|
263
|
+
principal?: string;
|
|
264
|
+
maxBodyBytes: number;
|
|
265
|
+
}
|
|
266
|
+
interface DreamingConfig {
|
|
267
|
+
enabled: boolean;
|
|
268
|
+
journalPath: string;
|
|
269
|
+
maxEntries: number;
|
|
270
|
+
injectRecentCount: number;
|
|
271
|
+
minIntervalMinutes: number;
|
|
272
|
+
narrativeModel: string | null;
|
|
273
|
+
narrativePromptStyle: DreamingNarrativePromptStyle;
|
|
274
|
+
watchFile: boolean;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Light-sleep phase config (issue #678 PR 2/4).
|
|
278
|
+
*
|
|
279
|
+
* Groups existing top-level lifecycle-policy gates under a unified namespace.
|
|
280
|
+
* When `dreams.phases.lightSleep.*` keys are set they WIN over the legacy
|
|
281
|
+
* top-level keys; the legacy keys remain readable for backward compatibility.
|
|
282
|
+
*
|
|
283
|
+
* Light sleep: recent activity scoring + clustering (tier-routing value score,
|
|
284
|
+
* observation ledger, buffer state — `runLifecyclePolicyPass` in orchestrator).
|
|
285
|
+
*/
|
|
286
|
+
interface DreamsLightSleepConfig {
|
|
287
|
+
/** Phase master switch. Mirrors `lifecyclePolicyEnabled` when not set explicitly. */
|
|
288
|
+
enabled: boolean;
|
|
289
|
+
/** Minimum interval between light-sleep passes in milliseconds. */
|
|
290
|
+
cadenceMs: number;
|
|
291
|
+
/** Value score above which a memory is treated as hot. Mirrors `lifecyclePromoteHeatThreshold`. */
|
|
292
|
+
promoteHeatThreshold: number;
|
|
293
|
+
/** Value score below which a memory starts to decay. Mirrors `lifecycleStaleDecayThreshold`. */
|
|
294
|
+
staleDecayThreshold: number;
|
|
295
|
+
/** Value score below which a memory is eligible for archive. Mirrors `lifecycleArchiveDecayThreshold`. */
|
|
296
|
+
archiveDecayThreshold: number;
|
|
297
|
+
/** Whether stale memories are filtered from recall. Mirrors `lifecycleFilterStaleEnabled`. */
|
|
298
|
+
filterStaleEnabled: boolean;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* REM phase config (issue #678 PR 2/4).
|
|
302
|
+
*
|
|
303
|
+
* Groups existing top-level semantic-consolidation and supersession gates.
|
|
304
|
+
* When `dreams.phases.rem.*` keys are set they WIN over the legacy top-level
|
|
305
|
+
* keys.
|
|
306
|
+
*
|
|
307
|
+
* REM: cross-session synthesis, supersession resolution, semantic consolidation
|
|
308
|
+
* (`runSemanticConsolidation` in orchestrator).
|
|
309
|
+
*/
|
|
310
|
+
interface DreamsRemConfig {
|
|
311
|
+
/** Phase master switch. Mirrors `semanticConsolidationEnabled` when not set explicitly. */
|
|
312
|
+
enabled: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* How often the REM pass runs, in milliseconds.
|
|
315
|
+
* Derived from `semanticConsolidationIntervalHours` (×3 600 000) when not set explicitly.
|
|
316
|
+
*/
|
|
317
|
+
cadenceMs: number;
|
|
318
|
+
/** Cosine-similarity threshold for cluster membership. Mirrors `semanticConsolidationThreshold`. */
|
|
319
|
+
similarityThreshold: number;
|
|
320
|
+
/** Minimum cluster size before consolidation runs. Mirrors `semanticConsolidationMinClusterSize`. */
|
|
321
|
+
minClusterSize: number;
|
|
322
|
+
/** Max cluster operations per run. Mirrors `semanticConsolidationMaxPerRun`. */
|
|
323
|
+
maxPerRun: number;
|
|
324
|
+
/** Minimum gap between consolidation passes (ms). Mirrors `consolidationMinIntervalMs`. */
|
|
325
|
+
minIntervalMs: number;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Deep-sleep phase config (issue #678 PR 2/4).
|
|
329
|
+
*
|
|
330
|
+
* Groups existing versioning and tier-migration gates.
|
|
331
|
+
* When `dreams.phases.deepSleep.*` keys are set they WIN over the legacy
|
|
332
|
+
* top-level keys.
|
|
333
|
+
*
|
|
334
|
+
* Deep sleep: promotion to durable memory, hot→cold tier migration,
|
|
335
|
+
* page-version snapshots, archive (`engram-nightly-governance` cron,
|
|
336
|
+
* `tier-migration.ts`, `page-versioning.ts`, `hygiene.ts`).
|
|
337
|
+
*/
|
|
338
|
+
interface DreamsDeepSleepConfig {
|
|
339
|
+
/**
|
|
340
|
+
* Phase master switch. No single direct legacy mirror; defaults false unless
|
|
341
|
+
* an existing deep-sleep surface such as nightly governance auto-registration,
|
|
342
|
+
* tier migration, or page versioning is explicitly enabled. Set to `false`
|
|
343
|
+
* to disable those surfaces without removing legacy config keys.
|
|
344
|
+
*/
|
|
345
|
+
enabled: boolean;
|
|
346
|
+
/** True only when dreams.phases.deepSleep.enabled was explicitly configured. */
|
|
347
|
+
enabledExplicitlySet?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Minimum interval between deep-sleep passes in milliseconds.
|
|
350
|
+
* Informational only in PR 2; PR 4 will wire this into the cron scheduler.
|
|
351
|
+
*/
|
|
352
|
+
cadenceMs: number;
|
|
353
|
+
/** Enable page-version snapshots on every overwrite. Mirrors `versioningEnabled`. */
|
|
354
|
+
versioningEnabled: boolean;
|
|
355
|
+
/** Max snapshots per page. Mirrors `versioningMaxPerPage`. */
|
|
356
|
+
versioningMaxPerPage: number;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Unified dreams phases config block (issue #678 PR 2/4).
|
|
360
|
+
*
|
|
361
|
+
* Operators set `dreams.phases.{lightSleep,rem,deepSleep}.*` in their plugin
|
|
362
|
+
* config. Values under this block WIN over the equivalent legacy top-level keys
|
|
363
|
+
* when both are set. Legacy keys continue to be parsed so existing configs do
|
|
364
|
+
* not need to change.
|
|
365
|
+
*
|
|
366
|
+
* This block is intentionally separate from `DreamingConfig` which controls the
|
|
367
|
+
* diary surface (`surfaces/dreams.ts`) — a different feature. See docs/dreams.md.
|
|
368
|
+
*/
|
|
369
|
+
interface DreamsPhasesConfig {
|
|
370
|
+
lightSleep: DreamsLightSleepConfig;
|
|
371
|
+
rem: DreamsRemConfig;
|
|
372
|
+
deepSleep: DreamsDeepSleepConfig;
|
|
373
|
+
}
|
|
374
|
+
/** Procedural memory (issue #519): mining + recall gates. All sub-features default off. */
|
|
375
|
+
interface ProceduralConfig {
|
|
376
|
+
enabled: boolean;
|
|
377
|
+
/** Minimum cluster size before emitting a candidate; `0` disables mining (`minOccurrences_zero`). */
|
|
378
|
+
minOccurrences: number;
|
|
379
|
+
/** Minimum success rate from trajectory outcomes in [0, 1]. */
|
|
380
|
+
successFloor: number;
|
|
381
|
+
/** When auto-promotion is enabled, promote pending_review → active after this many occurrences. */
|
|
382
|
+
autoPromoteOccurrences: number;
|
|
383
|
+
autoPromoteEnabled: boolean;
|
|
384
|
+
lookbackDays: number;
|
|
385
|
+
/** When true, installer may register the nightly procedural mining cron (default off). */
|
|
386
|
+
proceduralMiningCronAutoRegister: boolean;
|
|
387
|
+
/** Max procedure memories to inject on task-initiation recall (1–10). */
|
|
388
|
+
recallMaxProcedures: number;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Coding-agent mode config (issue #569).
|
|
392
|
+
*
|
|
393
|
+
* When the connector provides a `CodingContext` (see below), Remnic overlays
|
|
394
|
+
* a project- and/or branch-scoped namespace on top of the principal's default
|
|
395
|
+
* namespace so that memories written while working on project A do not surface
|
|
396
|
+
* while working on project B.
|
|
397
|
+
*
|
|
398
|
+
* Both flags default off-for-branch / on-for-project. Per CLAUDE.md #30 every
|
|
399
|
+
* filter or transform needs an escape hatch: set `projectScope: false` to
|
|
400
|
+
* exactly restore pre-#569 behaviour.
|
|
401
|
+
*/
|
|
402
|
+
interface CodingModeConfig {
|
|
403
|
+
/**
|
|
404
|
+
* When true (default), a session with a resolved `CodingContext` uses a
|
|
405
|
+
* project-scoped namespace. When false, the principal's default namespace
|
|
406
|
+
* is used unchanged (pre-#569 behaviour).
|
|
407
|
+
*/
|
|
408
|
+
projectScope: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* When true, recall/write also overlay the current branch on top of the
|
|
411
|
+
* project namespace. Default false — branch-scope is opt-in because active
|
|
412
|
+
* development typically wants recall across branches. (Wired by PR 3 of
|
|
413
|
+
* issue #569; declared here so the schema ships in one slice.)
|
|
414
|
+
*/
|
|
415
|
+
branchScope: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* When true (default), project-scoped and branch-scoped sessions include
|
|
418
|
+
* the root/default namespace in their read fallbacks so globally useful
|
|
419
|
+
* memories remain visible from any project. When false, project-scoped
|
|
420
|
+
* sessions only see their own namespace (strict isolation).
|
|
421
|
+
*
|
|
422
|
+
* CLAUDE.md #30: configuration gate for the recall fan-out to the root
|
|
423
|
+
* namespace. Does not affect writes — those always go to the project
|
|
424
|
+
* namespace only.
|
|
425
|
+
*/
|
|
426
|
+
globalFallback: boolean;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Session-scoped coding context. Produced by `resolveGitContext()` in the
|
|
430
|
+
* connector layer and attached to a session so that recall + write paths can
|
|
431
|
+
* compute an overlay namespace.
|
|
432
|
+
*
|
|
433
|
+
* All fields mirror `GitContext` from `./coding/git-context.ts`; kept as a
|
|
434
|
+
* separate interface because `types.ts` must stay dependency-free (it is
|
|
435
|
+
* imported by every other module).
|
|
436
|
+
*/
|
|
437
|
+
interface CodingContext {
|
|
438
|
+
projectId: string;
|
|
439
|
+
branch: string | null;
|
|
440
|
+
rootPath: string;
|
|
441
|
+
defaultBranch: string | null;
|
|
442
|
+
}
|
|
443
|
+
/** Configuration for the nightly contradiction-scan cron (issue #520). */
|
|
444
|
+
interface ContradictionScanConfig {
|
|
445
|
+
/** Master switch for the contradiction scan cron. Default true. */
|
|
446
|
+
enabled: boolean;
|
|
447
|
+
/** Embedding cosine similarity floor for candidate pair generation. Default 0.82. */
|
|
448
|
+
similarityFloor: number;
|
|
449
|
+
/** Minimum topic-token Jaccard overlap for unstructured pairs. Default 0.4. */
|
|
450
|
+
topicOverlapFloor: number;
|
|
451
|
+
/** Cap on candidate pairs evaluated per cron run. Default 500. */
|
|
452
|
+
maxPairsPerRun: number;
|
|
453
|
+
/** Cooldown in days before re-evaluating a pair judged independent/both-valid. Default 14. */
|
|
454
|
+
cooldownDays: number;
|
|
455
|
+
/** When true, pairs judged "duplicates" are auto-flagged for dedup (still need user approval). Default false. */
|
|
456
|
+
autoMergeDuplicates: boolean;
|
|
457
|
+
}
|
|
458
|
+
interface HeartbeatConfig {
|
|
459
|
+
enabled: boolean;
|
|
460
|
+
journalPath: string;
|
|
461
|
+
maxPreviousRuns: number;
|
|
462
|
+
watchFile: boolean;
|
|
463
|
+
detectionMode: HeartbeatDetectionMode;
|
|
464
|
+
gateExtractionDuringHeartbeat: boolean;
|
|
465
|
+
}
|
|
466
|
+
interface SlotBehaviorConfig {
|
|
467
|
+
requireExclusiveMemorySlot: boolean;
|
|
468
|
+
onSlotMismatch: SlotMismatchMode;
|
|
469
|
+
}
|
|
470
|
+
interface CodexCompatConfig {
|
|
471
|
+
enabled: boolean;
|
|
472
|
+
threadIdBufferKeying: boolean;
|
|
473
|
+
compactionFlushMode: CodexCompactionFlushMode;
|
|
474
|
+
fingerprintDedup: boolean;
|
|
475
|
+
}
|
|
476
|
+
declare function confidenceTier(score: number): ConfidenceTier;
|
|
477
|
+
/** Default TTL in days for speculative memories (auto-expire if unconfirmed) */
|
|
478
|
+
declare const SPECULATIVE_TTL_DAYS = 30;
|
|
479
|
+
/**
|
|
480
|
+
* Shape for semantic chunking config overrides stored in PluginConfig.
|
|
481
|
+
* Mirrors SemanticChunkingConfig from semantic-chunking.ts without creating
|
|
482
|
+
* a circular import (types.ts is imported by everything).
|
|
483
|
+
*/
|
|
484
|
+
interface SemanticChunkingConfigShape {
|
|
485
|
+
targetTokens: number;
|
|
486
|
+
minTokens: number;
|
|
487
|
+
maxTokens: number;
|
|
488
|
+
smoothingWindowSize: number;
|
|
489
|
+
boundaryThresholdStdDevs: number;
|
|
490
|
+
embeddingBatchSize: number;
|
|
491
|
+
fallbackToRecursive: boolean;
|
|
492
|
+
}
|
|
493
|
+
interface PluginConfig {
|
|
494
|
+
openaiApiKey: string | undefined;
|
|
495
|
+
openaiBaseUrl: string | undefined;
|
|
496
|
+
model: string;
|
|
497
|
+
reasoningEffort: ReasoningEffort;
|
|
498
|
+
triggerMode: TriggerMode;
|
|
499
|
+
bufferMaxTurns: number;
|
|
500
|
+
bufferMaxMinutes: number;
|
|
501
|
+
/**
|
|
502
|
+
* Surprise-gated buffer flush (issue #563, D-MEM).
|
|
503
|
+
*
|
|
504
|
+
* When enabled, every turn added to the smart buffer is scored against a
|
|
505
|
+
* configurable window of recent memories using an embedding-distance proxy
|
|
506
|
+
* for novelty (see `buffer-surprise.ts`). A turn whose surprise score
|
|
507
|
+
* exceeds `bufferSurpriseThreshold` triggers an immediate extract flush,
|
|
508
|
+
* even if the existing signal/turn-count/time triggers would otherwise keep
|
|
509
|
+
* buffering. Disabled by default — when `false`, buffer behavior is
|
|
510
|
+
* identical to pre-#563 code. Additive only: existing triggers are never
|
|
511
|
+
* suppressed by this flag.
|
|
512
|
+
*/
|
|
513
|
+
bufferSurpriseTriggerEnabled: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* Threshold in `[0, 1]` above which a surprise score causes an immediate
|
|
516
|
+
* flush. `0.35` is a conservative default chosen to favor precision over
|
|
517
|
+
* recall during the opt-in phase. Ignored unless
|
|
518
|
+
* `bufferSurpriseTriggerEnabled` is `true`.
|
|
519
|
+
*/
|
|
520
|
+
bufferSurpriseThreshold: number;
|
|
521
|
+
/**
|
|
522
|
+
* Number of nearest neighbors to average over when computing the surprise
|
|
523
|
+
* score (see `computeSurprise`). Default `5`. Clamped to the recent-memory
|
|
524
|
+
* window size at call time.
|
|
525
|
+
*/
|
|
526
|
+
bufferSurpriseK: number;
|
|
527
|
+
/**
|
|
528
|
+
* Maximum number of recent memories to sample when computing the surprise
|
|
529
|
+
* score. Bounds embedding cost per turn. Default `20`. Set to `0` to
|
|
530
|
+
* disable the trigger even when the flag is on (no memories to compare
|
|
531
|
+
* against → treat as not-applicable rather than maximally surprising).
|
|
532
|
+
*/
|
|
533
|
+
bufferSurpriseRecentMemoryCount: number;
|
|
534
|
+
/**
|
|
535
|
+
* Hard timeout (ms) for the surprise probe. If the probe does not
|
|
536
|
+
* resolve within this window, the buffer treats the probe as failed,
|
|
537
|
+
* logs at debug, and falls through to the existing triggers. Ensures
|
|
538
|
+
* a slow or hung embedder cannot stall the turn-append path. Default
|
|
539
|
+
* `2000` (2s).
|
|
540
|
+
*/
|
|
541
|
+
bufferSurpriseProbeTimeoutMs: number;
|
|
542
|
+
consolidateEveryN: number;
|
|
543
|
+
highSignalPatterns: string[];
|
|
544
|
+
maxMemoryTokens: number;
|
|
545
|
+
memoryOsPreset?: MemoryOsPresetName;
|
|
546
|
+
qmdEnabled: boolean;
|
|
547
|
+
qmdCollection: string;
|
|
548
|
+
qmdMaxResults: number;
|
|
549
|
+
qmdColdTierEnabled?: boolean;
|
|
550
|
+
qmdColdCollection?: string;
|
|
551
|
+
qmdColdMaxResults?: number;
|
|
552
|
+
qmdTierMigrationEnabled: boolean;
|
|
553
|
+
qmdTierDemotionMinAgeDays: number;
|
|
554
|
+
qmdTierDemotionValueThreshold: number;
|
|
555
|
+
qmdTierPromotionValueThreshold: number;
|
|
556
|
+
qmdTierParityGraphEnabled: boolean;
|
|
557
|
+
qmdTierParityHiMemEnabled: boolean;
|
|
558
|
+
qmdTierAutoBackfillEnabled: boolean;
|
|
559
|
+
embeddingFallbackEnabled: boolean;
|
|
560
|
+
embeddingFallbackProvider: "auto" | "openai" | "local";
|
|
561
|
+
/** Optional absolute path to qmd binary. If unset, PATH/fallback discovery is used. */
|
|
562
|
+
qmdPath?: string;
|
|
563
|
+
memoryDir: string;
|
|
564
|
+
debug: boolean;
|
|
565
|
+
identityEnabled: boolean;
|
|
566
|
+
identityContinuityEnabled: boolean;
|
|
567
|
+
identityInjectionMode: IdentityInjectionMode;
|
|
568
|
+
identityMaxInjectChars: number;
|
|
569
|
+
continuityIncidentLoggingEnabled: boolean;
|
|
570
|
+
continuityAuditEnabled: boolean;
|
|
571
|
+
sessionObserverEnabled?: boolean;
|
|
572
|
+
sessionObserverDebounceMs?: number;
|
|
573
|
+
sessionObserverBands?: SessionObserverBandConfig[];
|
|
574
|
+
injectQuestions: boolean;
|
|
575
|
+
commitmentDecayDays: number;
|
|
576
|
+
workspaceDir: string;
|
|
577
|
+
captureMode: CaptureMode;
|
|
578
|
+
fileHygiene?: FileHygieneConfig;
|
|
579
|
+
nativeKnowledge?: NativeKnowledgeConfig;
|
|
580
|
+
agentAccessHttp: AgentAccessHttpConfig;
|
|
581
|
+
accessTrackingEnabled: boolean;
|
|
582
|
+
accessTrackingBufferMaxSize: number;
|
|
583
|
+
recencyWeight: number;
|
|
584
|
+
boostAccessCount: boolean;
|
|
585
|
+
/** Record empty recall impressions (memoryIds: []) when no memories are injected. Disabled by default. */
|
|
586
|
+
recordEmptyRecallImpressions: boolean;
|
|
587
|
+
queryExpansionEnabled: boolean;
|
|
588
|
+
queryExpansionMaxQueries: number;
|
|
589
|
+
/** Minimum token length to consider for query expansion. */
|
|
590
|
+
queryExpansionMinTokenLen: number;
|
|
591
|
+
rerankEnabled: boolean;
|
|
592
|
+
/** Rerank provider. "local" uses Local LLM only; "cloud" uses gateway fallback chain. */
|
|
593
|
+
rerankProvider: "local" | "cloud";
|
|
594
|
+
rerankMaxCandidates: number;
|
|
595
|
+
rerankTimeoutMs: number;
|
|
596
|
+
rerankCacheEnabled: boolean;
|
|
597
|
+
rerankCacheTtlMs: number;
|
|
598
|
+
feedbackEnabled: boolean;
|
|
599
|
+
/** If true, allow recording negative examples and apply a soft penalty during ranking. */
|
|
600
|
+
negativeExamplesEnabled: boolean;
|
|
601
|
+
/** Score penalty per "not useful" hit (typical QMD scores ~0-1). Keep small. */
|
|
602
|
+
negativeExamplesPenaltyPerHit: number;
|
|
603
|
+
/** Maximum penalty applied from negative examples. */
|
|
604
|
+
negativeExamplesPenaltyCap: number;
|
|
605
|
+
chunkingEnabled: boolean;
|
|
606
|
+
chunkingTargetTokens: number;
|
|
607
|
+
chunkingMinTokens: number;
|
|
608
|
+
chunkingOverlapSentences: number;
|
|
609
|
+
/** Enable semantic chunking with embedding-based topic boundary detection. Default: false. */
|
|
610
|
+
semanticChunkingEnabled: boolean;
|
|
611
|
+
/** Optional overrides for the semantic chunking algorithm. */
|
|
612
|
+
semanticChunkingConfig: Partial<SemanticChunkingConfigShape>;
|
|
613
|
+
contradictionDetectionEnabled: boolean;
|
|
614
|
+
contradictionSimilarityThreshold: number;
|
|
615
|
+
contradictionMinConfidence: number;
|
|
616
|
+
contradictionAutoResolve: boolean;
|
|
617
|
+
/** Nightly contradiction-scan cron config (issue #520). */
|
|
618
|
+
contradictionScan: ContradictionScanConfig;
|
|
619
|
+
/**
|
|
620
|
+
* When enabled, writes that carry `structuredAttributes` mark any older
|
|
621
|
+
* fact with the same `entityRef + attribute_name` supersession key and a
|
|
622
|
+
* conflicting value as `status: "superseded"`.
|
|
623
|
+
*/
|
|
624
|
+
temporalSupersessionEnabled: boolean;
|
|
625
|
+
/**
|
|
626
|
+
* When enabled, superseded memories are still returned by recall (useful
|
|
627
|
+
* for audit/history queries). Default: false — superseded memories are
|
|
628
|
+
* filtered out.
|
|
629
|
+
*/
|
|
630
|
+
temporalSupersessionIncludeInRecall: boolean;
|
|
631
|
+
/**
|
|
632
|
+
* When true, recall checks whether a single validated memory in a
|
|
633
|
+
* high-trust taxonomy bucket can answer the query before invoking QMD.
|
|
634
|
+
* Default false — enable explicitly after bench validation.
|
|
635
|
+
*/
|
|
636
|
+
recallDirectAnswerEnabled: boolean;
|
|
637
|
+
/**
|
|
638
|
+
* Disclosure auto-escalation policy (issue #677 PR 4/4). When set to
|
|
639
|
+
* `"auto"`, recalls without an explicit caller-supplied disclosure
|
|
640
|
+
* escalate from `chunk` to `section` if the top-K confidence falls
|
|
641
|
+
* below {@link recallDisclosureEscalationThreshold}. `raw` is never
|
|
642
|
+
* auto-selected — it requires an explicit caller request. Default
|
|
643
|
+
* `"manual"` preserves pre-#677 behavior.
|
|
644
|
+
*/
|
|
645
|
+
recallDisclosureEscalation: "manual" | "auto";
|
|
646
|
+
/**
|
|
647
|
+
* Top-K confidence threshold (in `[0, 1]`) below which auto-escalation
|
|
648
|
+
* promotes `chunk` → `section`. Only consulted when
|
|
649
|
+
* {@link recallDisclosureEscalation} is `"auto"`. Default `0.5`.
|
|
650
|
+
*/
|
|
651
|
+
recallDisclosureEscalationThreshold: number;
|
|
652
|
+
/**
|
|
653
|
+
* Graph-based retrieval tier via Personalized PageRank (issue #559 PR 4).
|
|
654
|
+
* When true, recall builds a retrieval graph from memory frontmatter
|
|
655
|
+
* and runs PPR, merging the result with QMD via MMR. Default false —
|
|
656
|
+
* ships off pending the retrieval-graph bench in PR 5.
|
|
657
|
+
*/
|
|
658
|
+
recallGraphEnabled: boolean;
|
|
659
|
+
/** PPR damping factor used when `recallGraphEnabled` is true. */
|
|
660
|
+
recallGraphDamping: number;
|
|
661
|
+
/** PPR power-iteration cap used when `recallGraphEnabled` is true. */
|
|
662
|
+
recallGraphIterations: number;
|
|
663
|
+
/**
|
|
664
|
+
* Max memories returned by the graph tier before MMR. Set to 0 to
|
|
665
|
+
* disable the graph tier's contribution without flipping the flag.
|
|
666
|
+
*/
|
|
667
|
+
recallGraphTopK: number;
|
|
668
|
+
/**
|
|
669
|
+
* Minimum token-overlap ratio (query tokens ∩ memory tokens / query tokens)
|
|
670
|
+
* required for direct-answer eligibility. Set to 0 to disable the gate.
|
|
671
|
+
*/
|
|
672
|
+
recallDirectAnswerTokenOverlapFloor: number;
|
|
673
|
+
/**
|
|
674
|
+
* Minimum calibrated importance score required for direct-answer
|
|
675
|
+
* eligibility. Set to 0 to disable the gate.
|
|
676
|
+
*/
|
|
677
|
+
recallDirectAnswerImportanceFloor: number;
|
|
678
|
+
/**
|
|
679
|
+
* Ambiguity margin: if the second-best candidate scores within this
|
|
680
|
+
* ratio of the top candidate, direct-answer defers to the hybrid tier.
|
|
681
|
+
*/
|
|
682
|
+
recallDirectAnswerAmbiguityMargin: number;
|
|
683
|
+
/**
|
|
684
|
+
* Taxonomy category IDs eligible for direct-answer routing. Memories
|
|
685
|
+
* whose resolved taxonomy category is not in this list never qualify.
|
|
686
|
+
*/
|
|
687
|
+
recallDirectAnswerEligibleTaxonomyBuckets: string[];
|
|
688
|
+
/**
|
|
689
|
+
* Cross-namespace query-budget limiter (issue #565 PR 4/5). When true,
|
|
690
|
+
* a principal that issues a burst of recalls against namespaces other
|
|
691
|
+
* than their own is throttled once its per-window count crosses
|
|
692
|
+
* `recallCrossNamespaceBudgetHardLimit`. Default false — ships disabled.
|
|
693
|
+
*/
|
|
694
|
+
recallCrossNamespaceBudgetEnabled: boolean;
|
|
695
|
+
/** Rolling window in milliseconds over which cross-namespace reads are counted. */
|
|
696
|
+
recallCrossNamespaceBudgetWindowMs: number;
|
|
697
|
+
/**
|
|
698
|
+
* Soft threshold — the first point at which the limiter flags a burst.
|
|
699
|
+
* Calls are still allowed; anomaly detection (issue #565 PR 5) will
|
|
700
|
+
* surface the warning.
|
|
701
|
+
*/
|
|
702
|
+
recallCrossNamespaceBudgetSoftLimit: number;
|
|
703
|
+
/** Hard threshold — calls past this count are denied in the window. */
|
|
704
|
+
recallCrossNamespaceBudgetHardLimit: number;
|
|
705
|
+
/**
|
|
706
|
+
* When true, recall multiplies candidate scores by the Memory Worth
|
|
707
|
+
* factor computed from `mw_success` / `mw_fail` counters on each
|
|
708
|
+
* memory's frontmatter (see `computeMemoryWorth`). Memories with a
|
|
709
|
+
* history of failed sessions sink; neutral / uninstrumented memories
|
|
710
|
+
* are untouched (multiplier 1.0). Default false — flip to true in PR 5
|
|
711
|
+
* once the benchmark shows precision tie-or-win.
|
|
712
|
+
*/
|
|
713
|
+
recallMemoryWorthFilterEnabled: boolean;
|
|
714
|
+
/**
|
|
715
|
+
* Recall-audit anomaly detector (issue #565 PR 5/5). When true,
|
|
716
|
+
* access surfaces run the anomaly detector over a tail of the audit
|
|
717
|
+
* trail after each recall and surface any flags via logs / metrics.
|
|
718
|
+
* Ships disabled.
|
|
719
|
+
*/
|
|
720
|
+
recallAuditAnomalyDetectionEnabled: boolean;
|
|
721
|
+
/** Rolling window over which audit entries are analyzed. */
|
|
722
|
+
recallAuditAnomalyWindowMs: number;
|
|
723
|
+
/** Threshold for the `repeat-query` flag. */
|
|
724
|
+
recallAuditAnomalyRepeatQueryLimit: number;
|
|
725
|
+
/** Threshold for the `namespace-walk` flag (distinct namespaces). */
|
|
726
|
+
recallAuditAnomalyNamespaceWalkLimit: number;
|
|
727
|
+
/** Threshold for the `high-cardinality-return` flag. */
|
|
728
|
+
recallAuditAnomalyHighCardinalityLimit: number;
|
|
729
|
+
/** Threshold for the `rapid-fire` flag. */
|
|
730
|
+
recallAuditAnomalyRapidFireLimit: number;
|
|
731
|
+
/**
|
|
732
|
+
* Optional half-life for Memory Worth decay, in milliseconds. When
|
|
733
|
+
* positive, older outcome observations are exponentially decayed toward
|
|
734
|
+
* the uniform prior. Set to 0 (default) to disable decay and use raw
|
|
735
|
+
* counter values.
|
|
736
|
+
*/
|
|
737
|
+
recallMemoryWorthHalfLifeMs: number;
|
|
738
|
+
memoryLinkingEnabled: boolean;
|
|
739
|
+
threadingEnabled: boolean;
|
|
740
|
+
threadingGapMinutes: number;
|
|
741
|
+
summarizationEnabled: boolean;
|
|
742
|
+
summarizationTriggerCount: number;
|
|
743
|
+
summarizationRecentToKeep: number;
|
|
744
|
+
summarizationImportanceThreshold: number;
|
|
745
|
+
summarizationProtectedTags: string[];
|
|
746
|
+
topicExtractionEnabled: boolean;
|
|
747
|
+
topicExtractionTopN: number;
|
|
748
|
+
transcriptEnabled: boolean;
|
|
749
|
+
transcriptRetentionDays: number;
|
|
750
|
+
/** Channel types to skip from transcript logging (e.g., ["cron"]) */
|
|
751
|
+
transcriptSkipChannelTypes: string[];
|
|
752
|
+
transcriptRecallHours: number;
|
|
753
|
+
maxTranscriptTurns: number;
|
|
754
|
+
maxTranscriptTokens: number;
|
|
755
|
+
checkpointEnabled: boolean;
|
|
756
|
+
checkpointTurns: number;
|
|
757
|
+
compactionResetEnabled: boolean;
|
|
758
|
+
beforeResetTimeoutMs: number;
|
|
759
|
+
initGateTimeoutMs: number;
|
|
760
|
+
flushOnResetEnabled: boolean;
|
|
761
|
+
commandsListEnabled: boolean;
|
|
762
|
+
openclawToolsEnabled: boolean;
|
|
763
|
+
openclawToolSnippetMaxChars: number;
|
|
764
|
+
sessionTogglesEnabled: boolean;
|
|
765
|
+
verboseRecallVisibility: boolean;
|
|
766
|
+
recallTranscriptsEnabled: boolean;
|
|
767
|
+
recallTranscriptRetentionDays: number;
|
|
768
|
+
respectBundledActiveMemoryToggle: boolean;
|
|
769
|
+
activeRecallEnabled: boolean;
|
|
770
|
+
activeRecallAgents: string[] | null;
|
|
771
|
+
activeRecallAllowedChatTypes: ActiveRecallChatType[];
|
|
772
|
+
activeRecallQueryMode: ActiveRecallQueryMode;
|
|
773
|
+
activeRecallPromptStyle: ActiveRecallPromptStyle;
|
|
774
|
+
activeRecallCustomInstruction: string | null;
|
|
775
|
+
activeRecallPromptAppend: string | null;
|
|
776
|
+
activeRecallMaxSummaryChars: number;
|
|
777
|
+
activeRecallRecentUserTurns: number;
|
|
778
|
+
activeRecallRecentAssistantTurns: number;
|
|
779
|
+
activeRecallRecentUserChars: number;
|
|
780
|
+
activeRecallRecentAssistantChars: number;
|
|
781
|
+
activeRecallThinking: ActiveRecallThinking;
|
|
782
|
+
activeRecallTimeoutMs: number;
|
|
783
|
+
activeRecallCacheTtlMs: number;
|
|
784
|
+
activeRecallModel: string | null;
|
|
785
|
+
activeRecallModelFallbackPolicy: ActiveRecallModelFallbackPolicy;
|
|
786
|
+
activeRecallPersistTranscripts: boolean;
|
|
787
|
+
activeRecallTranscriptDir: string;
|
|
788
|
+
activeRecallEntityGraphDepth: number;
|
|
789
|
+
activeRecallIncludeCausalTrajectories: boolean;
|
|
790
|
+
activeRecallIncludeDaySummary: boolean;
|
|
791
|
+
activeRecallAttachRecallExplain: boolean;
|
|
792
|
+
activeRecallAllowChainedActiveMemory: boolean;
|
|
793
|
+
dreaming: DreamingConfig;
|
|
794
|
+
/**
|
|
795
|
+
* Unified dreams-phases config block (issue #678 PR 2/4).
|
|
796
|
+
* Groups existing lifecycle, REM, and deep-sleep gates under one namespace.
|
|
797
|
+
* Values here WIN over equivalent legacy top-level keys when set. See docs/dreams.md.
|
|
798
|
+
*/
|
|
799
|
+
dreamsPhases: DreamsPhasesConfig;
|
|
800
|
+
procedural: ProceduralConfig;
|
|
801
|
+
/**
|
|
802
|
+
* At-rest encryption configuration (issue #690 PR 3/4).
|
|
803
|
+
*
|
|
804
|
+
* When `secureStoreEnabled` is true, `StorageManager` reads and
|
|
805
|
+
* writes memory files through the `secure-fs` encryption layer.
|
|
806
|
+
* The store must be unlocked via `remnic secure-store unlock` before
|
|
807
|
+
* any recall or store operations will succeed.
|
|
808
|
+
*
|
|
809
|
+
* When `secureStoreEncryptOnWrite` is true (the default when enabled),
|
|
810
|
+
* every new memory write is encrypted. Set to false to pause new
|
|
811
|
+
* encryptions while still being able to decrypt existing files.
|
|
812
|
+
*/
|
|
813
|
+
secureStoreEnabled: boolean;
|
|
814
|
+
/** Encrypt new writes when the secure-store is unlocked. Default true. */
|
|
815
|
+
secureStoreEncryptOnWrite: boolean;
|
|
816
|
+
codingMode: CodingModeConfig;
|
|
817
|
+
heartbeat: HeartbeatConfig;
|
|
818
|
+
slotBehavior: SlotBehaviorConfig;
|
|
819
|
+
codexCompat: CodexCompatConfig;
|
|
820
|
+
/**
|
|
821
|
+
* When true (default), the extraction prompt instructs the LLM to classify
|
|
822
|
+
* each fact as `"project"` or `"global"` scope. Global-scoped facts are
|
|
823
|
+
* promoted to the shared namespace so they are visible across all projects.
|
|
824
|
+
* When false, all facts go to whatever namespace the session is in (pre-
|
|
825
|
+
* scope-classification behavior). Rule 30: configuration gate.
|
|
826
|
+
*/
|
|
827
|
+
extractionScopeClassificationEnabled: boolean;
|
|
828
|
+
/** Enable the LLM-as-judge fact-worthiness gate on extracted facts. Default false (opt-in). */
|
|
829
|
+
extractionJudgeEnabled: boolean;
|
|
830
|
+
/** Model override for the judge LLM. Empty string means use the local model. */
|
|
831
|
+
extractionJudgeModel: string;
|
|
832
|
+
/** Maximum number of candidate facts per judge LLM batch call. */
|
|
833
|
+
extractionJudgeBatchSize: number;
|
|
834
|
+
/** Shadow mode: log judge verdicts but do not filter facts. Default false. */
|
|
835
|
+
extractionJudgeShadow: boolean;
|
|
836
|
+
/**
|
|
837
|
+
* Maximum number of times the same candidate text may be deferred before
|
|
838
|
+
* the judge forcibly converts the verdict to `"reject"`. Prevents
|
|
839
|
+
* pathological LLM responses from looping forever on ambiguous facts.
|
|
840
|
+
* Defaults to 2 (issue #562, PR 2).
|
|
841
|
+
*/
|
|
842
|
+
extractionJudgeMaxDeferrals: number;
|
|
843
|
+
/**
|
|
844
|
+
* Emit structured telemetry rows to
|
|
845
|
+
* `state/observation-ledger/extraction-judge-verdicts.jsonl` on every
|
|
846
|
+
* judge verdict. Off by default; enable to collect defer-rate / latency
|
|
847
|
+
* metrics for operator dashboards (issue #562, PR 3).
|
|
848
|
+
*/
|
|
849
|
+
extractionJudgeTelemetryEnabled: boolean;
|
|
850
|
+
/**
|
|
851
|
+
* Collect `(candidate_text, verdict_kind, reason)` tuples into
|
|
852
|
+
* `~/.remnic/judge-training/<date>.jsonl` for use by a future GRPO
|
|
853
|
+
* training pipeline (issue #562, PR 4). Off by default. Rows live in
|
|
854
|
+
* the user's home directory rather than the shared memory directory so
|
|
855
|
+
* they are not committed, sync'd, or bundled into memory exports.
|
|
856
|
+
*/
|
|
857
|
+
collectJudgeTrainingPairs: boolean;
|
|
858
|
+
/**
|
|
859
|
+
* Override directory for judge training-pair collection. Empty string
|
|
860
|
+
* means use the default (`~/.remnic/judge-training`). Primarily for
|
|
861
|
+
* tests and for operators who want the output to land in a specific
|
|
862
|
+
* location.
|
|
863
|
+
*/
|
|
864
|
+
judgeTrainingDir: string;
|
|
865
|
+
hourlySummariesEnabled: boolean;
|
|
866
|
+
daySummaryEnabled: boolean;
|
|
867
|
+
/** If true, Engram may attempt to auto-register an hourly summary cron job (default off). */
|
|
868
|
+
hourlySummaryCronAutoRegister: boolean;
|
|
869
|
+
/** If true, Engram may attempt to auto-register the nightly governance cron job (default off). */
|
|
870
|
+
nightlyGovernanceCronAutoRegister: boolean;
|
|
871
|
+
summaryRecallHours: number;
|
|
872
|
+
maxSummaryCount: number;
|
|
873
|
+
summaryModel: string;
|
|
874
|
+
hourlySummariesExtendedEnabled: boolean;
|
|
875
|
+
hourlySummariesIncludeToolStats: boolean;
|
|
876
|
+
hourlySummariesIncludeSystemMessages: boolean;
|
|
877
|
+
hourlySummariesMaxTurnsPerRun: number;
|
|
878
|
+
conversationIndexEnabled: boolean;
|
|
879
|
+
conversationIndexBackend: "qmd" | "faiss";
|
|
880
|
+
conversationIndexQmdCollection: string;
|
|
881
|
+
conversationIndexRetentionDays: number;
|
|
882
|
+
conversationIndexMinUpdateIntervalMs: number;
|
|
883
|
+
conversationIndexEmbedOnUpdate: boolean;
|
|
884
|
+
conversationIndexFaissScriptPath?: string;
|
|
885
|
+
conversationIndexFaissPythonBin?: string;
|
|
886
|
+
conversationIndexFaissModelId: string;
|
|
887
|
+
conversationIndexFaissIndexDir: string;
|
|
888
|
+
conversationIndexFaissUpsertTimeoutMs: number;
|
|
889
|
+
conversationIndexFaissSearchTimeoutMs: number;
|
|
890
|
+
conversationIndexFaissHealthTimeoutMs: number;
|
|
891
|
+
conversationIndexFaissMaxBatchSize: number;
|
|
892
|
+
conversationIndexFaissMaxSearchK: number;
|
|
893
|
+
conversationRecallTopK: number;
|
|
894
|
+
conversationRecallMaxChars: number;
|
|
895
|
+
conversationRecallTimeoutMs: number;
|
|
896
|
+
evalHarnessEnabled: boolean;
|
|
897
|
+
evalShadowModeEnabled: boolean;
|
|
898
|
+
benchmarkBaselineSnapshotsEnabled: boolean;
|
|
899
|
+
benchmarkDeltaReporterEnabled: boolean;
|
|
900
|
+
benchmarkStoredBaselineEnabled: boolean;
|
|
901
|
+
evalStoreDir: string;
|
|
902
|
+
objectiveStateMemoryEnabled: boolean;
|
|
903
|
+
objectiveStateSnapshotWritesEnabled: boolean;
|
|
904
|
+
objectiveStateRecallEnabled: boolean;
|
|
905
|
+
objectiveStateStoreDir: string;
|
|
906
|
+
causalTrajectoryMemoryEnabled: boolean;
|
|
907
|
+
causalTrajectoryStoreDir: string;
|
|
908
|
+
causalTrajectoryRecallEnabled: boolean;
|
|
909
|
+
actionGraphRecallEnabled: boolean;
|
|
910
|
+
trustZonesEnabled: boolean;
|
|
911
|
+
quarantinePromotionEnabled: boolean;
|
|
912
|
+
trustZoneStoreDir: string;
|
|
913
|
+
trustZoneRecallEnabled: boolean;
|
|
914
|
+
memoryPoisoningDefenseEnabled: boolean;
|
|
915
|
+
memoryRedTeamBenchEnabled: boolean;
|
|
916
|
+
harmonicRetrievalEnabled: boolean;
|
|
917
|
+
abstractionAnchorsEnabled: boolean;
|
|
918
|
+
abstractionNodeStoreDir: string;
|
|
919
|
+
verifiedRecallEnabled: boolean;
|
|
920
|
+
semanticRulePromotionEnabled: boolean;
|
|
921
|
+
semanticRuleVerificationEnabled: boolean;
|
|
922
|
+
semanticConsolidationEnabled: boolean;
|
|
923
|
+
semanticConsolidationModel: string;
|
|
924
|
+
semanticConsolidationThreshold: number;
|
|
925
|
+
semanticConsolidationMinClusterSize: number;
|
|
926
|
+
semanticConsolidationExcludeCategories: string[];
|
|
927
|
+
semanticConsolidationIntervalHours: number;
|
|
928
|
+
semanticConsolidationMaxPerRun: number;
|
|
929
|
+
/**
|
|
930
|
+
* When true (default), semantic-consolidation prompts the LLM with an
|
|
931
|
+
* operator-aware format asking for JSON `{operator, output}` and records
|
|
932
|
+
* the resulting SPLIT/MERGE/UPDATE operator on `derived_via`. When
|
|
933
|
+
* false, falls back to the legacy plain-text prompt — `derived_via` is
|
|
934
|
+
* still populated via the cluster-shape heuristic in
|
|
935
|
+
* `chooseConsolidationOperator`. Issue #561 PR 3.
|
|
936
|
+
*/
|
|
937
|
+
operatorAwareConsolidationEnabled: boolean;
|
|
938
|
+
/**
|
|
939
|
+
* When true, the pattern-reinforcement maintenance job runs on its
|
|
940
|
+
* configured cadence and clusters duplicate non-procedural memories
|
|
941
|
+
* by normalized content. Clusters with `>= patternReinforcementMinCount`
|
|
942
|
+
* members produce a canonical (most-recent) memory tagged with
|
|
943
|
+
* `reinforcement_count` + `last_reinforced_at`; the older duplicates
|
|
944
|
+
* are marked `superseded` and pointed at the canonical. Default
|
|
945
|
+
* `false` — opt-in until bench validation lands.
|
|
946
|
+
*/
|
|
947
|
+
patternReinforcementEnabled: boolean;
|
|
948
|
+
/**
|
|
949
|
+
* Minimum interval (ms) between pattern-reinforcement runs. Default
|
|
950
|
+
* `7 * 24 * 60 * 60 * 1000` (7 days). Set to `0` to disable cadence
|
|
951
|
+
* gating (useful for tests / manual invocation).
|
|
952
|
+
*/
|
|
953
|
+
patternReinforcementCadenceMs: number;
|
|
954
|
+
/**
|
|
955
|
+
* Minimum cluster size before pattern reinforcement promotes a
|
|
956
|
+
* canonical and supersedes duplicates. Default `3`. Clamped to
|
|
957
|
+
* `>= 2` at config-parse time — a "cluster of 1" is just a single
|
|
958
|
+
* memory and a "cluster of 0" is meaningless.
|
|
959
|
+
*/
|
|
960
|
+
patternReinforcementMinCount: number;
|
|
961
|
+
/**
|
|
962
|
+
* Memory categories the pattern-reinforcement job considers.
|
|
963
|
+
* Default `["preference", "fact", "decision"]`. The job
|
|
964
|
+
* intentionally skips procedural memories so it stays disjoint from
|
|
965
|
+
* the procedural mining pipeline.
|
|
966
|
+
*/
|
|
967
|
+
patternReinforcementCategories: string[];
|
|
968
|
+
/** issue #687 PR 3/4: opt-in recall score boost for reinforced memories. Default false. */
|
|
969
|
+
reinforcementRecallBoostEnabled: boolean;
|
|
970
|
+
/** Score bonus per unit of reinforcement_count. Range [0, 1]. Default 0.05. */
|
|
971
|
+
reinforcementRecallBoostWeight: number;
|
|
972
|
+
/** Maximum additive reinforcement boost per result. Range [0, 1]. Default 0.3. */
|
|
973
|
+
reinforcementRecallBoostMax: number;
|
|
974
|
+
/**
|
|
975
|
+
* Async peer profile reasoner — issue #679 PR 2/5.
|
|
976
|
+
*
|
|
977
|
+
* Default `false` (opt-in). When enabled, the reasoner runs after
|
|
978
|
+
* `runSemanticConsolidation` (the REM phase of the dreams pipeline)
|
|
979
|
+
* and updates per-peer profile.md files with provenance-tagged
|
|
980
|
+
* field updates derived from the peer's interaction log.
|
|
981
|
+
*/
|
|
982
|
+
peerProfileReasonerEnabled: boolean;
|
|
983
|
+
/**
|
|
984
|
+
* Model identifier used by the peer profile reasoner. Logged for
|
|
985
|
+
* telemetry only — actual dispatch is via the same FallbackLlmClient
|
|
986
|
+
* the orchestrator uses for semantic consolidation. Default `gpt-5.2`.
|
|
987
|
+
*/
|
|
988
|
+
peerProfileReasonerModel: string;
|
|
989
|
+
/**
|
|
990
|
+
* Minimum new interaction-log entries a peer must accumulate since
|
|
991
|
+
* the previous reasoner run before being processed again. Default 5.
|
|
992
|
+
* Setting to 0 forces every run to consider every peer.
|
|
993
|
+
*/
|
|
994
|
+
peerProfileReasonerMinInteractions: number;
|
|
995
|
+
/**
|
|
996
|
+
* Hard cap on the total number of profile fields the reasoner will
|
|
997
|
+
* apply across all peers in a single run. Default 8.
|
|
998
|
+
*/
|
|
999
|
+
peerProfileReasonerMaxFieldsPerRun: number;
|
|
1000
|
+
/**
|
|
1001
|
+
* When true, inject the active peer's profile fields into the recall
|
|
1002
|
+
* context as a "## Peer Profile" section. Default false (opt-in,
|
|
1003
|
+
* Gotcha #30/#48 — least-privileged default). Requires the session's
|
|
1004
|
+
* peer ID to be registered via `setPeerIdForSession` before recall.
|
|
1005
|
+
*/
|
|
1006
|
+
peerProfileRecallEnabled: boolean;
|
|
1007
|
+
/**
|
|
1008
|
+
* Maximum number of peer profile fields to inject per recall. Only
|
|
1009
|
+
* the most-recently-updated N fields are included to keep the context
|
|
1010
|
+
* budget predictable. Default 5. Setting to 0 disables field
|
|
1011
|
+
* injection even when `peerProfileRecallEnabled` is true.
|
|
1012
|
+
*/
|
|
1013
|
+
peerProfileRecallMaxFields: number;
|
|
1014
|
+
creationMemoryEnabled: boolean;
|
|
1015
|
+
memoryUtilityLearningEnabled: boolean;
|
|
1016
|
+
promotionByOutcomeEnabled: boolean;
|
|
1017
|
+
commitmentLedgerEnabled: boolean;
|
|
1018
|
+
commitmentLifecycleEnabled: boolean;
|
|
1019
|
+
commitmentStaleDays: number;
|
|
1020
|
+
commitmentLedgerDir: string;
|
|
1021
|
+
resumeBundlesEnabled: boolean;
|
|
1022
|
+
resumeBundleDir: string;
|
|
1023
|
+
workProductRecallEnabled: boolean;
|
|
1024
|
+
workProductLedgerDir: string;
|
|
1025
|
+
workTasksEnabled: boolean;
|
|
1026
|
+
workProjectsEnabled: boolean;
|
|
1027
|
+
workTasksDir: string;
|
|
1028
|
+
workProjectsDir: string;
|
|
1029
|
+
workIndexEnabled: boolean;
|
|
1030
|
+
workIndexDir: string;
|
|
1031
|
+
workTaskIndexEnabled: boolean;
|
|
1032
|
+
workProjectIndexEnabled: boolean;
|
|
1033
|
+
workIndexAutoRebuildEnabled: boolean;
|
|
1034
|
+
workIndexAutoRebuildDebounceMs: number;
|
|
1035
|
+
localLlmEnabled: boolean;
|
|
1036
|
+
localLlmUrl: string;
|
|
1037
|
+
localLlmModel: string;
|
|
1038
|
+
/** Optional API key for authenticated OpenAI-compatible endpoints. */
|
|
1039
|
+
localLlmApiKey?: string;
|
|
1040
|
+
/** Additional headers for local/compatible endpoint requests. */
|
|
1041
|
+
localLlmHeaders?: Record<string, string>;
|
|
1042
|
+
/** If false, do not send Authorization header even when localLlmApiKey is set. */
|
|
1043
|
+
localLlmAuthHeader: boolean;
|
|
1044
|
+
localLlmFallback: boolean;
|
|
1045
|
+
/** Optional home directory override for local LLM helpers (LM Studio settings, CLI PATH). */
|
|
1046
|
+
localLlmHomeDir?: string;
|
|
1047
|
+
/** Optional absolute path to LMS CLI binary (preferred over auto-detection). */
|
|
1048
|
+
localLmsCliPath?: string;
|
|
1049
|
+
/** Optional bin directory prepended to PATH for LMS CLI execution. */
|
|
1050
|
+
localLmsBinDir?: string;
|
|
1051
|
+
/** Hard timeout for local LLM requests (ms). */
|
|
1052
|
+
localLlmTimeoutMs: number;
|
|
1053
|
+
/** Max context window for local LLM (override auto-detection). Set lower if your LLM server defaults to smaller contexts. */
|
|
1054
|
+
localLlmMaxContext?: number;
|
|
1055
|
+
/** If true, log slow operations (local LLM + related I/O) with durations and metadata (no content). */
|
|
1056
|
+
slowLogEnabled: boolean;
|
|
1057
|
+
/**
|
|
1058
|
+
* If true, include the full recalled memory text in `RecallTraceEvent.recalledContent`.
|
|
1059
|
+
* Disabled by default — enable only when you want external trace subscribers (e.g. Langfuse)
|
|
1060
|
+
* to see the exact memory context injected into each conversation turn.
|
|
1061
|
+
* This adds payload to trace events but does not log to files or the gateway log.
|
|
1062
|
+
*/
|
|
1063
|
+
traceRecallContent: boolean;
|
|
1064
|
+
/** Threshold for slow operation logging (ms). */
|
|
1065
|
+
slowLogThresholdMs: number;
|
|
1066
|
+
/** If true, collect and persist timing traces for recall and extraction pipelines. */
|
|
1067
|
+
profilingEnabled: boolean;
|
|
1068
|
+
/** Directory for profiling trace JSONL files. Defaults to <memoryDir>/profiling. */
|
|
1069
|
+
profilingStorageDir: string;
|
|
1070
|
+
/** Maximum number of trace files to keep (rolling window). */
|
|
1071
|
+
profilingMaxTraces: number;
|
|
1072
|
+
extractionDedupeEnabled: boolean;
|
|
1073
|
+
extractionDedupeWindowMs: number;
|
|
1074
|
+
extractionMinChars: number;
|
|
1075
|
+
extractionMinUserTurns: number;
|
|
1076
|
+
extractionMaxTurnChars: number;
|
|
1077
|
+
extractionMaxFactsPerRun: number;
|
|
1078
|
+
extractionMaxEntitiesPerRun: number;
|
|
1079
|
+
extractionMaxQuestionsPerRun: number;
|
|
1080
|
+
extractionMaxProfileUpdatesPerRun: number;
|
|
1081
|
+
/**
|
|
1082
|
+
* Minimum importance level required to persist an extracted fact. Facts
|
|
1083
|
+
* whose locally-scored level falls below this threshold are dropped before
|
|
1084
|
+
* write and counted toward the `importance_gated` metric. Defaults to
|
|
1085
|
+
* "low" so trivial content (greetings, single-word replies, filler) is
|
|
1086
|
+
* silently dropped while everything else still passes.
|
|
1087
|
+
*/
|
|
1088
|
+
extractionMinImportanceLevel: ImportanceLevel;
|
|
1089
|
+
/**
|
|
1090
|
+
* Inline source attribution (issue #369).
|
|
1091
|
+
* When enabled, extracted facts carry a compact provenance tag (agent,
|
|
1092
|
+
* session, timestamp) inlined into the fact text — not just in YAML
|
|
1093
|
+
* frontmatter — so the citation survives hostile memory text, copy/paste,
|
|
1094
|
+
* and LLM quoting. Off by default to preserve backwards compatibility
|
|
1095
|
+
* with existing downstream consumers that expect raw fact text.
|
|
1096
|
+
*/
|
|
1097
|
+
inlineSourceAttributionEnabled: boolean;
|
|
1098
|
+
/**
|
|
1099
|
+
* Template used when injecting inline citations. Supported placeholders:
|
|
1100
|
+
* `{agent}`, `{session}`, `{sessionId}`, `{ts}`, `{date}`. Defaults to
|
|
1101
|
+
* `[Source: agent={agent}, session={sessionId}, ts={ts}]`.
|
|
1102
|
+
*/
|
|
1103
|
+
inlineSourceAttributionFormat: string;
|
|
1104
|
+
consolidationRequireNonZeroExtraction: boolean;
|
|
1105
|
+
consolidationMinIntervalMs: number;
|
|
1106
|
+
qmdMaintenanceEnabled: boolean;
|
|
1107
|
+
qmdMaintenanceDebounceMs: number;
|
|
1108
|
+
qmdAutoEmbedEnabled: boolean;
|
|
1109
|
+
qmdEmbedMinIntervalMs: number;
|
|
1110
|
+
qmdUpdateTimeoutMs: number;
|
|
1111
|
+
qmdUpdateMinIntervalMs: number;
|
|
1112
|
+
localLlmRetry5xxCount: number;
|
|
1113
|
+
localLlmRetryBackoffMs: number;
|
|
1114
|
+
localLlm400TripThreshold: number;
|
|
1115
|
+
localLlm400CooldownMs: number;
|
|
1116
|
+
localLlmFastEnabled: boolean;
|
|
1117
|
+
localLlmFastModel: string;
|
|
1118
|
+
localLlmFastUrl: string;
|
|
1119
|
+
localLlmFastTimeoutMs: number;
|
|
1120
|
+
/**
|
|
1121
|
+
* Suppress chain-of-thought / thinking mode on the main local LLM
|
|
1122
|
+
* (issue #548). When true, Remnic injects
|
|
1123
|
+
* `chat_template_kwargs: { enable_thinking: false }` on every
|
|
1124
|
+
* request so thinking-capable models (Qwen 3.5, Gemma 4, DeepSeek,
|
|
1125
|
+
* etc.) skip reasoning tokens that structured-output tasks like
|
|
1126
|
+
* extraction and consolidation cannot benefit from. Default: true
|
|
1127
|
+
* — the dominant localLlm use case is JSON-shaped extraction where
|
|
1128
|
+
* thinking is pure latency tax and a common cause of 60s timeouts.
|
|
1129
|
+
* Set to false to restore thinking for narrative tasks.
|
|
1130
|
+
*
|
|
1131
|
+
* The fast-tier client (`fastLlm`) always disables thinking; that
|
|
1132
|
+
* contract is baked into "fast tier" and is unaffected by this flag.
|
|
1133
|
+
*/
|
|
1134
|
+
localLlmDisableThinking: boolean;
|
|
1135
|
+
gatewayConfig?: GatewayConfig;
|
|
1136
|
+
modelSource: "plugin" | "gateway";
|
|
1137
|
+
gatewayAgentId: string;
|
|
1138
|
+
fastGatewayAgentId: string;
|
|
1139
|
+
namespacesEnabled: boolean;
|
|
1140
|
+
defaultNamespace: string;
|
|
1141
|
+
sharedNamespace: string;
|
|
1142
|
+
principalFromSessionKeyMode: PrincipalFromSessionKeyMode;
|
|
1143
|
+
principalFromSessionKeyRules: PrincipalRule[];
|
|
1144
|
+
namespacePolicies: NamespacePolicy[];
|
|
1145
|
+
defaultRecallNamespaces: Array<"self" | "shared">;
|
|
1146
|
+
cronRecallMode: CronRecallMode;
|
|
1147
|
+
cronRecallAllowlist: string[];
|
|
1148
|
+
cronRecallPolicyEnabled: boolean;
|
|
1149
|
+
cronRecallNormalizedQueryMaxChars: number;
|
|
1150
|
+
cronRecallInstructionHeavyTokenCap: number;
|
|
1151
|
+
cronConversationRecallMode: CronConversationRecallMode;
|
|
1152
|
+
autoPromoteToSharedEnabled: boolean;
|
|
1153
|
+
autoPromoteToSharedCategories: Array<"fact" | "correction" | "decision" | "preference">;
|
|
1154
|
+
autoPromoteMinConfidenceTier: ConfidenceTier;
|
|
1155
|
+
routingRulesEnabled: boolean;
|
|
1156
|
+
routingRulesStateFile: string;
|
|
1157
|
+
sharedContextEnabled: boolean;
|
|
1158
|
+
sharedContextDir?: string;
|
|
1159
|
+
sharedContextMaxInjectChars: number;
|
|
1160
|
+
crossSignalsSemanticEnabled: boolean;
|
|
1161
|
+
crossSignalsSemanticTimeoutMs: number;
|
|
1162
|
+
sharedCrossSignalSemanticEnabled?: boolean;
|
|
1163
|
+
sharedCrossSignalSemanticTimeoutMs?: number;
|
|
1164
|
+
sharedCrossSignalSemanticMaxCandidates?: number;
|
|
1165
|
+
compoundingEnabled: boolean;
|
|
1166
|
+
compoundingWeeklyCronEnabled: boolean;
|
|
1167
|
+
compoundingSemanticEnabled: boolean;
|
|
1168
|
+
compoundingSynthesisTimeoutMs: number;
|
|
1169
|
+
compoundingInjectEnabled: boolean;
|
|
1170
|
+
ircEnabled: boolean;
|
|
1171
|
+
ircMaxPreferences: number;
|
|
1172
|
+
ircIncludeCorrections: boolean;
|
|
1173
|
+
ircMinConfidence: number;
|
|
1174
|
+
cmcEnabled: boolean;
|
|
1175
|
+
cmcStitchLookbackDays: number;
|
|
1176
|
+
cmcStitchMinScore: number;
|
|
1177
|
+
cmcStitchMaxEdgesPerTrajectory: number;
|
|
1178
|
+
cmcConsolidationEnabled: boolean;
|
|
1179
|
+
cmcConsolidationMinRecurrence: number;
|
|
1180
|
+
cmcConsolidationMinSessions: number;
|
|
1181
|
+
cmcConsolidationSuccessThreshold: number;
|
|
1182
|
+
cmcRetrievalEnabled: boolean;
|
|
1183
|
+
cmcRetrievalMaxDepth: number;
|
|
1184
|
+
cmcRetrievalMaxChars: number;
|
|
1185
|
+
cmcRetrievalCounterfactualBoost: number;
|
|
1186
|
+
cmcBehaviorLearningEnabled: boolean;
|
|
1187
|
+
cmcBehaviorMinFrequency: number;
|
|
1188
|
+
cmcBehaviorMinSessions: number;
|
|
1189
|
+
cmcBehaviorConfidenceThreshold: number;
|
|
1190
|
+
cmcLifecycleCausalImpactWeight: number;
|
|
1191
|
+
calibrationEnabled: boolean;
|
|
1192
|
+
calibrationMaxRulesPerRecall: number;
|
|
1193
|
+
calibrationMaxChars: number;
|
|
1194
|
+
searchBackend?: "qmd" | "remote" | "noop" | "lancedb" | "meilisearch" | "orama";
|
|
1195
|
+
remoteSearchBaseUrl?: string;
|
|
1196
|
+
remoteSearchApiKey?: string;
|
|
1197
|
+
remoteSearchTimeoutMs?: number;
|
|
1198
|
+
lancedbEnabled: boolean;
|
|
1199
|
+
lanceDbPath?: string;
|
|
1200
|
+
lanceEmbeddingDimension?: number;
|
|
1201
|
+
meilisearchEnabled: boolean;
|
|
1202
|
+
meilisearchHost?: string;
|
|
1203
|
+
meilisearchApiKey?: string;
|
|
1204
|
+
meilisearchTimeoutMs?: number;
|
|
1205
|
+
meilisearchAutoIndex?: boolean;
|
|
1206
|
+
oramaEnabled: boolean;
|
|
1207
|
+
oramaDbPath?: string;
|
|
1208
|
+
oramaEmbeddingDimension?: number;
|
|
1209
|
+
qmdDaemonEnabled: boolean;
|
|
1210
|
+
qmdDaemonUrl: string;
|
|
1211
|
+
qmdDaemonRecheckIntervalMs: number;
|
|
1212
|
+
qmdIntentHintsEnabled: boolean;
|
|
1213
|
+
qmdExplainEnabled: boolean;
|
|
1214
|
+
knowledgeIndexEnabled: boolean;
|
|
1215
|
+
knowledgeIndexMaxEntities: number;
|
|
1216
|
+
knowledgeIndexMaxChars: number;
|
|
1217
|
+
entityRetrievalEnabled: boolean;
|
|
1218
|
+
entityRetrievalMaxChars: number;
|
|
1219
|
+
entityRetrievalMaxHints: number;
|
|
1220
|
+
entityRetrievalMaxSupportingFacts: number;
|
|
1221
|
+
entityRetrievalMaxRelatedEntities: number;
|
|
1222
|
+
entityRetrievalRecentTurns: number;
|
|
1223
|
+
entitySchemas?: Record<string, EntitySchemaDefinition>;
|
|
1224
|
+
recallBudgetChars: number;
|
|
1225
|
+
recallOuterTimeoutMs: number;
|
|
1226
|
+
recallCoreDeadlineMs: number;
|
|
1227
|
+
recallEnrichmentDeadlineMs: number;
|
|
1228
|
+
recallPipeline: RecallSectionConfig[];
|
|
1229
|
+
/** Apply Maximal Marginal Relevance to the final recall selection per-section. */
|
|
1230
|
+
recallMmrEnabled: boolean;
|
|
1231
|
+
/** MMR λ parameter. 1.0 = pure relevance, 0.0 = pure diversity. Default 0.7. */
|
|
1232
|
+
recallMmrLambda: number;
|
|
1233
|
+
/** MMR is applied over the top N candidates per section. Default 40. */
|
|
1234
|
+
recallMmrTopN: number;
|
|
1235
|
+
/**
|
|
1236
|
+
* Boost stored `reasoning_trace` memories in recall results when the
|
|
1237
|
+
* incoming query reads like a problem-solving ask (e.g. "how do I…",
|
|
1238
|
+
* "step by step", "walk me through…"). Default false — opt in after
|
|
1239
|
+
* benchmarking (issue #564 PR 3).
|
|
1240
|
+
*/
|
|
1241
|
+
recallReasoningTraceBoostEnabled: boolean;
|
|
1242
|
+
qmdRecallCacheTtlMs: number;
|
|
1243
|
+
qmdRecallCacheStaleTtlMs: number;
|
|
1244
|
+
qmdRecallCacheMaxEntries: number;
|
|
1245
|
+
entityRelationshipsEnabled: boolean;
|
|
1246
|
+
entityActivityLogEnabled: boolean;
|
|
1247
|
+
entityActivityLogMaxEntries: number;
|
|
1248
|
+
entityAliasesEnabled: boolean;
|
|
1249
|
+
entitySummaryEnabled: boolean;
|
|
1250
|
+
entitySynthesisMaxTokens: number;
|
|
1251
|
+
/** Enable content-hash deduplication to prevent storing semantically identical facts. */
|
|
1252
|
+
factDeduplicationEnabled: boolean;
|
|
1253
|
+
/**
|
|
1254
|
+
* Issue #373 — Write-time semantic similarity guard. When enabled (default),
|
|
1255
|
+
* the orchestrator embeds each candidate fact and queries the existing
|
|
1256
|
+
* embedding index for its top-K nearest neighbors. If the best cosine
|
|
1257
|
+
* similarity is at or above `semanticDedupThreshold`, the fact is dropped
|
|
1258
|
+
* as a near-duplicate. Fails open (keeps the fact) if the embedding backend
|
|
1259
|
+
* is unavailable.
|
|
1260
|
+
*/
|
|
1261
|
+
semanticDedupEnabled: boolean;
|
|
1262
|
+
/** Cosine similarity threshold in [0, 1] above which a candidate fact is skipped. */
|
|
1263
|
+
semanticDedupThreshold: number;
|
|
1264
|
+
/** Number of nearest-neighbor candidates to consider during semantic dedup. */
|
|
1265
|
+
semanticDedupCandidates: number;
|
|
1266
|
+
/** Enable automatic archival of old, low-importance, rarely-accessed facts. */
|
|
1267
|
+
factArchivalEnabled: boolean;
|
|
1268
|
+
/** Minimum age in days before a fact is eligible for archival. */
|
|
1269
|
+
factArchivalAgeDays: number;
|
|
1270
|
+
/** Maximum importance score for archival eligibility (0-1). Only facts below this are archived. */
|
|
1271
|
+
factArchivalMaxImportance: number;
|
|
1272
|
+
/** Maximum access count for archival eligibility. Only rarely-accessed facts are archived. */
|
|
1273
|
+
factArchivalMaxAccessCount: number;
|
|
1274
|
+
/** Tags that protect a fact from archival regardless of other criteria. */
|
|
1275
|
+
factArchivalProtectedCategories: string[];
|
|
1276
|
+
lifecyclePolicyEnabled: boolean;
|
|
1277
|
+
lifecycleFilterStaleEnabled: boolean;
|
|
1278
|
+
lifecyclePromoteHeatThreshold: number;
|
|
1279
|
+
lifecycleStaleDecayThreshold: number;
|
|
1280
|
+
lifecycleArchiveDecayThreshold: number;
|
|
1281
|
+
lifecycleProtectedCategories: MemoryCategory[];
|
|
1282
|
+
lifecycleMetricsEnabled: boolean;
|
|
1283
|
+
proactiveExtractionEnabled: boolean;
|
|
1284
|
+
contextCompressionActionsEnabled: boolean;
|
|
1285
|
+
compressionGuidelineLearningEnabled: boolean;
|
|
1286
|
+
compressionGuidelineSemanticRefinementEnabled: boolean;
|
|
1287
|
+
compressionGuidelineSemanticTimeoutMs: number;
|
|
1288
|
+
maxProactiveQuestionsPerExtraction: number;
|
|
1289
|
+
proactiveExtractionTimeoutMs: number;
|
|
1290
|
+
proactiveExtractionMaxTokens: number;
|
|
1291
|
+
extractionMaxOutputTokens: number;
|
|
1292
|
+
proactiveExtractionCategoryAllowlist?: MemoryCategory[];
|
|
1293
|
+
maxCompressionTokensPerHour: number;
|
|
1294
|
+
behaviorLoopAutoTuneEnabled: boolean;
|
|
1295
|
+
behaviorLoopLearningWindowDays: number;
|
|
1296
|
+
behaviorLoopMinSignalCount: number;
|
|
1297
|
+
behaviorLoopMaxDeltaPerCycle: number;
|
|
1298
|
+
behaviorLoopProtectedParams: string[];
|
|
1299
|
+
recallPlannerEnabled: boolean;
|
|
1300
|
+
recallPlannerModel: string;
|
|
1301
|
+
recallPlannerTimeoutMs: number;
|
|
1302
|
+
recallPlannerUseResponsesApi: boolean;
|
|
1303
|
+
recallPlannerMaxPromptChars: number;
|
|
1304
|
+
recallPlannerMaxMemoryHints: number;
|
|
1305
|
+
recallPlannerShadowMode: boolean;
|
|
1306
|
+
recallPlannerTelemetryEnabled: boolean;
|
|
1307
|
+
recallPlannerMaxQmdResultsMinimal: number;
|
|
1308
|
+
recallPlannerMaxQmdResultsFull: number;
|
|
1309
|
+
intentRoutingEnabled: boolean;
|
|
1310
|
+
intentRoutingBoost: number;
|
|
1311
|
+
verbatimArtifactsEnabled: boolean;
|
|
1312
|
+
verbatimArtifactsMinConfidence: number;
|
|
1313
|
+
verbatimArtifactsMaxRecall: number;
|
|
1314
|
+
verbatimArtifactCategories: MemoryCategory[];
|
|
1315
|
+
memoryBoxesEnabled: boolean;
|
|
1316
|
+
/** Jaccard overlap threshold below which a topic shift triggers box sealing (0-1, default 0.35) */
|
|
1317
|
+
boxTopicShiftThreshold: number;
|
|
1318
|
+
/** Time gap in ms before an open box is sealed (default 30 min) */
|
|
1319
|
+
boxTimeGapMs: number;
|
|
1320
|
+
/** Max memories per box before forced seal */
|
|
1321
|
+
boxMaxMemories: number;
|
|
1322
|
+
traceWeaverEnabled: boolean;
|
|
1323
|
+
/** Days back to search for trace links */
|
|
1324
|
+
traceWeaverLookbackDays: number;
|
|
1325
|
+
/** Minimum Jaccard overlap to assign the same traceId (0-1, default 0.4) */
|
|
1326
|
+
traceWeaverOverlapThreshold: number;
|
|
1327
|
+
/** Number of recent days of boxes to inject during recall */
|
|
1328
|
+
boxRecallDays: number;
|
|
1329
|
+
/** Classify extracted memories as episode or note and tag with memoryKind */
|
|
1330
|
+
episodeNoteModeEnabled: boolean;
|
|
1331
|
+
/** Build and maintain temporal (state/index_time.json) and tag (state/index_tags.json) indexes */
|
|
1332
|
+
queryAwareIndexingEnabled: boolean;
|
|
1333
|
+
/** Max candidate paths returned from index prefilter (0 = no cap) */
|
|
1334
|
+
queryAwareIndexingMaxCandidates: number;
|
|
1335
|
+
temporalIndexWindowDays: number;
|
|
1336
|
+
temporalIndexMaxEntries: number;
|
|
1337
|
+
temporalBoostRecentDays: number;
|
|
1338
|
+
temporalBoostScore: number;
|
|
1339
|
+
temporalDecayEnabled: boolean;
|
|
1340
|
+
tagMemoryEnabled: boolean;
|
|
1341
|
+
tagMaxPerMemory: number;
|
|
1342
|
+
tagIndexMaxEntries: number;
|
|
1343
|
+
tagRecallBoost: number;
|
|
1344
|
+
tagRecallMaxMatches: number;
|
|
1345
|
+
multiGraphMemoryEnabled: boolean;
|
|
1346
|
+
graphRecallEnabled: boolean;
|
|
1347
|
+
graphRecallMaxExpansions: number;
|
|
1348
|
+
graphRecallMaxPerSeed: number;
|
|
1349
|
+
graphRecallMinEdgeWeight: number;
|
|
1350
|
+
graphRecallShadowEnabled: boolean;
|
|
1351
|
+
graphRecallSnapshotEnabled: boolean;
|
|
1352
|
+
graphRecallShadowSampleRate: number;
|
|
1353
|
+
graphRecallExplainToolEnabled: boolean;
|
|
1354
|
+
graphRecallStoreColdMirror: boolean;
|
|
1355
|
+
graphRecallColdMirrorCollection?: string;
|
|
1356
|
+
graphRecallColdMirrorMinAgeDays: number;
|
|
1357
|
+
graphRecallUseEntityPriors: boolean;
|
|
1358
|
+
graphRecallEntityPriorBoost: number;
|
|
1359
|
+
graphRecallPreferHubSeeds: boolean;
|
|
1360
|
+
graphRecallHubBias: number;
|
|
1361
|
+
graphRecallRecencyHalfLifeDays: number;
|
|
1362
|
+
graphRecallDampingFactor: number;
|
|
1363
|
+
graphRecallMaxSeedNodes: number;
|
|
1364
|
+
graphRecallMaxExpandedNodes: number;
|
|
1365
|
+
graphRecallMaxTrailPerNode: number;
|
|
1366
|
+
graphRecallMinSeedScore: number;
|
|
1367
|
+
graphRecallExpansionScoreThreshold: number;
|
|
1368
|
+
graphRecallExplainMaxPaths: number;
|
|
1369
|
+
graphRecallExplainMaxChars: number;
|
|
1370
|
+
graphRecallExplainEdgeLimit: number;
|
|
1371
|
+
graphRecallExplainEnabled: boolean;
|
|
1372
|
+
graphRecallEntityHintsEnabled: boolean;
|
|
1373
|
+
graphRecallEntityHintMax: number;
|
|
1374
|
+
graphRecallEntityHintMaxChars: number;
|
|
1375
|
+
graphRecallSnapshotDir: string;
|
|
1376
|
+
graphRecallEnableTrace: boolean;
|
|
1377
|
+
graphRecallEnableDebug: boolean;
|
|
1378
|
+
/** Allow graph_mode escalation for broader causal/timeline phrasing beyond strict keywords. */
|
|
1379
|
+
graphExpandedIntentEnabled?: boolean;
|
|
1380
|
+
/** Run bounded graph expansion in full mode when enough recall seeds exist. */
|
|
1381
|
+
graphAssistInFullModeEnabled?: boolean;
|
|
1382
|
+
/** In full mode, compute graph assist for telemetry/snapshotting but do not inject merged results. */
|
|
1383
|
+
graphAssistShadowEvalEnabled?: boolean;
|
|
1384
|
+
/** Minimum seed results required before full-mode graph assist runs. */
|
|
1385
|
+
graphAssistMinSeedResults?: number;
|
|
1386
|
+
entityGraphEnabled: boolean;
|
|
1387
|
+
timeGraphEnabled: boolean;
|
|
1388
|
+
/** When true, write fallback temporal adjacency edges for consecutive extracted memories. */
|
|
1389
|
+
graphWriteSessionAdjacencyEnabled?: boolean;
|
|
1390
|
+
causalGraphEnabled: boolean;
|
|
1391
|
+
maxGraphTraversalSteps: number;
|
|
1392
|
+
graphActivationDecay: number;
|
|
1393
|
+
/** Weight of graph activation score when blending with seed QMD score (0-1). */
|
|
1394
|
+
graphExpansionActivationWeight: number;
|
|
1395
|
+
/** Lower bound for blended graph-expanded recall scores (0-1). */
|
|
1396
|
+
graphExpansionBlendMin: number;
|
|
1397
|
+
/** Upper bound for blended graph-expanded recall scores (0-1). */
|
|
1398
|
+
graphExpansionBlendMax: number;
|
|
1399
|
+
maxEntityGraphEdgesPerMemory: number;
|
|
1400
|
+
/** SimpleMem-inspired de-linearization: resolve pronouns and anchor relative dates after extraction. */
|
|
1401
|
+
delinearizeEnabled: boolean;
|
|
1402
|
+
/** Synapse-inspired confidence gate — skip memory injection when top score is below threshold. */
|
|
1403
|
+
recallConfidenceGateEnabled: boolean;
|
|
1404
|
+
recallConfidenceGateThreshold: number;
|
|
1405
|
+
/** PlugMem-inspired causal rule extraction: mine IF→THEN rules during consolidation. */
|
|
1406
|
+
causalRuleExtractionEnabled: boolean;
|
|
1407
|
+
/** E-Mem-inspired memory reconstruction: targeted retrieval for missing entity context. */
|
|
1408
|
+
memoryReconstructionEnabled: boolean;
|
|
1409
|
+
/** Maximum number of entity expansions per recall. */
|
|
1410
|
+
memoryReconstructionMaxExpansions: number;
|
|
1411
|
+
/** Synapse-inspired lateral inhibition to suppress hub-node dominance. */
|
|
1412
|
+
graphLateralInhibitionEnabled: boolean;
|
|
1413
|
+
/** Inhibition strength (default 0.15). Higher = more suppression. */
|
|
1414
|
+
graphLateralInhibitionBeta: number;
|
|
1415
|
+
/** Number of top competing nodes considered for inhibition (default 7). */
|
|
1416
|
+
graphLateralInhibitionTopM: number;
|
|
1417
|
+
/** Enable the periodic graph-edge confidence decay job. Default false (opt-in). */
|
|
1418
|
+
graphEdgeDecayEnabled: boolean;
|
|
1419
|
+
/** Cadence in milliseconds at which the cron triggers the decay job. Default 7d. */
|
|
1420
|
+
graphEdgeDecayCadenceMs: number;
|
|
1421
|
+
/** Decay window passed through to `decayEdgeConfidence`. Default 90 days. */
|
|
1422
|
+
graphEdgeDecayWindowMs: number;
|
|
1423
|
+
/** Per-window confidence drop. Default 0.1. */
|
|
1424
|
+
graphEdgeDecayPerWindow: number;
|
|
1425
|
+
/** Floor confidence will not decay below. Default 0.1. */
|
|
1426
|
+
graphEdgeDecayFloor: number;
|
|
1427
|
+
/** Confidence threshold for the "below visibility" telemetry counter. Default 0.2. */
|
|
1428
|
+
graphEdgeDecayVisibilityThreshold: number;
|
|
1429
|
+
/**
|
|
1430
|
+
* Issue #681 PR 3/3 — minimum edge confidence required for an edge to be
|
|
1431
|
+
* traversed during spreading activation. Edges with `confidence` below this
|
|
1432
|
+
* floor are pruned and contribute neither activation nor downstream
|
|
1433
|
+
* neighbors. Legacy edges without `confidence` are treated as 1.0 so they
|
|
1434
|
+
* always pass the floor. Range `[0, 1]`; default `0.2`.
|
|
1435
|
+
*/
|
|
1436
|
+
graphTraversalConfidenceFloor: number;
|
|
1437
|
+
/**
|
|
1438
|
+
* Issue #681 PR 3/3 — number of PageRank-style refinement iterations applied
|
|
1439
|
+
* on top of the BFS spreading-activation scores. Each iteration redistributes
|
|
1440
|
+
* a node's confidence-weighted activation along its outgoing edges. Set to 0
|
|
1441
|
+
* to disable refinement and use raw BFS scores. Default `8`.
|
|
1442
|
+
*/
|
|
1443
|
+
graphTraversalPageRankIterations: number;
|
|
1444
|
+
temporalMemoryTreeEnabled: boolean;
|
|
1445
|
+
tmtHourlyMinMemories: number;
|
|
1446
|
+
tmtSummaryMaxTokens: number;
|
|
1447
|
+
/** Front-load exact stored evidence for query-visible cues like turns, dates, ids, files, and tools. */
|
|
1448
|
+
explicitCueRecallEnabled: boolean;
|
|
1449
|
+
/** Character budget for the explicit cue evidence section. */
|
|
1450
|
+
explicitCueRecallMaxChars: number;
|
|
1451
|
+
/** Maximum query-visible cues expanded per recall. */
|
|
1452
|
+
explicitCueRecallMaxReferences: number;
|
|
1453
|
+
lcmEnabled: boolean;
|
|
1454
|
+
lcmLeafBatchSize: number;
|
|
1455
|
+
lcmRollupFanIn: number;
|
|
1456
|
+
lcmFreshTailTurns: number;
|
|
1457
|
+
lcmMaxDepth: number;
|
|
1458
|
+
lcmRecallBudgetShare: number;
|
|
1459
|
+
lcmDeterministicMaxTokens: number;
|
|
1460
|
+
lcmArchiveRetentionDays: number;
|
|
1461
|
+
/** Opt-in structured message-part capture/recall sidecar for LCM. Default false. */
|
|
1462
|
+
messagePartsEnabled: boolean;
|
|
1463
|
+
/** Max structured file/tool matches injected into recall. */
|
|
1464
|
+
messagePartsRecallMaxResults: number;
|
|
1465
|
+
/** Enable three-agent parallel retrieval (DirectFact + Contextual + Temporal). Default false. */
|
|
1466
|
+
parallelRetrievalEnabled: boolean;
|
|
1467
|
+
/** Per-agent source weights for score blending during merge. */
|
|
1468
|
+
parallelAgentWeights: {
|
|
1469
|
+
direct: number;
|
|
1470
|
+
contextual: number;
|
|
1471
|
+
temporal: number;
|
|
1472
|
+
};
|
|
1473
|
+
/** Max results fetched per agent before merge. */
|
|
1474
|
+
parallelMaxResultsPerAgent: number;
|
|
1475
|
+
/** Briefing configuration knobs — see BriefingConfig for field docs. */
|
|
1476
|
+
briefing: BriefingConfig;
|
|
1477
|
+
codex: CodexConnectorConfig;
|
|
1478
|
+
connectors: LiveConnectorsConfig;
|
|
1479
|
+
/** Enable the MECE taxonomy knowledge directory. Default false. */
|
|
1480
|
+
taxonomyEnabled: boolean;
|
|
1481
|
+
/** Auto-regenerate RESOLVER.md when taxonomy changes. Default true. */
|
|
1482
|
+
taxonomyAutoGenResolver: boolean;
|
|
1483
|
+
/** Materialize Remnic memories into Codex's expected ~/.codex/memories/ layout. Default true. */
|
|
1484
|
+
codexMaterializeMemories: boolean;
|
|
1485
|
+
/** Namespace to materialize; "auto" derives from the connector context. Default "auto". */
|
|
1486
|
+
codexMaterializeNamespace: string;
|
|
1487
|
+
/** Max whitespace-tokenized size of memory_summary.md. Default 4500. */
|
|
1488
|
+
codexMaterializeMaxSummaryTokens: number;
|
|
1489
|
+
/** Max age in days for rollout_summaries/*.md before pruning. Default 30. */
|
|
1490
|
+
codexMaterializeRolloutRetentionDays: number;
|
|
1491
|
+
/** Run materialization after semantic/causal consolidation completes. Default true. */
|
|
1492
|
+
codexMaterializeOnConsolidation: boolean;
|
|
1493
|
+
/** Run materialization at Codex session-end hook. Default true. */
|
|
1494
|
+
codexMaterializeOnSessionEnd: boolean;
|
|
1495
|
+
/** Enable Codex marketplace integration. Default true. */
|
|
1496
|
+
codexMarketplaceEnabled: boolean;
|
|
1497
|
+
/** Enable page-level versioning with sidecar snapshots. Default false. */
|
|
1498
|
+
versioningEnabled: boolean;
|
|
1499
|
+
/** Maximum number of version snapshots to keep per page. Default 50. Set to 0 to disable pruning. */
|
|
1500
|
+
versioningMaxPerPage: number;
|
|
1501
|
+
/** Name of the sidecar directory inside memoryDir. Default ".versions". */
|
|
1502
|
+
versioningSidecarDir: string;
|
|
1503
|
+
/** Enable binary file lifecycle management (mirror, redirect, clean). Default: false. */
|
|
1504
|
+
binaryLifecycleEnabled: boolean;
|
|
1505
|
+
/** Grace period in days before a mirrored binary is eligible for local cleanup. Default: 7. */
|
|
1506
|
+
binaryLifecycleGracePeriodDays: number;
|
|
1507
|
+
/** Storage backend type: "filesystem" copies to a local dir, "none" is no-op. Default: "none". */
|
|
1508
|
+
binaryLifecycleBackendType: "filesystem" | "s3" | "none";
|
|
1509
|
+
/** Base path for the filesystem backend. Required when backendType is "filesystem". */
|
|
1510
|
+
binaryLifecycleBackendPath: string;
|
|
1511
|
+
/** Enable oai-mem-citation blocks in recall responses. Default false. */
|
|
1512
|
+
citationsEnabled: boolean;
|
|
1513
|
+
/** Auto-enable citations when the Codex adapter is detected. Default true. */
|
|
1514
|
+
citationsAutoDetect: boolean;
|
|
1515
|
+
/** Enable the external enrichment pipeline. Default false. */
|
|
1516
|
+
enrichmentEnabled: boolean;
|
|
1517
|
+
/** Automatically enrich new entities on creation. Default false. */
|
|
1518
|
+
enrichmentAutoOnCreate: boolean;
|
|
1519
|
+
/** Max candidates accepted per entity per enrichment run. Default 20. */
|
|
1520
|
+
enrichmentMaxCandidatesPerEntity: number;
|
|
1521
|
+
/** Whether third-party memory extensions are discovered and injected into consolidation. Default true. */
|
|
1522
|
+
memoryExtensionsEnabled: boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* Root directory for memory extensions. Empty string means derive from
|
|
1525
|
+
* memoryDir: go up to the Remnic home dir and append memory_extensions.
|
|
1526
|
+
*/
|
|
1527
|
+
memoryExtensionsRoot: string;
|
|
1528
|
+
}
|
|
1529
|
+
/** Runtime configuration for the daily context briefing feature. */
|
|
1530
|
+
interface BriefingConfig {
|
|
1531
|
+
/** Whether `remnic briefing` CLI and MCP tool are enabled. */
|
|
1532
|
+
enabled: boolean;
|
|
1533
|
+
/** Default lookback window token (e.g. "yesterday", "3d", "1w", "24h"). */
|
|
1534
|
+
defaultWindow: string;
|
|
1535
|
+
/** Default output format for the CLI. */
|
|
1536
|
+
defaultFormat: "markdown" | "json";
|
|
1537
|
+
/** Maximum number of LLM-generated suggested follow-ups. */
|
|
1538
|
+
maxFollowups: number;
|
|
1539
|
+
/** Optional path to an ICS or JSON calendar file. null disables the section. */
|
|
1540
|
+
calendarSource: string | null;
|
|
1541
|
+
/** If true, CLI writes a dated briefing file by default. */
|
|
1542
|
+
saveByDefault: boolean;
|
|
1543
|
+
/** Override directory for saved briefings. null → $REMNIC_HOME/briefings/. */
|
|
1544
|
+
saveDir: string | null;
|
|
1545
|
+
/** Whether to call the Responses API for follow-up suggestions. */
|
|
1546
|
+
llmFollowups: boolean;
|
|
1547
|
+
}
|
|
1548
|
+
/** Parsed representation of a briefing lookback window. */
|
|
1549
|
+
type BriefingWindow = "yesterday" | "today" | string;
|
|
1550
|
+
/** Filter the briefing to a single entity / project / topic. */
|
|
1551
|
+
interface BriefingFocus {
|
|
1552
|
+
type: "person" | "project" | "topic";
|
|
1553
|
+
value: string;
|
|
1554
|
+
}
|
|
1555
|
+
/** Calendar event surfaced by a CalendarSource implementation. */
|
|
1556
|
+
interface CalendarEvent {
|
|
1557
|
+
/** Stable identifier for dedupe / linking. */
|
|
1558
|
+
id: string;
|
|
1559
|
+
/** Event title (short). */
|
|
1560
|
+
title: string;
|
|
1561
|
+
/** ISO 8601 start timestamp. */
|
|
1562
|
+
start: string;
|
|
1563
|
+
/** Optional ISO 8601 end timestamp. */
|
|
1564
|
+
end?: string;
|
|
1565
|
+
/** Optional freeform location. */
|
|
1566
|
+
location?: string;
|
|
1567
|
+
/** Optional short notes. */
|
|
1568
|
+
notes?: string;
|
|
1569
|
+
}
|
|
1570
|
+
/** Abstraction over any calendar backend. Concrete implementations: `FileCalendarSource`. */
|
|
1571
|
+
interface CalendarSource {
|
|
1572
|
+
/** Return events that fall on the given UTC date (YYYY-MM-DD). */
|
|
1573
|
+
eventsForDate(dateIso: string): Promise<CalendarEvent[]>;
|
|
1574
|
+
}
|
|
1575
|
+
/** A single "active thread" surfaced in a briefing. */
|
|
1576
|
+
interface BriefingActiveThread {
|
|
1577
|
+
id: string;
|
|
1578
|
+
title: string;
|
|
1579
|
+
updatedAt: string;
|
|
1580
|
+
reason: string;
|
|
1581
|
+
}
|
|
1582
|
+
/** A single "recent entity" entry. */
|
|
1583
|
+
interface BriefingRecentEntity {
|
|
1584
|
+
name: string;
|
|
1585
|
+
type: string;
|
|
1586
|
+
updatedAt: string;
|
|
1587
|
+
score: number;
|
|
1588
|
+
summary?: string;
|
|
1589
|
+
}
|
|
1590
|
+
/** A single unresolved commitment or open question. */
|
|
1591
|
+
interface BriefingOpenCommitment {
|
|
1592
|
+
id: string;
|
|
1593
|
+
kind: "question" | "commitment" | "pending_memory";
|
|
1594
|
+
text: string;
|
|
1595
|
+
source?: string;
|
|
1596
|
+
createdAt?: string;
|
|
1597
|
+
}
|
|
1598
|
+
/** An LLM-generated short follow-up suggestion. */
|
|
1599
|
+
interface BriefingFollowup {
|
|
1600
|
+
text: string;
|
|
1601
|
+
rationale?: string;
|
|
1602
|
+
}
|
|
1603
|
+
/** Structured sections of a briefing result. */
|
|
1604
|
+
interface BriefingSections {
|
|
1605
|
+
activeThreads: BriefingActiveThread[];
|
|
1606
|
+
recentEntities: BriefingRecentEntity[];
|
|
1607
|
+
openCommitments: BriefingOpenCommitment[];
|
|
1608
|
+
suggestedFollowups: BriefingFollowup[];
|
|
1609
|
+
/** Only populated when a calendar source is configured and returns events. */
|
|
1610
|
+
todayCalendar?: CalendarEvent[];
|
|
1611
|
+
}
|
|
1612
|
+
/** A calendar source failure recorded when a CalendarSource throws during briefing generation. */
|
|
1613
|
+
interface BriefingCalendarSourceError {
|
|
1614
|
+
/** Human-readable description of the source (e.g. file path or source name). */
|
|
1615
|
+
source: string;
|
|
1616
|
+
/** Stringified error message from the failed source. */
|
|
1617
|
+
error: string;
|
|
1618
|
+
}
|
|
1619
|
+
/** Result returned by `buildBriefing`. */
|
|
1620
|
+
interface BriefingResult {
|
|
1621
|
+
markdown: string;
|
|
1622
|
+
json: Record<string, unknown>;
|
|
1623
|
+
sections: BriefingSections;
|
|
1624
|
+
/** Reason why suggested follow-ups were omitted (e.g. missing API key, LLM error). */
|
|
1625
|
+
followupsUnavailableReason?: string;
|
|
1626
|
+
/** Effective lookback window (ISO date range) used for this briefing. */
|
|
1627
|
+
window: {
|
|
1628
|
+
from: string;
|
|
1629
|
+
to: string;
|
|
1630
|
+
};
|
|
1631
|
+
/**
|
|
1632
|
+
* Calendar sources that failed during this briefing run.
|
|
1633
|
+
* Only present (non-empty) when at least one source threw.
|
|
1634
|
+
* Allows callers to distinguish "no events today" from "source unavailable".
|
|
1635
|
+
*/
|
|
1636
|
+
calendarSourceErrors?: BriefingCalendarSourceError[];
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Settings for the Codex CLI connector. These are consumed by
|
|
1640
|
+
* `remnic connectors install codex-cli` to decide where the phase-2 memory
|
|
1641
|
+
* extension is dropped and whether to install it at all.
|
|
1642
|
+
*/
|
|
1643
|
+
interface CodexConnectorConfig {
|
|
1644
|
+
/**
|
|
1645
|
+
* Whether to install the Remnic memory extension into
|
|
1646
|
+
* `<codex_home>/memories_extensions/remnic/` when the `codex-cli`
|
|
1647
|
+
* connector is installed. Default `true`. Set to `false` for users who
|
|
1648
|
+
* self-manage the Codex memory extensions folder.
|
|
1649
|
+
*/
|
|
1650
|
+
installExtension: boolean;
|
|
1651
|
+
/**
|
|
1652
|
+
* Optional override for the Codex home directory. When `null`, the
|
|
1653
|
+
* connector reads `$CODEX_HOME` and falls back to `~/.codex`. Setting
|
|
1654
|
+
* this is useful for integration tests and non-default installs.
|
|
1655
|
+
*/
|
|
1656
|
+
codexHome: string | null;
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Container for live-connector config blocks (issue #683 PR 2/N).
|
|
1660
|
+
*
|
|
1661
|
+
* Lives at `connectors.*` rather than the top level so future connectors
|
|
1662
|
+
* (Notion, Gmail, GitHub) can slot in without bloating `PluginConfig`.
|
|
1663
|
+
*
|
|
1664
|
+
* Every child block must default to `enabled: false` per CLAUDE.md gotcha
|
|
1665
|
+
* #30 (escape hatch by default) and gotcha #48 (least-privileged enum
|
|
1666
|
+
* defaults). Concrete connectors are also expected to short-circuit at
|
|
1667
|
+
* registration time when their credentials are not populated.
|
|
1668
|
+
*/
|
|
1669
|
+
interface LiveConnectorsConfig {
|
|
1670
|
+
/** Google Drive live connector (issue #683 PR 2/N). */
|
|
1671
|
+
googleDrive: GoogleDriveLiveConnectorConfig;
|
|
1672
|
+
/** Notion live connector (issue #683 PR 3/N). */
|
|
1673
|
+
notion: NotionLiveConnectorConfig;
|
|
1674
|
+
/** Gmail live connector (issue #683 PR 4/6). */
|
|
1675
|
+
gmail: GmailLiveConnectorConfig;
|
|
1676
|
+
/** GitHub live connector (issue #683 PR 5/6). */
|
|
1677
|
+
github: GitHubLiveConnectorConfig;
|
|
1678
|
+
}
|
|
1679
|
+
/**
|
|
1680
|
+
* Operator-facing config for the Google Drive live connector. The connector
|
|
1681
|
+
* module itself defines a separate, *validated* `GoogleDriveConnectorConfig`
|
|
1682
|
+
* shape (frozen, post-validation). This interface is the pre-validation
|
|
1683
|
+
* shape that `parseConfig` round-trips through.
|
|
1684
|
+
*
|
|
1685
|
+
* `clientId` / `clientSecret` / `refreshToken` are stored as strings here so
|
|
1686
|
+
* the schema can ship in `openclaw.plugin.json` and operators can populate
|
|
1687
|
+
* them from a secret store (e.g. an env-substituted plist or systemd
|
|
1688
|
+
* EnvironmentFile). They MUST NEVER be committed to source. The repo-wide
|
|
1689
|
+
* privacy policy in CLAUDE.md applies.
|
|
1690
|
+
*/
|
|
1691
|
+
interface GoogleDriveLiveConnectorConfig {
|
|
1692
|
+
/** Master gate. Default false — operators must opt in explicitly. */
|
|
1693
|
+
enabled: boolean;
|
|
1694
|
+
/** OAuth2 client id. Populate from a secret store; never commit. */
|
|
1695
|
+
clientId: string;
|
|
1696
|
+
/** OAuth2 client secret. Populate from a secret store; never commit. */
|
|
1697
|
+
clientSecret: string;
|
|
1698
|
+
/** OAuth2 refresh token. Populate from a secret store; never commit. */
|
|
1699
|
+
refreshToken: string;
|
|
1700
|
+
/** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
|
|
1701
|
+
pollIntervalMs: number;
|
|
1702
|
+
/** Optional folder-id scope. Empty array = all accessible files. */
|
|
1703
|
+
folderIds: string[];
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Operator-facing config for the Notion live connector (issue #683 PR 3/N).
|
|
1707
|
+
* The connector module defines a separate validated `NotionConnectorConfig`
|
|
1708
|
+
* shape (frozen, post-validation). This interface is the pre-validation shape
|
|
1709
|
+
* that `parseConfig` round-trips through.
|
|
1710
|
+
*
|
|
1711
|
+
* `token` is stored as a string here so operators can populate it from a
|
|
1712
|
+
* secret store (e.g. an env-substituted plist or systemd EnvironmentFile).
|
|
1713
|
+
* It MUST NEVER be committed to source. The repo-wide privacy policy in
|
|
1714
|
+
* CLAUDE.md applies.
|
|
1715
|
+
*/
|
|
1716
|
+
interface NotionLiveConnectorConfig {
|
|
1717
|
+
/** Master gate. Default false — operators must opt in explicitly. */
|
|
1718
|
+
enabled: boolean;
|
|
1719
|
+
/** Notion integration token. Starts with `secret_`. Populate from a secret store; never commit. */
|
|
1720
|
+
token: string;
|
|
1721
|
+
/** Array of Notion database ids to import pages from. Empty = connector is a no-op. */
|
|
1722
|
+
databaseIds: string[];
|
|
1723
|
+
/** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
|
|
1724
|
+
pollIntervalMs: number;
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Operator-facing config for the Gmail live connector (issue #683 PR 4/6).
|
|
1728
|
+
* The connector module defines a separate validated `GmailConnectorConfig`
|
|
1729
|
+
* shape (frozen, post-validation). This interface is the pre-validation shape
|
|
1730
|
+
* that `parseConfig` round-trips through.
|
|
1731
|
+
*
|
|
1732
|
+
* OAuth2 credentials are stored as strings here so operators can populate
|
|
1733
|
+
* them from a secret store (e.g. env-substituted plist or systemd
|
|
1734
|
+
* EnvironmentFile). They MUST NEVER be committed to source. The repo-wide
|
|
1735
|
+
* privacy policy in CLAUDE.md applies.
|
|
1736
|
+
*/
|
|
1737
|
+
interface GmailLiveConnectorConfig {
|
|
1738
|
+
/** Master gate. Default false — operators must opt in explicitly. */
|
|
1739
|
+
enabled: boolean;
|
|
1740
|
+
/** OAuth2 client id. Populate from a secret store; never commit. */
|
|
1741
|
+
clientId: string;
|
|
1742
|
+
/** OAuth2 client secret. Populate from a secret store; never commit. */
|
|
1743
|
+
clientSecret: string;
|
|
1744
|
+
/** OAuth2 refresh token issued for the Gmail scope. Populate from a secret store; never commit. */
|
|
1745
|
+
refreshToken: string;
|
|
1746
|
+
/** Gmail userId. Defaults to "me" (the authenticated user). */
|
|
1747
|
+
userId: string;
|
|
1748
|
+
/** Gmail search query applied in addition to the watermark filter. Default "in:inbox". */
|
|
1749
|
+
query: string;
|
|
1750
|
+
/** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
|
|
1751
|
+
pollIntervalMs: number;
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* Operator-facing config for the GitHub live connector (issue #683 PR 5/6).
|
|
1755
|
+
* The connector module defines a separate validated `GitHubConnectorConfig`
|
|
1756
|
+
* shape (frozen, post-validation). This interface is the pre-validation shape
|
|
1757
|
+
* that `parseConfig` round-trips through.
|
|
1758
|
+
*
|
|
1759
|
+
* `token` is stored as a string here so operators can populate it from a
|
|
1760
|
+
* secret store (e.g. an env-substituted plist or systemd EnvironmentFile).
|
|
1761
|
+
* It MUST NEVER be committed to source. The repo-wide privacy policy in
|
|
1762
|
+
* CLAUDE.md applies.
|
|
1763
|
+
*/
|
|
1764
|
+
interface GitHubLiveConnectorConfig {
|
|
1765
|
+
/** Master gate. Default false — operators must opt in explicitly. */
|
|
1766
|
+
enabled: boolean;
|
|
1767
|
+
/** GitHub personal access token. Populate from a secret store; never commit. */
|
|
1768
|
+
token: string;
|
|
1769
|
+
/** GitHub login of the user whose comments will be imported. Required. */
|
|
1770
|
+
userLogin: string;
|
|
1771
|
+
/** Repos to poll in "owner/repo" format. Empty = connector is a no-op. */
|
|
1772
|
+
repos: string[];
|
|
1773
|
+
/** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
|
|
1774
|
+
pollIntervalMs: number;
|
|
1775
|
+
/** Whether to fetch Discussion comments in addition to issue/PR comments. Default false. */
|
|
1776
|
+
includeDiscussions: boolean;
|
|
1777
|
+
}
|
|
1778
|
+
interface BootstrapOptions {
|
|
1779
|
+
dryRun?: boolean;
|
|
1780
|
+
sessionsDir?: string;
|
|
1781
|
+
limit?: number;
|
|
1782
|
+
since?: Date;
|
|
1783
|
+
}
|
|
1784
|
+
interface BootstrapResult {
|
|
1785
|
+
sessionsScanned: number;
|
|
1786
|
+
turnsProcessed: number;
|
|
1787
|
+
highSignalTurns: number;
|
|
1788
|
+
memoriesCreated: number;
|
|
1789
|
+
skipped: number;
|
|
1790
|
+
}
|
|
1791
|
+
interface PrincipalRule {
|
|
1792
|
+
match: string;
|
|
1793
|
+
principal: string;
|
|
1794
|
+
}
|
|
1795
|
+
interface NamespacePolicy {
|
|
1796
|
+
name: string;
|
|
1797
|
+
readPrincipals: string[];
|
|
1798
|
+
writePrincipals: string[];
|
|
1799
|
+
includeInRecallByDefault?: boolean;
|
|
1800
|
+
}
|
|
1801
|
+
interface RelevanceFeedback {
|
|
1802
|
+
up: number;
|
|
1803
|
+
down: number;
|
|
1804
|
+
lastUpdatedAt: string;
|
|
1805
|
+
notes?: string[];
|
|
1806
|
+
}
|
|
1807
|
+
interface BufferTurn {
|
|
1808
|
+
role: "user" | "assistant";
|
|
1809
|
+
content: string;
|
|
1810
|
+
timestamp: string;
|
|
1811
|
+
sessionKey?: string;
|
|
1812
|
+
logicalSessionKey?: string;
|
|
1813
|
+
providerThreadId?: string | null;
|
|
1814
|
+
turnFingerprint?: string;
|
|
1815
|
+
persistProcessedFingerprint?: boolean;
|
|
1816
|
+
parts?: LcmMessagePartInput[];
|
|
1817
|
+
rawContent?: unknown;
|
|
1818
|
+
sourceFormat?: MessagePartSourceFormat;
|
|
1819
|
+
}
|
|
1820
|
+
interface BufferEntryState {
|
|
1821
|
+
turns: BufferTurn[];
|
|
1822
|
+
lastExtractionAt: string | null;
|
|
1823
|
+
extractionCount: number;
|
|
1824
|
+
/**
|
|
1825
|
+
* Turns retained across `clearAfterExtraction` so a later extraction pass
|
|
1826
|
+
* sees the context that caused a defer verdict (issue #562, PR 2). Bounded
|
|
1827
|
+
* to the configured retention cap by `retainDeferredTurns`. Empty / absent
|
|
1828
|
+
* means no retention in effect.
|
|
1829
|
+
*/
|
|
1830
|
+
retainedTurns?: BufferTurn[];
|
|
1831
|
+
}
|
|
1832
|
+
interface BufferState {
|
|
1833
|
+
turns: BufferTurn[];
|
|
1834
|
+
lastExtractionAt: string | null;
|
|
1835
|
+
extractionCount: number;
|
|
1836
|
+
entries?: Record<string, BufferEntryState>;
|
|
1837
|
+
}
|
|
1838
|
+
interface BehaviorLoopAdjustment {
|
|
1839
|
+
parameter: string;
|
|
1840
|
+
previousValue: number;
|
|
1841
|
+
nextValue: number;
|
|
1842
|
+
delta: number;
|
|
1843
|
+
evidenceCount: number;
|
|
1844
|
+
confidence: number;
|
|
1845
|
+
reason: string;
|
|
1846
|
+
appliedAt: string;
|
|
1847
|
+
}
|
|
1848
|
+
interface BehaviorLoopPolicyState {
|
|
1849
|
+
version: number;
|
|
1850
|
+
windowDays: number;
|
|
1851
|
+
minSignalCount: number;
|
|
1852
|
+
maxDeltaPerCycle: number;
|
|
1853
|
+
protectedParams: string[];
|
|
1854
|
+
adjustments: BehaviorLoopAdjustment[];
|
|
1855
|
+
updatedAt: string;
|
|
1856
|
+
}
|
|
1857
|
+
type BehaviorSignalType = "correction_override" | "preference_affinity" | "topic_revisitation" | "action_pattern" | "outcome_preference" | "phrasing_style";
|
|
1858
|
+
type BehaviorSignalDirection = "positive" | "negative";
|
|
1859
|
+
interface BehaviorSignalEvent {
|
|
1860
|
+
timestamp: string;
|
|
1861
|
+
namespace: string;
|
|
1862
|
+
memoryId: string;
|
|
1863
|
+
category: Extract<MemoryCategory, "correction" | "preference">;
|
|
1864
|
+
signalType: BehaviorSignalType;
|
|
1865
|
+
direction: BehaviorSignalDirection;
|
|
1866
|
+
confidence: number;
|
|
1867
|
+
signalHash: string;
|
|
1868
|
+
source: "extraction" | "correction";
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* One row of the buffer-surprise telemetry ledger (issue #563 PR 3).
|
|
1872
|
+
*
|
|
1873
|
+
* Emitted by `SmartBuffer` each time the surprise probe produces a score
|
|
1874
|
+
* for an incoming turn (i.e. the feature flag is on and the existing
|
|
1875
|
+
* trigger-logic path called through to the probe). Not written when the
|
|
1876
|
+
* probe is skipped — the absence of a row is meaningful and matches the
|
|
1877
|
+
* "probe was not consulted" state.
|
|
1878
|
+
*
|
|
1879
|
+
* The ledger is intentionally lean: we record the score, the threshold in
|
|
1880
|
+
* force, whether the turn caused a flush, and the turn count so operators
|
|
1881
|
+
* can re-derive precision/recall without replaying traffic. Turn content
|
|
1882
|
+
* is never persisted — this ledger is safe to commit to shared storage.
|
|
1883
|
+
*/
|
|
1884
|
+
interface BufferSurpriseEvent {
|
|
1885
|
+
/** Literal tag to simplify multiplexed log consumers. */
|
|
1886
|
+
event: "BUFFER_SURPRISE";
|
|
1887
|
+
/** ISO timestamp when the decision was made. Server-side, not turn ts. */
|
|
1888
|
+
timestamp: string;
|
|
1889
|
+
/** Buffer identifier (session / thread). Opaque string. */
|
|
1890
|
+
bufferKey: string;
|
|
1891
|
+
/** Session key if available; null when the turn has no session binding. */
|
|
1892
|
+
sessionKey: string | null;
|
|
1893
|
+
/** Role of the scored turn. */
|
|
1894
|
+
turnRole: "user" | "assistant";
|
|
1895
|
+
/** Surprise score in `[0, 1]`, already clamped. */
|
|
1896
|
+
surpriseScore: number;
|
|
1897
|
+
/** Threshold in force when the decision was made. */
|
|
1898
|
+
threshold: number;
|
|
1899
|
+
/** Whether this turn upgraded `keep_buffering` → `extract_now`. */
|
|
1900
|
+
triggeredFlush: boolean;
|
|
1901
|
+
/** Number of turns in the buffer (including the current turn). */
|
|
1902
|
+
turnCountInWindow: number;
|
|
1903
|
+
}
|
|
1904
|
+
/** Memory status for lifecycle management */
|
|
1905
|
+
type MemoryStatus = "active" | "pending_review" | "rejected" | "quarantined" | "superseded" | "archived"
|
|
1906
|
+
/**
|
|
1907
|
+
* Operator explicitly forgot the memory (issue #686 PR 4/6). Soft
|
|
1908
|
+
* delete: the file stays on disk and a page-version snapshot is kept
|
|
1909
|
+
* so the act is reversible during a configurable retention window
|
|
1910
|
+
* (default 90 days), but the memory is excluded from recall, browse,
|
|
1911
|
+
* and entity attribution. After the retention window passes, a
|
|
1912
|
+
* future maintenance cron will hard-delete forgotten memories.
|
|
1913
|
+
*/
|
|
1914
|
+
| "forgotten";
|
|
1915
|
+
type LifecycleState = "candidate" | "validated" | "active" | "stale" | "archived";
|
|
1916
|
+
type VerificationState = "unverified" | "user_confirmed" | "system_inferred" | "disputed";
|
|
1917
|
+
type PolicyClass = "ephemeral" | "durable" | "protected";
|
|
1918
|
+
/** Importance level tiers */
|
|
1919
|
+
type ImportanceLevel = "critical" | "high" | "normal" | "low" | "trivial";
|
|
1920
|
+
/** Importance scoring result */
|
|
1921
|
+
interface ImportanceScore {
|
|
1922
|
+
/** Numeric score 0-1 */
|
|
1923
|
+
score: number;
|
|
1924
|
+
/** Tier level */
|
|
1925
|
+
level: ImportanceLevel;
|
|
1926
|
+
/** Reasons for this score */
|
|
1927
|
+
reasons: string[];
|
|
1928
|
+
/** Salient keywords extracted */
|
|
1929
|
+
keywords: string[];
|
|
1930
|
+
}
|
|
1931
|
+
interface MemoryFrontmatter {
|
|
1932
|
+
id: string;
|
|
1933
|
+
category: MemoryCategory;
|
|
1934
|
+
created: string;
|
|
1935
|
+
updated: string;
|
|
1936
|
+
source: string;
|
|
1937
|
+
confidence: number;
|
|
1938
|
+
confidenceTier: ConfidenceTier;
|
|
1939
|
+
tags: string[];
|
|
1940
|
+
entityRef?: string;
|
|
1941
|
+
supersedes?: string;
|
|
1942
|
+
/** ISO 8601 date — memory expires and gets cleaned up after this date */
|
|
1943
|
+
expiresAt?: string;
|
|
1944
|
+
/** IDs of parent memories this was derived from (lineage tracking) */
|
|
1945
|
+
lineage?: string[];
|
|
1946
|
+
/** Memory status: active (default), pending_review, rejected, quarantined, superseded, archived, or forgotten */
|
|
1947
|
+
status?: MemoryStatus;
|
|
1948
|
+
/** ID of memory that superseded this one */
|
|
1949
|
+
supersededBy?: string;
|
|
1950
|
+
/** Timestamp when superseded */
|
|
1951
|
+
supersededAt?: string;
|
|
1952
|
+
/** Timestamp when archived */
|
|
1953
|
+
archivedAt?: string;
|
|
1954
|
+
/**
|
|
1955
|
+
* Explicit fact validity start (issue #680). ISO 8601 timestamp.
|
|
1956
|
+
*
|
|
1957
|
+
* When present, marks the moment at which the fact begins being
|
|
1958
|
+
* "true" / authoritative. When absent at read time, callers fall
|
|
1959
|
+
* back to `created` so legacy memories written before #680 still
|
|
1960
|
+
* participate in `as_of` recall filtering without a migration.
|
|
1961
|
+
*/
|
|
1962
|
+
valid_at?: string;
|
|
1963
|
+
/**
|
|
1964
|
+
* Explicit fact validity end (issue #680). ISO 8601 timestamp.
|
|
1965
|
+
*
|
|
1966
|
+
* Set automatically by the temporal-supersession pipeline when a
|
|
1967
|
+
* newer fact supersedes this one — the value is the superseder's
|
|
1968
|
+
* `valid_at` (or `created` if no `valid_at` was set). May also be
|
|
1969
|
+
* set manually for facts that are known to expire at a specific
|
|
1970
|
+
* point in time.
|
|
1971
|
+
*/
|
|
1972
|
+
invalid_at?: string;
|
|
1973
|
+
/**
|
|
1974
|
+
* Timestamp when the operator explicitly forgot this memory
|
|
1975
|
+
* (issue #686 PR 4/6). Set by `remnic forget <id>`. Memories with
|
|
1976
|
+
* `status === "forgotten"` are excluded from recall, browse, and
|
|
1977
|
+
* entity attribution; the file remains on disk until the retention
|
|
1978
|
+
* window passes.
|
|
1979
|
+
*/
|
|
1980
|
+
forgottenAt?: string;
|
|
1981
|
+
/** Optional human-readable reason captured by `remnic forget --reason`. */
|
|
1982
|
+
forgottenReason?: string;
|
|
1983
|
+
/** Policy-driven lifecycle state used for retrieval eligibility/ranking. */
|
|
1984
|
+
lifecycleState?: LifecycleState;
|
|
1985
|
+
/** Verification provenance used by lifecycle policy. */
|
|
1986
|
+
verificationState?: VerificationState;
|
|
1987
|
+
/** Policy class used by lifecycle guardrails. */
|
|
1988
|
+
policyClass?: PolicyClass;
|
|
1989
|
+
/** Last lifecycle validation timestamp (ISO 8601). */
|
|
1990
|
+
lastValidatedAt?: string;
|
|
1991
|
+
/** Lifecycle decay score in [0,1]. */
|
|
1992
|
+
decayScore?: number;
|
|
1993
|
+
/** Lifecycle heat score in [0,1]. */
|
|
1994
|
+
heatScore?: number;
|
|
1995
|
+
/** Number of times this memory has been retrieved */
|
|
1996
|
+
accessCount?: number;
|
|
1997
|
+
/** Last time this memory was accessed (ISO 8601) */
|
|
1998
|
+
lastAccessed?: string;
|
|
1999
|
+
/** Number of sessions where this memory was retrieved and the outcome was judged a success. */
|
|
2000
|
+
mw_success?: number;
|
|
2001
|
+
/** Number of sessions where this memory was retrieved and the outcome was judged a failure. */
|
|
2002
|
+
mw_fail?: number;
|
|
2003
|
+
/** Importance score with level, reasons, and keywords */
|
|
2004
|
+
importance?: ImportanceScore;
|
|
2005
|
+
/** Parent memory ID if this is a chunk */
|
|
2006
|
+
parentId?: string;
|
|
2007
|
+
/** Chunk index within parent (0-based) */
|
|
2008
|
+
chunkIndex?: number;
|
|
2009
|
+
/** Total number of chunks for this parent */
|
|
2010
|
+
chunkTotal?: number;
|
|
2011
|
+
/** Links to other memories */
|
|
2012
|
+
links?: MemoryLink[];
|
|
2013
|
+
intentGoal?: string;
|
|
2014
|
+
intentActionType?: string;
|
|
2015
|
+
intentEntityTypes?: string[];
|
|
2016
|
+
artifactType?: "decision" | "constraint" | "todo" | "definition" | "commitment" | "correction" | "fact";
|
|
2017
|
+
sourceMemoryId?: string;
|
|
2018
|
+
sourceTurnId?: string;
|
|
2019
|
+
/** episode = time-specific event; note = stable belief/preference/decision */
|
|
2020
|
+
memoryKind?: "episode" | "note" | "box" | "dream" | "procedural";
|
|
2021
|
+
/** Structured key-value attributes extracted from the content (e.g., product attributes, dates, quantities). */
|
|
2022
|
+
structuredAttributes?: Record<string, string>;
|
|
2023
|
+
/**
|
|
2024
|
+
* SHA-256 (via ContentHashIndex.computeHash) of the raw content that was
|
|
2025
|
+
* used as the dedup key at write time. Persists through archive and
|
|
2026
|
+
* consolidation so the hash can be removed from the index even if the stored
|
|
2027
|
+
* content has been transformed (e.g. an inline citation was appended).
|
|
2028
|
+
*
|
|
2029
|
+
* When present, archive/consolidation paths use this directly instead of
|
|
2030
|
+
* calling stripCitation(memory.content), which only handles the default
|
|
2031
|
+
* [Source: ...] format and silently fails for custom citation templates.
|
|
2032
|
+
*/
|
|
2033
|
+
contentHash?: string;
|
|
2034
|
+
/**
|
|
2035
|
+
* Consolidation provenance — pointers to the page-versioning snapshots
|
|
2036
|
+
* that this memory was derived from (issue #561). Each entry is a
|
|
2037
|
+
* `"<memory-path>:<version-number>"` string (e.g.
|
|
2038
|
+
* `"facts/preferences.md:3"`) referencing a snapshot recorded by
|
|
2039
|
+
* `page-versioning.ts`.
|
|
2040
|
+
*
|
|
2041
|
+
* PR 1 introduces this field as read-through only — storage preserves
|
|
2042
|
+
* it verbatim but no code produces it yet. PR 2 populates it on
|
|
2043
|
+
* consolidation writes; PR 4 adds a `remnic doctor` integrity check
|
|
2044
|
+
* that validates each referent actually exists.
|
|
2045
|
+
*/
|
|
2046
|
+
derived_from?: string[];
|
|
2047
|
+
/**
|
|
2048
|
+
* Which consolidation operator produced this memory (issue #561,
|
|
2049
|
+
* extended in #687). See `ConsolidationOperator` in
|
|
2050
|
+
* `semantic-consolidation.ts` for the operator algebra. Absent on
|
|
2051
|
+
* memories that were not produced by a consolidation pass.
|
|
2052
|
+
*
|
|
2053
|
+
* `"pattern-reinforcement"` (issue #687 PR 2/4) tags memories that
|
|
2054
|
+
* were promoted to canonical by the pattern-reinforcement
|
|
2055
|
+
* maintenance job after observing the same content across
|
|
2056
|
+
* multiple sessions.
|
|
2057
|
+
*/
|
|
2058
|
+
derived_via?: "split" | "merge" | "update" | "pattern-reinforcement";
|
|
2059
|
+
/**
|
|
2060
|
+
* Number of source memories that reinforced this canonical memory
|
|
2061
|
+
* (issue #687 PR 2/4). Set by the pattern-reinforcement
|
|
2062
|
+
* maintenance job when it clusters duplicate memories and promotes
|
|
2063
|
+
* the most recent member to canonical. Counts the cluster size at
|
|
2064
|
+
* the time of the run; subsequent runs update this monotonically.
|
|
2065
|
+
*
|
|
2066
|
+
* Always a positive integer when present. Absent on memories that
|
|
2067
|
+
* have not been touched by pattern reinforcement.
|
|
2068
|
+
*/
|
|
2069
|
+
reinforcement_count?: number;
|
|
2070
|
+
/**
|
|
2071
|
+
* ISO 8601 timestamp recording the most recent pattern-reinforcement
|
|
2072
|
+
* run that touched this memory (issue #687 PR 2/4). Updated each
|
|
2073
|
+
* time the cluster size grows. Absent when `reinforcement_count`
|
|
2074
|
+
* is absent.
|
|
2075
|
+
*/
|
|
2076
|
+
last_reinforced_at?: string;
|
|
2077
|
+
}
|
|
2078
|
+
/** Memory link relationship types */
|
|
2079
|
+
type MemoryLinkType = "follows" | "references" | "contradicts" | "supports" | "related";
|
|
2080
|
+
/** A link between memories */
|
|
2081
|
+
interface MemoryLink {
|
|
2082
|
+
targetId: string;
|
|
2083
|
+
linkType: MemoryLinkType;
|
|
2084
|
+
strength: number;
|
|
2085
|
+
reason?: string;
|
|
2086
|
+
}
|
|
2087
|
+
interface ConversationThread {
|
|
2088
|
+
id: string;
|
|
2089
|
+
title: string;
|
|
2090
|
+
createdAt: string;
|
|
2091
|
+
updatedAt: string;
|
|
2092
|
+
sessionKey?: string;
|
|
2093
|
+
episodeIds: string[];
|
|
2094
|
+
linkedThreadIds: string[];
|
|
2095
|
+
}
|
|
2096
|
+
interface MemorySummary {
|
|
2097
|
+
id: string;
|
|
2098
|
+
createdAt: string;
|
|
2099
|
+
timeRangeStart: string;
|
|
2100
|
+
timeRangeEnd: string;
|
|
2101
|
+
summaryText: string;
|
|
2102
|
+
keyFacts: string[];
|
|
2103
|
+
keyEntities: string[];
|
|
2104
|
+
sourceEpisodeIds: string[];
|
|
2105
|
+
}
|
|
2106
|
+
interface DaySummaryResult {
|
|
2107
|
+
summary: string;
|
|
2108
|
+
bullets: string[];
|
|
2109
|
+
next_actions: string[];
|
|
2110
|
+
risks_or_open_loops: string[];
|
|
2111
|
+
}
|
|
2112
|
+
interface TopicScore {
|
|
2113
|
+
term: string;
|
|
2114
|
+
score: number;
|
|
2115
|
+
count: number;
|
|
2116
|
+
}
|
|
2117
|
+
interface MemoryFile {
|
|
2118
|
+
path: string;
|
|
2119
|
+
frontmatter: MemoryFrontmatter;
|
|
2120
|
+
content: string;
|
|
2121
|
+
}
|
|
2122
|
+
/**
|
|
2123
|
+
* Public type representing the **Observation** stage in the
|
|
2124
|
+
* Trace → Observation → Primitive pipeline (issue #685).
|
|
2125
|
+
*
|
|
2126
|
+
* - **Trace**: raw conversation turns captured in `buffer.ts`. Noisy,
|
|
2127
|
+
* verbose, ephemeral.
|
|
2128
|
+
* - **Observation** (this type): post-extraction, importance-scored
|
|
2129
|
+
* fact candidate emitted by `extraction.ts` / `extraction-judge.ts`.
|
|
2130
|
+
* Already distilled — but not yet consolidated against the corpus.
|
|
2131
|
+
* - **Primitive**: the durable `MemoryFile` written by `storage.ts`,
|
|
2132
|
+
* reinforced over time by `compounding/engine.ts`.
|
|
2133
|
+
*
|
|
2134
|
+
* `MemoryObservation` is the named handle on the intermediate stage
|
|
2135
|
+
* the codebase has always produced but never publicly typed. It lets
|
|
2136
|
+
* callers (telemetry, doctor surfaces, tests, downstream tooling)
|
|
2137
|
+
* inspect the post-extraction shape without reaching into extraction
|
|
2138
|
+
* internals.
|
|
2139
|
+
*
|
|
2140
|
+
* Naming note: this is intentionally NOT the same as the existing
|
|
2141
|
+
* `state/observation-ledger/` directory, which is telemetry storage
|
|
2142
|
+
* for the extraction pipeline (turn-count aggregates rebuilt by
|
|
2143
|
+
* `maintenance/rebuild-observations.ts` and judge verdict events
|
|
2144
|
+
* appended by `extraction-judge-telemetry.ts`). Lifecycle events on
|
|
2145
|
+
* primitives — status flips, supersessions, archival, forget — live
|
|
2146
|
+
* in `state/memory-lifecycle-ledger.jsonl`, written by
|
|
2147
|
+
* `StorageManager`. A `MemoryObservation` describes the in-flight
|
|
2148
|
+
* candidate that became (or didn't become) a primitive; the ledger
|
|
2149
|
+
* directory is how the pipeline reports on itself. See
|
|
2150
|
+
* `docs/trace-to-primitive.md` for the full pipeline walkthrough.
|
|
2151
|
+
*/
|
|
2152
|
+
interface MemoryObservation {
|
|
2153
|
+
/** Stable id for this observation, distinct from any primitive id. */
|
|
2154
|
+
id: string;
|
|
2155
|
+
/** Source session id the trace came from. */
|
|
2156
|
+
sessionId?: string;
|
|
2157
|
+
/** ISO timestamp the observation was emitted. */
|
|
2158
|
+
observedAt: string;
|
|
2159
|
+
/** The extracted fact candidate (category, content, confidence, tags, etc.). */
|
|
2160
|
+
fact: ExtractedFact;
|
|
2161
|
+
/** Importance score in [0,1], from `importance.ts`. */
|
|
2162
|
+
importance?: number;
|
|
2163
|
+
/**
|
|
2164
|
+
* Whether the observation passed the extraction judge
|
|
2165
|
+
* (`extraction-judge.ts`). When `false`, the observation was
|
|
2166
|
+
* captured for telemetry but not persisted as a primitive.
|
|
2167
|
+
*/
|
|
2168
|
+
judgeAccepted?: boolean;
|
|
2169
|
+
/** Optional reason the judge gave when rejecting. */
|
|
2170
|
+
judgeRejectionReason?: string;
|
|
2171
|
+
/**
|
|
2172
|
+
* Id of the resulting `MemoryFile` primitive once consolidation runs.
|
|
2173
|
+
* Absent until consolidation decides to ADD/MERGE/UPDATE the
|
|
2174
|
+
* observation into the corpus.
|
|
2175
|
+
*/
|
|
2176
|
+
resultingPrimitiveId?: string;
|
|
2177
|
+
}
|
|
2178
|
+
/** Ordered step for extracted procedure memories (issue #519). */
|
|
2179
|
+
interface ExtractedProcedureStep {
|
|
2180
|
+
order: number;
|
|
2181
|
+
intent: string;
|
|
2182
|
+
toolCall?: {
|
|
2183
|
+
kind: string;
|
|
2184
|
+
signature: string;
|
|
2185
|
+
};
|
|
2186
|
+
expectedOutcome?: string;
|
|
2187
|
+
optional?: boolean;
|
|
2188
|
+
}
|
|
2189
|
+
interface ExtractedFact {
|
|
2190
|
+
category: MemoryCategory;
|
|
2191
|
+
content: string;
|
|
2192
|
+
confidence: number;
|
|
2193
|
+
tags: string[];
|
|
2194
|
+
entityRef?: string;
|
|
2195
|
+
source?: ExtractionPassSource;
|
|
2196
|
+
promptedByQuestion?: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* Whether this fact is project-scoped or globally applicable.
|
|
2199
|
+
* When `extractionScopeClassificationEnabled` is true, the extraction LLM
|
|
2200
|
+
* classifies each fact. Default is `"project"` when a coding context is
|
|
2201
|
+
* active, `"global"` when no coding context is present.
|
|
2202
|
+
*/
|
|
2203
|
+
scope?: MemoryScope;
|
|
2204
|
+
/** Structured key-value attributes extracted from the content (e.g., product attributes, dates, quantities). */
|
|
2205
|
+
structuredAttributes?: Record<string, string>;
|
|
2206
|
+
/** When category is `procedure`, ordered steps with intents (persisted under procedures/). */
|
|
2207
|
+
procedureSteps?: ExtractedProcedureStep[];
|
|
2208
|
+
/**
|
|
2209
|
+
* When category is `reasoning_trace`, the stored solution chain the user
|
|
2210
|
+
* walked through. Persisted under reasoning-traces/.
|
|
2211
|
+
*/
|
|
2212
|
+
reasoningTrace?: ExtractedReasoningTrace;
|
|
2213
|
+
}
|
|
2214
|
+
interface ExtractedReasoningTraceStep {
|
|
2215
|
+
order: number;
|
|
2216
|
+
description: string;
|
|
2217
|
+
}
|
|
2218
|
+
interface ExtractedReasoningTrace {
|
|
2219
|
+
steps: ExtractedReasoningTraceStep[];
|
|
2220
|
+
finalAnswer: string;
|
|
2221
|
+
observedOutcome?: string;
|
|
2222
|
+
}
|
|
2223
|
+
interface MemoryIntent {
|
|
2224
|
+
goal: string;
|
|
2225
|
+
actionType: string;
|
|
2226
|
+
entityTypes: string[];
|
|
2227
|
+
/** True when the prompt reads like starting a concrete task (ship/deploy/tests/PR, etc.). */
|
|
2228
|
+
taskInitiation?: boolean;
|
|
2229
|
+
}
|
|
2230
|
+
interface ExtractedQuestion {
|
|
2231
|
+
question: string;
|
|
2232
|
+
context: string;
|
|
2233
|
+
priority: number;
|
|
2234
|
+
}
|
|
2235
|
+
interface QuestionEntry {
|
|
2236
|
+
id: string;
|
|
2237
|
+
question: string;
|
|
2238
|
+
context: string;
|
|
2239
|
+
priority: number;
|
|
2240
|
+
created: string;
|
|
2241
|
+
resolved: boolean;
|
|
2242
|
+
resolvedAt?: string;
|
|
2243
|
+
}
|
|
2244
|
+
interface ExtractionResult {
|
|
2245
|
+
facts: ExtractedFact[];
|
|
2246
|
+
profileUpdates: string[];
|
|
2247
|
+
entities: EntityMention[];
|
|
2248
|
+
questions: ExtractedQuestion[];
|
|
2249
|
+
identityReflection?: string;
|
|
2250
|
+
relationships?: ExtractedRelationship[];
|
|
2251
|
+
}
|
|
2252
|
+
interface EntityMention {
|
|
2253
|
+
name: string;
|
|
2254
|
+
type: "person" | "project" | "tool" | "company" | "place" | "other";
|
|
2255
|
+
facts: string[];
|
|
2256
|
+
structuredSections?: EntityStructuredSection[];
|
|
2257
|
+
source?: ExtractionPassSource;
|
|
2258
|
+
promptedByQuestion?: string;
|
|
2259
|
+
}
|
|
2260
|
+
interface EntityRelationship {
|
|
2261
|
+
target: string;
|
|
2262
|
+
label: string;
|
|
2263
|
+
}
|
|
2264
|
+
interface EntityActivityEntry {
|
|
2265
|
+
date: string;
|
|
2266
|
+
note: string;
|
|
2267
|
+
}
|
|
2268
|
+
interface EntityTimelineEntry {
|
|
2269
|
+
timestamp: string;
|
|
2270
|
+
text: string;
|
|
2271
|
+
source?: string;
|
|
2272
|
+
sessionKey?: string;
|
|
2273
|
+
principal?: string;
|
|
2274
|
+
}
|
|
2275
|
+
interface EntityStructuredSection {
|
|
2276
|
+
key: string;
|
|
2277
|
+
title: string;
|
|
2278
|
+
facts: string[];
|
|
2279
|
+
}
|
|
2280
|
+
interface EntitySchemaSectionDefinition {
|
|
2281
|
+
key: string;
|
|
2282
|
+
title: string;
|
|
2283
|
+
description: string;
|
|
2284
|
+
aliases?: string[];
|
|
2285
|
+
}
|
|
2286
|
+
interface EntitySchemaDefinition {
|
|
2287
|
+
sections: EntitySchemaSectionDefinition[];
|
|
2288
|
+
}
|
|
2289
|
+
interface EntityFile {
|
|
2290
|
+
name: string;
|
|
2291
|
+
type: string;
|
|
2292
|
+
created?: string;
|
|
2293
|
+
updated: string;
|
|
2294
|
+
extraFrontmatterLines?: string[];
|
|
2295
|
+
preSectionLines?: string[];
|
|
2296
|
+
facts: string[];
|
|
2297
|
+
summary?: string;
|
|
2298
|
+
synthesis?: string;
|
|
2299
|
+
synthesisUpdatedAt?: string;
|
|
2300
|
+
synthesisTimelineCount?: number;
|
|
2301
|
+
synthesisStructuredFactCount?: number;
|
|
2302
|
+
synthesisStructuredFactDigest?: string;
|
|
2303
|
+
synthesisVersion?: number;
|
|
2304
|
+
timeline: EntityTimelineEntry[];
|
|
2305
|
+
structuredSections?: EntityStructuredSection[];
|
|
2306
|
+
relationships: EntityRelationship[];
|
|
2307
|
+
activity: EntityActivityEntry[];
|
|
2308
|
+
aliases: string[];
|
|
2309
|
+
extraSections?: Array<{
|
|
2310
|
+
title: string;
|
|
2311
|
+
lines: string[];
|
|
2312
|
+
}>;
|
|
2313
|
+
}
|
|
2314
|
+
interface ScoredEntity {
|
|
2315
|
+
name: string;
|
|
2316
|
+
type: string;
|
|
2317
|
+
score: number;
|
|
2318
|
+
factCount: number;
|
|
2319
|
+
summary?: string;
|
|
2320
|
+
topRelationships: string[];
|
|
2321
|
+
}
|
|
2322
|
+
interface ExtractedRelationship {
|
|
2323
|
+
source: string;
|
|
2324
|
+
target: string;
|
|
2325
|
+
label: string;
|
|
2326
|
+
extractionSource?: ExtractionPassSource;
|
|
2327
|
+
promptedByQuestion?: string;
|
|
2328
|
+
}
|
|
2329
|
+
interface ConsolidationItem {
|
|
2330
|
+
existingId: string;
|
|
2331
|
+
action: ConsolidationAction;
|
|
2332
|
+
mergeWith?: string;
|
|
2333
|
+
updatedContent?: string;
|
|
2334
|
+
reason: string;
|
|
2335
|
+
}
|
|
2336
|
+
interface ConsolidationResult {
|
|
2337
|
+
items: ConsolidationItem[];
|
|
2338
|
+
profileUpdates: string[];
|
|
2339
|
+
entityUpdates: EntityMention[];
|
|
2340
|
+
}
|
|
2341
|
+
interface ConsolidationObservation {
|
|
2342
|
+
runAt: string;
|
|
2343
|
+
recentMemories: MemoryFile[];
|
|
2344
|
+
existingMemories: MemoryFile[];
|
|
2345
|
+
profile: string;
|
|
2346
|
+
result: ConsolidationResult;
|
|
2347
|
+
merged: number;
|
|
2348
|
+
invalidated: number;
|
|
2349
|
+
}
|
|
2350
|
+
interface QmdSearchResult {
|
|
2351
|
+
docid: string;
|
|
2352
|
+
path: string;
|
|
2353
|
+
snippet: string;
|
|
2354
|
+
score: number;
|
|
2355
|
+
explain?: QmdSearchExplain;
|
|
2356
|
+
transport?: "daemon" | "subprocess" | "hybrid" | "scoped_prefilter";
|
|
2357
|
+
}
|
|
2358
|
+
interface QmdSearchExplain {
|
|
2359
|
+
ftsScores?: number[];
|
|
2360
|
+
vectorScores?: number[];
|
|
2361
|
+
rrf?: number;
|
|
2362
|
+
rerankScore?: number;
|
|
2363
|
+
blendedScore?: number;
|
|
2364
|
+
/** Additive boost applied from `reinforcement_count` frontmatter (issue #687 PR 3/4). */
|
|
2365
|
+
reinforcementBoost?: number;
|
|
2366
|
+
}
|
|
2367
|
+
interface MetaState {
|
|
2368
|
+
extractionCount: number;
|
|
2369
|
+
lastExtractionAt: string | null;
|
|
2370
|
+
lastConsolidationAt: string | null;
|
|
2371
|
+
totalMemories: number;
|
|
2372
|
+
totalEntities: number;
|
|
2373
|
+
processedExtractionFingerprints?: Array<{
|
|
2374
|
+
fingerprint: string;
|
|
2375
|
+
observedAt: string;
|
|
2376
|
+
}>;
|
|
2377
|
+
}
|
|
2378
|
+
type MemoryActionType = "store_episode" | "store_note" | "update_note" | "create_artifact" | "summarize_node" | "discard" | "link_graph";
|
|
2379
|
+
type MemoryActionOutcome = "applied" | "skipped" | "failed";
|
|
2380
|
+
type MemoryActionPolicyDecision = "allow" | "defer" | "deny";
|
|
2381
|
+
type MemoryActionStatus = "validated" | "applied" | "rejected";
|
|
2382
|
+
type MemoryActionEligibilitySource = "extraction" | "consolidation" | "replay" | "manual" | "unknown";
|
|
2383
|
+
interface MemoryActionEligibilityContext {
|
|
2384
|
+
confidence: number;
|
|
2385
|
+
lifecycleState: LifecycleState;
|
|
2386
|
+
importance: number;
|
|
2387
|
+
source: MemoryActionEligibilitySource;
|
|
2388
|
+
}
|
|
2389
|
+
interface MemoryActionPolicyResult {
|
|
2390
|
+
action: MemoryActionType;
|
|
2391
|
+
decision: MemoryActionPolicyDecision;
|
|
2392
|
+
rationale: string;
|
|
2393
|
+
eligibility: MemoryActionEligibilityContext;
|
|
2394
|
+
}
|
|
2395
|
+
interface MemoryActionEvent {
|
|
2396
|
+
schemaVersion?: number;
|
|
2397
|
+
actionId?: string;
|
|
2398
|
+
timestamp: string;
|
|
2399
|
+
action: MemoryActionType;
|
|
2400
|
+
outcome: MemoryActionOutcome;
|
|
2401
|
+
status?: MemoryActionStatus;
|
|
2402
|
+
actor?: string;
|
|
2403
|
+
subsystem?: string;
|
|
2404
|
+
reason?: string;
|
|
2405
|
+
memoryId?: string;
|
|
2406
|
+
namespace?: string;
|
|
2407
|
+
sessionKey?: string;
|
|
2408
|
+
sourceSessionKey?: string;
|
|
2409
|
+
checkpointCapturedAt?: string;
|
|
2410
|
+
checkpointTtl?: string;
|
|
2411
|
+
checkpointTurnCount?: number;
|
|
2412
|
+
inputSummary?: string;
|
|
2413
|
+
outputMemoryIds?: string[];
|
|
2414
|
+
dryRun?: boolean;
|
|
2415
|
+
policyVersion?: string;
|
|
2416
|
+
promptHash?: string;
|
|
2417
|
+
policyDecision?: MemoryActionPolicyDecision;
|
|
2418
|
+
policyRationale?: string;
|
|
2419
|
+
policyEligibility?: MemoryActionEligibilityContext;
|
|
2420
|
+
}
|
|
2421
|
+
type MemoryLifecycleEventType = "created" | "updated" | "superseded" | "archived" | "rejected" | "restored" | "merged" | "imported" | "promoted" | "explicit_capture_accepted" | "explicit_capture_queued";
|
|
2422
|
+
interface MemoryLifecycleStateSummary {
|
|
2423
|
+
category?: MemoryCategory;
|
|
2424
|
+
path?: string;
|
|
2425
|
+
status?: MemoryStatus;
|
|
2426
|
+
lifecycleState?: LifecycleState;
|
|
2427
|
+
}
|
|
2428
|
+
interface MemoryLifecycleEvent {
|
|
2429
|
+
eventId: string;
|
|
2430
|
+
memoryId: string;
|
|
2431
|
+
eventType: MemoryLifecycleEventType;
|
|
2432
|
+
timestamp: string;
|
|
2433
|
+
actor: string;
|
|
2434
|
+
reasonCode?: string;
|
|
2435
|
+
ruleVersion: string;
|
|
2436
|
+
relatedMemoryIds?: string[];
|
|
2437
|
+
before?: MemoryLifecycleStateSummary;
|
|
2438
|
+
after?: MemoryLifecycleStateSummary;
|
|
2439
|
+
correlationId?: string;
|
|
2440
|
+
}
|
|
2441
|
+
interface MemoryProjectionCurrentState {
|
|
2442
|
+
memoryId: string;
|
|
2443
|
+
category: MemoryCategory;
|
|
2444
|
+
status: MemoryStatus;
|
|
2445
|
+
lifecycleState?: LifecycleState;
|
|
2446
|
+
path: string;
|
|
2447
|
+
pathRel: string;
|
|
2448
|
+
created: string;
|
|
2449
|
+
updated: string;
|
|
2450
|
+
archivedAt?: string;
|
|
2451
|
+
supersededAt?: string;
|
|
2452
|
+
entityRef?: string;
|
|
2453
|
+
source: string;
|
|
2454
|
+
confidence: number;
|
|
2455
|
+
confidenceTier: ConfidenceTier;
|
|
2456
|
+
memoryKind?: MemoryFrontmatter["memoryKind"];
|
|
2457
|
+
accessCount?: number;
|
|
2458
|
+
lastAccessed?: string;
|
|
2459
|
+
tags?: string[];
|
|
2460
|
+
preview?: string;
|
|
2461
|
+
}
|
|
2462
|
+
interface CompressionGuidelineOptimizerSourceWindow {
|
|
2463
|
+
from: string;
|
|
2464
|
+
to: string;
|
|
2465
|
+
}
|
|
2466
|
+
interface CompressionGuidelineOptimizerEventCounts {
|
|
2467
|
+
total: number;
|
|
2468
|
+
applied: number;
|
|
2469
|
+
skipped: number;
|
|
2470
|
+
failed: number;
|
|
2471
|
+
}
|
|
2472
|
+
type CompressionGuidelineActivationState = "draft" | "active";
|
|
2473
|
+
interface CompressionGuidelineOptimizerActionSummary {
|
|
2474
|
+
action: MemoryActionType;
|
|
2475
|
+
total: number;
|
|
2476
|
+
outcomes: Record<MemoryActionOutcome, number>;
|
|
2477
|
+
quality: {
|
|
2478
|
+
good: number;
|
|
2479
|
+
poor: number;
|
|
2480
|
+
unknown: number;
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
interface CompressionGuidelineOptimizerRuleUpdate {
|
|
2484
|
+
action: MemoryActionType;
|
|
2485
|
+
delta: number;
|
|
2486
|
+
direction: "increase" | "decrease" | "hold";
|
|
2487
|
+
confidence: "low" | "medium" | "high";
|
|
2488
|
+
notes: string[];
|
|
2489
|
+
}
|
|
2490
|
+
interface CompressionGuidelineOptimizerState {
|
|
2491
|
+
version: number;
|
|
2492
|
+
updatedAt: string;
|
|
2493
|
+
sourceWindow: CompressionGuidelineOptimizerSourceWindow;
|
|
2494
|
+
eventCounts: CompressionGuidelineOptimizerEventCounts;
|
|
2495
|
+
guidelineVersion: number;
|
|
2496
|
+
contentHash?: string;
|
|
2497
|
+
activationState?: CompressionGuidelineActivationState;
|
|
2498
|
+
actionSummaries?: CompressionGuidelineOptimizerActionSummary[];
|
|
2499
|
+
ruleUpdates?: CompressionGuidelineOptimizerRuleUpdate[];
|
|
2500
|
+
}
|
|
2501
|
+
type ContinuityIncidentState = "open" | "closed";
|
|
2502
|
+
interface ContinuityIncidentRecord {
|
|
2503
|
+
id: string;
|
|
2504
|
+
state: ContinuityIncidentState;
|
|
2505
|
+
openedAt: string;
|
|
2506
|
+
updatedAt: string;
|
|
2507
|
+
triggerWindow?: string;
|
|
2508
|
+
symptom: string;
|
|
2509
|
+
suspectedCause?: string;
|
|
2510
|
+
fixApplied?: string;
|
|
2511
|
+
verificationResult?: string;
|
|
2512
|
+
preventiveRule?: string;
|
|
2513
|
+
closedAt?: string;
|
|
2514
|
+
filePath?: string;
|
|
2515
|
+
}
|
|
2516
|
+
interface ContinuityIncidentOpenInput {
|
|
2517
|
+
triggerWindow?: string;
|
|
2518
|
+
symptom: string;
|
|
2519
|
+
suspectedCause?: string;
|
|
2520
|
+
}
|
|
2521
|
+
interface ContinuityIncidentCloseInput {
|
|
2522
|
+
fixApplied: string;
|
|
2523
|
+
verificationResult: string;
|
|
2524
|
+
preventiveRule?: string;
|
|
2525
|
+
}
|
|
2526
|
+
type ContinuityLoopCadence = "daily" | "weekly" | "monthly" | "quarterly";
|
|
2527
|
+
type ContinuityLoopStatus = "active" | "paused" | "retired";
|
|
2528
|
+
interface ContinuityImprovementLoop {
|
|
2529
|
+
id: string;
|
|
2530
|
+
cadence: ContinuityLoopCadence;
|
|
2531
|
+
purpose: string;
|
|
2532
|
+
status: ContinuityLoopStatus;
|
|
2533
|
+
killCondition: string;
|
|
2534
|
+
lastReviewed: string;
|
|
2535
|
+
notes?: string;
|
|
2536
|
+
}
|
|
2537
|
+
interface ContinuityLoopUpsertInput {
|
|
2538
|
+
id: string;
|
|
2539
|
+
cadence: ContinuityLoopCadence;
|
|
2540
|
+
purpose: string;
|
|
2541
|
+
status: ContinuityLoopStatus;
|
|
2542
|
+
killCondition: string;
|
|
2543
|
+
lastReviewed?: string;
|
|
2544
|
+
notes?: string;
|
|
2545
|
+
}
|
|
2546
|
+
interface ContinuityLoopReviewInput {
|
|
2547
|
+
status?: ContinuityLoopStatus;
|
|
2548
|
+
notes?: string;
|
|
2549
|
+
reviewedAt?: string;
|
|
2550
|
+
}
|
|
2551
|
+
/** Entry in the access tracking buffer (batched updates) */
|
|
2552
|
+
interface AccessTrackingEntry {
|
|
2553
|
+
memoryId: string;
|
|
2554
|
+
newCount: number;
|
|
2555
|
+
lastAccessed: string;
|
|
2556
|
+
}
|
|
2557
|
+
interface SignalScanResult {
|
|
2558
|
+
level: SignalLevel;
|
|
2559
|
+
patterns: string[];
|
|
2560
|
+
}
|
|
2561
|
+
interface LlmTraceEvent {
|
|
2562
|
+
kind: "llm_start" | "llm_end" | "llm_error";
|
|
2563
|
+
traceId: string;
|
|
2564
|
+
model: string;
|
|
2565
|
+
operation: "extraction" | "consolidation" | "profile_consolidation" | "identity_consolidation" | "day_summary";
|
|
2566
|
+
input?: string;
|
|
2567
|
+
output?: string;
|
|
2568
|
+
durationMs?: number;
|
|
2569
|
+
error?: string;
|
|
2570
|
+
tokenUsage?: {
|
|
2571
|
+
input?: number;
|
|
2572
|
+
output?: number;
|
|
2573
|
+
total?: number;
|
|
2574
|
+
};
|
|
2575
|
+
}
|
|
2576
|
+
interface RecallTraceEvent {
|
|
2577
|
+
kind: "recall_summary";
|
|
2578
|
+
traceId: string;
|
|
2579
|
+
operation: "recall";
|
|
2580
|
+
sessionKey?: string;
|
|
2581
|
+
promptHash: string;
|
|
2582
|
+
promptLength: number;
|
|
2583
|
+
retrievalQueryHash: string;
|
|
2584
|
+
retrievalQueryLength: number;
|
|
2585
|
+
recallMode: RecallPlanMode;
|
|
2586
|
+
recallResultLimit: number;
|
|
2587
|
+
qmdEnabled: boolean;
|
|
2588
|
+
qmdAvailable: boolean;
|
|
2589
|
+
recallNamespaces: string[];
|
|
2590
|
+
source: "none" | "hot_qmd" | "hot_embedding" | "cold_fallback" | "recent_scan";
|
|
2591
|
+
recalledMemoryCount: number;
|
|
2592
|
+
injected: boolean;
|
|
2593
|
+
contextChars: number;
|
|
2594
|
+
policyVersion?: string;
|
|
2595
|
+
identityInjectionMode?: IdentityInjectionMode | "none";
|
|
2596
|
+
identityInjectedChars?: number;
|
|
2597
|
+
identityInjectionTruncated?: boolean;
|
|
2598
|
+
durationMs: number;
|
|
2599
|
+
timings?: Record<string, string>;
|
|
2600
|
+
/**
|
|
2601
|
+
* The full recalled memory context added to the runtime context.
|
|
2602
|
+
* Only populated when `traceRecallContent` config option is `true`.
|
|
2603
|
+
* Omitted by default to avoid sending potentially sensitive memory content
|
|
2604
|
+
* to external trace collectors unless explicitly opted in.
|
|
2605
|
+
*/
|
|
2606
|
+
recalledContent?: string;
|
|
2607
|
+
}
|
|
2608
|
+
type EngramTraceEvent = LlmTraceEvent | RecallTraceEvent;
|
|
2609
|
+
type LlmTraceCallback = (event: EngramTraceEvent) => void;
|
|
2610
|
+
type ModelApi = "openai-completions" | "anthropic-messages" | "google-generative" | "codex-cli" | string;
|
|
2611
|
+
type CodexCliReasoningEffort = "low" | "medium" | "high" | "xhigh";
|
|
2612
|
+
type ModelProviderAuthMode = "bearer" | "header" | "query";
|
|
2613
|
+
interface ModelDefinitionConfig {
|
|
2614
|
+
id: string;
|
|
2615
|
+
name?: string;
|
|
2616
|
+
contextWindow?: number;
|
|
2617
|
+
maxOutputTokens?: number;
|
|
2618
|
+
costPer1MInput?: number;
|
|
2619
|
+
costPer1MOutput?: number;
|
|
2620
|
+
aliases?: string[];
|
|
2621
|
+
}
|
|
2622
|
+
interface ModelProviderConfig {
|
|
2623
|
+
baseUrl: string;
|
|
2624
|
+
apiKey?: string | Record<string, unknown>;
|
|
2625
|
+
auth?: ModelProviderAuthMode;
|
|
2626
|
+
api?: ModelApi;
|
|
2627
|
+
headers?: Record<string, string>;
|
|
2628
|
+
authHeader?: boolean;
|
|
2629
|
+
disableThinking?: boolean;
|
|
2630
|
+
executable?: string;
|
|
2631
|
+
reasoningEffort?: CodexCliReasoningEffort;
|
|
2632
|
+
codexCliExecutable?: string;
|
|
2633
|
+
codexCliReasoningEffort?: CodexCliReasoningEffort;
|
|
2634
|
+
retryOptions?: {
|
|
2635
|
+
timeoutMs?: number;
|
|
2636
|
+
};
|
|
2637
|
+
models: ModelDefinitionConfig[];
|
|
2638
|
+
}
|
|
2639
|
+
interface AgentDefaultsConfig {
|
|
2640
|
+
model?: {
|
|
2641
|
+
primary?: string;
|
|
2642
|
+
backup?: string;
|
|
2643
|
+
fallbacks?: string[];
|
|
2644
|
+
};
|
|
2645
|
+
thinking?: {
|
|
2646
|
+
mode?: "off" | "on" | "adaptive";
|
|
2647
|
+
budget?: number;
|
|
2648
|
+
};
|
|
2649
|
+
}
|
|
2650
|
+
interface AgentPersonaModelConfig {
|
|
2651
|
+
primary?: string;
|
|
2652
|
+
fallbacks?: string[];
|
|
2653
|
+
}
|
|
2654
|
+
interface AgentPersona {
|
|
2655
|
+
id: string;
|
|
2656
|
+
name?: string;
|
|
2657
|
+
model?: AgentPersonaModelConfig;
|
|
2658
|
+
}
|
|
2659
|
+
interface GatewayConfig {
|
|
2660
|
+
agents?: {
|
|
2661
|
+
defaults?: AgentDefaultsConfig;
|
|
2662
|
+
list?: AgentPersona[];
|
|
2663
|
+
};
|
|
2664
|
+
models?: {
|
|
2665
|
+
providers?: Record<string, ModelProviderConfig>;
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
interface TranscriptEntry {
|
|
2669
|
+
timestamp: string;
|
|
2670
|
+
role: "user" | "assistant";
|
|
2671
|
+
content: string;
|
|
2672
|
+
sessionKey: string;
|
|
2673
|
+
turnId: string;
|
|
2674
|
+
metadata?: {
|
|
2675
|
+
compactAfter?: boolean;
|
|
2676
|
+
compactionId?: string | null;
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2679
|
+
interface Checkpoint {
|
|
2680
|
+
sessionKey: string;
|
|
2681
|
+
capturedAt: string;
|
|
2682
|
+
turns: TranscriptEntry[];
|
|
2683
|
+
ttl: string;
|
|
2684
|
+
}
|
|
2685
|
+
interface HourlySummary {
|
|
2686
|
+
hour: string;
|
|
2687
|
+
sessionKey: string;
|
|
2688
|
+
bullets: string[];
|
|
2689
|
+
turnCount: number;
|
|
2690
|
+
generatedAt: string;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
export { type AccessTrackingEntry, type ActiveRecallChatType, type ActiveRecallModelFallbackPolicy, type ActiveRecallPromptStyle, type ActiveRecallQueryMode, type ActiveRecallThinking, type AgentAccessAuthToken, type AgentAccessHttpConfig, type AgentDefaultsConfig, type AgentPersona, type AgentPersonaModelConfig, type BehaviorLoopAdjustment, type BehaviorLoopPolicyState, type BehaviorSignalDirection, type BehaviorSignalEvent, type BehaviorSignalType, type BootstrapOptions, type BootstrapResult, type BriefingActiveThread, type BriefingCalendarSourceError, type BriefingConfig, type BriefingFocus, type BriefingFollowup, type BriefingOpenCommitment, type BriefingRecentEntity, type BriefingResult, type BriefingSections, type BriefingWindow, type BufferEntryState, type BufferState, type BufferSurpriseEvent, type BufferTurn, type CalendarEvent, type CalendarSource, type CaptureMode, type Checkpoint, type CodexCliReasoningEffort, type CodexCompactionFlushMode, type CodexCompatConfig, type CodexConnectorConfig, type CodingContext, type CodingModeConfig, type CompressionGuidelineActivationState, type CompressionGuidelineOptimizerActionSummary, type CompressionGuidelineOptimizerEventCounts, type CompressionGuidelineOptimizerRuleUpdate, type CompressionGuidelineOptimizerSourceWindow, type CompressionGuidelineOptimizerState, type ConfidenceTier, type ConsolidationAction, type ConsolidationItem, type ConsolidationObservation, type ConsolidationResult, type ContinuityImprovementLoop, type ContinuityIncidentCloseInput, type ContinuityIncidentOpenInput, type ContinuityIncidentRecord, type ContinuityIncidentState, type ContinuityLoopCadence, type ContinuityLoopReviewInput, type ContinuityLoopStatus, type ContinuityLoopUpsertInput, type ContradictionScanConfig, type ConversationThread, type CronConversationRecallMode, type CronRecallMode, DEFAULT_RECALL_DISCLOSURE, type DaySummaryResult, type DreamingConfig, type DreamingNarrativePromptStyle, type DreamsDeepSleepConfig, type DreamsLightSleepConfig, type DreamsPhase, type DreamsPhaseStatus, type DreamsPhasesConfig, type DreamsRemConfig, type DreamsRunResult, type DreamsStatusResult, type EngramTraceEvent, type EntityActivityEntry, type EntityFile, type EntityMention, type EntityRelationship, type EntitySchemaDefinition, type EntitySchemaSectionDefinition, type EntityStructuredSection, type EntityTimelineEntry, type ExtractedFact, type ExtractedProcedureStep, type ExtractedQuestion, type ExtractedReasoningTrace, type ExtractedReasoningTraceStep, type ExtractedRelationship, type ExtractionPassSource, type ExtractionResult, type FileHygieneConfig, type GatewayConfig, type GitHubLiveConnectorConfig, type GmailLiveConnectorConfig, type GoogleDriveLiveConnectorConfig, type HeartbeatConfig, type HeartbeatDetectionMode, type HourlySummary, type IdentityInjectionMode, type ImportanceLevel, type ImportanceScore, type LifecycleState, type LiveConnectorsConfig, type LlmTraceCallback, type LlmTraceEvent, type MemoryActionEligibilityContext, type MemoryActionEligibilitySource, type MemoryActionEvent, type MemoryActionOutcome, type MemoryActionPolicyDecision, type MemoryActionPolicyResult, type MemoryActionStatus, type MemoryActionType, type MemoryCategory, type MemoryFile, type MemoryFrontmatter, type MemoryIntent, type MemoryLifecycleEvent, type MemoryLifecycleEventType, type MemoryLifecycleStateSummary, type MemoryLink, type MemoryLinkType, type MemoryObservation, type MemoryOsPresetName, type MemoryProjectionCurrentState, type MemoryScope, type MemoryStatus, type MemorySummary, type MetaState, type ModelApi, type ModelDefinitionConfig, type ModelProviderAuthMode, type ModelProviderConfig, type NamespacePolicy, type NativeKnowledgeConfig, type NativeKnowledgeFolderRuleConfig, type NativeKnowledgeObsidianVaultConfig, type NativeKnowledgeOpenClawWorkspaceConfig, type NotionLiveConnectorConfig, type PluginConfig, type PolicyClass, type PrincipalFromSessionKeyMode, type PrincipalRule, type ProceduralConfig, type QmdSearchExplain, type QmdSearchResult, type QuestionEntry, RECALL_DISCLOSURE_LEVELS, type ReasoningEffort, type RecallDisclosure, type RecallPipelineConfig, type RecallPlanMode, type RecallSectionConfig, type RecallTierExplain, type RecallTraceEvent, type RelevanceFeedback, type RetrievalTier, SPECULATIVE_TTL_DAYS, type ScoredEntity, type SecretRef, type SemanticChunkingConfigShape, type SessionObserverBandConfig, type SignalLevel, type SignalScanResult, type SlotBehaviorConfig, type SlotMismatchMode, type TopicScore, type TranscriptEntry, type TriggerMode, type VerificationState, confidenceTier, isRecallDisclosure };
|