agent-recall-core 3.4.30 → 3.4.35
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 +121 -441
- package/dist/digest/store.d.ts.map +1 -1
- package/dist/digest/store.js +4 -3
- package/dist/digest/store.js.map +1 -1
- package/dist/display/board-render.d.ts +61 -0
- package/dist/display/board-render.d.ts.map +1 -0
- package/dist/display/board-render.js +223 -0
- package/dist/display/board-render.js.map +1 -0
- package/dist/helpers/alignment-patterns.d.ts +10 -0
- package/dist/helpers/alignment-patterns.d.ts.map +1 -1
- package/dist/helpers/alignment-patterns.js +5 -1
- package/dist/helpers/alignment-patterns.js.map +1 -1
- package/dist/helpers/blind-spots.d.ts +86 -0
- package/dist/helpers/blind-spots.d.ts.map +1 -0
- package/dist/helpers/blind-spots.js +205 -0
- package/dist/helpers/blind-spots.js.map +1 -0
- package/dist/helpers/conflict-scan.d.ts +10 -0
- package/dist/helpers/conflict-scan.d.ts.map +1 -1
- package/dist/helpers/conflict-scan.js +3 -3
- package/dist/helpers/conflict-scan.js.map +1 -1
- package/dist/helpers/semantic-match.d.ts +82 -0
- package/dist/helpers/semantic-match.d.ts.map +1 -0
- package/dist/helpers/semantic-match.js +229 -0
- package/dist/helpers/semantic-match.js.map +1 -0
- package/dist/index.d.ts +52 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -9
- package/dist/index.js.map +1 -1
- package/dist/palace/awareness.d.ts +30 -0
- package/dist/palace/awareness.d.ts.map +1 -1
- package/dist/palace/awareness.js +65 -2
- package/dist/palace/awareness.js.map +1 -1
- package/dist/palace/consolidate.d.ts.map +1 -1
- package/dist/palace/consolidate.js +17 -0
- package/dist/palace/consolidate.js.map +1 -1
- package/dist/palace/decay-pass.d.ts +46 -0
- package/dist/palace/decay-pass.d.ts.map +1 -0
- package/dist/palace/decay-pass.js +87 -0
- package/dist/palace/decay-pass.js.map +1 -0
- package/dist/palace/insights-index.d.ts.map +1 -1
- package/dist/palace/insights-index.js +4 -2
- package/dist/palace/insights-index.js.map +1 -1
- package/dist/palace/skills.d.ts +41 -2
- package/dist/palace/skills.d.ts.map +1 -1
- package/dist/palace/skills.js +106 -4
- package/dist/palace/skills.js.map +1 -1
- package/dist/prompts/consolidation-prompt.d.ts +25 -0
- package/dist/prompts/consolidation-prompt.d.ts.map +1 -0
- package/dist/prompts/consolidation-prompt.js +91 -0
- package/dist/prompts/consolidation-prompt.js.map +1 -0
- package/dist/storage/archive-prune.d.ts +56 -0
- package/dist/storage/archive-prune.d.ts.map +1 -0
- package/dist/storage/archive-prune.js +118 -0
- package/dist/storage/archive-prune.js.map +1 -0
- package/dist/storage/archive-write.d.ts +38 -0
- package/dist/storage/archive-write.d.ts.map +1 -0
- package/dist/storage/archive-write.js +98 -0
- package/dist/storage/archive-write.js.map +1 -0
- package/dist/storage/blind-spots-store.d.ts +30 -0
- package/dist/storage/blind-spots-store.d.ts.map +1 -0
- package/dist/storage/blind-spots-store.js +91 -0
- package/dist/storage/blind-spots-store.js.map +1 -0
- package/dist/storage/capture-router.d.ts +60 -0
- package/dist/storage/capture-router.d.ts.map +1 -0
- package/dist/storage/capture-router.js +133 -0
- package/dist/storage/capture-router.js.map +1 -0
- package/dist/storage/classification.d.ts +32 -0
- package/dist/storage/classification.d.ts.map +1 -0
- package/dist/storage/classification.js +74 -0
- package/dist/storage/classification.js.map +1 -0
- package/dist/storage/consolidation-queue.d.ts +39 -0
- package/dist/storage/consolidation-queue.d.ts.map +1 -0
- package/dist/storage/consolidation-queue.js +120 -0
- package/dist/storage/consolidation-queue.js.map +1 -0
- package/dist/storage/content-guard.d.ts +74 -0
- package/dist/storage/content-guard.d.ts.map +1 -0
- package/dist/storage/content-guard.js +179 -0
- package/dist/storage/content-guard.js.map +1 -0
- package/dist/storage/corrections.d.ts +246 -21
- package/dist/storage/corrections.d.ts.map +1 -1
- package/dist/storage/corrections.js +605 -56
- package/dist/storage/corrections.js.map +1 -1
- package/dist/storage/durable-intent.d.ts +49 -0
- package/dist/storage/durable-intent.d.ts.map +1 -0
- package/dist/storage/durable-intent.js +124 -0
- package/dist/storage/durable-intent.js.map +1 -0
- package/dist/storage/filelock.d.ts +6 -0
- package/dist/storage/filelock.d.ts.map +1 -1
- package/dist/storage/filelock.js +6 -1
- package/dist/storage/filelock.js.map +1 -1
- package/dist/storage/memory-protocol.d.ts +19 -0
- package/dist/storage/memory-protocol.d.ts.map +1 -0
- package/dist/storage/memory-protocol.js +101 -0
- package/dist/storage/memory-protocol.js.map +1 -0
- package/dist/storage/paths.d.ts +23 -0
- package/dist/storage/paths.d.ts.map +1 -1
- package/dist/storage/paths.js +39 -0
- package/dist/storage/paths.js.map +1 -1
- package/dist/storage/retention.d.ts +23 -0
- package/dist/storage/retention.d.ts.map +1 -0
- package/dist/storage/retention.js +48 -0
- package/dist/storage/retention.js.map +1 -0
- package/dist/storage/session.d.ts +2 -2
- package/dist/storage/session.d.ts.map +1 -1
- package/dist/storage/session.js +11 -1
- package/dist/storage/session.js.map +1 -1
- package/dist/supabase/config.d.ts +8 -0
- package/dist/supabase/config.d.ts.map +1 -1
- package/dist/supabase/config.js +5 -0
- package/dist/supabase/config.js.map +1 -1
- package/dist/supabase/recall-backend.d.ts +1 -0
- package/dist/supabase/recall-backend.d.ts.map +1 -1
- package/dist/supabase/recall-backend.js +13 -13
- package/dist/supabase/recall-backend.js.map +1 -1
- package/dist/supabase/sync.d.ts.map +1 -1
- package/dist/supabase/sync.js +30 -3
- package/dist/supabase/sync.js.map +1 -1
- package/dist/tools-logic/bootstrap.d.ts +15 -0
- package/dist/tools-logic/bootstrap.d.ts.map +1 -1
- package/dist/tools-logic/bootstrap.js +238 -47
- package/dist/tools-logic/bootstrap.js.map +1 -1
- package/dist/tools-logic/brief.d.ts +84 -0
- package/dist/tools-logic/brief.d.ts.map +1 -0
- package/dist/tools-logic/brief.js +193 -0
- package/dist/tools-logic/brief.js.map +1 -0
- package/dist/tools-logic/check-action.d.ts +9 -0
- package/dist/tools-logic/check-action.d.ts.map +1 -1
- package/dist/tools-logic/check-action.js +31 -2
- package/dist/tools-logic/check-action.js.map +1 -1
- package/dist/tools-logic/check.d.ts +7 -0
- package/dist/tools-logic/check.d.ts.map +1 -1
- package/dist/tools-logic/check.js +24 -2
- package/dist/tools-logic/check.js.map +1 -1
- package/dist/tools-logic/confidence.d.ts +50 -0
- package/dist/tools-logic/confidence.d.ts.map +1 -0
- package/dist/tools-logic/confidence.js +70 -0
- package/dist/tools-logic/confidence.js.map +1 -0
- package/dist/tools-logic/drill-down.d.ts +37 -0
- package/dist/tools-logic/drill-down.d.ts.map +1 -0
- package/dist/tools-logic/drill-down.js +63 -0
- package/dist/tools-logic/drill-down.js.map +1 -0
- package/dist/tools-logic/export-corrections.d.ts +63 -0
- package/dist/tools-logic/export-corrections.d.ts.map +1 -0
- package/dist/tools-logic/export-corrections.js +124 -0
- package/dist/tools-logic/export-corrections.js.map +1 -0
- package/dist/tools-logic/journal-capture.d.ts.map +1 -1
- package/dist/tools-logic/journal-capture.js +4 -1
- package/dist/tools-logic/journal-capture.js.map +1 -1
- package/dist/tools-logic/journal-write.d.ts.map +1 -1
- package/dist/tools-logic/journal-write.js +3 -2
- package/dist/tools-logic/journal-write.js.map +1 -1
- package/dist/tools-logic/memory-query.d.ts +10 -3
- package/dist/tools-logic/memory-query.d.ts.map +1 -1
- package/dist/tools-logic/memory-query.js +31 -7
- package/dist/tools-logic/memory-query.js.map +1 -1
- package/dist/tools-logic/mirror-builder.d.ts +115 -0
- package/dist/tools-logic/mirror-builder.d.ts.map +1 -0
- package/dist/tools-logic/mirror-builder.js +348 -0
- package/dist/tools-logic/mirror-builder.js.map +1 -0
- package/dist/tools-logic/palace-write.d.ts.map +1 -1
- package/dist/tools-logic/palace-write.js +3 -2
- package/dist/tools-logic/palace-write.js.map +1 -1
- package/dist/tools-logic/pipeline-close.d.ts.map +1 -1
- package/dist/tools-logic/pipeline-close.js +2 -1
- package/dist/tools-logic/pipeline-close.js.map +1 -1
- package/dist/tools-logic/pipeline-open.d.ts.map +1 -1
- package/dist/tools-logic/pipeline-open.js +2 -1
- package/dist/tools-logic/pipeline-open.js.map +1 -1
- package/dist/tools-logic/predict-correction.d.ts +47 -0
- package/dist/tools-logic/predict-correction.d.ts.map +1 -0
- package/dist/tools-logic/predict-correction.js +137 -0
- package/dist/tools-logic/predict-correction.js.map +1 -0
- package/dist/tools-logic/prior-builder.d.ts +27 -0
- package/dist/tools-logic/prior-builder.d.ts.map +1 -0
- package/dist/tools-logic/prior-builder.js +57 -0
- package/dist/tools-logic/prior-builder.js.map +1 -0
- package/dist/tools-logic/recognition-builder.d.ts +116 -0
- package/dist/tools-logic/recognition-builder.d.ts.map +1 -0
- package/dist/tools-logic/recognition-builder.js +289 -0
- package/dist/tools-logic/recognition-builder.js.map +1 -0
- package/dist/tools-logic/safety-consolidation.d.ts +104 -0
- package/dist/tools-logic/safety-consolidation.d.ts.map +1 -0
- package/dist/tools-logic/safety-consolidation.js +256 -0
- package/dist/tools-logic/safety-consolidation.js.map +1 -0
- package/dist/tools-logic/session-end-reflect.d.ts +18 -0
- package/dist/tools-logic/session-end-reflect.d.ts.map +1 -1
- package/dist/tools-logic/session-end-reflect.js +68 -29
- package/dist/tools-logic/session-end-reflect.js.map +1 -1
- package/dist/tools-logic/session-end.d.ts +9 -0
- package/dist/tools-logic/session-end.d.ts.map +1 -1
- package/dist/tools-logic/session-end.js +111 -13
- package/dist/tools-logic/session-end.js.map +1 -1
- package/dist/tools-logic/session-start-lite.d.ts +2 -0
- package/dist/tools-logic/session-start-lite.d.ts.map +1 -1
- package/dist/tools-logic/session-start-lite.js +10 -0
- package/dist/tools-logic/session-start-lite.js.map +1 -1
- package/dist/tools-logic/session-start.d.ts +46 -0
- package/dist/tools-logic/session-start.d.ts.map +1 -1
- package/dist/tools-logic/session-start.js +96 -3
- package/dist/tools-logic/session-start.js.map +1 -1
- package/dist/tools-logic/skill-propose.d.ts +27 -0
- package/dist/tools-logic/skill-propose.d.ts.map +1 -0
- package/dist/tools-logic/skill-propose.js +66 -0
- package/dist/tools-logic/skill-propose.js.map +1 -0
- package/dist/tools-logic/skill-recall.d.ts +5 -0
- package/dist/tools-logic/skill-recall.d.ts.map +1 -1
- package/dist/tools-logic/skill-recall.js +14 -1
- package/dist/tools-logic/skill-recall.js.map +1 -1
- package/dist/tools-logic/smart-recall.d.ts +17 -0
- package/dist/tools-logic/smart-recall.d.ts.map +1 -1
- package/dist/tools-logic/smart-recall.js +51 -16
- package/dist/tools-logic/smart-recall.js.map +1 -1
- package/dist/tools-logic/store-doctor.d.ts +71 -0
- package/dist/tools-logic/store-doctor.d.ts.map +1 -0
- package/dist/tools-logic/store-doctor.js +387 -0
- package/dist/tools-logic/store-doctor.js.map +1 -0
- package/dist/tools-logic/store-repair.d.ts +64 -0
- package/dist/tools-logic/store-repair.d.ts.map +1 -0
- package/dist/tools-logic/store-repair.js +243 -0
- package/dist/tools-logic/store-repair.js.map +1 -0
- package/dist/tools-logic/supersession.d.ts +34 -0
- package/dist/tools-logic/supersession.d.ts.map +1 -0
- package/dist/tools-logic/supersession.js +103 -0
- package/dist/tools-logic/supersession.js.map +1 -0
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/vector/local-vector-backend.d.ts.map +1 -1
- package/dist/vector/local-vector-backend.js +14 -17
- package/dist/vector/local-vector-backend.js.map +1 -1
- package/package.json +9 -1
- package/dist/relevance/injector.d.ts +0 -51
- package/dist/relevance/injector.d.ts.map +0 -1
- package/dist/relevance/injector.js +0 -121
- package/dist/relevance/injector.js.map +0 -1
- package/dist/relevance/precision.d.ts +0 -109
- package/dist/relevance/precision.d.ts.map +0 -1
- package/dist/relevance/precision.js +0 -279
- package/dist/relevance/precision.js.map +0 -1
- package/dist/relevance/promoter.d.ts +0 -60
- package/dist/relevance/promoter.d.ts.map +0 -1
- package/dist/relevance/promoter.js +0 -336
- package/dist/relevance/promoter.js.map +0 -1
- package/dist/relevance/stager.d.ts +0 -61
- package/dist/relevance/stager.d.ts.map +0 -1
- package/dist/relevance/stager.js +0 -251
- package/dist/relevance/stager.js.map +0 -1
- package/dist/relevance/surfacer.d.ts +0 -34
- package/dist/relevance/surfacer.d.ts.map +0 -1
- package/dist/relevance/surfacer.js +0 -333
- package/dist/relevance/surfacer.js.map +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* safety-consolidation.ts — the LOGIN-FREE, LLM-FREE background safety pass.
|
|
3
|
+
*
|
|
4
|
+
* The operator's #1 priority: the three maintenance steps that keep memory
|
|
5
|
+
* healthy (FSRS/salience decay, raw-archive retention, candidate graduation)
|
|
6
|
+
* must run AUTOMATICALLY and WITHOUT a Claude login or any OPENAI_API_KEY.
|
|
7
|
+
*
|
|
8
|
+
* Before this module those steps only fired when the un-cron'd overnight
|
|
9
|
+
* dreaming agent drained the async queue (`ar consolidate-async`), which fails
|
|
10
|
+
* often — so decay rarely ran, pruneRawArchive had ZERO callers (the archive
|
|
11
|
+
* grew unbounded), and crystallization candidates never graduated.
|
|
12
|
+
*
|
|
13
|
+
* This pass wires the EXISTING, already-headless primitives together:
|
|
14
|
+
* (a) decay → consolidateJournalToPalace (runs runDecayPass + markKeystones
|
|
15
|
+
* internally; pure regex/fs, no LLM)
|
|
16
|
+
* (b) prune → pruneRawArchive (the dead retention pass), gated by the
|
|
17
|
+
* `.consumed.json` marker which this pass advances by the
|
|
18
|
+
* deterministic "older than the retention window ⇒ distilled"
|
|
19
|
+
* rule (monotonic ⇒ idempotent)
|
|
20
|
+
* (c) graduate → findCrystallizationCandidates + a DETERMINISTIC threshold
|
|
21
|
+
* rule that re-titles the strongest member `CRYSTALLIZED: …`.
|
|
22
|
+
* No LLM-authored summary — that stays the optional dreaming
|
|
23
|
+
* path. Idempotent because findCrystallizationCandidates
|
|
24
|
+
* excludes already-CRYSTALLIZED titles.
|
|
25
|
+
* NOTE (sync side effect): when a candidate actually graduates,
|
|
26
|
+
* this step persists the mutated awareness state and calls
|
|
27
|
+
* renderAwareness, which (via writeAwareness) fires a GATED,
|
|
28
|
+
* non-blocking Supabase sync of the awareness markdown. The
|
|
29
|
+
* sync is a no-op unless Supabase is configured AND sync_enabled
|
|
30
|
+
* (readSupabaseConfig returns null otherwise), so it never
|
|
31
|
+
* requires a network round-trip or a login to complete the pass
|
|
32
|
+
* — it does NOT violate the login-free contract below. dryRun
|
|
33
|
+
* and "nothing graduated" paths perform NO write and NO sync.
|
|
34
|
+
*
|
|
35
|
+
* HARD contract:
|
|
36
|
+
* - NONE of the three steps may require an LLM / OPENAI_API_KEY / Claude login.
|
|
37
|
+
* - EACH step is wrapped in its own try/catch so one throwing does NOT abort
|
|
38
|
+
* the others (best-effort, per-step isolation).
|
|
39
|
+
* - dryRun computes counts but writes NOTHING.
|
|
40
|
+
*/
|
|
41
|
+
import * as fs from "node:fs";
|
|
42
|
+
import * as path from "node:path";
|
|
43
|
+
import { consolidateJournalToPalace } from "../palace/consolidate.js";
|
|
44
|
+
import { runDecayPass } from "../palace/decay-pass.js";
|
|
45
|
+
import { pruneRawArchive, } from "../storage/archive-prune.js";
|
|
46
|
+
import { findCrystallizationCandidates, readAwarenessState, writeAwarenessState, renderAwareness, } from "../palace/awareness.js";
|
|
47
|
+
import { archiveRawDir } from "../storage/paths.js";
|
|
48
|
+
import { readJsonSafe, writeJsonAtomic } from "../storage/fs-utils.js";
|
|
49
|
+
import { readSupabaseConfig } from "../supabase/config.js";
|
|
50
|
+
import { DEFAULT_ARCHIVE_RETENTION_DAYS, resolveRetentionDays, } from "../storage/retention.js";
|
|
51
|
+
const DAY_MS = 86_400_000;
|
|
52
|
+
// The raw-archive retention window now lives in storage/retention.ts (single
|
|
53
|
+
// source of truth shared with store-doctor.ts, so the pruner and the integrity
|
|
54
|
+
// check can never disagree on the threshold). Re-exported here for barrel /
|
|
55
|
+
// back-compat consumers that import it from this module.
|
|
56
|
+
export { DEFAULT_ARCHIVE_RETENTION_DAYS };
|
|
57
|
+
/** Deterministic graduation floor: a crystallization candidate graduates when
|
|
58
|
+
* its members together carry at least this many confirmations. Layered on top
|
|
59
|
+
* of findCrystallizationCandidates' own minCluster/minTotalConfirm gates so the
|
|
60
|
+
* rule is purely numeric — NO LLM judgement. Overridable via the runSafety
|
|
61
|
+
* opt, the AGENT_RECALL_GRADUATION_MIN_CONFIRMATIONS env var, or config.json
|
|
62
|
+
* `graduation_min_confirmations` (resolved in that order by
|
|
63
|
+
* resolveGraduationMinConfirmations). */
|
|
64
|
+
export const DEFAULT_GRADUATION_MIN_CONFIRMATIONS = 8;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the graduation confirmation floor: explicit opt >
|
|
67
|
+
* AGENT_RECALL_GRADUATION_MIN_CONFIRMATIONS env > config.json
|
|
68
|
+
* `graduation_min_confirmations` > DEFAULT_GRADUATION_MIN_CONFIRMATIONS.
|
|
69
|
+
*
|
|
70
|
+
* Mirrors resolveRetentionDays so the two numeric knobs resolve identically.
|
|
71
|
+
*/
|
|
72
|
+
function resolveGraduationMinConfirmations(explicit) {
|
|
73
|
+
if (typeof explicit === "number" && Number.isFinite(explicit) && explicit > 0) {
|
|
74
|
+
return explicit;
|
|
75
|
+
}
|
|
76
|
+
const env = process.env.AGENT_RECALL_GRADUATION_MIN_CONFIRMATIONS;
|
|
77
|
+
if (env) {
|
|
78
|
+
const n = Number(env);
|
|
79
|
+
if (Number.isFinite(n) && n > 0)
|
|
80
|
+
return n;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
const cfg = readSupabaseConfig();
|
|
84
|
+
if (cfg &&
|
|
85
|
+
typeof cfg.graduation_min_confirmations === "number" &&
|
|
86
|
+
cfg.graduation_min_confirmations > 0) {
|
|
87
|
+
return cfg.graduation_min_confirmations;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// config read is best-effort — fall through to default
|
|
92
|
+
}
|
|
93
|
+
return DEFAULT_GRADUATION_MIN_CONFIRMATIONS;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Advance the raw-archive `.consumed.json` marker to "now − olderThanDays".
|
|
97
|
+
*
|
|
98
|
+
* Definition of "consumed" (single agreed definition, shared verbatim with
|
|
99
|
+
* archive-prune.ts): a raw segment whose content has been folded into the palace
|
|
100
|
+
* by the (regex, login-free) journal→palace consolidation. Segments older than
|
|
101
|
+
* the retention window have necessarily already been consolidated, so they count
|
|
102
|
+
* as consumed. Advancing the marker to the age cutoff lets pruneRawArchive
|
|
103
|
+
* actually fire on those aged segments while still PROTECTING anything newer than
|
|
104
|
+
* the window (the consumed gate stays meaningful). This is the writer for the
|
|
105
|
+
* exact `mtime <= lastConsumedAt` contract pruneRawArchive reads.
|
|
106
|
+
*
|
|
107
|
+
* MONOTONIC: never moves the marker backward. This is what makes the whole pass
|
|
108
|
+
* idempotent — a re-run with no newly-aged segments advances nothing and prunes
|
|
109
|
+
* nothing. Reuses the EXISTING checkpoint file; invents no new one.
|
|
110
|
+
*
|
|
111
|
+
* Returns the lastConsumedAt the marker is (or would be, in dryRun) set to.
|
|
112
|
+
*/
|
|
113
|
+
function advanceConsumeMarker(slug, olderThanDays, dryRun) {
|
|
114
|
+
const dir = archiveRawDir(slug);
|
|
115
|
+
if (!fs.existsSync(dir))
|
|
116
|
+
return null;
|
|
117
|
+
const markerPath = path.join(dir, ".consumed.json");
|
|
118
|
+
const existing = readJsonSafe(markerPath);
|
|
119
|
+
const prevMs = existing?.lastConsumedAt
|
|
120
|
+
? new Date(existing.lastConsumedAt).getTime()
|
|
121
|
+
: 0;
|
|
122
|
+
const cutoffMs = Date.now() - olderThanDays * DAY_MS;
|
|
123
|
+
// Monotonic: only advance forward. If the marker already covers the cutoff,
|
|
124
|
+
// there is nothing to do — re-runs become no-ops here.
|
|
125
|
+
if (!(cutoffMs > prevMs)) {
|
|
126
|
+
return existing?.lastConsumedAt ?? null;
|
|
127
|
+
}
|
|
128
|
+
const next = new Date(cutoffMs).toISOString();
|
|
129
|
+
if (!dryRun) {
|
|
130
|
+
writeJsonAtomic(markerPath, {
|
|
131
|
+
lastConsumedOffset: existing?.lastConsumedOffset ?? 0,
|
|
132
|
+
lastConsumedAt: next,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return next;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Step (c): graduate above-threshold crystallization candidates by re-titling
|
|
139
|
+
* the strongest member insight `CRYSTALLIZED: <title>`. Deterministic threshold
|
|
140
|
+
* ONLY — no LLM-authored summary. Idempotent: findCrystallizationCandidates
|
|
141
|
+
* excludes already-CRYSTALLIZED titles, so a graduated insight never re-graduates.
|
|
142
|
+
*/
|
|
143
|
+
function graduateCandidates(candidates, minConfirmations, dryRun) {
|
|
144
|
+
const eligible = candidates.filter((c) => c.total_confirmations >= minConfirmations);
|
|
145
|
+
if (eligible.length === 0)
|
|
146
|
+
return { graduated: 0, titles: [] };
|
|
147
|
+
const state = readAwarenessState();
|
|
148
|
+
if (!state)
|
|
149
|
+
return { graduated: 0, titles: [] };
|
|
150
|
+
const titles = [];
|
|
151
|
+
let mutated = false;
|
|
152
|
+
for (const cand of eligible) {
|
|
153
|
+
// Pick the strongest member (most confirmations) that is still un-graduated.
|
|
154
|
+
const members = state.topInsights
|
|
155
|
+
.filter((i) => cand.insight_ids.includes(i.id))
|
|
156
|
+
.filter((i) => !/^\s*(crystallized|critical)\b/i.test(i.title ?? ""));
|
|
157
|
+
if (members.length === 0)
|
|
158
|
+
continue; // already graduated → idempotent skip
|
|
159
|
+
members.sort((a, b) => b.confirmations - a.confirmations);
|
|
160
|
+
const lead = members[0];
|
|
161
|
+
const newTitle = `CRYSTALLIZED: ${lead.title}`;
|
|
162
|
+
titles.push(newTitle);
|
|
163
|
+
if (!dryRun) {
|
|
164
|
+
lead.title = newTitle;
|
|
165
|
+
mutated = true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (mutated && !dryRun) {
|
|
169
|
+
writeAwarenessState(state);
|
|
170
|
+
renderAwareness(state);
|
|
171
|
+
}
|
|
172
|
+
return { graduated: titles.length, titles };
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Run the three best-effort, LOGIN-FREE, LLM-FREE safety-consolidation steps
|
|
176
|
+
* for a project. Each step is isolated in its own try/catch: one throwing never
|
|
177
|
+
* aborts the others. dryRun computes counts but writes nothing.
|
|
178
|
+
*/
|
|
179
|
+
export async function runSafetyConsolidation(project, opts = {}) {
|
|
180
|
+
const dryRun = opts.dryRun === true;
|
|
181
|
+
const olderThanDays = resolveRetentionDays(opts.olderThanDays);
|
|
182
|
+
const minConfirmations = resolveGraduationMinConfirmations(opts.minConfirmations);
|
|
183
|
+
const decay = { ran: false, scanned: 0, archived: 0 };
|
|
184
|
+
const pruned = {
|
|
185
|
+
ran: false,
|
|
186
|
+
scanned: 0,
|
|
187
|
+
gzipped: 0,
|
|
188
|
+
removed: 0,
|
|
189
|
+
eligible: 0,
|
|
190
|
+
consumedThrough: null,
|
|
191
|
+
};
|
|
192
|
+
const graduated = {
|
|
193
|
+
ran: false,
|
|
194
|
+
candidates: 0,
|
|
195
|
+
graduated: 0,
|
|
196
|
+
graduatedTitles: [],
|
|
197
|
+
};
|
|
198
|
+
// ── (a) decay + keystones ──────────────────────────────────────────────
|
|
199
|
+
// consolidateJournalToPalace runs runDecayPass + markKeystones internally and
|
|
200
|
+
// is pure regex/fs (no LLM). In dryRun we MUST NOT write, so call runDecayPass
|
|
201
|
+
// directly with dryRun:true instead of the full (always-writing) consolidate.
|
|
202
|
+
//
|
|
203
|
+
// Counting note: runDecayPass skips already-archived objects, so a post-write
|
|
204
|
+
// re-count would under-report. Capture the candidate count from a dryRun pass
|
|
205
|
+
// FIRST (pre-write), then run the real consolidate to apply the flags.
|
|
206
|
+
try {
|
|
207
|
+
const report = runDecayPass(project, { dryRun: true });
|
|
208
|
+
decay.scanned = report.scanned;
|
|
209
|
+
decay.archived = report.archived_candidates.length;
|
|
210
|
+
if (!dryRun) {
|
|
211
|
+
// Distill journal → palace (regex), which internally applies the decay
|
|
212
|
+
// flags. Counts already captured above (pre-write) so they stay honest.
|
|
213
|
+
consolidateJournalToPalace(project);
|
|
214
|
+
}
|
|
215
|
+
decay.ran = true;
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
decay.error = err instanceof Error ? err.message : String(err);
|
|
219
|
+
}
|
|
220
|
+
// ── (b) prune raw archive (retention) ──────────────────────────────────
|
|
221
|
+
try {
|
|
222
|
+
// Advance the consume marker so aged, already-distilled segments become
|
|
223
|
+
// prunable (the marker is the load-bearing safety guard). Monotonic.
|
|
224
|
+
const consumedThrough = advanceConsumeMarker(project, olderThanDays, dryRun);
|
|
225
|
+
pruned.consumedThrough = consumedThrough;
|
|
226
|
+
const res = pruneRawArchive(project, {
|
|
227
|
+
olderThanDays,
|
|
228
|
+
dryRun,
|
|
229
|
+
});
|
|
230
|
+
pruned.scanned = res.scanned;
|
|
231
|
+
pruned.gzipped = res.gzipped;
|
|
232
|
+
pruned.removed = res.removed;
|
|
233
|
+
pruned.eligible = res.eligible;
|
|
234
|
+
// pruneRawArchive recomputes consumedThrough from the marker we just wrote;
|
|
235
|
+
// prefer its value when present (they agree in non-dryRun).
|
|
236
|
+
pruned.consumedThrough = res.consumedThrough ?? consumedThrough;
|
|
237
|
+
pruned.ran = true;
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
pruned.error = err instanceof Error ? err.message : String(err);
|
|
241
|
+
}
|
|
242
|
+
// ── (c) graduate crystallization candidates (deterministic threshold) ───
|
|
243
|
+
try {
|
|
244
|
+
const candidates = findCrystallizationCandidates();
|
|
245
|
+
graduated.candidates = candidates.length;
|
|
246
|
+
const g = graduateCandidates(candidates, minConfirmations, dryRun);
|
|
247
|
+
graduated.graduated = g.graduated;
|
|
248
|
+
graduated.graduatedTitles = g.titles;
|
|
249
|
+
graduated.ran = true;
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
graduated.error = err instanceof Error ? err.message : String(err);
|
|
253
|
+
}
|
|
254
|
+
return { project, dryRun, decay, pruned, graduated };
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=safety-consolidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-consolidation.js","sourceRoot":"","sources":["../../src/tools-logic/safety-consolidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,eAAe,GAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,yDAAyD;AACzD,OAAO,EAAE,8BAA8B,EAAE,CAAC;AAE1C;;;;;;0CAM0C;AAC1C,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAsDtD;;;;;;GAMG;AACH,SAAS,iCAAiC,CAAC,QAAiB;IAC1D,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CA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-18,6 +18,7 @@
|
|
|
18
18
|
* already in the conversation writes its own reflection, we just give it
|
|
19
19
|
* the inputs.
|
|
20
20
|
*/
|
|
21
|
+
import { type CrystallizationCandidate } from "../palace/awareness.js";
|
|
21
22
|
export interface ReflectInput {
|
|
22
23
|
project?: string;
|
|
23
24
|
/** Look back this many days of journal entries. Default 7. */
|
|
@@ -43,6 +44,23 @@ export interface ReflectInputBundle {
|
|
|
43
44
|
phase: string;
|
|
44
45
|
synthesis: string;
|
|
45
46
|
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Wave 2: lossless raw archive segments not yet consumed by compression
|
|
49
|
+
* (files newer than the `.consumed.json` marker). The in-loop LLM is asked to
|
|
50
|
+
* distill these upward and advance the marker. Core stays deterministic — it
|
|
51
|
+
* only surfaces the raw material; it makes NO LLM call itself.
|
|
52
|
+
*/
|
|
53
|
+
raw_unconsumed?: Array<{
|
|
54
|
+
file: string;
|
|
55
|
+
excerpt: string;
|
|
56
|
+
bytes: number;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Wave 3: clusters of related awareness insights that are candidates for
|
|
60
|
+
* crystallization into a single principle. Raw material ONLY — core does NOT
|
|
61
|
+
* synthesize the principle (the in-loop LLM does, per Decision #3).
|
|
62
|
+
*/
|
|
63
|
+
crystallization_candidates?: CrystallizationCandidate[];
|
|
46
64
|
}
|
|
47
65
|
export interface ReflectResult {
|
|
48
66
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-end-reflect.d.ts","sourceRoot":"","sources":["../../src/tools-logic/session-end-reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"session-end-reflect.d.ts","sourceRoot":"","sources":["../../src/tools-logic/session-end-reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAiC,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC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js";
|
|
|
22
22
|
import { readCorrections } from "../storage/corrections.js";
|
|
23
23
|
import { listJournalFiles } from "../helpers/journal-files.js";
|
|
24
24
|
import { listMilestones } from "../palace/pipeline.js";
|
|
25
|
+
import { findCrystallizationCandidates } from "../palace/awareness.js";
|
|
26
|
+
import { archiveRawDir } from "../storage/paths.js";
|
|
27
|
+
import { readJsonSafe } from "../storage/fs-utils.js";
|
|
28
|
+
import { buildConsolidationPrompt } from "../prompts/consolidation-prompt.js";
|
|
25
29
|
import * as fs from "node:fs";
|
|
26
30
|
import * as path from "node:path";
|
|
27
31
|
const EXCERPT_CHARS = 800;
|
|
@@ -68,10 +72,23 @@ export async function sessionEndReflect(input) {
|
|
|
68
72
|
phase: p.meta.phase,
|
|
69
73
|
synthesis: p.sections.synthesis,
|
|
70
74
|
}));
|
|
75
|
+
const rawUnconsumed = collectRawUnconsumed(slug);
|
|
76
|
+
// Wave 3: surface crystallization candidates (best-effort; never throws).
|
|
77
|
+
let crystallizationCandidates = [];
|
|
78
|
+
try {
|
|
79
|
+
crystallizationCandidates = findCrystallizationCandidates();
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
crystallizationCandidates = [];
|
|
83
|
+
}
|
|
71
84
|
const bundle = {
|
|
72
85
|
recent_journals: recentJournals,
|
|
73
86
|
active_corrections: corrections,
|
|
74
87
|
recent_phases: recentPhases,
|
|
88
|
+
...(rawUnconsumed.length > 0 ? { raw_unconsumed: rawUnconsumed } : {}),
|
|
89
|
+
...(crystallizationCandidates.length > 0
|
|
90
|
+
? { crystallization_candidates: crystallizationCandidates }
|
|
91
|
+
: {}),
|
|
75
92
|
};
|
|
76
93
|
const prompt = buildPrompt(slug, bundle, lookback);
|
|
77
94
|
const nextActions = [
|
|
@@ -81,37 +98,59 @@ export async function sessionEndReflect(input) {
|
|
|
81
98
|
];
|
|
82
99
|
return { success: true, project: slug, bundle, prompt, next_actions: nextActions };
|
|
83
100
|
}
|
|
101
|
+
// Wave 5: the prompt body is now generated by the SINGLE versioned source
|
|
102
|
+
// (prompts/consolidation-prompt.ts), so `ar consolidate` and `session_end_reflect`
|
|
103
|
+
// render identically. This wrapper exists only to keep the call signature stable.
|
|
84
104
|
function buildPrompt(slug, bundle, lookback) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
105
|
+
return buildConsolidationPrompt(slug, bundle, lookback);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Wave 2: collect lossless raw-archive files newer than the `.consumed.json`
|
|
109
|
+
* marker so the reflect bundle can hand them to the LLM for distillation.
|
|
110
|
+
* Deterministic and best-effort — never throws.
|
|
111
|
+
*/
|
|
112
|
+
function collectRawUnconsumed(slug) {
|
|
113
|
+
const out = [];
|
|
114
|
+
try {
|
|
115
|
+
const rawDir = archiveRawDir(slug);
|
|
116
|
+
if (!fs.existsSync(rawDir))
|
|
117
|
+
return out;
|
|
118
|
+
const marker = readJsonSafe(path.join(rawDir, ".consumed.json"));
|
|
119
|
+
const cutoffMs = marker?.lastConsumedAt
|
|
120
|
+
? new Date(marker.lastConsumedAt).getTime()
|
|
121
|
+
: 0;
|
|
122
|
+
const files = fs
|
|
123
|
+
.readdirSync(rawDir)
|
|
124
|
+
.filter((f) => f.endsWith(".md"))
|
|
125
|
+
.sort()
|
|
126
|
+
.reverse();
|
|
127
|
+
for (const file of files) {
|
|
128
|
+
const full = path.join(rawDir, file);
|
|
129
|
+
let stat;
|
|
130
|
+
try {
|
|
131
|
+
stat = fs.statSync(full);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (Number.isFinite(cutoffMs) && cutoffMs > 0 && stat.mtimeMs <= cutoffMs) {
|
|
137
|
+
continue; // already consumed
|
|
138
|
+
}
|
|
139
|
+
let excerpt = "";
|
|
140
|
+
try {
|
|
141
|
+
excerpt = fs.readFileSync(full, "utf-8").slice(0, EXCERPT_CHARS);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
out.push({ file, excerpt, bytes: stat.size });
|
|
147
|
+
if (out.length >= 5)
|
|
148
|
+
break; // cap — bound the bundle size
|
|
149
|
+
}
|
|
109
150
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
for (const ph of bundle.recent_phases) {
|
|
113
|
-
lines.push(`- Phase ${ph.order} — ${ph.phase}: ${ph.synthesis}`);
|
|
151
|
+
catch {
|
|
152
|
+
// best-effort
|
|
114
153
|
}
|
|
115
|
-
return
|
|
154
|
+
return out;
|
|
116
155
|
}
|
|
117
156
|
//# sourceMappingURL=session-end-reflect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-end-reflect.js","sourceRoot":"","sources":["../../src/tools-logic/session-end-reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"session-end-reflect.js","sourceRoot":"","sources":["../../src/tools-logic/session-end-reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,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ACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;YACnE,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9C,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;gBAAE,MAAM,CAAC,8BAA8B;QAC5D,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,cAAc;IAChB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -39,6 +39,15 @@ export interface SessionEndInput {
|
|
|
39
39
|
phase_name: string;
|
|
40
40
|
goal: string;
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Wave 2: defer the inline journal→palace consolidation to the async
|
|
44
|
+
* dreaming queue instead of running it in this turn. ONLY the harness-driven
|
|
45
|
+
* Stop hook (`hook-end`) passes this true — it enqueues a consolidation job
|
|
46
|
+
* and skips the synchronous palace pass. Default false ⇒ ZERO behavior
|
|
47
|
+
* change for /arsave, /arsaveall, and the MCP session_end (they still
|
|
48
|
+
* consolidate inline). Decision #3: consolidation is async dreaming.
|
|
49
|
+
*/
|
|
50
|
+
deferConsolidation?: boolean;
|
|
42
51
|
}
|
|
43
52
|
export interface MergeSuggestion {
|
|
44
53
|
file: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-end.d.ts","sourceRoot":"","sources":["../../src/tools-logic/session-end.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"session-end.d.ts","sourceRoot":"","sources":["../../src/tools-logic/session-end.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD,OAAO,K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