wyrm-mcp 7.3.2 → 7.3.3
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/README.md +8 -14
- package/dist/activation.js +59 -1
- package/dist/agent-daemon.js +281 -4
- package/dist/agent-loop.js +332 -7
- package/dist/analytics.js +236 -13
- package/dist/attribution.js +49 -1
- package/dist/audit.js +457 -2
- package/dist/auto-capture.js +138 -3
- package/dist/auto-orchestrator.js +325 -1
- package/dist/autoconfig.d.ts +50 -0
- package/dist/autoconfig.d.ts.map +1 -1
- package/dist/autoconfig.js +1115 -39
- package/dist/autoconfig.js.map +1 -1
- package/dist/buddy-runner.js +109 -1
- package/dist/buddy.js +564 -14
- package/dist/build-flags.js +15 -1
- package/dist/capabilities.js +183 -3
- package/dist/capture.js +56 -1
- package/dist/causality.js +148 -8
- package/dist/cli.js +281 -20
- package/dist/cloud/cli.js +541 -5
- package/dist/cloud/client.js +221 -1
- package/dist/cloud/crypto.js +85 -1
- package/dist/cloud/machine-id.js +113 -2
- package/dist/cloud/recovery.js +60 -1
- package/dist/cloud/sync-engine.js +543 -7
- package/dist/cloud-backup.js +579 -5
- package/dist/cloud-profile.js +138 -1
- package/dist/cloud-sync-entrypoint.js +47 -1
- package/dist/cloud-sync.js +309 -2
- package/dist/connectors/bridge-source.d.ts +46 -0
- package/dist/connectors/bridge-source.d.ts.map +1 -0
- package/dist/connectors/bridge-source.js +77 -0
- package/dist/connectors/bridge-source.js.map +1 -0
- package/dist/connectors/index.d.ts +24 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +69 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors/ingest.d.ts +16 -0
- package/dist/connectors/ingest.d.ts.map +1 -0
- package/dist/connectors/ingest.js +116 -0
- package/dist/connectors/ingest.js.map +1 -0
- package/dist/connectors/types.d.ts +99 -0
- package/dist/connectors/types.d.ts.map +1 -0
- package/dist/connectors/types.js +17 -0
- package/dist/connectors/types.js.map +1 -0
- package/dist/constellation.js +168 -12
- package/dist/content-signature.js +45 -1
- package/dist/context-build-budgeted.js +144 -4
- package/dist/context-ranking.js +69 -1
- package/dist/crypto.js +179 -1
- package/dist/daemon-write-endpoint.js +290 -1
- package/dist/daemon-writer.js +406 -2
- package/dist/database.js +1278 -53
- package/dist/deprecations.js +162 -2
- package/dist/design.js +141 -13
- package/dist/event-replication.js +112 -1
- package/dist/events-sse.js +43 -7
- package/dist/events.js +238 -6
- package/dist/failure-patterns.d.ts +107 -0
- package/dist/failure-patterns.d.ts.map +1 -1
- package/dist/failure-patterns.js +924 -43
- package/dist/failure-patterns.js.map +1 -1
- package/dist/federation.js +236 -12
- package/dist/goals.js +101 -13
- package/dist/golden.js +355 -3
- package/dist/handlers/agent.js +165 -4
- package/dist/handlers/alias-adapters.js +129 -1
- package/dist/handlers/aliases.js +171 -1
- package/dist/handlers/audit.js +87 -1
- package/dist/handlers/boundary.js +221 -1
- package/dist/handlers/capture.js +1114 -73
- package/dist/handlers/causality.js +119 -9
- package/dist/handlers/cloud.js +382 -85
- package/dist/handlers/companion.js +459 -28
- package/dist/handlers/datalake.js +187 -7
- package/dist/handlers/dispatch-context.js +22 -0
- package/dist/handlers/entity.js +256 -25
- package/dist/handlers/events.js +335 -16
- package/dist/handlers/failure.d.ts.map +1 -1
- package/dist/handlers/failure.js +408 -13
- package/dist/handlers/failure.js.map +1 -1
- package/dist/handlers/goals.js +296 -4
- package/dist/handlers/intelligence.js +681 -126
- package/dist/handlers/invoicing.js +70 -1
- package/dist/handlers/mcpclient.js +137 -6
- package/dist/handlers/orchestration.js +125 -40
- package/dist/handlers/output-schemas.js +24 -1
- package/dist/handlers/presence.js +99 -3
- package/dist/handlers/project.js +182 -28
- package/dist/handlers/prompts.js +157 -6
- package/dist/handlers/quest.js +224 -4
- package/dist/handlers/recall.js +237 -13
- package/dist/handlers/registry.js +167 -1
- package/dist/handlers/resources.js +288 -1
- package/dist/handlers/review.js +74 -11
- package/dist/handlers/run.js +498 -16
- package/dist/handlers/search.js +338 -15
- package/dist/handlers/session.js +643 -31
- package/dist/handlers/share.js +184 -8
- package/dist/handlers/shims.js +464 -1
- package/dist/handlers/skill.js +449 -67
- package/dist/handlers/survivors.js +120 -1
- package/dist/handlers/symbols.js +109 -8
- package/dist/handlers/syncops.js +302 -4
- package/dist/handlers/types.js +27 -1
- package/dist/harvest.js +191 -5
- package/dist/hours.js +156 -7
- package/dist/http-auth.js +321 -3
- package/dist/http-fast.js +1302 -22
- package/dist/icons.js +47 -1
- package/dist/importers.js +268 -1
- package/dist/index.js +840 -2
- package/dist/indexer.js +145 -4
- package/dist/intelligence.js +261 -31
- package/dist/internal-dispatch.js +212 -3
- package/dist/keyset.js +110 -1
- package/dist/knowledge-graph.js +176 -12
- package/dist/license.js +441 -2
- package/dist/logger.js +199 -2
- package/dist/maintenance.js +148 -2
- package/dist/mcp-client.js +262 -6
- package/dist/memory-artifacts.js +596 -32
- package/dist/migrate-prompt.js +124 -2
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +799 -42
- package/dist/migrations.js.map +1 -1
- package/dist/performance.js +228 -1
- package/dist/presence.js +140 -11
- package/dist/priority-embed.js +164 -5
- package/dist/providers/embedding-provider.js +196 -1
- package/dist/readonly-gate.js +29 -1
- package/dist/receipt.js +43 -1
- package/dist/rehydration.js +157 -9
- package/dist/reindex.js +88 -1
- package/dist/render-target.js +544 -21
- package/dist/render.js +280 -4
- package/dist/repl-guard.js +173 -1
- package/dist/replication-daemon-entrypoint.js +31 -1
- package/dist/replication-daemon.js +262 -2
- package/dist/rerank.js +142 -1
- package/dist/resilience.js +591 -1
- package/dist/reverse-bridge.js +360 -5
- package/dist/security.js +244 -1
- package/dist/session-seen.js +51 -3
- package/dist/setup.js +260 -1
- package/dist/skill-author.js +168 -5
- package/dist/spec-kit.js +191 -1
- package/dist/sqlite-busy.js +154 -1
- package/dist/statusline.js +315 -11
- package/dist/sub-agent.js +262 -13
- package/dist/summarizer.js +139 -13
- package/dist/symbols.js +283 -7
- package/dist/sync.js +359 -5
- package/dist/tasks-dispatch.js +84 -1
- package/dist/tasks.js +282 -1
- package/dist/token-budget.js +143 -1
- package/dist/tool-analytics.js +129 -7
- package/dist/tool-annotations.js +365 -1
- package/dist/tool-manifest-v2.json +1 -1
- package/dist/tool-manifest.json +1 -1
- package/dist/tool-profiles.js +75 -1
- package/dist/trace-harvest.js +244 -6
- package/dist/types.js +30 -1
- package/dist/ui-dashboard.js +50 -41
- package/dist/ulid.js +81 -1
- package/dist/usage-tracker.js +66 -1
- package/dist/validate.js +129 -1
- package/dist/vault.js +534 -1
- package/dist/vector-init.js +67 -1
- package/dist/vectors.js +184 -3
- package/dist/version-check.js +136 -4
- package/dist/visibility.js +155 -19
- package/dist/wyrm-cli.js +2845 -101
- package/dist/wyrm-cli.js.map +1 -1
- package/dist/wyrm-guard.d.ts.map +1 -1
- package/dist/wyrm-guard.js +475 -14
- package/dist/wyrm-guard.js.map +1 -1
- package/dist/wyrm-loop.js +150 -3
- package/dist/wyrm-manifest.json +1 -1
- package/dist/wyrm-statusline-daemon.js +11 -1
- package/dist/wyrm-statusline.js +56 -4
- package/dist/wyrm-ui.js +77 -9
- package/package.json +1 -1
package/dist/events.js
CHANGED
|
@@ -1,18 +1,250 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Live Memory v6.4 — append-only event log (Phase 1: local node).
|
|
3
|
+
*
|
|
4
|
+
* Every canonical write emits an event here as a FAILURE-ISOLATED side effect:
|
|
5
|
+
* the emit runs AFTER the canonical write and any failure — or the feature being
|
|
6
|
+
* disabled — logs-and-drops. It NEVER throws and NEVER rolls back the real write.
|
|
7
|
+
* "Strictly additive" means the existing write path cannot regress even if this
|
|
8
|
+
* table or its migration is broken.
|
|
9
|
+
*
|
|
10
|
+
* Feature flag `WYRM_LIVE_MEMORY` — DEFAULT ON (operator decision, v6.4).
|
|
11
|
+
* Disable with `WYRM_LIVE_MEMORY=0` (or `false` / `off`).
|
|
12
|
+
*
|
|
13
|
+
* Privacy: a denormalized payload is written ONLY for shareable rows; protected
|
|
14
|
+
* or private rows are reference-only (`payload_json = NULL`) so the event log
|
|
15
|
+
* never becomes a copy of data the encryption/federation layer protects.
|
|
16
|
+
*
|
|
17
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
18
|
+
* @license Proprietary — (c) 2026 Ghost Protocol (Pvt) Ltd. All rights reserved. See LICENSE.
|
|
19
|
+
*/
|
|
20
|
+
import { randomUUID } from 'node:crypto';
|
|
21
|
+
import { hostname } from 'node:os';
|
|
22
|
+
import { logger } from './logger.js';
|
|
23
|
+
import { getActor } from './handlers/boundary.js';
|
|
24
|
+
/** The closed set of valid event kinds — ingest rejects anything else (anti-spoof). */
|
|
25
|
+
const KNOWN_KINDS = new Set([
|
|
26
|
+
'capture', 'session_update', 'quest', 'truth', 'presence', 'tool_call',
|
|
27
|
+
'failure', 'decision',
|
|
28
|
+
]);
|
|
29
|
+
// Ingest bounds for peer-supplied events (defends storage + ordering against a hostile peer).
|
|
30
|
+
const MAX_PAYLOAD_BYTES = 64 * 1024; // oversized payloads degrade to reference-only
|
|
31
|
+
const MAX_DEVICE_LEN = 80;
|
|
32
|
+
const MAX_FIELD_LEN = 256;
|
|
33
|
+
const DAY_MS = 86_400_000;
|
|
34
|
+
const isSafeNonNegInt = (n) => typeof n === 'number' && Number.isInteger(n) && n >= 0 && n <= Number.MAX_SAFE_INTEGER;
|
|
35
|
+
const clampStr = (s, max) => typeof s === 'string' ? s.slice(0, max) : null;
|
|
36
|
+
/** Default ON in v6.4 (operator decision). Disable with WYRM_LIVE_MEMORY=0|false|off. */
|
|
37
|
+
export function isLiveMemoryEnabled() {
|
|
38
|
+
const v = (process.env.WYRM_LIVE_MEMORY || '').toLowerCase();
|
|
39
|
+
return v !== '0' && v !== 'false' && v !== 'off';
|
|
40
|
+
}
|
|
41
|
+
// Per-DB cache (not a single module global): a process that opens more than one
|
|
42
|
+
// WyrmDB — e.g. cross-device replication tests, or a future multi-DB host — must
|
|
43
|
+
// get a DISTINCT device id per DB, or echo-suppression collapses.
|
|
44
|
+
const deviceIdCache = new WeakMap();
|
|
45
|
+
/** Stable per-node device id, persisted in wyrm_meta. Lazy + cached per DB. */
|
|
46
|
+
export function getDeviceId(db) {
|
|
47
|
+
const hit = deviceIdCache.get(db);
|
|
48
|
+
if (hit)
|
|
49
|
+
return hit;
|
|
50
|
+
const read = () => db.prepare(`SELECT value FROM wyrm_meta WHERE key = 'device_id'`).get()?.value;
|
|
51
|
+
let id = read();
|
|
52
|
+
if (!id) {
|
|
53
|
+
const candidate = `${hostname().slice(0, 24)}-${randomUUID().slice(0, 8)}`;
|
|
54
|
+
db.prepare(`INSERT OR IGNORE INTO wyrm_meta (key, value) VALUES ('device_id', ?)`).run(candidate);
|
|
55
|
+
id = read() || candidate; // re-read in case another process won the race
|
|
56
|
+
}
|
|
57
|
+
deviceIdCache.set(db, id);
|
|
58
|
+
return id;
|
|
59
|
+
}
|
|
60
|
+
function clamp(n, lo, hi, dflt) {
|
|
61
|
+
const v = typeof n === 'number' && Number.isFinite(n) ? Math.floor(n) : dflt;
|
|
62
|
+
return Math.max(lo, Math.min(hi, v));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Emit an event for a canonical write. NEVER throws; no-op when disabled.
|
|
66
|
+
* Call AFTER the canonical row is committed.
|
|
67
|
+
*/
|
|
68
|
+
export function emitEvent(db, ev) {
|
|
69
|
+
if (!isLiveMemoryEnabled())
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
const device = getDeviceId(db);
|
|
73
|
+
const isShared = ev.isShared ? 1 : 0;
|
|
74
|
+
let payloadJson = null;
|
|
75
|
+
if (isShared && ev.payload !== undefined) {
|
|
76
|
+
// Isolate stringify: a non-serializable payload (circular / BigInt) degrades
|
|
77
|
+
// to reference-only — the event still emits rather than being dropped whole.
|
|
78
|
+
try {
|
|
79
|
+
payloadJson = JSON.stringify(ev.payload);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
payloadJson = null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// v7 F2 (T009): machine attribution from the ambient actor envelope unless
|
|
86
|
+
// the caller passed it explicitly. The 6.x `actor` display label keeps being
|
|
87
|
+
// written exactly as before — agent_id/run_id land ALONGSIDE it.
|
|
88
|
+
const ambient = getActor();
|
|
89
|
+
const agentId = ev.agentId !== undefined ? ev.agentId : ambient.agent_id;
|
|
90
|
+
const runId = ev.runId !== undefined ? ev.runId : ambient.run_id;
|
|
91
|
+
// Atomic origin_seq allocation: the MAX(origin_seq)+1 is computed INSIDE the
|
|
92
|
+
// INSERT so it runs under the write lock — no read-then-write race between the
|
|
93
|
+
// server, the CLI, and the trace hook all writing to one DB.
|
|
94
|
+
db.prepare(`
|
|
2
95
|
INSERT INTO events
|
|
3
96
|
(origin_device, origin_seq, project_id, kind, ref_table, ref_id, actor, is_shared, payload_json, created_at, agent_id, run_id)
|
|
4
97
|
VALUES (?, (SELECT COALESCE(MAX(origin_seq), 0) + 1 FROM events WHERE origin_device = ?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
5
|
-
`).run(
|
|
98
|
+
`).run(device, device, String(ev.projectId), ev.kind, ev.refTable ?? null, ev.refId != null ? String(ev.refId) : null, ev.actor ?? null, isShared, payloadJson, Date.now(), agentId, runId);
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
// log-and-drop: the canonical write already succeeded; the event is best-effort.
|
|
102
|
+
logger.warn('live-memory: emitEvent dropped', { err: err instanceof Error ? err.message : String(err) });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** One-shot pull of events newer than a cursor, for a project. Idempotent. */
|
|
106
|
+
export function eventsSince(db, projectId, sinceCursor = 0, limit = 100) {
|
|
107
|
+
const lim = clamp(limit, 1, 1000, 100);
|
|
108
|
+
const since = clamp(sinceCursor, 0, Number.MAX_SAFE_INTEGER, 0);
|
|
109
|
+
return db
|
|
110
|
+
.prepare(`SELECT * FROM events WHERE project_id = ? AND cursor > ? ORDER BY cursor ASC LIMIT ?`)
|
|
111
|
+
.all(String(projectId), since, lim);
|
|
112
|
+
}
|
|
113
|
+
/** Initial subscribe: current head cursor + a recent window (chronological). */
|
|
114
|
+
export function subscribeEvents(db, projectId, window = 20) {
|
|
115
|
+
const win = clamp(window, 1, 200, 20);
|
|
116
|
+
const recent = db
|
|
117
|
+
.prepare(`SELECT * FROM events WHERE project_id = ? ORDER BY cursor DESC LIMIT ?`)
|
|
118
|
+
.all(String(projectId), win);
|
|
119
|
+
recent.reverse();
|
|
120
|
+
const head = db
|
|
121
|
+
.prepare(`SELECT COALESCE(MAX(cursor), 0) AS c FROM events WHERE project_id = ?`)
|
|
122
|
+
.get(String(projectId));
|
|
123
|
+
return { cursor: head.c, recent };
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Ingest one event received from a peer (replication PULL). Failure-isolated.
|
|
127
|
+
* - **Echo-suppression:** an event whose `origin_device` is THIS device is
|
|
128
|
+
* dropped (`'echo'`) — our own events bouncing back never re-insert.
|
|
129
|
+
* - **Idempotent dedup:** `INSERT OR IGNORE` on `UNIQUE(origin_device, origin_seq)`
|
|
130
|
+
* → re-delivering the same event is a no-op (`'duplicate'`).
|
|
131
|
+
* - `localProjectId` files the event under a LOCAL project (peer project ids are
|
|
132
|
+
* not assumed to match ours — the local node decides the mapping).
|
|
133
|
+
* The remote `(origin_device, origin_seq)` identity is preserved verbatim so the
|
|
134
|
+
* dedup key stays globally stable; only the local `cursor` is freshly minted.
|
|
135
|
+
*/
|
|
136
|
+
export function ingestRemoteEvent(db, localProjectId, ev) {
|
|
137
|
+
try {
|
|
138
|
+
// ── Validate + bound every peer-supplied field (hostile peer hardening) ──
|
|
139
|
+
if (!ev || typeof ev.origin_device !== 'string' || !isSafeNonNegInt(ev.origin_seq)) {
|
|
140
|
+
return 'duplicate'; // malformed identity — drop, never throw
|
|
141
|
+
}
|
|
142
|
+
const device = clampStr(ev.origin_device, MAX_DEVICE_LEN);
|
|
143
|
+
if (!device)
|
|
144
|
+
return 'duplicate';
|
|
145
|
+
if (device === getDeviceId(db))
|
|
146
|
+
return 'echo'; // our own event bounced back
|
|
147
|
+
// Reject unknown kinds — stops a peer injecting arbitrary `event:` types downstream.
|
|
148
|
+
if (typeof ev.kind !== 'string' || !KNOWN_KINDS.has(ev.kind))
|
|
149
|
+
return 'duplicate';
|
|
150
|
+
const isShared = ev.is_shared ? 1 : 0;
|
|
151
|
+
// Privacy consistency: a non-shared row NEVER carries a payload (mirrors emit's invariant),
|
|
152
|
+
// so a peer can't smuggle a private-flagged blob. Oversized shared payloads degrade to
|
|
153
|
+
// reference-only rather than bloating the store unboundedly.
|
|
154
|
+
let payloadJson = isShared && typeof ev.payload_json === 'string' ? ev.payload_json : null;
|
|
155
|
+
if (payloadJson && payloadJson.length > MAX_PAYLOAD_BYTES)
|
|
156
|
+
payloadJson = null;
|
|
157
|
+
const now = Date.now();
|
|
158
|
+
const createdAt = isSafeNonNegInt(ev.created_at) && ev.created_at <= now + DAY_MS ? ev.created_at : now;
|
|
159
|
+
const cloudCursor = isSafeNonNegInt(ev.cloud_cursor) ? ev.cloud_cursor : null;
|
|
160
|
+
// v7 F2 (T009): the remote author's attribution is preserved (clamped like
|
|
161
|
+
// every peer-supplied field) — the LOCAL actor envelope is deliberately NOT
|
|
162
|
+
// stamped on ingested events: provenance belongs to whoever wrote the row,
|
|
163
|
+
// and NULL stays NULL so replication round-trips are byte-faithful.
|
|
164
|
+
const info = db.prepare(`
|
|
6
165
|
INSERT OR IGNORE INTO events
|
|
7
166
|
(origin_device, origin_seq, cloud_cursor, project_id, kind, ref_table, ref_id, actor, is_shared, payload_json, created_at, agent_id, run_id)
|
|
8
167
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
9
|
-
`).run(
|
|
168
|
+
`).run(device, ev.origin_seq, cloudCursor, String(localProjectId), ev.kind, clampStr(ev.ref_table, MAX_FIELD_LEN), clampStr(ev.ref_id, MAX_FIELD_LEN), clampStr(ev.actor, MAX_FIELD_LEN), isShared, payloadJson, createdAt, clampStr(ev.agent_id, MAX_FIELD_LEN), clampStr(ev.run_id, MAX_FIELD_LEN));
|
|
169
|
+
return info.changes > 0 ? 'inserted' : 'duplicate';
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
logger.warn('live-memory: ingestRemoteEvent dropped', { err: err instanceof Error ? err.message : String(err) });
|
|
173
|
+
return 'duplicate';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Shared events past a local-cursor watermark, for PUSH up to a peer/cloud.
|
|
178
|
+
* **Privacy gate:** only `is_shared = 1` rows are eligible to leave the box;
|
|
179
|
+
* reference-only rows keep `payload_json = NULL` exactly as stored, so protected
|
|
180
|
+
* data never replicates even by accident.
|
|
181
|
+
*/
|
|
182
|
+
export function eventsForPush(db, projectId, sinceCursor = 0, limit = 200) {
|
|
183
|
+
const lim = clamp(limit, 1, 1000, 200);
|
|
184
|
+
const since = clamp(sinceCursor, 0, Number.MAX_SAFE_INTEGER, 0);
|
|
185
|
+
// [grove isolation] Live Memory replication is a separate egress channel; gate
|
|
186
|
+
// it by grove too. Only a 'team' grove's events may leave the box. We match the
|
|
187
|
+
// event's project_id against BOTH projects.id and projects.path (events store a
|
|
188
|
+
// path-or-id key), so a private grove (e.g. GHOST PROTOCOL) never replicates.
|
|
189
|
+
// If the projects.sync_policy column is absent (pre-migration), the grove
|
|
190
|
+
// feature is off and we fall back to the is_shared-only gate.
|
|
191
|
+
try {
|
|
192
|
+
const pol = db.prepare(`SELECT sync_policy AS p FROM projects WHERE CAST(id AS TEXT) = ? OR path = ? LIMIT 1`).get(String(projectId), String(projectId));
|
|
193
|
+
if (pol && pol.p && pol.p !== 'team')
|
|
194
|
+
return [];
|
|
195
|
+
}
|
|
196
|
+
catch { /* sync_policy column absent (pre-migration): grove gate off */ }
|
|
197
|
+
return db.prepare(`
|
|
10
198
|
SELECT * FROM events
|
|
11
199
|
WHERE project_id = ? AND is_shared = 1 AND cursor > ?
|
|
12
200
|
ORDER BY cursor ASC LIMIT ?
|
|
13
|
-
`).all(String(
|
|
201
|
+
`).all(String(projectId), since, lim);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Retention for the append-only event log. Live Memory is a DERIVED stream, not
|
|
205
|
+
* the system of record — trimming old events is lossless for memory; it only
|
|
206
|
+
* shortens how far back the live tail / replication catch-up can reach. Bounds
|
|
207
|
+
* the table two ways: (1) drop events older than `olderThanDays` (old enough that
|
|
208
|
+
* any peer has long since synced), then (2) cap each project to its most recent
|
|
209
|
+
* `maxPerProject` by cursor. Failure-isolated — a retention hiccup never throws.
|
|
210
|
+
*
|
|
211
|
+
* Performance note: this is why widening producers (truths/captures/failures/
|
|
212
|
+
* decisions all emit now) can't grow the DB unbounded — maintenance trims it.
|
|
213
|
+
*/
|
|
214
|
+
export function pruneEvents(db, opts = {}) {
|
|
215
|
+
const olderThanDays = clamp(opts.olderThanDays, 1, 3650, 90);
|
|
216
|
+
const maxPerProject = clamp(opts.maxPerProject, 1, 1_000_000, 5000);
|
|
217
|
+
try {
|
|
218
|
+
let deleted = 0;
|
|
219
|
+
// (1) Age-based sweep.
|
|
220
|
+
const cutoff = Date.now() - olderThanDays * DAY_MS;
|
|
221
|
+
deleted += db.prepare(`DELETE FROM events WHERE created_at < ?`).run(cutoff).changes;
|
|
222
|
+
// (2) Per-project count cap: keep the most recent `maxPerProject` by cursor.
|
|
223
|
+
// The OFFSET row is the (max+1)-th newest cursor; deleting <= it keeps exactly
|
|
224
|
+
// `maxPerProject`. Projects under the cap return NULL → `cursor <= NULL` deletes
|
|
225
|
+
// nothing (safe no-op).
|
|
226
|
+
const overflow = db.prepare(`SELECT project_id FROM events GROUP BY project_id HAVING COUNT(*) > ?`).all(maxPerProject);
|
|
227
|
+
const trim = db.prepare(`
|
|
14
228
|
DELETE FROM events WHERE project_id = ? AND cursor <= (
|
|
15
229
|
SELECT cursor FROM events WHERE project_id = ? ORDER BY cursor DESC LIMIT 1 OFFSET ?
|
|
16
230
|
)
|
|
17
|
-
`);
|
|
18
|
-
|
|
231
|
+
`);
|
|
232
|
+
for (const { project_id } of overflow) {
|
|
233
|
+
deleted += trim.run(project_id, project_id, maxPerProject).changes;
|
|
234
|
+
}
|
|
235
|
+
return { deleted };
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
logger.warn('live-memory: pruneEvents failed', { err: err instanceof Error ? err.message : String(err) });
|
|
239
|
+
return { deleted: 0 };
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** Tiny persistent KV in wyrm_meta — used for replication watermarks. */
|
|
243
|
+
export function getMeta(db, key) {
|
|
244
|
+
return db.prepare(`SELECT value FROM wyrm_meta WHERE key = ?`).get(key)?.value;
|
|
245
|
+
}
|
|
246
|
+
export function setMeta(db, key, value) {
|
|
247
|
+
db.prepare(`INSERT INTO wyrm_meta (key, value) VALUES (?, ?)
|
|
248
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value`).run(key, value);
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -24,6 +24,35 @@ export type RunScopeFilter = QuarantineScope | 'any';
|
|
|
24
24
|
/** v7 F2 (T015): the tiers a failure can be PROMOTED to ('run' is where
|
|
25
25
|
* quarantined rows start — promotion only ever widens, see TIER_RANK). */
|
|
26
26
|
export type PromoteTier = 'project' | 'global';
|
|
27
|
+
/** Hard cap on DISTINCT anchored files (rel_paths) per failure, enforced at
|
|
28
|
+
* WRITE time (recordAnchors). Refreshing an already-anchored path never
|
|
29
|
+
* consumes a slot — one row per (failure_id, rel_path) by construction. */
|
|
30
|
+
export declare const ANCHOR_CAP = 8;
|
|
31
|
+
/** The advisory flag a downgraded match carries (PROTOCOL.md §10.2.5). Both
|
|
32
|
+
* surfaces — the MCP failure_check handler and the wyrm-guard block tiers —
|
|
33
|
+
* emit EXACTLY this string, so consumers can key on it. */
|
|
34
|
+
export declare const STALE_ANCHOR_FLAG = "source changed since this failure was recorded \u2014 re-verify";
|
|
35
|
+
/**
|
|
36
|
+
* One stored anchor row (SELECT-projection of failure_anchors). size/mtime_ns
|
|
37
|
+
* are BigInt: mtime in nanoseconds exceeds Number.MAX_SAFE_INTEGER (~9e15 vs
|
|
38
|
+
* ~1.7e18), so the read statement runs under safeIntegers — a number round-trip
|
|
39
|
+
* would silently break the stat fast path on every check.
|
|
40
|
+
*/
|
|
41
|
+
export interface FailureAnchor {
|
|
42
|
+
rel_path: string;
|
|
43
|
+
sha: string;
|
|
44
|
+
size: bigint;
|
|
45
|
+
mtime_ns: bigint;
|
|
46
|
+
recorded_at: string;
|
|
47
|
+
}
|
|
48
|
+
/** One failure's oracle verdict:
|
|
49
|
+
* - 'unanchored' — nothing checkable (no anchors / no root / every anchor
|
|
50
|
+
* missing-or-unreadable): FAIL-OPEN, no staleness claim, verdict unchanged.
|
|
51
|
+
* - 'fresh' — ≥1 checkable anchor and every checkable anchor matches
|
|
52
|
+
* (stat fast path, or normalized-content hash on stat drift).
|
|
53
|
+
* - 'stale' — ≥1 anchor is READABLE and its normalized-content hash
|
|
54
|
+
* positively differs from what was recorded. The only downgrading verdict. */
|
|
55
|
+
export type AnchorFreshness = 'unanchored' | 'fresh' | 'stale';
|
|
27
56
|
export interface FailurePattern {
|
|
28
57
|
id: number;
|
|
29
58
|
project_id: number | null;
|
|
@@ -91,6 +120,12 @@ export interface FailureVerdictMatch {
|
|
|
91
120
|
match: 'exact' | 'fuzzy' | 'target';
|
|
92
121
|
/** Deterministic per-match score, 0..1 — see matchConfidence(). */
|
|
93
122
|
confidence: number;
|
|
123
|
+
/** Staleness oracle (migration 30, PROTOCOL.md §10.2.5): present ONLY when
|
|
124
|
+
* this match's anchored source files have POSITIVELY drifted since the
|
|
125
|
+
* failure was recorded — the hard block downgrades to advisory and this
|
|
126
|
+
* carries STALE_ANCHOR_FLAG. ADDITIVE: absent (never null) on every
|
|
127
|
+
* unanchored/fresh match, so anchor-less results stay byte-identical. */
|
|
128
|
+
stale_anchor?: string;
|
|
94
129
|
}
|
|
95
130
|
/**
|
|
96
131
|
* The canonical wyrm_failure_check result shape (spec FR-2). `confidence` is a
|
|
@@ -280,6 +315,78 @@ export declare class FailurePatterns {
|
|
|
280
315
|
*/
|
|
281
316
|
contentMatch(editContent: string, scope: FailureScope, projectId: number | null): FailurePattern | null;
|
|
282
317
|
get(id: number): FailurePattern | null;
|
|
318
|
+
/** The anchor fingerprint: sha256 over the NORMALIZED content form
|
|
319
|
+
* (normalizeContentSignature — the content-tier normal form), so
|
|
320
|
+
* whitespace/reformat/comment churn can never false-flag staleness. */
|
|
321
|
+
static anchorSha(content: string): string;
|
|
322
|
+
/**
|
|
323
|
+
* Anchor a recorded failure to the source files it is about (the undeclared
|
|
324
|
+
* `files` param of wyrm_failure_record). For each file UNDER the project
|
|
325
|
+
* root: stat + read + hash the normalized content, store the
|
|
326
|
+
* PROJECT-RELATIVE path (anchors replicate across machines whose checkouts
|
|
327
|
+
* live at different roots) with the stat fast-path fields. Paths escaping
|
|
328
|
+
* the project root (traversal, absolute paths outside it) are REJECTED;
|
|
329
|
+
* unreadable files are skipped.
|
|
330
|
+
*
|
|
331
|
+
* UPSERT per (failure_id, rel_path): record() COALESCES repeat failures
|
|
332
|
+
* onto ONE id, so a coalesced re-record that names the same files must
|
|
333
|
+
* REFRESH each path's anchor in place (delete-then-insert — no reliance on
|
|
334
|
+
* the unique index, so a DB that ran an earlier shape of migration 30 still
|
|
335
|
+
* behaves). Appending instead would leave the old-sha row beside the fresh
|
|
336
|
+
* one, and anchorFreshness — 'stale' on ANY drifted row — would keep a
|
|
337
|
+
* failure just re-confirmed against CURRENT source permanently advisory.
|
|
338
|
+
* ANCHOR_CAP counts DISTINCT rel_paths: refreshing an existing anchor never
|
|
339
|
+
* consumes a slot and lands even at the cap. Best-effort by contract:
|
|
340
|
+
* returns how many anchors were written (refreshes included) and NEVER
|
|
341
|
+
* throws — a pre-migration-30 DB or any fs error must not fail the record.
|
|
342
|
+
*
|
|
343
|
+
* SECURITY (allowNewPaths): only the call that FRESHLY created this failure
|
|
344
|
+
* may introduce NEW anchor paths. record() coalesces a repeat signature onto
|
|
345
|
+
* an existing id, so a coalesced re-record (allowNewPaths=false) may only
|
|
346
|
+
* REFRESH paths already anchored — it can never attach a NEW (decoy) anchor
|
|
347
|
+
* to a firm block it does not own and then drift the decoy to collapse that
|
|
348
|
+
* block to advisory. Refreshes are always allowed (a re-confirmed failure
|
|
349
|
+
* must regain its hard block); the gate is on introducing new paths only.
|
|
350
|
+
*/
|
|
351
|
+
recordAnchors(failureId: number, projectRoot: string, files: string[], allowNewPaths?: boolean): number;
|
|
352
|
+
/** Stored anchors for one failure. safeIntegers: mtime_ns (INT64 ns) exceeds
|
|
353
|
+
* JS safe-number range — a number round-trip would break the stat fast path.
|
|
354
|
+
* Never throws: a pre-migration-30 DB reads as "no anchors" (fail-open). */
|
|
355
|
+
getAnchors(failureId: number): FailureAnchor[];
|
|
356
|
+
/**
|
|
357
|
+
* THE ORACLE CORE: has this failure's anchored source POSITIVELY drifted?
|
|
358
|
+
*
|
|
359
|
+
* Fast path first (the guard's latency budget): stat each anchor — equal
|
|
360
|
+
* size AND mtime_ns ⇒ fresh with ZERO hashing. Only on stat drift is the
|
|
361
|
+
* file read and its NORMALIZED content re-hashed (anchorSha), so a
|
|
362
|
+
* whitespace-only reformat stats different but hashes identical ⇒ fresh.
|
|
363
|
+
*
|
|
364
|
+
* FAIL-OPEN (PROTOCOL.md §10.2 verdict contract): a missing/unreadable
|
|
365
|
+
* anchor file (fleet-replicated rows from machines whose checkout this box
|
|
366
|
+
* doesn't have), a rel_path that would escape the root, a pre-migration DB,
|
|
367
|
+
* or ANY fs error contributes NO staleness claim — only a readable file
|
|
368
|
+
* whose normalized hash differs returns 'stale'. Never throws. Read-only
|
|
369
|
+
* (the wyrm-guard handle is readonly).
|
|
370
|
+
*/
|
|
371
|
+
anchorFreshness(failureId: number, projectRoot: string | null): AnchorFreshness;
|
|
372
|
+
/**
|
|
373
|
+
* The SHARED downgrade rule both firewall surfaces inherit — the MCP
|
|
374
|
+
* wyrm_failure_check handler AND the wyrm-guard block tiers call exactly
|
|
375
|
+
* this, so the two cannot drift. Returns the ids of matches whose hard
|
|
376
|
+
* block must DOWNGRADE to advisory (stale_anchor), i.e. matches that are:
|
|
377
|
+
*
|
|
378
|
+
* · NOT an exact-signature match for the current attempt — an exact
|
|
379
|
+
* command/edit signature match KEEPS its hard block regardless of
|
|
380
|
+
* anchors (code moving on does not unprove a command failure), and
|
|
381
|
+
* · file/symbol-scoped — only matches ABOUT source code are unproven by
|
|
382
|
+
* that source changing; command/edit/prompt scopes key on the ATTEMPT
|
|
383
|
+
* itself and never downgrade, and
|
|
384
|
+
* · positively 'stale' under anchorFreshness above.
|
|
385
|
+
*
|
|
386
|
+
* Fail-open end to end: no project root, no anchors, missing files, any
|
|
387
|
+
* error ⇒ ids stay out of the set ⇒ verdict unchanged. Never throws.
|
|
388
|
+
*/
|
|
389
|
+
staleAnchorIds(matches: ReadonlyArray<Pick<FailureVerdictMatch, 'id' | 'scope' | 'match'>>, projectRoot: string | null): Set<number>;
|
|
283
390
|
/**
|
|
284
391
|
* Confirmation ledger + the ≥2-distinct-agents auto-promotion path.
|
|
285
392
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failure-patterns.d.ts","sourceRoot":"","sources":["../src/failure-patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"failure-patterns.d.ts","sourceRoot":"","sources":["../src/failure-patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAU3C,MAAM,MAAM,Y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