onboard.sh dockerfile: the generated image has no pnpm, so onSandboxReady dies in every worker until a healer patches it #192

Closed
opened 2026-10-14 23:17:36 +00:00 by ben · 3 comments
Owner

Seen onboarding Tupu/ai-company-os (2026-10-14, its #1). onboard.sh dockerfile <out> none renders Dockerfile.tmpl with the harness layer on node:22-bookworm, which ships no pnpm shim. The vendored main.mts onSandboxReady runs pnpm install inside every worker, so the very first swarm runs on the new consumer died at install. Two healers on different hosts each landed RUN npm i -g pnpm@11.6.0 into the consumer's .sandcastle/Dockerfile within minutes (same signature), and a third de-duplicated the two blocks — the heal path worked, but the template shipped a known-dead image.

Matou/dev-factory's own Dockerfile carries "an empty stack layer plus a pinned pnpm" (onboarding/README.md, worked example) — the pin lives in the consumer file, not the template, so every new consumer rediscovers it.

Proposed fix: move the pnpm install into the harness layer of onboarding/templates/Dockerfile.tmpl (pinned, e.g. RUN npm i -g pnpm@<pin> or corepack enable && corepack prepare pnpm@<pin> --activate), since it is a harness need (main.mts), not a stack need. install-prompt.md step 5 could stop implying the none layer is complete.

Evidence: Tupu/ai-company-os commits 71db22c, 19a0c88, 8fb5df3 (healer, 2026-10-14) and the swarm runs they healed.

**Seen onboarding `Tupu/ai-company-os` (2026-10-14, its #1).** `onboard.sh dockerfile <out> none` renders `Dockerfile.tmpl` with the harness layer on `node:22-bookworm`, which ships no `pnpm` shim. The vendored `main.mts` `onSandboxReady` runs `pnpm install` inside every worker, so the very first swarm runs on the new consumer died at install. Two healers on different hosts each landed `RUN npm i -g pnpm@11.6.0` into the consumer's `.sandcastle/Dockerfile` within minutes (same signature), and a third de-duplicated the two blocks — the heal path worked, but the template shipped a known-dead image. `Matou/dev-factory`'s own `Dockerfile` carries "an empty stack layer plus a pinned pnpm" (onboarding/README.md, worked example) — the pin lives in the consumer file, not the template, so every new consumer rediscovers it. **Proposed fix:** move the pnpm install into the harness layer of `onboarding/templates/Dockerfile.tmpl` (pinned, e.g. `RUN npm i -g pnpm@<pin>` or `corepack enable && corepack prepare pnpm@<pin> --activate`), since it is a harness need (`main.mts`), not a stack need. `install-prompt.md` step 5 could stop implying the `none` layer is complete. **Evidence:** `Tupu/ai-company-os` commits `71db22c`, `19a0c88`, `8fb5df3` (healer, 2026-10-14) and the swarm runs they healed.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Ruling: Routed to ready-for-agent (category bug).

Verification (claim confirmed against the code):

  • onboarding/templates/Dockerfile.tmpl builds the harness layer on node:22-bookworm (git/curl/jq/openssh, git-fence, doctl, Claude CLI, UID-GID, sandbox marker) with no pnpm. pnpm appears only as a commented <pin> placeholder emitted into the node stack layer (onboard-lib.sh onboard_gen_dockerfile, the node) case), and not at all for the none stack (which just says "delete this section").
  • main.mts onSandboxReady always runs CI=true pnpm install --frozen-lockfile --store-dir … before the agent starts — independent of the product stack, because the harness itself is a pnpm package. So pnpm is a harness need, not a stack need.
  • The factory's own .sandcastle/Dockerfile carries RUN npm install -g pnpm@11.6.0 with a comment stating it is pinned because main.mts runs pnpm install --frozen-lockfile inside the sandbox — i.e. the fix already exists, but only in the hand-authored consumer file, so every new consumer rediscovers it (the Tupu/ai-company-os heal incident).

Why this is a two-way door: the whole change is edits to a template (Dockerfile.tmpl), its generator comment, and a prompt-doc wording line — all revertible by a later commit, and provable offline by onboarding/tests/onboard-lib-test.sh (the render assertions) plus an image build. It touches no protected session surface (not a prompt skeleton, not .sandcastle/, not .forgejo/), no credentials, no security posture, no data, no spend. Nothing on the one-way-door list.

The one judgement call, ruled: install a pinned default pnpm in the harness layer so no rendered image is ever dead, and keep the node stack-layer pin-override guidance so a node consumer can still match its own product lockfile's pnpm major (the later stack-layer npm i -g pnpm@<pin> wins over the harness default). This keeps none-stack consumers alive (they install only the harness-authored @ai-hero/sandcastle lockfile) without breaking a node consumer whose lockfile is a different pnpm major. An agent may choose npm i -g pnpm@<pin> or corepack prepare — either is provable by the test.


Agent Brief

Category: bug
Summary: onboard.sh dockerfile renders an image with no pnpm, so main.mts onSandboxReady (pnpm install) dies in every freshly-onboarded consumer until a healer patches it.

Current behavior:
The Dockerfile template's harness layer installs no package manager. pnpm is treated as a stack concern: the generator emits a commented RUN npm install -g pnpm@<pin> placeholder only into the node stack layer, and nothing for the none stack. But the vendored harness (main.mts onSandboxReady) unconditionally runs pnpm install --frozen-lockfile inside every worker container. A none-stack consumer — and any node consumer before the human fills the placeholder — therefore boots a sandbox whose first harness step fails. Healers then re-land a pnpm install into the consumer's committed Dockerfile, repeatedly, across hosts.

Desired behavior:
Every image the template renders — for node, go, node+go, and especially none — contains a working, pinned pnpm before onSandboxReady runs, so pnpm install --frozen-lockfile succeeds out of the box. pnpm lives in the harness layer (same for every onboarded repo), pinned, not in the stack layer. A node consumer may still override the pin in its stack layer to match its own product lockfile's pnpm major.

Key interfaces:

  • onboarding/templates/Dockerfile.tmpl — the harness-layer section (the block marked "same for every onboarded repo") gains a pinned pnpm install. Choose a mechanism (RUN npm install -g pnpm@<pin> or corepack enable && corepack prepare pnpm@<pin> --activate) and a pin consistent with the harness's own lockfile major (the factory's .sandcastle/Dockerfile uses 11.6.0; keep a single source-of-truth comment explaining the pin as that file does).
  • onboard_gen_dockerfile in onboarding/onboard-lib.sh — the node stack-layer guidance (node) case) should no longer imply pnpm is missing until the human adds it; reframe it as an optional pin-override for the product lockfile, since the harness layer now guarantees a default. Do not reintroduce product-specific values into the template (blast-radius rule).
  • onboarding/install-prompt.md — the dockerfile bullet currently says a none stack "still carries the harness layer, which is correct". Adjust so it no longer implies the none layer is otherwise complete/ready without pnpm; keep it truthful that the harness layer now ships pnpm.

Acceptance criteria:

  • A Dockerfile rendered with stack none contains a pinned pnpm install in the harness layer.
  • The same holds for node, go, and node+go renders (the harness-layer install is stack-independent).
  • onboarding/tests/onboard-lib-test.sh is updated in the same commit to assert the harness-layer pnpm install is present for none (and at least one language stack), and still passes along with the existing "no unresolved {{ placeholders" and stack-marker assertions.
  • onboarding/tests/install-prompt-contract-test.sh still passes after the wording change (update it in the same commit if it asserts the changed sentence).
  • The full offline suite stays green: for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done.
  • STATUS.md updated in the same commit if the change alters project state (a template-contract change to onboarding qualifies).

Out of scope:

  • Patching already-onboarded consumer repos — the topology is pull-only; they pick this up at their next FACTORY_REF pin bump. No cross-repo pushes.
  • Changing main.mts / onSandboxReady — the pnpm install stays; the fix is to make the image satisfy it.
  • Removing or changing the node stack-layer's ability to pin a product-specific pnpm major.
  • Any go-toolchain guidance beyond what's already emitted.
> *This was generated by AI during triage.* ## Ruled by agent under ADR 0174 — veto anytime **Ruling:** Routed to `ready-for-agent` (category `bug`). **Verification (claim confirmed against the code):** - `onboarding/templates/Dockerfile.tmpl` builds the harness layer on `node:22-bookworm` (git/curl/jq/openssh, git-fence, doctl, Claude CLI, UID-GID, sandbox marker) with **no pnpm**. pnpm appears only as a commented `<pin>` placeholder emitted into the *node stack layer* (`onboard-lib.sh` `onboard_gen_dockerfile`, the `node)` case), and not at all for the `none` stack (which just says "delete this section"). - `main.mts` `onSandboxReady` always runs `CI=true pnpm install --frozen-lockfile --store-dir …` before the agent starts — independent of the product stack, because the harness itself is a pnpm package. So pnpm is a harness need, not a stack need. - The factory's own `.sandcastle/Dockerfile` carries `RUN npm install -g pnpm@11.6.0` with a comment stating it is pinned *because main.mts runs `pnpm install --frozen-lockfile` inside the sandbox* — i.e. the fix already exists, but only in the hand-authored consumer file, so every new consumer rediscovers it (the `Tupu/ai-company-os` heal incident). **Why this is a two-way door:** the whole change is edits to a template (`Dockerfile.tmpl`), its generator comment, and a prompt-doc wording line — all revertible by a later commit, and provable offline by `onboarding/tests/onboard-lib-test.sh` (the render assertions) plus an image build. It touches no protected session surface (not a prompt skeleton, not `.sandcastle/`, not `.forgejo/`), no credentials, no security posture, no data, no spend. Nothing on the one-way-door list. **The one judgement call, ruled:** install a *pinned default* pnpm in the **harness layer** so no rendered image is ever dead, and **keep** the node stack-layer pin-override guidance so a node consumer can still match its own product lockfile's pnpm major (the later stack-layer `npm i -g pnpm@<pin>` wins over the harness default). This keeps `none`-stack consumers alive (they install only the harness-authored `@ai-hero/sandcastle` lockfile) without breaking a node consumer whose lockfile is a different pnpm major. An agent may choose `npm i -g pnpm@<pin>` or `corepack prepare` — either is provable by the test. --- ## Agent Brief **Category:** bug **Summary:** `onboard.sh dockerfile` renders an image with no pnpm, so `main.mts` `onSandboxReady` (`pnpm install`) dies in every freshly-onboarded consumer until a healer patches it. **Current behavior:** The Dockerfile template's harness layer installs no package manager. pnpm is treated as a *stack* concern: the generator emits a commented `RUN npm install -g pnpm@<pin>` placeholder only into the node stack layer, and nothing for the `none` stack. But the vendored harness (`main.mts` `onSandboxReady`) unconditionally runs `pnpm install --frozen-lockfile` inside every worker container. A `none`-stack consumer — and any node consumer before the human fills the placeholder — therefore boots a sandbox whose first harness step fails. Healers then re-land a pnpm install into the consumer's committed Dockerfile, repeatedly, across hosts. **Desired behavior:** Every image the template renders — for `node`, `go`, `node+go`, and especially `none` — contains a working, pinned pnpm before `onSandboxReady` runs, so `pnpm install --frozen-lockfile` succeeds out of the box. pnpm lives in the harness layer (same for every onboarded repo), pinned, not in the stack layer. A node consumer may still override the pin in its stack layer to match its own product lockfile's pnpm major. **Key interfaces:** - `onboarding/templates/Dockerfile.tmpl` — the harness-layer section (the block marked "same for every onboarded repo") gains a pinned pnpm install. Choose a mechanism (`RUN npm install -g pnpm@<pin>` or `corepack enable && corepack prepare pnpm@<pin> --activate`) and a pin consistent with the harness's own lockfile major (the factory's `.sandcastle/Dockerfile` uses `11.6.0`; keep a single source-of-truth comment explaining the pin as that file does). - `onboard_gen_dockerfile` in `onboarding/onboard-lib.sh` — the node stack-layer guidance (`node)` case) should no longer imply pnpm is *missing* until the human adds it; reframe it as an optional pin-override for the product lockfile, since the harness layer now guarantees a default. Do not reintroduce product-specific values into the template (blast-radius rule). - `onboarding/install-prompt.md` — the `dockerfile` bullet currently says a `none` stack "still carries the harness layer, which is correct". Adjust so it no longer implies the `none` layer is otherwise complete/ready without pnpm; keep it truthful that the harness layer now ships pnpm. **Acceptance criteria:** - [ ] A Dockerfile rendered with stack `none` contains a pinned pnpm install in the harness layer. - [ ] The same holds for `node`, `go`, and `node+go` renders (the harness-layer install is stack-independent). - [ ] `onboarding/tests/onboard-lib-test.sh` is updated in the same commit to assert the harness-layer pnpm install is present for `none` (and at least one language stack), and still passes along with the existing "no unresolved `{{` placeholders" and stack-marker assertions. - [ ] `onboarding/tests/install-prompt-contract-test.sh` still passes after the wording change (update it in the same commit if it asserts the changed sentence). - [ ] The full offline suite stays green: `for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done`. - [ ] `STATUS.md` updated in the same commit if the change alters project state (a template-contract change to onboarding qualifies). **Out of scope:** - Patching already-onboarded consumer repos — the topology is pull-only; they pick this up at their next `FACTORY_REF` pin bump. No cross-repo pushes. - Changing `main.mts` / `onSandboxReady` — the pnpm install stays; the fix is to make the image satisfy it. - Removing or changing the node stack-layer's ability to pin a product-specific pnpm major. - Any go-toolchain guidance beyond what's already emitted.

swarm-claim host=matou-dev-server-01 run=21727
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=21727 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #192 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 192,
  "status": "success",
  "commits": [
    "120c6fae8d5478f4cb3133f412ad02012242fb5d"
  ],
  "changed_files": [
    "STATUS.md",
    "onboarding/install-prompt.md",
    "onboarding/onboard-lib.sh",
    "onboarding/templates/Dockerfile.tmpl",
    "onboarding/tests/onboard-lib-test.sh"
  ],
  "tests": [
    {
      "command": "bash onboarding/tests/onboard-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash onboarding/tests/install-prompt-contract-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A Dockerfile rendered with stack none contains a pinned pnpm install in the harness layer": "Dockerfile.tmpl adds `RUN npm install -g pnpm@11.6.0` in the harness layer (above the UID/GID drop and stack layer); onboard-lib-test.sh asserts it present and above the `# none:` marker for a none render",
    "The same holds for node, go, and node+go renders (harness-layer install is stack-independent)": "The pnpm install lives in the shared harness layer of Dockerfile.tmpl, emitted identically for every stack (STACK_LAYER substitution is below it); onboard-lib-test.sh asserts it for the node render too",
    "onboard-lib-test.sh updated to assert the harness-layer pnpm install for none and a language stack and still passes with the no-{{ and stack-marker assertions": "Two #192 cases added (node + none, pinned pnpm above stack layer); test passes 240/0",
    "install-prompt-contract-test.sh still passes after the wording change": "Contract test asserts subcommand names only, not the changed sentence; passes (exit 0)",
    "The full offline suite stays green": "Full suite loop ran with no FAIL output (exit 0)",
    "STATUS.md updated in the same commit": "STATUS.md gains a newest-first #192 entry in commit 120c6fa"
  },
  "summary": "Moved the pinned pnpm install into the onboard Dockerfile template's harness layer so every rendered image (including none) boots pnpm install-ready, ending the per-consumer heal rediscovery.",
  "blockers": []
}
**close-report** for #192 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 192, "status": "success", "commits": [ "120c6fae8d5478f4cb3133f412ad02012242fb5d" ], "changed_files": [ "STATUS.md", "onboarding/install-prompt.md", "onboarding/onboard-lib.sh", "onboarding/templates/Dockerfile.tmpl", "onboarding/tests/onboard-lib-test.sh" ], "tests": [ { "command": "bash onboarding/tests/onboard-lib-test.sh", "exit_code": 0 }, { "command": "bash onboarding/tests/install-prompt-contract-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done", "exit_code": 0 } ], "criteria": { "A Dockerfile rendered with stack none contains a pinned pnpm install in the harness layer": "Dockerfile.tmpl adds `RUN npm install -g pnpm@11.6.0` in the harness layer (above the UID/GID drop and stack layer); onboard-lib-test.sh asserts it present and above the `# none:` marker for a none render", "The same holds for node, go, and node+go renders (harness-layer install is stack-independent)": "The pnpm install lives in the shared harness layer of Dockerfile.tmpl, emitted identically for every stack (STACK_LAYER substitution is below it); onboard-lib-test.sh asserts it for the node render too", "onboard-lib-test.sh updated to assert the harness-layer pnpm install for none and a language stack and still passes with the no-{{ and stack-marker assertions": "Two #192 cases added (node + none, pinned pnpm above stack layer); test passes 240/0", "install-prompt-contract-test.sh still passes after the wording change": "Contract test asserts subcommand names only, not the changed sentence; passes (exit 0)", "The full offline suite stays green": "Full suite loop ran with no FAIL output (exit 0)", "STATUS.md updated in the same commit": "STATUS.md gains a newest-first #192 entry in commit 120c6fa" }, "summary": "Moved the pinned pnpm install into the onboard Dockerfile template's harness layer so every rendered image (including none) boots pnpm install-ready, ending the per-consumer heal rediscovery.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#192
No description provided.