spexcode 0.2.7 → 0.2.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spexcode",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "SpexCode — a spec-driven, self-developing dev tool. The `spex` CLI + spec server reads the .spec tree and its git history, and serves the dashboard.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,14 +23,18 @@ export type ContentProbe = {
|
|
|
23
23
|
behind(anchorSha: string, path: string): number
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// (anchor, HEAD) name two immutable trees, so entries never invalidate; the LRU only bounds memory
|
|
26
|
+
// (anchor, HEAD) name two immutable trees, so entries never invalidate; the LRU only bounds memory,
|
|
27
|
+
// sized above the largest adopter reading corpus — one entry per (reading, path) worst case — so a
|
|
28
|
+
// repeat board build never thrashes back into forking (a bound below the corpus's distinct key count
|
|
29
|
+
// turns a fixed-order rebuild into sequential thrash: every pass evicts the whole memo before cycling
|
|
30
|
+
// back, re-forking one git child per key forever — scenariofresh's oidMemo sizing rule).
|
|
27
31
|
const diffMemo = new Map<string, Set<string> | null>()
|
|
28
32
|
const behindMemo = new Map<string, number>()
|
|
29
33
|
function memo<V>(m: Map<string, V>, k: string, build: () => V): V {
|
|
30
34
|
if (m.has(k)) { const v = m.get(k)!; m.delete(k); m.set(k, v); return v }
|
|
31
35
|
const v = build()
|
|
32
36
|
m.set(k, v)
|
|
33
|
-
if (m.size >
|
|
37
|
+
if (m.size > 4096) m.delete(m.keys().next().value!)
|
|
34
38
|
return v
|
|
35
39
|
}
|
|
36
40
|
|