Declare SOURCE_COMMIT just before the step that writes it, so the pnpm
installs are no longer rebuilt on every commit; install production
dependencies in their own stage and copy node_modules as a separate
layer, so a source change exports and pushes only the small app layer;
fetch the runtime packages with one apt-get download call; share one
pnpm toolchain stage and a pnpm store cache mount.
Containerfile.rust-stable writes a toolchain file (Rust release, components, targets, sccache, installed packages).
A toolchain-id init container (toolchain image) writes rustc -vV and that file before warm-restore and warm-copy, the
publish records its sha256 in the manifest, warm-sync carries rustc and the key into the node status, and the runner,
restore and copy accept a version of another digest when both match. Docs say which programs run from which image.
- The row records whether the volume was made empty for the current start
(volume_fresh). A kept volume is only checked for its base commit, never seeded
or wiped; a kept volume that is gone or being deleted is replaced by a fresh one
before the pod is made.
- A resume that cannot start or seed (pull failure, pending or seed limits, pod
gone, create tries, a kept volume without its base commit) goes back to parked
with its kept volume and checkpoint, up to 3 tries (resume_tries); after that it
stays parked with the reason in its error and is not resumed again.
- A kept volume is dropped only when its node is gone: the node is missing or not
ready for 5 min, or, when nodes cannot be read, every node refused the pod for the
volume's node affinity. Never while the last checkpoint failed.
- A failed checkpoint is recorded (checkpoint_error); while set, the parked volume
is kept past its keep time. The keep-time deletion lets go of the volume on the
row before deleting it.
- The lease's resume note keeps the queued stdin (remote_calls.base_stdin) and says
what the last resume did: kept tree, rebuilt from the checkpoint of hh:mm, or
rebuilt with no checkpoint.
- `ws init` removes a stale git index lock.
The session's env goes to the app through env(1), so no value can stop the
wrapper recording the pid and exit code. An app with no pid 5 s after its start
no longer counts as running, and app-stop records one as ended. ensure_display
no longer has its error header redirected. A handed-back app-start skips the
argument checks and waits for the app it started. The Xvfb pid is checked to
be Xvfb before it is waited on or killed; pids must be above 1. Map State is
matched on its own line, and a window a running app's .win names is never
taken by another app.
Two copies of the runner or of the periodic chores can run on one Postgres database: the copy that holds the
role's session-level advisory lock leads, the other waits as a standby and takes over when the leader's
session ends. A new leader moves the role's epoch and fences its writes, and those of its jobs, to it: every
write transaction checks the epoch after the writer lock, so writes of a leader that lost its lock fail. The
old leader kills its jobs and exits when its lock connection fails or a check of the lock fails. A standby
runner answers /readyz with 503; /healthz/checks gains runner-leader and periodic-leader. The periodic loop
moves to deploy/periodic.sh, run by autocraft-server periodic.
- The launcher keeps a workspace's pod while a background command the session has
not seen end may still run, and counts idle time from the end of a lease.
- A parked workspace comes back when its bound call is queued or leased, or when a
session's tool call or a try session asks for it: a new pod on the kept volume,
or a new volume rebuilt from the base and the stored checkpoint (git apply).
Session tool calls wait for the workspace to be ready.
- A resume onto a volume whose node takes no pod within 3 min drops the volume and
rebuilds. Resumed pods and rebuilt volumes get their own names, so an old pod still
shutting down on a lost node never blocks them; the exec check ignores such pods.
- `ws init` marks calls an earlier pod on the volume left without an exit as killed.
- Try sessions get two attempts. A lease after an earlier lease of the same call
worked in the workspace adds a note to the prompt with the checkpoint's diff stat;
the launcher checkpoints a workspace whose bound call went back to the queue.
The ws helper gains app-start (restarts Xvfb if it died, at most 4 apps, lavapipe
env, waits up to 30 s for the window found by _NET_WM_PID or as a new unclaimed
window; a call number already started is waited on, not started again),
app-stop (SIGTERM, SIGKILL after 5 s) and shot (root capture cropped to the
window and region, full size kept in .ws/shots, scaled like read's images).
The tool table gains array, env and rect fields. Sessions drive apps through
their own CLI with shell.
Offline steps that mount the build dirs run rustc through sccache against the
read-only WebDAV endpoint set with --sccache-url, when the repo has a CI gate.
sccache keys a compile on the compiler, its own release, the arguments, every
CARGO_* variable and the working directory, so a cached step matches the gate's
job: the CI checkout path with its default target dir, CARGO_HOME, the gate's
job env (CARGO_TERM_COLOR given to rustc only), dev-strip, and the store
sccache/<cache-version>. The pod carries craft.build/cache=read; the step ends
with sccache --show-stats. The rust-stable image pins Rust 1.100.0 and installs
the checksum-verified sccache 0.18.0 release.
- Installation tokens for a write are minted for the write's repository (a transfer's also for its target); reads across repos and pushes to a contributor's fork keep the installation-wide token. Reading the app's keys checks the secrets file's mode like every other reader.
- The app's git credential helper is set for https://github.com only, after every configured helper is dropped.
- jev children get only the search path, home, locale, temp, cache, TLS and proxy variables and Jev's own.
- Git on the cached clones names the repository with GIT_DIR, runs with safe.bareRepository=explicit and reads attributes from the empty tree.
- The sandbox denies /proc and the credential directory in the absolute (//path) form as well.
- The scrub hides hex keys that are not digests, URL user:password, three-part dotted tokens and credentials inside hex or base64.
- The dashboard unit sees the settings file, releases, the bare repo and .local read-only.
- post-receive resolves the pushed commit once and the hook deploys that commit; the image build runs pnpm installs without install scripts.
Debian's /var/lock is a symlink, which cannot overwrite the runtime image's
directory during COPY, and apt state has no business in the production layer.
The dev image has no curl, and the dependency closure was lost to apt-cache's
indented output. Flatten it, download every package, and chroot the result so a
missing library fails the build instead of the container.
The dev variant of dhi.io/node:26 supplies bash, apt and npm in the build stages;
the production stage is the runtime variant, which has no shell, so the packages
the process needs are unpacked into a rootfs by a tools stage and copied in as
files. Whatever the image runs is now Node plus those exact binaries.
The dev variant is deliberate: the image needs bash for its entrypoint and apt to
install git, gh, bubblewrap and sqlite3 for the pipeline, which the runtime
variant does not carry. CI now logs in to dhi.io to pull the base.