@haaaiawd/second-nature 0.1.26 → 0.1.29
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/SKILL.md +35 -0
- package/agent-inner-guide.md +144 -0
- package/index.js +280 -2
- package/openclaw.plugin.json +2 -2
- package/package.json +4 -1
- package/runtime/cli/commands/connector-behavior.d.ts +20 -0
- package/runtime/cli/commands/connector-behavior.js +160 -0
- package/runtime/cli/commands/index.js +8 -0
- package/runtime/cli/index.js +9 -2
- package/runtime/cli/ops/manual-run-dispatcher.d.ts +79 -0
- package/runtime/cli/ops/manual-run-dispatcher.js +110 -0
- package/runtime/cli/ops/ops-router.d.ts +45 -4
- package/runtime/cli/ops/ops-router.js +543 -2
- package/runtime/cli/read-models/index.js +35 -18
- package/runtime/cli/read-models/types.d.ts +1 -0
- package/runtime/connectors/agent-network/agent-world/adapter.d.ts +1 -0
- package/runtime/connectors/agent-network/agent-world/adapter.js +2 -2
- package/runtime/connectors/base/contract.d.ts +4 -1
- package/runtime/connectors/base/contract.js +5 -1
- package/runtime/connectors/base/effect-commit-ledger-sqlite.d.ts +31 -0
- package/runtime/connectors/base/effect-commit-ledger-sqlite.js +86 -0
- package/runtime/connectors/base/failure-taxonomy.js +5 -0
- package/runtime/connectors/base/manifest-v7.d.ts +151 -0
- package/runtime/connectors/base/manifest-v7.js +170 -0
- package/runtime/connectors/base/manifest.d.ts +3 -13
- package/runtime/connectors/base/manifest.js +7 -7
- package/runtime/connectors/base/route-planner.js +11 -8
- package/runtime/connectors/base/structured-unavailable-reason.d.ts +59 -0
- package/runtime/connectors/base/structured-unavailable-reason.js +113 -0
- package/runtime/connectors/base/wet-probe-runner.d.ts +40 -0
- package/runtime/connectors/base/wet-probe-runner.js +132 -0
- package/runtime/connectors/manifest/manifest-schema.d.ts +4 -0
- package/runtime/connectors/manifest/manifest-schema.js +2 -0
- package/runtime/connectors/services/connector-executor-adapter.d.ts +1 -0
- package/runtime/connectors/services/connector-executor-adapter.js +132 -26
- package/runtime/core/second-nature/body/behavior-promotion/behavior-promotion-loop.d.ts +45 -0
- package/runtime/core/second-nature/body/behavior-promotion/behavior-promotion-loop.js +132 -0
- package/runtime/core/second-nature/body/circuit-breaker/circuit-breaker-manager.d.ts +60 -0
- package/runtime/core/second-nature/body/circuit-breaker/circuit-breaker-manager.js +174 -0
- package/runtime/core/second-nature/body/probe-signal-adapter.d.ts +38 -0
- package/runtime/core/second-nature/body/probe-signal-adapter.js +60 -0
- package/runtime/core/second-nature/body/tool-affordance/affordance-assembler.d.ts +51 -0
- package/runtime/core/second-nature/body/tool-affordance/affordance-assembler.js +129 -0
- package/runtime/core/second-nature/body/tool-affordance/affordance-context-scope.d.ts +30 -0
- package/runtime/core/second-nature/body/tool-affordance/affordance-context-scope.js +92 -0
- package/runtime/core/second-nature/body/tool-experience/experience-writer.d.ts +34 -0
- package/runtime/core/second-nature/body/tool-experience/experience-writer.js +67 -0
- package/runtime/core/second-nature/body/tool-experience/pain-signal-query.d.ts +37 -0
- package/runtime/core/second-nature/body/tool-experience/pain-signal-query.js +62 -0
- package/runtime/core/second-nature/heartbeat/decision-trace-emitter.d.ts +29 -0
- package/runtime/core/second-nature/heartbeat/decision-trace-emitter.js +28 -0
- package/runtime/core/second-nature/heartbeat/embodied-context-assembler.d.ts +54 -0
- package/runtime/core/second-nature/heartbeat/embodied-context-assembler.js +164 -0
- package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +37 -0
- package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.js +61 -0
- package/runtime/core/second-nature/heartbeat/idle-curiosity-policy.d.ts +37 -0
- package/runtime/core/second-nature/heartbeat/idle-curiosity-policy.js +60 -0
- package/runtime/core/second-nature/heartbeat/index.d.ts +4 -0
- package/runtime/core/second-nature/heartbeat/index.js +5 -0
- package/runtime/core/second-nature/heartbeat/run-heartbeat-cycle-v7.d.ts +63 -0
- package/runtime/core/second-nature/heartbeat/run-heartbeat-cycle-v7.js +118 -0
- package/runtime/core/second-nature/orchestrator/downstream-intent-orchestrator.d.ts +41 -0
- package/runtime/core/second-nature/orchestrator/downstream-intent-orchestrator.js +43 -0
- package/runtime/core/second-nature/orchestrator/effect-dispatcher.d.ts +2 -1
- package/runtime/core/second-nature/orchestrator/effect-dispatcher.js +2 -0
- package/runtime/core/second-nature/orchestrator/hard-guard-evaluator.d.ts +31 -0
- package/runtime/core/second-nature/orchestrator/hard-guard-evaluator.js +102 -0
- package/runtime/core/second-nature/orchestrator/index.d.ts +5 -0
- package/runtime/core/second-nature/orchestrator/index.js +7 -0
- package/runtime/core/second-nature/quiet/claim-synthesizer.d.ts +53 -0
- package/runtime/core/second-nature/quiet/claim-synthesizer.js +153 -0
- package/runtime/core/second-nature/quiet/daily-diary-writer.d.ts +29 -0
- package/runtime/core/second-nature/quiet/daily-diary-writer.js +92 -0
- package/runtime/core/second-nature/quiet/index.d.ts +5 -0
- package/runtime/core/second-nature/quiet/index.js +5 -0
- package/runtime/core/second-nature/quiet/run-source-backed-quiet.js +19 -12
- package/runtime/core/second-nature/types.d.ts +2 -0
- package/runtime/guidance/channel-feedback-ingestion-service.d.ts +88 -0
- package/runtime/guidance/channel-feedback-ingestion-service.js +231 -0
- package/runtime/guidance/guidance-draft-service.d.ts +60 -0
- package/runtime/guidance/guidance-draft-service.js +80 -0
- package/runtime/guidance/index.d.ts +3 -0
- package/runtime/guidance/index.js +3 -0
- package/runtime/guidance/outreach-draft-schema.d.ts +8 -8
- package/runtime/guidance/outreach-strategy-selector.d.ts +77 -0
- package/runtime/guidance/outreach-strategy-selector.js +211 -0
- package/runtime/observability/audit/append-only-audit-store.d.ts +20 -2
- package/runtime/observability/audit/append-only-audit-store.js +32 -6
- package/runtime/observability/audit/audit-envelope.d.ts +2 -1
- package/runtime/observability/audit/audit-envelope.js +8 -7
- package/runtime/observability/audit/audit-family-registry.json +66 -0
- package/runtime/observability/audit/family-registry.d.ts +43 -0
- package/runtime/observability/audit/family-registry.js +70 -0
- package/runtime/observability/index.d.ts +6 -1
- package/runtime/observability/index.js +6 -1
- package/runtime/observability/redaction/policy.d.ts +24 -3
- package/runtime/observability/redaction/policy.js +74 -0
- package/runtime/observability/services/heartbeat-digest-assembler.d.ts +152 -0
- package/runtime/observability/services/heartbeat-digest-assembler.js +248 -0
- package/runtime/observability/services/lived-experience-audit.js +6 -6
- package/runtime/observability/services/narrative-timeline-query-service.d.ts +136 -0
- package/runtime/observability/services/narrative-timeline-query-service.js +169 -0
- package/runtime/observability/services/restore-audit-service.d.ts +74 -0
- package/runtime/observability/services/restore-audit-service.js +79 -0
- package/runtime/observability/services/runtime-secret-anchor-view.d.ts +77 -0
- package/runtime/observability/services/runtime-secret-anchor-view.js +168 -0
- package/runtime/observability/services/self-health-snapshot.d.ts +92 -0
- package/runtime/observability/services/self-health-snapshot.js +251 -0
- package/runtime/shared/types/goal.d.ts +62 -0
- package/runtime/shared/types/goal.js +20 -0
- package/runtime/shared/types/index.d.ts +3 -0
- package/runtime/shared/types/index.js +3 -0
- package/runtime/shared/types/source-ref.d.ts +14 -0
- package/runtime/shared/types/source-ref.js +1 -0
- package/runtime/shared/types/v7-entities.d.ts +206 -0
- package/runtime/shared/types/v7-entities.js +27 -0
- package/runtime/storage/db/index.js +3 -0
- package/runtime/storage/db/migration-runner.d.ts +30 -0
- package/runtime/storage/db/migration-runner.js +93 -0
- package/runtime/storage/db/migrations/index.d.ts +5 -0
- package/runtime/storage/db/migrations/index.js +13 -0
- package/runtime/storage/db/migrations/v7-001-foundation.d.ts +13 -0
- package/runtime/storage/db/migrations/v7-001-foundation.js +144 -0
- package/runtime/storage/db/migrations/v7-002-effect-commit-ledger.d.ts +8 -0
- package/runtime/storage/db/migrations/v7-002-effect-commit-ledger.js +27 -0
- package/runtime/storage/db/migrations/v7-003-circuit-breaker.d.ts +7 -0
- package/runtime/storage/db/migrations/v7-003-circuit-breaker.js +26 -0
- package/runtime/storage/db/migrations/v7-004-behavior-promotion.d.ts +7 -0
- package/runtime/storage/db/migrations/v7-004-behavior-promotion.js +26 -0
- package/runtime/storage/db/schema/agent-goal.d.ts +38 -0
- package/runtime/storage/db/schema/agent-goal.js +2 -0
- package/runtime/storage/db/transaction-utils.d.ts +14 -0
- package/runtime/storage/db/transaction-utils.js +29 -0
- package/runtime/storage/db/write-queue.d.ts +38 -0
- package/runtime/storage/db/write-queue.js +97 -0
- package/runtime/storage/quiet/persist-quiet-artifact.js +2 -1
- package/runtime/storage/services/credential-vault.js +31 -17
- package/runtime/storage/services/diary-dream-store.d.ts +35 -0
- package/runtime/storage/services/diary-dream-store.js +165 -0
- package/runtime/storage/services/embodied-context-state-port.d.ts +77 -0
- package/runtime/storage/services/embodied-context-state-port.js +115 -0
- package/runtime/storage/services/goal-lifecycle-store.d.ts +42 -0
- package/runtime/storage/services/goal-lifecycle-store.js +181 -0
- package/runtime/storage/services/history-digest-store.d.ts +33 -0
- package/runtime/storage/services/history-digest-store.js +140 -0
- package/runtime/storage/services/identity-profile-store.d.ts +25 -0
- package/runtime/storage/services/identity-profile-store.js +81 -0
- package/runtime/storage/services/interaction-snapshot-projector.d.ts +15 -0
- package/runtime/storage/services/interaction-snapshot-projector.js +35 -0
- package/runtime/storage/services/restore-snapshot-store.d.ts +52 -0
- package/runtime/storage/services/restore-snapshot-store.js +193 -0
- package/runtime/storage/services/runtime-secret-anchor-store.d.ts +26 -0
- package/runtime/storage/services/runtime-secret-anchor-store.js +82 -0
- package/runtime/storage/services/tool-experience-store.d.ts +25 -0
- package/runtime/storage/services/tool-experience-store.js +116 -0
- package/runtime/storage/services/write-validation-gate.d.ts +46 -0
- package/runtime/storage/services/write-validation-gate.js +200 -0
- package/workspace-ops-bridge.js +16 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WriteValidationGate — T-SMS.C.1
|
|
3
|
+
*
|
|
4
|
+
* Core logic: All write paths MUST pass through this gate before persisting.
|
|
5
|
+
* Rejects payloads containing sensitive fields, missing source refs on fact
|
|
6
|
+
* claims, or failing schema/sensitivity scans. Returns structured machine-
|
|
7
|
+
* readable reason codes (DR-022).
|
|
8
|
+
*
|
|
9
|
+
* Dependencies:
|
|
10
|
+
* - `SourceRef` type from `../../shared/types/source-ref.js`
|
|
11
|
+
* - v7 entity types for shape awareness
|
|
12
|
+
*
|
|
13
|
+
* Boundary:
|
|
14
|
+
* - This gate is stateless; it inspects payloads but never writes.
|
|
15
|
+
* - Callers must handle rejection before any DB/artifact write.
|
|
16
|
+
* - Does NOT redact — redaction is the caller's responsibility after gate
|
|
17
|
+
* approval.
|
|
18
|
+
*
|
|
19
|
+
* Test coverage: tests/unit/storage/write-validation-gate.test.ts
|
|
20
|
+
*/
|
|
21
|
+
const SENSITIVE_FIELD_PATTERNS = [
|
|
22
|
+
// Order: most specific first to avoid substring shadowing
|
|
23
|
+
{
|
|
24
|
+
field: "raw_private_content",
|
|
25
|
+
reason: "write_validation_failed:raw_private_content_detected",
|
|
26
|
+
pattern: /\braw_private_content\b/i,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
field: "raw_prompt",
|
|
30
|
+
reason: "write_validation_failed:raw_prompt_detected",
|
|
31
|
+
pattern: /\braw_prompt\b/i,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
field: "encryption_key",
|
|
35
|
+
reason: "write_validation_failed:encryption_key_detected",
|
|
36
|
+
pattern: /\bencryption_key\b/i,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
field: "session_token",
|
|
40
|
+
reason: "write_validation_failed:session_token_detected",
|
|
41
|
+
pattern: /\bsession_token\b/i,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
field: "credential",
|
|
45
|
+
reason: "write_validation_failed:credential_detected",
|
|
46
|
+
pattern: /\bcredential\b/i,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
field: "token",
|
|
50
|
+
reason: "write_validation_failed:token_detected",
|
|
51
|
+
pattern: /token/i,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* Detect if a plain object value contains a key that looks like a
|
|
56
|
+
* credential or secret field name.
|
|
57
|
+
*/
|
|
58
|
+
function detectSensitiveFieldKey(obj) {
|
|
59
|
+
if (obj === null || typeof obj !== "object")
|
|
60
|
+
return undefined;
|
|
61
|
+
const keys = Object.keys(obj);
|
|
62
|
+
for (const key of keys) {
|
|
63
|
+
const lower = key.toLowerCase();
|
|
64
|
+
for (const s of SENSITIVE_FIELD_PATTERNS) {
|
|
65
|
+
if (s.pattern.test(lower)) {
|
|
66
|
+
return s.reason;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Recursively scan a value for sensitive field keys at any depth.
|
|
74
|
+
*/
|
|
75
|
+
function deepScanSensitiveFields(value) {
|
|
76
|
+
const result = detectSensitiveFieldKey(value);
|
|
77
|
+
if (result)
|
|
78
|
+
return result;
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
for (const item of value) {
|
|
81
|
+
const r = deepScanSensitiveFields(item);
|
|
82
|
+
if (r)
|
|
83
|
+
return r;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (value !== null && typeof value === "object") {
|
|
87
|
+
for (const v of Object.values(value)) {
|
|
88
|
+
const r = deepScanSensitiveFields(v);
|
|
89
|
+
if (r)
|
|
90
|
+
return r;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Validate that sourceRefs is a non-empty tuple.
|
|
97
|
+
*/
|
|
98
|
+
function validateSourceRefs(sourceRefs) {
|
|
99
|
+
if (!Array.isArray(sourceRefs)) {
|
|
100
|
+
return "write_validation_failed:source_refs_missing";
|
|
101
|
+
}
|
|
102
|
+
if (sourceRefs.length === 0) {
|
|
103
|
+
return "write_validation_failed:source_refs_empty";
|
|
104
|
+
}
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Lightweight sensitivity scan: rejects obvious PII or secret patterns
|
|
109
|
+
* in string values.
|
|
110
|
+
*/
|
|
111
|
+
function sensitivityScan(value) {
|
|
112
|
+
if (typeof value === "string") {
|
|
113
|
+
// Basic secret pattern heuristics
|
|
114
|
+
const secretPatterns = [
|
|
115
|
+
/\b[A-Za-z0-9_\-]{32,}\b/, // potential API keys / tokens
|
|
116
|
+
/\b-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----/,
|
|
117
|
+
/\bpassword\s*[:=]\s*\S+/i,
|
|
118
|
+
/\bapi[_\-]?key\s*[:=]\s*\S+/i,
|
|
119
|
+
/\bsecret\s*[:=]\s*\S+/i,
|
|
120
|
+
];
|
|
121
|
+
for (const p of secretPatterns) {
|
|
122
|
+
if (p.test(value)) {
|
|
123
|
+
return "write_validation_failed:sensitivity_scan_failed";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (Array.isArray(value)) {
|
|
128
|
+
for (const item of value) {
|
|
129
|
+
const r = sensitivityScan(item);
|
|
130
|
+
if (r)
|
|
131
|
+
return r;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (value !== null && typeof value === "object") {
|
|
135
|
+
for (const v of Object.values(value)) {
|
|
136
|
+
const r = sensitivityScan(v);
|
|
137
|
+
if (r)
|
|
138
|
+
return r;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Validate a write payload before persistence.
|
|
145
|
+
*
|
|
146
|
+
* @param payload — the object about to be written
|
|
147
|
+
* @param options — gate behavior tuning
|
|
148
|
+
* @returns WriteValidationResult: ok=true to proceed, ok=false with reason
|
|
149
|
+
*/
|
|
150
|
+
export function validateWritePayload(payload, options = {}) {
|
|
151
|
+
const requireSourceRefs = options.requireSourceRefs ?? true;
|
|
152
|
+
const runSensitivityScan = options.runSensitivityScan ?? true;
|
|
153
|
+
const scanFieldKeys = options.scanFieldKeys ?? true;
|
|
154
|
+
// 1. Schema-level: payload must be a non-null object
|
|
155
|
+
if (payload === null || typeof payload !== "object") {
|
|
156
|
+
return {
|
|
157
|
+
ok: false,
|
|
158
|
+
reason: "write_validation_failed:schema_validation_failed",
|
|
159
|
+
details: "Payload must be a non-null object",
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const obj = payload;
|
|
163
|
+
// 2. Sensitive field key detection (DR-022 category 1)
|
|
164
|
+
if (scanFieldKeys) {
|
|
165
|
+
const fieldReason = deepScanSensitiveFields(obj);
|
|
166
|
+
if (fieldReason) {
|
|
167
|
+
return { ok: false, reason: fieldReason };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// 3. Source refs non-empty for fact-claim-like payloads (DR-022 category 2)
|
|
171
|
+
if (requireSourceRefs) {
|
|
172
|
+
const hasFactClaimShape = "sourceRefs" in obj ||
|
|
173
|
+
("kind" in obj && (obj.kind === "fact" || obj.kind === "observation" || obj.kind === "pattern"));
|
|
174
|
+
if (hasFactClaimShape) {
|
|
175
|
+
const sourceRefReason = validateSourceRefs(obj.sourceRefs);
|
|
176
|
+
if (sourceRefReason) {
|
|
177
|
+
return { ok: false, reason: sourceRefReason };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// 4. Sensitivity scan on string values (DR-022 category 3)
|
|
182
|
+
if (runSensitivityScan) {
|
|
183
|
+
const scanReason = sensitivityScan(obj);
|
|
184
|
+
if (scanReason) {
|
|
185
|
+
return { ok: false, reason: scanReason };
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return { ok: true };
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Convenience: assert that payload passes gate, else throw.
|
|
192
|
+
*/
|
|
193
|
+
export function assertWritePayload(payload, options) {
|
|
194
|
+
const result = validateWritePayload(payload, options);
|
|
195
|
+
if (!result.ok) {
|
|
196
|
+
throw new Error(result.details
|
|
197
|
+
? `${result.reason}: ${result.details}`
|
|
198
|
+
: (result.reason ?? "write_validation_failed:unknown"));
|
|
199
|
+
}
|
|
200
|
+
}
|
package/workspace-ops-bridge.js
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* `createCliRuntimeDeps` + `createOpsRouter` + `createCliCommands` path as the workspace CLI.
|
|
6
6
|
* `process.chdir(workspaceRoot)` during dispatch so `memory/workspace` paths match CLI cwd semantics.
|
|
7
7
|
*
|
|
8
|
+
* v7 additions (T-ROS.C.2): pass auditStore (AppendOnlyAuditStore) to createOpsRouter so that
|
|
9
|
+
* heartbeat_digest, restore, and other v7 commands work through the bridge. The store is created
|
|
10
|
+
* fresh per-bridge-open (in-memory; not persisted across restarts). secretAnchorDeps are not wired
|
|
11
|
+
* here yet — runtime_secret_bootstrap will degrade gracefully until T-ROS.C.4 wires the real port.
|
|
12
|
+
*
|
|
8
13
|
* Boundaries: no static imports from `./runtime/*` (sql.js top-level await stays out of register() graph).
|
|
9
14
|
* VM safety: do not read `import.meta.url` at module scope — some OpenClaw loaders evaluate this file in contexts
|
|
10
15
|
* where top-level `import.meta` breaks before `register()` runs; compute package root only inside `openWorkspaceOpsBridge`.
|
|
@@ -30,13 +35,20 @@ export async function openWorkspaceOpsBridge(workspaceRoot) {
|
|
|
30
35
|
const storageDb = (await import("./runtime/storage/db/index.js"));
|
|
31
36
|
const obsDb = (await import("./runtime/observability/db/index.js"));
|
|
32
37
|
const boundary = (await import("./runtime/cli/runtime/runtime-artifact-boundary.js"));
|
|
38
|
+
// v7 (T-ROS.C.2): in-memory audit store for v7 ops surface (heartbeat_digest, restore, etc.)
|
|
39
|
+
const auditMod = (await import("./runtime/observability/audit/append-only-audit-store.js"));
|
|
40
|
+
const auditStore = new auditMod.AppendOnlyAuditStore();
|
|
33
41
|
const dataDir = path.join(resolvedRoot, "data");
|
|
34
42
|
fs.mkdirSync(dataDir, { recursive: true });
|
|
35
43
|
const statePath = path.join(dataDir, "state.db");
|
|
36
44
|
const obsPath = path.join(dataDir, "observability.db");
|
|
37
45
|
const stateDb = storageDb.createStateDatabase(statePath);
|
|
38
46
|
const observabilityDb = obsDb.createObservabilityDatabase(obsPath);
|
|
39
|
-
const deps = cliIndex.createCliRuntimeDeps({
|
|
47
|
+
const deps = cliIndex.createCliRuntimeDeps({
|
|
48
|
+
stateDb,
|
|
49
|
+
observabilityDb,
|
|
50
|
+
workspaceRoot: resolvedRoot,
|
|
51
|
+
});
|
|
40
52
|
const runtimeResolved = boundary.resolvePackagedRuntime(pluginPackageRoot);
|
|
41
53
|
const opsRouter = cliIndex.createOpsRouter({
|
|
42
54
|
runtimeAvailable: runtimeResolved.ok,
|
|
@@ -48,6 +60,9 @@ export async function openWorkspaceOpsBridge(workspaceRoot) {
|
|
|
48
60
|
workspaceRoot: resolvedRoot,
|
|
49
61
|
connectorExecutor: deps.connectorExecutor,
|
|
50
62
|
registry: deps.registry,
|
|
63
|
+
// v7 (T-ROS.C.2): in-memory audit store for heartbeat_digest / restore / self_health
|
|
64
|
+
auditStore,
|
|
65
|
+
restoreSnapshotStore: deps.restoreSnapshotStore,
|
|
51
66
|
});
|
|
52
67
|
const commands = commandsMod.createCliCommands({
|
|
53
68
|
readModels: deps.readModels,
|