agent-recall-core 3.4.39 → 3.4.40

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 (47) hide show
  1. package/dist/helpers/journal-files.d.ts +29 -1
  2. package/dist/helpers/journal-files.d.ts.map +1 -1
  3. package/dist/helpers/journal-files.js +124 -33
  4. package/dist/helpers/journal-files.js.map +1 -1
  5. package/dist/helpers/journal-sig-theme.d.ts.map +1 -1
  6. package/dist/helpers/journal-sig-theme.js +40 -4
  7. package/dist/helpers/journal-sig-theme.js.map +1 -1
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +5 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/storage/archive-write.d.ts.map +1 -1
  13. package/dist/storage/archive-write.js +7 -1
  14. package/dist/storage/archive-write.js.map +1 -1
  15. package/dist/storage/blind-spots-store.d.ts +9 -1
  16. package/dist/storage/blind-spots-store.d.ts.map +1 -1
  17. package/dist/storage/blind-spots-store.js +9 -2
  18. package/dist/storage/blind-spots-store.js.map +1 -1
  19. package/dist/storage/corrections.d.ts +47 -3
  20. package/dist/storage/corrections.d.ts.map +1 -1
  21. package/dist/storage/corrections.js +53 -6
  22. package/dist/storage/corrections.js.map +1 -1
  23. package/dist/storage/hygiene.d.ts +111 -0
  24. package/dist/storage/hygiene.d.ts.map +1 -0
  25. package/dist/storage/hygiene.js +422 -0
  26. package/dist/storage/hygiene.js.map +1 -0
  27. package/dist/storage/memory-protocol.d.ts.map +1 -1
  28. package/dist/storage/memory-protocol.js +4 -1
  29. package/dist/storage/memory-protocol.js.map +1 -1
  30. package/dist/storage/store-manifest.d.ts +31 -0
  31. package/dist/storage/store-manifest.d.ts.map +1 -0
  32. package/dist/storage/store-manifest.js +108 -0
  33. package/dist/storage/store-manifest.js.map +1 -0
  34. package/dist/tools-logic/predict-correction.d.ts +10 -0
  35. package/dist/tools-logic/predict-correction.d.ts.map +1 -1
  36. package/dist/tools-logic/predict-correction.js +6 -2
  37. package/dist/tools-logic/predict-correction.js.map +1 -1
  38. package/dist/tools-logic/recognition-builder.d.ts +9 -0
  39. package/dist/tools-logic/recognition-builder.d.ts.map +1 -1
  40. package/dist/tools-logic/recognition-builder.js +5 -3
  41. package/dist/tools-logic/recognition-builder.js.map +1 -1
  42. package/dist/tools-logic/session-start.d.ts.map +1 -1
  43. package/dist/tools-logic/session-start.js +35 -4
  44. package/dist/tools-logic/session-start.js.map +1 -1
  45. package/dist/types.d.ts +1 -1
  46. package/dist/types.js +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,422 @@
1
+ /**
2
+ * hygiene.ts — DETECTION-ONLY store trash audit ("ar hygiene").
3
+ *
4
+ * Sibling to store-doctor.ts, but a different axis:
5
+ * - store-doctor = STRUCTURAL integrity (index drift, stale locks, stalled
6
+ * consolidation seam, orphaned markers, ledger divergence).
7
+ * - hygiene = STORE TRASH (junk project dirs, unbounded counter files,
8
+ * recurring-theme epidemics, case-fold forks, stale derived caches,
9
+ * leaked-secret-shaped strings, missing materialized indexes, reserved-
10
+ * word slug collisions).
11
+ *
12
+ * HARD INVARIANTS (owner-approved 2026-07-27):
13
+ * 1. Scan != clean. `runHygieneScan` NEVER deletes, renames, or quarantines
14
+ * anything — findings only. No mkdir, no unlink, no rename, no write of
15
+ * any kind. Only fs reads (existsSync/readdirSync/readFileSync/statSync).
16
+ * 2. The ONLY write this module ever performs is its own baseline file
17
+ * (`hygiene-baseline.json`), and ONLY via the explicit `updateBaseline`
18
+ * call — never as a side effect of scanning or of `applyBaseline`.
19
+ * 3. Each check runs independently try/caught inside `runHygieneScan` — one
20
+ * failing check (unreadable dir, permissions, malformed file) degrades
21
+ * that check to zero findings; it never kills the whole scan.
22
+ * 4. `runHygieneScan(root)` is PURE with respect to global state: unlike
23
+ * store-doctor.ts (which reads the process-global root via getRoot()),
24
+ * every path here is built from the explicit `root` parameter. This is
25
+ * deliberate — it lets tests exercise the scanner against a temp
26
+ * directory without mutating (or restoring) any global root state.
27
+ *
28
+ * Baseline: without one, every pre-existing finding (e.g. ~985 stray counter
29
+ * files) would resurface on every run and drown out anything NEW. The first
30
+ * invocation of `ar hygiene --baseline-update` snapshots every current
31
+ * finding's `stable_id`; subsequent bare `ar hygiene` runs report only
32
+ * findings whose `stable_id` is NOT in that snapshot ("fresh"), plus a
33
+ * one-line count of how many are already known.
34
+ */
35
+ import * as fs from "node:fs";
36
+ import * as path from "node:path";
37
+ import { createHash } from "node:crypto";
38
+ import { ensureDir } from "./fs-utils.js";
39
+ import { listCaseVariantForks, PROJECTS_DIRNAME } from "./paths.js";
40
+ import { parseJournalFileName } from "../helpers/journal-name-parser.js";
41
+ // ---------------------------------------------------------------------------
42
+ // Constants
43
+ // ---------------------------------------------------------------------------
44
+ /** The baseline file lives at the store root, alongside `projects/`. */
45
+ export const HYGIENE_BASELINE_FILENAME = "hygiene-baseline.json";
46
+ export function hygieneBaselinePath(root) {
47
+ return path.join(root, HYGIENE_BASELINE_FILENAME);
48
+ }
49
+ const CHECK_NAMES = [
50
+ "junk-project-dirs",
51
+ "counter-accumulation",
52
+ "theme-epidemic",
53
+ "case-fold-forks",
54
+ "stale-derived-caches",
55
+ "root-secret-patterns",
56
+ "missing-corrections-index",
57
+ "reserved-word-slugs",
58
+ ];
59
+ // (a) junk-project-dirs
60
+ const UUID_PREFIX_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-/i;
61
+ const DOT_DOT_RE = /\.\./;
62
+ const JUNK_LITERAL_RE = /^(test-|this-project-does-not-exist|not-a-real-project)/i;
63
+ const EPOCH_SUFFIX_RE = /-\d{13}$/;
64
+ // (b) counter-accumulation
65
+ const COUNTER_PREFIX = ".ambient-counter-";
66
+ const COUNTER_YELLOW_THRESHOLD = 100;
67
+ const COUNTER_RED_THRESHOLD = 500;
68
+ // (c) theme-epidemic
69
+ const THEME_EPIDEMIC_MIN_FILES = 10;
70
+ const THEME_EPIDEMIC_SHARE = 0.5;
71
+ // (e) stale-derived-caches
72
+ const STALE_CACHE_AGE_MS = 30 * 24 * 60 * 60 * 1000;
73
+ const SECRET_PATTERNS = [
74
+ { name: "openai-sk-proj", regex: /sk-proj-/ },
75
+ { name: "openai-or-anthropic-sk", regex: /sk-[A-Za-z0-9_-]{20,}/ },
76
+ { name: "supabase-secret-key", regex: /sb_secret_/ },
77
+ { name: "supabase-service-role-key", regex: /sbp_[a-f0-9]{40}/ },
78
+ { name: "aws-access-key-id", regex: /AKIA[A-Z0-9]{16}/ },
79
+ { name: "github-pat", regex: /ghp_[A-Za-z0-9]{36}/ },
80
+ { name: "slack-token", regex: /xox[bap]-/ },
81
+ ];
82
+ // (h) reserved-word-slugs
83
+ const RESERVED_SLUGS = new Set([
84
+ "palace", "journal", "corrections", "tmp", "insights", "rooms", "skills",
85
+ ]);
86
+ // ---------------------------------------------------------------------------
87
+ // Internal helpers
88
+ // ---------------------------------------------------------------------------
89
+ function stableId(check, findingPath) {
90
+ return createHash("sha256").update(`${check}:${findingPath}`).digest("hex").slice(0, 16);
91
+ }
92
+ function mkFinding(check, severity, findingPath, evidence, agentInstruction) {
93
+ return {
94
+ check,
95
+ severity,
96
+ path: findingPath,
97
+ evidence,
98
+ stable_id: stableId(check, findingPath),
99
+ agent_instruction: agentInstruction,
100
+ };
101
+ }
102
+ function safeReaddirNames(dir) {
103
+ try {
104
+ return fs.readdirSync(dir);
105
+ }
106
+ catch {
107
+ return [];
108
+ }
109
+ }
110
+ function safeReaddirEntries(dir) {
111
+ try {
112
+ return fs.readdirSync(dir, { withFileTypes: true });
113
+ }
114
+ catch {
115
+ return [];
116
+ }
117
+ }
118
+ /** Every directory entry directly under `<root>/projects` (junk dirs included). */
119
+ function listProjectDirNames(root) {
120
+ return safeReaddirEntries(path.join(root, PROJECTS_DIRNAME))
121
+ .filter((e) => e.isDirectory())
122
+ .map((e) => e.name);
123
+ }
124
+ // ---------------------------------------------------------------------------
125
+ // Check (a) — junk-project-dirs
126
+ // ---------------------------------------------------------------------------
127
+ function checkJunkProjectDirs(projectNames) {
128
+ const out = [];
129
+ for (const name of projectNames) {
130
+ const isUuid = UUID_PREFIX_RE.test(name);
131
+ const isDotDot = DOT_DOT_RE.test(name);
132
+ const isLiteralJunk = JUNK_LITERAL_RE.test(name);
133
+ const isEpoch = EPOCH_SUFFIX_RE.test(name);
134
+ if (!isUuid && !isDotDot && !isLiteralJunk && !isEpoch)
135
+ continue;
136
+ const severity = isUuid || isDotDot ? "red" : "yellow";
137
+ const reasons = [
138
+ isUuid && "uuid-shaped name",
139
+ isDotDot && "path-traversal-shaped (contains '..')",
140
+ isLiteralJunk && "literal test/placeholder slug",
141
+ isEpoch && "epoch-timestamp-suffixed name",
142
+ ]
143
+ .filter((r) => Boolean(r))
144
+ .join(", ");
145
+ out.push(mkFinding("junk-project-dirs", severity, `${PROJECTS_DIRNAME}/${name}`, `${PROJECTS_DIRNAME}/${name}: ${reasons}`, "Likely a stray/test project directory, not real project data. Confirm with the owner before removing it — this scan never mutates the store and an agent must never auto-delete a project directory."));
146
+ }
147
+ return out;
148
+ }
149
+ // ---------------------------------------------------------------------------
150
+ // Check (b) — counter-accumulation (ONE aggregate finding, never per-file)
151
+ // ---------------------------------------------------------------------------
152
+ function checkCounterAccumulation(root) {
153
+ const n = safeReaddirNames(root).filter((f) => f.startsWith(COUNTER_PREFIX)).length;
154
+ if (n <= COUNTER_YELLOW_THRESHOLD)
155
+ return [];
156
+ const severity = n > COUNTER_RED_THRESHOLD ? "red" : "yellow";
157
+ return [
158
+ mkFinding("counter-accumulation", severity, `${COUNTER_PREFIX}*`, `${n} ${COUNTER_PREFIX}* file(s) at store root (thresholds: yellow>${COUNTER_YELLOW_THRESHOLD}, red>${COUNTER_RED_THRESHOLD})`, "These are per-session ambient-injection counters that accumulate forever with no automatic cleanup. Confirm with the owner before bulk-deleting files matching this exact prefix — never auto-delete from an agent."),
159
+ ];
160
+ }
161
+ // ---------------------------------------------------------------------------
162
+ // Check (c) — theme-epidemic
163
+ // ---------------------------------------------------------------------------
164
+ function checkThemeEpidemic(root, projectNames) {
165
+ const out = [];
166
+ for (const name of projectNames) {
167
+ const journalDirPath = path.join(root, PROJECTS_DIRNAME, name, "journal");
168
+ const files = safeReaddirNames(journalDirPath).filter((f) => f.endsWith(".md") && f !== "index.md");
169
+ if (files.length === 0)
170
+ continue;
171
+ const themeCounts = new Map();
172
+ let parseableCount = 0;
173
+ for (const f of files) {
174
+ let parsed;
175
+ try {
176
+ parsed = parseJournalFileName(f);
177
+ }
178
+ catch {
179
+ continue;
180
+ }
181
+ if (parsed.isLegacy)
182
+ continue; // only v2/current parseable names count
183
+ parseableCount++;
184
+ if (parsed.theme && parsed.theme !== "none") {
185
+ themeCounts.set(parsed.theme, (themeCounts.get(parsed.theme) ?? 0) + 1);
186
+ }
187
+ }
188
+ if (parseableCount < THEME_EPIDEMIC_MIN_FILES)
189
+ continue;
190
+ let topTheme = null;
191
+ let topCount = 0;
192
+ for (const [theme, count] of themeCounts) {
193
+ if (count > topCount) {
194
+ topTheme = theme;
195
+ topCount = count;
196
+ }
197
+ }
198
+ if (!topTheme)
199
+ continue;
200
+ const share = topCount / parseableCount;
201
+ if (share <= THEME_EPIDEMIC_SHARE)
202
+ continue;
203
+ out.push(mkFinding("theme-epidemic", "yellow", `${PROJECTS_DIRNAME}/${name}`, `theme="${topTheme}" in ${topCount}/${parseableCount} (${Math.round(share * 100)}%) of parseable journal filenames`, "One recurring theme dominates this project's journal — likely the same unresolved issue recurring across sessions. Surface it to the owner as a candidate for a durable correction/fix rather than more journal notes; never delete or merge journal files."));
204
+ }
205
+ return out;
206
+ }
207
+ // ---------------------------------------------------------------------------
208
+ // Check (d) — case-fold-forks (reuses paths.ts's listCaseVariantForks)
209
+ // ---------------------------------------------------------------------------
210
+ /**
211
+ * Pure mapping from case-variant fork groups (as returned by
212
+ * `listCaseVariantForks`) to HygieneFinding objects. Extracted for fs-free
213
+ * testability — real case-variant sibling directories cannot be fabricated on
214
+ * a case-insensitive-but-case-preserving filesystem (macOS APFS default: a
215
+ * second `mkdirSync("agentrecall")` silently collides with an existing
216
+ * "AgentRecall"). Same constraint documented on `pickProjectDirEntry` in
217
+ * paths.ts; same fix (test the pure mapping directly). Not part of the
218
+ * public core barrel — internal/test-only export.
219
+ */
220
+ export function caseFoldForksToFindings(forks) {
221
+ return forks.map((fork) => mkFinding("case-fold-forks", "red", `${PROJECTS_DIRNAME}/${fork.project}`, `${fork.variants.length} case-variant directories for one project: ${fork.variants.join(", ")} (diverges on case-sensitive filesystems)`, "These directories are the SAME project split by a case-fold mismatch. Merging requires combining journal/palace/corrections content by hand — confirm with the owner first; never auto-delete or auto-merge either directory."));
222
+ }
223
+ function checkCaseFoldForks(root) {
224
+ try {
225
+ return caseFoldForksToFindings(listCaseVariantForks(root));
226
+ }
227
+ catch {
228
+ return [];
229
+ }
230
+ }
231
+ // ---------------------------------------------------------------------------
232
+ // Check (e) — stale-derived-caches
233
+ // ---------------------------------------------------------------------------
234
+ function checkStaleDerivedCaches(root) {
235
+ const out = [];
236
+ const now = Date.now();
237
+ for (const entry of safeReaddirEntries(root)) {
238
+ if (!entry.isFile())
239
+ continue;
240
+ const name = entry.name;
241
+ if (name === HYGIENE_BASELINE_FILENAME)
242
+ continue;
243
+ const isCacheJson = /-cache\.json$/.test(name);
244
+ const isKnownDerived = name === "dashboard.json" || name === "scoreboard.json";
245
+ if (!isCacheJson && !isKnownDerived)
246
+ continue;
247
+ let mtimeMs;
248
+ try {
249
+ mtimeMs = fs.statSync(path.join(root, name)).mtimeMs;
250
+ }
251
+ catch {
252
+ continue;
253
+ }
254
+ const ageMs = now - mtimeMs;
255
+ if (ageMs <= STALE_CACHE_AGE_MS)
256
+ continue;
257
+ out.push(mkFinding("stale-derived-caches", "yellow", name, `${name} is ${Math.round(ageMs / (24 * 60 * 60 * 1000))}d old (derived cache — regeneratable from the store)`, "This is a DERIVED cache file, not source data — it is safe to delete or let its producer overwrite it. Confirm with the owner before deleting; never auto-delete from an agent without confirmation."));
258
+ }
259
+ return out;
260
+ }
261
+ // ---------------------------------------------------------------------------
262
+ // Check (f) — root-secret-patterns
263
+ // ---------------------------------------------------------------------------
264
+ function checkRootSecretPatterns(root) {
265
+ const out = [];
266
+ for (const entry of safeReaddirEntries(root)) {
267
+ if (!entry.isFile())
268
+ continue;
269
+ if (!entry.name.endsWith(".json"))
270
+ continue;
271
+ if (entry.name === HYGIENE_BASELINE_FILENAME)
272
+ continue;
273
+ let content;
274
+ try {
275
+ content = fs.readFileSync(path.join(root, entry.name), "utf-8");
276
+ }
277
+ catch {
278
+ continue;
279
+ }
280
+ const lines = content.split(/\r?\n/);
281
+ for (let i = 0; i < lines.length; i++) {
282
+ const line = lines[i];
283
+ for (const pattern of SECRET_PATTERNS) {
284
+ if (!pattern.regex.test(line))
285
+ continue;
286
+ const lineNo = i + 1;
287
+ out.push(mkFinding("root-secret-patterns", "red", `${entry.name}#L${lineNo}`,
288
+ // Evidence is file + pattern NAME + line number ONLY — NEVER the
289
+ // matched secret text itself.
290
+ `${entry.name}: pattern=${pattern.name}, line=${lineNo}`, "A credential-shaped string was found in a root-level store file. NEVER echo, log, or paste the matched value anywhere. Confirm with the owner and rotate the credential immediately, then move it out of this file (env var / secret manager)."));
291
+ break; // one finding per matching line — avoid double-reporting the
292
+ // same secret under two overlapping pattern names (e.g. sk-proj- is
293
+ // also a valid match of the generic openai-or-anthropic-sk pattern).
294
+ }
295
+ }
296
+ }
297
+ return out;
298
+ }
299
+ // ---------------------------------------------------------------------------
300
+ // Check (g) — missing-corrections-index
301
+ // ---------------------------------------------------------------------------
302
+ function checkMissingCorrectionsIndex(root, projectNames) {
303
+ const out = [];
304
+ for (const name of projectNames) {
305
+ const correctionsDirPath = path.join(root, PROJECTS_DIRNAME, name, "corrections");
306
+ const jsonCount = safeReaddirNames(correctionsDirPath).filter((f) => f.endsWith(".json") && !f.startsWith("_")).length;
307
+ if (jsonCount < 1)
308
+ continue;
309
+ if (fs.existsSync(path.join(correctionsDirPath, "_index.md")))
310
+ continue;
311
+ out.push(mkFinding("missing-corrections-index", "yellow", `${PROJECTS_DIRNAME}/${name}/corrections`, `${jsonCount} correction record(s) but no _index.md`, "Regenerate the materialized index by writing (or retracting) any correction for this project — regenerateCorrectionsIndex() runs automatically on every corrections mutation. No manual file edit is needed or advised."));
312
+ }
313
+ return out;
314
+ }
315
+ // ---------------------------------------------------------------------------
316
+ // Check (h) — reserved-word-slugs
317
+ // ---------------------------------------------------------------------------
318
+ function checkReservedWordSlugs(projectNames) {
319
+ const out = [];
320
+ for (const name of projectNames) {
321
+ if (!RESERVED_SLUGS.has(name.toLowerCase()))
322
+ continue;
323
+ out.push(mkFinding("reserved-word-slugs", "red", `${PROJECTS_DIRNAME}/${name}`, `${PROJECTS_DIRNAME}/${name} collides with a reserved internal directory name (${[...RESERVED_SLUGS].join("/")})`, "A project slug that shadows a reserved internal name can corrupt path resolution for every project. Confirm with the owner and migrate this project to a different slug — never auto-rename or auto-delete."));
324
+ }
325
+ return out;
326
+ }
327
+ // ---------------------------------------------------------------------------
328
+ // Rollup + public entry point
329
+ // ---------------------------------------------------------------------------
330
+ function rollupGrade(findings) {
331
+ let grade = "clean";
332
+ for (const f of findings) {
333
+ if (f.severity === "red")
334
+ return "red";
335
+ if (f.severity === "yellow")
336
+ grade = "yellow";
337
+ }
338
+ return grade;
339
+ }
340
+ /**
341
+ * Run every hygiene check against `root`. READ-ONLY: never writes, never
342
+ * mkdirs, never renames, never acquires a lock. Each check is independently
343
+ * try/caught — one failing check degrades to zero findings for that check,
344
+ * never throws out of the scan as a whole.
345
+ */
346
+ export function runHygieneScan(root) {
347
+ const counts = {};
348
+ for (const name of CHECK_NAMES)
349
+ counts[name] = 0;
350
+ const findings = [];
351
+ const projectNames = listProjectDirNames(root);
352
+ const runners = [
353
+ ["junk-project-dirs", () => checkJunkProjectDirs(projectNames)],
354
+ ["counter-accumulation", () => checkCounterAccumulation(root)],
355
+ ["theme-epidemic", () => checkThemeEpidemic(root, projectNames)],
356
+ ["case-fold-forks", () => checkCaseFoldForks(root)],
357
+ ["stale-derived-caches", () => checkStaleDerivedCaches(root)],
358
+ ["root-secret-patterns", () => checkRootSecretPatterns(root)],
359
+ ["missing-corrections-index", () => checkMissingCorrectionsIndex(root, projectNames)],
360
+ ["reserved-word-slugs", () => checkReservedWordSlugs(projectNames)],
361
+ ];
362
+ for (const [name, run] of runners) {
363
+ try {
364
+ const results = run();
365
+ counts[name] = results.length;
366
+ findings.push(...results);
367
+ }
368
+ catch {
369
+ // One failing check must never kill the whole scan.
370
+ counts[name] = 0;
371
+ }
372
+ }
373
+ return { findings, grade: rollupGrade(findings), counts };
374
+ }
375
+ // ---------------------------------------------------------------------------
376
+ // Baseline (separate from the pure scan — the ONLY write path in this file)
377
+ // ---------------------------------------------------------------------------
378
+ function readBaselineSafe(baselinePath) {
379
+ try {
380
+ if (!fs.existsSync(baselinePath))
381
+ return null;
382
+ const parsed = JSON.parse(fs.readFileSync(baselinePath, "utf-8"));
383
+ if (!parsed || !Array.isArray(parsed.stable_ids))
384
+ return null;
385
+ return parsed;
386
+ }
387
+ catch {
388
+ return null;
389
+ }
390
+ }
391
+ /**
392
+ * Partition `findings` into `fresh` (stable_id NOT in the baseline) and
393
+ * `known` (stable_id IS in the baseline). READ-ONLY — only reads the
394
+ * baseline file; never writes it. Missing/malformed baseline degrades to
395
+ * "everything is fresh" (the honest first-run state).
396
+ */
397
+ export function applyBaseline(findings, baselinePath) {
398
+ const baseline = readBaselineSafe(baselinePath);
399
+ const knownIds = new Set(baseline?.stable_ids ?? []);
400
+ const fresh = [];
401
+ const known = [];
402
+ for (const f of findings) {
403
+ (knownIds.has(f.stable_id) ? known : fresh).push(f);
404
+ }
405
+ return { fresh, known };
406
+ }
407
+ /**
408
+ * Snapshot every current finding's stable_id into the baseline file. This is
409
+ * the ONLY write this module ever performs, and it only happens when a
410
+ * caller explicitly invokes this function (CLI: `ar hygiene --baseline-update`).
411
+ * Atomic (tmp + rename), mode 0600.
412
+ */
413
+ export function updateBaseline(findings, baselinePath) {
414
+ const stable_ids = Array.from(new Set(findings.map((f) => f.stable_id))).sort();
415
+ const baseline = { created_at: new Date().toISOString(), stable_ids };
416
+ ensureDir(path.dirname(baselinePath));
417
+ const tmp = `${baselinePath}.tmp.${process.pid}.${Date.now()}`;
418
+ fs.writeFileSync(tmp, JSON.stringify(baseline, null, 2), { encoding: "utf-8", mode: 0o600 });
419
+ fs.renameSync(tmp, baselinePath);
420
+ return baseline;
421
+ }
422
+ //# sourceMappingURL=hygiene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hygiene.js","sourceRoot":"","sources":["../../src/storage/hygiene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAyDzE,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,wEAAwE;AACxE,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,mBAAmB;IACnB,sBAAsB;IACtB,gBAAgB;IAChB,iBAAiB;IACjB,sBAAsB;IACtB,sBAAsB;IACtB,2BAA2B;IAC3B,qBAAqB;CACb,CAAC;AAEX,wBAAwB;AACxB,MAAM,cAAc,GAAG,4BAA4B,CAAC;AACpD,MAAM,UAAU,GAAG,MAAM,CAA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,CAAC,YAAY,CAAC,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,GAAG,YAAY,QAAQ,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IAC/D,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7F,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACjC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"memory-protocol.d.ts","sourceRoot":"","sources":["../../src/storage/memory-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuEH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW3D"}
1
+ {"version":3,"file":"memory-protocol.d.ts","sourceRoot":"","sources":["../../src/storage/memory-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA0EH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW3D"}
@@ -59,7 +59,10 @@ lossless archive instead of answering thinly (the bridge).
59
59
  Raw dumps are queued for compression, never compressed inside the Stop turn:
60
60
 
61
61
  \`\`\`
62
- ~/.agent-recall/.consolidation-queue/<date>.jsonl ← one JSON job per line
62
+ ../../.consolidation-queue/<date>.jsonl ← one JSON job per line, relative
63
+ to this file (../.. = the store
64
+ root, two levels up from
65
+ projects/<slug>/)
63
66
  \`\`\`
64
67
 
65
68
  A job looks like \`{ "project", "sessionId", "reason", "at", "done"? }\`.
@@ -1 +1 @@
1
- {"version":3,"file":"memory-protocol.js","sourceRoot":"","sources":["../../src/storage/memory-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;G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AS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAE/C,4EAA4E;AAC5E,oEAAoE;AACpE,2EAA2E;AAC3E,8DAA8D;AAC9D,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,aAAa;QACnD,SAAS,CAAC,GAAG,CAAC,CAAC;QACf,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * store-manifest.ts — the store-ROOT self-description (sibling of
3
+ * memory-protocol.ts, one level up). Writes a `MANIFEST.md` at the top of the
4
+ * AgentRecall store (default `~/.agent-recall`, or `AGENT_RECALL_ROOT`) so a
5
+ * cold agent with ONLY filesystem access — no AgentRecall code, no MCP, a
6
+ * bare copy of the directory dropped into a VM — can orient itself.
7
+ *
8
+ * Design rationale (2026-07-27 round table): `MEMORY-PROTOCOL.md` (see
9
+ * memory-protocol.ts) explains ONE project's folder layout, but nothing
10
+ * explains the STORE itself — which of the many `projects/<slug>/`
11
+ * directories are canonical vs. throwaway test junk, which root files are
12
+ * pinned source-of-truth vs. regenerable caches, that `_index.md` files are
13
+ * machine indexes and not memory entries, or that a naming grammar exists at
14
+ * all. That knowledge lived only in this code repo's docs — invisible from
15
+ * the data directory alone. This file closes that gap.
16
+ *
17
+ * Same write-once contract as memory-protocol.ts: written ONCE, never
18
+ * overwrites an existing MANIFEST.md (a user may hand-edit it), and every
19
+ * path inside the generated body is store-root-RELATIVE — never `~` or a
20
+ * machine-absolute path, so the body stays valid after the store is copied
21
+ * to a different machine or home directory.
22
+ */
23
+ /**
24
+ * Write the store-root MANIFEST.md if it is absent (write-once). Mirrors
25
+ * writeMemoryProtocol's contract exactly: best-effort, never throws — returns
26
+ * the path (written or pre-existing) or an empty string on failure. `root` is
27
+ * the store root (typically the caller's `getRoot()`), passed explicitly so
28
+ * this function stays fs-root-agnostic and testable against a temp directory.
29
+ */
30
+ export declare function ensureStoreManifest(root: string): string;
31
+ //# sourceMappingURL=store-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-manifest.d.ts","sourceRoot":"","sources":["../../src/storage/store-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAsEH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUxD"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * store-manifest.ts — the store-ROOT self-description (sibling of
3
+ * memory-protocol.ts, one level up). Writes a `MANIFEST.md` at the top of the
4
+ * AgentRecall store (default `~/.agent-recall`, or `AGENT_RECALL_ROOT`) so a
5
+ * cold agent with ONLY filesystem access — no AgentRecall code, no MCP, a
6
+ * bare copy of the directory dropped into a VM — can orient itself.
7
+ *
8
+ * Design rationale (2026-07-27 round table): `MEMORY-PROTOCOL.md` (see
9
+ * memory-protocol.ts) explains ONE project's folder layout, but nothing
10
+ * explains the STORE itself — which of the many `projects/<slug>/`
11
+ * directories are canonical vs. throwaway test junk, which root files are
12
+ * pinned source-of-truth vs. regenerable caches, that `_index.md` files are
13
+ * machine indexes and not memory entries, or that a naming grammar exists at
14
+ * all. That knowledge lived only in this code repo's docs — invisible from
15
+ * the data directory alone. This file closes that gap.
16
+ *
17
+ * Same write-once contract as memory-protocol.ts: written ONCE, never
18
+ * overwrites an existing MANIFEST.md (a user may hand-edit it), and every
19
+ * path inside the generated body is store-root-RELATIVE — never `~` or a
20
+ * machine-absolute path, so the body stays valid after the store is copied
21
+ * to a different machine or home directory.
22
+ */
23
+ import * as fs from "node:fs";
24
+ import * as path from "node:path";
25
+ import { ensureDir } from "./fs-utils.js";
26
+ import { VERSION } from "../types.js";
27
+ const MANIFEST_FILENAME = "MANIFEST.md";
28
+ function buildManifestBody() {
29
+ return `---
30
+ manifest_version: 1
31
+ generated_by: agent-recall-core@${VERSION}
32
+ ---
33
+
34
+ # AgentRecall — Store Manifest
35
+
36
+ > This directory is a portable agent memory store. Restore = copy the
37
+ > directory to any machine and point the \`AGENT_RECALL_ROOT\` environment
38
+ > variable at the copy (defaults to a dot-directory under the current
39
+ > user's home when unset) — no database, no server, no other state
40
+ > required.
41
+
42
+ ## Orientation (cold-agent read order)
43
+
44
+ 1. \`status.md\` — current cross-project status board.
45
+ 2. \`projects/<slug>/MEMORY-PROTOCOL.md\` — the per-project self-describing
46
+ protocol (folder layout, read/write rules) for the project you're in.
47
+ 3. Per-store \`_index.md\` files inside that project (e.g.
48
+ \`palace/rooms/_index.md\`, \`corrections/_index.md\`, \`journal/_index.md\`)
49
+ — machine fast-path summaries, regenerated on every write.
50
+ 4. File bodies — open these only when the index above is not confident
51
+ enough to answer.
52
+
53
+ ## \`projects/\` convention
54
+
55
+ One directory per project, under \`projects/<slug>/\`. Inside any store
56
+ directory, a file whose name starts with \`_\` (e.g. \`_index.md\`) is a
57
+ regenerated INDEX, not a memory entry: never recall it as content, and never
58
+ hand-edit it — the next write to that store overwrites it wholesale.
59
+
60
+ ## File classification (root-relative)
61
+
62
+ | class | meaning | examples |
63
+ |---|---|---|
64
+ | sync | pinned, source-of-truth; safe and intended to sync elsewhere | \`status.md\`, \`awareness.md\`, \`ARCHITECTURE.md\`, \`projects/**\` |
65
+ | never-sync | secrets or machine-local locks; must never leave this machine or be echoed anywhere | \`config.json\` (contains credentials — do not read or print it), \`*.lock\`, \`.hook-*-lock\`, \`tmp/\` |
66
+ | regenerable | derived caches; safe to delete, rebuilt automatically on next use | \`dashboard.json\`, \`dashboard.html\`, \`dashboard-legacy.html\`, \`scoreboard.json\`, \`feedback-log.json\`, \`insights-index.json\`, \`arstatus-cache.json\`, \`awareness-archive.json\`, \`awareness-state.json\`, \`static/\`, \`.ambient-counter-*\`, \`.consolidation-queue/\` |
67
+
68
+ When restoring or mirroring this store: copy \`sync\` plus everything under
69
+ \`projects/\`; skip \`never-sync\` (rotate credentials instead of copying
70
+ them — never move \`config.json\` between machines); let \`regenerable\`
71
+ rebuild itself on next use.
72
+
73
+ ## Naming grammar (condensed self-contained summary)
74
+
75
+ - \`--\` is the FIELD delimiter; a plain \`-\` only ever appears INSIDE a field.
76
+ - journal: \`{date}--{saveType}--[{sig}]--[{theme}]--{slug}.md\` (null
77
+ \`sig\`/\`theme\` are omitted, never printed as literal "none").
78
+ - corrections: \`{date}--{rule-slug}.json\`.
79
+ - palace rooms: \`{topic-slug}.md\` — one file per topic, with dated
80
+ \`### {date}\` blocks appended inside; NOT one file per entry.
81
+ - palace pipeline: \`{NNNN}--{phase-slug}.md\`.
82
+ - palace skills: \`{topic}--{slug}.md\` (topical, no date — reference store).
83
+ - awareness / insights: \`{date}--{slug}.md\`.
84
+ - Mutable state (severity escalation, retraction, supersession) lives ONLY
85
+ in a store's \`_index.md\` and the file body — NEVER encoded in a path.
86
+ `;
87
+ }
88
+ /**
89
+ * Write the store-root MANIFEST.md if it is absent (write-once). Mirrors
90
+ * writeMemoryProtocol's contract exactly: best-effort, never throws — returns
91
+ * the path (written or pre-existing) or an empty string on failure. `root` is
92
+ * the store root (typically the caller's `getRoot()`), passed explicitly so
93
+ * this function stays fs-root-agnostic and testable against a temp directory.
94
+ */
95
+ export function ensureStoreManifest(root) {
96
+ try {
97
+ const dest = path.join(root, MANIFEST_FILENAME);
98
+ if (fs.existsSync(dest))
99
+ return dest; // write-once — never overwrite a user edit
100
+ ensureDir(root);
101
+ fs.writeFileSync(dest, buildManifestBody(), "utf-8");
102
+ return dest;
103
+ }
104
+ catch {
105
+ return "";
106
+ }
107
+ }
108
+ //# sourceMappingURL=store-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-manifest.js","sourceRoot":"","sources":["../../src/storage/store-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC,SAAS,iBAAiB;IACxB,OAAO;;kCAEyB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDxC,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAChD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,2CAA2C;QACjF,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -9,10 +9,20 @@
9
9
  * spawned per-call agent). Reuses the exported tokenize/overlap grammar from
10
10
  * check-action (Wave 4) — does NOT fork it.
11
11
  */
12
+ import { type CorrectionRecord } from "../storage/corrections.js";
12
13
  export interface PredictCorrectionInput {
13
14
  /** The plan / action / goal text to evaluate. */
14
15
  plan: string;
15
16
  project?: string;
17
+ /**
18
+ * PERF (2026-07-27) — optional active corrections already loaded by the
19
+ * caller (e.g. session_start read the corrections directory once and
20
+ * derived this via readActiveCorrections(slug, allCorrections)). When
21
+ * provided, predictCorrection (and its lazy recomputeBlindSpots fallback)
22
+ * skip their own directory scan and use this array verbatim instead.
23
+ * Omitting it preserves the original behavior exactly.
24
+ */
25
+ preloadedCorrections?: CorrectionRecord[];
16
26
  }
17
27
  export interface PredictedRisk {
18
28
  /** The tendency this plan resembles. */
@@ -1 +1 @@
1
- {"version":3,"file":"predict-correction.d.ts","sourceRoot":"","sources":["../../src/tools-logic/predict-correction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,MAAM,WAAW,sBAAsB;IACrC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,gCAAgC;IAChC,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,oEAAoE;IACpE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oEAAoE;IACpE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAID;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,MAAgC,CAAC;AAyBhE,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAgGlC"}
1
+ {"version":3,"file":"predict-correction.d.ts","sourceRoot":"","sources":["../../src/tools-logic/predict-correction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAwC,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGxG,MAAM,WAAW,sBAAsB;IACrC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,gCAAgC;IAChC,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,oEAAoE;IACpE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oEAAoE;IACpE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAID;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,MAAgC,CAAC;AAyBhE,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAoGlC"}