@spike1292/claude-memory 0.0.0-stage → 0.14.0
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/LICENSE +21 -0
- package/README.md +412 -2
- package/hooks/distill-session.mjs +74 -0
- package/hooks/graph-staleness-check.mjs +25 -0
- package/hooks/hooks.json +94 -0
- package/hooks/insights-surface.mjs +48 -0
- package/hooks/lib/distill-session.mjs +1560 -0
- package/hooks/lib/dupe-report.mjs +61 -0
- package/hooks/lib/env-shell.mjs +92 -0
- package/hooks/lib/graph-staleness-check.mjs +394 -0
- package/hooks/lib/hook-io.mjs +715 -0
- package/hooks/lib/insights-surface.mjs +165 -0
- package/hooks/lib/memory-link-lint.mjs +499 -0
- package/hooks/lib/memory-recall.mjs +219 -0
- package/hooks/lib/omp.mjs +103 -0
- package/hooks/lib/opencode.mjs +231 -0
- package/hooks/lib/paths.mjs +452 -0
- package/hooks/lib/semantic-index-refresh.mjs +155 -0
- package/hooks/lib/validate-note.mjs +218 -0
- package/hooks/lib/vault-env.sh +110 -0
- package/hooks/memory-link-lint.mjs +65 -0
- package/hooks/memory-recall.mjs +251 -0
- package/hooks/semantic-index-refresh.mjs +23 -0
- package/hooks/session-context.mjs +9 -0
- package/hooks/validate-note.mjs +52 -0
- package/hooks/vault-memory-sync.sh +154 -0
- package/omp/index.js +1 -0
- package/opencode/index.js +1 -0
- package/package.json +51 -4
- package/scripts/claude-memory.mjs +31 -0
- package/scripts/doctor-perf.mjs +121 -0
- package/scripts/doctor.sh +558 -0
- package/scripts/env.mjs +6 -0
- package/scripts/lib/claude-memory.mjs +168 -0
- package/scripts/lib/doctor-perf.mjs +434 -0
- package/scripts/lib/hook-stats.mjs +864 -0
- package/scripts/lib/lexical.mjs +85 -0
- package/scripts/lib/memory-adopt.mjs +69 -0
- package/scripts/lib/memory-audit-checks.mjs +344 -0
- package/scripts/lib/memory-eval.mjs +381 -0
- package/scripts/lib/memory-mark.mjs +135 -0
- package/scripts/lib/memory-mcp.mjs +142 -0
- package/scripts/lib/memory-merge.mjs +316 -0
- package/scripts/lib/memory-mine.mjs +108 -0
- package/scripts/lib/memory-promote.mjs +207 -0
- package/scripts/lib/memory-prune.mjs +84 -0
- package/scripts/lib/memory-semantic.mjs +999 -0
- package/scripts/lib/memory-setup.mjs +170 -0
- package/scripts/lib/memory-synth-vault.mjs +538 -0
- package/scripts/lib/model-default.mjs +7 -0
- package/scripts/lib/models.mjs +58 -0
- package/scripts/lib/prune-logs.mjs +130 -0
- package/scripts/lib/recall-stats.mjs +354 -0
- package/scripts/lib/share-modules.mjs +70 -0
- package/scripts/lib/slim-install.mjs +162 -0
- package/scripts/lib/vault-mcp.mjs +405 -0
- package/scripts/memory-adopt.mjs +160 -0
- package/scripts/memory-audit-checks.mjs +375 -0
- package/scripts/memory-eval.mjs +753 -0
- package/scripts/memory-mark.mjs +39 -0
- package/scripts/memory-mcp.mjs +35 -0
- package/scripts/memory-merge.mjs +55 -0
- package/scripts/memory-prune.mjs +44 -0
- package/scripts/memory-semantic.mjs +1192 -0
- package/scripts/memory-setup.mjs +33 -0
- package/scripts/memory-synth-vault.mjs +251 -0
- package/scripts/prune-logs.mjs +42 -0
- package/scripts/share-modules.mjs +79 -0
- package/scripts/slim-install.mjs +55 -0
- package/scripts/vault-mcp.mjs +50 -0
- package/stubs/onnxruntime-web/index.mjs +11 -0
- package/stubs/onnxruntime-web/package.json +12 -0
- package/stubs/sharp/index.mjs +11 -0
- package/stubs/sharp/package.json +12 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Generate a FIXED synthetic vault + query sets, so retrieval numbers are reproducible.
|
|
3
|
+
//
|
|
4
|
+
// Deterministic: seeded PRNG, no Date.now(), no Math.random(). Same seed -> byte-identical vault.
|
|
5
|
+
// Prose is ordinary English/Dutch so meaning is real; only product NAMES are invented, so gold
|
|
6
|
+
// stays unique and never collides with a real note.
|
|
7
|
+
//
|
|
8
|
+
// The seed-7 baseline table, the rejected hardening attempt, and why the English case set is at
|
|
9
|
+
// its ceiling (must not be quoted as evidence — use the real-vault case sets for small deltas):
|
|
10
|
+
// docs/decisions/2026-08-15-synth-vault-baseline.md.
|
|
11
|
+
//
|
|
12
|
+
// Logic half; the CLI entry is scripts/memory-synth-vault.mjs.
|
|
13
|
+
// Tests: node --test scripts/lib/memory-synth-vault.test.mjs
|
|
14
|
+
//
|
|
15
|
+
// Usage:
|
|
16
|
+
// node scripts/memory-synth-vault.mjs --out /tmp/synthvault [--notes 300] [--seed 7] [--echoes 2]
|
|
17
|
+
// node memory-semantic.mjs --vault /tmp/synthvault --slug bench --index --rebuild
|
|
18
|
+
// node memory-eval.mjs --vault /tmp/synthvault --slug bench --run --cases /tmp/synthvault/cases-paraphrase.jsonl
|
|
19
|
+
|
|
20
|
+
// ---------------------------------------------------------------- seeded PRNG
|
|
21
|
+
/**
|
|
22
|
+
* @param {number} a
|
|
23
|
+
* @returns {() => number}
|
|
24
|
+
*/
|
|
25
|
+
export function mulberry32(a) {
|
|
26
|
+
return function () {
|
|
27
|
+
a |= 0;
|
|
28
|
+
a = (a + 0x6d2b79f5) | 0;
|
|
29
|
+
let t = Math.imul(a ^ (a >>> 15), 1 | a);
|
|
30
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
31
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ---------------------------------------------------------------- the material
|
|
36
|
+
// Each entry is one GOLD note. `title` words are deliberately absent from `ask` (the paraphrase),
|
|
37
|
+
// which is the whole point: a question that shares title tokens tests keyword matching, not meaning.
|
|
38
|
+
// `key` is the keyword-style question that SHOULD be easy. `nl` is the Dutch paraphrase.
|
|
39
|
+
export const DOMAINS = [
|
|
40
|
+
{
|
|
41
|
+
name: 'caching',
|
|
42
|
+
product: 'Vantrel',
|
|
43
|
+
cases: [
|
|
44
|
+
{
|
|
45
|
+
title: 'stale-html-survives-a-release',
|
|
46
|
+
body: 'The edge keeps handing back the previous build long after the rollout finishes, because the invalidation runs before the origin has the new files. Order the two and the window closes.',
|
|
47
|
+
ask: 'old pages keep being served to users after we ship a new version',
|
|
48
|
+
key: 'Vantrel stale html release invalidation',
|
|
49
|
+
nl: 'oude paginas worden nog steeds getoond nadat we een nieuwe versie hebben uitgerold',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: 'query-parameters-fragment-the-cache-key',
|
|
53
|
+
body: 'Every tracking parameter that reaches the key creates a separate stored copy, so the hit rate collapses while the object count explodes. An allowlist of the parameters that actually change the response fixes it.',
|
|
54
|
+
ask: 'our hit rate is terrible and we store thousands of near identical copies',
|
|
55
|
+
key: 'Vantrel cache key query parameter allowlist',
|
|
56
|
+
nl: 'onze hit ratio is slecht en we bewaren duizenden bijna identieke kopieen',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'immutable-assets-share-a-policy-with-mutable-media',
|
|
60
|
+
body: 'Hashed files can be kept for a year, uploaded images cannot. One shared lifetime forces the safe short value onto both, so the fingerprinted files are re-fetched for no reason.',
|
|
61
|
+
ask: 'files with a content hash in the name are downloaded again far too often',
|
|
62
|
+
key: 'Vantrel immutable asset media cache policy split',
|
|
63
|
+
nl: 'bestanden met een hash in de naam worden veel te vaak opnieuw opgehaald',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'origin-owns-the-lifetime-header',
|
|
67
|
+
body: 'The delivery layer only repeats what the backend declares. Tuning the distribution while the backend still sends a one-minute lifetime changes nothing at all.',
|
|
68
|
+
ask: 'i changed the setting on the distribution and nothing happened',
|
|
69
|
+
key: 'Vantrel origin cache control header respected',
|
|
70
|
+
nl: 'ik heb de instelling op de distributie aangepast en er gebeurde niets',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: 'purge-is-eventually-consistent-across-regions',
|
|
74
|
+
body: 'A clear request returns success immediately but each location drops its copy on its own schedule, so two people in different countries disagree about what is live for several minutes.',
|
|
75
|
+
ask: 'two colleagues in different countries see different content at the same moment',
|
|
76
|
+
key: 'Vantrel purge eventual consistency regions',
|
|
77
|
+
nl: 'twee collegas in verschillende landen zien op hetzelfde moment andere inhoud',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'authentication',
|
|
83
|
+
product: 'Kelbrin',
|
|
84
|
+
cases: [
|
|
85
|
+
{
|
|
86
|
+
title: 'refresh-storm-after-a-clock-skew',
|
|
87
|
+
body: 'When the server drifts ahead, every client believes its credential expired and asks for a new one at the same instant. The renewal endpoint then falls over from self-inflicted load.',
|
|
88
|
+
ask: 'all our users were signed out at once and the renewal service collapsed',
|
|
89
|
+
key: 'Kelbrin refresh storm clock skew',
|
|
90
|
+
nl: 'al onze gebruikers werden tegelijk uitgelogd en de vernieuwdienst viel om',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: 'the-identity-cookie-cannot-be-read-by-the-browser',
|
|
94
|
+
body: 'It is marked so that only the server sees it, which is correct, and it also means the page script that tries to attach the account to an error report always finds nothing.',
|
|
95
|
+
ask: 'our crash reports never show which account hit the problem',
|
|
96
|
+
key: 'Kelbrin httponly cookie account attribution',
|
|
97
|
+
nl: 'onze foutmeldingen laten nooit zien welk account het probleem had',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: 'open-redirect-hides-in-the-return-address',
|
|
101
|
+
body: 'The parameter that says where to go after signing in is taken at face value, so an attacker can send someone to their own page carrying a valid session.',
|
|
102
|
+
ask: 'can someone forward a signed in visitor to a site they control',
|
|
103
|
+
key: 'Kelbrin open redirect return url validation',
|
|
104
|
+
nl: 'kan iemand een ingelogde bezoeker doorsturen naar een eigen website',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: 'scope-gap-returns-a-permission-error-not-a-login-prompt',
|
|
108
|
+
body: 'The gateway accepts the credential, then the backend refuses one capability it never granted. It reads as a broken sign-in, but nothing about the sign-in is wrong.',
|
|
109
|
+
ask: 'the api says forbidden even though the person is definitely signed in',
|
|
110
|
+
key: 'Kelbrin scope capability gap 401',
|
|
111
|
+
nl: 'de api zegt verboden terwijl de persoon zeker is ingelogd',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: 'server-side-rendering-has-no-browser-to-hold-the-session',
|
|
115
|
+
body: 'The first render happens where no cookie jar exists, so anything that assumes a signed-in reader produces the anonymous variant and then flickers when the page wakes up.',
|
|
116
|
+
ask: 'the page briefly shows the logged out version before correcting itself',
|
|
117
|
+
key: 'Kelbrin ssr session cookie first render',
|
|
118
|
+
nl: 'de pagina toont kort de uitgelogde versie voordat hij zichzelf corrigeert',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'monitoring',
|
|
124
|
+
product: 'Orsalind',
|
|
125
|
+
cases: [
|
|
126
|
+
{
|
|
127
|
+
title: 'thresholds-calibrated-on-a-quiet-period',
|
|
128
|
+
body: 'The numbers were chosen while almost no real visitors were present, so they describe an empty system. After the switchover the same limits fire constantly or never fire at all.',
|
|
129
|
+
ask: 'is it safe to set alert limits from what the graphs show right now',
|
|
130
|
+
key: 'Orsalind alarm threshold calibration baseline',
|
|
131
|
+
nl: 'kan ik alarmgrenzen baseren op wat de grafieken nu laten zien',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: 'the-widget-is-keyed-by-full-resource-address',
|
|
135
|
+
body: 'Supplying the short name produces an empty panel rather than an error, so the board looks healthy while measuring nothing.',
|
|
136
|
+
ask: 'my dashboard panel is blank but it does not report any failure',
|
|
137
|
+
key: 'Orsalind widget dimension full arn empty tile',
|
|
138
|
+
nl: 'mijn dashboardpaneel is leeg maar geeft geen enkele fout',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: 'log-search-truncates-a-large-response',
|
|
142
|
+
body: 'The query stops at a size limit and returns what fits. Absence of a record therefore proves nothing unless every page was walked.',
|
|
143
|
+
ask: 'i searched the logs and found nothing, can i conclude it never happened',
|
|
144
|
+
key: 'Orsalind filter log events 1mb truncation paginate',
|
|
145
|
+
nl: 'ik heb de logs doorzocht en niets gevonden, mag ik concluderen dat het nooit gebeurde',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: 'panel-heights-differ-by-type-and-later-rows-float-up',
|
|
149
|
+
body: 'A single-value tile is shorter than a chart, and the layout engine pulls the following row into the leftover space, so a board built in a tidy grid renders as a staircase.',
|
|
150
|
+
ask: 'my dashboard layout looks scrambled after i added one small tile',
|
|
151
|
+
key: 'Orsalind widget height single value graph layout',
|
|
152
|
+
nl: 'mijn dashboardindeling ziet er rommelig uit nadat ik een kleine tegel toevoegde',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
title: 'detailed-collection-is-billed-per-series-and-per-task',
|
|
156
|
+
body: 'The richer level multiplies with how many instances run, so a fleet that scales out at peak also scales the invoice, and list prices overstate it when volume discounts already apply.',
|
|
157
|
+
ask: 'how much does the richer observability tier actually cost us per month',
|
|
158
|
+
key: 'Orsalind container insights enhanced pricing tier',
|
|
159
|
+
nl: 'hoeveel kost de uitgebreide observatielaag ons daadwerkelijk per maand',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'delivery-pipeline',
|
|
165
|
+
product: 'Trestamo',
|
|
166
|
+
cases: [
|
|
167
|
+
{
|
|
168
|
+
title: 'a-green-badge-hides-cancelled-child-work',
|
|
169
|
+
body: 'The parent reports success while jobs inside a nested run were quietly dropped, so a deploy that never happened looks finished.',
|
|
170
|
+
ask: 'the build says it passed but the release never reached production',
|
|
171
|
+
key: 'Trestamo pipeline green badge cancelled child jobs',
|
|
172
|
+
nl: 'de build zegt geslaagd maar de release bereikte productie nooit',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
title: 'squash-merging-destroys-the-shared-ancestor',
|
|
176
|
+
body: 'Collapsing a branch into one commit removes the point both sides agreed on, so a later attempt to undo the change has nothing to subtract from.',
|
|
177
|
+
ask: 'why can i not revert that change cleanly any more',
|
|
178
|
+
key: 'Trestamo squash merge base revert broken',
|
|
179
|
+
nl: 'waarom kan ik die wijziging niet meer netjes terugdraaien',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
title: 'in-flight-work-outruns-a-stale-queued-job',
|
|
183
|
+
body: 'A newer run overtakes an older queued one, and the older one lands last, putting the previous artifact back on top of the newer one.',
|
|
184
|
+
ask: 'an older version replaced the newer one after both finished',
|
|
185
|
+
key: 'Trestamo pipeline auto cancel resource group ordering',
|
|
186
|
+
nl: 'een oudere versie verving de nieuwere nadat beide klaar waren',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
title: 'nested-runs-are-invisible-to-the-listing-endpoint',
|
|
190
|
+
body: 'Asking for the runs of a project omits anything triggered as a child, so an inventory built from that list silently misses whole stages.',
|
|
191
|
+
ask: 'my script counted the builds but missed several stages entirely',
|
|
192
|
+
key: 'Trestamo child pipeline bridges endpoint listing',
|
|
193
|
+
nl: 'mijn script telde de runs maar miste verschillende fases volledig',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
title: 'disabling-a-noisy-check-hides-a-real-one',
|
|
197
|
+
body: 'The step was already failing before this change and was switched off to get a clean run, which also switched off the signal that would have caught the new fault.',
|
|
198
|
+
ask: 'should i switch off something that was failing before my work started',
|
|
199
|
+
key: 'Trestamo pre-existing non blocking failure disable',
|
|
200
|
+
nl: 'moet ik een controle uitzetten die al kapot was voor mijn wijziging',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'edge-security',
|
|
206
|
+
product: 'Belmoyra',
|
|
207
|
+
cases: [
|
|
208
|
+
{
|
|
209
|
+
title: 'the-filter-rule-lives-in-another-teams-account',
|
|
210
|
+
body: 'The block happens before any of our own configuration is consulted, and the change has to be requested from the group that owns it rather than raised as a change to our own repository.',
|
|
211
|
+
ask: 'who do i ask to open a blocked path, we cannot change it ourselves',
|
|
212
|
+
key: 'Belmoyra web acl rule ownership other team',
|
|
213
|
+
nl: 'aan wie vraag ik om een geblokkeerd pad te openen, we kunnen het zelf niet wijzigen',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
title: 'automated-crawlers-cause-the-refusal-spikes',
|
|
217
|
+
body: 'The rejections arrive in waves on a weekly rhythm and almost all carry one automated agent string. They track the crawler, not anything we released.',
|
|
218
|
+
ask: 'we get bursts of rejected requests every week with no deploy nearby',
|
|
219
|
+
key: 'Belmoyra bot rule 403 spike weekly cycle',
|
|
220
|
+
nl: 'we krijgen elke week golven van geweigerde verzoeken zonder release in de buurt',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
title: 'the-corporate-proxy-mimics-a-permission-failure',
|
|
224
|
+
body: 'A network appliance answers instead of the service and returns a refusal that carries headers implying a real account check, so it looks like a rights problem rather than interception.',
|
|
225
|
+
ask: 'the tool says forbidden, is my access dead or is something in between',
|
|
226
|
+
key: 'Belmoyra proxy intercept 403 false permission failure',
|
|
227
|
+
nl: 'de tool zegt verboden, is mijn toegang verlopen of zit er iets tussen',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
title: 'a-probe-that-expects-success-reports-its-own-runtime',
|
|
231
|
+
body: 'The healthy answer is a redirect, but the check only accepts a plain success, so it records a failure for the whole time it runs and the duration looks like an outage.',
|
|
232
|
+
ask: 'my availability check reported an outage exactly as long as the check itself',
|
|
233
|
+
key: 'Belmoyra probe expects 200 healthy is 302',
|
|
234
|
+
nl: 'mijn beschikbaarheidscontrole meldde een storing precies zo lang als de controle zelf duurde',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
title: 'non-production-stays-closed-to-the-public-internet',
|
|
238
|
+
body: 'Only the live environment was opened. The others still answer nothing outside the office network, which is intended and is not a fault to be reported.',
|
|
239
|
+
ask: 'the test environment does not answer from my home connection',
|
|
240
|
+
key: 'Belmoyra non production egress restricted corporate',
|
|
241
|
+
nl: 'de testomgeving reageert niet vanaf mijn thuisverbinding',
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'memory-and-runtime',
|
|
247
|
+
product: 'Quorvex',
|
|
248
|
+
cases: [
|
|
249
|
+
{
|
|
250
|
+
title: 'the-interpreter-heap-cap-sits-above-the-container-limit',
|
|
251
|
+
body: 'The process is allowed to grow past what the box will give it, so instead of collecting garbage it is killed outright and the crash looks like an unrelated restart.',
|
|
252
|
+
ask: 'our service is being terminated instead of cleaning up its own memory',
|
|
253
|
+
key: 'Quorvex heap cap container memory oom kill',
|
|
254
|
+
nl: 'onze dienst wordt afgebroken in plaats van zijn eigen geheugen op te ruimen',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
title: 'a-build-argument-does-not-survive-into-the-running-image',
|
|
258
|
+
body: 'The value is available while assembling the image and then disappears, so the running process falls back to a default nobody chose.',
|
|
259
|
+
ask: 'the value i supplied while packaging is gone once the process starts',
|
|
260
|
+
key: 'Quorvex build arg env runtime not persisted',
|
|
261
|
+
nl: 'de instelling die ik meegaf tijdens de build ontbreekt als de container draait',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
title: 'a-cold-cache-plus-a-crawler-wave-exhausts-the-workers',
|
|
265
|
+
body: 'Every request has to be produced from scratch at the moment a bulk reader arrives, and the two together push the renderers past their ceiling.',
|
|
266
|
+
ask: 'we had a burst of errors when an automated reader arrived on an empty store',
|
|
267
|
+
key: 'Quorvex cold cache crawler storm ssr workers',
|
|
268
|
+
nl: 'we hadden een golf van fouten toen een bulklezer arriveerde bij een lege cache',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
title: 'addresses-run-out-before-capacity-does',
|
|
272
|
+
body: 'The subnet cannot number any more instances even though there is plenty of compute left, and no built-in measurement reports the remaining headroom.',
|
|
273
|
+
ask: 'scaling stopped even though the cluster still had plenty of room',
|
|
274
|
+
key: 'Quorvex subnet ip exhaustion no native metric',
|
|
275
|
+
nl: 'het opschalen stopte terwijl er nog capaciteit over was in het cluster',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
title: 'the-rolling-controller-makes-one-count-meaningless',
|
|
279
|
+
body: 'With the simple release strategy the grouping counter never moves, so a panel built on it shows a flat line that means nothing rather than a healthy system.',
|
|
280
|
+
ask: 'this counter never changes, is the system healthy or is the panel wrong',
|
|
281
|
+
key: 'Quorvex rolling deployment controller task set count',
|
|
282
|
+
nl: 'deze teller verandert nooit, is het systeem gezond of klopt het paneel niet',
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'workspace-tooling',
|
|
288
|
+
product: 'Haldreth',
|
|
289
|
+
cases: [
|
|
290
|
+
{
|
|
291
|
+
title: 'boundary-tags-only-govern-projects-that-carry-them',
|
|
292
|
+
body: 'A package with no label is exempt from the import rules, so a forbidden dependency passes review because the checker was never asked about it.',
|
|
293
|
+
ask: 'a banned import slipped through, why did the rule not catch it',
|
|
294
|
+
key: 'Haldreth module boundary tag untagged project',
|
|
295
|
+
nl: 'een verboden import glipte erdoor, waarom greep de regel niet in',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
title: 'parallel-test-workers-exhaust-the-machine',
|
|
299
|
+
body: 'Each worker loads its own copy and the total outgrows the host, so the suite dies from resource pressure rather than from a real assertion.',
|
|
300
|
+
ask: 'the suite dies without any assertion actually going red',
|
|
301
|
+
key: 'Haldreth jest parallel workers memory run in band',
|
|
302
|
+
nl: 'de testrun sterft zonder dat er echt een test faalt',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
title: 'a-barrel-file-drags-in-the-whole-area',
|
|
306
|
+
body: 'Importing one symbol through the shared entry point pulls every sibling with it, which inflates the bundle and hides which parts are really used.',
|
|
307
|
+
ask: 'our bundle grew enormously after importing a single helper',
|
|
308
|
+
key: 'Haldreth barrel index export bundle size',
|
|
309
|
+
nl: 'onze bundel groeide enorm nadat we een enkele helper importeerden',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
title: 'the-type-checker-is-skipped-by-the-fast-transform',
|
|
313
|
+
body: 'The compiler option that speeds compilation also means specification files are transformed without ever being checked, so a broken type ships green.',
|
|
314
|
+
ask: 'my test compiled fine but the types in it were wrong all along',
|
|
315
|
+
key: 'Haldreth isolated modules ts-jest no typecheck',
|
|
316
|
+
nl: 'mijn test compileerde prima maar de types erin waren al die tijd fout',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
title: 'the-formatter-rewrites-machine-edited-tables',
|
|
320
|
+
body: 'A script that edits a generated table has its output reflowed on commit, so the next run no longer recognises what it wrote.',
|
|
321
|
+
ask: 'my generator stopped matching its own output after committing',
|
|
322
|
+
key: 'Haldreth prettier reformat generated table script',
|
|
323
|
+
nl: 'mijn generator herkende zijn eigen uitvoer niet meer na het committen',
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: 'issue-tracking',
|
|
329
|
+
product: 'Nirvale',
|
|
330
|
+
cases: [
|
|
331
|
+
{
|
|
332
|
+
title: 'the-duplicate-was-already-open-for-months',
|
|
333
|
+
body: 'A new item was raised for work that had been recorded long before, including in closed and rejected states, so effort was split across two records nobody reconciled.',
|
|
334
|
+
ask: 'i raised a work item that turned out to exist somewhere else',
|
|
335
|
+
key: 'Nirvale duplicate ticket search backlog first',
|
|
336
|
+
nl: 'ik heb een werkitem aangemaakt dat al bleek te bestaan',
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
title: 'creation-hangs-when-a-parent-is-supplied-inline',
|
|
340
|
+
body: 'Passing the containing record while creating the item never returns. Creating it bare and attaching the parent afterwards works every time.',
|
|
341
|
+
ask: 'the command never finishes when i also give it the containing record',
|
|
342
|
+
key: 'Nirvale create hangs parent epic flag',
|
|
343
|
+
nl: 'de opdracht eindigt nooit als ik ook het bovenliggende record meegeef',
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
title: 'an-empty-description-is-still-a-claim-on-the-work',
|
|
347
|
+
body: 'A stub record with no text still represents a decision that the work belongs to someone. Repurpose it rather than opening a rival next to it.',
|
|
348
|
+
ask: 'there is a blank entry already, should i make a proper new one instead',
|
|
349
|
+
key: 'Nirvale empty description stub repurpose not rival',
|
|
350
|
+
nl: 'er bestaat een lege invoer, moet ik een nette nieuwe maken',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
title: 'two-workflows-share-one-board',
|
|
354
|
+
body: 'One record type can move between any states while another is gated stage by stage, so a transition that works for one is refused for the other on the same board.',
|
|
355
|
+
ask: 'the same status change is accepted for one item and refused for another',
|
|
356
|
+
key: 'Nirvale board two workflows story feature gated',
|
|
357
|
+
nl: 'dezelfde statuswijziging wordt bij het ene item geaccepteerd en bij het andere geweigerd',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
title: 'an-inline-comment-lands-without-its-position',
|
|
361
|
+
body: 'The call returns a success code and creates a note with no anchor, so the remark appears detached from the line it was about.',
|
|
362
|
+
ask: 'my review remark attached itself to the wrong place in the change',
|
|
363
|
+
key: 'Nirvale inline comment position dropped 201',
|
|
364
|
+
nl: 'mijn revisieopmerking kwam op de verkeerde plek in de wijziging terecht',
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
];
|
|
369
|
+
|
|
370
|
+
// ECHO notes: the hardening lever — one gold-diverging distractor per case. Why the first version
|
|
371
|
+
// had no headroom, and what was tried: docs/decisions/2026-08-15-synth-vault-baseline.md.
|
|
372
|
+
//
|
|
373
|
+
// Danger: an echo that is TOO close stops being a distractor and becomes a second valid answer,
|
|
374
|
+
// making gold ambiguous. Verify with the keyword case set: it must still find gold first. Keyword
|
|
375
|
+
// recall holding while paraphrase recall drops means the echo added difficulty without destroying
|
|
376
|
+
// gold identity; keyword recall dropping too means the echo is ambiguous and must be weakened.
|
|
377
|
+
export const ECHO_CAUSES = [
|
|
378
|
+
[
|
|
379
|
+
'a stale configuration default nobody revisited',
|
|
380
|
+
'change the default and redeploy the component that reads it',
|
|
381
|
+
],
|
|
382
|
+
[
|
|
383
|
+
'a retry policy that hides the first failure',
|
|
384
|
+
'surface the first failure instead of swallowing it',
|
|
385
|
+
],
|
|
386
|
+
[
|
|
387
|
+
'a permission that was granted at the wrong level',
|
|
388
|
+
'move the grant to the level that actually evaluates it',
|
|
389
|
+
],
|
|
390
|
+
];
|
|
391
|
+
|
|
392
|
+
// Filler notes are never gold. They exist to be plausible competition — the real failure mode
|
|
393
|
+
// measured on 2026-08-15 was the right note losing to a SIMILAR SIBLING, not to a random note.
|
|
394
|
+
export const FILLER_ASPECTS = [
|
|
395
|
+
[
|
|
396
|
+
'rollout-checklist',
|
|
397
|
+
'A step by step list used before a change goes out, covering who approves it and what gets checked afterwards.',
|
|
398
|
+
],
|
|
399
|
+
[
|
|
400
|
+
'naming-conventions',
|
|
401
|
+
'How things in this area are named, which prefixes are reserved, and what a reviewer should reject.',
|
|
402
|
+
],
|
|
403
|
+
[
|
|
404
|
+
'ownership-and-escalation',
|
|
405
|
+
'Who is accountable for this area, who to page outside office hours, and what counts as urgent.',
|
|
406
|
+
],
|
|
407
|
+
[
|
|
408
|
+
'known-limitations',
|
|
409
|
+
'Behaviour that looks like a defect but is accepted, with the reason it has not been changed.',
|
|
410
|
+
],
|
|
411
|
+
[
|
|
412
|
+
'glossary-of-terms',
|
|
413
|
+
'Short definitions for the words used across this area so that new readers are not guessing.',
|
|
414
|
+
],
|
|
415
|
+
[
|
|
416
|
+
'review-guidance',
|
|
417
|
+
'What a reviewer should look at first in this area and which mistakes recur most often.',
|
|
418
|
+
],
|
|
419
|
+
[
|
|
420
|
+
'historic-decisions',
|
|
421
|
+
'Choices made earlier in this area, the alternatives considered, and why they were set aside.',
|
|
422
|
+
],
|
|
423
|
+
[
|
|
424
|
+
'test-strategy',
|
|
425
|
+
'Which behaviour is covered automatically here, what is checked by hand, and where the gaps are.',
|
|
426
|
+
],
|
|
427
|
+
];
|
|
428
|
+
|
|
429
|
+
// One knowledge update per domain, in DOMAINS order, on a topic no gold case covers. The older
|
|
430
|
+
// note keeps its claim with the protocol's supersession marker; the newer one must win `ask`.
|
|
431
|
+
export const SUPERSEDED = [
|
|
432
|
+
{
|
|
433
|
+
topic: 'purge-request-limit',
|
|
434
|
+
before:
|
|
435
|
+
'Purge requests are capped at one hundred paths per call, so large releases split them into batches.',
|
|
436
|
+
after:
|
|
437
|
+
'Purge requests now accept up to five thousand paths per call, so a release sends them in one batch.',
|
|
438
|
+
ask: 'how many paths can one purge request carry',
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
topic: 'session-lifetime',
|
|
442
|
+
before:
|
|
443
|
+
'A signed-in session lasts eight hours and then the user is sent back to the login page.',
|
|
444
|
+
after:
|
|
445
|
+
'A signed-in session now lasts thirty days, renewed silently while the user stays active.',
|
|
446
|
+
ask: 'how long does a signed-in session last before people must log in again',
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
topic: 'metric-retention',
|
|
450
|
+
before:
|
|
451
|
+
'Raw metric samples are kept for fourteen days before they are rolled up into hourly averages.',
|
|
452
|
+
after:
|
|
453
|
+
'Raw metric samples are now kept for ninety days before they are rolled up into hourly averages.',
|
|
454
|
+
ask: 'how many days of raw metric samples do we keep',
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
topic: 'deploy-window',
|
|
458
|
+
before:
|
|
459
|
+
'Production deploys are allowed only on weekday mornings, never after lunch or on Fridays.',
|
|
460
|
+
after: 'Production deploys are now allowed at any hour on any weekday, Fridays included.',
|
|
461
|
+
ask: 'when are we allowed to deploy to production',
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
topic: 'rate-limit-threshold',
|
|
465
|
+
before: 'A single client address is blocked after three hundred requests in one minute.',
|
|
466
|
+
after: 'A single client address is now blocked after twelve hundred requests in one minute.',
|
|
467
|
+
ask: 'how many requests per minute can one client send before it is blocked',
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
topic: 'heap-ceiling',
|
|
471
|
+
before:
|
|
472
|
+
'Worker processes run with a heap ceiling of two gigabytes and restart when they reach it.',
|
|
473
|
+
after:
|
|
474
|
+
'Worker processes now run with a heap ceiling of six gigabytes and restart when they reach it.',
|
|
475
|
+
ask: 'how much heap may a worker process use before it restarts',
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
topic: 'formatter-choice',
|
|
479
|
+
before:
|
|
480
|
+
'Every package is formatted with the old house formatter, run from a shared pre-commit hook.',
|
|
481
|
+
after:
|
|
482
|
+
'Every package is now formatted by the editor on save, and the shared pre-commit hook is gone.',
|
|
483
|
+
ask: 'how is code formatting enforced across the packages',
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
topic: 'stale-ticket-policy',
|
|
487
|
+
before: 'Tickets with no activity for thirty days are closed automatically with a polite note.',
|
|
488
|
+
after:
|
|
489
|
+
'Tickets with no activity are never closed automatically; a person reviews them each quarter.',
|
|
490
|
+
ask: 'what happens to tickets that nobody has touched for a long time',
|
|
491
|
+
},
|
|
492
|
+
];
|
|
493
|
+
export const SUPERSEDED_ON = '2026-03-02';
|
|
494
|
+
|
|
495
|
+
// Questions with no answer anywhere in the vault: the recall hook must inject nothing for them.
|
|
496
|
+
export const ABSTAIN = [
|
|
497
|
+
'how long should sourdough proof overnight in a cold kitchen',
|
|
498
|
+
'which grass seed grows best in a shady back garden',
|
|
499
|
+
'what is a good beginner route for climbing in the Alps',
|
|
500
|
+
'how do I remove a red wine stain from a wool carpet',
|
|
501
|
+
'when should tomato seedlings be moved outdoors in spring',
|
|
502
|
+
'what are the rules for castling in a game of chess',
|
|
503
|
+
'how often should a bicycle chain be cleaned and oiled',
|
|
504
|
+
'which film won the most awards at the ceremony last year',
|
|
505
|
+
];
|
|
506
|
+
|
|
507
|
+
// ---------------------------------------------------------------- generation
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @param {string} name
|
|
511
|
+
* @param {string} description
|
|
512
|
+
* @param {string} body
|
|
513
|
+
* @param {string[]} aliases
|
|
514
|
+
* @param {string[]} links
|
|
515
|
+
* @returns {string}
|
|
516
|
+
*/
|
|
517
|
+
export function noteText(name, description, body, aliases, links) {
|
|
518
|
+
return `---
|
|
519
|
+
name: ${name}
|
|
520
|
+
description: "${description}"
|
|
521
|
+
synthetic: true
|
|
522
|
+
metadata:
|
|
523
|
+
type: reference
|
|
524
|
+
confidence: high
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
# ${description}
|
|
528
|
+
|
|
529
|
+
${body}
|
|
530
|
+
|
|
531
|
+
## Detail
|
|
532
|
+
|
|
533
|
+
${body} This section repeats the substance so the note has more than one retrievable region, the
|
|
534
|
+
way a real note does. ${links.map((l) => `See [[${l}]].`).join(' ')}
|
|
535
|
+
|
|
536
|
+
_Also asked as: ${aliases.join(', ')}._
|
|
537
|
+
`;
|
|
538
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// The active embedding model, in ONE place — CLAUDE.md's Retrieval section explains why a drifting default is silent rather than an error.
|
|
2
|
+
// Changing this is a real change (different model = different index, different dupe/cluster thresholds in models.mjs) — verify with memory-eval.mjs --run --cases "$CLAUDE_MEMORY_HOME/eval/<set>.jsonl" first.
|
|
3
|
+
import { config } from '../../hooks/lib/paths.mjs';
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_MODEL = 'bge-m3';
|
|
6
|
+
export const activeModel = () =>
|
|
7
|
+
process.env.MEMORY_SEMANTIC_MODEL || config().model || DEFAULT_MODEL;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Model profiles, in a module of their own — CHANGELOG.md's 0.4.0 entry has why (importing
|
|
2
|
+
// memory-semantic.mjs just for this list takes a caller down on a bad config value).
|
|
3
|
+
// Override with MEMORY_SEMANTIC_MODEL=<key>. Batch 1 for every model; padding shifts a vector
|
|
4
|
+
// 0.014 where competing notes sit ~0.001 apart (2026-08-15) — sweep in
|
|
5
|
+
// docs/decisions/2026-08-15-model-choice.md.
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {object} ModelProfile
|
|
8
|
+
* @property {string} id
|
|
9
|
+
* @property {number} dim
|
|
10
|
+
* @property {number} maxChars
|
|
11
|
+
* @property {'mean'|'cls'} pool
|
|
12
|
+
* @property {string} q
|
|
13
|
+
* @property {string} d
|
|
14
|
+
* @property {number} dupeMin
|
|
15
|
+
* @property {number} clusterMin
|
|
16
|
+
* @property {number} [batch]
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** @type {Record<string, ModelProfile>} */
|
|
20
|
+
export const MODELS = {
|
|
21
|
+
// dupeMin is model-specific, not transferable — sweep: docs/decisions/2026-08-15-model-choice.md.
|
|
22
|
+
// Mean pooling, not cls, despite the model card — measured against it (same doc).
|
|
23
|
+
'bge-small-en': {
|
|
24
|
+
id: 'Xenova/bge-small-en-v1.5',
|
|
25
|
+
dim: 384,
|
|
26
|
+
maxChars: 1800,
|
|
27
|
+
pool: 'mean',
|
|
28
|
+
q: 'Represent this sentence for searching relevant passages: ',
|
|
29
|
+
d: '',
|
|
30
|
+
dupeMin: 0.86,
|
|
31
|
+
clusterMin: 0.8,
|
|
32
|
+
},
|
|
33
|
+
// Better Dutch, large English regression — sweep: docs/decisions/2026-08-15-model-choice.md.
|
|
34
|
+
// Available for Dutch-heavy work; not the default.
|
|
35
|
+
'e5-multi': {
|
|
36
|
+
id: 'Xenova/multilingual-e5-small',
|
|
37
|
+
dim: 384,
|
|
38
|
+
maxChars: 1600,
|
|
39
|
+
pool: 'mean',
|
|
40
|
+
q: 'query: ',
|
|
41
|
+
d: 'passage: ',
|
|
42
|
+
dupeMin: 0.95,
|
|
43
|
+
clusterMin: 0.92,
|
|
44
|
+
},
|
|
45
|
+
// dupeMin 0.75 / clusterMin 0.72 measured 2026-08-17 — do not copy or scale from e5-multi, m3's
|
|
46
|
+
// similarity band sits low and wide, the opposite. Full sweep and cost re-evaluation:
|
|
47
|
+
// docs/decisions/2026-08-15-model-choice.md.
|
|
48
|
+
'bge-m3': {
|
|
49
|
+
id: 'Xenova/bge-m3',
|
|
50
|
+
dim: 1024,
|
|
51
|
+
maxChars: 1800,
|
|
52
|
+
d: '',
|
|
53
|
+
q: '',
|
|
54
|
+
pool: 'cls',
|
|
55
|
+
dupeMin: 0.75,
|
|
56
|
+
clusterMin: 0.72,
|
|
57
|
+
},
|
|
58
|
+
};
|