feat(release): pi gets a range in package.json, the image tag comes from the lock, and an image fit step runs before every build (#1873) #2017

Merged
jason.woltje merged 4 commits from pi-unpin-s5 into refactor 2026-11-20 15:23:41 +00:00
Owner

What changes

Lane pi-unpin-s5, slice S5 of the pi unpin design: the package range, the image tag and the scripts stop pinning pi.

  • Range, not pin. package.json gives @earendil-works/pi-coding-agent the range >=0.85.1. package-lock.json still resolves 0.85.1, and only its root range line changed.
  • The tag comes from the lock. New scripts/image-tag.mjs builds mosaic-poc-agent:<lock version>-r<RELEASE> and refuses a lock it can't read. scripts/common.sh, scripts/mosaic-task.mjs, scripts/testing/lane-image.mjs, scripts/test-task.sh and scripts/test-auth.sh use it. Today's tag is unchanged: mosaic-poc-agent:0.85.1-r0.0.13.
  • The image fit step. New scripts/pi-fit-image.mjs runs the fit check on the pi the lock resolves, and refuses unless the checkout's node_modules holds exactly that lock entry. build_image in scripts/common.sh runs it before docker build, and build.sh, release.sh package and verify.sh call build_image.
  • scripts/agent-host-dev.sh no longer refuses pi for its version. It prints the version pi reports.
  • AGENTS.md. "Version pin" becomes "Harness versions" (written by the Lead).

Differs from the design

  • The fit step runs on the host, not as a Containerfile RUN step. The fit check runs pi inside bwrap, and docker build's seccomp profile refuses the namespaces bwrap needs.
  • compose.yaml loses its build section and sets pull_policy: never. Otherwise a compose run would build a missing image with no fit step. A missing image now refuses, and scripts/build.sh is the way to build one.

No new verb, refusal code, grant, role, schema or config format.

Tests

  • New packages/cli/tests/pi-unpin-s5.test.mjs, with changes to gate-lane-image.test.mjs and gate-lane-image-base.test.mjs: a stand-in lock at 9.9.9 gives a 9.9.9 tag, a package.json range never reaches a tag, the fit step fails on a stand-in pi that lacks a flag and passes on the installed pi.
  • Lane gate on 9d02ab4a6: 202 files, 2647 pass, 0 fail.
  • Lead check in a clean environment on 9287e2fac: 271 files, 2943 pass, 0 fail.
  • Run by the Lead on the host: node scripts/image-tag.mjs gives mosaic-poc-agent:0.85.1-r0.0.13, node scripts/pi-fit-image.mjs passes on pi 0.85.1, and bash -n passes on every script.
  • Not run: build.sh, release.sh package, verify.sh, test-task.sh, test-auth.sh, test-release.sh, a real image build, and a compose run on a missing tag.

Review

A fresh claude-opus-5-5 reviewer asked for 4 changes, all fixed. A second asked for 2 test additions and 3 doc lines, all fixed. That last round touched only tests and docs.

Left for later

  • The fit step runs pi on the host's node, not the image's.
  • The suites that need Docker and the instance config have not run on this change.
## What changes Lane pi-unpin-s5, slice S5 of the pi unpin design: the package range, the image tag and the scripts stop pinning pi. - **Range, not pin.** `package.json` gives `@earendil-works/pi-coding-agent` the range `>=0.85.1`. `package-lock.json` still resolves 0.85.1, and only its root range line changed. - **The tag comes from the lock.** New `scripts/image-tag.mjs` builds `mosaic-poc-agent:<lock version>-r<RELEASE>` and refuses a lock it can't read. `scripts/common.sh`, `scripts/mosaic-task.mjs`, `scripts/testing/lane-image.mjs`, `scripts/test-task.sh` and `scripts/test-auth.sh` use it. Today's tag is unchanged: `mosaic-poc-agent:0.85.1-r0.0.13`. - **The image fit step.** New `scripts/pi-fit-image.mjs` runs the fit check on the pi the lock resolves, and refuses unless the checkout's `node_modules` holds exactly that lock entry. `build_image` in `scripts/common.sh` runs it before `docker build`, and `build.sh`, `release.sh package` and `verify.sh` call `build_image`. - **`scripts/agent-host-dev.sh`** no longer refuses pi for its version. It prints the version pi reports. - **AGENTS.md.** "Version pin" becomes "Harness versions" (written by the Lead). ## Differs from the design - The fit step runs on the host, not as a Containerfile `RUN` step. The fit check runs pi inside bwrap, and docker build's seccomp profile refuses the namespaces bwrap needs. - `compose.yaml` loses its build section and sets `pull_policy: never`. Otherwise a compose run would build a missing image with no fit step. A missing image now refuses, and `scripts/build.sh` is the way to build one. No new verb, refusal code, grant, role, schema or config format. ## Tests - New `packages/cli/tests/pi-unpin-s5.test.mjs`, with changes to `gate-lane-image.test.mjs` and `gate-lane-image-base.test.mjs`: a stand-in lock at 9.9.9 gives a 9.9.9 tag, a `package.json` range never reaches a tag, the fit step fails on a stand-in pi that lacks a flag and passes on the installed pi. - Lane gate on 9d02ab4a6: 202 files, 2647 pass, 0 fail. - Lead check in a clean environment on 9287e2fac: 271 files, 2943 pass, 0 fail. - Run by the Lead on the host: `node scripts/image-tag.mjs` gives `mosaic-poc-agent:0.85.1-r0.0.13`, `node scripts/pi-fit-image.mjs` passes on pi 0.85.1, and `bash -n` passes on every script. - Not run: `build.sh`, `release.sh package`, `verify.sh`, `test-task.sh`, `test-auth.sh`, `test-release.sh`, a real image build, and a compose run on a missing tag. ## Review A fresh claude-opus-5-5 reviewer asked for 4 changes, all fixed. A second asked for 2 test additions and 3 doc lines, all fixed. That last round touched only tests and docs. ## Left for later - The fit step runs pi on the host's node, not the image's. - The suites that need Docker and the instance config have not run on this change.
jason.woltje added 4 commits 2026-11-20 15:23:38 +00:00
jason.woltje merged commit 9287e2fac7 into refactor 2026-11-20 15:23:41 +00:00
Sign in to join this conversation.