Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/drawing-board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
candidate:
description: Exact firstdraft/drawing-board commit to qualify
required: true
default: 86bcb7f5bb13c5bb211fecdb09d5e831080d5643
default: 6fb0694dfca90c41b326668435ed691b47de2ab6

permissions:
contents: read
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Select the exact template candidate
id: candidate
env:
CANDIDATE: ${{ inputs.candidate || '86bcb7f5bb13c5bb211fecdb09d5e831080d5643' }}
CANDIDATE: ${{ inputs.candidate || '6fb0694dfca90c41b326668435ed691b47de2ab6' }}
run: |
[[ "$CANDIDATE" =~ ^[0-9a-f]{40}$ ]]
echo "sha=$CANDIDATE" >> "$GITHUB_OUTPUT"
Expand Down
39 changes: 22 additions & 17 deletions drawing-board/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The accepted cross-repository sequence and its safety boundaries live in
| Drawing Board `bin/` | Installation diagnostics and optional Plan review |
| Drawing Board `script/initialize-application` and inventory modules | Nested application's initial Git checkpoint |
| Drawing Board `script/refresh-codespaces-private-port` | Existing Codespaces attachment behavior |
| `image/` | Dockerfile, locked build Features and the historical published-image receipt |
| `image/` | Dockerfile, locked build Features and the receipt for the workspace image the template uses |
| `action.yml` | Source checks and two installation smokes in the exact caller checkout's Dev Container |
| `image/action.yml`, `image/verify/action.yml` | Authorized image build, then AMD64 runtime / ARM64 metadata verification in a dependent job |
| `script/check*` | Source, credential, installation, preservation, workshop-helper and Git-initialization checks |
Expand Down Expand Up @@ -83,9 +83,9 @@ modules directly and keep their fixtures in temporary directories. They do not n

Drawing Board's `contract` job checks out GitHub's exact PR merge candidate (or the pushed main commit), then calls
`firstdraft/dockerfiles/drawing-board` at one full commit SHA. The action copies its `script/` and `image/` into an
owned ignored `tmp/` directory only in that disposable CI checkout, starts the actual candidate Dev Container with
the existing pinned `devcontainers/ci` action, and runs source checks plus the installation smoke twice. An always
step removes only that temporary directory. No maintainer code is committed to the template or retained in a
owned ignored `tmp/` directory in that disposable CI checkout and fetches the public recipe commit recorded in the
receipt. It starts the candidate Dev Container with the pinned `devcontainers/ci` action and runs the source checks
and the installation smoke twice. A final cleanup step removes the temporary directory. No maintainer code is committed to the template or retained in a
student planning archive. Keep the original check name and read-only token permissions in the caller.

This repository's own workflow tests changes against the explicit Drawing Board SHA in
Expand Down Expand Up @@ -199,10 +199,12 @@ requirement. To update the image:
1. change `image/Dockerfile` or `image/.devcontainer.json` in this repository;
2. let the current Dev Container CLI regenerate `image/.devcontainer-lock.json`, then review every
resolved Feature version and digest rather than editing the lock by hand;
3. after separate publication approval, update both Board image-action pins to the merged maintainer revision and
push one Board `devcontainer-image-candidate-safe-<short-sha>` tag (or use its existing manual dispatch);
4. verify both image platforms, then record the reviewed receipt and immutable digest, including the Board caller
revision and exact dockerfiles image-source revision; update the receipt checker for that successor provenance;
3. after separate publication approval, update both Board image-action pins to the merged maintainer revision.
Dispatch the image workflow from Board `main` once the pins merge, or publish from a retained
`devcontainer-image-candidate-safe-<short-sha>` tag. Future CI checkouts need the original Board commit.
4. verify both image platforms and record the immutable digest, Board caller revision and exact dockerfiles recipe
revision in `image/receipt.json`. Record the successful workflow attempt and hash that attempt's original log
archive from GitHub's Actions API.
5. prove a credential-free manifest read by immutable digest and update the receipt's observation; and
6. run the contracts, the built-container smoke twice, and one fresh non-prebuilt Codespace comparison before
calling the successor digest qualified for the ordinary template.
Expand All @@ -215,14 +217,16 @@ GitHub-tunneled development environment; client authentication remains key-only
supersedes the per-container-host-key experiment, but does not approve consumption of its quarantined package.

The candidate workflow remains Board-owned and uses its existing package-write job token. Its SHA-pinned build
and verification actions live here; they do not move a stable or `latest` tag. Keep verification in a separate job
with `needs: build`, because `devcontainers/ci` pushes during the build job's post phase. No image was published
during this relocation.
The consumed image's receipt binds its build inputs to the source commit, source tree, workflow run, platforms,
and manifest digest. The August receipt verifies its build inputs against Drawing Board history. This directory
holds the recipe for the next build. Its Ruby and locked Features can advance while the published template and its
installation smoke keep using the recorded image. The current receipt records both
anonymous access and the retained comparison Codespace as passed. That exact Codespace also proved that
and verification actions live here. The build publishes a tag for the Board commit.
Keep verification in a separate job with `needs: build`, because `devcontainers/ci` pushes during the build job's post phase.
The receipt binds the publishing workflow in Drawing Board and its image recipe in dockerfiles to their original Git
commits, trees and input bytes. It also records the platform digests, the installed AMD64 Ruby and PostgreSQL clients,
anonymous registry access and the fresh Codespace comparison. The next recipe can advance independently while the
template and installation check still use the qualified image.
Full-history CI verifies each source file at its recorded Git commit. A local mount without that history checks
the template's runtime pins against the recorded Codespace versions. The installation smoke checks the running tools.

The August comparison Codespace proved that
`script/selenium` resolves the Compose project from its runtime container identity; no speculative fallback was
needed. The helper remains in use by `script/application-smoke` for the optional nested application and by
`script/devcontainer-smoke` to verify that workspace setup has not started Selenium. Root-adopted applications use
Expand Down Expand Up @@ -310,7 +314,8 @@ fallback.
Review tools weekly as well as during releases. Fresh setup already selects the vendors' latest public Claude and
Codex releases, and the First Draft plugin its catalog offers; verify those installers still work with the
template. Review the pinned Render, Neon and Revyl CLIs, Ruby, Node, PostgreSQL, Dev Container Features, GitHub CLI, and Selenium/image
dependencies against their official releases. Render and Revyl pins carry each Linux asset's published SHA-256;
dependencies against their official releases. Render and Revyl pins carry each Linux asset's published SHA-256.
Setup retries a failed GitHub release download once with a fresh redirect and checks the same digest before installation.
Revyl stays on the laptop kit's version unless the kit moves. Prepare small compatible updates and run the checks for the affected surface. A runtime pin must continue
to match generated Foundations; record a concrete compatibility reason when retaining an older version.

Expand Down
5 changes: 4 additions & 1 deletion drawing-board/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ runs:
set -euo pipefail
mkdir -p tmp
directory="$(mktemp -d tmp/drawing-board-checks.XXXXXX)"
cp -R "$CHECKS_SOURCE/script" "$CHECKS_SOURCE/image" "$directory/"
echo "directory=$directory" >> "$GITHUB_OUTPUT"
cp -R "$CHECKS_SOURCE/script" "$CHECKS_SOURCE/image" "$directory/"
recipe="$(jq -er '.recipe.commit | select(test("^[0-9a-f]{40}$"))' "$CHECKS_SOURCE/image/receipt.json")"
git init --quiet "$directory/published-recipe"
git -C "$directory/published-recipe" fetch --quiet --no-tags --depth=1 https://github.com/firstdraft/dockerfiles.git "$recipe"
# Buildx 0.37.2 refuses the Dev Containers CLI's Compose build of its generated Dockerfile
# (devcontainers/cli#1320). Keep 0.37.1, on the runner's own Docker engine, until a CLI
# release fixes that.
Expand Down
49 changes: 32 additions & 17 deletions drawing-board/image/receipt.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
{
"format": "firstdraft.drawing-board-development-image/1",
"format": "firstdraft.drawing-board-development-image/2",
"source": {
"repository": "firstdraft/drawing-board",
"commit": "1488d6337847a0dfd7da9b7c11de895e81160421",
"tree": "4af88c915789dda2fa6d5e366e35f672981a5030",
"tag": "devcontainer-image-candidate-safe-1488d63"
"ref": "refs/heads/main",
"commit": "981e781cb77e60b8478a404bcb1456f2e9406bb7",
"tree": "0b07305413275ceb99e655c886b36a958f7d6db8"
},
"recipe": {
"repository": "firstdraft/dockerfiles",
"commit": "f7ba4dbd3ff038d326a415186968e03371776bb5",
"tree": "e59a667a831ebccd3a0fc7fdbd21bf8003a3c5a6"
},
"inputs": {
".devcontainer/Dockerfile": "ff81e7bf2b56191d20d592429d29c1be30e0fabaffd9ae9f3c4f0f52e73cd480",
".devcontainer/image/devcontainer.json": "5143f0ed66fd97b986b86f8be171516d194796ca3137f0a14d7580e0bb9bbe75",
".devcontainer/image/devcontainer-lock.json": "9efc5a704e887e1c66679f574cfcb6d5eb9d0ff6b80e3fe3dffd9cbdc7db894b",
".github/workflows/devcontainer-image.yml": "d442d1a1383fb470e5d3e6fa14f2a29b7b09b5dd33a44cfa93575c7467f806a7",
"script/devcontainer-image-smoke": "272260b7bbdbe61613e43ee3e73df2eaf3941442aaa6dc7a27a848d2da1e2134"
".github/workflows/devcontainer-image.yml": "d28ea14cf1a4fb58e0ba36b785115d70d3f72538ac19c519f60b49f78cc24ee2",
"drawing-board/image/Dockerfile": "5a1b641bf68224435d9e73adc588911b088e90fed2d108453e36920670046acd",
"drawing-board/image/.devcontainer.json": "626aaf5ce0f4c7387dd13dd569a8b909cf828d6165421b042138d62002fee7bd",
"drawing-board/image/.devcontainer-lock.json": "0308491af2ed9565451ae5acbd151cebda6f42256db8c1e1f4de8bc865a43b82",
"drawing-board/image/action.yml": "09a877ef61e319af11acdb7df37d9d64014dc371549b13b3ec62dc9ec6680f44",
"drawing-board/image/verify/action.yml": "c10d63ef0da023ee91dec5c24d0ebb142dc670f36cb1dc64b99c7a62b4ad48ad",
"drawing-board/script/devcontainer-image-smoke": "b16ccfe7343c94bea6fef56214d50efcd064df7be9526f6672dc8b6094866235"
},
"publication": {
"workflow_run": 33320822128,
"build_job": 99282366552,
"verify_job": 99284135796,
"workflow_run": 46513778683,
"workflow_attempt": 2,
"build_job": 142185403446,
"verify_job": 142192820203,
"package": "ghcr.io/firstdraft/drawing-board-workspace",
"manifest": "sha256:06602be5cc829d5142c12b06c505dbf8353a3ade6751ca4bf01a785ea2c3e6e3",
"manifest": "sha256:bd687517bba9cfb91de62ddbf3f415f41096ec5c66a0bf56b6bf10ab116397cc",
"platforms": {
"linux/amd64": "sha256:1c8a08347080623ce27daf13651327142eee2ac163907430614869435db2fdae",
"linux/arm64": "sha256:0d09a17e7618d69bc2fa1c57754cbb0453363a19f061686f517efceee59bde10"
"linux/amd64": "sha256:3d4e6f23756e053b4bcddf59999e97581ee871a64c3ed7a72b98a7869dec7839",
"linux/arm64": "sha256:cb90a7fee5eb86af1998c1ec4da3398ca446c612492aafc0b7b4ba8b2206d871"
},
"visibility": "public",
"anonymous_pull": "passed",
Expand All @@ -33,7 +41,8 @@
"locked_feature_ids_present_once_in_metadata": true,
"no_command_stays_running": true,
"official_sshd_feature_starts_key_only_listener": true,
"postgresql_client": "18.6",
"ruby": "4.0.10",
"postgresql_client": "18.7",
"psql_major": 18,
"pg_dump_major": 18
},
Expand All @@ -42,7 +51,13 @@
"runtime": "not_observed"
}
},
"workflow_log_sha256": "8c538bf40f5fa2fc6ead4b4f96afcfb779a0ec429e22c49b74d0df3fb0eb224d"
"workflow_log_sha256": "c569ec95809c5cfeb7b9a438f7c3754e1f9af960ba851a4b0b957fcaa0b54b66",
"comparison_codespace": {
"commit": "6fb0694dfca90c41b326668435ed691b47de2ab6",
"prebuild": false,
"ruby": "4.0.10",
"node": "24.18.0"
}
},
"policy": {
"ssh": {
Expand Down
20 changes: 17 additions & 3 deletions drawing-board/script/check-agent-setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,19 @@ if (args.length === 2) {
assert.equal(args[1], "-o");
const downloads = ${JSON.stringify(downloads)};
const assets = ${JSON.stringify(fixtureAssets)};
const requested = new URL(args[3]);
const pinnedUrl = requested.origin + requested.pathname;
const tool = Object.keys(downloads).find((name) =>
new RegExp("^" + downloads[name].replace(/[.]/g, "[.]") + "(amd64|arm64)" + (name === "render" ? "[.]zip" : "") + "$").test(args[3]));
new RegExp("^" + downloads[name].replace(/[.]/g, "[.]") + "(amd64|arm64)" + (name === "render" ? "[.]zip" : "") + "$").test(pinnedUrl));
assert(tool, "Only the pinned Render and Revyl release assets may be downloaded: " + args[3]);
writeFileSync(args[2], assets[tool]);
appendFileSync(process.env.SETUP_TEST_INSTALLS, JSON.stringify({ agent: tool, args: [args[3].replace(/(amd64|arm64)/, "ARCH")] }) + "\\n");
if (process.env.SETUP_TEST_EXPIRED_REDIRECT === "1") {
if (!requested.search) process.exit(22);
assert.match(requested.search, /^[?]download=[0-9]+$/);
} else {
assert.equal(requested.search, "");
}
writeFileSync(args[2], process.env.SETUP_TEST_CORRUPT_ASSET === tool ? "wrong release bytes" : assets[tool]);
appendFileSync(process.env.SETUP_TEST_INSTALLS, JSON.stringify({ agent: tool, args: [pinnedUrl.replace(/(amd64|arm64)/, "ARCH")] }) + "\\n");
}
`, 0o755);
write(path.join(stubs, "unzip"), `#!/usr/bin/env node
Expand Down Expand Up @@ -302,12 +310,18 @@ writeFileSync(path.join(prefix, "bin", name), "#!/usr/bin/env node\\nconsole.log
run("bash", ["-o", "pipefail", "-c", 'curl -fsSL https://claude.ai/install.sh | bash']);
run("bash", ["-o", "pipefail", "-c", 'curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh -s -- --release latest']);
for (const agent of ["claude", "codex"]) assert.equal(run(path.join(home, ".local/bin", agent), ["--version"]), `${agent} 2.0.0`);
environment.SETUP_TEST_EXPIRED_REDIRECT = "1";
const rerun = run("bash", [path.join(devcontainer, "setup-agents")]);
assert.equal(installs().length, 2 * expectedInstalls.length + 2);
assert.deepEqual(byAgent(installs().slice(-expectedInstalls.length)), expectedInstalls, "Reruns must not reapply an obsolete client pin");
assert(rerun.includes("claude 2.0.0") && rerun.includes("codex 2.0.0"));
assert(rerun.split("\n").includes(pluginVersion));
verifyPreserved();
const corrupted = spawnSync("bash", [path.join(devcontainer, "setup-agents")], {
cwd: workspace, env: {...environment, SETUP_TEST_CORRUPT_ASSET: "render"}, encoding: "utf8", timeout: 30_000,
});
assert.equal(corrupted.status, 1);
assert.match(corrupted.stderr, /render\.zip has SHA-256 [0-9a-f]{64}, not the pinned/);
} finally {
rmSync(temporary, { recursive: true, force: true });
}
Expand Down
Loading