Renderer out of the instance: runner fetches it from the forge
dd66ff0c's instance was 374 MB (CARLOS caps a ship at 256 MiB) because it embedded renderer.tar.gz. Design rev 4 (docs/superpowers/specs/2026-11-30-renderer-out-of-instance.md). - Instance: build-instance-release.sh no longer bundles the archive and bounds the bundle at 160 MiB. InstallAssets neither requires, checks nor serves it (/releases/<v>/renderer.tar.gz is 404). - Runner: the archive's SHA-256, size and forge tag are linked in beside the tree pin (Makefile; RENDERER_REVISION for a republished -r<n>). RendererAsset builds the URL from the RendererForge constant and the tag. The install manifest records the digest and size; Validate pairs them with the pin and bounds the size. - Self-serve install: keeps a verified tree; copies one an earlier release has (CopyRenderer: copies, never links, verified whole); otherwise downloads from the forge into one private scratch file, following exactly one redirect to https without credentials, with an overall and a stall deadline. Then size and digest, MANIFEST pin, full tree verify. Existing failure keys, no new copy. - SOURCES: build-renderer-tree.py writes it beside the archive from the same checked debs (scripts/renderer-sources.py: each package's version, deb, and source package from its control file; chromium's source); "check" mode holds it to the pin. - Provenance: staged-artifacts.py hashes the archive, SOURCES and the install manifest (build information only for binaries) and holds the Linux target to the archive's digest and size. - scripts/publish-renderer.sh: publish (tag the kit's COMMIT, upload the archive and SOURCES with a notes line, verify) or check (full unauthenticated GET of both, compared with the kit; never a HEAD). staging-thin.py runs check before it installs anything and installs from the download. - Operator upgrade, cutover and verify-installed are unchanged (kit). Tests: release, setup, testci, cmd/equipo-runner (renderer, install), equipotest release contracts, staging suite. Mutations (no digest check, any redirects, http redirect, manifest digest ignored, no reuse) each fail a test. Reference scan, budgets and lanes-check pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 files changed,
+1,380
−249
.rastrillo/budgets.txt+1 −1AGENTS.md+2 −0Makefile+12 −1docs/superpowers/specs/2026-11-30-renderer-out-of-instance.md+21 −4internal/equipotest/runner_release_test.go+15 −5internal/release/embedded_install_test.go+28 −7internal/release/install.go+18 −6internal/release/install_assets.go+4 −21internal/release/install_test.go+5 −0internal/release/renderer.go+49 −1internal/release/renderer_assets_test.go+82 −51internal/release/renderer_install.go+87 −1internal/release/renderer_publish_test.go+169 −0internal/release/renderer_tree_test.go+94 −3internal/release/staged_gate_test.go+17 −4internal/runner/setup/install.go+165 −26internal/runner/setup/install_test.go+33 −3internal/runner/setup/renderer_install_test.go+157 −41scripts/build-instance-release.sh+10 −3scripts/build-renderer-tree.py+18 −0scripts/publish-renderer.sh+108 −0scripts/renderer-sources.py+153 −0scripts/runner-install-manifest.py+6 −2scripts/runner-reference-allowlist.json+78 −57scripts/staged-artifacts.py+22 −2scripts/staging-thin-test.py+13 −6scripts/staging-thin.py+13 −4
CI cancelled — superseded by a newer push — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/renderer-out-of-instance: Type Size Avail | ext4 96G 84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 84G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.6s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.8s
ci-box: pi: installed and verified in 7.7s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.8s
ci-box: clone deepened in 7.1s
ci-box: file times set from content: 3747 files, 243 directories
ci-box: ready in 20.9s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok amadan.net/oficina/equipo/internal/equipotest 0.239s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
6.1s
+ go list -export -test -tags testbuild -f ./...
6.3s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
4.2s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC
go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
receipt: test step 1m24.02s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m21.899s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m21.9s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 74.11, cpu waiting 45.57%, memory waiting 0.00%, io waiting 0.47%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless
receipt: test step 1m22.31s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.849s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.85s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 74.11, cpu waiting 45.18%, memory waiting 0.00%, io waiting 0.49%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless
receipt: test step 1m25.792s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m23.543s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m12.28s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 6.01s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 5.25s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 73.70, cpu waiting 45.45%, memory waiting 0.00%, io waiting 0.45%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestMacWorker
=== RUN TestMacWorker
time=2026-11-30T14:17:24.606Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:17:24.606Z level=INFO msg="startup phase done" phase=state_lock took=88µs
time=2026-11-30T14:17:24.606Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:17:24.607Z level=INFO msg="startup phase done" phase=claim_roots took=85µs
time=2026-11-30T14:17:24.607Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:17:24.653Z level=INFO msg="startup phase done" phase=sweep took=46.586ms
time=2026-11-30T14:17:24.653Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:17:24.653Z level=INFO msg="startup phase done" phase=credentials took=98µs
time=2026-11-30T14:17:24.653Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:17:24.707Z level=INFO msg="startup phase done" phase=open_state took=53.689ms
time=2026-11-30T14:17:24.707Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T14:17:24.709Z level=INFO msg=connecting host=127.0.0.1:43365 protocol=38
time=2026-11-30T14:17:24.711Z level=INFO msg=connected host=127.0.0.1:43365 took=1.884ms
time=2026-11-30T14:17:24.711Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:17:24.713Z level=INFO msg="capabilities gathered" took=1.501ms tags=linux,claude,go
time=2026-11-30T14:17:24.715Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:17:24.721Z level=INFO msg=welcome protocol=38 role=primary generation=1
mac_test.go:128: worker log:
d" took=82µs tags=macos,xcode,ios_simulator,claude
time=2026-11-30T14:17:47.655Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:17:47.671Z level=INFO msg=welcome protocol=38 role=worker generation=2
time=2026-11-30T14:17:57.729Z level=WARN msg="test build: the fake Mac worker runs checks in a process group without a sandbox" build=equipo-fake-worker-unsandboxed-process-group
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase done" phase=state_lock took=54µs
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase done" phase=claim_roots took=44µs
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase done" phase=sweep took=53µs
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase done" phase=credentials took=150µs
time=2026-11-30T14:17:57.851Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:17:57.855Z level=INFO msg="startup phase done" phase=open_state took=4.083ms
time=2026-11-30T14:17:57.855Z level=WARN msg="no seal key: Claude cannot be added to this Mac" err=*fs.PathError
time=2026-11-30T14:17:57.856Z level=INFO msg=connecting host=127.0.0.1:43365 protocol=38
time=2026-11-30T14:17:57.861Z level=INFO msg=connected host=127.0.0.1:43365 took=5.425ms
time=2026-11-30T14:17:57.861Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:17:57.862Z level=INFO msg="capabilities gathered" took=138µs tags=macos,xcode,ios_simulator,claude
time=2026-11-30T14:17:57.862Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:17:57.869Z level=INFO msg=welcome protocol=38 role=worker generation=3
time=2026-11-30T14:18:02.110Z level=WARN msg="test build: the fake Mac worker runs checks in a process group without a sandbox" build=equipo-fake-worker-unsandboxed-process-group
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase done" phase=state_lock took=59µs
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase done" phase=claim_roots took=44µs
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase done" phase=sweep took=69µs
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase done" phase=credentials took=126µs
time=2026-11-30T14:18:02.244Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:18:02.251Z level=INFO msg="startup phase done" phase=open_state took=7.247ms
time=2026-11-30T14:18:02.252Z level=WARN msg="no seal key: Claude cannot be added to this Mac" err=*fs.PathError
time=2026-11-30T14:18:02.362Z level=INFO msg=connecting host=127.0.0.1:43365 protocol=38
time=2026-11-30T14:18:02.365Z level=INFO msg=connected host=127.0.0.1:43365 took=2.633ms
time=2026-11-30T14:18:02.365Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:18:02.365Z level=INFO msg="capabilities gathered" took=84µs tags=macos,xcode,ios_simulator,claude
time=2026-11-30T14:18:02.365Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:18:02.372Z level=INFO msg=welcome protocol=38 role=worker generation=4
time=2026-11-30T14:18:07.770Z level=INFO msg="kept sessions" kept=1 bytes=3060 expired=0
time=2026-11-30T14:18:12.897Z level=INFO msg="kept sessions" kept=2 bytes=6219 expired=0
time=2026-11-30T14:18:15.174Z level=INFO msg="kept sessions" kept=3 bytes=11893 expired=0
time=2026-11-30T14:18:19.934Z level=INFO msg="kept sessions" kept=4 bytes=15730 expired=0
time=2026-11-30T14:18:22.348Z level=INFO msg="kept sessions" kept=5 bytes=22082 expired=0
time=2026-11-30T14:18:27.176Z level=WARN msg="test build: the fake Mac worker runs checks in a process group without a sandbox" build=equipo-fake-worker-unsandboxed-process-group
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase done" phase=state_lock took=59µs
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase done" phase=claim_roots took=46µs
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase done" phase=sweep took=142µs
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase done" phase=credentials took=136µs
time=2026-11-30T14:18:27.259Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:18:27.265Z level=INFO msg="startup phase done" phase=open_state took=5.173ms
time=2026-11-30T14:18:27.265Z level=WARN msg="no seal key: Claude cannot be added to this Mac" err=*fs.PathError
time=2026-11-30T14:18:27.375Z level=INFO msg=connecting host=127.0.0.1:43365 protocol=38
time=2026-11-30T14:18:27.375Z level=INFO msg="kept sessions" kept=5 bytes=22082 expired=0
time=2026-11-30T14:18:27.376Z level=INFO msg=connected host=127.0.0.1:43365 took=1.731ms
time=2026-11-30T14:18:27.376Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:18:27.376Z level=INFO msg="capabilities gathered" took=83µs tags=macos,xcode,ios_simulator,claude
time=2026-11-30T14:18:27.377Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:18:27.386Z level=INFO msg=welcome protocol=38 role=worker generation=5
time=2026-11-30T14:18:29.026Z level=INFO msg="kept sessions" kept=6 bytes=25512 expired=0
time=2026-11-30T14:18:32.313Z level=INFO msg="kept sessions" kept=6 bytes=27258 expired=0
time=2026-11-30T14:18:32.603Z level=WARN msg="test build: the fake Mac worker runs checks in a process group without a sandbox" build=equipo-fake-worker-unsandboxed-process-group
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase done" phase=state_lock took=58µs
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase done" phase=claim_roots took=44µs
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase done" phase=sweep took=57µs
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase done" phase=credentials took=131µs
time=2026-11-30T14:18:32.679Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:18:32.683Z level=INFO msg="startup phase done" phase=open_state took=3.662ms
time=2026-11-30T14:18:32.683Z level=WARN msg="no seal key: Claude cannot be added to this Mac" err=*fs.PathError
time=2026-11-30T14:18:32.684Z level=INFO msg=connecting host=127.0.0.1:43365 protocol=38
time=2026-11-30T14:18:32.685Z level=INFO msg="kept sessions" kept=6 bytes=27258 expired=0
time=2026-11-30T14:18:32.686Z level=INFO msg=connected host=127.0.0.1:43365 took=1.634ms
time=2026-11-30T14:18:32.686Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:18:32.686Z level=INFO msg="capabilities gathered" took=92µs tags=macos,xcode,ios_simulator,claude
time=2026-11-30T14:18:32.686Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:18:32.694Z level=INFO msg=welcome protocol=38 role=worker generation=6
time=2026-11-30T14:18:32.712Z level=INFO msg="kept sessions" kept=5 bytes=22082 expired=0
time=2026-11-30T14:18:34.194Z level=WARN msg="secret in candidate: nothing uploaded" object="" kind=gitleaks
time=2026-11-30T14:19:34.924Z level=WARN msg="kept sessions" err=syscall.Errno
--- FAIL: TestMacWorker (133.19s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestMacWorker/M9b
=== RUN TestMacWorker/M9b
time=2026-11-30T14:18:12.987Z level=WARN msg="publication push" err="forge: push outcome unknown: git push (refused): ! 16b6f97f701f25f9552e65c1763f2d001f021664:refs/heads/equipo/tkybxpwo3ou5-pane-back-gesture [remote rejected] (pre-receive hook declined) remote: refused error: failed to push some refs to '/tmp/eqh-174696314/forge/woodstar__panes.git'" refusal=refused
mac_test.go:739: fix round {ChangeFiles:<nil> BaseChecks: ID:s_y7iezy6ltxwyitdmwevioxduej Revision:5 TaskID:tkybxpwo3ou5 Index:3 Specialist:engineering State:done Reason: Attempt:1 BaseSHA:16b6f97f701f25f9552e65c1763f2d001f021664 CandidateSHA:d0e6b7cf3d09ac895512b18299b39f030fcb019a Pushed:false Terminated:true Summary:No build/leftover.txt. Working in /tmp/eqh-174696314/mac/scratch/worker-steps/512f5f2685ffc7d9/tree. Replaced "paneBack = false" with "paneBack = true" in Woodstar/Pane.swift. (resumed session) (signed in by token) Headline:Made the change the task asks for. LogTail:Read /tmp/eqh-174696314/mac/scratch/worker-steps/512f5f2685ffc7d9/tree/Woodstar/Pane.swift
Edit /tmp/eqh-174696314/mac/scratch/worker-steps/512f5f2685ffc7d9/tree/Woodstar/Pane.swift
Headline: Made the change the task asks for. StartedAt:2026-11-30 14:18:13.94409534 +0000 UTC FinishedAt:2026-11-30 14:18:15.197511583 +0000 UTC Round:1 Family:claude Account:mac-claude Model: Verdict: ReviewLabel: Findings:[] Checks: Gate: ExitCode:<nil> Hosted:<nil> Askable:true Rebase:false MergeSHA: Into: Strategy: WithoutChecks:false Switched:<nil> Activity:[] RunnerID:BWHEOUB6HR6MHSBP4H6MUQCWGW RunnerLabel:Tito Studio Needs:[macos xcode ios_simulator claude] Placement: Publication:pending TerminationKind:process_group EngineeringStatus:<nil> SandboxChoice: WaitingFor: MadeOn:Tito Studio XcodeAccess:sandboxed ChecksSandbox: Preview:<nil> Research:<nil> Design:<nil> Hold:<nil> Paused:<nil> Publish:<nil> RetriedBy:}
--- FAIL: TestMacWorker/M9b (4.17s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 2m47.836s
FAIL amadan.net/oficina/equipo/internal/headless 168.115s
receipt: test step 2m50.375s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 2m47.836s amadan.net/oficina/equipo/internal/headless
receipt: slow test 2m13.19s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 15.85s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.61s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.19s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
exit status 1
+ go test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' -v -run '^TestMacWorker$/^M9b$' -count=1 ./internal/headless (retry, once)
FAILED TWICE ./internal/headless:TestMacWorker/M9b headless-mac
=== RUN TestMacWorker
time=2026-11-30T14:19:56.199Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:19:56.199Z level=INFO msg="startup phase done" phase=state_lock took=51µs
time=2026-11-30T14:19:56.199Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:19:56.199Z level=INFO msg="startup phase done" phase=claim_roots took=82µs
time=2026-11-30T14:19:56.199Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:19:56.241Z level=INFO msg="startup phase done" phase=sweep took=41.675ms
time=2026-11-30T14:19:56.241Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:19:56.241Z level=INFO msg="startup phase done" phase=credentials took=103µs
time=2026-11-30T14:19:56.241Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:19:56.291Z level=INFO msg="startup phase done" phase=open_state took=49.834ms
time=2026-11-30T14:19:56.291Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T14:19:56.292Z level=INFO msg=connecting host=127.0.0.1:44493 protocol=38
time=2026-11-30T14:19:56.293Z level=INFO msg=connected host=127.0.0.1:44493 took=1.039ms
time=2026-11-30T14:19:56.294Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:19:56.294Z level=INFO msg="capabilities gathered" took=352µs tags=linux,claude,go
time=2026-11-30T14:19:56.295Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:19:56.301Z level=INFO msg=welcome protocol=38 role=primary generation=1
=== RUN TestMacWorker/M9b
time=2026-11-30T14:19:57.226Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-30T14:19:59.808Z level=WARN msg="publication push" err="forge: push outcome unknown: git push (refused): ! 23431ea5017016a1150d4f996e19e7620ff27a2b:refs/heads/equipo/tk6dipjjvenw-pane-back-gesture [remote rejected] (pre-receive hook declined) remote: refused error: failed to push some refs to '/tmp/eqh-2161257166/forge/woodstar__panes.git'" refusal=refused
mac_test.go:757: worktrees "/tmp/eqh-2161257166/mac/scratch/worker-steps/09ee4749b52392f2/tree" then "" ("Working in /tmp/eqh-2161257166/mac/scratch/worker-steps/09ee4749b52392f2/tree. Created Woodstar/Pane.swift. Created build/leftover.txt. Created Woodstar/Pane.swift. (signed in by token)" / "Replaced \"edgeSwipe = false\" with \"edgeSwipe = true\" in Woodstar/Swipe.swift. (resumed session) (signed in by token)")
=== NAME TestMacWorker
mac_test.go:128: worker log:
time=2026-11-30T14:19:56.627Z level=WARN msg="test build: the fake Mac worker runs checks in a process group without a sandbox" build=equipo-fake-worker-unsandboxed-process-group
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase done" phase=state_lock took=60µs
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase done" phase=claim_roots took=75µs
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase done" phase=sweep took=44µs
time=2026-11-30T14:19:56.682Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:19:56.683Z level=INFO msg="startup phase done" phase=credentials took=143µs
time=2026-11-30T14:19:56.683Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:19:56.686Z level=INFO msg="startup phase done" phase=open_state took=3.346ms
time=2026-11-30T14:19:56.686Z level=WARN msg="no seal key: Claude cannot be added to this Mac" err=*fs.PathError
time=2026-11-30T14:19:56.687Z level=INFO msg=connecting host=127.0.0.1:44493 protocol=38
time=2026-11-30T14:19:56.688Z level=INFO msg=connected host=127.0.0.1:44493 took=1.028ms
time=2026-11-30T14:19:56.688Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:19:56.688Z level=INFO msg="capabilities gathered" took=98µs tags=macos,xcode,ios_simulator,claude
time=2026-11-30T14:19:56.688Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:19:56.692Z level=INFO msg=welcome protocol=38 role=worker generation=1
time=2026-11-30T14:19:59.737Z level=INFO msg="kept sessions" kept=1 bytes=3162 expired=0
time=2026-11-30T14:20:01.425Z level=INFO msg="kept sessions" kept=2 bytes=8709 expired=0
time=2026-11-30T14:20:03.040Z level=INFO msg="kept sessions" kept=3 bytes=16774 expired=0
time=2026-11-30T14:20:03.094Z level=WARN msg="publication push" err="forge: push outcome unknown: git ls-remote: signal: killed"
time=2026-11-30T14:20:03.094Z level=WARN msg="relay bases" err=cancelled
time=2026-11-30T14:20:03.094Z level=WARN msg="relay uploads" err=cancelled
time=2026-11-30T14:20:03.094Z level=WARN msg="relay publications" err=cancelled
--- FAIL: TestMacWorker (8.71s)
--- FAIL: TestMacWorker/M9b (6.34s)
FAIL
rastrillo-budget/v1 ran 8.714s
FAIL amadan.net/oficina/equipo/internal/headless 8.888s
FAIL
machine: 32 CPUs, load 26.19, cpu waiting 13.34%, memory waiting 0.00%, io waiting 0.09%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 3 of 29 failed: exit status 2
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 1m43.877s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m41.03s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m10.06s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.58s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.68s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.63s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.09s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 66.61, cpu waiting 42.85%, memory waiting 0.00%, io waiting 0.35%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 3m35.504s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m33.076s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m46.8s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 23.99s amadan.net/oficina/equipo/internal/headless TestMacMixedVersions
receipt: slow test 21.3s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.58s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.33s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
machine: 32 CPUs, load 17.53, cpu waiting 7.57%, memory waiting 0.00%, io waiting 0.04%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest
receipt: test step 3m32.021s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m29.169s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 15.68s amadan.net/oficina/equipo/internal/thintest TestTasklessHoldResumes
receipt: slow test 11.03s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.68s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.46s amadan.net/oficina/equipo/internal/thintest TestAbilityHoldResumes
receipt: slow test 5.46s amadan.net/oficina/equipo/internal/thintest TestNudgeResumesHeldJob
machine: 32 CPUs, load 17.53, cpu waiting 8.09%, memory waiting 0.00%, io waiting 0.05%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest
receipt: test step 2m27.229s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m24.788s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.45s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.06s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.94s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 4.89s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 3.07s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 37.84, cpu waiting 22.09%, memory waiting 0.00%, io waiting 0.16%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
amadan: job cancelled — a newer push superseded it
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner
receipt: test step 51.139s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 50.167s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.13s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 56.44, cpu waiting 33.88%, memory waiting 0.00%, io waiting 0.83%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
receipt: test step 1m3.441s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m2.199s amadan.net/oficina/equipo/internal/runner
receipt: slow test 52.28s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 44.74s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.43s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.48s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 69.28, cpu waiting 41.08%, memory waiting 0.00%, io waiting 0.68%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/runner TestDarwinToolProxyFrameBounds
=== RUN TestDarwinToolProxyFrameBounds
tool_proxy_mac_test.go:149: a reply over the bound: io: read/write on closed pipe, 0 bytes out
--- FAIL: TestDarwinToolProxyFrameBounds (0.02s)
--- FAIL amadan.net/oficina/equipo/internal/runner (package output)
FAIL
rastrillo-budget/v1 ran 41.049s
FAIL amadan.net/oficina/equipo/internal/runner 41.061s
receipt: test step 41.74s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 41.049s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 5.01s amadan.net/oficina/equipo/internal/runner TestEnrolCommitsTheCredentialLast
receipt: slow test 3.45s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.26s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
exit status 1
+ go test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' -v -run '^TestDarwinToolProxyFrameBounds$' -count=1 ./internal/runner (retry, once)
##############################################################################
FLAKE ./internal/runner:TestDarwinToolProxyFrameBounds runner-rest a750c137efddb1fc6f46600af6c96a1d6a255082 0.02s 48.91
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 48.91, cpu waiting 27.78%, memory waiting 0.00%, io waiting 0.96%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 38.4%, load 28.37
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
receipt: test step 1m16.218s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m13.929s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 33.3s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 33.21s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 30.79s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 27.49s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 27.2s amadan.net/oficina/equipo/internal/equipotest TestAuthoritySnapshotChanges
machine: 32 CPUs, load 62.48, cpu waiting 41.05%, memory waiting 0.00%, io waiting 0.32%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 38.4%, load 28.37
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest
receipt: test step 2m26.632s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m24.477s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.4s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 24.39s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 24.35s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 24.34s amadan.net/oficina/equipo/internal/equipotest TestProjectsSharedAndGrouped
receipt: slow test 24.33s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
machine: 32 CPUs, load 26.19, cpu waiting 14.22%, memory waiting 0.00%, io waiting 0.09%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 40.1%, load 28.37
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
budget note: internal/equipotest took 5m42.665s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI
receipt: test step 5m49.059s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 5m42.665s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m46.74s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.92s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.88s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.82s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.77s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 2.62, cpu waiting 0.48%, memory waiting 0.00%, io waiting 0.00%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 40.1%, load 28.37
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest
receipt: test step 1m14.644s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m12.449s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 30.66s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 30.08s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 30.06s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 27.74s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
receipt: slow test 27.67s amadan.net/oficina/equipo/internal/equipotest TestSigninBackgroundSweep
machine: 32 CPUs, load 66.61, cpu waiting 42.23%, memory waiting 0.00%, io waiting 0.33%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 38.4%, load 28.37
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
receipt: test step 1m1.283s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 58.759s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 4.43s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.6s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.89s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.6s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
receipt: slow test 1.59s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
machine: 32 CPUs, load 73.70, cpu waiting 44.94%, memory waiting 0.00%, io waiting 0.42%
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 40.1%, load 28.37
test lane rest: ./cmd/equipo ./cmd/equipo-hosted-controller ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedclient ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/designstep ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mac/creds ./internal/runner/mac/denylist ./internal/runner/mac/fprobe ./internal/runner/mac/proc ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/websource/hostaddrs ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-hosted-controller ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedclient ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/designstep ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mac/creds ./internal/runner/mac/denylist ./internal/runner/mac/fprobe ./internal/runner/mac/proc ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/websource/hostaddrs ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/isolatedjob: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/hostedclient: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude TestClaudeCaptureSequence
=== RUN TestClaudeCaptureSequence
launcher_test.go:806: claude_turn_uncertain
--- FAIL: TestClaudeCaptureSequence (0.17s)
--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude (package output)
FAIL
rastrillo-budget/v1 ran 36.561s
FAIL amadan.net/oficina/equipo/internal/runner/provider/claude 37.484s
--- FAIL amadan.net/oficina/equipo/internal/runner/webread TestTimeouts
=== RUN TestTimeouts
fetch_test.go:537: s1: {Source:s1 Origin:paul Parent: URL:https://shop.example.com/slow-body Hops:[{URL:https://shop.example.com/slow-body Address:151.101.1.1 Status:200}] Address:151.101.1.1 Status:200 Type:text/plain Bytes:5 SHA256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 Millis:301 Reason: File:s001.txt}
--- FAIL: TestTimeouts (0.61s)
--- FAIL amadan.net/oficina/equipo/internal/runner/webread (package output)
FAIL
rastrillo-budget/v1 ran 1.244s
FAIL amadan.net/oficina/equipo/internal/runner/webread 1.269s
budget: amadan.net/oficina/equipo/internal/runner/pause ran tests but printed no time: add func TestMain(m *testing.M) { os.Exit(budget.Main(m)) }
budget note: internal/equipo took 2m55.752s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 47.239s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.217s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 14.907s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/hostedctl took 31.81s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/idtest took 2m17.642s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 52.451s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 1m9.663s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 28.001s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/mac took 46.024s, over the 45s its record on line 43 allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/mac/fprobe took 14.761s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 16.027s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/render took 1m27.107s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 3m1.144s against a 60s target (the gate's other steps are not in this figure)
receipt: 33 packages ran, 50 cached, 21 without tests, 2 failed
receipt: slow package 2m55.752s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 2m17.642s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m27.107s amadan.net/oficina/equipo/internal/runner/render
receipt: slow package 1m16.986s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 1m9.663s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 1m2.37s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 53.59s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 53.2s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 53.1s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 52.61s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestClaudeCaptureSequence$' -count=1 ./internal/runner/provider/claude (retry, once)
##############################################################################
FLAKE ./internal/runner/provider/claude:TestClaudeCaptureSequence rest a750c137efddb1fc6f46600af6c96a1d6a255082 0.17s 17.53
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
+ go test -tags testbuild -timeout 15m -v -run '^TestTimeouts$' -count=1 ./internal/runner/webread (retry, once)
##############################################################################
FLAKE ./internal/runner/webread:TestTimeouts rest a750c137efddb1fc6f46600af6c96a1d6a255082 0.61s 17.53
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 17.53, cpu waiting 7.57%, memory waiting 0.00%, io waiting 0.04%
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
=== RUN TestBrowserDraftIsTheMessage
time=2026-11-30T14:17:52.481Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:17:52.481Z level=INFO msg="startup phase done" phase=state_lock took=63µs
time=2026-11-30T14:17:52.481Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:17:52.481Z level=INFO msg="startup phase done" phase=claim_roots took=84µs
time=2026-11-30T14:17:52.481Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:17:52.552Z level=INFO msg="startup phase done" phase=sweep took=71.022ms
time=2026-11-30T14:17:52.552Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:17:52.552Z level=INFO msg="startup phase done" phase=credentials took=97µs
time=2026-11-30T14:17:52.552Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:17:52.615Z level=INFO msg="startup phase done" phase=open_state took=62.656ms
time=2026-11-30T14:17:52.616Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T14:17:52.617Z level=INFO msg=connecting host=127.0.0.1:45207 protocol=38
time=2026-11-30T14:17:52.619Z level=INFO msg=connected host=127.0.0.1:45207 took=1.97ms
time=2026-11-30T14:17:52.619Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:17:52.620Z level=INFO msg="capabilities gathered" took=575µs tags=linux,claude,go
time=2026-11-30T14:17:52.620Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:17:52.646Z level=INFO msg=welcome protocol=38 role=primary generation=1
time=2026-11-30T14:17:54.602Z level=INFO msg="connection checked" connection=claude-1 state=healthy
browser_thinking_test.go:106: waiting for !!window.__m: context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserDraftIsTheMessage (8.56s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 54.729s
FAIL amadan.net/oficina/equipo/internal/headless 54.984s
receipt: test step 57.002s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 54.729s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.82s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.63s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 8.56s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 7.56s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 7.05s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' -v -run '^TestBrowserDraftIsTheMessage$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserDraftIsTheMessage browser-headless-chat a750c137efddb1fc6f46600af6c96a1d6a255082 8.56s 66.86
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 69.54, cpu waiting 43.87%, memory waiting 0.00%, io waiting 0.37%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
receipt: test step 1m41.013s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m38.973s amadan.net/oficina/equipo/internal/headless
receipt: slow test 31.14s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 24.16s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.88s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.49s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 10.05s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 66.61, cpu waiting 42.85%, memory waiting 0.00%, io waiting 0.35%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
receipt: test step 1m58.268s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m56.171s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.72s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.54s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 13.18s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.72s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 11.37s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
machine: 32 CPUs, load 55.00, cpu waiting 34.15%, memory waiting 0.00%, io waiting 0.26%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-30T14:17:55.565Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T14:17:55.565Z level=INFO msg="startup phase done" phase=state_lock took=145µs
time=2026-11-30T14:17:55.565Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T14:17:55.565Z level=INFO msg="startup phase done" phase=claim_roots took=96µs
time=2026-11-30T14:17:55.565Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T14:17:55.635Z level=INFO msg="startup phase done" phase=sweep took=69.418ms
time=2026-11-30T14:17:55.635Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T14:17:55.635Z level=INFO msg="startup phase done" phase=credentials took=201µs
time=2026-11-30T14:17:55.635Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T14:17:55.697Z level=INFO msg="startup phase done" phase=open_state took=61.341ms
time=2026-11-30T14:17:55.697Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T14:17:55.698Z level=INFO msg=connecting host=127.0.0.1:34099 protocol=38
time=2026-11-30T14:17:55.701Z level=INFO msg=connected host=127.0.0.1:34099 took=2.399ms
time=2026-11-30T14:17:55.701Z level=INFO msg="capabilities gathering"
time=2026-11-30T14:17:55.702Z level=INFO msg="capabilities gathered" took=659µs tags=linux,claude,go
time=2026-11-30T14:17:55.702Z level=INFO msg="hello sent" protocol=38
time=2026-11-30T14:17:55.711Z level=INFO msg=welcome protocol=38 role=primary generation=1
browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.77s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m45.99s
FAIL amadan.net/oficina/equipo/internal/headless 106.251s
receipt: test step 1m47.908s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m45.99s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.31s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 13.89s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 11.02s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.75s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.79s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
rastrillo: budget test: go test failed
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest a750c137efddb1fc6f46600af6c96a1d6a255082 6.77s 62.48
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 58.92, cpu waiting 36.36%, memory waiting 0.00%, io waiting 0.28%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo
receipt: test step 4.548s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.554s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.94s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 610ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest
receipt: test step 8.283s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 6.617s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.62s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.374s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 13.007s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 11.374s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 9.18s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.19s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test
receipt: test step 4.588s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.817s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.82s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAskMacOffline|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest
receipt: test step 3m45.293s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m42.549s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 28.3s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.39s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.05s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.8s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.57s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 9.88, cpu waiting 3.76%, memory waiting 0.00%, io waiting 0.02%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless (55s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.89s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.36s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.78s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.47s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.81s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless (68s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 25.67s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.81s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.94s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 17.61s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (22s)
ok ./internal/headless TestMixedVersions 20.05s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.77s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 70.70, cpu waiting 43.27%, memory waiting 0.00%, io waiting 0.60%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
receipt: test step 13.542s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.659s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 242ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 78ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 4ms amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow test 5.37s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.74s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 410ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 240ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 4.471s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.334s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicy
machine: 32 CPUs, load 24.38, cpu waiting 11.16%, memory waiting 0.00%, io waiting 1.43%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 38.4%, load 28.37
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 3459 text files, 3965 matches, 0 failures
python3 native/scripts/check-share.py
Share packaging, keychain-only boundary and reviewed copy verified
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 116 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.899s
machine: 32 CPUs, load 73.70, cpu waiting 45.08%, memory waiting 0.00%, io waiting 0.44%
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 38.4%, load 28.37
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 66.86, cpu waiting 39.09%, memory waiting 0.00%, io waiting 0.73%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 38.4%, load 28.37
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 70.70, cpu waiting 43.04%, memory waiting 0.00%, io waiting 0.62%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 38.4%, load 28.37
shard 28: make gitleaks
[90m2:17PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m2:18PM[0m [32mINF[0m [1m1321 commits scanned.[0m
[90m2:18PM[0m [32mINF[0m [1mscanned ~74862436 bytes (74.86 MB) in 28.5s[0m
[90m2:18PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 66.86, cpu waiting 39.09%, memory waiting 0.00%, io waiting 0.73%
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 7a4797fe..4e5cb85b 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -16,7 +16,7 @@ time internal/equipotest 300s Final fix package rerun measured 187.035s (review |
| size internal/equipo 24733 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1, probe details, Design's copy; measured 24733. |
| size internal/wire 9726 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, 38 Design, unproven and probe detail codes; measured 9726. |
| -size internal/equipotest - 12683 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures and Rastrillo asset contract; measured 0/12683 source/test lines. |
| +size internal/equipotest - 12693 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures, Rastrillo asset contract, renderer archive link; measured 0/12693 source/test lines. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
diff --git a/AGENTS.md b/AGENTS.md| index c76bbbbe..d4d03005 100644 |
| --- a/AGENTS.md |
| +++ b/AGENTS.md |
| @@ -48,6 +48,8 @@ Never log credentials or sign-in links in production. |
| Production upgrades: an agent runs `scripts/upgrade-thin.sh <version> --execute` (and its rollback) itself, then tells Paul. With a green staging run and no waiver it needs no one's go (Paul, 2026-11-20). A waiver is Paul's decision; once he approves one, the agent still runs the upgrade, not Paul (Paul, 2026-11-22). The cutover scripts and anything needing the owner's sign-in (enrolment links, revoking machines) stay with Paul. |
| +The page renderer is not in the instance (it would pass the platform's 256 MiB ship cap). A release whose `renderer.tar.gz` changed is published before staging with `scripts/publish-renderer.sh publish <the runner release directory>`: the archive and its `SOURCES` on the forge, under the tag linked into the runner. Staging downloads and checks it (`publish-renderer.sh check`) before it installs anything, and refuses an unpublished one. Self-serve installs fetch it from there. |
| + |
| Use Rastrillo v0.45.0 APIs from the pinned module cache. Resolve activation, |
| open one database, construct the app, clear `opts.DBPath`, then serve. |
| The database closes on shutdown and on failed app construction. |
diff --git a/Makefile b/Makefile| index 38db5c98..7ea6de8a 100644 |
| --- a/Makefile |
| +++ b/Makefile |
| @@ -280,6 +280,17 @@ GITLEAKS_SHA256 = $$(sha256sum $(RUNNER_RELEASE_DIR)/gitleaks | cut -d ' ' -f 1) |
| # digest is linked into the Linux runner as gitleaks' is, and recorded in |
| # the install manifest's Linux target. A Mac runner has no renderer. |
| RENDERER_SHA256 = $$(tar -xzOf $(RUNNER_RELEASE_DIR)/renderer.tar.gz MANIFEST | sha256sum | cut -d ' ' -f 1) |
| +# The archive itself is not in the instance (it would pass the platform's |
| +# 256 MiB ship cap): the Linux runner fetches it from its forge release, |
| +# renderer-<first 12 of its SHA-256> (internal/release RendererForge), and |
| +# checks its digest and size, linked here from the same file. A withdrawn |
| +# release's bytes are published again as renderer-<12>-<RENDERER_REVISION> |
| +# (r2, r3, ...): set it for that build. scripts/publish-renderer.sh |
| +# publishes the kit's archive and SOURCES under the linked tag. |
| +RENDERER_ARCHIVE_SHA256 = $$(sha256sum $(RUNNER_RELEASE_DIR)/renderer.tar.gz | cut -d ' ' -f 1) |
| +RENDERER_ARCHIVE_SIZE = $$(stat -c %s $(RUNNER_RELEASE_DIR)/renderer.tar.gz) |
| +RENDERER_REVISION ?= |
| +RENDERER_TAG = renderer-$$(sha256sum $(RUNNER_RELEASE_DIR)/renderer.tar.gz | cut -c 1-12)$(if $(RENDERER_REVISION),-$(RENDERER_REVISION)) |
| RELEASE_LDFLAGS = -s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=$$(git rev-parse --short HEAD) -X amadan.net/oficina/equipo/internal/release.toolProxySHA256=$(TOOL_PROXY_SHA256) |
| release-runner: copy-release-check direct-release-check |
| @@ -293,7 +304,7 @@ release-runner: copy-release-check direct-release-check |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o $(RUNNER_RELEASE_DIR)/equipo-tool-proxy ./cmd/equipo-tool-proxy |
| python3 scripts/build-renderer-tree.py internal/release/renderer.json $(RUNNER_RELEASE_DIR)/renderer.tar.gz |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath \ |
| - -ldflags "$(RELEASE_LDFLAGS) -X amadan.net/oficina/equipo/internal/release.gitleaksSHA256=$(GITLEAKS_SHA256) -X amadan.net/oficina/equipo/internal/release.rendererSHA256=$(RENDERER_SHA256)" \ |
| + -ldflags "$(RELEASE_LDFLAGS) -X amadan.net/oficina/equipo/internal/release.gitleaksSHA256=$(GITLEAKS_SHA256) -X amadan.net/oficina/equipo/internal/release.rendererSHA256=$(RENDERER_SHA256) -X amadan.net/oficina/equipo/internal/release.rendererArchiveSHA256=$(RENDERER_ARCHIVE_SHA256) -X amadan.net/oficina/equipo/internal/release.rendererArchiveSize=$(RENDERER_ARCHIVE_SIZE) -X amadan.net/oficina/equipo/internal/release.rendererTag=$(RENDERER_TAG)" \ |
| -o $(RUNNER_RELEASE_DIR)/equipo-runner ./cmd/equipo-runner |
| scripts/no-fake-worker.sh $(RUNNER_RELEASE_DIR)/equipo-runner |
| @mkdir -p $(RUNNER_RELEASE_DIR)/darwin-arm64 |
diff --git a/docs/superpowers/specs/2026-11-30-renderer-out-of-instance.md b/docs/superpowers/specs/2026-11-30-renderer-out-of-instance.md| index 34ea1ddf..d6c59574 100644 |
| --- a/docs/superpowers/specs/2026-11-30-renderer-out-of-instance.md |
| +++ b/docs/superpowers/specs/2026-11-30-renderer-out-of-instance.md |
| @@ -1,7 +1,8 @@ |
| # The page renderer out of the instance (design note) |
| -Status: rev 3. Rev 2 was approved by the coordinating session |
| -(2026-11-30); rev 3 adds the host probe's findings and the SOURCES record. Branch |
| +Status: rev 4, built on this branch. Rev 2 was approved by the |
| +coordinating session (2026-11-30). Rev 3 adds the host probe's findings and |
| +the SOURCES record. Rev 4 folds in Astra's build round 1 (below). Branch |
| `renderer-out-of-instance` off main dd66ff0c. Rev 1 had one Astra review |
| (NOT READY, 4 Important, 2 Minor). Its findings are folded in below and |
| listed at the end. It was not reviewed again. |
| @@ -19,7 +20,7 @@ verifies it today. No chunked deploys, no split binary. |
| ## Who reads the instance's copy today |
| -Only the self-serve install: `install-v1.sh` runs `equipo-runner`'s |
| +Only the self-serve install: `install-v1.sh` runs the runner's |
| `setup.installUser` (`internal/runner/setup/install.go`). It fetches |
| `<origin>/releases/<v>/renderer.tar.gz` when no verified tree for the |
| linked pin is on disk, and requires the archive's MANIFEST digest to equal |
| @@ -28,7 +29,7 @@ install manifest's `targets.linux.renderer_sha256`. |
| The operator paths never touch it. `scripts/upgrade-thin.sh`, |
| `cutover-thin.sh`, `cutover-finish-thin.sh` and `staging-thin.py` run |
| -`equipo-runner install-renderer <kit>/renderer.tar.gz` from the release |
| +the runner's `install-renderer <kit>/renderer.tar.gz` from the release |
| kit, after `renderer_linked` checks the MANIFEST digest against the runner. |
| The Mac updater (`thin/mac.go`) fetches only darwin assets, and a Mac has no |
| renderer. `verify-installed` reads the tree on disk and renders the fixture. |
| @@ -265,3 +266,19 @@ covers `SOURCES` too, against the kit's copy. |
| after staging. |
| - `publish-renderer.sh` refuses a published asset that differs from the |
| kit. |
| + |
| +## Astra build round 1 (on rev 3) and what changed |
| + |
| +- Important, provenance: adding the archive and the install manifest to |
| + `artifacts()` would send them through the Go build-information check. |
| + Now every artifact is hashed, and only binaries are asked for build |
| + information (`NOT_BINARIES`). The exact Linux-target comparison |
| + includes the archive's digest and size. |
| +- Important, SOURCES lacked provenance. It is now one of the staged |
| + artifacts, hashed and re-verified like the archive. |
| +- Minor, tagging: `publish-renderer.sh` tags the kit's `COMMIT`, never the |
| + checkout, and refuses a forge tag on another commit. |
| +- Minor, size: the archive size is linked into the runner |
| + (`rendererArchiveSize`) from the same file, and `RendererAsset.Valid` |
| + requires `0 < size <= RendererArchiveMax`. |
| + |
diff --git a/internal/equipotest/runner_release_test.go b/internal/equipotest/runner_release_test.go| index 38173252..02d1a69d 100644 |
| --- a/internal/equipotest/runner_release_test.go |
| +++ b/internal/equipotest/runner_release_test.go |
| @@ -90,14 +90,14 @@ func runnerPackagingScenarios(t *testing.T, target string, scenarios []string) { |
| "git": "#!/bin/sh\ncase \"$1\" in diff) [ \"$SCENARIO\" != dirty ];; rev-parse) echo abc1234;; ls-files) if [ \"$SCENARIO\" = untracked ]; then echo unsafe.go; fi;; status) if [ \"$SCENARIO\" = dirty ]; then echo ' M tracked'; fi; if [ \"$SCENARIO\" = untracked ]; then echo '?? unsafe.go'; fi; if [ -e changed-during-build ]; then echo '?? changed-during-build'; fi;; clone) for a; do last=$a; done; mkdir -p \"$last\" && cp -R . \"$last\";; esac\n", |
| // Each build writes its own bytes, so every artifact has its own digest. |
| // go version -m reports the commit a binary says it was built from. |
| - "go": "#!/bin/sh\ncase \"$1\" in env) echo go1.26.11;; version) rev=abc1234; mod=false; if [ \"$SCENARIO\" = vcs_revision ]; then rev=def5678; fi; if [ \"$SCENARIO\" = vcs_modified ]; then mod=true; fi; if [ \"$SCENARIO\" != vcs_missing ]; then printf '%s: go1.26.11\\n\\tpath\\tfixture\\n\\tbuild\\tvcs.revision=%s\\n\\tbuild\\tvcs.modified=%s\\n' \"$3\" \"$rev\" \"$mod\"; fi;; test) [ \"$SCENARIO\" != copy ];; build) if [ \"$SCENARIO\" = changed_during_build ]; then touch changed-during-build; fi; if [ \"$GOOS/$GOARCH\" = linux/arm64 ]; then test -f internal/release/bundled/install-manifest.json || exit 97; test -f internal/release/bundled/renderer.tar.gz || exit 96; fi; printf '%s\\n' \"$GOOS/$GOARCH\" \"$@\" >> \"$CAPTURE\"; while [ $# -gt 0 ]; do if [ \"$1\" = -o ]; then shift; printf 'built %s for %s\\n' \"$1\" \"$GOOS/$GOARCH\" > \"$1\"; fi; shift; done;; esac\n", |
| + "go": "#!/bin/sh\ncase \"$1\" in env) echo go1.26.11;; version) rev=abc1234; mod=false; if [ \"$SCENARIO\" = vcs_revision ]; then rev=def5678; fi; if [ \"$SCENARIO\" = vcs_modified ]; then mod=true; fi; if [ \"$SCENARIO\" != vcs_missing ]; then printf '%s: go1.26.11\\n\\tpath\\tfixture\\n\\tbuild\\tvcs.revision=%s\\n\\tbuild\\tvcs.modified=%s\\n' \"$3\" \"$rev\" \"$mod\"; fi;; test) [ \"$SCENARIO\" != copy ];; build) if [ \"$SCENARIO\" = changed_during_build ]; then touch changed-during-build; fi; if [ \"$GOOS/$GOARCH\" = linux/arm64 ]; then test -f internal/release/bundled/install-manifest.json || exit 97; test ! -e internal/release/bundled/renderer.tar.gz || exit 96; fi; printf '%s\\n' \"$GOOS/$GOARCH\" \"$@\" >> \"$CAPTURE\"; while [ $# -gt 0 ]; do if [ \"$1\" = -o ]; then shift; printf 'built %s for %s\\n' \"$1\" \"$GOOS/$GOARCH\" > \"$1\"; fi; shift; done;; esac\n", |
| "codex": "#!/bin/sh\n[ \"$SCENARIO\" != codex ] && echo 'codex-cli 0.165.0'\n", |
| "bwrap": "#!/bin/sh\nif [ \"$SCENARIO\" = bwrap ]; then echo 'bubblewrap 0.10.0'; else echo 'bubblewrap 0.11.0'; fi\n", |
| "systemctl": "#!/bin/sh\nexit 98\n", |
| "carlos": "#!/bin/sh\nexit 99\n", |
| } |
| scripts["go"] = strings.Replace(scripts["go"], "version) rev=abc1234;", `version) case "$3" in */gitleaks) printf '\tmod\tgithub.com/zricethezav/gitleaks/v8\tv8.30.1\th1:fixture\n'; exit 0;; esac; rev=abc1234;`, 1) |
| - scripts["../scripts/build-renderer-tree.py"] = "import gzip, hashlib, io, sys, tarfile\nassert sys.argv[1] == 'internal/release/renderer.json' and sys.argv[2].endswith('-abc1234/renderer.tar.gz')\nm = b'dir usr\\n'\nwith gzip.open(sys.argv[2], 'wb') as g, tarfile.open(fileobj=g, mode='w|') as t:\n i = tarfile.TarInfo('MANIFEST'); i.size = len(m); t.addfile(i, io.BytesIO(m))\nprint(hashlib.sha256(m).hexdigest())\n" // a tree of one directory: the script itself is tested in internal/release |
| + scripts["../scripts/build-renderer-tree.py"] = "import gzip, hashlib, io, sys, tarfile\nassert sys.argv[1] == 'internal/release/renderer.json' and sys.argv[2].endswith('-abc1234/renderer.tar.gz')\nm = b'dir usr\\n'\nwith gzip.open(sys.argv[2], 'wb') as g, tarfile.open(fileobj=g, mode='w|') as t:\n i = tarfile.TarInfo('MANIFEST'); i.size = len(m); t.addfile(i, io.BytesIO(m))\nopen(sys.argv[2].rsplit('/', 1)[0] + '/SOURCES', 'w').write('sources\\n')\nprint(hashlib.sha256(m).hexdigest())\n" // a tree of one directory, and its SOURCES: the script itself is tested in internal/release |
| for name, script := range scripts { |
| executionMust(t, os.WriteFile(filepath.Join(bin, name), []byte(script), 0700)) |
| } |
| @@ -155,6 +155,12 @@ func runnerPackagingScenarios(t *testing.T, target string, scenarios []string) { |
| executionMust(t, err) |
| return fmt.Sprintf("%x", sha256.Sum256(b)) |
| } |
| + size := func(path string) int64 { |
| + t.Helper() |
| + info, err := os.Stat(path) |
| + executionMust(t, err) |
| + return info.Size() |
| + } |
| proxy := digest(filepath.Join(dir, "equipo-tool-proxy")) |
| // The tool proxy is built first, plainly; both runners are then |
| // linked with the digest of that build (Mac runners spec §3.1: |
| @@ -162,7 +168,10 @@ func runnerPackagingScenarios(t *testing.T, target string, scenarios []string) { |
| flags := "-s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=abc1234 -X amadan.net/oficina/equipo/internal/release.toolProxySHA256=" + proxy |
| for _, build := range []string{ |
| "linux/amd64\nbuild\n-trimpath\n-ldflags\n-s -w\n-o\nreleases/equipo-runner-linux-amd64-abc1234/equipo-tool-proxy\n./cmd/equipo-tool-proxy\n", |
| - "linux/amd64\nbuild\n-trimpath\n-ldflags\n" + flags + " -X amadan.net/oficina/equipo/internal/release.gitleaksSHA256=" + digest(filepath.Join(dir, "gitleaks")) + " -X amadan.net/oficina/equipo/internal/release.rendererSHA256=" + fmt.Sprintf("%x", sha256.Sum256([]byte("dir usr\n"))) + "\n-o\nreleases/equipo-runner-linux-amd64-abc1234/equipo-runner\n", |
| + "linux/amd64\nbuild\n-trimpath\n-ldflags\n" + flags + " -X amadan.net/oficina/equipo/internal/release.gitleaksSHA256=" + digest(filepath.Join(dir, "gitleaks")) + " -X amadan.net/oficina/equipo/internal/release.rendererSHA256=" + fmt.Sprintf("%x", sha256.Sum256([]byte("dir usr\n"))) + |
| + // The archive the runner fetches from the forge: its digest, |
| + // size and the tag its digest names. |
| + " -X amadan.net/oficina/equipo/internal/release.rendererArchiveSHA256=" + digest(filepath.Join(dir, "renderer.tar.gz")) + " -X amadan.net/oficina/equipo/internal/release.rendererArchiveSize=" + fmt.Sprint(size(filepath.Join(dir, "renderer.tar.gz"))) + " -X amadan.net/oficina/equipo/internal/release.rendererTag=renderer-" + digest(filepath.Join(dir, "renderer.tar.gz"))[:12] + "\n-o\nreleases/equipo-runner-linux-amd64-abc1234/equipo-runner\n", |
| "darwin/arm64\nbuild\n-trimpath\n-ldflags\n" + flags + " -X amadan.net/oficina/equipo/internal/release.gitleaksSHA256=" + digest(filepath.Join(dir, "darwin-arm64", "gitleaks")) + "\n-o\nreleases/equipo-runner-linux-amd64-abc1234/darwin-arm64/equipo-runner\n", |
| } { |
| if !strings.Contains(string(raw), build) { |
| @@ -194,7 +203,7 @@ func runnerPackagingScenarios(t *testing.T, target string, scenarios []string) { |
| var install release.InstallManifest |
| readJSON(filepath.Join(dir, "install-manifest.json"), &install) |
| runner, mac := digest(filepath.Join(dir, "equipo-runner")), digest(filepath.Join(dir, "darwin-arm64/equipo-runner")) |
| - if install.Validate("abc1234") != nil || !reflect.DeepEqual(install.Release, shipped) || install.RunnerSHA256 != runner || !reflect.DeepEqual(install.Targets, map[string]release.InstallTarget{release.TargetLinux: {RunnerSHA256: runner, ToolProxySHA256: proxy, GitleaksSHA256: digest(filepath.Join(dir, "gitleaks")), RendererSHA256: fmt.Sprintf("%x", sha256.Sum256([]byte("dir usr\n")))}, release.TargetDarwin: {RunnerSHA256: mac, GitleaksSHA256: digest(filepath.Join(dir, "darwin-arm64", "gitleaks"))}}) { |
| + if install.Validate("abc1234") != nil || !reflect.DeepEqual(install.Release, shipped) || install.RunnerSHA256 != runner || !reflect.DeepEqual(install.Targets, map[string]release.InstallTarget{release.TargetLinux: {RunnerSHA256: runner, ToolProxySHA256: proxy, GitleaksSHA256: digest(filepath.Join(dir, "gitleaks")), RendererSHA256: fmt.Sprintf("%x", sha256.Sum256([]byte("dir usr\n"))), RendererArchiveSHA256: digest(filepath.Join(dir, "renderer.tar.gz")), RendererArchiveSize: size(filepath.Join(dir, "renderer.tar.gz"))}, release.TargetDarwin: {RunnerSHA256: mac, GitleaksSHA256: digest(filepath.Join(dir, "darwin-arm64", "gitleaks"))}}) { |
| t.Fatalf("install manifest %+v", install) |
| } |
| if _, err := os.Stat(filepath.Join(dir, "evidence")); !os.IsNotExist(err) { |
| @@ -215,7 +224,8 @@ func runnerPackagingScenarios(t *testing.T, target string, scenarios []string) { |
| SHA256 map[string]string |
| } |
| readJSON(instance+".manifest.json", &made) |
| - if made.Version != "abc1234" || made.Commit != "abc1234" || made.Go != "go1.26.11" || !reflect.DeepEqual(made.Release, shipped) || !reflect.DeepEqual(made.SHA256, map[string]string{"instance": digest(instance), "runner": runner, "tool_proxy": proxy, "darwin_runner": mac, "gitleaks": digest(filepath.Join(dir, "gitleaks")), "darwin_gitleaks": digest(filepath.Join(dir, "darwin-arm64", "gitleaks"))}) { |
| + if made.Version != "abc1234" || made.Commit != "abc1234" || made.Go != "go1.26.11" || !reflect.DeepEqual(made.Release, shipped) || !reflect.DeepEqual(made.SHA256, map[string]string{"instance": digest(instance), "runner": runner, "tool_proxy": proxy, "darwin_runner": mac, "gitleaks": digest(filepath.Join(dir, "gitleaks")), "darwin_gitleaks": digest(filepath.Join(dir, "darwin-arm64", "gitleaks")), |
| + "renderer_archive": digest(filepath.Join(dir, "renderer.tar.gz")), "renderer_sources": digest(filepath.Join(dir, "SOURCES")), "install_manifest": digest(filepath.Join(dir, "install-manifest.json"))}) { |
| t.Fatalf("provenance manifest %+v", made) |
| } |
| if _, err := os.Stat(instance + ".evidence"); !os.IsNotExist(err) { |
diff --git a/internal/release/embedded_install_test.go b/internal/release/embedded_install_test.go| index 9d28b599..5a87ec38 100644 |
| --- a/internal/release/embedded_install_test.go |
| +++ b/internal/release/embedded_install_test.go |
| @@ -167,13 +167,7 @@ func TestBundledInstallAssets(t *testing.T) { |
| if !a.CachedAvailable() { |
| t.Fatal("bundled release unavailable") |
| } |
| - names := installAssetNames |
| - // The renderer the Linux runner installs beside itself (amd64). |
| - if m.Targets[TargetLinux].RendererSHA256 == "" { |
| - t.Fatal("the bundled release names no renderer") |
| - } |
| - names = append(names[:len(names):len(names)], RendererArchive) |
| - for _, name := range names { |
| + for _, name := range installAssetNames { |
| w := httptest.NewRecorder() |
| a.ServeHTTP(w, httptest.NewRequest("GET", "/releases/"+m.Version+"/"+name, nil)) |
| want, e := fs.ReadFile(files, name) |
| @@ -181,4 +175,31 @@ func TestBundledInstallAssets(t *testing.T) { |
| t.Fatal("bundled HTTP asset", name, w.Code, e) |
| } |
| } |
| + // The release names the renderer the Linux runner installs (its tree |
| + // pin, archive digest and size), but the instance neither carries nor |
| + // serves it: the runner fetches it from the forge. |
| + if linux := m.Targets[TargetLinux]; linux.RendererSHA256 == "" || linux.RendererArchiveSHA256 == "" || linux.RendererArchiveSize <= 0 { |
| + t.Fatal("the bundled release names no renderer") |
| + } |
| + if _, err := fs.Stat(files, RendererArchive); err == nil { |
| + t.Fatal("the renderer is bundled into the instance") |
| + } |
| + w := httptest.NewRecorder() |
| + a.ServeHTTP(w, httptest.NewRequest("GET", "/releases/"+m.Version+"/"+RendererArchive, nil)) |
| + if w.Code != 404 { |
| + t.Fatalf("the instance serves the renderer: %d", w.Code) |
| + } |
| + // And everything bundled stays well under the platform's ship cap. |
| + var total int64 |
| + fs.WalkDir(files, ".", func(_ string, d fs.DirEntry, err error) error { |
| + if err == nil && !d.IsDir() { |
| + if info, err := d.Info(); err == nil { |
| + total += info.Size() |
| + } |
| + } |
| + return nil |
| + }) |
| + if total > 160<<20 { |
| + t.Fatalf("the bundle is %d bytes, over 160 MiB", total) |
| + } |
| } |
diff --git a/internal/release/install.go b/internal/release/install.go| index eeb72bc4..fa5c0c50 100644 |
| --- a/internal/release/install.go |
| +++ b/internal/release/install.go |
| @@ -27,13 +27,19 @@ type InstallManifest struct { |
| } |
| // InstallTarget is one platform's runner and tool proxy digests, and on |
| -// Linux the renderer tree's: the SHA-256 of renderer.tar.gz's MANIFEST, |
| -// the pin linked into that runner (rendererSHA256). |
| +// Linux the renderer's: the SHA-256 of renderer.tar.gz's MANIFEST, the |
| +// pin linked into that runner (rendererSHA256), and the archive's own |
| +// SHA-256 and size (rendererArchiveSHA256, rendererArchiveSize). The |
| +// archive is published on the forge, not served by the instance; these |
| +// say which one, and the runner refuses a manifest that disagrees with |
| +// what is linked into it. |
| type InstallTarget struct { |
| - GitleaksSHA256 string `json:"gitleaks_sha256,omitempty"` |
| - RendererSHA256 string `json:"renderer_sha256,omitempty"` |
| - RunnerSHA256 string `json:"runner_sha256"` |
| - ToolProxySHA256 string `json:"tool_proxy_sha256,omitempty"` |
| + GitleaksSHA256 string `json:"gitleaks_sha256,omitempty"` |
| + RendererSHA256 string `json:"renderer_sha256,omitempty"` |
| + RendererArchiveSHA256 string `json:"renderer_archive_sha256,omitempty"` |
| + RendererArchiveSize int64 `json:"renderer_archive_size,omitempty"` |
| + RunnerSHA256 string `json:"runner_sha256"` |
| + ToolProxySHA256 string `json:"tool_proxy_sha256,omitempty"` |
| } |
| // The Mac worker's target and where its files are served, under |
| @@ -102,6 +108,12 @@ func (m InstallManifest) Validate(version string) error { |
| if !ValidInstallVersion(version) || m.Version != version || m.Target != TargetLinux || !sha256Hex(m.RunnerSHA256) || linux.RunnerSHA256 != m.RunnerSHA256 || linux.ToolProxySHA256 != m.Release.ToolProxySHA256() || !m.Release.Installable() || !reflect.DeepEqual(m.NamespaceArgs, provider.NamespaceArguments()) { |
| return errManifest |
| } |
| + // A renderer pin comes with its archive's digest and size, and an |
| + // archive with a pin. |
| + archive := linux.RendererArchiveSHA256 != "" || linux.RendererArchiveSize != 0 |
| + if archive != (linux.RendererSHA256 != "") || archive && (!sha256Hex(linux.RendererSHA256) || !sha256Hex(linux.RendererArchiveSHA256) || linux.RendererArchiveSize <= 0 || linux.RendererArchiveSize > RendererArchiveMax) { |
| + return errManifest |
| + } |
| return nil |
| } |
diff --git a/internal/release/install_assets.go b/internal/release/install_assets.go| index 35ae39f7..3edaa32b 100644 |
| --- a/internal/release/install_assets.go |
| +++ b/internal/release/install_assets.go |
| @@ -78,8 +78,6 @@ func (a *InstallAssets) open(name string) (installFile, error) { |
| switch name { |
| case "install-manifest.json", "install-v1.sh": |
| limit = 1 << 20 |
| - case RendererArchive: |
| - limit = RendererArchiveMax |
| } |
| if e != nil || !i.Mode().IsRegular() || i.Size() > limit { |
| f.Close() |
| @@ -182,24 +180,9 @@ func (a *InstallAssets) Available() bool { |
| return false |
| } |
| } |
| - // The renderer the Linux runner installs beside itself: its MANIFEST, |
| - // the archive's first member, is the pin the release recorded (and |
| - // linked into the runner, which checks the whole tree against it). |
| - if want := m.Targets[TargetLinux].RendererSHA256; want != "" { |
| - f, err := a.open(RendererArchive) |
| - if err != nil { |
| - return false |
| - } |
| - files[RendererArchive] = f |
| - got, err := RendererArchivePin(f) |
| - if err != nil || got != want { |
| - return false |
| - } |
| - infos[RendererArchive], err = f.Stat() |
| - if err != nil { |
| - return false |
| - } |
| - } |
| + // The page renderer is not served here: the Linux runner fetches it |
| + // from the forge (RendererForge), checked against what is linked into |
| + // it. An instance carrying it would pass the platform's ship cap. |
| // The Mac worker: listed, present and matching, or not served at all. |
| if t, e := m.DarwinTarget(a.Version); e == nil { |
| mac := map[string]installFile{} |
| @@ -245,7 +228,7 @@ func (a *InstallAssets) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| prefix := "/releases/" + a.Version + "/" |
| name := strings.TrimPrefix(r.URL.Path, prefix) |
| mac := slices.Contains(darwinAssetNames, name) |
| - if !strings.HasPrefix(r.URL.Path, prefix) || (r.Method != "GET" && r.Method != "HEAD") || (name != "install-v1.sh" && name != "install-manifest.json" && name != "equipo-runner" && name != "equipo-tool-proxy" && name != "gitleaks" && name != RendererArchive && !mac) { |
| + if !strings.HasPrefix(r.URL.Path, prefix) || (r.Method != "GET" && r.Method != "HEAD") || (name != "install-v1.sh" && name != "install-manifest.json" && name != "equipo-runner" && name != "equipo-tool-proxy" && name != "gitleaks" && !mac) { |
| w.WriteHeader(http.StatusNotFound) |
| return |
| } |
diff --git a/internal/release/install_test.go b/internal/release/install_test.go| index 15266da2..d44aec66 100644 |
| --- a/internal/release/install_test.go |
| +++ b/internal/release/install_test.go |
| @@ -60,6 +60,11 @@ func TestOnboardingInstallPackaging(t *testing.T) { |
| if manifest.Targets[TargetLinux].RendererSHA256 != renderer { |
| t.Fatal("renderer pin missing from release", manifest) |
| } |
| + // And the archive by its own digest and size: what the runner fetches |
| + // from the forge. |
| + if tarball, err := os.ReadFile(filepath.Join(root, "renderer.tar.gz")); err != nil || manifest.Targets[TargetLinux].RendererArchiveSHA256 != fmt.Sprintf("%x", sha256.Sum256(tarball)) || manifest.Targets[TargetLinux].RendererArchiveSize != int64(len(tarball)) { |
| + t.Fatal("renderer archive missing from release", manifest.Targets[TargetLinux], err) |
| + } |
| if manifest.RunnerSHA256 != fmt.Sprintf("%x", sha256.Sum256(binary)) { |
| t.Fatal("checksum mismatch") |
| } |
diff --git a/internal/release/renderer.go b/internal/release/renderer.go| index 8aa73f09..3a2ee7d6 100644 |
| --- a/internal/release/renderer.go |
| +++ b/internal/release/renderer.go |
| @@ -1,6 +1,11 @@ |
| package release |
| -import "amadan.net/oficina/equipo/internal/wire" |
| +import ( |
| + "regexp" |
| + "strconv" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| // Linked from the release's renderer tree (Makefile, release-runner): |
| // the SHA-256 of its MANIFEST, as scripts/build-renderer-tree.py printed |
| @@ -17,3 +22,46 @@ func RendererPin() (pin, health string) { |
| } |
| return rendererSHA256, "" |
| } |
| + |
| +// Linked from the same kit file as rendererSHA256 (Makefile, |
| +// release-runner): the archive's own SHA-256 and size, and the forge |
| +// release tag it is published under (renderer-<first 12 of that digest>, |
| +// or renderer-<12>-r<n> after a withdrawal). Only the Linux runner has |
| +// them. |
| +var rendererArchiveSHA256, rendererArchiveSize, rendererTag string |
| + |
| +// RendererForge is where every published renderer archive is, by tag: |
| +// <RendererForge><tag>/renderer.tar.gz. A constant of the runner, never |
| +// data: nothing an instance or a manifest says can point it elsewhere. |
| +const RendererForge = "https://amadan.net/oficina/equipo/-/releases/" |
| + |
| +// RendererAsset is the published archive a runner fetches when it has no |
| +// verified tree: the tree pin it unpacks to, the archive's digest and size, |
| +// and its forge tag. |
| +type RendererAsset struct { |
| + Pin, SHA256 string |
| + Size int64 |
| + Tag string |
| +} |
| + |
| +// URL is the archive's address on the forge. |
| +func (a RendererAsset) URL() string { return RendererForge + a.Tag + "/" + RendererArchive } |
| + |
| +// rendererTagPattern is renderer-<12 hex>, with an optional -r<n>. |
| +var rendererTagPattern = regexp.MustCompile(`^renderer-([0-9a-f]{12})(-r[1-9][0-9]{0,2})?$`) |
| + |
| +// Valid: a tree pin, an archive digest, a size within RendererArchiveMax |
| +// and a tag naming that digest. |
| +func (a RendererAsset) Valid() bool { |
| + m := rendererTagPattern.FindStringSubmatch(a.Tag) |
| + return sha256Hex(a.Pin) && sha256Hex(a.SHA256) && a.Size > 0 && a.Size <= RendererArchiveMax && m != nil && m[1] == a.SHA256[:12] |
| +} |
| + |
| +// LinkedRendererAsset is the asset linked into this build, and whether it |
| +// is whole and valid (only a Linux release runner has one). |
| +func LinkedRendererAsset() (RendererAsset, bool) { |
| + pin, _ := RendererPin() |
| + size, err := strconv.ParseInt(rendererArchiveSize, 10, 64) |
| + a := RendererAsset{Pin: pin, SHA256: rendererArchiveSHA256, Size: size, Tag: rendererTag} |
| + return a, err == nil && a.Valid() |
| +} |
diff --git a/internal/release/renderer_assets_test.go b/internal/release/renderer_assets_test.go| index a7c76217..cbc4bb49 100644 |
| --- a/internal/release/renderer_assets_test.go |
| +++ b/internal/release/renderer_assets_test.go |
| @@ -7,14 +7,16 @@ import ( |
| "net/http/httptest" |
| "os" |
| "path/filepath" |
| + "strings" |
| "testing" |
| "amadan.net/oficina/equipo/internal/release/renderertest" |
| "amadan.net/oficina/equipo/internal/runner/provider" |
| ) |
| -// rendererAssets is a release directory as the instance serves one, its |
| -// Linux target naming the renderer archive beside the runner. |
| +// rendererAssets is a release directory as the instance serves one: its |
| +// Linux target names the renderer (pin, archive digest and size), and a |
| +// renderer.tar.gz lies beside the runner, as in a release kit. |
| func rendererAssets(t *testing.T) (*InstallAssets, string, []byte) { |
| t.Helper() |
| root := t.TempDir() |
| @@ -33,7 +35,7 @@ func rendererAssets(t *testing.T) (*InstallAssets, string, []byte) { |
| sum := func(b []byte) string { return fmt.Sprintf("%x", sha256.Sum256(b)) } |
| manifest := InstallManifest{Version: "fixture-16", Target: TargetLinux, RunnerSHA256: sum(runner), NamespaceArgs: provider.NamespaceArguments(), Release: m, |
| Targets: map[string]InstallTarget{ |
| - TargetLinux: {RunnerSHA256: sum(runner), ToolProxySHA256: sum(proxy), GitleaksSHA256: sum(scanner), RendererSHA256: pin}, |
| + TargetLinux: {RunnerSHA256: sum(runner), ToolProxySHA256: sum(proxy), GitleaksSHA256: sum(scanner), RendererSHA256: pin, RendererArchiveSHA256: sum(archive), RendererArchiveSize: int64(len(archive))}, |
| TargetDarwin: {RunnerSHA256: sum([]byte("mac runner"))}, |
| }} |
| raw, err := json.Marshal(manifest) |
| @@ -56,77 +58,106 @@ func getAsset(a *InstallAssets, name string) (int, string) { |
| return w.Code, w.Body.String() |
| } |
| -// The instance serves renderer.tar.gz with the Linux runner when its |
| -// MANIFEST is the pin the release recorded; a Mac worker has none. |
| -func TestInstallAssetsServeTheRendererOnLinux(t *testing.T) { |
| - a, _, archive := rendererAssets(t) |
| - if code, body := getAsset(a, RendererArchive); code != 200 || body != string(archive) { |
| - t.Fatalf("renderer archive %d", code) |
| - } |
| - if code, _ := getAsset(a, "darwin-arm64/equipo-runner"); code != 200 { |
| - t.Fatalf("mac runner %d", code) |
| +// The instance never serves the renderer, even with one beside the |
| +// runner: the runner fetches it from the forge. The rest of the release |
| +// is served as before. |
| +func TestInstallAssetsNeverServeTheRenderer(t *testing.T) { |
| + a, _, _ := rendererAssets(t) |
| + for _, name := range []string{RendererArchive, "darwin-arm64/" + RendererArchive} { |
| + if code, _ := getAsset(a, name); code != 404 { |
| + t.Fatalf("%s served: %d", name, code) |
| + } |
| } |
| - if code, _ := getAsset(a, "darwin-arm64/"+RendererArchive); code != 404 { |
| - t.Fatalf("a Mac renderer served: %d", code) |
| + for _, name := range []string{"equipo-runner", "install-manifest.json", "darwin-arm64/equipo-runner"} { |
| + if code, _ := getAsset(a, name); code != 200 { |
| + t.Fatalf("%s: %d", name, code) |
| + } |
| } |
| } |
| -// A renderer archive that is missing, or whose MANIFEST is not the pin |
| -// the release recorded, makes the release unavailable, as a changed |
| -// runner does. |
| -func TestInstallAssetsRefuseAnotherRenderer(t *testing.T) { |
| +// The release is available without a renderer archive and whatever one |
| +// lies there: nothing of the instance reads it. |
| +func TestInstallAssetsNeedNoRenderer(t *testing.T) { |
| for name, change := range map[string]func(root string) error{ |
| "missing": func(root string) error { return os.Remove(filepath.Join(root, RendererArchive)) }, |
| - "another tree": func(root string) error { |
| - other, _ := renderertest.Archive(renderertest.Small()[:4]) |
| - return os.WriteFile(filepath.Join(root, RendererArchive), other, 0o600) |
| - }, |
| "not an archive": func(root string) error { |
| return os.WriteFile(filepath.Join(root, RendererArchive), []byte("not gzip"), 0o600) |
| }, |
| } { |
| t.Run(name, func(t *testing.T) { |
| a, root, _ := rendererAssets(t) |
| - if !a.Available() { |
| - t.Fatal("the fixture release is unavailable") |
| - } |
| if err := change(root); err != nil { |
| t.Fatal(err) |
| } |
| - if a.Available() { |
| - t.Fatal("available with", name) |
| - } |
| - if code, _ := getAsset(a, RendererArchive); code != 503 { |
| - t.Fatalf("served with %s: %d", name, code) |
| + if !a.Available() { |
| + t.Fatal("unavailable with the renderer", name) |
| } |
| }) |
| } |
| } |
| -// The asset reader allows renderer.tar.gz up to 384 MiB and every other |
| -// file the usual 128 MiB. |
| -func TestInstallAssetsBoundTheRendererAt384MiB(t *testing.T) { |
| +// A Linux target's renderer pin comes with its archive's digest and size, |
| +// and they with it; the size is bounded by RendererArchiveMax. |
| +func TestInstallManifestRendererArchive(t *testing.T) { |
| a, root, _ := rendererAssets(t) |
| - for _, c := range []struct { |
| - name string |
| - size int64 |
| - ok bool |
| - }{ |
| - {RendererArchive, 384 << 20, true}, |
| - {RendererArchive, 384<<20 + 1, false}, |
| - {"equipo-runner", 128 << 20, true}, |
| - {"equipo-runner", 128<<20 + 1, false}, |
| - {"gitleaks", 200 << 20, false}, |
| + raw, err := os.ReadFile(filepath.Join(root, "install-manifest.json")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var good InstallManifest |
| + if err = json.Unmarshal(raw, &good); err != nil || good.Validate(a.Version) != nil { |
| + t.Fatalf("fixture manifest: %v", err) |
| + } |
| + for name, edit := range map[string]func(*InstallTarget){ |
| + "no renderer at all": func(l *InstallTarget) { l.RendererSHA256, l.RendererArchiveSHA256, l.RendererArchiveSize = "", "", 0 }, |
| + "pin only": func(l *InstallTarget) { l.RendererArchiveSHA256, l.RendererArchiveSize = "", 0 }, |
| + "archive only": func(l *InstallTarget) { l.RendererSHA256 = "" }, |
| + "no size": func(l *InstallTarget) { l.RendererArchiveSize = 0 }, |
| + "over the bound": func(l *InstallTarget) { l.RendererArchiveSize = RendererArchiveMax + 1 }, |
| + "at the bound": func(l *InstallTarget) { l.RendererArchiveSize = RendererArchiveMax }, |
| + "a bad digest": func(l *InstallTarget) { l.RendererArchiveSHA256 = "ABC" }, |
| } { |
| - if err := os.Truncate(filepath.Join(root, c.name), c.size); err != nil { |
| - t.Fatal(err) |
| - } |
| - f, err := a.open(c.name) |
| - if (err == nil) != c.ok { |
| - t.Fatalf("%s at %d bytes: %v", c.name, c.size, err) |
| + var m InstallManifest |
| + json.Unmarshal(raw, &m) |
| + linux := m.Targets[TargetLinux] |
| + edit(&linux) |
| + m.Targets[TargetLinux] = linux |
| + ok := name == "no renderer at all" || name == "at the bound" |
| + if (m.Validate(a.Version) == nil) != ok { |
| + t.Errorf("%s: valid %v", name, !ok) |
| } |
| - if f != nil { |
| - f.Close() |
| + } |
| +} |
| + |
| +// The asset linked into a runner is whole: a tree pin, an archive digest, |
| +// a size within the bound and a tag naming that digest; its address is on |
| +// the forge, built from the tag alone. |
| +func TestRendererAsset(t *testing.T) { |
| + sum := strings.Repeat("ab", 32) |
| + good := RendererAsset{Pin: strings.Repeat("cd", 32), SHA256: sum, Size: 230650088, Tag: "renderer-" + sum[:12]} |
| + if !good.Valid() || good.URL() != "https://amadan.net/oficina/equipo/-/releases/renderer-abababababab/renderer.tar.gz" { |
| + t.Fatalf("%+v %s", good.Valid(), good.URL()) |
| + } |
| + republished := good |
| + republished.Tag += "-r2" |
| + if !republished.Valid() { |
| + t.Fatal("a republished tag refused") |
| + } |
| + for name, edit := range map[string]func(*RendererAsset){ |
| + "another digest's tag": func(a *RendererAsset) { a.Tag = "renderer-" + strings.Repeat("0", 12) }, |
| + "a tag with a path": func(a *RendererAsset) { a.Tag += "/../x" }, |
| + "revision zero": func(a *RendererAsset) { a.Tag += "-r0" }, |
| + "no pin": func(a *RendererAsset) { a.Pin = "" }, |
| + "no size": func(a *RendererAsset) { a.Size = 0 }, |
| + "over the bound": func(a *RendererAsset) { a.Size = RendererArchiveMax + 1 }, |
| + } { |
| + a := good |
| + edit(&a) |
| + if a.Valid() { |
| + t.Errorf("%s: valid", name) |
| } |
| } |
| + if _, ok := LinkedRendererAsset(); ok { |
| + t.Fatal("a test build has a renderer asset linked") |
| + } |
| } |
diff --git a/internal/release/renderer_install.go b/internal/release/renderer_install.go| index 5ed9d48c..5e67242c 100644 |
| --- a/internal/release/renderer_install.go |
| +++ b/internal/release/renderer_install.go |
| @@ -74,6 +74,26 @@ var oldTree = regexp.MustCompile(`^[0-9a-f]{12}$`) |
| // for an archive or tree that is not the pinned one) or the error of the |
| // disk. |
| func InstallRenderer(runnerDir string, archive io.Reader, pin string) (string, error) { |
| + return installTree(runnerDir, pin, func(tmp string) error { return unpackRenderer(tmp, archive, pin) }) |
| +} |
| + |
| +// CopyRenderer installs, as InstallRenderer does, a copy of the tree at |
| +// from, which must verify for pin first: an earlier release's tree, so a |
| +// new release beside it needs nothing fetched. Files are copied, never |
| +// linked (VerifyRenderer refuses a file with more than one link), and the |
| +// copy is verified whole before it is renamed into place. |
| +func CopyRenderer(runnerDir, from, pin string) (string, error) { |
| + if err := VerifyRenderer(from, pin); err != nil { |
| + return "", err |
| + } |
| + return installTree(runnerDir, pin, func(tmp string) error { return copyTree(tmp, from) }) |
| +} |
| + |
| +// installTree is InstallRenderer's and CopyRenderer's shared part: fill |
| +// writes a candidate tree into a new directory beside the tree's place, |
| +// which is verified and renamed into place; a tree there that already |
| +// verifies is kept and fill never runs. Then every other tree is removed. |
| +func installTree(runnerDir, pin string, fill func(tmp string) error) (string, error) { |
| if !sha256Hex(pin) { |
| return "", &RendererError{Health: wire.ToolUnpinned, Reason: "no renderer pin is linked into this runner"} |
| } |
| @@ -98,7 +118,7 @@ func InstallRenderer(runnerDir string, archive io.Reader, pin string) (string, e |
| os.RemoveAll(tmp) |
| } |
| }() |
| - if err = unpackRenderer(tmp, archive, pin); err != nil { |
| + if err = fill(tmp); err != nil { |
| return "", err |
| } |
| if err = os.Chmod(tmp, 0o755); err != nil { |
| @@ -122,6 +142,72 @@ func InstallRenderer(runnerDir string, archive io.Reader, pin string) (string, e |
| return final, nil |
| } |
| +// copyTree copies the tree at from into the empty directory dir: |
| +// directories, regular files (their bytes, in new files) and symbolic |
| +// links, each with its mode; anything else, or more entries or bytes than |
| +// a tree may hold, is refused. VerifyRenderer then checks the copy. |
| +func copyTree(dir, from string) error { |
| + root, err := os.OpenRoot(dir) |
| + if err != nil { |
| + return err |
| + } |
| + defer root.Close() |
| + src, err := os.OpenRoot(from) |
| + if err != nil { |
| + return err |
| + } |
| + defer src.Close() |
| + var total, count int64 |
| + return fs.WalkDir(src.FS(), ".", func(name string, d fs.DirEntry, err error) error { |
| + if err != nil || name == "." { |
| + return err |
| + } |
| + if count++; count > rendererEntriesMax { |
| + return rendererMismatch("", "more than %d entries", rendererEntriesMax) |
| + } |
| + info, err := src.Lstat(name) |
| + if err != nil { |
| + return err |
| + } |
| + mode := info.Mode() |
| + switch { |
| + case mode.IsDir(): |
| + if err = root.Mkdir(name, 0o700); err != nil { |
| + return err |
| + } |
| + return root.Chmod(name, mode.Perm()) |
| + case mode.IsRegular(): |
| + if total += info.Size(); total > rendererUnpackedMax { |
| + return rendererMismatch(name, "more bytes than any renderer tree holds") |
| + } |
| + in, err := src.Open(name) |
| + if err != nil { |
| + return err |
| + } |
| + defer in.Close() |
| + out, err := root.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o600) |
| + if err != nil { |
| + return err |
| + } |
| + defer out.Close() |
| + if n, err := io.Copy(out, in); err != nil || n != info.Size() { |
| + return rendererMismatch(name, "copied %d of %d bytes: %v", n, info.Size(), err) |
| + } |
| + if err = out.Chmod(mode.Perm()); err != nil { |
| + return err |
| + } |
| + return out.Close() |
| + case mode&fs.ModeSymlink != 0: |
| + target, err := src.Readlink(name) |
| + if err != nil { |
| + return err |
| + } |
| + return root.Symlink(target, name) |
| + } |
| + return rendererMismatch(name, "is not a directory, file or link") |
| + }) |
| +} |
| + |
| // rendererParent makes <runner dir>/renderer/ (0755, whatever the umask) |
| // unless it exists, and checks it is a directory, not a link, owned by |
| // this user or root, that nobody else can write. |
diff --git a/internal/release/renderer_publish_test.go b/internal/release/renderer_publish_test.go| new file mode 100644 |
| index 00000000..95e215a3 |
| --- /dev/null |
| +++ b/internal/release/renderer_publish_test.go |
| @@ -0,0 +1,169 @@ |
| +package release |
| + |
| +import ( |
| + "crypto/sha256" |
| + "encoding/hex" |
| + "os" |
| + "os/exec" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/testci" |
| +) |
| + |
| +// publishRig is a release kit, the repository it was built from (with a |
| +// bare origin), and stub curl, amadan and go: the forge is a directory of |
| +// published assets by tag, amadan release create copies into it and logs, |
| +// and go version -m reports the tag linked into the kit's runner. |
| +type publishRig struct { |
| + t *testing.T |
| + repo, kit, forge, log, commit string |
| + archive, sources, tag, pinJSON string |
| + origin string |
| + env []string |
| +} |
| + |
| +func newPublishRig(t *testing.T) *publishRig { |
| + t.Helper() |
| + testci.Files(t, "../../scripts/publish-renderer.sh", "../../scripts/renderer-sources.py") |
| + testci.Tools(t, "git", "python3", "sh") |
| + r := &publishRig{t: t, repo: t.TempDir(), kit: t.TempDir(), forge: t.TempDir(), log: filepath.Join(t.TempDir(), "log")} |
| + run := func(dir string, args ...string) string { |
| + t.Helper() |
| + cmd := exec.Command(args[0], args[1:]...) |
| + cmd.Dir = dir |
| + cmd.Env = append(os.Environ(), "GIT_AUTHOR_NAME=t", "GIT_AUTHOR_EMAIL=t@example.com", "GIT_COMMITTER_NAME=t", "GIT_COMMITTER_EMAIL=t@example.com", "GIT_CONFIG_GLOBAL=/dev/null") |
| + out, err := cmd.CombinedOutput() |
| + if err != nil { |
| + t.Fatalf("%v: %v\n%s", args, err, out) |
| + } |
| + return strings.TrimSpace(string(out)) |
| + } |
| + origin := t.TempDir() |
| + run(origin, "git", "init", "-q", "--bare") |
| + run(r.repo, "git", "init", "-q", "-b", "main") |
| + r.pinJSON = `{"version":"1.0-1","amd64":[{"package":"chromium-headless-shell","version":"1.0-1","architecture":"amd64","url":"https://snapshot.debian.org/archive/debian/20990101T000000Z/pool/main/c/chromium/chromium-headless-shell_1.0-1_amd64.deb","sha256":"` + strings.Repeat("a", 64) + `","size":1}]}` |
| + os.MkdirAll(filepath.Join(r.repo, "internal", "release"), 0o755) |
| + os.WriteFile(filepath.Join(r.repo, "internal", "release", "renderer.json"), []byte(r.pinJSON), 0o644) |
| + run(r.repo, "git", "add", "-A") |
| + run(r.repo, "git", "commit", "-q", "-m", "pin") |
| + run(r.repo, "git", "remote", "add", "origin", origin) |
| + r.commit = run(r.repo, "git", "rev-parse", "HEAD") |
| + // A later commit: the kit is not the current checkout. |
| + run(r.repo, "git", "commit", "-q", "--allow-empty", "-m", "later") |
| + |
| + r.archive = "renderer archive bytes" |
| + r.sources = "The page renderer: Chromium headless shell 1.0-1, from Debian.\nChromium source: https://snapshot.debian.org/package/chromium/1.0-1/\n\n" + |
| + "chromium-headless-shell 1.0-1 amd64 https://snapshot.debian.org/archive/debian/20990101T000000Z/pool/main/c/chromium/chromium-headless-shell_1.0-1_amd64.deb https://snapshot.debian.org/package/chromium/1.0-1/\n" |
| + sum := sha256.Sum256([]byte(r.archive)) |
| + r.tag = "renderer-" + hex.EncodeToString(sum[:])[:12] |
| + for name, body := range map[string]string{"renderer.tar.gz": r.archive, "SOURCES": r.sources, "equipo-runner": "runner", "COMMIT": r.commit + "\n"} { |
| + os.WriteFile(filepath.Join(r.kit, name), []byte(body), 0o644) |
| + } |
| + bin := t.TempDir() |
| + stub := func(name, body string) { os.WriteFile(filepath.Join(bin, name), []byte("#!/bin/sh\n"+body), 0o755) } |
| + // curl: the last argument is the URL; --output names where to write; |
| + // prints the status as --write-out asks. |
| + stub("curl", `out=; for a; do [ "$prev" = --output ] && out=$a; prev=$a; url=$a; done |
| +echo "curl $url" >> `+r.log+` |
| +path=`+r.forge+`/${url#https://amadan.net/oficina/equipo/-/releases/} |
| +if [ -f "$path" ]; then cp "$path" "$out"; printf 200; else : > "$out"; printf 404; fi |
| +`) |
| + // amadan release create -repo R -notes-file N TAG FILE... |
| + stub("amadan", `echo "amadan $*" >> `+r.log+` |
| +tag=$7; shift 7; mkdir -p `+r.forge+`/$tag; for f; do cp "$f" `+r.forge+`/$tag/; done |
| +`) |
| + stub("go", `printf '%s: go1.26.11\n\tbuild\t-ldflags="-s -w -X amadan.net/oficina/equipo/internal/release.rendererTag=%s"\n' "$3" "${FIXTURE_TAG-`+r.tag+`}" |
| +`) |
| + r.env = append(os.Environ(), "PATH="+bin+string(os.PathListSeparator)+os.Getenv("PATH"), "GIT_CONFIG_GLOBAL=/dev/null", "GIT_AUTHOR_NAME=t", "GIT_AUTHOR_EMAIL=t@example.com", "GIT_COMMITTER_NAME=t", "GIT_COMMITTER_EMAIL=t@example.com") |
| + r.origin = origin |
| + return r |
| +} |
| + |
| +func (r *publishRig) run(args ...string) (string, error) { |
| + script, _ := filepath.Abs("../../scripts/publish-renderer.sh") |
| + cmd := exec.Command("bash", append([]string{script}, args...)...) |
| + cmd.Dir = r.repo |
| + cmd.Env = r.env |
| + out, err := cmd.CombinedOutput() |
| + return string(out), err |
| +} |
| + |
| +func (r *publishRig) logged() string { b, _ := os.ReadFile(r.log); return string(b) } |
| + |
| +// publish puts the kit's archive and SOURCES on the forge under the tag |
| +// linked into its runner, tagging the kit's commit (not the checkout), |
| +// then downloads both in full and compares them. A second publish only |
| +// checks; check mode downloads into a directory. |
| +func TestPublishRenderer(t *testing.T) { |
| + r := newPublishRig(t) |
| + if out, err := r.run("publish", r.kit); err != nil { |
| + t.Fatalf("publish: %v\n%s", err, out) |
| + } |
| + if !strings.Contains(r.logged(), "amadan release create -repo oficina/equipo -notes-file ") || !strings.Contains(r.logged(), r.tag+" "+filepath.Join(r.kit, "renderer.tar.gz")+" "+filepath.Join(r.kit, "SOURCES")) { |
| + t.Fatalf("no release created:\n%s", r.logged()) |
| + } |
| + out, err := exec.Command("git", "--git-dir", r.origin, "rev-parse", r.tag+"^{commit}").Output() |
| + if err != nil || strings.TrimSpace(string(out)) != r.commit { |
| + t.Fatalf("the forge's tag names %q, not the kit's commit %s: %v", out, r.commit, err) |
| + } |
| + for _, name := range []string{"renderer.tar.gz", "SOURCES"} { |
| + if b, _ := os.ReadFile(filepath.Join(r.forge, r.tag, name)); string(b) == "" { |
| + t.Fatalf("%s not published", name) |
| + } |
| + } |
| + os.Remove(r.log) |
| + if out, err := r.run("publish", r.kit); err != nil || strings.Contains(r.logged(), "amadan release") { |
| + t.Fatalf("second publish: %v\n%s\n%s", err, out, r.logged()) |
| + } |
| + dir := filepath.Join(t.TempDir(), "downloaded") |
| + if out, err := r.run("check", r.kit, dir); err != nil { |
| + t.Fatalf("check: %v\n%s", err, out) |
| + } |
| + if b, _ := os.ReadFile(filepath.Join(dir, "renderer.tar.gz")); string(b) != r.archive { |
| + t.Fatalf("check downloaded %q", b) |
| + } |
| + if strings.Contains(r.logged(), "-I") || strings.Contains(r.logged(), "--head") || strings.Contains(r.logged(), "--range") { |
| + t.Fatalf("a HEAD or ranged request:\n%s", r.logged()) |
| + } |
| +} |
| + |
| +// A published asset that differs from the kit, a tag that is not the |
| +// archive's, SOURCES that are not the pinned packages', and check with |
| +// nothing published: refused, and nothing is created. |
| +func TestPublishRendererRefuses(t *testing.T) { |
| + for name, c := range map[string]struct { |
| + set func(r *publishRig) []string |
| + args func(r *publishRig) []string |
| + }{ |
| + "a different published archive": {func(r *publishRig) []string { |
| + os.MkdirAll(filepath.Join(r.forge, r.tag), 0o755) |
| + os.WriteFile(filepath.Join(r.forge, r.tag, "renderer.tar.gz"), []byte("other bytes"), 0o644) |
| + os.WriteFile(filepath.Join(r.forge, r.tag, "SOURCES"), []byte(r.sources), 0o644) |
| + return nil |
| + }, nil}, |
| + "a tag naming another archive": {func(r *publishRig) []string { return []string{"FIXTURE_TAG=renderer-000000000000"} }, nil}, |
| + "no linked tag": {func(r *publishRig) []string { return []string{"FIXTURE_TAG="} }, nil}, |
| + "SOURCES not the pin's": {func(r *publishRig) []string { |
| + os.WriteFile(filepath.Join(r.kit, "SOURCES"), []byte(strings.Replace(r.sources, "1.0-1 amd64", "9.9-9 amd64", 1)), 0o644) |
| + return nil |
| + }, nil}, |
| + "check with nothing published": {func(r *publishRig) []string { return nil }, func(r *publishRig) []string { return []string{"check", r.kit, t.TempDir()} }}, |
| + } { |
| + t.Run(name, func(t *testing.T) { |
| + r := newPublishRig(t) |
| + r.env = append(r.env, c.set(r)...) |
| + args := []string{"publish", r.kit} |
| + if c.args != nil { |
| + args = c.args(r) |
| + } |
| + if out, err := r.run(args...); err == nil { |
| + t.Fatalf("passed:\n%s", out) |
| + } |
| + if strings.Contains(r.logged(), "amadan release create") { |
| + t.Fatalf("created a release:\n%s", r.logged()) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/release/renderer_tree_test.go b/internal/release/renderer_tree_test.go| index b05db76d..b5babc7a 100644 |
| --- a/internal/release/renderer_tree_test.go |
| +++ b/internal/release/renderer_tree_test.go |
| @@ -32,7 +32,7 @@ type debMember struct { |
| // fixtureDeb is a small Debian package as dpkg-deb builds one: an ar |
| // archive of debian-binary, control.tar.gz and data.tar.gz. Its members |
| // carry a build machine's owner and times, which the tree must not keep. |
| -func fixtureDeb(t *testing.T, members []debMember) []byte { |
| +func fixtureDeb(t *testing.T, members []debMember, control string) []byte { |
| t.Helper() |
| targz := func(members []debMember) []byte { |
| var b bytes.Buffer |
| @@ -73,7 +73,7 @@ func fixtureDeb(t *testing.T, members []debMember) []byte { |
| } |
| } |
| member("debian-binary", []byte("2.0\n")) |
| - member("control.tar.gz", targz([]debMember{{name: "./control", body: "Package: fixture\n", mode: 0o644}})) |
| + member("control.tar.gz", targz([]debMember{{name: "./control", body: control, mode: 0o644}})) |
| member("data.tar.gz", targz(members)) |
| return ar.Bytes() |
| } |
| @@ -87,6 +87,7 @@ type rendererFixture struct { |
| packages map[string][]debMember |
| order []string |
| edit func(p *rendererPackage) |
| + control func(name, control string) string |
| } |
| func newRendererFixture() *rendererFixture { |
| @@ -129,7 +130,16 @@ func (f *rendererFixture) write(t *testing.T, dir string) (string, map[string]st |
| pin := rendererPin{Version: "1.0-1", Snapshots: map[string]string{"debian": "20990101T000000Z"}, Program: "usr/lib/chromium/chromium-headless-shell"} |
| urls := map[string]string{} |
| for _, name := range f.order { |
| - deb := fixtureDeb(t, f.packages[name]) |
| + // Its control file, as Debian's: the browser is built from the |
| + // chromium source package, the others from their own. |
| + control := "Package: " + name + "\nVersion: 1.0-1\nArchitecture: amd64\n" |
| + if name == "chromium-headless-shell" { |
| + control += "Source: chromium\n" |
| + } |
| + if f.control != nil { |
| + control = f.control(name, control) |
| + } |
| + deb := fixtureDeb(t, f.packages[name], control) |
| sum := sha256.Sum256(deb) |
| p := rendererPackage{Package: name, Version: "1.0-1", Architecture: "amd64", |
| URL: fmt.Sprintf("https://snapshot.debian.org/archive/debian/20990101T000000Z/pool/main/%c/%s/%s_1.0-1_amd64.deb", name[0], name, name), |
| @@ -451,3 +461,84 @@ func writeRendererTar(t *testing.T, path, manifest string) string { |
| sum := sha256.Sum256([]byte(manifest)) |
| return hex.EncodeToString(sum[:]) |
| } |
| + |
| +// The build writes SOURCES beside the archive, from the same checked |
| +// debs: the Chromium version and its source, and per package its version, |
| +// architecture, deb and source package on snapshot.debian.org. |
| +// renderer-sources.py check accepts it, and refuses it changed. |
| +func TestRendererTreeWritesSources(t *testing.T) { |
| + testci.Files(t, "../../scripts/build-renderer-tree.py", "../../scripts/renderer-sources.py") |
| + testci.Tools(t, "python3") |
| + dir := t.TempDir() |
| + pin, urls := newRendererFixture().write(t, dir) |
| + out := filepath.Join(dir, "out", "renderer.tar.gz") |
| + os.Mkdir(filepath.Dir(out), 0o755) |
| + if _, stderr, err := buildRendererTree(t, pin, urls, out, 0); err != nil { |
| + t.Fatalf("build: %v\n%s", err, stderr) |
| + } |
| + sources := filepath.Join(dir, "out", "SOURCES") |
| + raw, err := os.ReadFile(sources) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + snap := "https://snapshot.debian.org/archive/debian/20990101T000000Z/pool/main/" |
| + want := "The page renderer: Chromium headless shell 1.0-1, from Debian.\n" + |
| + "Chromium source: https://snapshot.debian.org/package/chromium/1.0-1/\n\n" + |
| + "chromium-headless-shell 1.0-1 amd64 " + snap + "c/chromium-headless-shell/chromium-headless-shell_1.0-1_amd64.deb https://snapshot.debian.org/package/chromium/1.0-1/\n" + |
| + "fontconfig-config 1.0-1 amd64 " + snap + "f/fontconfig-config/fontconfig-config_1.0-1_amd64.deb https://snapshot.debian.org/package/fontconfig-config/1.0-1/\n" + |
| + "fonts-fixture 1.0-1 amd64 " + snap + "f/fonts-fixture/fonts-fixture_1.0-1_amd64.deb https://snapshot.debian.org/package/fonts-fixture/1.0-1/\n" + |
| + "libc6 1.0-1 amd64 " + snap + "l/libc6/libc6_1.0-1_amd64.deb https://snapshot.debian.org/package/libc6/1.0-1/\n" |
| + if string(raw) != want { |
| + t.Fatalf("SOURCES:\n%s\nwant:\n%s", raw, want) |
| + } |
| + check := func(path string) error { |
| + return exec.Command("python3", "-I", "../../scripts/renderer-sources.py", "check", pin, path).Run() |
| + } |
| + if err := check(sources); err != nil { |
| + t.Fatalf("check refused the build's SOURCES: %v", err) |
| + } |
| + for name, edit := range map[string]func(string) string{ |
| + "a package dropped": func(s string) string { return strings.Replace(s, "libc6 1.0-1", "", 1) }, |
| + "another version": func(s string) string { return strings.Replace(s, "libc6 1.0-1 amd64", "libc6 1.0-2 amd64", 1) }, |
| + "another header": func(s string) string { return strings.Replace(s, "shell 1.0-1,", "shell 2.0-1,", 1) }, |
| + } { |
| + bad := filepath.Join(dir, name) |
| + os.WriteFile(bad, []byte(edit(want)), 0o600) |
| + if check(bad) == nil { |
| + t.Errorf("check accepted SOURCES with %s", name) |
| + } |
| + } |
| +} |
| + |
| +// A deb whose control file is not the pinned package and version, or |
| +// names no chromium source for the browser, is refused: SOURCES is never |
| +// written from a guess, and neither is the archive. |
| +func TestRendererTreeRefusesAnotherControl(t *testing.T) { |
| + testci.Files(t, "../../scripts/build-renderer-tree.py", "../../scripts/renderer-sources.py") |
| + testci.Tools(t, "python3") |
| + for name, edit := range map[string]func(pkg, control string) string{ |
| + "another version": func(pkg, c string) string { |
| + if pkg == "libc6" { |
| + return strings.Replace(c, "1.0-1", "1.0-9", 1) |
| + } |
| + return c |
| + }, |
| + "the browser from another source": func(pkg, c string) string { return strings.Replace(c, "Source: chromium", "Source: other", 1) }, |
| + } { |
| + t.Run(name, func(t *testing.T) { |
| + dir := t.TempDir() |
| + f := newRendererFixture() |
| + f.control = edit |
| + pin, urls := f.write(t, dir) |
| + out := filepath.Join(dir, "renderer.tar.gz") |
| + if _, _, err := buildRendererTree(t, pin, urls, out, 0); err == nil { |
| + t.Fatal("built") |
| + } |
| + for _, p := range []string{out, filepath.Join(dir, "SOURCES")} { |
| + if _, err := os.Stat(p); !os.IsNotExist(err) { |
| + t.Fatalf("%s written: %v", p, err) |
| + } |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/release/staged_gate_test.go b/internal/release/staged_gate_test.go| index eab261f3..01b67c58 100644 |
| --- a/internal/release/staged_gate_test.go |
| +++ b/internal/release/staged_gate_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "crypto/sha256" |
| "encoding/hex" |
| "encoding/json" |
| + "fmt" |
| "os" |
| "os/exec" |
| "path/filepath" |
| @@ -41,6 +42,7 @@ func TestStagedArtifactsGate(t *testing.T) { |
| write(filepath.Join(runner, "darwin-arm64", "equipo-runner"), "mac runner") |
| write(filepath.Join(runner, "darwin-arm64", "gitleaks"), "mac scanner") |
| renderer := writeRendererTar(t, filepath.Join(runner, "renderer.tar.gz"), "dir usr\n") |
| + write(filepath.Join(runner, "SOURCES"), "sources") |
| gate := func(verb string, args ...string) error { |
| return exec.Command("python3", append([]string{filepath.Join(root, "scripts", "staged-artifacts.py"), verb, "abc1234"}, args...)...).Run() |
| } |
| @@ -48,9 +50,12 @@ func TestStagedArtifactsGate(t *testing.T) { |
| // What make release-runner leaves: the release manifest with the tool |
| // proxy it built, and the install manifest with every target's digests. |
| released := func(proxy, linux, mac string) { |
| + tarball, err := os.ReadFile(filepath.Join(runner, "renderer.tar.gz")) |
| + must(err) |
| + archive := `,"renderer_archive_sha256":"` + hash(string(tarball)) + `","renderer_archive_size":` + fmt.Sprint(len(tarball)) |
| release := `{"schema":3,"binaries":[{"name":"bwrap","sha256":"` + hash("bwrap") + `"},{"name":"equipo-tool-proxy","sha256":"` + hash(proxy) + `"}]}` |
| write(filepath.Join(runner, "manifest.json"), release) |
| - write(filepath.Join(runner, "install-manifest.json"), `{"gitleaks":"v8.30.1","version":"abc1234","runner_sha256":"`+hash(linux)+`","release":`+release+`,"targets":{"linux/amd64":{"runner_sha256":"`+hash(linux)+`","tool_proxy_sha256":"`+hash(proxy)+`","gitleaks_sha256":"`+hash("scanner")+`","renderer_sha256":"`+renderer+`"},"darwin/arm64":{"runner_sha256":"`+hash(mac)+`","gitleaks_sha256":"`+hash("mac scanner")+`"}}}`) |
| + write(filepath.Join(runner, "install-manifest.json"), `{"gitleaks":"v8.30.1","version":"abc1234","runner_sha256":"`+hash(linux)+`","release":`+release+`,"targets":{"linux/amd64":{"runner_sha256":"`+hash(linux)+`","tool_proxy_sha256":"`+hash(proxy)+`","gitleaks_sha256":"`+hash("scanner")+`","renderer_sha256":"`+renderer+`"`+archive+`},"darwin/arm64":{"runner_sha256":"`+hash(mac)+`","gitleaks_sha256":"`+hash("mac scanner")+`"}}}`) |
| } |
| write(filepath.Join(runner, "COMMIT"), "abc1234full\n") |
| bin := t.TempDir() |
| @@ -87,14 +92,22 @@ echo go1.26.11 |
| "another Mac runner": func() { released("proxy", "runner", "another mac runner") }, |
| "another commit": func() { write(filepath.Join(runner, "COMMIT"), "def5678full\n") }, |
| "another renderer": func() { writeRendererTar(t, filepath.Join(runner, "renderer.tar.gz"), "dir etc\n") }, |
| + // The same tree, other archive bytes: the recorded digest is not |
| + // the file's. |
| + "another archive": func() { |
| + f, err := os.OpenFile(filepath.Join(runner, "renderer.tar.gz"), os.O_APPEND|os.O_WRONLY, 0) |
| + must(err) |
| + f.Write([]byte{0}) |
| + f.Close() |
| + }, |
| } { |
| change() |
| if gate("manifest") == nil { |
| t.Fatal("a provenance manifest written for a release with " + name) |
| } |
| + writeRendererTar(t, filepath.Join(runner, "renderer.tar.gz"), "dir usr\n") |
| released("proxy", "runner", "mac runner") |
| write(filepath.Join(runner, "COMMIT"), "abc1234full\n") |
| - writeRendererTar(t, filepath.Join(runner, "renderer.tar.gz"), "dir usr\n") |
| } |
| t.Setenv("FIXTURE_SCANNER_VERSION", "v8.30.0") |
| if gate("manifest") == nil { |
| @@ -131,11 +144,11 @@ echo go1.26.11 |
| raw, err := os.ReadFile(instance + ".manifest.json") |
| must(err) |
| must(json.Unmarshal(raw, &made)) |
| - if made.Version != "abc1234" || made.Commit != "abc1234full" || made.Go != "go1.26.11" || made.SHA256["instance"] != hash("instance") || made.SHA256["runner"] != hash("runner") || made.SHA256["tool_proxy"] != hash("proxy") || made.SHA256["darwin_runner"] != hash("mac runner") || made.SHA256["gitleaks"] != hash("scanner") || made.SHA256["darwin_gitleaks"] != hash("mac scanner") { |
| + if made.Version != "abc1234" || made.Commit != "abc1234full" || made.Go != "go1.26.11" || made.SHA256["instance"] != hash("instance") || made.SHA256["runner"] != hash("runner") || made.SHA256["tool_proxy"] != hash("proxy") || made.SHA256["darwin_runner"] != hash("mac runner") || made.SHA256["gitleaks"] != hash("scanner") || made.SHA256["darwin_gitleaks"] != hash("mac scanner") || made.SHA256["renderer_sources"] != hash("sources") || made.SHA256["renderer_archive"] == "" || made.SHA256["install_manifest"] == "" { |
| t.Fatalf("provenance manifest %s", raw) |
| } |
| // Each artifact is held to the build that recorded it. |
| - for _, path := range []string{instance, filepath.Join(runner, "equipo-runner"), filepath.Join(runner, "equipo-tool-proxy"), filepath.Join(runner, "darwin-arm64", "equipo-runner"), filepath.Join(runner, "gitleaks"), filepath.Join(runner, "darwin-arm64", "gitleaks")} { |
| + for _, path := range []string{instance, filepath.Join(runner, "equipo-runner"), filepath.Join(runner, "equipo-tool-proxy"), filepath.Join(runner, "darwin-arm64", "equipo-runner"), filepath.Join(runner, "gitleaks"), filepath.Join(runner, "darwin-arm64", "gitleaks"), filepath.Join(runner, "SOURCES"), filepath.Join(runner, "renderer.tar.gz"), filepath.Join(runner, "install-manifest.json")} { |
| kept, err := os.ReadFile(path) |
| must(err) |
| write(path, "rebuilt") |
diff --git a/internal/runner/setup/install.go b/internal/runner/setup/install.go| index 6f7c6517..570092f6 100644 |
| --- a/internal/runner/setup/install.go |
| +++ b/internal/runner/setup/install.go |
| @@ -32,14 +32,19 @@ type InstallResult struct { |
| var errUnavailable = errors.New("runner.install.unavailable") |
| type installHost struct { |
| - scannerPin, rendererPin string |
| - manifest release.Manifest |
| - home, goos, goarch string |
| - fetch func(context.Context, string, int64) ([]byte, error) |
| - preflight func(context.Context, string, release.InstallManifest) []string |
| - service func(context.Context, string) error |
| - lingering func(context.Context) (bool, error) |
| - serviceAvailable func(context.Context) bool |
| + scannerPin string |
| + renderer release.RendererAsset |
| + manifest release.Manifest |
| + home, goos, goarch string |
| + fetch func(context.Context, string, int64) ([]byte, error) |
| + // fetchRenderer downloads the renderer archive at url into a new |
| + // private file in scratch, at most size+1 bytes, and returns it open |
| + // at its start (fetchRendererArchive). |
| + fetchRenderer func(ctx context.Context, url string, size int64, scratch string) (*os.File, error) |
| + preflight func(context.Context, string, release.InstallManifest) []string |
| + service func(context.Context, string) error |
| + lingering func(context.Context) (bool, error) |
| + serviceAvailable func(context.Context) bool |
| } |
| func InstallUser(ctx context.Context, opts InstallOptions) (InstallResult, error) { |
| @@ -47,8 +52,8 @@ func InstallUser(ctx context.Context, opts InstallOptions) (InstallResult, error |
| if err != nil { |
| return InstallResult{State: "unavailable", Missing: []string{"runner.install.destination"}}, errUnavailable |
| } |
| - rendererPin, _ := release.RendererPin() |
| - return installUser(ctx, opts, installHost{scannerPin: release.GitleaksSHA256(), rendererPin: rendererPin, manifest: release.BuildManifest(), home: home, goos: runtime.GOOS, goarch: runtime.GOARCH, fetch: fetchRelease, preflight: containmentPreflight, service: enableService, lingering: readLingering, serviceAvailable: userServiceAvailable}) |
| + renderer, _ := release.LinkedRendererAsset() |
| + return installUser(ctx, opts, installHost{scannerPin: release.GitleaksSHA256(), renderer: renderer, manifest: release.BuildManifest(), home: home, goos: runtime.GOOS, goarch: runtime.GOARCH, fetch: fetchRelease, fetchRenderer: fetchRendererArchive, preflight: containmentPreflight, service: enableService, lingering: readLingering, serviceAvailable: userServiceAvailable}) |
| } |
| func installUser(ctx context.Context, o InstallOptions, h installHost) (r InstallResult, err error) { |
| r = InstallResult{Version: o.Release, State: "unavailable"} |
| @@ -138,29 +143,42 @@ func installUser(ctx context.Context, o InstallOptions, h installHost) (r Instal |
| return fail("runner.install.checksum") |
| } |
| dir := filepath.Join(o.Root, "releases", o.Release) |
| - // The page renderer, unpacked beside the runner: its MANIFEST must be |
| - // the pin linked into this runner and the one the release recorded. |
| - // A tree already there that verifies (the second run, after |
| - // enrolment) is kept and nothing is fetched for it. |
| - if h.rendererPin == "" || h.rendererPin != m.Targets[release.TargetLinux].RendererSHA256 { |
| + // The page renderer, beside the runner. The archive this runner |
| + // installs is linked into it (release.LinkedRendererAsset): its tree |
| + // pin, digest, size and forge tag, which the release's manifest must |
| + // repeat. A tree already there that verifies (the second run, after |
| + // enrolment) is kept; one an earlier release here has is copied; |
| + // otherwise the archive is fetched from the forge, never from the |
| + // instance, and checked whole before anything is unpacked. |
| + asset, linux := h.renderer, m.Targets[release.TargetLinux] |
| + if !asset.Valid() || asset.Pin != linux.RendererSHA256 || asset.SHA256 != linux.RendererArchiveSHA256 || asset.Size != linux.RendererArchiveSize { |
| return fail("runner.install.checksum") |
| } |
| - var renderer []byte |
| - if release.VerifyRenderer(release.RendererTree(dir, h.rendererPin), h.rendererPin) != nil { |
| - renderer, e = h.fetch(ctx, base+release.RendererArchive, release.RendererArchiveMax) |
| - if e != nil { |
| - return fail("runner.install.release") |
| - } |
| - if pin, pe := release.RendererArchivePin(bytes.NewReader(renderer)); pe != nil || pin != h.rendererPin { |
| - return fail("runner.install.checksum") |
| + var archive *os.File |
| + reuse := "" |
| + if release.VerifyRenderer(release.RendererTree(dir, asset.Pin), asset.Pin) != nil { |
| + if reuse = earlierTree(o.Root, o.Release, asset.Pin); reuse == "" { |
| + if archive, e = h.fetchRenderer(ctx, asset.URL(), asset.Size, scratch); e != nil { |
| + return fail("runner.install.release") |
| + } |
| + defer archive.Close() |
| + if !archiveMatches(archive, asset) { |
| + return fail("runner.install.checksum") |
| + } |
| } |
| } |
| if !privateDirectory(dir) { |
| return fail("runner.install.destination") |
| } |
| - // Unpacked and verified before any of the runner's files is written. |
| - if renderer != nil { |
| - if _, e = release.InstallRenderer(dir, bytes.NewReader(renderer), h.rendererPin); e != nil { |
| + // Unpacked (or copied) and verified before any of the runner's files |
| + // is written. |
| + if archive != nil || reuse != "" { |
| + if archive != nil { |
| + _, e = release.InstallRenderer(dir, archive, asset.Pin) |
| + } else { |
| + _, e = release.CopyRenderer(dir, reuse, asset.Pin) |
| + } |
| + if e != nil { |
| var mismatch *release.RendererError |
| if errors.As(e, &mismatch) { |
| return fail("runner.install.checksum") |
| @@ -349,3 +367,124 @@ func fetchRelease(ctx context.Context, url string, limit int64) ([]byte, error) |
| } |
| return b, nil |
| } |
| + |
| +// earlierTree is a renderer tree for pin that verifies in another release |
| +// directory under root (an earlier install's), or "". At most a few |
| +// release directories are looked at. |
| +func earlierTree(root, version, pin string) string { |
| + entries, err := os.ReadDir(filepath.Join(root, "releases")) |
| + if err != nil { |
| + return "" |
| + } |
| + for i, d := range entries { |
| + if i >= 32 { |
| + break |
| + } |
| + name := d.Name() |
| + if name == version || !d.IsDir() || !release.ValidInstallVersion(name) { |
| + continue |
| + } |
| + tree := release.RendererTree(filepath.Join(root, "releases", name), pin) |
| + if info, err := os.Lstat(tree); err == nil && info.IsDir() && release.VerifyRenderer(tree, pin) == nil { |
| + return tree |
| + } |
| + } |
| + return "" |
| +} |
| + |
| +// archiveMatches: f holds exactly the asset's size in bytes, with its |
| +// SHA-256, and the archive's MANIFEST is its tree pin. f is left at its |
| +// start. |
| +func archiveMatches(f *os.File, a release.RendererAsset) bool { |
| + if _, err := f.Seek(0, io.SeekStart); err != nil { |
| + return false |
| + } |
| + h := sha256.New() |
| + n, err := io.Copy(h, io.LimitReader(f, a.Size+1)) |
| + if err != nil || n != a.Size || hex.EncodeToString(h.Sum(nil)) != a.SHA256 { |
| + return false |
| + } |
| + if _, err := f.Seek(0, io.SeekStart); err != nil { |
| + return false |
| + } |
| + pin, err := release.RendererArchivePin(f) |
| + if err != nil || pin != a.Pin { |
| + return false |
| + } |
| + _, err = f.Seek(0, io.SeekStart) |
| + return err == nil |
| +} |
| + |
| +// Bounds on the renderer download: it may take long on a slow link, but |
| +// not stall. rendererTransport is nil (the default) but in tests. |
| +var ( |
| + rendererDownloadMax = 30 * time.Minute |
| + rendererDownloadStall = 2 * time.Minute |
| + rendererTransport http.RoundTripper |
| +) |
| + |
| +// fetchRendererArchive downloads the archive at url (the forge's fixed |
| +// address) into a new private file in scratch. The forge answers with a |
| +// redirect to its storage: exactly one is followed, and only to an https |
| +// URL without credentials. The body is read at most to size+1 bytes, and |
| +// a download that makes no progress for rendererDownloadStall, or runs |
| +// past rendererDownloadMax, is abandoned. A failure removes the file. |
| +func fetchRendererArchive(ctx context.Context, url string, size int64, scratch string) (_ *os.File, err error) { |
| + ctx, cancel := context.WithTimeout(ctx, rendererDownloadMax) |
| + defer cancel() |
| + c := http.Client{Transport: rendererTransport, CheckRedirect: func(req *http.Request, via []*http.Request) error { |
| + if len(via) > 1 || req.URL.Scheme != "https" || req.URL.User != nil || req.URL.Host == "" { |
| + return errUnavailable |
| + } |
| + return nil |
| + }} |
| + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) |
| + if err != nil { |
| + return nil, err |
| + } |
| + resp, err := c.Do(req) |
| + if err != nil { |
| + return nil, err |
| + } |
| + defer resp.Body.Close() |
| + if resp.StatusCode != http.StatusOK { |
| + return nil, errUnavailable |
| + } |
| + f, err := os.CreateTemp(scratch, "renderer-*.tar.gz") |
| + if err != nil { |
| + return nil, err |
| + } |
| + defer func() { |
| + if err != nil { |
| + f.Close() |
| + os.Remove(f.Name()) |
| + } |
| + }() |
| + stall := time.AfterFunc(rendererDownloadStall, cancel) |
| + defer stall.Stop() |
| + n, err := io.Copy(f, progress{io.LimitReader(resp.Body, size+1), func() { stall.Reset(rendererDownloadStall) }}) |
| + if err != nil { |
| + return nil, err |
| + } |
| + if n != size { |
| + return nil, errUnavailable |
| + } |
| + if _, err = f.Seek(0, io.SeekStart); err != nil { |
| + return nil, err |
| + } |
| + return f, nil |
| +} |
| + |
| +// progress calls moved after every read that returned bytes. |
| +type progress struct { |
| + r io.Reader |
| + moved func() |
| +} |
| + |
| +func (p progress) Read(b []byte) (int, error) { |
| + n, err := p.r.Read(b) |
| + if n > 0 { |
| + p.moved() |
| + } |
| + return n, err |
| +} |
diff --git a/internal/runner/setup/install_test.go b/internal/runner/setup/install_test.go| index fd477c6d..9547a907 100644 |
| --- a/internal/runner/setup/install_test.go |
| +++ b/internal/runner/setup/install_test.go |
| @@ -47,18 +47,19 @@ func installFixture(t *testing.T) (InstallOptions, installHost, *int) { |
| built.Binaries = append(built.Binaries[:4:4], release.BinaryDigest{Name: "equipo-tool-proxy", Version: built.LauncherVersion, SHA256: proxySum}) |
| // And the renderer archive, whose MANIFEST is the pin linked into the runner. |
| archive, rendererPin := renderertest.Archive(renderertest.Small()) |
| - m := release.InstallManifest{Version: "fixture-16", Target: "linux/amd64", RunnerSHA256: runnerSum, NamespaceArgs: provider.NamespaceArguments(), Release: built, Targets: map[string]release.InstallTarget{release.TargetLinux: {RunnerSHA256: runnerSum, ToolProxySHA256: proxySum, GitleaksSHA256: runnerSum, RendererSHA256: rendererPin}}} |
| + asset := assetOf(archive, rendererPin) |
| + m := release.InstallManifest{Version: "fixture-16", Target: "linux/amd64", RunnerSHA256: runnerSum, NamespaceArgs: provider.NamespaceArguments(), Release: built, Targets: map[string]release.InstallTarget{release.TargetLinux: {RunnerSHA256: runnerSum, ToolProxySHA256: proxySum, GitleaksSHA256: runnerSum, RendererSHA256: rendererPin, RendererArchiveSHA256: asset.SHA256, RendererArchiveSize: asset.Size}}} |
| raw, err := json.Marshal(m) |
| if err != nil { |
| t.Fatal(err) |
| } |
| calls := new(int) |
| - h := installHost{scannerPin: runnerSum, rendererPin: rendererPin, manifest: m.Release, home: home, goos: "linux", goarch: "amd64", fetch: func(_ context.Context, url string, _ int64) ([]byte, error) { |
| + h := installHost{scannerPin: runnerSum, renderer: asset, fetchRenderer: forgeFetch(t, archive, nil), manifest: m.Release, home: home, goos: "linux", goarch: "amd64", fetch: func(_ context.Context, url string, _ int64) ([]byte, error) { |
| if strings.HasSuffix(url, "install-manifest.json") { |
| return raw, nil |
| } |
| if strings.HasSuffix(url, "/"+release.RendererArchive) { |
| - return archive, nil |
| + t.Errorf("fetched the renderer from the instance: %s", url) |
| } |
| if strings.HasSuffix(url, "equipo-tool-proxy") { |
| return []byte("fixture tool proxy"), nil |
| @@ -381,3 +382,32 @@ func TestSetupCommandsHaveTheirOwnDirectory(t *testing.T) { |
| t.Fatalf("dir %q", dir) |
| } |
| } |
| + |
| +// assetOf is the asset linked into a runner for archive: its tree pin, |
| +// digest, size and the tag its digest names. |
| +func assetOf(archive []byte, pin string) release.RendererAsset { |
| + sum := fmt.Sprintf("%x", sha256.Sum256(archive)) |
| + return release.RendererAsset{Pin: pin, SHA256: sum, Size: int64(len(archive)), Tag: "renderer-" + sum[:12]} |
| +} |
| + |
| +// forgeFetch is a fetchRenderer that answers with body, as the forge |
| +// would, writing it to a new file in scratch; it records each URL asked |
| +// for in urls (when not nil). |
| +func forgeFetch(t *testing.T, body []byte, urls *[]string) func(context.Context, string, int64, string) (*os.File, error) { |
| + return func(_ context.Context, url string, size int64, scratch string) (*os.File, error) { |
| + if urls != nil { |
| + *urls = append(*urls, url) |
| + } |
| + f, err := os.CreateTemp(scratch, "renderer-*.tar.gz") |
| + if err != nil { |
| + return nil, err |
| + } |
| + if len(body) > int(size)+1 { |
| + body = body[:size+1] |
| + } |
| + if _, err = f.Write(body); err == nil { |
| + _, err = f.Seek(0, 0) |
| + } |
| + return f, err |
| + } |
| +} |
diff --git a/internal/runner/setup/renderer_install_test.go b/internal/runner/setup/renderer_install_test.go| index e7ab1075..a22c1ee6 100644 |
| --- a/internal/runner/setup/renderer_install_test.go |
| +++ b/internal/runner/setup/renderer_install_test.go |
| @@ -5,97 +5,213 @@ package runnersetup |
| import ( |
| "context" |
| "encoding/json" |
| + "errors" |
| + "net/http" |
| + "net/http/httptest" |
| "os" |
| "path/filepath" |
| "strings" |
| + "syscall" |
| "testing" |
| + "time" |
| "amadan.net/oficina/equipo/internal/release" |
| "amadan.net/oficina/equipo/internal/release/renderertest" |
| ) |
| -// The installer fetches renderer.tar.gz with the runner, holds its |
| -// MANIFEST to the pin linked into the runner and to the one the release |
| -// recorded, and unpacks it beside the runner as |
| -// renderer/<first 12 of pin>/, the tree VerifyRenderer accepts. |
| +// The installer fetches renderer.tar.gz from the forge, at the address |
| +// built from the tag linked into the runner (never from the instance), |
| +// holds it to the linked size, digest and pin and to what the release |
| +// recorded, and unpacks it beside the runner as renderer/<first 12 of |
| +// pin>/, the tree VerifyRenderer accepts. |
| func TestInstallIncludesVerifiedRenderer(t *testing.T) { |
| o, h, _ := installFixture(t) |
| + var urls []string |
| + archive, _ := renderertest.Archive(renderertest.Small()) |
| + h.fetchRenderer = forgeFetch(t, archive, &urls) |
| r, err := installUser(context.Background(), o, h) |
| if err != nil { |
| t.Fatal(err) |
| } |
| - tree := release.RendererTree(filepath.Dir(r.BinaryPath), h.rendererPin) |
| - if err = release.VerifyRenderer(tree, h.rendererPin); err != nil { |
| + want := release.RendererForge + h.renderer.Tag + "/renderer.tar.gz" |
| + if len(urls) != 1 || urls[0] != want { |
| + t.Fatalf("fetched %v, want [%s]", urls, want) |
| + } |
| + tree := release.RendererTree(filepath.Dir(r.BinaryPath), h.renderer.Pin) |
| + if err = release.VerifyRenderer(tree, h.renderer.Pin); err != nil { |
| t.Fatalf("no verified renderer beside the runner: %v", err) |
| } |
| // A retry (the installer runs twice: before enrolment and after) |
| // finds the tree verified and fetches nothing for it. |
| - fetch := h.fetch |
| - h.fetch = func(ctx context.Context, url string, limit int64) ([]byte, error) { |
| - if strings.HasSuffix(url, "/"+release.RendererArchive) { |
| - t.Error("fetched the renderer again for a verified tree") |
| - } |
| - return fetch(ctx, url, limit) |
| + urls = nil |
| + if _, err = installUser(context.Background(), o, h); err != nil || len(urls) != 0 { |
| + t.Fatalf("retry: fetched %v: %v", urls, err) |
| } |
| - if _, err = installUser(context.Background(), o, h); err != nil { |
| +} |
| + |
| +// A new release beside an earlier one with the same renderer copies its |
| +// tree, fetching nothing: files copied, not linked, and verified. |
| +func TestInstallCopiesAnEarlierTree(t *testing.T) { |
| + o, h, _ := installFixture(t) |
| + if _, err := installUser(context.Background(), o, h); err != nil { |
| t.Fatal(err) |
| } |
| + var urls []string |
| + h.fetchRenderer = forgeFetch(t, nil, &urls) |
| + h.fetch = editManifest(h.fetch, func(m *release.InstallManifest) { m.Version = "fixture-17" }) |
| + o.Release = "fixture-17" |
| + r, err := installUser(context.Background(), o, h) |
| + if err != nil || len(urls) != 0 { |
| + t.Fatalf("second release: fetched %v: %v", urls, err) |
| + } |
| + tree := release.RendererTree(filepath.Dir(r.BinaryPath), h.renderer.Pin) |
| + if err = release.VerifyRenderer(tree, h.renderer.Pin); err != nil { |
| + t.Fatalf("copied tree: %v", err) |
| + } |
| + links := 0 |
| + filepath.Walk(tree, func(p string, info os.FileInfo, err error) error { |
| + if err == nil && info.Mode().IsRegular() && info.Sys().(*syscall.Stat_t).Nlink != 1 { |
| + links++ |
| + } |
| + return nil |
| + }) |
| + if links != 0 { |
| + t.Fatalf("%d files of the copy are linked to another", links) |
| + } |
| } |
| -// Another archive, one whose files are not its MANIFEST's, a release |
| -// that recorded another pin or none, and a runner with no pin linked: |
| -// refused before the runner or the renderer is written. |
| +// Each check refuses before the runner or the renderer is written: the |
| +// download's size or digest, its MANIFEST, its files, what the release |
| +// recorded and what the runner has linked. |
| func TestInstallRendererRefusesAnotherTree(t *testing.T) { |
| + small, pin := renderertest.Archive(renderertest.Small()) |
| other, otherPin := renderertest.Archive(renderertest.Small()[:4]) |
| // The pin's MANIFEST, over a file with other bytes than it lists. |
| changed := renderertest.Small() |
| changed[len(changed)-1].Body = "changed" |
| tampered := renderertest.ArchiveOf(changed, renderertest.Manifest(renderertest.Small())) |
| - for name, change := range map[string]func(*installHost){ |
| - "another archive": func(h *installHost) { h.fetch = swap(h.fetch, release.RendererArchive, other) }, |
| - "not an archive": func(h *installHost) { h.fetch = swap(h.fetch, release.RendererArchive, []byte("not gzip")) }, |
| - "a changed file": func(h *installHost) { h.fetch = swap(h.fetch, release.RendererArchive, tampered) }, |
| - "recorded another pin": func(h *installHost) { |
| - h.fetch = editManifest(h.fetch, func(m *release.InstallManifest) { |
| - linux := m.Targets[release.TargetLinux] |
| - linux.RendererSHA256 = otherPin |
| - m.Targets[release.TargetLinux] = linux |
| - }) |
| - }, |
| - "recorded none": func(h *installHost) { |
| + // The same tree and size, other bytes (the gzip header's time): only |
| + // the archive digest tells them apart. |
| + retimed := append([]byte{}, small...) |
| + retimed[4] ^= 0xff |
| + // link makes the runner's linked asset, and the release's record, |
| + // say archive with pin: every check before the one under test passes. |
| + link := func(h *installHost, archive []byte, pin string) { |
| + h.renderer = assetOf(archive, pin) |
| + h.fetchRenderer = forgeFetch(t, archive, nil) |
| + h.fetch = editManifest(h.fetch, func(m *release.InstallManifest) { |
| + linux := m.Targets[release.TargetLinux] |
| + linux.RendererSHA256, linux.RendererArchiveSHA256, linux.RendererArchiveSize = pin, h.renderer.SHA256, h.renderer.Size |
| + m.Targets[release.TargetLinux] = linux |
| + }) |
| + } |
| + record := func(edit func(*release.InstallTarget)) func(*installHost) { |
| + return func(h *installHost) { |
| h.fetch = editManifest(h.fetch, func(m *release.InstallManifest) { |
| linux := m.Targets[release.TargetLinux] |
| - linux.RendererSHA256 = "" |
| + edit(&linux) |
| m.Targets[release.TargetLinux] = linux |
| }) |
| - }, |
| - "runner linked another pin": func(h *installHost) { h.rendererPin = otherPin }, |
| - "runner linked none": func(h *installHost) { h.rendererPin = "" }, |
| + } |
| + } |
| + for name, c := range map[string]struct { |
| + change func(*installHost) |
| + key string |
| + }{ |
| + "other bytes": {func(h *installHost) { h.fetchRenderer = forgeFetch(t, other, nil) }, "runner.install.checksum"}, |
| + "same tree, other bytes": {func(h *installHost) { h.fetchRenderer = forgeFetch(t, retimed, nil) }, "runner.install.checksum"}, |
| + "short": {func(h *installHost) { h.fetchRenderer = forgeFetch(t, small[:len(small)-1], nil) }, "runner.install.checksum"}, |
| + "long": {func(h *installHost) { h.fetchRenderer = forgeFetch(t, append(append([]byte{}, small...), 0), nil) }, "runner.install.checksum"}, |
| + "another tree's MANIFEST": {func(h *installHost) { link(h, other, pin) }, "runner.install.checksum"}, |
| + "a changed file": {func(h *installHost) { link(h, tampered, pin) }, "runner.install.checksum"}, |
| + "not an archive": {func(h *installHost) { link(h, []byte("not gzip"), pin) }, "runner.install.checksum"}, |
| + "recorded another pin": {record(func(l *release.InstallTarget) { l.RendererSHA256 = otherPin }), "runner.install.checksum"}, |
| + "recorded another archive": {record(func(l *release.InstallTarget) { l.RendererArchiveSHA256 = strings.Repeat("a", 64) }), "runner.install.checksum"}, |
| + "recorded another size": {record(func(l *release.InstallTarget) { l.RendererArchiveSize++ }), "runner.install.checksum"}, |
| + "runner linked another pin": {func(h *installHost) { h.renderer.Pin = otherPin }, "runner.install.checksum"}, |
| + "runner linked another tag": {func(h *installHost) { h.renderer.Tag = "renderer-000000000000" }, "runner.install.checksum"}, |
| + "runner linked none": {func(h *installHost) { h.renderer = release.RendererAsset{} }, "runner.install.checksum"}, |
| + "forge unreachable": {func(h *installHost) { |
| + h.fetchRenderer = func(context.Context, string, int64, string) (*os.File, error) { return nil, errors.New("offline") } |
| + }, "runner.install.release"}, |
| } { |
| t.Run(name, func(t *testing.T) { |
| o, h, calls := installFixture(t) |
| - pin := h.rendererPin |
| - change(&h) |
| + pin := h.renderer.Pin |
| + c.change(&h) |
| r, err := installUser(context.Background(), o, h) |
| - if err == nil || r.State != "unavailable" || strings.Join(r.Missing, ",") != "runner.install.checksum" || *calls != 0 { |
| + if err == nil || r.State != "unavailable" || strings.Join(r.Missing, ",") != c.key || *calls != 0 { |
| t.Fatalf("installed with %s: %+v %v", name, r, err) |
| } |
| dir := filepath.Join(o.Root, "releases", o.Release) |
| for _, p := range []string{release.RendererTree(dir, pin), release.RendererTree(dir, otherPin), filepath.Join(dir, "equipo-runner")} { |
| if _, err := os.Lstat(p); !os.IsNotExist(err) { |
| - t.Fatalf("a renderer tree at %s: %v", p, err) |
| + t.Fatalf("written at %s: %v", p, err) |
| } |
| } |
| }) |
| } |
| } |
| -func swap(fetch func(context.Context, string, int64) ([]byte, error), name string, body []byte) func(context.Context, string, int64) ([]byte, error) { |
| - return func(ctx context.Context, url string, limit int64) ([]byte, error) { |
| - if strings.HasSuffix(url, "/"+name) { |
| - return body, nil |
| +// fetchRendererArchive follows the forge's one redirect to https storage, |
| +// and refuses a second, a plain-http or credentialed target, another |
| +// status, a wrong length and a stalled body, leaving no file behind. |
| +func TestFetchRendererArchive(t *testing.T) { |
| + body := []byte("renderer archive bytes") |
| + storage := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + switch r.URL.Path { |
| + case "/object": |
| + w.Write(body) |
| + case "/again": |
| + http.Redirect(w, r, "/object", http.StatusFound) |
| + case "/stall": |
| + w.Header().Set("Content-Length", "22") |
| + w.Write(body[:4]) |
| + w.(http.Flusher).Flush() |
| + <-r.Context().Done() |
| + default: |
| + w.WriteHeader(http.StatusNotFound) |
| + } |
| + })) |
| + defer storage.Close() |
| + plain := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write(body) })) |
| + defer plain.Close() |
| + forge := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + to := map[string]string{"/ok": storage.URL + "/object", "/twice": storage.URL + "/again", "/http": plain.URL + "/object", |
| + "/creds": strings.Replace(storage.URL, "https://", "https://user:pw@", 1) + "/object", "/stall": storage.URL + "/stall"}[r.URL.Path] |
| + if r.URL.Path == "/gone" { |
| + w.WriteHeader(http.StatusNotFound) |
| + return |
| } |
| - return fetch(ctx, url, limit) |
| + http.Redirect(w, r, to, http.StatusFound) |
| + })) |
| + defer forge.Close() |
| + old, oldStall := rendererTransport, rendererDownloadStall |
| + rendererTransport, rendererDownloadStall = forge.Client().Transport, 200*time.Millisecond |
| + defer func() { rendererTransport, rendererDownloadStall = old, oldStall }() |
| + |
| + scratch := t.TempDir() |
| + f, err := fetchRendererArchive(context.Background(), forge.URL+"/ok", int64(len(body)), scratch) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + got, _ := os.ReadFile(f.Name()) |
| + f.Close() |
| + if string(got) != string(body) { |
| + t.Fatalf("got %q", got) |
| + } |
| + os.Remove(f.Name()) |
| + for _, c := range []struct { |
| + path string |
| + size int64 |
| + }{{"/twice", int64(len(body))}, {"/http", int64(len(body))}, {"/creds", int64(len(body))}, {"/gone", int64(len(body))}, {"/ok", int64(len(body)) - 1}, {"/ok", int64(len(body)) + 1}, {"/stall", int64(len(body))}} { |
| + if f, err := fetchRendererArchive(context.Background(), forge.URL+c.path, c.size, scratch); err == nil { |
| + f.Close() |
| + t.Errorf("%s (size %d) was accepted", c.path, c.size) |
| + } |
| + } |
| + if left, _ := os.ReadDir(scratch); len(left) != 0 { |
| + t.Fatalf("left in scratch: %v", left) |
| } |
| } |
diff --git a/scripts/build-instance-release.sh b/scripts/build-instance-release.sh| index b9fe40ab..e7535e86 100755 |
| --- a/scripts/build-instance-release.sh |
| +++ b/scripts/build-instance-release.sh |
| @@ -10,9 +10,10 @@ bundle=internal/release/bundled |
| mkdir "$bundle" |
| trap 'rm -rf "$bundle"' EXIT |
| trap 'exit 1' HUP INT TERM |
| -# renderer.tar.gz is the page renderer the Linux (amd64) runner installs |
| -# beside itself; the asset reader allows it 384 MiB. |
| -for name in install-manifest.json equipo-runner equipo-tool-proxy gitleaks renderer.tar.gz install-v1.sh; do |
| +# The page renderer (renderer.tar.gz) is not bundled: the Linux runner |
| +# fetches it from its forge release (internal/release RendererForge). The |
| +# platform caps one ship at 256 MiB, and the renderer alone is ~230 MB. |
| +for name in install-manifest.json equipo-runner equipo-tool-proxy gitleaks install-v1.sh; do |
| cp "$source/$name" "$bundle/$name" |
| done |
| # The Mac worker's runner, served under darwin-arm64/ (it has no tool proxy). |
| @@ -20,6 +21,12 @@ mkdir "$bundle/darwin-arm64" |
| for name in equipo-runner gitleaks; do |
| cp "$source/darwin-arm64/$name" "$bundle/darwin-arm64/$name" |
| done |
| +# Everything embedded stays well under the ship cap (a bound, not the cap). |
| +bundled=$(du -sb "$bundle" | cut -f 1) |
| +if [ "$bundled" -gt $((160 << 20)) ]; then |
| + echo "build-instance-release: the bundle is $bundled bytes, over 160 MiB" >&2 |
| + exit 1 |
| +fi |
| # The instance serves only the tool proxy of its own build: its digest is |
| # linked in, as it is into the runners (Makefile, RELEASE_LDFLAGS). |
| proxy=$(sha256sum "$source/equipo-tool-proxy" | cut -d ' ' -f 1) |
diff --git a/scripts/build-renderer-tree.py b/scripts/build-renderer-tree.py| index bce6d954..4218a151 100755 |
| --- a/scripts/build-renderer-tree.py |
| +++ b/scripts/build-renderer-tree.py |
| @@ -32,6 +32,10 @@ all. The tree is unpacked in a scratch directory beside TAR and removed, |
| unless --tree names a new directory to keep it in. The MANIFEST's SHA-256, |
| printed on stdout, is the pin make release-runner links into the Linux |
| runner (internal/release rendererSHA256). |
| + |
| +SOURCES is written beside TAR in the same run, from the same checked debs |
| +(scripts/renderer-sources.py): each package, its version and where its |
| +source is. It is published with the archive. |
| """ |
| import gzip |
| import hashlib |
| @@ -45,6 +49,11 @@ import tarfile |
| import tempfile |
| import urllib.request |
| from concurrent.futures import ThreadPoolExecutor |
| +import importlib.util |
| + |
| +_spec = importlib.util.spec_from_file_location("renderer_sources", os.path.join(os.path.dirname(os.path.abspath(__file__)), "renderer-sources.py")) |
| +renderer_sources = importlib.util.module_from_spec(_spec) |
| +_spec.loader.exec_module(renderer_sources) |
| SNAPSHOT = "https://snapshot.debian.org/archive/" |
| DIGEST = re.compile(r"[0-9a-f]{64}") |
| @@ -296,6 +305,10 @@ def build(pin_path, tar_path, keep): |
| out_dir = os.path.dirname(os.path.abspath(tar_path)) |
| with ThreadPoolExecutor(max_workers=4) as pool: |
| debs = list(pool.map(checked, packages)) |
| + try: |
| + sources = renderer_sources.sources(pin, debs).encode("utf-8") |
| + except renderer_sources.Refused as r: |
| + raise Refused(str(r)) |
| if keep: |
| os.mkdir(keep, 0o755) |
| root, scratch = keep, None |
| @@ -322,6 +335,11 @@ def build(pin_path, tar_path, keep): |
| fd = None |
| write_tar(tree, manifest, out) |
| os.chmod(partial, 0o644) |
| + sources_path = os.path.join(out_dir, "SOURCES") |
| + with open(sources_path + ".partial", "wb") as f: |
| + f.write(sources) |
| + os.chmod(sources_path + ".partial", 0o644) |
| + os.replace(sources_path + ".partial", sources_path) |
| os.replace(partial, tar_path) |
| partial = None |
| except BaseException: |
diff --git a/scripts/publish-renderer.sh b/scripts/publish-renderer.sh| new file mode 100755 |
| index 00000000..ecfa701a |
| --- /dev/null |
| +++ b/scripts/publish-renderer.sh |
| @@ -0,0 +1,108 @@ |
| +#!/usr/bin/env bash |
| +# Publish the page renderer a release kit holds, or check the published one. |
| +# |
| +# scripts/publish-renderer.sh publish <kit> |
| +# scripts/publish-renderer.sh check <kit> <dir> |
| +# |
| +# <kit> is a runner release directory (make release-runner): |
| +# renderer.tar.gz, SOURCES, equipo-runner and COMMIT. The Linux runner in |
| +# it fetches renderer.tar.gz from the forge release whose tag is linked |
| +# into it (internal/release rendererTag), at |
| +# https://amadan.net/oficina/equipo/-/releases/<tag>/renderer.tar.gz, |
| +# never from the instance. Both modes first require that the tag is the |
| +# one linked into the kit's runner and names the archive's digest, and |
| +# that SOURCES lists exactly the pinned packages of the kit's commit. |
| +# |
| +# publish: if the release exists, check it (below). Otherwise tag the |
| +# kit's commit (never the current checkout), push the tag, create the |
| +# release with renderer.tar.gz and SOURCES (scripts/renderer-sources.py |
| +# wrote SOURCES with the archive), and check it. Needs writer access to |
| +# oficina/equipo. |
| +# |
| +# check: download both assets in full, without credentials, into <dir>, |
| +# and require each to be the kit's file byte for byte. Never a HEAD or a |
| +# ranged request: the forge counts a redirect it issues as a download. |
| +# staging-thin.py runs it before it installs anything, and installs the |
| +# renderer from the downloaded copy. |
| +set -euo pipefail |
| + |
| +FORGE=https://amadan.net/oficina/equipo/-/releases |
| +REPO=oficina/equipo |
| +AMADAN=${AMADAN:-amadan} |
| +GO=${GO:-go} |
| + |
| +die() { echo "publish-renderer: $*" >&2; exit 1; } |
| +sum() { sha256sum "$1" | cut -d ' ' -f 1; } |
| + |
| +[[ $# -ge 2 ]] || die "usage: publish <kit> | check <kit> <dir>" |
| +verb=$1 kit=$2 |
| +case $verb in |
| +publish) [[ $# -eq 2 ]] || die "usage: publish <kit>" ;; |
| +check) [[ $# -eq 3 ]] || die "usage: check <kit> <dir>"; out=$3 ;; |
| +*) die "usage: publish <kit> | check <kit> <dir>" ;; |
| +esac |
| +for f in renderer.tar.gz SOURCES equipo-runner COMMIT; do |
| + [[ -f $kit/$f && ! -L $kit/$f ]] || die "$kit/$f is missing" |
| +done |
| +commit=$(cat "$kit/COMMIT") |
| +[[ $commit =~ ^[0-9a-f]{40}$ ]] || die "$kit/COMMIT is not a commit" |
| +archive_sum=$(sum "$kit/renderer.tar.gz") |
| +sources_sum=$(sum "$kit/SOURCES") |
| + |
| +# The tag linked into the kit's runner, as go version -m reports its build. |
| +tag=$("$GO" version -m "$kit/equipo-runner" | grep -o 'internal/release\.rendererTag=[^ "]*' | head -1 | cut -d = -f 2) |
| +[[ $tag =~ ^renderer-([0-9a-f]{12})(-r[1-9][0-9]{0,2})?$ ]] || die "no renderer tag is linked into $kit/equipo-runner" |
| +[[ ${BASH_REMATCH[1]} == "${archive_sum:0:12}" ]] || die "the linked tag $tag does not name $kit/renderer.tar.gz ($archive_sum)" |
| + |
| +# SOURCES lists exactly the pinned packages of the kit's commit. |
| +scratch=$(mktemp -d "${TMPDIR:-/tmp}/publish-renderer.XXXXXX") |
| +trap 'rm -rf "$scratch"' EXIT |
| +git show "$commit:internal/release/renderer.json" >"$scratch/renderer.json" || die "no renderer.json at $commit" |
| +python3 -I "$(dirname "$0")/renderer-sources.py" check "$scratch/renderer.json" "$kit/SOURCES" || die "$kit/SOURCES is not the pinned packages'" |
| + |
| +# fetch NAME DEST: the published asset, whole, following the forge's |
| +# redirect to its storage. Prints the HTTP status ("404" when there is |
| +# none). |
| +fetch() { |
| + curl --silent --show-error --location --max-redirs 1 --proto '=https' --proto-redir '=https' \ |
| + --max-time 1800 --output "$2" --write-out '%{http_code}' "$FORGE/$tag/$1" |
| +} |
| + |
| +# check_into DIR: both assets downloaded into DIR are the kit's. |
| +check_into() { |
| + local dir=$1 name status |
| + for name in renderer.tar.gz SOURCES; do |
| + status=$(fetch "$name" "$dir/$name") || die "downloading $tag/$name failed" |
| + [[ $status == 200 ]] || die "$FORGE/$tag/$name answered $status" |
| + cmp -s "$dir/$name" "$kit/$name" || die "the published $tag/$name is not $kit/$name" |
| + done |
| + echo "publish-renderer: $tag matches $kit (renderer.tar.gz $archive_sum, SOURCES $sources_sum)" |
| +} |
| + |
| +if [[ $verb == check ]]; then |
| + mkdir -p "$out" |
| + check_into "$out" |
| + exit 0 |
| +fi |
| + |
| +# publish: an existing release is only checked, never replaced. |
| +status=$(fetch renderer.tar.gz "$scratch/existing") || die "asking the forge for $tag failed" |
| +if [[ $status == 200 ]]; then |
| + check_into "$scratch" |
| + exit 0 |
| +fi |
| +[[ $status == 404 ]] || die "$FORGE/$tag/renderer.tar.gz answered $status" |
| + |
| +# The tag names the kit's commit, on the forge too. |
| +remote=$(git ls-remote --tags origin "refs/tags/$tag" | cut -f 1) |
| +if [[ -z $remote ]]; then |
| + git tag "$tag" "$commit" 2>/dev/null || [[ $(git rev-parse "$tag^{commit}") == "$commit" ]] || die "a local tag $tag names another commit" |
| + git push origin "refs/tags/$tag" |
| +elif [[ $remote != "$commit" ]]; then |
| + die "the forge's tag $tag names $remote, not the kit's $commit" |
| +fi |
| +version=$(head -1 "$kit/SOURCES" | sed -n 's/^The page renderer: Chromium headless shell \([^,]*\), from Debian\.$/\1/p') |
| +[[ -n $version ]] || die "$kit/SOURCES has no Chromium version" |
| +printf '%s\n' "The page renderer: Debian packages and Chromium headless shell $version. Where each one's source is: SOURCES." >"$scratch/notes.md" |
| +"$AMADAN" release create -repo "$REPO" -notes-file "$scratch/notes.md" "$tag" "$kit/renderer.tar.gz" "$kit/SOURCES" |
| +check_into "$scratch" |
diff --git a/scripts/renderer-sources.py b/scripts/renderer-sources.py| new file mode 100755 |
| index 00000000..a1e73359 |
| --- /dev/null |
| +++ b/scripts/renderer-sources.py |
| @@ -0,0 +1,153 @@ |
| +#!/usr/bin/env python3 |
| +"""SOURCES: what the published page renderer distributes, and where each |
| +part's source is. |
| + |
| + scripts/renderer-sources.py check PIN SOURCES |
| + |
| +The renderer archive (scripts/build-renderer-tree.py) holds Debian |
| +packages, Chromium's headless shell among them. Publishing it makes us |
| +their distributor, so its forge release carries SOURCES beside it. SOURCES |
| +is made by build-renderer-tree.py in the same run as the archive, from the |
| +same pinned list (internal/release/renderer.json) and the same checked |
| +debs, so it cannot drift: sources(pin, debs) here. It is plain text: |
| + |
| + The page renderer: Chromium headless shell <version>, from Debian. |
| + Chromium source: https://snapshot.debian.org/package/chromium/<version>/ |
| + |
| + <package> <version> <architecture> <deb URL> <source package URL> |
| + ... |
| + |
| +one line per pinned amd64 package, in the pin's order. A package's source |
| +name and version are its deb's control file's Source field (the package's |
| +own name and version when it has none). |
| + |
| +`check` refuses SOURCES unless it is exactly what the pin's packages give |
| +for every field the pin holds: the header's version and, per line and in |
| +order, package, version, architecture and URL, with a source URL on |
| +snapshot.debian.org. publish-renderer.sh runs it before an upload. |
| +""" |
| +import io |
| +import json |
| +import re |
| +import sys |
| +import tarfile |
| +from urllib.parse import quote |
| + |
| +SNAPSHOT_PACKAGE = "https://snapshot.debian.org/package/" |
| + |
| + |
| +class Refused(Exception): |
| + pass |
| + |
| + |
| +def ar_members(name, deb): |
| + """The members of a deb (an ar archive), by name.""" |
| + if deb[:8] != b"!<arch>\n": |
| + raise Refused("%s: not a deb" % name) |
| + i, members = 8, {} |
| + while i < len(deb): |
| + header = deb[i:i + 60] |
| + if len(header) != 60 or header[58:60] != b"`\n": |
| + raise Refused("%s: a broken ar header" % name) |
| + member = header[:16].decode("ascii", "replace").strip().rstrip("/") |
| + size = int(header[48:58]) |
| + members.setdefault(member, deb[i + 60:i + 60 + size]) |
| + i += 60 + size + (size & 1) |
| + return members |
| + |
| + |
| +def control_of(name, deb): |
| + """The deb's control fields (Package, Version, Source, ...).""" |
| + members = ar_members(name, deb) |
| + modes = {"control.tar": "r:", "control.tar.gz": "r:gz", "control.tar.xz": "r:xz"} |
| + found = [m for m in members if m in modes] |
| + if len(found) != 1: |
| + raise Refused("%s: want one control.tar, .tar.gz or .tar.xz member" % name) |
| + with tarfile.open(fileobj=io.BytesIO(members[found[0]]), mode=modes[found[0]]) as tar: |
| + for m in tar: |
| + if m.name in ("./control", "control") and m.isfile(): |
| + text = tar.extractfile(m).read().decode("utf-8") |
| + break |
| + else: |
| + raise Refused("%s: no control file" % name) |
| + fields, last = {}, None |
| + for line in text.splitlines(): |
| + if line[:1] in (" ", "\t") and last: |
| + continue |
| + key, sep, value = line.partition(":") |
| + if sep: |
| + last = key.strip() |
| + fields[last] = value.strip() |
| + return fields |
| + |
| + |
| +def source_of(p, control): |
| + """(source name, source version) of a pinned package, from its control.""" |
| + if control.get("Package") != p["package"] or control.get("Version") != p["version"]: |
| + raise Refused("%s: its control says %s %s" % (p["package"], control.get("Package"), control.get("Version"))) |
| + m = re.fullmatch(r"([a-z0-9][a-z0-9+.-]*)(?: \(([^()\s]+)\))?", control.get("Source", p["package"])) |
| + if not m: |
| + raise Refused("%s: a Source field %r" % (p["package"], control.get("Source"))) |
| + return m.group(1), m.group(2) or p["version"] |
| + |
| + |
| +def source_url(name, version): |
| + return SNAPSHOT_PACKAGE + quote(name, safe="") + "/" + quote(version, safe="~:+") + "/" |
| + |
| + |
| +def header(pin, chromium_version): |
| + return ("The page renderer: Chromium headless shell %s, from Debian.\n" |
| + "Chromium source: %s\n\n" % (pin["version"], source_url("chromium", chromium_version))) |
| + |
| + |
| +def sources(pin, debs): |
| + """SOURCES for pin's amd64 packages, debs their checked bytes in order.""" |
| + packages = pin["amd64"] |
| + if len(debs) != len(packages): |
| + raise Refused("want one deb per pinned package") |
| + lines, chromium = [], None |
| + for p, deb in zip(packages, debs): |
| + name, version = source_of(p, control_of(p["package"], deb)) |
| + if p["package"] == "chromium-headless-shell": |
| + if name != "chromium": |
| + raise Refused("chromium-headless-shell is built from %s, not chromium" % name) |
| + chromium = version |
| + lines.append(" ".join([p["package"], p["version"], p["architecture"], p["url"], source_url(name, version)])) |
| + if chromium is None: |
| + raise Refused("the pin has no chromium-headless-shell") |
| + return header(pin, chromium) + "\n".join(lines) + "\n" |
| + |
| + |
| +def check(pin, text): |
| + """Refuse SOURCES unless it is what pin's packages give.""" |
| + packages = pin["amd64"] |
| + head, sep, body = text.partition("\n\n") |
| + if not sep or not head.startswith("The page renderer: Chromium headless shell %s, from Debian.\nChromium source: %schromium/" % (pin["version"], SNAPSHOT_PACKAGE)): |
| + raise Refused("SOURCES' header is not the pin's") |
| + rows = body.splitlines() |
| + if len(rows) != len(packages) or not text.endswith("\n"): |
| + raise Refused("SOURCES lists %d packages, the pin %d" % (len(rows), len(packages))) |
| + for p, row in zip(packages, rows): |
| + f = row.split(" ") |
| + if len(f) != 5 or f[:4] != [p["package"], p["version"], p["architecture"], p["url"]] or not f[4].startswith(SNAPSHOT_PACKAGE): |
| + raise Refused("SOURCES' line for %s is not the pin's: %r" % (p["package"], row)) |
| + |
| + |
| +def main(argv): |
| + if len(argv) != 3 or argv[0] != "check": |
| + print(__doc__, file=sys.stderr) |
| + return 2 |
| + with open(argv[1]) as f: |
| + pin = json.load(f) |
| + with open(argv[2], encoding="utf-8") as f: |
| + text = f.read() |
| + try: |
| + check(pin, text) |
| + except Refused as r: |
| + print("renderer-sources: refused: %s" % r, file=sys.stderr) |
| + return 1 |
| + return 0 |
| + |
| + |
| +if __name__ == "__main__": |
| + sys.exit(main(sys.argv[1:])) |
diff --git a/scripts/runner-install-manifest.py b/scripts/runner-install-manifest.py| index 5f825ebc..2246b0da 100644 |
| --- a/scripts/runner-install-manifest.py |
| +++ b/scripts/runner-install-manifest.py |
| @@ -1,6 +1,6 @@ |
| #!/usr/bin/env python3 |
| """Record what one release build produced: the runner and tool proxy digests, |
| -and on Linux the renderer tree's pin. |
| +and on Linux the renderer tree's pin and its archive's digest and size. |
| The source manifest (internal/release/manifest.json, copied into the |
| release directory) pins the programs this repository does not build. This |
| @@ -43,9 +43,13 @@ release["binaries"].append({"name": "equipo-tool-proxy", "version": release["lau |
| # Every platform's runner (Mac runners spec 3.1). The top-level fields |
| # stay the Linux runner's for older bootstraps; a Mac worker's files are |
| # under darwin-arm64/ and it is listed only when they are there. |
| +# The renderer: its tree pin, and the archive's own digest and size (the |
| +# runner fetches it from the forge, not the instance, and checks both). |
| +archive = root / "renderer.tar.gz" |
| targets = {"linux/amd64": {"runner_sha256": digest(root / "equipo-runner"), |
| "tool_proxy_sha256": digest(root / "equipo-tool-proxy"), "gitleaks_sha256": digest(root / "gitleaks"), |
| - "renderer_sha256": renderer_pin(root / "renderer.tar.gz")}} |
| + "renderer_sha256": renderer_pin(archive), |
| + "renderer_archive_sha256": digest(archive), "renderer_archive_size": archive.stat().st_size}} |
| mac = root / "darwin-arm64" |
| if (mac / "equipo-runner").is_file(): |
| targets["darwin/arm64"] = {"runner_sha256": digest(mac / "equipo-runner"), "gitleaks_sha256": digest(mac / "gitleaks")} |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index efad0e55..578b4000 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -15812,13 +15812,6 @@ |
| "count": 2, |
| "reason": "Fable follow-up: pinned runner scanner packaging and existing runtime integration." |
| }, |
| - { |
| - "path": "internal/release/staged_gate_test.go", |
| - "line_sha256": "fb9169abfe7d706c7c0f4d4a42ef768456cfd6be1f1c1ff9da04af0e67a28a72", |
| - "match": "equipo-runner", |
| - "count": 2, |
| - "reason": "Fable follow-up: pinned runner scanner packaging and existing runtime integration." |
| - }, |
| { |
| "path": "docs/api/equipo-v1.openapi.json", |
| "line_sha256": "ce892a21ae5ab451537c7c410dc20804ff36c90b1a497e798bf56151903ce3c3", |
| @@ -22275,7 +22268,7 @@ |
| }, |
| { |
| "path": "internal/equipotest/runner_release_test.go", |
| - "line_sha256": "b4e2946cbbed5bd4883137a4e37953bc05f16ef428c4019d1cda93b4b67890ce", |
| + "line_sha256": "86f45d6c9c3e34447e5c24bc21293ed9de88cc3fc3fabfbafa0824cf57f6a067", |
| "match": "equipo-runner", |
| "count": 2, |
| "reason": "Fable follow-up: pinned runner scanner packaging and existing runtime integration." |
| @@ -22357,13 +22350,6 @@ |
| "count": 3, |
| "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| }, |
| - { |
| - "path": "internal/release/install_assets.go", |
| - "line_sha256": "c8dbe720dff22aba3fe4ba0d6a0e280d824a0c24266344068dc83739a2d2e388", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| { |
| "path": "internal/release/renderer_assets_test.go", |
| "line_sha256": "793696f062e772771c1536cee1c07d79aa404de6e573a9fe87fe87a8fbf3c58c", |
| @@ -22371,13 +22357,6 @@ |
| "count": 1, |
| "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| }, |
| - { |
| - "path": "internal/release/renderer_assets_test.go", |
| - "line_sha256": "9370c39559592bf4e9d27e65094c3822a10982811e65971536d54a0a7d4ae725", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| { |
| "path": "internal/release/renderer_assets_test.go", |
| "line_sha256": "a7c6f0d0fccc139c3a24dcdef8c391bc4029b2a5ee6afa9958f4b49f5f1a912b", |
| @@ -22385,20 +22364,6 @@ |
| "count": 1, |
| "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| }, |
| - { |
| - "path": "internal/release/renderer_assets_test.go", |
| - "line_sha256": "df34cc4089b8428d633fca94405d1e002ed8f6bbbcdbe158e139a05466fa1298", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| - { |
| - "path": "internal/release/renderer_assets_test.go", |
| - "line_sha256": "e15a665cf2a0e2e2a46c038cbd1ac1b78cd941dff69462a05fc68c6e03b03a9c", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| { |
| "path": "internal/release/renderer_scripts_test.go", |
| "line_sha256": "12b6510ce8fbbe65cc5ab76d99e21b3a4f7b61664ac56401cc2f67e0e2d9ef3e", |
| @@ -22455,13 +22420,6 @@ |
| "count": 1, |
| "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| }, |
| - { |
| - "path": "scripts/build-instance-release.sh", |
| - "line_sha256": "530a58ef9d90985f55337003d8187d629df9d63e3b70ed347faca8c12311cdc0", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| { |
| "path": "scripts/cutover-finish-thin.sh", |
| "line_sha256": "12260be6ca928cae632e2bdf2195fe44fc00e11cf2ee2680ed7e01c217e839be", |
| @@ -22518,20 +22476,6 @@ |
| "count": 1, |
| "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| }, |
| - { |
| - "path": "scripts/staging-thin.py", |
| - "line_sha256": "0c8c2cb081a78882e8678e89719608f8bd2572afa6fee63aa74ed896816545ea", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| - { |
| - "path": "scripts/staging-thin-test.py", |
| - "line_sha256": "4bfdbdfc446082debb3015067a44f748edd0f28daef7b17b00d2750f99686612", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| - }, |
| { |
| "path": "scripts/upgrade-thin.sh", |
| "line_sha256": "12260be6ca928cae632e2bdf2195fe44fc00e11cf2ee2680ed7e01c217e839be", |
| @@ -22972,5 +22916,82 @@ |
| "match": "equipo-runner", |
| "count": 1, |
| "reason": "Dynamic specialists slice 1 task 21: a fake page renderer's launch configuration naming the retained runner executable path; test data, no new runtime dependency." |
| + }, |
| + { |
| + "path": "internal/release/install_assets.go", |
| + "line_sha256": "5b1c39eda80a58debe54efeb61a6c7a6bb813ce7b0af92beccadfbab3a1f9e25", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Runner executable/package or user-service identifier, retained for direct-launch installation and fixture verification." |
| + }, |
| + { |
| + "path": "internal/release/renderer_assets_test.go", |
| + "line_sha256": "69a8b1718538bced6e549a102692542313a22b070998f3f67ef416454535bbee", |
| + "match": "equipo-runner", |
| + "count": 2, |
| + "reason": "Dynamic specialists slice 1 task 7: the page renderer the release ships beside the runner, installed by install-renderer and checked by verify-installed." |
| + }, |
| + { |
| + "path": "internal/release/staged_gate_test.go", |
| + "line_sha256": "f8bdb3b512fe2af1ed226715b7243666f1cdfed264e316e899f56ac4ac19d383", |
| + "match": "equipo-runner", |
| + "count": 2, |
| + "reason": "Staged-artifact gate test: the released runner binary path it hashes." |
| + }, |
| + { |
| + "path": "scripts/build-instance-release.sh", |
| + "line_sha256": "773bdf97410e36ff1f295fc71b95c17cb3601f95631211612bcfae4e3cbbdb0a", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Fable follow-up: pinned runner scanner packaging and existing runtime integration." |
| + }, |
| + { |
| + "path": "scripts/publish-renderer.sh", |
| + "line_sha256": "8c1a066495582cbbee487c6d7468ed3a2c853ad25b8c5b9b7378d1128a0d6200", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Retained runner executable name in the page renderer's forge publish and check tooling (renderer out of the instance)." |
| + }, |
| + { |
| + "path": "scripts/publish-renderer.sh", |
| + "line_sha256": "b771102631e53880ef59b2b7205148676c212391cb91e5c794edd1ca262107ff", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Retained runner executable name in the page renderer's forge publish and check tooling (renderer out of the instance)." |
| + }, |
| + { |
| + "path": "scripts/publish-renderer.sh", |
| + "line_sha256": "cacb0ce3596424430de2771a2d6d6aa1a687c9c9306bf05d25cc62d8cadb5942", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Retained runner executable name in the page renderer's forge publish and check tooling (renderer out of the instance)." |
| + }, |
| + { |
| + "path": "scripts/publish-renderer.sh", |
| + "line_sha256": "cf0796fdf91edec6029f0a07a86f04e9cab0b99b79254079ff5d8ad570bb7c2e", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Retained runner executable name in the page renderer's forge publish and check tooling (renderer out of the instance)." |
| + }, |
| + { |
| + "path": "scripts/staging-thin-test.py", |
| + "line_sha256": "d826390cf4d2c3ab7ab319feb717288f089b85e4094c442cef5e22485d560162", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Staging release test: a fake runner release's file names, to check the preview scanner is installed beside the runner and held to its digest." |
| + }, |
| + { |
| + "path": "scripts/staging-thin.py", |
| + "line_sha256": "fddde0e2f585d9e093820469ffab1aa5816335cdfbd269c335d0c8ba8e78f9f3", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Thin v1 staging gate: the staging runner unit, its state root, the production runner config it reads binary paths from, and the runner binary it builds (spec 7)." |
| + }, |
| + { |
| + "path": "internal/release/renderer_publish_test.go", |
| + "line_sha256": "e74344059d1838d9fd75c02f56ce7302b73664f34724116d22babc53c79c240d", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Retained runner executable name in the page renderer's forge publish and check tooling (renderer out of the instance)." |
| } |
| ] |
diff --git a/scripts/staged-artifacts.py b/scripts/staged-artifacts.py| index 44cbe6fc..eb725810 100755 |
| --- a/scripts/staged-artifacts.py |
| +++ b/scripts/staged-artifacts.py |
| @@ -17,7 +17,10 @@ binary says it was built from that commit, unmodified (go version -m: |
| vcs.revision, vcs.modified=false), and the runner release agrees with |
| itself: the tool proxy the release manifest records and the runner |
| digests in the install manifest are the bytes on disk, and the renderer |
| -pin it records is the MANIFEST of the renderer.tar.gz beside them. |
| +pin it records is the MANIFEST of the renderer.tar.gz beside them, whose |
| +digest and size it records too. The renderer archive, its SOURCES and the |
| +install manifest are hashed with the binaries (they are not built from |
| +the commit, so they are not asked for build information). |
| `verify` recomputes every hash and refuses unless the artifacts are the |
| ones the provenance manifest names, at the commit it names. |
| @@ -50,9 +53,22 @@ def artifacts(version, instance=None): |
| # Both targets (Mac runners spec 3.1): the Mac worker's bytes are |
| # part of what production receives. |
| 'darwin_runner': runner / 'darwin-arm64' / 'equipo-runner', |
| + # Not binaries: the renderer archive and SOURCES the forge release |
| + # publishes (the runner fetches the archive there, not from the |
| + # instance), and the install manifest the instance embeds, which |
| + # names the archive. Frozen here, so neither can change after |
| + # staging while the instance keeps the original. |
| + 'renderer_archive': runner / 'renderer.tar.gz', |
| + 'renderer_sources': runner / 'SOURCES', |
| + 'install_manifest': runner / 'install-manifest.json', |
| } |
| +# The artifacts that are files, not Go binaries: hashed, never asked for |
| +# build information. |
| +NOT_BINARIES = ('renderer_archive', 'renderer_sources', 'install_manifest') |
| + |
| + |
| def digests(version, instance=None): |
| out = {} |
| for name, path in artifacts(version, instance).items(): |
| @@ -119,7 +135,9 @@ def self_consistent(version, sums, commit): |
| and install['gitleaks'] == 'v8.30.1' |
| and install['runner_sha256'] == sums['runner'] |
| and targets['linux/amd64'] == {'runner_sha256': sums['runner'], 'tool_proxy_sha256': sums['tool_proxy'], 'gitleaks_sha256': sums['gitleaks'], |
| - 'renderer_sha256': renderer_pin(runner / 'renderer.tar.gz')} |
| + 'renderer_sha256': renderer_pin(runner / 'renderer.tar.gz'), |
| + 'renderer_archive_sha256': sums['renderer_archive'], |
| + 'renderer_archive_size': (runner / 'renderer.tar.gz').stat().st_size} |
| and targets['darwin/arm64'] == {'runner_sha256': sums['darwin_runner'], 'gitleaks_sha256': sums['darwin_gitleaks']} |
| and (runner / 'COMMIT').read_text().strip() == commit), release |
| except (OSError, ValueError, KeyError, TypeError, tarfile.TarError): |
| @@ -164,6 +182,8 @@ def main(): |
| print(f'refused: the {version} runner release does not name its own bytes', file=sys.stderr) |
| return 1 |
| for name, path in artifacts(version, instance).items(): |
| + if name in NOT_BINARIES: |
| + continue |
| if not (scanner_from_pin(path) if name in ('gitleaks', 'darwin_gitleaks') else built_from(path, commit)): |
| print(f'refused: the {name} binary does not say it was built from {commit}, unmodified', file=sys.stderr) |
| return 1 |
diff --git a/scripts/staging-thin-test.py b/scripts/staging-thin-test.py| index 503cd4aa..04eb9d84 100644 |
| --- a/scripts/staging-thin-test.py |
| +++ b/scripts/staging-thin-test.py |
| @@ -336,9 +336,11 @@ class ReleaseTest(unittest.TestCase): |
| self.assertTrue(os.access(scanner, os.X_OK)) |
| def test_build_installs_the_renderer_beside_the_runner(self): |
| - # The staged runner unpacks the release's renderer.tar.gz beside |
| - # itself (install-renderer); verify-installed then checks the tree |
| - # and renders the fixture page with it. |
| + # The published renderer is downloaded in full and held to the |
| + # release (publish-renderer.sh check), after provenance and before |
| + # anything is installed; the staged runner unpacks that download |
| + # beside itself (install-renderer); verify-installed then checks |
| + # the tree and renders the fixture page with it. |
| with scratch() as folder: |
| repo, root = Path(folder) / 'repo', Path(folder) / 'root' |
| built = self.release(repo, 'abc1234') |
| @@ -349,11 +351,16 @@ class ReleaseTest(unittest.TestCase): |
| patch.object(staging, 'run', return_value='') as run: |
| staging.build() |
| calls = [c.args[0] for c in run.call_args_list] |
| - install = [str(root / 'releases/abc1234/equipo-runner'), 'install-renderer', str(built / 'renderer.tar.gz')] |
| + published = root / 'releases/abc1234/published-renderer' |
| + check = ['scripts/publish-renderer.sh', 'check', str(built), str(published)] |
| + install = [str(root / 'releases/abc1234/equipo-runner'), 'install-renderer', str(published / 'renderer.tar.gz')] |
| + self.assertIn(check, calls) |
| self.assertIn(install, calls) |
| - # After the provenance check, which holds the runner to the release. |
| + # After the provenance check, which holds the runner to the |
| + # release, and the published asset's check. |
| verify = ['python3', 'scripts/staged-artifacts.py', 'verify', 'abc1234'] |
| - self.assertLess(calls.index(verify), calls.index(install)) |
| + self.assertLess(calls.index(verify), calls.index(check)) |
| + self.assertLess(calls.index(check), calls.index(install)) |
| def test_provenance_holds_the_scanner_to_the_release(self): |
| with scratch() as folder: |
diff --git a/scripts/staging-thin.py b/scripts/staging-thin.py| index 3775a114..c5b8f061 100755 |
| --- a/scripts/staging-thin.py |
| +++ b/scripts/staging-thin.py |
| @@ -204,10 +204,19 @@ def build(): |
| for name in ('equipo-runner', 'equipo-tool-proxy', 'gitleaks'): |
| shutil.copy2(release / name, runner / name) |
| provenance(sha) |
| - # And the page renderer beside it, unpacked by the staged runner from |
| - # the release's archive and held to the pin linked into it (both |
| - # staging runners use it); verify-installed renders a page with it. |
| - run([str(runner / 'equipo-runner'), 'install-renderer', str(release / 'renderer.tar.gz')]) |
| + # The page renderer as users get it: published on the forge under the |
| + # tag linked into the runner (scripts/publish-renderer.sh publish). |
| + # Downloaded in full, without credentials (never a HEAD: the forge |
| + # counts a redirect as a download), and required to be the release's |
| + # bytes, which provenance just held to the build. A release whose |
| + # renderer is not published stops here, before staging installs |
| + # anything, so production cannot ship without it. |
| + published = runner / 'published-renderer' |
| + run(['scripts/publish-renderer.sh', 'check', str(release), str(published)], timeout=2400) |
| + # Unpacked by the staged runner from that download and held to the pin |
| + # linked into it (both staging runners use it); verify-installed |
| + # renders a page with it. |
| + run([str(runner / 'equipo-runner'), 'install-renderer', str(published / 'renderer.tar.gz')]) |
| print(f'built {sha}: {instance_binary(sha)} and {runner}') |
| return sha |