@arcforge/platform 2.0.215 → 2.0.218

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.215",
3
+ "version": "2.0.218",
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,26 +44,27 @@
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.215",
48
- "@arcforge/engines": "2.0.215",
49
- "@arcforge/err": "2.0.215",
50
- "@arcforge/types": "2.0.215",
51
- "@arcforge/cloud": "2.0.215",
52
- "@arcforge/capsule": "2.0.215",
53
- "@arcforge/core": "2.0.215",
54
- "@arcforge/vstr": "2.0.215",
47
+ "@arcforge/session": "2.0.218",
48
+ "@arcforge/engines": "2.0.218",
49
+ "@arcforge/err": "2.0.218",
50
+ "@arcforge/types": "2.0.218",
51
+ "@arcforge/cloud": "2.0.218",
52
+ "@arcforge/capsule": "2.0.218",
53
+ "@arcforge/core": "2.0.218",
54
+ "@arcforge/vstr": "2.0.218",
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.215"
60
+ "@arcforge/link": "2.0.218"
61
61
  },
62
62
  "devDependencies": {
63
- "@arcforge/air": "2.0.208",
64
- "@arcforge/cognet": "2.0.208",
63
+ "@arcforge/air": "2.0.215",
64
+ "@arcforge/cognet": "2.0.215",
65
65
  "@arclabs/repo": "1.0.0",
66
66
  "@types/bun": "latest",
67
67
  "@types/semver": "^7.7.1"
68
- }
68
+ },
69
+ "axonRevision": "bfbb695da8a820cef52f99cbf6cc084f872c3f87"
69
70
  }
@@ -1,6 +1,5 @@
1
1
  import { join } from "node:path"
2
2
  import { err } from "@arcforge/err"
3
- import { KERNEL_ABI_VERSION } from "@arcforge/types"
4
3
  import { readCognetAbi } from "../../blueprint"
5
4
  import { fsx } from "../../../utils/fs"
6
5
  import { KINDS } from "../kinds"
@@ -59,20 +58,31 @@ export function Source(opts: SourceOpts) {
59
58
  ".assets",
60
59
  ])
61
60
 
62
- // A cognet's ABI is the kernel contract it targets, and it is the
63
- // only thing that says which kernels can load it. Lifted out of
64
- // cognet.config.ts HERE so the registry can record it: otherwise
65
- // the value stays sealed in the tarball and the resolve path can
66
- // only offer "latest" and hope.
61
+ // A cognet's ABI pin is the kernel contract it REFUSES to run
62
+ // outside of. Lifted out of cognet.config.ts here so the registry
63
+ // can record it: otherwise the value stays sealed in the tarball
64
+ // and the resolve path can only offer "latest" and hope.
67
65
  //
68
- // Unpinned falls back to THIS CLI's kernel rather than throwing.
69
- // Publish compiles the candidate from source with this CLI to
70
- // prove a consumer could, so an unpinned cognet genuinely was
71
- // validated against this ABI — recording it is a fact, and the
72
- // row must carry one either way or the resolver cannot place it.
73
- const abi = kind === "cognet"
74
- ? (await readCognetAbi(root)) ?? KERNEL_ABI_VERSION
75
- : undefined
66
+ // Unpinned stays NULL — it must not fall back to this CLI's kernel.
67
+ // What ships here is SOURCE (see `entries` below: the config, the
68
+ // src tree, package.json — no compiled bundle), and the consumer
69
+ // compiles it against THEIR kernel at prepare time. So the ABI this
70
+ // machine happens to run is not a property of the artifact, and
71
+ // stamping it writes a pin the author deliberately did not write:
72
+ // an assertion opted into, per cognetAbi(), turned into one every
73
+ // cognet is forced to restate.
74
+ //
75
+ // It was `?? KERNEL_ABI_VERSION`, and the cost was total. Publish
76
+ // compiling the candidate proves a consumer COULD build it on this
77
+ // ABI; it says nothing about the next one. So @axon/zero — which
78
+ // pins nothing and cares about nothing — went out stamped "11",
79
+ // the kernel moved to 12, and `axon init` broke for every new user
80
+ // against an artifact that would have compiled fine.
81
+ // null for both "not a cognet" and "a cognet that pins nothing" —
82
+ // neither declares a kernel contract, and the field is omitted for
83
+ // both, so the registry row stays NULL rather than carrying a
84
+ // number nobody asserted.
85
+ const abi = kind === "cognet" ? await readCognetAbi(root) : null
76
86
 
77
87
  const image: SourceImage = {
78
88
  kind,
@@ -81,7 +91,7 @@ export function Source(opts: SourceOpts) {
81
91
  public: pkg.public,
82
92
  builtAt: new Date().toISOString(),
83
93
  ...(pkg.description ? { description: pkg.description } : {}),
84
- ...(abi !== undefined ? { abi } : {}),
94
+ ...(abi !== null ? { abi: abi } : {}),
85
95
  }
86
96
  await artifacts.image(bundleDir, image)
87
97
  // package.json rides along — publish reads name/version/visibility from it.
package/src/index.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  export { Platform, type PlatformT } from "./platform"
2
2
  export type { ProjectKind, ProjectT } from "./build/project"
3
+ // Promoted deliberately: the name of the default brain is a public fact about
4
+ // the platform, and `arc`'s release preflight now asks the registry whether a
5
+ // version of it exists for this kernel's ABI. Two consumers, one constant.
6
+ export { DEFAULT_COGNET } from "./build/blueprint"
3
7
  // The `@` palette renders these rows, so the shape is part of the platform's
4
8
  // public surface rather than an internal of the walk that produces it.
5
9
  export type { FileEntry, FilesT } from "./services/files"
package/src/platform.ts CHANGED
@@ -92,7 +92,12 @@ export function Platform(opts: PlatformOpts) {
92
92
  return result
93
93
  },
94
94
  })
95
- const cloud = Cloud({ store: store, distribution: distribution, release: opts.version })
95
+ const cloud = Cloud({
96
+ store: store,
97
+ distribution: distribution,
98
+ release: opts.version,
99
+ ...(opts.fetch !== undefined ? { fetch: opts.fetch } : {}),
100
+ })
96
101
 
97
102
  const ollama = Ollama() // local models via the Ollama daemon
98
103
  const mic = Mic() // mic capture + visualizer service
@@ -267,6 +272,15 @@ export function Platform(opts: PlatformOpts) {
267
272
  export type PlatformT = ReturnType<typeof Platform>
268
273
 
269
274
  type PlatformOpts = {
275
+ /**
276
+ * Transport override, forwarded to the cloud client — see HttpOpts.fetch.
277
+ *
278
+ * A test that needs to control the network injects it here instead of
279
+ * assigning over `globalThis.fetch`: Bun runs test FILES concurrently in
280
+ * one process, so a global stub is live inside every other file running at
281
+ * the same moment. Production passes nothing.
282
+ */
283
+ fetch?: typeof fetch
270
284
  /**
271
285
  * Who supervises a spawned agent.
272
286
  *
@@ -19,6 +19,14 @@ type CloudOpts = {
19
19
  distribution: Distribution
20
20
  /** Shipped host version stamped onto every crash report. */
21
21
  release: string
22
+ /**
23
+ * Transport override — see HttpOpts.fetch.
24
+ *
25
+ * Present so a test can isolate the network to ONE Platform instead of
26
+ * assigning over `globalThis.fetch`, which every concurrently-running test
27
+ * file shares. Production passes nothing.
28
+ */
29
+ fetch?: typeof fetch
22
30
  }
23
31
 
24
32
  export type Distribution = "production" | "development"
@@ -142,6 +150,7 @@ export function Cloud(opts: CloudOpts) {
142
150
  environmentCredentials: policy.environmentCredentials,
143
151
  release: opts.release,
144
152
  onUnauthorized: () => { void onSessionExpired() },
153
+ ...(opts.fetch !== undefined ? { fetch: opts.fetch } : {}),
145
154
  })
146
155
  }
147
156
 
@@ -96,7 +96,31 @@ export type PromptCacheT = ReturnType<typeof PromptCache>
96
96
  */
97
97
  export type CloneOptions = { dir?: string; reportPrepareFailure?: boolean }
98
98
 
99
- export function Registry(opts: { cloud: AxonCloudClient; prepare(root: string): Promise<void> }) {
99
+ /**
100
+ * Fetching the artifact bytes is an INJECTABLE seam, not a bare global.
101
+ *
102
+ * `download` used to reach straight for `globalThis.fetch`, which left a test
103
+ * no way to serve a fixture tarball except to assign over that global. With
104
+ * `parallel = true` in bunfig, Bun interleaves test FILES in one process, so
105
+ * one file's stub was live inside every other file running at the same
106
+ * moment: `zeno.test.ts` called clone() and was served `registry.test.ts`'s
107
+ * archive of a directory that test had already deleted. 94 failures traced to
108
+ * that one assignment, and an `afterEach` restore cannot help — it runs after
109
+ * its own describe, long after a concurrent file has been handed the wrong
110
+ * fetch.
111
+ *
112
+ * Injected the same way `Framework({ fetch })` in libs/repo already does it:
113
+ * the default is the real thing, so production wiring passes nothing.
114
+ */
115
+ export type ArtifactDownload = (url: string) => Promise<ArrayBuffer>
116
+
117
+ export function Registry(opts: {
118
+ cloud: AxonCloudClient
119
+ prepare(root: string): Promise<void>
120
+ download?: ArtifactDownload
121
+ }) {
122
+ const fetchArtifact: ArtifactDownload = opts.download ?? download
123
+
100
124
  /**
101
125
  * Install what was downloaded. Throws by DEFAULT; reports only on request.
102
126
  *
@@ -142,7 +166,7 @@ export function Registry(opts: { cloud: AxonCloudClient; prepare(root: string):
142
166
  const { name, version: requestedVersion } = parseSpecifier(ref)
143
167
  const resolved = await opts.cloud.registry.resolve(name, requestedVersion)
144
168
  const target = resolve(cwd, options.dir ?? directoryName(resolved.name))
145
- await extract(await download(resolved.downloadUrl), target)
169
+ await extract(await fetchArtifact(resolved.downloadUrl), target)
146
170
  const prepareError = await runPrepare(target, options.reportPrepareFailure === true)
147
171
 
148
172
  return { ...resolved, root: target, prepareError }
@@ -155,7 +179,7 @@ export function Registry(opts: { cloud: AxonCloudClient; prepare(root: string):
155
179
  const { name, version: requestedVersion } = parseSpecifier(ref)
156
180
  const resolved = await opts.cloud.registry.resolve(name, requestedVersion)
157
181
  const target = resolve(cwd, options.dir ?? directoryName(options.as))
158
- await extract(await download(resolved.downloadUrl), target)
182
+ await extract(await fetchArtifact(resolved.downloadUrl), target)
159
183
 
160
184
  const cloneResult = { ...resolved, root: target }
161
185
  const packagePath = join(cloneResult.root, "package.json")