@spunto/build 0.19.0 → 0.19.1

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": "@spunto/build",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "Spunto's shared Build engine — the devcontainer image protocol and VS Code extension registry clients, with no database, no HTTP framework and no UI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -181,8 +181,17 @@ function startDone(worker) {
181
181
  function projectState() {
182
182
  if (!project) return null
183
183
  const { plan } = project
184
- const baked = existsSync(join(DIR, `.baked-${plan.bakeKey}`))
185
184
  const alive = runnerPid() != null
185
+ // The recipe of the runner of this boot, not the plan's: a recipe change deployed while the box
186
+ // runs (new bakeKey, the plan re-sent at the agent's reconnection) applies at its next start, and
187
+ // the plan's marker is not there before. Read against the plan, the box said `baking` until then,
188
+ // `building` in the dashboard, while it was up and ready (2026-10-26, IMAGE_RECIPE_VERSION 3).
189
+ // A runner started by an agent that kept no key in started.json: past its bake once setup is done.
190
+ const last = lastStart()
191
+ const ofThisBoot = last != null && (alive || last.boot === bootId())
192
+ const baked = ofThisBoot && last.bakeKey
193
+ ? existsSync(join(DIR, `.baked-${last.bakeKey}`))
194
+ : existsSync(join(DIR, `.baked-${plan.bakeKey}`)) || (alive && existsSync(SETUP_DONE))
186
195
  let worker = null
187
196
  try {
188
197
  worker = JSON.parse(readFileSync(MP_STATUS, "utf8"))
@@ -304,7 +313,7 @@ function applyProject(plan) {
304
313
  }
305
314
  const log = openSync(join(DIR, "project.log"), "a")
306
315
  // Before the spawn: the worker script's `ready` of this start must be newer than it (startDone).
307
- writeFileSync(STARTED(), JSON.stringify({ boot, version: plan.version, exitCode: null, at: new Date().toISOString() }))
316
+ writeFileSync(STARTED(), JSON.stringify({ boot, version: plan.version, bakeKey: plan.bakeKey, exitCode: null, at: new Date().toISOString() }))
308
317
  // Detached, in its own session: it outlives an agent restart, like a container's CMD would.
309
318
  const child = spawn("bash", [join(DIR, "runner.sh"), DIR, plan.bakeKey, plan.bakeOnly ? "bake-only" : "full"], {
310
319
  cwd: "/",