@arcforge/platform 2.0.197 → 2.0.199

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": "@arcforge/platform",
3
- "version": "2.0.197",
3
+ "version": "2.0.199",
4
4
  "description": "The Axon developer platform — headless project discovery, blueprint scanning, typegen, agent lifecycle, registry, benches and tests. Shared by the CLI/TUI and the Fleet extension.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -44,20 +44,20 @@
44
44
  "deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
45
45
  },
46
46
  "dependencies": {
47
- "@arcforge/session": "2.0.197",
48
- "@arcforge/engines": "2.0.197",
49
- "@arcforge/err": "2.0.197",
50
- "@arcforge/types": "2.0.197",
51
- "@arcforge/cloud": "2.0.197",
52
- "@arcforge/capsule": "2.0.197",
53
- "@arcforge/core": "2.0.197",
54
- "@arcforge/vstr": "2.0.197",
47
+ "@arcforge/session": "2.0.199",
48
+ "@arcforge/engines": "2.0.199",
49
+ "@arcforge/err": "2.0.199",
50
+ "@arcforge/types": "2.0.199",
51
+ "@arcforge/cloud": "2.0.199",
52
+ "@arcforge/capsule": "2.0.199",
53
+ "@arcforge/core": "2.0.199",
54
+ "@arcforge/vstr": "2.0.199",
55
55
  "fft.js": "^4.0.4",
56
56
  "h3": "^1.15.11",
57
57
  "semver": "^7.7.4",
58
58
  "sharp": "^0.35.3",
59
59
  "typescript": "5.9.2",
60
- "@arcforge/link": "2.0.197"
60
+ "@arcforge/link": "2.0.199"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@arcforge/air": "2.0.187",
@@ -32,9 +32,48 @@ export type TreeCacheOpts = {
32
32
  export const DEFAULT_TREE_CACHE = join(homedir(), ".axon", "cache", "trees")
33
33
  export const DEFAULT_MAX_TREES = 24
34
34
 
35
+ /**
36
+ * Environment overrides, for the same reason `AXON_STORE_ROOT` exists.
37
+ *
38
+ * `root` being injectable was supposed to keep tests off the developer's real
39
+ * cache — the comment above says so outright — but injection only protects the
40
+ * call sites that remember to inject. The SUITE does not: every fixture builds
41
+ * a `Platform()`, which builds a `Tree()`, which builds a `TreeCache()` with
42
+ * defaults, so a full parallel run resolves into `~/.axon/cache/trees` and
43
+ * evicts from it. Measured on 2026-09-10: thirteen of the developer's
44
+ * twenty-four cached trees were rewritten by test runs, against a cap of
45
+ * twenty-four.
46
+ *
47
+ * That is not only rude, it makes the suite's install behaviour a function of
48
+ * whatever else the machine has built lately. A run whose working set collides
49
+ * with the cap evicts trees other tests in the same run are about to want, and
50
+ * each miss turns a ~1ms graft into a full `bun install` — which is what a
51
+ * 60-second timeout in a test that takes 4.5 seconds alone actually looks like.
52
+ *
53
+ * An env var rather than another option threaded through Platform(), because
54
+ * the escape has to close for call sites that never think about it — exactly
55
+ * the argument `storeRoot()` makes for the store.
56
+ */
57
+ const ENV_TREE_CACHE_ROOT = "AXON_TREE_CACHE_ROOT"
58
+ const ENV_TREE_CACHE_MAX = "AXON_TREE_CACHE_MAX"
59
+
60
+ /** The cap from the environment, if it names a usable one. */
61
+ function maxFromEnv(): number | null {
62
+ const raw = process.env[ENV_TREE_CACHE_MAX]
63
+ if (raw === undefined) return null
64
+ const parsed = Number(raw)
65
+ // Loud rather than silently falling back: a mistyped cap that quietly
66
+ // reverts to the default would show up only as the eviction thrash this
67
+ // variable exists to remove, months later and with nothing pointing here.
68
+ if (!Number.isInteger(parsed) || parsed < 1) {
69
+ throw new Error(`${ENV_TREE_CACHE_MAX} must be a positive integer — got ${JSON.stringify(raw)}`)
70
+ }
71
+ return parsed
72
+ }
73
+
35
74
  export function TreeCache(opts: TreeCacheOpts = {}) {
36
- const cacheRoot = opts.root ?? DEFAULT_TREE_CACHE
37
- const maxTrees = opts.max ?? DEFAULT_MAX_TREES
75
+ const cacheRoot = opts.root ?? process.env[ENV_TREE_CACHE_ROOT] ?? DEFAULT_TREE_CACHE
76
+ const maxTrees = opts.max ?? maxFromEnv() ?? DEFAULT_MAX_TREES
38
77
 
39
78
 
40
79
  /**