monomind 1.11.11 → 1.11.13

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.
Files changed (227) hide show
  1. package/.claude/commands/mastermind/idea.md +1 -1
  2. package/.claude/commands/mastermind/master.md +1 -1
  3. package/.claude/skills/mastermind/_protocol.md +4 -4
  4. package/.claude/skills/mastermind/architect.md +7 -4
  5. package/.claude/skills/mastermind/autodev.md +4 -2
  6. package/.claude/skills/mastermind/build.md +3 -3
  7. package/.claude/skills/mastermind/content.md +3 -3
  8. package/.claude/skills/mastermind/createorg.md +2 -2
  9. package/.claude/skills/mastermind/finance.md +3 -3
  10. package/.claude/skills/mastermind/idea.md +8 -0
  11. package/.claude/skills/mastermind/marketing.md +3 -3
  12. package/.claude/skills/mastermind/ops.md +3 -3
  13. package/.claude/skills/mastermind/release.md +3 -3
  14. package/.claude/skills/mastermind/research.md +3 -3
  15. package/.claude/skills/mastermind/review.md +3 -3
  16. package/.claude/skills/mastermind/sales.md +3 -3
  17. package/package.json +1 -1
  18. package/packages/@monomind/cli/dist/src/index.js +19 -14
  19. package/packages/@monomind/cli/dist/src/init/statusline-generator.js +3 -3
  20. package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +1 -1
  21. package/packages/@monomind/cli/dist/src/update/checker.js +24 -7
  22. package/packages/@monomind/cli/dist/src/update/index.d.ts +10 -0
  23. package/packages/@monomind/cli/dist/src/update/index.js +29 -2
  24. package/packages/@monomind/cli/package.json +1 -1
  25. package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +0 -25
  26. package/packages/@monomind/cli/dist/src/agents/halt-signal.js +0 -76
  27. package/packages/@monomind/cli/dist/src/agents/index.d.ts +0 -18
  28. package/packages/@monomind/cli/dist/src/agents/index.js +0 -13
  29. package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +0 -41
  30. package/packages/@monomind/cli/dist/src/agents/managed-agent.js +0 -69
  31. package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +0 -23
  32. package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +0 -49
  33. package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +0 -22
  34. package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +0 -80
  35. package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +0 -71
  36. package/packages/@monomind/cli/dist/src/agents/registry-query.js +0 -125
  37. package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +0 -19
  38. package/packages/@monomind/cli/dist/src/agents/score-decay.js +0 -22
  39. package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +0 -13
  40. package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +0 -40
  41. package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +0 -54
  42. package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +0 -212
  43. package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +0 -30
  44. package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +0 -84
  45. package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +0 -20
  46. package/packages/@monomind/cli/dist/src/agents/trigger-index.js +0 -38
  47. package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +0 -64
  48. package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +0 -308
  49. package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +0 -18
  50. package/packages/@monomind/cli/dist/src/agents/version-diff.js +0 -64
  51. package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +0 -60
  52. package/packages/@monomind/cli/dist/src/agents/version-store.js +0 -235
  53. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -45
  54. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +0 -404
  55. package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +0 -14
  56. package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +0 -333
  57. package/packages/@monomind/cli/dist/src/commands/ui.js +0 -68
  58. package/packages/@monomind/cli/dist/src/consensus/index.d.ts +0 -7
  59. package/packages/@monomind/cli/dist/src/consensus/index.js +0 -6
  60. package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +0 -44
  61. package/packages/@monomind/cli/dist/src/context/context-provider.js +0 -25
  62. package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +0 -12
  63. package/packages/@monomind/cli/dist/src/context/git-state-provider.js +0 -34
  64. package/packages/@monomind/cli/dist/src/context/index.d.ts +0 -12
  65. package/packages/@monomind/cli/dist/src/context/index.js +0 -12
  66. package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +0 -15
  67. package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +0 -19
  68. package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +0 -26
  69. package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +0 -93
  70. package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +0 -24
  71. package/packages/@monomind/cli/dist/src/context/task-history-provider.js +0 -32
  72. package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +0 -14
  73. package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +0 -27
  74. package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +0 -31
  75. package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +0 -81
  76. package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +0 -24
  77. package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +0 -65
  78. package/packages/@monomind/cli/dist/src/dlq/index.d.ts +0 -10
  79. package/packages/@monomind/cli/dist/src/dlq/index.js +0 -7
  80. package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +0 -33
  81. package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +0 -107
  82. package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +0 -23
  83. package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +0 -59
  84. package/packages/@monomind/cli/dist/src/eval/index.d.ts +0 -10
  85. package/packages/@monomind/cli/dist/src/eval/index.js +0 -7
  86. package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +0 -40
  87. package/packages/@monomind/cli/dist/src/eval/trace-collector.js +0 -102
  88. package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
  89. package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +0 -264
  90. package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +0 -22
  91. package/packages/@monomind/cli/dist/src/interactive/interrupt.js +0 -71
  92. package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +0 -25
  93. package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +0 -48
  94. package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +0 -61
  95. package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +0 -246
  96. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
  97. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
  98. package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +0 -21
  99. package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +0 -106
  100. package/packages/@monomind/cli/dist/src/model/index.d.ts +0 -4
  101. package/packages/@monomind/cli/dist/src/model/index.js +0 -4
  102. package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +0 -22
  103. package/packages/@monomind/cli/dist/src/model/model-settings.js +0 -33
  104. package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +0 -24
  105. package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +0 -65
  106. package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +0 -34
  107. package/packages/@monomind/cli/dist/src/monovector/capabilities.js +0 -37
  108. package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +0 -7
  109. package/packages/@monomind/cli/dist/src/orchestration/index.js +0 -6
  110. package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
  111. package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +0 -31
  112. package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +0 -68
  113. package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +0 -180
  114. package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
  115. package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +0 -126
  116. package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
  117. package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +0 -188
  118. package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
  119. package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +0 -206
  120. package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +0 -60
  121. package/packages/@monomind/cli/dist/src/runtime/headless.js +0 -284
  122. package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
  123. package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +0 -95
  124. package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +0 -197
  125. package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +0 -623
  126. package/packages/@monomind/cli/dist/src/services/index.d.ts +0 -13
  127. package/packages/@monomind/cli/dist/src/services/index.js +0 -11
  128. package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +0 -201
  129. package/packages/@monomind/cli/dist/src/services/worker-queue.js +0 -594
  130. package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +0 -25
  131. package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +0 -77
  132. package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +0 -31
  133. package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +0 -61
  134. package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +0 -19
  135. package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +0 -68
  136. package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
  137. package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +0 -205
  138. package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
  139. package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +0 -190
  140. package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
  141. package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +0 -105
  142. package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
  143. package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +0 -214
  144. package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +0 -10
  145. package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +0 -82
  146. package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +0 -12
  147. package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +0 -23
  148. package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +0 -17
  149. package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +0 -129
  150. package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +0 -9
  151. package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +0 -116
  152. package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +0 -41
  153. package/packages/@monomind/cli/dist/src/workflow/dag-types.js +0 -8
  154. package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +0 -12
  155. package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +0 -20
  156. package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +0 -165
  157. package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +0 -82
  158. package/packages/@monomind/cli/dist/src/workflow/index.d.ts +0 -13
  159. package/packages/@monomind/cli/dist/src/workflow/index.js +0 -11
  160. package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +0 -11
  161. package/packages/@monomind/cli/dist/src/workflow/template-engine.js +0 -40
  162. package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +0 -29
  163. package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +0 -227
  164. package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
  165. package/packages/@monomind/guidance/dist/adversarial.js +0 -572
  166. package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
  167. package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
  168. package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
  169. package/packages/@monomind/guidance/dist/artifacts.js +0 -356
  170. package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
  171. package/packages/@monomind/guidance/dist/authority.js +0 -558
  172. package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
  173. package/packages/@monomind/guidance/dist/capabilities.js +0 -485
  174. package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
  175. package/packages/@monomind/guidance/dist/coherence.js +0 -372
  176. package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
  177. package/packages/@monomind/guidance/dist/compiler.js +0 -419
  178. package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
  179. package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
  180. package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
  181. package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
  182. package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
  183. package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
  184. package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
  185. package/packages/@monomind/guidance/dist/evolution.js +0 -500
  186. package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
  187. package/packages/@monomind/guidance/dist/gates.js +0 -302
  188. package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
  189. package/packages/@monomind/guidance/dist/gateway.js +0 -452
  190. package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
  191. package/packages/@monomind/guidance/dist/generators.js +0 -682
  192. package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
  193. package/packages/@monomind/guidance/dist/headless.js +0 -342
  194. package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
  195. package/packages/@monomind/guidance/dist/hooks.js +0 -347
  196. package/packages/@monomind/guidance/dist/index.d.ts +0 -205
  197. package/packages/@monomind/guidance/dist/index.js +0 -321
  198. package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
  199. package/packages/@monomind/guidance/dist/ledger.js +0 -375
  200. package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
  201. package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
  202. package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
  203. package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
  204. package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
  205. package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
  206. package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
  207. package/packages/@monomind/guidance/dist/optimizer.js +0 -329
  208. package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
  209. package/packages/@monomind/guidance/dist/persistence.js +0 -464
  210. package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
  211. package/packages/@monomind/guidance/dist/proof.js +0 -238
  212. package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
  213. package/packages/@monomind/guidance/dist/retriever.js +0 -394
  214. package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
  215. package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
  216. package/packages/@monomind/guidance/dist/temporal.d.ts +0 -426
  217. package/packages/@monomind/guidance/dist/temporal.js +0 -658
  218. package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
  219. package/packages/@monomind/guidance/dist/trust.js +0 -473
  220. package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
  221. package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
  222. package/packages/@monomind/guidance/dist/types.d.ts +0 -378
  223. package/packages/@monomind/guidance/dist/types.js +0 -10
  224. package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
  225. package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
  226. package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
  227. package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
@@ -1,276 +0,0 @@
1
- /**
2
- * Truth Anchor System
3
- *
4
- * Immutable, externally-signed facts that anchor the system to reality
5
- * beyond tool outputs and internal memory.
6
- *
7
- * A Truth Anchor is a fact that:
8
- * - Is immutable once recorded (cannot be overwritten or decayed)
9
- * - Is externally signed (by a human, hardware sensor, or external authority)
10
- * - Supersedes any internal belief that contradicts it
11
- * - Can be referenced but never mutated
12
- * - Has a verifiable signature chain
13
- *
14
- * TruthAnchorStore:
15
- * - Creates and signs new truth anchors with HMAC-SHA256
16
- * - Append-only storage (anchors are never mutated after creation)
17
- * - Retrieval by ID, time range, kind, attester, or tags
18
- * - Signature verification for individual anchors or the full store
19
- * - Supersession chain: new anchors can declare they supersede old ones
20
- * - Export/import for persistence and transfer
21
- * - Max 50,000 anchors with LRU eviction of expired ones only
22
- *
23
- * TruthResolver:
24
- * - Resolves conflicts between internal beliefs and truth anchors
25
- * - Memory conflict resolution (truth anchor always wins)
26
- * - Decision conflict resolution (constrains proposed actions)
27
- * - Topic-based ground truth retrieval with fuzzy tag matching
28
- *
29
- * @module @monomind/guidance/truth-anchors
30
- */
31
- /**
32
- * The kind of external source that attested to a truth anchor.
33
- */
34
- export type TruthSourceKind = 'human-attestation' | 'hardware-signal' | 'regulatory-input' | 'external-observation' | 'signed-document' | 'consensus-result';
35
- /**
36
- * An immutable, externally-signed fact anchored to the system.
37
- *
38
- * Once created, a TruthAnchor is never mutated. It can only be
39
- * superseded by a new anchor that references the old one.
40
- */
41
- export interface TruthAnchor {
42
- /** Unique identifier (UUID v4) */
43
- id: string;
44
- /** The kind of external source that attested to this fact */
45
- kind: TruthSourceKind;
46
- /** The fact being asserted, in natural language */
47
- claim: string;
48
- /** Supporting data or evidence for the claim */
49
- evidence: string;
50
- /** Who or what signed this anchor (human ID, sensor ID, authority ID) */
51
- attesterId: string;
52
- /** HMAC-SHA256 signature over the canonical anchor content */
53
- signature: string;
54
- /** Unix timestamp (ms) when the anchor was created */
55
- timestamp: number;
56
- /** Unix timestamp (ms) when the fact became true */
57
- validFrom: number;
58
- /** Unix timestamp (ms) when the fact expires, or null for indefinite */
59
- validUntil: number | null;
60
- /** IDs of anchors that this anchor supersedes */
61
- supersedes: string[];
62
- /** Searchable tags for topic-based retrieval */
63
- tags: string[];
64
- /** Arbitrary metadata attached to the anchor */
65
- metadata: Record<string, unknown>;
66
- }
67
- /**
68
- * Configuration for the TruthAnchorStore.
69
- */
70
- export interface TruthAnchorConfig {
71
- /** HMAC-SHA256 signing key */
72
- signingKey: string;
73
- /** Maximum number of anchors to retain (default 50,000) */
74
- maxAnchors: number;
75
- }
76
- /**
77
- * Parameters for creating a new truth anchor.
78
- */
79
- export interface AnchorParams {
80
- kind: TruthSourceKind;
81
- claim: string;
82
- evidence: string;
83
- attesterId: string;
84
- validFrom?: number;
85
- validUntil?: number | null;
86
- supersedes?: string[];
87
- tags?: string[];
88
- metadata?: Record<string, unknown>;
89
- }
90
- /**
91
- * Query options for filtering truth anchors.
92
- */
93
- export interface TruthAnchorQuery {
94
- /** Filter by source kind */
95
- kind?: TruthSourceKind;
96
- /** Filter by attester ID */
97
- attesterId?: string;
98
- /** Filter by tags (anchor must have at least one matching tag) */
99
- tags?: string[];
100
- /** Only return anchors valid at this timestamp */
101
- validAt?: number;
102
- }
103
- /**
104
- * Result of verifying all anchors in the store.
105
- */
106
- export interface VerifyAllResult {
107
- /** Number of anchors with valid signatures */
108
- valid: number;
109
- /** IDs of anchors with invalid signatures */
110
- invalid: string[];
111
- }
112
- /**
113
- * Result of resolving a conflict between an internal belief and truth anchors.
114
- */
115
- export interface ConflictResolution {
116
- /** Whether a truth anchor overrides the internal belief */
117
- truthWins: boolean;
118
- /** The truth anchor that overrides, if any */
119
- anchor?: TruthAnchor;
120
- /** Human-readable explanation of the resolution */
121
- reason: string;
122
- }
123
- /**
124
- * Append-only store for truth anchors.
125
- *
126
- * Anchors are immutable once created. The store provides signing,
127
- * verification, querying, supersession, and capacity management
128
- * with LRU eviction of expired anchors only.
129
- */
130
- export declare class TruthAnchorStore {
131
- private readonly config;
132
- private readonly anchors;
133
- private readonly indexById;
134
- constructor(config?: Partial<TruthAnchorConfig>);
135
- /**
136
- * Create and sign a new truth anchor.
137
- *
138
- * The anchor is appended to the store and can never be mutated.
139
- * If the store exceeds capacity, expired anchors are evicted
140
- * starting from the oldest.
141
- */
142
- anchor(params: AnchorParams): TruthAnchor;
143
- /**
144
- * Retrieve a truth anchor by its ID.
145
- *
146
- * Returns undefined if the anchor does not exist.
147
- */
148
- get(id: string): TruthAnchor | undefined;
149
- /**
150
- * Get all anchors that are valid at the given timestamp.
151
- *
152
- * An anchor is active when:
153
- * - `validFrom <= timestamp`
154
- * - `validUntil` is null (indefinite) or `validUntil > timestamp`
155
- *
156
- * Defaults to the current time if no timestamp is provided.
157
- */
158
- getActive(timestamp?: number): TruthAnchor[];
159
- /**
160
- * Query anchors with optional filters.
161
- *
162
- * All provided filters are ANDed together. An anchor must match
163
- * every specified filter to be included in the result.
164
- */
165
- query(opts: TruthAnchorQuery): TruthAnchor[];
166
- /**
167
- * Verify the HMAC-SHA256 signature of a single anchor.
168
- *
169
- * Recomputes the signature from the anchor's content and compares
170
- * it to the stored signature. Returns true if they match.
171
- */
172
- verify(id: string): boolean;
173
- /**
174
- * Verify all anchors in the store.
175
- *
176
- * Returns a summary with the count of valid anchors and the
177
- * IDs of any anchors whose signatures do not match.
178
- */
179
- verifyAll(): VerifyAllResult;
180
- /**
181
- * Create a new anchor that supersedes an existing one.
182
- *
183
- * The old anchor remains in the store (immutable) but the new
184
- * anchor's `supersedes` array includes the old anchor's ID.
185
- * This creates a verifiable supersession chain.
186
- *
187
- * Throws if the old anchor ID does not exist.
188
- */
189
- supersede(oldId: string, params: AnchorParams): TruthAnchor;
190
- /**
191
- * Resolve a claim against an internal belief.
192
- *
193
- * Searches for active truth anchors whose claim matches the
194
- * provided claim text. If a matching truth anchor exists and
195
- * is currently valid, it wins over the internal belief.
196
- *
197
- * Returns the truth anchor if it exists, otherwise returns
198
- * undefined (meaning the internal belief stands).
199
- */
200
- resolve(claim: string, _internalBelief: string): TruthAnchor | undefined;
201
- /**
202
- * Export all anchors for persistence or transfer.
203
- *
204
- * Returns a shallow copy of the anchor array. The individual
205
- * anchor objects are returned as-is since they are immutable.
206
- */
207
- exportAnchors(): TruthAnchor[];
208
- /**
209
- * Import anchors from an external source.
210
- *
211
- * Imported anchors are appended to the store. Duplicate IDs
212
- * (anchors already in the store) are silently skipped.
213
- * Capacity enforcement runs after import.
214
- */
215
- importAnchors(anchors: TruthAnchor[]): void;
216
- /**
217
- * Get the total number of anchors in the store.
218
- */
219
- get size(): number;
220
- /**
221
- * Enforce the maximum anchor capacity.
222
- *
223
- * Only expired anchors are evicted, starting from the oldest.
224
- * If no expired anchors can be evicted and the store is still
225
- * over capacity, the oldest expired anchors are removed first.
226
- * Active (non-expired) anchors are never evicted.
227
- */
228
- private enforceCapacity;
229
- }
230
- /**
231
- * Resolves conflicts between internal system beliefs and externally
232
- * anchored truth.
233
- *
234
- * The fundamental principle: truth anchors always win. If a valid,
235
- * active truth anchor contradicts an internal belief, the anchor
236
- * takes precedence.
237
- */
238
- export declare class TruthResolver {
239
- private readonly store;
240
- constructor(store: TruthAnchorStore);
241
- /**
242
- * Check if any active truth anchor contradicts a memory value.
243
- *
244
- * Searches by namespace and key as tags, and by the memory value
245
- * as a claim. If a truth anchor exists that covers the same topic,
246
- * it wins over the internal memory.
247
- */
248
- resolveMemoryConflict(memoryKey: string, memoryValue: string, namespace: string): ConflictResolution;
249
- /**
250
- * Check if any active truth anchor constrains a proposed action.
251
- *
252
- * Searches for anchors whose claims or tags relate to the proposed
253
- * action and its context. Returns a conflict resolution indicating
254
- * whether the action is constrained.
255
- */
256
- resolveDecisionConflict(proposedAction: string, context: Record<string, unknown>): ConflictResolution;
257
- /**
258
- * Get all active truth anchors relevant to a topic.
259
- *
260
- * Uses fuzzy tag matching: a tag matches the topic if either
261
- * the tag contains the topic or the topic contains the tag
262
- * (case-insensitive). Also matches against the claim text.
263
- */
264
- getGroundTruth(topic: string): TruthAnchor[];
265
- }
266
- /**
267
- * Create a TruthAnchorStore with the given configuration.
268
- *
269
- * @param config - Must include `signingKey`. `maxAnchors` defaults to 50,000.
270
- */
271
- export declare function createTruthAnchorStore(config?: Partial<TruthAnchorConfig>): TruthAnchorStore;
272
- /**
273
- * Create a TruthResolver backed by the given store.
274
- */
275
- export declare function createTruthResolver(store: TruthAnchorStore): TruthResolver;
276
- //# sourceMappingURL=truth-anchors.d.ts.map