limen-ai 2.0.1 → 4.0.0

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 (131) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +67 -3
  3. package/dist/api/a2a-governance/a2a_governance_api.d.ts +73 -0
  4. package/dist/api/a2a-governance/a2a_governance_api.d.ts.map +1 -0
  5. package/dist/api/a2a-governance/a2a_governance_api.js +195 -0
  6. package/dist/api/a2a-governance/a2a_governance_api.js.map +1 -0
  7. package/dist/api/agents/trust_progression.d.ts +20 -0
  8. package/dist/api/agents/trust_progression.d.ts.map +1 -1
  9. package/dist/api/agents/trust_progression.js +30 -0
  10. package/dist/api/agents/trust_progression.js.map +1 -1
  11. package/dist/api/cognitive/cognitive_api.d.ts +12 -1
  12. package/dist/api/cognitive/cognitive_api.d.ts.map +1 -1
  13. package/dist/api/cognitive/cognitive_api.js +64 -2
  14. package/dist/api/cognitive/cognitive_api.js.map +1 -1
  15. package/dist/api/convenience/convenience_layer.d.ts +14 -2
  16. package/dist/api/convenience/convenience_layer.d.ts.map +1 -1
  17. package/dist/api/convenience/convenience_layer.js +48 -20
  18. package/dist/api/convenience/convenience_layer.js.map +1 -1
  19. package/dist/api/convenience/convenience_types.d.ts +4 -0
  20. package/dist/api/convenience/convenience_types.d.ts.map +1 -1
  21. package/dist/api/convenience/convenience_types.js.map +1 -1
  22. package/dist/api/enforcement/rbac_guard.d.ts +1 -1
  23. package/dist/api/enforcement/rbac_guard.d.ts.map +1 -1
  24. package/dist/api/enforcement/rbac_guard.js +4 -7
  25. package/dist/api/enforcement/rbac_guard.js.map +1 -1
  26. package/dist/api/facades/claim_api_impl.d.ts +6 -1
  27. package/dist/api/facades/claim_api_impl.d.ts.map +1 -1
  28. package/dist/api/facades/claim_api_impl.js +8 -1
  29. package/dist/api/facades/claim_api_impl.js.map +1 -1
  30. package/dist/api/facades/claim_facade.d.ts +7 -0
  31. package/dist/api/facades/claim_facade.d.ts.map +1 -1
  32. package/dist/api/facades/claim_facade.js +22 -1
  33. package/dist/api/facades/claim_facade.js.map +1 -1
  34. package/dist/api/facades/working_memory_api_impl.d.ts +1 -1
  35. package/dist/api/facades/working_memory_api_impl.js +1 -1
  36. package/dist/api/gateway/permission_gateway.d.ts.map +1 -1
  37. package/dist/api/gateway/permission_gateway.js +27 -1
  38. package/dist/api/gateway/permission_gateway.js.map +1 -1
  39. package/dist/api/index.d.ts +1 -1
  40. package/dist/api/index.d.ts.map +1 -1
  41. package/dist/api/index.js +254 -5
  42. package/dist/api/index.js.map +1 -1
  43. package/dist/api/interfaces/api.d.ts +100 -2
  44. package/dist/api/interfaces/api.d.ts.map +1 -1
  45. package/dist/api/migration/037_fts5_retraction_guard.d.ts +1 -1
  46. package/dist/api/migration/037_fts5_retraction_guard.js +1 -1
  47. package/dist/api/missions/mission_api.d.ts.map +1 -1
  48. package/dist/api/missions/mission_api.js +15 -0
  49. package/dist/api/missions/mission_api.js.map +1 -1
  50. package/dist/api/output/output_api.d.ts +74 -0
  51. package/dist/api/output/output_api.d.ts.map +1 -0
  52. package/dist/api/output/output_api.js +132 -0
  53. package/dist/api/output/output_api.js.map +1 -0
  54. package/dist/api/telemetry/telemetry_api.d.ts +77 -0
  55. package/dist/api/telemetry/telemetry_api.d.ts.map +1 -0
  56. package/dist/api/telemetry/telemetry_api.js +137 -0
  57. package/dist/api/telemetry/telemetry_api.js.map +1 -0
  58. package/dist/claims/interfaces/claim_types.d.ts +30 -5
  59. package/dist/claims/interfaces/claim_types.d.ts.map +1 -1
  60. package/dist/claims/interfaces/claim_types.js +6 -2
  61. package/dist/claims/interfaces/claim_types.js.map +1 -1
  62. package/dist/claims/store/claim_stores.d.ts +10 -0
  63. package/dist/claims/store/claim_stores.d.ts.map +1 -1
  64. package/dist/claims/store/claim_stores.js +162 -7
  65. package/dist/claims/store/claim_stores.js.map +1 -1
  66. package/dist/cognitive/cognitive_types.d.ts +28 -1
  67. package/dist/cognitive/cognitive_types.d.ts.map +1 -1
  68. package/dist/cognitive/context_compiler.d.ts +92 -0
  69. package/dist/cognitive/context_compiler.d.ts.map +1 -0
  70. package/dist/cognitive/context_compiler.js +509 -0
  71. package/dist/cognitive/context_compiler.js.map +1 -0
  72. package/dist/cognitive/health.d.ts +38 -1
  73. package/dist/cognitive/health.d.ts.map +1 -1
  74. package/dist/cognitive/health.js +108 -0
  75. package/dist/cognitive/health.js.map +1 -1
  76. package/dist/cognitive/output_primitives.d.ts +131 -0
  77. package/dist/cognitive/output_primitives.d.ts.map +1 -0
  78. package/dist/cognitive/output_primitives.js +169 -0
  79. package/dist/cognitive/output_primitives.js.map +1 -0
  80. package/dist/cognitive/task_preparation.d.ts +108 -0
  81. package/dist/cognitive/task_preparation.d.ts.map +1 -0
  82. package/dist/cognitive/task_preparation.js +333 -0
  83. package/dist/cognitive/task_preparation.js.map +1 -0
  84. package/dist/cognitive/telemetry_schemas.d.ts +82 -0
  85. package/dist/cognitive/telemetry_schemas.d.ts.map +1 -0
  86. package/dist/cognitive/telemetry_schemas.js +128 -0
  87. package/dist/cognitive/telemetry_schemas.js.map +1 -0
  88. package/dist/coordination/a2a_governance.d.ts +119 -0
  89. package/dist/coordination/a2a_governance.d.ts.map +1 -0
  90. package/dist/coordination/a2a_governance.js +155 -0
  91. package/dist/coordination/a2a_governance.js.map +1 -0
  92. package/dist/coordination/index.d.ts +12 -0
  93. package/dist/coordination/index.d.ts.map +1 -0
  94. package/dist/coordination/index.js +12 -0
  95. package/dist/coordination/index.js.map +1 -0
  96. package/dist/coordination/limen_backend.d.ts +75 -0
  97. package/dist/coordination/limen_backend.d.ts.map +1 -0
  98. package/dist/coordination/limen_backend.js +239 -0
  99. package/dist/coordination/limen_backend.js.map +1 -0
  100. package/dist/kernel/crypto/key_rotation.d.ts +54 -0
  101. package/dist/kernel/crypto/key_rotation.d.ts.map +1 -0
  102. package/dist/kernel/crypto/key_rotation.js +159 -0
  103. package/dist/kernel/crypto/key_rotation.js.map +1 -0
  104. package/dist/kernel/events/event_bus.d.ts.map +1 -1
  105. package/dist/kernel/events/event_bus.js +63 -2
  106. package/dist/kernel/events/event_bus.js.map +1 -1
  107. package/dist/kernel/interfaces/common.d.ts +10 -0
  108. package/dist/kernel/interfaces/common.d.ts.map +1 -1
  109. package/dist/kernel/interfaces/events.d.ts +13 -1
  110. package/dist/kernel/interfaces/events.d.ts.map +1 -1
  111. package/dist/kernel/interfaces/index.d.ts +1 -1
  112. package/dist/kernel/interfaces/index.d.ts.map +1 -1
  113. package/dist/kernel/interfaces/index.js.map +1 -1
  114. package/dist/orchestration/index.d.ts +1 -1
  115. package/dist/orchestration/index.d.ts.map +1 -1
  116. package/dist/orchestration/index.js +2 -2
  117. package/dist/orchestration/index.js.map +1 -1
  118. package/dist/orchestration/transitions/transition_service.d.ts +2 -1
  119. package/dist/orchestration/transitions/transition_service.d.ts.map +1 -1
  120. package/dist/orchestration/transitions/transition_service.js +22 -1
  121. package/dist/orchestration/transitions/transition_service.js.map +1 -1
  122. package/dist/plugins/plugin_types.d.ts +1 -1
  123. package/dist/plugins/plugin_types.d.ts.map +1 -1
  124. package/dist/plugins/plugin_types.js +4 -0
  125. package/dist/plugins/plugin_types.js.map +1 -1
  126. package/dist/security/security_types.d.ts +12 -1
  127. package/dist/security/security_types.d.ts.map +1 -1
  128. package/dist/security/security_types.js +3 -0
  129. package/dist/security/security_types.js.map +1 -1
  130. package/examples/README.md +50 -0
  131. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,56 @@ All notable changes to Limen are documented in this file.
5
5
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.0.0] - 2026-04-29 (COGNITION)
9
+
10
+ ### Summary
11
+ Cognitive substrate release. Limen stops being a store agents query and becomes the fabric agents think with. Context compilation, dependency-aware knowledge, task-aware preparation, coordination backend, semantic output primitives, telemetry, and A2A governance.
12
+
13
+ ### Added
14
+ - **Phase 1: Vitals & Dense Output** — `cognitive.health({ maxAge })` cached health checks, `cognitive.delta({ since })` lightweight change detection, `outputMode: 'ai-dense' | 'human-readable'` token-optimized formatting
15
+ - **Phase 2: Context Compiler** — `cognitive.compile({ domain, predicates, format, maxTokens })` produces reasoning-ready compiled context from claims. Three formats: raw, structured, reasoning-ready with DECIDED/CORRECTION/OBSERVED labels. Token budget enforcement with truncation
16
+ - **Phase 3: Living Knowledge** — Dependency triggers (`reviewNeeded` flag on claims whose evidence sources are retracted). Filtered event subscriptions with predicate/subject pattern matching. `claim:dependency-invalidated` and `claim:related` events
17
+ - **Phase 4: Semantic Primitives** — 7 `output.*` predicate schemas (assertion, judgment, evidence, action, question, alert, narrative). Zod validation. `output.assert()` and `output.query()` convenience API
18
+ - **Phase 5: Task-Aware Preparation** — `cognitive.prepareForTask({ agentRole, project, taskDescription, maxTokens })` returns sections (decisions, corrections, constraints, findings) with keyword-driven predicate selection
19
+ - **Phase 6: Coordination Backend** — `createLimenBackend(limen)` adapter for Symphonic Swarm cluster mode. Session management, decision coordination, domain locking with TTL
20
+ - **Phase 7: Telemetry & A2A Governance** — 3 telemetry schemas (cost, vital, audit) with `telemetry.record()` and `telemetry.query()`. A2A governance block, capability boundary, data classification, and proactive rule schemas with full CRUD API
21
+
22
+ ### Changed
23
+ - Version bump from 3.0.0 to 4.0.0
24
+
25
+ ## [3.0.0] - 2026-04-28 (WIRE)
26
+
27
+ ### Summary
28
+ Complete wiring remediation and production readiness release. Every spec promise verified end-to-end. Every "auto" feature runs automatically. Every security feature enforces.
29
+
30
+ ### Added
31
+ - **Phase 1: Core Wiring** — Decay computation in convenience `recall()` (effectiveConfidence at query time). Automated retention scheduler (background timer, configurable interval). Replay engine integration (mission state snapshots on lifecycle transitions). Auto-connection suggestions (debounced, fires on claim assertion).
32
+ - **Phase 2: Security Enforcement** — Consent enforcement on claim assertion (fail-closed, configurable). Classification-filtered retrieval on query AND search paths (trust-level mapped clearance). Key rotation (atomic re-encryption of vault entries).
33
+ - **Phase 3: MCP Tool Completion** — 11 new MCP tools: `limen_consolidate`, `limen_importance`, `limen_narrative`, `limen_verify`, `limen_suggest_connections`, `limen_replay_verify`, `limen_governance_erasure`, `limen_governance_audit_export`, `limen_consent_register`, `limen_consent_check`, `limen_maintenance_retention`. 11 matching CLI commands. Total: 36 MCP tools.
34
+ - **Phase 4: DX/UX** — README overhaul (Node>=22 banner, ESM note, CLI section, MCP for Claude section, What's New in v3). Examples README with runner instructions.
35
+ - **Phase 5: Proof Pack** — Security model expanded from 8 to 11 mechanisms. Readiness doc refreshed for v3.0.0.
36
+ - **Phase 6: OAT** — 8 operational acceptance scenarios verifying every spec promise end-to-end.
37
+ - `limen.maintenance.runRetention()`, `getRetentionPolicies()`, `updateRetentionPolicy()` — manual retention API
38
+ - `limen.replay.verify(missionId)`, `replay.getSnapshots(missionId)` — mission determinism verification
39
+ - `limen.security.rotateKey(newMasterKey)` — atomic key rotation
40
+ - `maintenance.retentionEnabled`, `maintenance.retentionIntervalMs` config options
41
+ - `security.consent.required`, `security.consent.scope` config options
42
+ - `cognitive.autoSuggestConnections` config option
43
+
44
+ ### Fixed
45
+ - **Dispute recomputation** — `disputed` flag now correctly recomputes to `false` after contradicting claim is retracted (3 sites: queryClaims, searchClaims, vectorHydrateDisputed)
46
+ - **Classification filter bypass** — search path now filters by classification level (was query-only)
47
+ - **Consent fail-open** — consent enforcement now fail-closed when registry unavailable
48
+ - **Replay SQLITE_BUSY** — replay snapshots use orchestrationConn instead of separate connection
49
+ - **Stale worktree/stryker pollution** — cleaned phantom test failures from stale temp directories
50
+
51
+ ### Changed
52
+ - Removed all AI attribution from source code, tests, and documentation
53
+ - `vitest.config.ts` added at root to prevent phantom failures from node:test files
54
+ - Permission gateway updated with maintenance, replay, security namespace registrations
55
+
56
+ ---
57
+
8
58
  ## [2.0.0] - 2026-04-03 (THINK)
9
59
 
10
60
  ### Added
package/README.md CHANGED
@@ -16,16 +16,32 @@
16
16
 
17
17
  Cognitive infrastructure for AI agents — beliefs that decay, governance that enforces, knowledge that heals itself.
18
18
 
19
+ > **Requires Node.js >= 22.** ESM-only package (`"type": "module"`).
20
+
19
21
  ```
20
22
  npm install limen-ai
21
23
  ```
22
24
 
25
+ Run with: `npx tsx yourscript.ts`
26
+
23
27
  Optional, for semantic/vector search:
24
28
 
25
29
  ```
26
30
  npm install sqlite-vec
27
31
  ```
28
32
 
33
+ ## What's New in v3.0.0
34
+
35
+ - **Decay in recall** — `effectiveConfidence` now decays on every read (was only in search)
36
+ - **Automated retention** — background scheduler cleans expired data automatically
37
+ - **Replay verification** — mission determinism verified via state snapshots
38
+ - **Auto-connection** — relationship suggestions fire automatically on claim assertion
39
+ - **Consent enforcement** — claim assertion blocked without active consent (when configured)
40
+ - **Classification filtering** — claims filtered by clearance level at query and search time
41
+ - **Key rotation** — atomic re-encryption of all vault entries with new master key
42
+ - **11 new MCP tools** — 36 total tools, full CLI parity
43
+ - **Dispute fix** — `disputed` flag correctly recomputes after contradicting claim retracted
44
+
29
45
  ## Quick Start
30
46
 
31
47
  ```typescript
@@ -198,7 +214,11 @@ Limen applies security controls before data reaches storage.
198
214
 
199
215
  **Injection Defense.** Claim content is sanitized against prompt injection patterns. SQL injection via FTS5 queries is neutralized. Subject/predicate formats are validated against URI patterns.
200
216
 
201
- **Consent Tracking.** CRUD for data subject consent records. Consent status (active, revoked, expired) is computed on read with expiry checks. All mutations produce audit trail entries.
217
+ **Consent Enforcement.** CRUD for data subject consent records with enforcement on claim assertion. When `security.consent.required` is true, claims about entities are blocked without active consent. Consent status (active, revoked, expired) is computed on read. All mutations produce audit trail entries.
218
+
219
+ **Classification Filtering.** Claims are classified at assertion time (unrestricted, internal, confidential, restricted, critical). Query and search results are filtered by the requesting agent's clearance level, derived from trust progression (untrusted=0, probationary=1, trusted=2, admin=4).
220
+
221
+ **Key Rotation.** Atomic re-encryption of all vault entries with a new master key. Transactional — partial failure rolls back completely. Audit trail records every rotation event.
202
222
 
203
223
  **Poisoning Defense.** The `maxAutoConfidence` ceiling (default 0.7) prevents any programmatic source from laundering high-confidence claims. Only human-verified claims via `evidence_path` grounding can exceed the ceiling.
204
224
 
@@ -300,12 +320,56 @@ All fields optional. `createLimen()` with no arguments runs in zero-config mode.
300
320
  | `selfHealing.maxCascadeDepth` | `number` | `5` | Maximum cascade recursion depth |
301
321
  | `vector.provider` | `EmbeddingProvider` | `undefined` | Embedding function for semantic search |
302
322
  | `vector.dimensions` | `number` | `undefined` | Embedding vector dimensions |
303
- | `requireRbac` | `boolean` | `false` | Enforce RBAC on all operations |
323
+ | `requireRbac` | `boolean` | `false` | Enforce RBAC + classification filtering |
324
+ | `security.consent.required` | `boolean` | `false` | Enforce consent check on claim assertion |
325
+ | `maintenance.retentionEnabled` | `boolean` | `true` | Automatic retention scheduling |
326
+ | `maintenance.retentionIntervalMs` | `number` | `86400000` | Retention check interval (24h default) |
327
+ | `cognitive.autoSuggestConnections` | `boolean` | `true` | Auto-suggest connections on claim assertion |
304
328
  | `defaultTimeoutMs` | `number` | `60000` | Chat/infer timeout (ms) |
305
329
  | `rateLimiting.apiCallsPerMinute` | `number` | `100` | API rate limit |
306
330
  | `failoverPolicy` | `'degrade' \| 'allow-overdraft' \| 'block'` | `'degrade'` | Provider failure behavior |
307
331
  | `logger` | `(event) => void` | No-op | Structured logging callback |
308
332
 
333
+ ## Command Line
334
+
335
+ Limen includes a full CLI with JSON output for every operation.
336
+
337
+ ```bash
338
+ npm install -g limen-cli
339
+
340
+ limen init # initialize database
341
+ limen remember --subject entity:user:alice --predicate preference.food --value "loves Thai"
342
+ limen recall --subject entity:user:alice
343
+ limen search --query "Thai food"
344
+ limen forget --claimId <id> --reason incorrect
345
+ limen health # knowledge health report
346
+ limen consolidate # merge, archive, resolve
347
+ limen importance --claimId <id> # 5-factor importance score
348
+ limen maintenance-retention # run retention manually
349
+ ```
350
+
351
+ All 36 MCP tools have CLI equivalents. Run `limen --help` for the full list.
352
+
353
+ ## Limen for Claude (MCP)
354
+
355
+ Add to `~/.claude/mcp.json`:
356
+
357
+ ```json
358
+ {
359
+ "mcpServers": {
360
+ "limen": {
361
+ "command": "npx",
362
+ "args": ["-y", "limen-mcp"],
363
+ "env": {
364
+ "LIMEN_DATA_DIR": "/path/to/your/data"
365
+ }
366
+ }
367
+ }
368
+ }
369
+ ```
370
+
371
+ 36 tools available: `limen_remember`, `limen_recall`, `limen_search`, `limen_forget`, `limen_connect`, `limen_reflect`, `limen_consolidate`, `limen_importance`, `limen_narrative`, `limen_verify`, `limen_suggest_connections`, `limen_replay_verify`, `limen_consent_register`, `limen_consent_check`, `limen_maintenance_retention`, `limen_governance_erasure`, `limen_governance_audit_export`, and more.
372
+
309
373
  ## Architecture
310
374
 
311
375
  ```
@@ -321,7 +385,7 @@ Kernel SQLite (WAL), audit trail, RBAC, crypto, events
321
385
 
322
386
  Layers depend downward only. The kernel knows nothing about AI. The API composes everything into a single frozen `Limen` object via `Object.freeze`.
323
387
 
324
- 4,000+ tests. 134+ invariants across 3 tiers. 16 system calls. 1 production dependency (`better-sqlite3`). Every state mutation is audited in a hash-chained, append-only trail. RBAC on every operation. AES-256-GCM encryption at rest.
388
+ 4,000+ tests. 134+ invariants across 3 tiers. 16 system calls. 36 MCP tools. 1 production dependency (`better-sqlite3`). Every state mutation is audited in a hash-chained, append-only trail. RBAC on every operation. AES-256-GCM encryption at rest. Consent enforcement. Classification-filtered retrieval. Automated retention scheduling.
325
389
 
326
390
  ## Trust Surface
327
391
 
@@ -0,0 +1,73 @@
1
+ /**
2
+ * FR-002: A2A Governance API — Convenience namespace for inter-agent governance.
3
+ *
4
+ * Provides `a2aGovernance.setGovernanceBlock()`, `a2aGovernance.getGovernanceBlock()`,
5
+ * `a2aGovernance.registerProactiveRule()`, and `a2aGovernance.listProactiveRules()`
6
+ * methods that sit on the Limen API object.
7
+ *
8
+ * Architecture: This is the "store" layer in the three-file pattern.
9
+ * Governance types are defined in coordination/a2a_governance.ts (contract).
10
+ * This file implements the convenience API (implementation).
11
+ *
12
+ * Governance boundary (I-17): Only imports ClaimApi, never ClaimSystem/ClaimStore.
13
+ *
14
+ * Spec ref: v4.0.0 Phase 7 FR-002
15
+ * QAL: 3 (Governance integrity. Failure = unauthorized inter-agent actions.)
16
+ */
17
+ import type { Result } from '../../kernel/interfaces/index.js';
18
+ import type { MissionId, TaskId } from '../../kernel/interfaces/index.js';
19
+ import type { TimeProvider } from '../../kernel/interfaces/time.js';
20
+ import type { ClaimApi } from '../interfaces/api.js';
21
+ import type { TenantScopedConnection } from '../../kernel/tenant/tenant_scope.js';
22
+ import type { BeliefView } from '../convenience/convenience_types.js';
23
+ import type { GovernanceBlock } from '../../coordination/a2a_governance.js';
24
+ /**
25
+ * The a2aGovernance namespace on the Limen API object.
26
+ */
27
+ export interface A2AGovernanceApi {
28
+ /**
29
+ * Set the A2A governance block (singleton).
30
+ * Validates against the GovernanceBlock schema and stores as a claim.
31
+ * Setting a new block supersedes the previous one.
32
+ *
33
+ * @param block - The governance block object
34
+ */
35
+ setGovernanceBlock(block: object): Result<void>;
36
+ /**
37
+ * Get the current A2A governance block.
38
+ * Returns null if no governance block has been set.
39
+ */
40
+ getGovernanceBlock(): Result<GovernanceBlock | null>;
41
+ /**
42
+ * Register a proactive rule for inter-agent automation.
43
+ * Validates against the ProactiveRule schema and stores as a claim.
44
+ *
45
+ * @param rule - The proactive rule object
46
+ */
47
+ registerProactiveRule(rule: object): Result<{
48
+ claimId: string;
49
+ }>;
50
+ /**
51
+ * List proactive rules, optionally filtered by status.
52
+ *
53
+ * @param status - Filter by status ('active' | 'suspended' | 'retired'). Omit for all.
54
+ */
55
+ listProactiveRules(status?: string): Result<readonly BeliefView[]>;
56
+ }
57
+ export interface A2AGovernanceApiDeps {
58
+ readonly claims: ClaimApi;
59
+ readonly getConnection: () => TenantScopedConnection;
60
+ readonly time: TimeProvider;
61
+ readonly missionId: MissionId;
62
+ readonly taskId: TaskId | null;
63
+ readonly maxAutoConfidence: number;
64
+ }
65
+ /**
66
+ * Create the A2A governance API namespace.
67
+ *
68
+ * Returns an object with setGovernanceBlock, getGovernanceBlock,
69
+ * registerProactiveRule, and listProactiveRules methods.
70
+ * NOT frozen here — the permission gateway wraps methods before deepFreeze.
71
+ */
72
+ export declare function createA2AGovernanceApi(deps: A2AGovernanceApiDeps): A2AGovernanceApi;
73
+ //# sourceMappingURL=a2a_governance_api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a_governance_api.d.ts","sourceRoot":"","sources":["../../../src/api/a2a-governance/a2a_governance_api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAMtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AA6B5E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,kBAAkB,IAAI,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAErD;;;;;OAKG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjE;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC;CACpE;AAMD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,sBAAsB,CAAC;IACrD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAMD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,GAAG,gBAAgB,CA4KnF"}
@@ -0,0 +1,195 @@
1
+ /**
2
+ * FR-002: A2A Governance API — Convenience namespace for inter-agent governance.
3
+ *
4
+ * Provides `a2aGovernance.setGovernanceBlock()`, `a2aGovernance.getGovernanceBlock()`,
5
+ * `a2aGovernance.registerProactiveRule()`, and `a2aGovernance.listProactiveRules()`
6
+ * methods that sit on the Limen API object.
7
+ *
8
+ * Architecture: This is the "store" layer in the three-file pattern.
9
+ * Governance types are defined in coordination/a2a_governance.ts (contract).
10
+ * This file implements the convenience API (implementation).
11
+ *
12
+ * Governance boundary (I-17): Only imports ClaimApi, never ClaimSystem/ClaimStore.
13
+ *
14
+ * Spec ref: v4.0.0 Phase 7 FR-002
15
+ * QAL: 3 (Governance integrity. Failure = unauthorized inter-agent actions.)
16
+ */
17
+ import { validateGovernanceBlock, validateProactiveRule, } from '../../coordination/a2a_governance.js';
18
+ // ── Result Helpers ──
19
+ function ok(value) {
20
+ return { ok: true, value };
21
+ }
22
+ function err(code, message) {
23
+ return { ok: false, error: { code, message, spec: 'FR-002' } };
24
+ }
25
+ // ============================================================================
26
+ // Constants
27
+ // ============================================================================
28
+ /** Well-known subject URN for the singleton governance block claim. */
29
+ const GOVERNANCE_BLOCK_SUBJECT = 'entity:governance:a2a-block';
30
+ /** Predicate for governance block claims. */
31
+ const GOVERNANCE_BLOCK_PREDICATE = 'a2a.governance_block';
32
+ /** Predicate for proactive rule claims. */
33
+ const PROACTIVE_RULE_PREDICATE = 'a2a.proactive_rule';
34
+ // ============================================================================
35
+ // Factory
36
+ // ============================================================================
37
+ /**
38
+ * Create the A2A governance API namespace.
39
+ *
40
+ * Returns an object with setGovernanceBlock, getGovernanceBlock,
41
+ * registerProactiveRule, and listProactiveRules methods.
42
+ * NOT frozen here — the permission gateway wraps methods before deepFreeze.
43
+ */
44
+ export function createA2AGovernanceApi(deps) {
45
+ const { claims, time, missionId, taskId, maxAutoConfidence } = deps;
46
+ function setGovernanceBlock(block) {
47
+ // 1. Validate against schema
48
+ const validation = validateGovernanceBlock(block);
49
+ if (!validation.ok) {
50
+ return validation;
51
+ }
52
+ // 2. Serialize to JSON string for claim storage
53
+ const jsonValue = JSON.stringify(block);
54
+ // 3. Assert via ClaimApi — uses well-known subject for singleton pattern
55
+ const result = claims.assertClaim({
56
+ subject: GOVERNANCE_BLOCK_SUBJECT,
57
+ predicate: GOVERNANCE_BLOCK_PREDICATE,
58
+ object: { type: 'json', value: jsonValue },
59
+ confidence: maxAutoConfidence,
60
+ validAt: time.nowISO(),
61
+ missionId,
62
+ taskId,
63
+ groundingMode: 'runtime_witness',
64
+ evidenceRefs: [],
65
+ runtimeWitness: {
66
+ witnessType: 'governance_block_set',
67
+ witnessedValues: { action: 'set' },
68
+ witnessTimestamp: time.nowISO(),
69
+ },
70
+ });
71
+ if (!result.ok) {
72
+ return result;
73
+ }
74
+ return ok(undefined);
75
+ }
76
+ function getGovernanceBlock() {
77
+ // Query for the governance block claim by well-known subject+predicate
78
+ const result = claims.queryClaims({
79
+ subject: GOVERNANCE_BLOCK_SUBJECT,
80
+ predicate: GOVERNANCE_BLOCK_PREDICATE,
81
+ limit: 1,
82
+ status: 'active',
83
+ });
84
+ if (!result.ok) {
85
+ return result;
86
+ }
87
+ if (result.value.claims.length === 0) {
88
+ return ok(null);
89
+ }
90
+ // Parse the stored JSON back to a GovernanceBlock
91
+ const claim = result.value.claims[0];
92
+ const rawValue = typeof claim.claim.object.value === 'string'
93
+ ? claim.claim.object.value
94
+ : JSON.stringify(claim.claim.object.value);
95
+ try {
96
+ const parsed = JSON.parse(rawValue);
97
+ return ok(parsed);
98
+ }
99
+ catch {
100
+ return err('INVALID_GOVERNANCE_BLOCK', 'Stored governance block is not valid JSON');
101
+ }
102
+ }
103
+ function registerProactiveRule(rule) {
104
+ // 1. Validate against schema
105
+ const validation = validateProactiveRule(rule);
106
+ if (!validation.ok) {
107
+ return validation;
108
+ }
109
+ // 2. Serialize to JSON string for claim storage
110
+ const jsonValue = JSON.stringify(rule);
111
+ // 3. Build subject URN using the rule's id
112
+ const ruleObj = rule;
113
+ const subject = `entity:proactive-rule:${ruleObj.id}`;
114
+ // 4. Assert via ClaimApi
115
+ const result = claims.assertClaim({
116
+ subject,
117
+ predicate: PROACTIVE_RULE_PREDICATE,
118
+ object: { type: 'json', value: jsonValue },
119
+ confidence: maxAutoConfidence,
120
+ validAt: time.nowISO(),
121
+ missionId,
122
+ taskId,
123
+ groundingMode: 'runtime_witness',
124
+ evidenceRefs: [],
125
+ runtimeWitness: {
126
+ witnessType: 'proactive_rule_register',
127
+ witnessedValues: { ruleId: ruleObj.id },
128
+ witnessTimestamp: time.nowISO(),
129
+ },
130
+ });
131
+ if (!result.ok) {
132
+ return result;
133
+ }
134
+ return ok({ claimId: result.value.claim.id });
135
+ }
136
+ function listProactiveRules(status) {
137
+ // Validate status if provided
138
+ const validStatuses = ['active', 'suspended', 'retired'];
139
+ if (status !== undefined && !validStatuses.includes(status)) {
140
+ return err('INVALID_PROACTIVE_RULE', `Invalid status: "${status}". Valid values: ${validStatuses.join(', ')}`);
141
+ }
142
+ // Query claims via ClaimApi
143
+ const result = claims.queryClaims({
144
+ predicate: PROACTIVE_RULE_PREDICATE,
145
+ subject: null,
146
+ limit: 100,
147
+ status: 'active',
148
+ });
149
+ if (!result.ok) {
150
+ return result;
151
+ }
152
+ // Transform to BeliefView
153
+ let beliefs = result.value.claims.map(item => ({
154
+ claimId: item.claim.id,
155
+ subject: item.claim.subject,
156
+ predicate: item.claim.predicate,
157
+ value: typeof item.claim.object.value === 'string'
158
+ ? item.claim.object.value
159
+ : JSON.stringify(item.claim.object.value),
160
+ confidence: item.claim.confidence,
161
+ validAt: item.claim.validAt,
162
+ createdAt: item.claim.createdAt,
163
+ effectiveConfidence: item.effectiveConfidence,
164
+ freshness: item.freshness,
165
+ stability: item.claim.stability,
166
+ lastAccessedAt: item.claim.lastAccessedAt,
167
+ accessCount: item.claim.accessCount,
168
+ reasoning: item.claim.reasoning,
169
+ superseded: item.superseded,
170
+ disputed: item.disputed,
171
+ reviewNeeded: item.reviewNeeded,
172
+ }));
173
+ // Filter by rule status if provided
174
+ if (status !== undefined) {
175
+ beliefs = beliefs.filter(b => {
176
+ try {
177
+ const parsed = JSON.parse(b.value);
178
+ return parsed.status === status;
179
+ }
180
+ catch {
181
+ return false;
182
+ }
183
+ });
184
+ }
185
+ return ok(beliefs);
186
+ }
187
+ // NOT frozen here — permission gateway wraps methods before deepFreeze.
188
+ return {
189
+ setGovernanceBlock,
190
+ getGovernanceBlock,
191
+ registerProactiveRule,
192
+ listProactiveRules,
193
+ };
194
+ }
195
+ //# sourceMappingURL=a2a_governance_api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a_governance_api.js","sourceRoot":"","sources":["../../../src/api/a2a-governance/a2a_governance_api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAG9C,uBAAuB;AAEvB,SAAS,EAAE,CAAI,KAAQ;IACrB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,GAAG,CAAI,IAAY,EAAE,OAAe;IAC3C,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,K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KAAK,CAAC,WAAW;YACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;YAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAC,CAAC;QAEJ,oCAAoC;QACpC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;gBAC3B,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAwB,CAAC;oBAC1D,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;gBAClC,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC,OAAgC,CAAC,CAAC;IAC9C,CAAC;IAED,wEAAwE;IACxE,OAAO;QACL,kBAAkB;QAClB,kBAAkB;QAClB,qBAAqB;QACrB,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
@@ -75,4 +75,24 @@ export type ViolationSeverity = 'low' | 'medium' | 'high' | 'critical';
75
75
  * any on untrusted → null (already at lowest)
76
76
  */
77
77
  export declare function getDemotionTarget(currentLevel: TrustLevel, severity: ViolationSeverity): TrustLevel | null;
78
+ /**
79
+ * Map trust levels to classification clearance levels.
80
+ * Clearance values align with CLASSIFICATION_LEVEL_ORDER in governance_types.ts:
81
+ * unrestricted=0, internal=1, confidential=2, restricted=3, critical=4
82
+ *
83
+ * untrusted -> 0 (unrestricted only)
84
+ * probationary -> 1 (internal and below)
85
+ * trusted -> 2 (confidential and below)
86
+ * admin -> 4 (all levels including critical)
87
+ *
88
+ * This mapping enforces principle of least privilege:
89
+ * agents must earn trust before accessing sensitive data.
90
+ */
91
+ export declare const TRUST_TO_CLEARANCE: Readonly<Record<TrustLevel, number>>;
92
+ /**
93
+ * Get the clearance level for a given trust level.
94
+ * Returns the maximum classification level the agent can access.
95
+ * Returns 4 (all) for undefined/null trust (backward compat single-user mode).
96
+ */
97
+ export declare function getClearanceForTrust(trustLevel: TrustLevel | null | undefined): number;
78
98
  //# sourceMappingURL=trust_progression.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trust_progression.d.ts","sourceRoot":"","sources":["../../../src/api/agents/trust_progression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAIhE,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAgB5E;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,UAAU,EACvB,SAAS,EAAE,QAAQ,GAAG,OAAO,GAC5B;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA4BpD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACtC,aAAa,EAAE,OAAO,GAAG,MAAM,GAC9B;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQxD;AAID;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,UA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E,MAAM,CAAC,CAKnE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGtF"}
@@ -121,4 +121,34 @@ export function getDemotionTarget(currentLevel, severity) {
121
121
  };
122
122
  return demotionMap[currentLevel];
123
123
  }
124
+ // ─── v3.0.0 EG-03: Trust-to-Clearance Mapping ───
125
+ /**
126
+ * Map trust levels to classification clearance levels.
127
+ * Clearance values align with CLASSIFICATION_LEVEL_ORDER in governance_types.ts:
128
+ * unrestricted=0, internal=1, confidential=2, restricted=3, critical=4
129
+ *
130
+ * untrusted -> 0 (unrestricted only)
131
+ * probationary -> 1 (internal and below)
132
+ * trusted -> 2 (confidential and below)
133
+ * admin -> 4 (all levels including critical)
134
+ *
135
+ * This mapping enforces principle of least privilege:
136
+ * agents must earn trust before accessing sensitive data.
137
+ */
138
+ export const TRUST_TO_CLEARANCE = {
139
+ untrusted: 0,
140
+ probationary: 1,
141
+ trusted: 2,
142
+ admin: 4,
143
+ };
144
+ /**
145
+ * Get the clearance level for a given trust level.
146
+ * Returns the maximum classification level the agent can access.
147
+ * Returns 4 (all) for undefined/null trust (backward compat single-user mode).
148
+ */
149
+ export function getClearanceForTrust(trustLevel) {
150
+ if (trustLevel === null || trustLevel === undefined)
151
+ return 4; // full access
152
+ return TRUST_TO_CLEARANCE[trustLevel] ?? 4;
153
+ }
124
154
  //# sourceMappingURL=trust_progression.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trust_progression.js","sourceRoot":"","sources":["../../../src/api/agents/trust_progression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,wCAAwC;AAExC;;;;GAIG;AACH,MAAM,UAAU,GAA0C;IACxD,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI,EAAE,sCAAsC;CACpD,CAAC;A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AC;AASD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAwB,EACxB,QAA2B;IAE3B,iDAAiD;IACjD,IAAI,YAAY,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wEAAwE;IACxE,IAAI,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACnD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,sCAAsC;IACtC,MAAM,WAAW,GAAyD;QACxE,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,cAAc;QACvB,YAAY,EAAE,WAAW;KAC1B,CAAC;IAEF,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC;AACnC,CAAC"}
1
+ {"version":3,"file":"trust_progression.js","sourceRoot":"","sources":["../../../src/api/agents/trust_progression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,wCAAwC;AAExC;;;;GAIG;AACH,MAAM,UAAU,GAA0C;IACxD,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI,EAAE,sCAAsC;CACpD,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAmB;IACnD,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAqB,EACrB,WAAuB,EACvB,SAA6B;IAE7B,gCAAgC;IAChC,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,SAAS,IAAI,EAAE,CAAC;IAC5E,CAAC;IAED,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;Q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;AAED,mDAAmD;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAyC;IACtE,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAyC;IAC5E,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,CAAC,cAAc;IAC7E,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC"}
@@ -27,14 +27,21 @@ import type { RetractClaimHandler, RelateClaimsHandler } from '../../claims/inte
27
27
  import type { VectorStore } from '../../vector/vector_store.js';
28
28
  import type { EmbeddingProvider } from '../../vector/vector_types.js';
29
29
  import type { ConsolidationOptions, ConsolidationResult, ImportanceScore, ImportanceWeights, NarrativeSnapshot, VerificationResult, VerificationProvider, ConnectionSuggestion, SelfHealingConfig } from '../../cognitive/cognitive_types.js';
30
+ import type { CompileOptions, CompiledContext } from '../../cognitive/context_compiler.js';
31
+ import type { PrepareForTaskOptions, PreparedContext } from '../../cognitive/task_preparation.js';
30
32
  import { type CognitiveHealthReport, type CognitiveHealthConfig } from '../../cognitive/health.js';
33
+ import type { DeltaOptions, DeltaResult } from '../../cognitive/cognitive_types.js';
31
34
  /**
32
35
  * Phase 5 + Phase 12: Cognitive API namespace interface.
33
36
  * Exposed as `limen.cognitive` on the Limen public API.
34
37
  */
35
38
  export interface CognitiveNamespace {
36
- /** Phase 5 §5.3: Compute cognitive health report. Synchronous. */
39
+ /** Phase 5 §5.3 + FR-003: Compute cognitive health report. Synchronous. Supports maxAge caching. */
37
40
  health(config?: CognitiveHealthConfig): Result<CognitiveHealthReport>;
41
+ /** FR-003: Query claim changes since a timestamp. */
42
+ delta(options: DeltaOptions): Result<DeltaResult>;
43
+ /** FR-003: Invalidate cached health result. Called internally on mutations. */
44
+ invalidateHealthCache(): void;
38
45
  /** Phase 12 §12.6: Run consolidation (merge + archive + suggest resolution). */
39
46
  consolidate(options?: ConsolidationOptions): Result<ConsolidationResult>;
40
47
  /** Phase 12 §12.7: Verify a claim via external provider. ONLY async method. */
@@ -49,6 +56,10 @@ export interface CognitiveNamespace {
49
56
  acceptSuggestion(suggestionId: string): Result<void>;
50
57
  /** Phase 12: Reject a pending connection suggestion. */
51
58
  rejectSuggestion(suggestionId: string): Result<void>;
59
+ /** FR-006: Compile claims from a domain into reasoning-ready context. */
60
+ compile(options: CompileOptions): Result<CompiledContext>;
61
+ /** FR-008: Prepare task-aware context for an agent based on role and task description. */
62
+ prepareForTask(options: PrepareForTaskOptions): Result<PreparedContext>;
52
63
  }
53
64
  /**
54
65
  * Dependencies for creating the CognitiveNamespace.
@@ -1 +1 @@
1
- {"version":3,"file":"cognitive_api.d.ts","sourceRoot":"","sources":["../../../src/api/cognitive/cognitive_api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAa,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAW,MAAM,wCAAwC,CAAC;AAChH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8B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