agent-recall-core 3.4.49 → 3.4.51

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 (95) hide show
  1. package/dist/helpers/transcript-project.d.ts +69 -0
  2. package/dist/helpers/transcript-project.d.ts.map +1 -0
  3. package/dist/helpers/transcript-project.js +212 -0
  4. package/dist/helpers/transcript-project.js.map +1 -0
  5. package/dist/index.d.ts +26 -5
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +51 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/palace/awareness.d.ts +28 -0
  10. package/dist/palace/awareness.d.ts.map +1 -1
  11. package/dist/palace/awareness.js +40 -6
  12. package/dist/palace/awareness.js.map +1 -1
  13. package/dist/prompts/consolidation-prompt.d.ts.map +1 -1
  14. package/dist/prompts/consolidation-prompt.js +5 -0
  15. package/dist/prompts/consolidation-prompt.js.map +1 -1
  16. package/dist/retrieval/activation.d.ts +202 -0
  17. package/dist/retrieval/activation.d.ts.map +1 -0
  18. package/dist/retrieval/activation.js +313 -0
  19. package/dist/retrieval/activation.js.map +1 -0
  20. package/dist/storage/corrections.d.ts +140 -2
  21. package/dist/storage/corrections.d.ts.map +1 -1
  22. package/dist/storage/corrections.js +97 -4
  23. package/dist/storage/corrections.js.map +1 -1
  24. package/dist/storage/dream-health.d.ts +56 -8
  25. package/dist/storage/dream-health.d.ts.map +1 -1
  26. package/dist/storage/dream-health.js +130 -35
  27. package/dist/storage/dream-health.js.map +1 -1
  28. package/dist/storage/dream-yield.d.ts +81 -0
  29. package/dist/storage/dream-yield.d.ts.map +1 -0
  30. package/dist/storage/dream-yield.js +77 -0
  31. package/dist/storage/dream-yield.js.map +1 -0
  32. package/dist/storage/filelock.d.ts +10 -2
  33. package/dist/storage/filelock.d.ts.map +1 -1
  34. package/dist/storage/filelock.js +10 -2
  35. package/dist/storage/filelock.js.map +1 -1
  36. package/dist/storage/heed-tiers.d.ts +206 -0
  37. package/dist/storage/heed-tiers.d.ts.map +1 -0
  38. package/dist/storage/heed-tiers.js +318 -0
  39. package/dist/storage/heed-tiers.js.map +1 -0
  40. package/dist/supabase/sync.d.ts +1 -1
  41. package/dist/supabase/sync.d.ts.map +1 -1
  42. package/dist/supabase/sync.js +47 -11
  43. package/dist/supabase/sync.js.map +1 -1
  44. package/dist/tools-logic/association.d.ts +260 -0
  45. package/dist/tools-logic/association.d.ts.map +1 -0
  46. package/dist/tools-logic/association.js +502 -0
  47. package/dist/tools-logic/association.js.map +1 -0
  48. package/dist/tools-logic/check-action.d.ts.map +1 -1
  49. package/dist/tools-logic/check-action.js +14 -0
  50. package/dist/tools-logic/check-action.js.map +1 -1
  51. package/dist/tools-logic/dream-admission.d.ts +144 -0
  52. package/dist/tools-logic/dream-admission.d.ts.map +1 -0
  53. package/dist/tools-logic/dream-admission.js +537 -0
  54. package/dist/tools-logic/dream-admission.js.map +1 -0
  55. package/dist/tools-logic/implicit-harvest.d.ts +196 -0
  56. package/dist/tools-logic/implicit-harvest.d.ts.map +1 -0
  57. package/dist/tools-logic/implicit-harvest.js +675 -0
  58. package/dist/tools-logic/implicit-harvest.js.map +1 -0
  59. package/dist/tools-logic/insight-promotion.d.ts +18 -0
  60. package/dist/tools-logic/insight-promotion.d.ts.map +1 -1
  61. package/dist/tools-logic/insight-promotion.js +90 -15
  62. package/dist/tools-logic/insight-promotion.js.map +1 -1
  63. package/dist/tools-logic/retier.d.ts +274 -0
  64. package/dist/tools-logic/retier.d.ts.map +1 -0
  65. package/dist/tools-logic/retier.js +511 -0
  66. package/dist/tools-logic/retier.js.map +1 -0
  67. package/dist/tools-logic/safety-consolidation.d.ts +15 -0
  68. package/dist/tools-logic/safety-consolidation.d.ts.map +1 -1
  69. package/dist/tools-logic/safety-consolidation.js +13 -2
  70. package/dist/tools-logic/safety-consolidation.js.map +1 -1
  71. package/dist/tools-logic/session-end-reflect.d.ts.map +1 -1
  72. package/dist/tools-logic/session-end-reflect.js +4 -1
  73. package/dist/tools-logic/session-end-reflect.js.map +1 -1
  74. package/dist/tools-logic/session-end.d.ts +35 -0
  75. package/dist/tools-logic/session-end.d.ts.map +1 -1
  76. package/dist/tools-logic/session-end.js +26 -7
  77. package/dist/tools-logic/session-end.js.map +1 -1
  78. package/dist/tools-logic/session-start.d.ts +11 -0
  79. package/dist/tools-logic/session-start.d.ts.map +1 -1
  80. package/dist/tools-logic/session-start.js +34 -4
  81. package/dist/tools-logic/session-start.js.map +1 -1
  82. package/dist/tools-logic/smart-recall.d.ts +11 -0
  83. package/dist/tools-logic/smart-recall.d.ts.map +1 -1
  84. package/dist/tools-logic/smart-recall.js +11 -0
  85. package/dist/tools-logic/smart-recall.js.map +1 -1
  86. package/dist/tools-logic/store-doctor.d.ts.map +1 -1
  87. package/dist/tools-logic/store-doctor.js +7 -1
  88. package/dist/tools-logic/store-doctor.js.map +1 -1
  89. package/dist/tools-logic/transcript-audit.d.ts +128 -0
  90. package/dist/tools-logic/transcript-audit.d.ts.map +1 -0
  91. package/dist/tools-logic/transcript-audit.js +428 -0
  92. package/dist/tools-logic/transcript-audit.js.map +1 -0
  93. package/dist/types.d.ts +1 -1
  94. package/dist/types.js +1 -1
  95. package/package.json +1 -1
@@ -0,0 +1,313 @@
1
+ /**
2
+ * retrieval/activation.ts — evolution p3: ACT-R declarative memory
3
+ * activation, `A_i = B_i + Σ_j W_j·S_ji`.
4
+ *
5
+ * `B_i` (base activation: recency/frequency) ALREADY EXISTS as the per-tier
6
+ * scores every caller already computes — journal Ebbinghaus `S=2`
7
+ * (smart-recall.ts's MATH.md §b), palace salience/IDF, insight
8
+ * confirmation-count, rankCorrections' severity/proof_confidence/recency/
9
+ * proof composite (corrections.ts). This module does NOT re-derive any of
10
+ * those — it reads Phase 2's `association/edges.json`
11
+ * (`tools-logic/association.ts`, schema `assoc-edges/v1`) and computes ONLY
12
+ * the associative bonus `Σ_j W_j·S_ji`, `W_j = 1/|context|` (uniform),
13
+ * `S_ji = weight · exp(-days(asOfDay − last_seen)/S_DECAY)`.
14
+ *
15
+ * WHAT IT IS: a cognitive-model bonus wired into TWO existing ranking
16
+ * pipelines, both flag-gated on `AGENT_RECALL_ACTIVATION=1` (default OFF —
17
+ * see `activationEnabled()`), following the exact template
18
+ * `retrieval/semantic-leg.ts` (fix7) already established for an opt-in leg:
19
+ * flag off ⇒ zero file read, zero behavior change, byte-identical output.
20
+ * (a) session_start correction ordering (`activationTieBreak`) — a
21
+ * TIE-BREAK applied strictly AFTER rankCorrections' own severity and
22
+ * proof_confidence keys; never reorders across a severity/confidence
23
+ * boundary, and the P0-always-survive budget logic downstream
24
+ * (session-start.ts's `applyCorrectionBudget`) is untouched — this
25
+ * function only reorders, never drops.
26
+ * (b) smart_recall post-RRF re-rank (`applyActivationRerank`) — a
27
+ * multiplicative boost on the fused top-K, `final_score = fused_score
28
+ * · (1 + ACT_ALPHA · normalized_activation)`.
29
+ *
30
+ * DIMENSIONAL-COHERENCE CHALLENGE (resolved, not silently mixed): (a) never
31
+ * combines activation with `B_i` numerically — it only compares
32
+ * `activationBonus` values against EACH OTHER to break a tie, so no
33
+ * cross-scale summation ever happens. (b) DOES mix scales (`fused_score` is
34
+ * an RRF-derived value on the `1/(60+r)` scale documented in MATH.md §b;
35
+ * `S_ji` is `weight · exp(...)`, an unrelated integer-ish scale) — see
36
+ * `applyActivationRerank`'s own doc comment for the explicit squashing
37
+ * normalization (`x/(x+1)`) that resolves this rather than adding the two
38
+ * incompatible scales directly (the exact class of bug smart-recall.ts's
39
+ * own header calls "Fix 1: incompatible scales").
40
+ *
41
+ * HAND-TUNED (documented per MATH.md convention, see packages/core/src/
42
+ * MATH.md §c — added alongside this module):
43
+ * - `S_DECAY = 30` days — chosen by feel (a month-ish co-activation
44
+ * memory), NOT fit to any recall/forget outcome data.
45
+ * - `ACT_ALPHA = 0.2` — chosen so the multiplicative boost can move a
46
+ * tied item by up to ×1.2 without ever vaulting a genuinely stronger
47
+ * fused_score item the way an uncapped multiplier could (same class of
48
+ * defect the hot-window boost's removal fixed, MATH.md §b) — not fit to
49
+ * a labeled relevance set.
50
+ *
51
+ * DEGRADATION CONTRACT (never throws, matches semantic-leg.ts's contract):
52
+ * missing/corrupt/wrong-shape `edges.json` → `loadAssocGraph` returns
53
+ * `null`; every consumer here treats `null` as "no signal", producing
54
+ * IDENTICAL results to today plus a diagnosable reason
55
+ * (`ActivationLegNote`, same shape family as `SemanticLegNote`).
56
+ *
57
+ * HOPFIELD — explicitly deferred (see this module's header once more, and
58
+ * the evolution p3 worker report): `palace/hopfield.ts` is a dense
59
+ * associative-memory primitive (attractor dynamics over a FULL similarity
60
+ * matrix). The `assoc-edges/v1` graph this module reads is SPARSE by
61
+ * construction (an edge exists only between corrections that were actually
62
+ * co-cited — most correction pairs in a real store have no edge at all).
63
+ * Feeding a sparse, mostly-zero adjacency into Hopfield's softmax-over-all-
64
+ * patterns update would spend its energy attending to a near-uniform
65
+ * distribution over non-edges, which is not the density Hopfield's
66
+ * exponential storage-capacity argument (Ramsauer et al. 2020) assumes.
67
+ * The linear ACT-R sum used here is the correct primitive for a sparse
68
+ * co-activation graph; Hopfield stays a documented, not-wired-in primitive.
69
+ */
70
+ import * as fs from "node:fs";
71
+ import { assocNodeId, defaultEdgesPathFor, isAssocEdgesFile, } from "../tools-logic/association.js";
72
+ // ---------------------------------------------------------------------------
73
+ // Flag
74
+ // ---------------------------------------------------------------------------
75
+ /** Opt-in env var. Default OFF — every integration point below must check
76
+ * this BEFORE reading any file (constraint: flag-off is byte-identical). */
77
+ export const ACTIVATION_FLAG_ENV = "AGENT_RECALL_ACTIVATION";
78
+ export function activationEnabled() {
79
+ return process.env[ACTIVATION_FLAG_ENV] === "1";
80
+ }
81
+ // ---------------------------------------------------------------------------
82
+ // HAND-TUNED constants (see this file's header + MATH.md §c)
83
+ // ---------------------------------------------------------------------------
84
+ /** Decay half-life-ish constant (days) for S_ji = weight·exp(-days/S_DECAY). HAND-TUNED. */
85
+ export const S_DECAY = 30;
86
+ /** Multiplicative boost strength for the smart-recall integration point (2b). HAND-TUNED. */
87
+ export const ACT_ALPHA = 0.2;
88
+ /** How many of the fused/re-sorted top results the smart-recall integration re-ranks. */
89
+ const ACTIVATION_RERANK_K = 10;
90
+ /** Pure: turns an already-parsed, already-validated edges file into the
91
+ * adjacency structure the math functions below consume. No fs access. */
92
+ export function adjacencyFromEdgesFile(file) {
93
+ const adjacency = new Map();
94
+ for (const edge of file.edges) {
95
+ if (!adjacency.has(edge.a))
96
+ adjacency.set(edge.a, new Map());
97
+ if (!adjacency.has(edge.b))
98
+ adjacency.set(edge.b, new Map());
99
+ adjacency.get(edge.a).set(edge.b, edge);
100
+ adjacency.get(edge.b).set(edge.a, edge);
101
+ }
102
+ return { adjacency, edgeCount: file.edges.length };
103
+ }
104
+ /**
105
+ * Load the S_ji graph from `<storeRoot>/association/edges.json` (or an
106
+ * explicit path override — mirrors `readAssocEdgesFile`'s own signature).
107
+ * Missing file, unreadable file, unparseable JSON, or wrong-shape content
108
+ * all degrade to `null` — NEVER throws. Deliberately does NOT reuse
109
+ * `readAssocEdgesFile` (which collapses "missing" and "corrupt" into a
110
+ * silently-empty-but-valid file) because this function's degradation
111
+ * contract needs to tell "no graph at all" (null — callers report a
112
+ * diagnosable reason) apart from "a real, validly-empty graph" (an
113
+ * AssocGraph with 0 edges — a legitimate, if unusual, state after `ar assoc
114
+ * rebuild` runs against a store with zero cited events yet).
115
+ */
116
+ export function loadAssocGraph(storeRoot, explicitPath) {
117
+ const p = explicitPath ?? defaultEdgesPathFor(storeRoot);
118
+ if (!fs.existsSync(p))
119
+ return null;
120
+ let raw;
121
+ try {
122
+ raw = fs.readFileSync(p, "utf-8");
123
+ }
124
+ catch {
125
+ return null;
126
+ }
127
+ let parsed;
128
+ try {
129
+ parsed = JSON.parse(raw);
130
+ }
131
+ catch {
132
+ return null;
133
+ }
134
+ if (!isAssocEdgesFile(parsed))
135
+ return null;
136
+ return adjacencyFromEdgesFile(parsed);
137
+ }
138
+ /** Local-calendar-day string for "now" (matches session-start.ts's own "sv"
139
+ * locale convention for local-day bucketing — see e.g. its retrieved-outcome
140
+ * 1/day dedup guard). */
141
+ export function todayDayString() {
142
+ return new Date().toLocaleDateString("sv");
143
+ }
144
+ /**
145
+ * Whole-day difference between two `YYYY-MM-DD` strings, parsed as UTC
146
+ * midnight (so the result never drifts with the calling process's local
147
+ * timezone — load-bearing for the eval script's determinism requirement).
148
+ * Returns `null` on either unparseable string (degrade, never throw).
149
+ */
150
+ function daysBetweenDayStrings(fromDay, toDay) {
151
+ const from = Date.parse(`${fromDay}T00:00:00Z`);
152
+ const to = Date.parse(`${toDay}T00:00:00Z`);
153
+ if (Number.isNaN(from) || Number.isNaN(to))
154
+ return null;
155
+ return Math.round((to - from) / 86_400_000);
156
+ }
157
+ /**
158
+ * S_ji = weight · exp(-days(asOfDay − last_seen) / S_DECAY). HAND-TUNED
159
+ * S_DECAY (see this file's header). `days` is clamped at 0 (an edge whose
160
+ * `last_seen` is AFTER `asOfDay` — should never happen given the temporal
161
+ * split's own invariant, but this is a pure function with no knowledge of
162
+ * its caller's discipline, so it degrades to "no decay yet" rather than
163
+ * producing a >1 multiplier via a negative exponent). Malformed dates
164
+ * degrade to 0 (never throw).
165
+ */
166
+ export function assocStrength(edge, asOfDay) {
167
+ const days = daysBetweenDayStrings(edge.last_seen, asOfDay);
168
+ if (days === null)
169
+ return 0;
170
+ return edge.weight * Math.exp(-Math.max(0, days) / S_DECAY);
171
+ }
172
+ /**
173
+ * activationBonus(i) = Σ_j (1/|context|)·S_ji, summed over context items j
174
+ * that have an edge to i (context items without an edge to i contribute 0).
175
+ * `graph === null` (no graph loaded) or an empty context both degrade to 0
176
+ * — never throws, matches the module's degradation contract.
177
+ */
178
+ export function activationBonus(candidateNodeId, contextNodeIds, graph, asOfDay) {
179
+ if (!graph || contextNodeIds.length === 0)
180
+ return 0;
181
+ const neighbors = graph.adjacency.get(candidateNodeId);
182
+ if (!neighbors)
183
+ return 0;
184
+ const w = 1 / contextNodeIds.length;
185
+ let sum = 0;
186
+ for (const j of contextNodeIds) {
187
+ if (j === candidateNodeId)
188
+ continue; // no self-loops in this graph by construction
189
+ const edge = neighbors.get(j);
190
+ if (!edge)
191
+ continue;
192
+ sum += w * assocStrength(edge, asOfDay);
193
+ }
194
+ return sum;
195
+ }
196
+ function effectiveConf(r) {
197
+ return r.proof_confidence ?? r.weight ?? 0;
198
+ }
199
+ /**
200
+ * Reorders `ranked` (already `rankCorrections()`'s output — severity ≫
201
+ * proof_confidence ≫ recency ≫ proof_count, corrections.ts) using
202
+ * activation as a TIE-BREAK strictly AFTER severity and proof_confidence:
203
+ * items are first partitioned into contiguous groups sharing the SAME
204
+ * (severity, effective proof_confidence) — rankCorrections' two
205
+ * highest-weighted keys — and activation only reorders WITHIN a group,
206
+ * never across one. `rankCorrections`' own recency/proof_count ordering
207
+ * survives as the STABLE fallback: with no graph (or zero bonus for every
208
+ * candidate) a group's relative order is preserved exactly.
209
+ *
210
+ * GREEDY, per the brief: `context` starts empty and grows by one node id
211
+ * per pick (within AND across tie-classes, in output order) — so the 2nd
212
+ * pick's activation score already "sees" the 1st pick, etc. This is a
213
+ * simple, deterministic sequential process, not a global optimization.
214
+ *
215
+ * Does NOT check `activationEnabled()` itself (testable in isolation) —
216
+ * callers (session-start.ts) must short-circuit before ever loading a graph
217
+ * or calling this function, so flag-off has zero file reads (constraint 1).
218
+ */
219
+ export function activationTieBreak(ranked, opts) {
220
+ const { project, graph, asOfDay } = opts;
221
+ const result = [];
222
+ const context = [];
223
+ let i = 0;
224
+ while (i < ranked.length) {
225
+ let j = i;
226
+ while (j + 1 < ranked.length &&
227
+ ranked[j + 1].severity === ranked[i].severity &&
228
+ effectiveConf(ranked[j + 1]) === effectiveConf(ranked[i])) {
229
+ j++;
230
+ }
231
+ // Tie-class is ranked[i..j] — greedily reorder within it.
232
+ const pool = ranked.slice(i, j + 1).map((r) => r); // shallow copy, original relative order preserved as pool order
233
+ while (pool.length > 0) {
234
+ let bestPos = 0;
235
+ let bestScore = -Infinity;
236
+ for (let k = 0; k < pool.length; k++) {
237
+ const nodeId = assocNodeId(project, pool[k].id);
238
+ const score = activationBonus(nodeId, context, graph, asOfDay);
239
+ if (score > bestScore) {
240
+ bestScore = score;
241
+ bestPos = k; // first (= earliest original position) strictly-greater score wins ties
242
+ }
243
+ }
244
+ const [chosen] = pool.splice(bestPos, 1);
245
+ result.push(chosen);
246
+ context.push(assocNodeId(project, chosen.id));
247
+ }
248
+ i = j + 1;
249
+ }
250
+ return result;
251
+ }
252
+ /**
253
+ * Post-RRF (+ post-Beta-feedback-multiplier) re-rank of the fused top-K
254
+ * (K=10). Mutates `results` IN PLACE over its first `min(K, results.length)`
255
+ * entries only — items beyond K are left untouched.
256
+ *
257
+ * `final_score = fused_score · (1 + ACT_ALPHA · normalized_activation)`.
258
+ *
259
+ * NORMALIZATION (dimensional-coherence CHALLENGE, resolved — see this file's
260
+ * header): `fused_score` lives on the RRF scale (`1/(60+r)`, MATH.md §b);
261
+ * raw `activationBonus` lives on the `weight·exp(-days/30)` scale (roughly:
262
+ * an integer session-count, decayed) — summing these directly would repeat
263
+ * exactly the "Fix 1: incompatible scales" defect smart-recall.ts's own
264
+ * header documents for the pre-RRF linear-fusion bug. Instead the raw bonus
265
+ * is squashed through `x/(x+1)` into `[0,1)` BEFORE being used as a
266
+ * dimensionless multiplier — bounded regardless of how large a raw edge
267
+ * weight gets, needs no corpus-wide "max possible" scan (keeps this
268
+ * deterministic and simple, per the brief), and is 0 exactly when the raw
269
+ * bonus is 0 (zero signal ⇒ multiplier ⇒ ×1, an exact no-op).
270
+ *
271
+ * Context = the top-3 node ids BY FUSED SCORE (i.e. `results[0..2]` as they
272
+ * stand when this function is called — the SAME top-K, not the greedy
273
+ * growing context `activationTieBreak` uses for session_start; the brief
274
+ * specifies this context for smart_recall independently of 2a's).
275
+ *
276
+ * Degradation: no graph, or zero bonus for every top-K item → `results` is
277
+ * left COMPLETELY UNTOUCHED (not just "same order" — no mutation at all)
278
+ * and the returned note has `used: false` with a reason.
279
+ */
280
+ export function applyActivationRerank(results, project, opts) {
281
+ const asOfDay = opts.asOfDay ?? todayDayString();
282
+ const graph = opts.graph !== undefined ? opts.graph : loadAssocGraph(opts.storeRoot);
283
+ if (!graph) {
284
+ return { enabled: true, used: false, reason: "no association graph (run `ar assoc rebuild`)" };
285
+ }
286
+ const k = Math.min(ACTIVATION_RERANK_K, results.length);
287
+ if (k === 0) {
288
+ return { enabled: true, used: false, reason: "no candidates" };
289
+ }
290
+ const top = results.slice(0, k);
291
+ const contextSize = Math.min(3, top.length);
292
+ const context = top.slice(0, contextSize).map((it) => assocNodeId(project, it.id));
293
+ let anyBonus = false;
294
+ const rescored = top.map((it, idx) => {
295
+ const nodeId = assocNodeId(project, it.id);
296
+ const bonus = activationBonus(nodeId, context, graph, asOfDay);
297
+ if (bonus > 0)
298
+ anyBonus = true;
299
+ const normalized = bonus / (bonus + 1); // squash — see doc comment above
300
+ return { it, idx, finalScore: it.score * (1 + ACT_ALPHA * normalized) };
301
+ });
302
+ if (!anyBonus) {
303
+ return { enabled: true, used: false, reason: "no edges among top candidates" };
304
+ }
305
+ rescored.sort((a, b) => b.finalScore - a.finalScore || a.idx - b.idx);
306
+ for (let pos = 0; pos < k; pos++) {
307
+ const { it, finalScore } = rescored[pos];
308
+ it.score = finalScore;
309
+ results[pos] = it;
310
+ }
311
+ return { enabled: true, used: true, reason: "activation-boosted top candidates" };
312
+ }
313
+ //# sourceMappingURL=activation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activation.js","sourceRoot":"","sources":["../../src/retrieval/activation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAGL,WAAW,EACX,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAEvC,8EAA8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,CAAC,GAAG,CAAC,CAAC;IACtE,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;QACjC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzC,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,mCAAmC,EAAE,CAAC;AACpF,CAAC"}
@@ -21,6 +21,19 @@ import type { Confidence, DecayClass } from "../types.js";
21
21
  * silently rewrite old files, which the owner ruled out.
22
22
  */
23
23
  export type FailureClass = "wrong_ref" | "naming_violation" | "skipped_verify" | "scope_violation" | "model_dispatch" | "framing_error" | "confidential_leak" | "publish_gate" | "other";
24
+ /**
25
+ * Evolution p4 (2026-09-17) — the soft-constraint ladder `ar corrections
26
+ * retier` computes via `tierOf()` (tools-logic/retier.ts):
27
+ * "gate" — hard-enforced, non-negotiable (subset of p0)
28
+ * "nudge" — surfaced but advisory
29
+ * "watch" — background-only, lowest priority
30
+ * Declared HERE (storage layer) rather than in retier.ts because the field
31
+ * it types (`CorrectionRecord.tier` below) lives here — retier.ts (tools-
32
+ * logic) imports this type FROM corrections.ts, never the reverse, matching
33
+ * this file's existing "low-level storage layer never imports the
34
+ * tools-logic stack" discipline (see betaPosterior's doc comment below).
35
+ */
36
+ export type CorrectionTier = "gate" | "nudge" | "watch";
24
37
  export interface CorrectionRecord {
25
38
  id: string;
26
39
  date: string;
@@ -138,6 +151,29 @@ export interface CorrectionRecord {
138
151
  * caller's original, unmixed list.
139
152
  */
140
153
  applies_when?: string[];
154
+ /**
155
+ * Evolution p4 (2026-09-17, soft-constraint ladder) — the LAST-PERSISTED
156
+ * output of `tierOf(record, asOfDay)` (tools-logic/retier.ts), written
157
+ * ONLY by `ar corrections retier --write` via `setCorrectionTier()`
158
+ * below. ADDITIVE + OPTIONAL: absent on every pre-p4 record and on any
159
+ * record `ar corrections retier` has never touched.
160
+ *
161
+ * READ-CONTRACT (the CHALLENGE this field's design had to resolve): this
162
+ * is a WRITE-TIME CACHE, not truth. `heeded_count`/`recurrence_count`/
163
+ * `not_violated_count`/`last_retrieved` all keep accruing between retier
164
+ * runs, so `tierOf(record, today)` can legitimately disagree with this
165
+ * field the moment ANY outcome lands after the last `--write`. Consumers
166
+ * that need a CURRENT tier (e.g. a future session_start gating decision)
167
+ * MUST call `tierOf()` fresh — this field exists so `ar corrections
168
+ * retier --dry-run` can show "current [stored] vs computed" drift and so
169
+ * `--write` has something idempotent to compare against (a second
170
+ * `--write` with unchanged inputs writes nothing — see retier.ts). The
171
+ * session_start render tag (evolution p4 goal 3) ALSO recomputes fresh
172
+ * rather than reading this field, for the same reason. Never treat
173
+ * absence as "watch" by convention — absence means "never retiered",
174
+ * which is a different fact than "computed watch".
175
+ */
176
+ tier?: CorrectionTier;
141
177
  }
142
178
  /**
143
179
  * v4 W1 (2026-07-02 field-design-options.md §A.1) — provenance of a
@@ -192,8 +228,21 @@ export interface CorrectionOutcome {
192
228
  *
193
229
  * Backward-compatibility: old readers that filter on the pre-C3 kind set skip
194
230
  * these new kinds without error (confirmed: rmr-report.mjs, activity-feed.ts).
231
+ *
232
+ * Evolution p1a (2026-09-17) — transcript-audit ledger-only verdicts:
233
+ * "cited" = a day's project transcripts show ≥2 unique ≥4-char rule
234
+ * content-words in ASSISTANT text (or the correction id
235
+ * literal appears) — the correction's topic was surfaced.
236
+ * "ignored" = neither cited nor recurred — the correction was injected
237
+ * that day but never surfaced in the transcripts.
238
+ * Both are LEDGER-ONLY (see recordOutcome's early-return) and are
239
+ * single-producer-gated to evidence starting "transcript-audit:", exactly
240
+ * like "not_triggered"'s "dream-audit:" gate above. "recurred" from this
241
+ * same instrument reuses the EXISTING "recurred" kind (counter-mutating,
242
+ * intended) and is NOT gated — session-end and check-action already
243
+ * produce "recurred" from other evidence.
195
244
  */
196
- kind: "retrieved" | "heeded" | "recurred" | "predicted" | "predict_hit" | "triggered" | "not_triggered" | "unknown" | "not_violated";
245
+ kind: "retrieved" | "heeded" | "recurred" | "predicted" | "predict_hit" | "triggered" | "not_triggered" | "unknown" | "not_violated" | "cited" | "ignored";
197
246
  /**
198
247
  * SEMANTIC timestamp (ISO) — the day the outcome belongs to. The dream-audit
199
248
  * path (C3b) deliberately backdates this to the audited day so day-bucketed
@@ -507,6 +556,48 @@ export interface WriteCorrectionResult {
507
556
  id?: string;
508
557
  }
509
558
  export declare function distillRuleIdentity(rule: string): string;
559
+ export interface WriteCorrectionOptions {
560
+ /**
561
+ * Evolution p1b seam (2026-09-17, `ar corrections harvest-implicit` — see
562
+ * implicit-harvest.ts and its worker report for the CHALLENGE this closes).
563
+ *
564
+ * writeCorrection's ONLY gate was `isLikelyRealCorrection` — hard noise
565
+ * gates (length/system-fragment/doc-header) FUSED with the actionable-scan
566
+ * (STRONG/WEAK imperative + preference) and the soft-acknowledgment gate,
567
+ * with no seam to run just the hard gates. That is fine for every existing
568
+ * producer (check.ts's structured human_correction form, which is already
569
+ * imperative-shaped by construction), but a signal-miner over IMPLICIT
570
+ * conversational corrections (negation-opener re-instructions, again-
571
+ * markers, repeated near-identical instructions) deliberately captures text
572
+ * that often has NO clean imperative/preference shape — that is the entire
573
+ * point of mining implicit signal the explicit gate was never meant to see.
574
+ * Worse, the soft-ack gate would frequently REJECT exactly the negation-
575
+ * opener shape this miner targets ("No, that's wrong. <4+ words of
576
+ * re-instruction>" matches the ack pattern's own optional "that's wrong"
577
+ * clause when the re-instruction is short — the historical Loop-7 failure
578
+ * the actionable-scan rescue exists to prevent, replayed from the opposite
579
+ * side once that rescue is skipped).
580
+ *
581
+ * Forking a parallel write path was rejected (violates "storage via the
582
+ * canonical write path" — the whole point is to keep on-write consolidation
583
+ * dedup, atomic write, and index regen shared with every other producer).
584
+ * Refactoring isLikelyRealCorrection's internals were rejected too (v3/S-M3
585
+ * dropHardNoise/actionable-scan/soft-ack sequencing is a precision-tuned,
586
+ * heavily-regression-tested unit — see the doc comments above; splitting it
587
+ * would risk the Loop 7/8/14 regressions it exists to prevent).
588
+ *
589
+ * Minimal seam instead: an OPTIONAL 3rd parameter, additive only — every
590
+ * existing call site (dozens, see corrections.ts callers) omits it and gets
591
+ * byte-identical behavior. When `skipActionableGate` is true, the gate run
592
+ * is `dropHardNoise` ONLY (still exported, still unchanged, still the exact
593
+ * precision floor every other producer clears) — never the actionable scan,
594
+ * never the soft-ack gate. Callers that opt in accept full responsibility
595
+ * for their OWN signal-specific vetting (this is why the brief's severity/
596
+ * weight/confidence for implicit records are hard-floored low — see
597
+ * implicit-harvest.ts).
598
+ */
599
+ skipActionableGate?: boolean;
600
+ }
510
601
  /**
511
602
  * Write a correction to persistent storage.
512
603
  * Auto-detects severity from the rule/context text.
@@ -516,7 +607,7 @@ export declare function distillRuleIdentity(rule: string): string;
516
607
  * are unaffected (the return value was void, now it is an object; ignoring it
517
608
  * still compiles and runs correctly).
518
609
  */
519
- export declare function writeCorrection(project: string, correction: CorrectionRecord): Promise<WriteCorrectionResult>;
610
+ export declare function writeCorrection(project: string, correction: CorrectionRecord, opts?: WriteCorrectionOptions): Promise<WriteCorrectionResult>;
520
611
  /**
521
612
  * TEST-ONLY instrumentation log — one entry (the project slug) appended per
522
613
  * actual corrections-directory enumeration inside readCorrections() below
@@ -593,8 +684,46 @@ export declare function retractCorrection(project: string, id: string, reason?:
593
684
  * string MUST start with "dream-audit:". Any other producer throws. This is
594
685
  * the core-level enforcement of the single-producer contract (the CLI's
595
686
  * `ar outcomes record` is the one caller that adds the prefix).
687
+ * - `cited` / `ignored` (evolution p1a, transcript-audit) are gated the same
688
+ * way: evidence MUST start with "transcript-audit:". Any other producer
689
+ * throws. `recurred` produced by this SAME instrument reuses the shared
690
+ * "recurred" kind and carries a "transcript-audit:<basename>" evidence
691
+ * prefix too, but is NOT gated here — session-end and check-action are
692
+ * pre-existing, legitimate "recurred" producers with their own evidence
693
+ * shapes.
596
694
  */
597
695
  export declare function recordOutcome(outcome: CorrectionOutcome): Promise<void>;
696
+ export interface SetCorrectionTierResult {
697
+ written: boolean;
698
+ /** Present only when `written` is false because of a lock-contention skip. */
699
+ error?: string;
700
+ }
701
+ /**
702
+ * Evolution p4 (2026-09-17, soft-constraint ladder) — the SANCTIONED
703
+ * single-record write path `ar corrections retier --write` uses to persist
704
+ * `tierOf()`'s (tools-logic/retier.ts) computed tier onto a correction.
705
+ * Mirrors `retractCorrection`'s locked read→find→mutate→atomic-rewrite→
706
+ * index-regen shape EXACTLY (same lock name, same existing-filename reuse,
707
+ * same atomic-write primitive) — this is a NEW field being written through
708
+ * the EXISTING write mechanism, not a new write mechanism. ADDITIVE: only
709
+ * `tier` changes; every other field on the record is preserved byte-for-byte.
710
+ *
711
+ * IDEMPOTENT BY CONSTRUCTION: no-ops (returns `{written:false}`, touches
712
+ * disk not at all — no lock even acquired past the read) when the record
713
+ * already carries this exact tier. This is what makes a second
714
+ * `ar corrections retier --write` run over unchanged inputs write zero
715
+ * records (see retier.ts's own `changed` guard, which this double-checks
716
+ * against a FRESH read rather than trusting the caller's snapshot).
717
+ *
718
+ * Lock-contention handling mirrors `recordOutcome`, not `retractCorrection`:
719
+ * retier writes MANY records in one CLI invocation (a loop, not a single
720
+ * human-typed command), so one record's lock timeout must not abort the
721
+ * whole run — it is caught, logged, and reported to the caller as a skip
722
+ * (re-runnable later; `tier` is a derived cache, never a ledger, so nothing
723
+ * is lost by skipping — the next `ar corrections retier --write` recomputes
724
+ * it fresh from `tierOf()`, not from any partial state here).
725
+ */
726
+ export declare function setCorrectionTier(project: string, id: string, tier: CorrectionTier): Promise<SetCorrectionTierResult>;
598
727
  /** One `_outcomes.jsonl` line that failed to parse (or lacked required fields). */
599
728
  export interface MalformedOutcomeRow {
600
729
  /** 1-based line number within _outcomes.jsonl. */
@@ -647,6 +776,15 @@ export interface RecomputedCounters {
647
776
  * increment site, L1049/L1052).
648
777
  */
649
778
  export declare function recomputeCorrectionCounters(events: CorrectionOutcome[], record: Pick<CorrectionRecord, "weight" | "severity">): RecomputedCounters;
779
+ /**
780
+ * Public read-only view of the outcomes ledger, bucketed per correction id
781
+ * (fix12 hygiene, 2026-09-12). Thin wrapper over parseOutcomesLedger so KPI
782
+ * surfaces (`ar stats` evidence-tiered heed split via storage/heed-tiers.ts)
783
+ * can classify full event lists without re-implementing ledger parsing.
784
+ * Malformed lines are silently dropped here — callers that need the
785
+ * quarantine trail use runOutcomesRebuild's dry-run instead.
786
+ */
787
+ export declare function readOutcomeEventsByCorrection(project: string): Map<string, CorrectionOutcome[]>;
650
788
  /** One correction's before/after divergence, plus the on-disk record needed to apply the fix. */
651
789
  export interface DivergenceEntry {
652
790
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"corrections.d.ts","sourceRoot":"","sources":["../../src/storage/corrections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAM1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,mBAAmB,GACnB,cAAc,GACd,OAAO,CAAC;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACnD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