oficina / equipo Public

renderer: VerifyRenderer checks an installed tree is exactly the pinned one

What changed
- internal/release/renderer_verify.go: VerifyRenderer(dir, pin) and its
  typed result. *RendererError carries Health (wire.ToolMissing,
  ToolMismatch, ToolUnpinned), the entry Path and a Reason; it unwraps to
  ErrRendererMissing / ErrRendererMismatch / ErrRendererUnpinned.
  RendererHealth(err) maps a result to ok/missing/mismatch/unpinned, and
  any unknown error to mismatch. A strict MANIFEST parser: one-space
  fields, newline-terminated, UTF-8, sorted by path with no duplicates,
  parents listed as dirs, clean relative paths, lower-case SHA-256, 4-digit
  modes with no 022 or setuid/setgid/sticky bits, and relative link targets
  that resolve inside the tree (mirroring the build script's resolver).
- renderer_verify_linux.go: the walk. It works from the tree's directory
  fd one name at a time (fstatat AT_SYMLINK_NOFOLLOW, then openat with
  O_NOFOLLOW, readlinkat). A non-regular entry is never opened, and files
  are opened O_NONBLOCK. Order: pin (unpinned before any disk read), root
  (ENOENT is missing; a link or non-dir is mismatch), then MANIFEST
  (fstatat says a regular file; then safe; at most 16 MiB; sha256 == pin;
  then parsed). Then every entry: type as listed, file mode exact, hash,
  link target byte-exact, nothing unlisted, nothing missing. The root,
  MANIFEST and every dir and file must be owned by this euid or root,
  not group or world writable, and files must have one name (nlink 1).
- renderer_verify_other.go: !linux reports missing.
- scripts/build-renderer-tree.py: --tree chmods MANIFEST to 0644. It was
  written with the umask's mode, 0664 under umask 002, which the
  verifier refuses.
- renderer_tree_test.go: the script runs under umask 002 with python -B.
  The umask makes the contract test catch umask-dependent modes. -B stops
  -I (which ignores PYTHONDONTWRITEBYTECODE) from writing a .pyc next to
  the script.

Tests
  CGO_ENABLED=0 go test ./internal/release/ -run 'TestParseRendererManifest|TestRendererHealth|TestVerifyRenderer' -count=1
  CGO_ENABLED=0 go test ./internal/release/ -count=1          ok 12.8s
  darwin/arm64 runner build and vet gates                     ok
  rastrillo budget size; scripts/ci-test.py check             ok

RED: first a compile failure (undefined VerifyRenderer etc). Then a
skeleton that accepts everything: TestParseRendererManifestRefuses failed
all 42 cases, TestVerifyRendererRefuses all 28, and RendererHealth,
Unpinned and MissingTree failed too. On the first real run, the contract
test TestVerifyRendererAcceptsTheBuiltTree failed with "MANIFEST: is group
or world writable (0664)". That was the script bug fixed above.

GREEN: all of the above pass.

Mutations (54; guard broken -> test that failed; each restored and
checksummed). Refusal tests assert the entry and the reason, so a guard
shadowed by another layer still shows.
- pin compare -> MANIFEST_swapped_with_a_matching_tree
- unpinned check -> TestVerifyRendererUnpinned
- file hash -> tampered_byte
- unlisted name -> extra_file/_at_the_root/_directory/_fifo
- missing sweep -> missing_file/_directory/_link
- link target -> link_retargeted
- exact mode -> mode_changed, setuid_added
- 022 check -> mode_widened, directory_group_writable, sticky 1777,
  root_group_writable, MANIFEST_group_writable
- owner -> owned_by_another_user
- nlink -> file_hard_linked_from_outside
- kind compare -> every replaced_by case
- fstatat follows -> replaced-by-link cases; also with dir or file openat
  following -> killed
- root O_NOFOLLOW -> root_a_link_to_the_pinned_tree
- root/subdir/MANIFEST/file safe calls -> their writable/owner/nlink cases
- fifo routed as a file -> file_replaced_by_a_fifo (open+fstat catches
  it); also with a blocking open -> the test hangs (20s timeout)
- MANIFEST type pre-check -> MANIFEST_a_fifo, MANIFEST_a_link; also with a
  blocking open -> hangs
- MANIFEST O_NOFOLLOW alone: SURVIVED, by design (the fstatat pre-check
  refuses the link first); with the pre-check also removed -> killed
- ENOENT is missing -> MissingTree; clean path -> MissingTree
- pinned MANIFEST parsed -> RefusesAPinnedBadManifest; 16 MiB cap -> same
- RendererHealth fallback, Unwrap sentinel -> Health and every refusal
- parser: UTF-8, final newline, SHA-256, mode, 022, leading 0, absolute
  target, field count, unknown kind, path parts, MANIFEST name, DEL,
  control, white space (U+00A0), empty field, strict sort, sort,
  parent-is-dir, links resolved, climb-out (panic), names nothing,
  through a non-dir, intermediate links -> each named refusal case
- script --tree MANIFEST chmod -> TestVerifyRendererAcceptsTheBuiltTree
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4c0d8440565027e4acd4ebc85fa1a4302730756c parent 09a7006
7 files changed, +1,043 −2
  • internal/release/renderer_manifest_test.go +157 −0
  • internal/release/renderer_tree_test.go +3 −1
  • internal/release/renderer_verify.go +278 −0
  • internal/release/renderer_verify_linux.go +252 −0
  • internal/release/renderer_verify_linux_test.go +337 −0
  • internal/release/renderer_verify_other.go +11 −0
  • scripts/build-renderer-tree.py +5 −1

CI failed — 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/specialists-slice-1: 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.4s
ci-box: codex: fetched and verified in 4.4s
ci-box: codex-code-mode-host: fetched and verified in 1.5s
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.9s
ci-box: pi: installed and verified in 7.2s
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.7s
ci-box: clone deepened in 5.1s
ci-box: file times set from content: 3296 files, 213 directories
ci-box: ready in 19.5s
=== 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.148s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  5.5s
+ go list -export -test -tags testbuild -f  ./...
  5.2s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.6s
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 1m19.443s 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 1m17.352s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m17.35s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 56.47, cpu waiting 37.84%, memory waiting 0.00%, io waiting 0.41%
--- 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 1m19.149s 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 1m17.13s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m17.13s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 56.47, cpu waiting 37.84%, memory waiting 0.00%, io waiting 0.41%
--- 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 1m18.949s 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 1m17.124s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m7.46s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.29s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.38s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 56.47, cpu waiting 37.84%, memory waiting 0.00%, io waiting 0.41%
--- 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

receipt: test step 1m17.863s 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 1m15.865s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.71s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 18.92s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 56.47, cpu waiting 37.84%, memory waiting 0.00%, io waiting 0.41%
--- 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 1m35.243s 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 1m33.306s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m3.3s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.58s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.26s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.31s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.85s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 52.07, cpu waiting 36.13%, memory waiting 0.00%, io waiting 0.30%
--- 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 2m57.961s 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 2m56.057s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m39.64s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.37s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.2s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.72s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 23.11, cpu waiting 10.82%, memory waiting 0.00%, io waiting 0.07%
--- 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 2m15.052s 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 2m13.165s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 10.03s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.73s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.01s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 4.01s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.62s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 33.98, cpu waiting 21.19%, memory waiting 0.00%, io waiting 0.15%
--- 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 1m57.482s 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 1m55.623s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.56s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.06s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.95s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.56s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.01s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 42.83, cpu waiting 25.96%, memory waiting 0.00%, io waiting 0.21%
--- 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
budget note: internal/runner/thin took 5m12.632s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 5m18.309s 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 5m12.632s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.02s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.87s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.8s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.48s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 9.94s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
machine: 32 CPUs, load 3.91, cpu waiting 1.04%, memory waiting 0.00%, io waiting 0.00%
--- 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.163s 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.179s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.15s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 56.23, cpu waiting 33.80%, memory waiting 0.00%, io waiting 0.64%
--- 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 1m0.168s 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 59.013s amadan.net/oficina/equipo/internal/runner
receipt: slow test 49s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 44.07s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.41s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.59s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 57.49, cpu waiting 37.31%, memory waiting 0.00%, io waiting 0.56%
--- 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

receipt: test step 36.777s 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 35.923s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.6s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.35s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.14s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 39.16, cpu waiting 21.29%, memory waiting 0.00%, io waiting 0.84%
--- 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 40.6%, load 32.65
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
--- FAIL amadan.net/oficina/equipo/internal/equipotest TestDirectDeadReferencesRepository
=== RUN   TestDirectDeadReferencesRepository
    direct_cutover_test.go:221: repository reference inventory: exit status 1
        docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1.md:109:5: unclassified equipo-runner
        docs/superpowers/plans/CONTROLLER-BRIEF-specialists-slice-1.md:84:25: unclassified Paseo
        docs/superpowers/specs/2026-11-28-dynamic-specialists.md:224:15: unclassified equipo-runner
        reference scan: 3008 text files, 3232 matches, 3 failures
--- FAIL: TestDirectDeadReferencesRepository (2.35s)

--- FAIL amadan.net/oficina/equipo/internal/equipotest (package output)
FAIL
rastrillo-budget/v1 ran 1m6.791s
FAIL	amadan.net/oficina/equipo/internal/equipotest	67.204s


receipt: test step 1m8.917s 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 1m6.791s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 28.48s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 28.34s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 26.19s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 23.44s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 23.28s amadan.net/oficina/equipo/internal/equipotest TestAuthorityUsesLiveRoster
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' -v -run '^TestDirectDeadReferencesRepository$' -count=1 ./internal/equipotest   (retry, once)
FAILED TWICE ./internal/equipotest:TestDirectDeadReferencesRepository equipotest-a
=== RUN   TestDirectDeadReferencesRepository
    direct_cutover_test.go:221: repository reference inventory: exit status 1
        docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1.md:109:5: unclassified equipo-runner
        docs/superpowers/plans/CONTROLLER-BRIEF-specialists-slice-1.md:84:25: unclassified Paseo
        docs/superpowers/specs/2026-11-28-dynamic-specialists.md:224:15: unclassified equipo-runner
        reference scan: 3008 text files, 3232 matches, 3 failures
--- FAIL: TestDirectDeadReferencesRepository (2.24s)
FAIL
rastrillo-budget/v1 ran 2.239s
FAIL	amadan.net/oficina/equipo/internal/equipotest	2.402s
FAIL
machine: 32 CPUs, load 48.86, cpu waiting 33.23%, memory waiting 0.00%, io waiting 0.27%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 12 of 29 failed: exit status 2
--- 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 40.6%, load 26.96
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 2m15.318s 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 2m13.271s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 22.36s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 22.36s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 22.28s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 22.26s amadan.net/oficina/equipo/internal/equipotest TestProjectKindsAndDefaultBranch
receipt: slow test 22.26s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
machine: 32 CPUs, load 27.99, cpu waiting 13.66%, 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.6%, load 26.96
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 5m33.399s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI

receipt: test step 5m38.939s 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 5m33.399s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m41.61s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.25s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.23s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.2s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.13s amadan.net/oficina/equipo/internal/equipotest TestRosterProtectsLastOwner
machine: 32 CPUs, load 2.25, cpu waiting 0.45%, 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.6%, load 26.96
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 1m9.801s 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 1m7.858s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.91s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 25.85s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 25.82s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.93s amadan.net/oficina/equipo/internal/equipotest TestSigninBackgroundSweep
receipt: slow test 23.92s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 48.86, cpu waiting 34.25%, memory waiting 0.00%, io waiting 0.28%
--- 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 40.6%, load 26.96
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 55.828s 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 53.545s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.92s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.67s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.34s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorMessageSourcesUpgrade
machine: 32 CPUs, load 54.19, cpu waiting 37.61%, memory waiting 0.00%, io waiting 0.36%
--- 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.6%, load 32.65
test lane rest: ./cmd/equipo ./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/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./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/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/websource ./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-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/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./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/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/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: 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/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 2m22.691s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 25.869s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.581s, 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 13.668s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m53.218s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 37.199s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 58.24s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 22.771s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 13.871s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m30.378s against a 60s target (the gate's other steps are not in this figure)
receipt: 28 packages ran, 41 cached, 16 without tests, 0 failed
receipt: slow package 2m22.691s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m53.218s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m7.216s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 58.24s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 53.241s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow test 56.27s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 48.39s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 47.38s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 47.19s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 46.33s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
machine: 32 CPUs, load 21.50, cpu waiting 10.12%, memory waiting 0.00%, io waiting 0.06%
--- 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

receipt: test step 1m25.805s 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 1m24.034s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.97s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.73s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.43s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.24s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.82s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 54.19, cpu waiting 37.61%, memory waiting 0.00%, io waiting 0.36%
--- 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 1m32.32s 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 1m30.452s amadan.net/oficina/equipo/internal/headless
receipt: slow test 28.79s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.02s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.42s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.5s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 8.99s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 53.29, cpu waiting 36.75%, memory waiting 0.00%, io waiting 0.31%
--- 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 1m53.534s 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 1m51.646s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.74s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.3s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.51s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.21s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.12s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 43.25, cpu waiting 27.57%, memory waiting 0.00%, io waiting 0.22%
--- 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-28T17:33:23.204Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T17:33:23.205Z level=INFO msg="startup phase done" phase=state_lock took=272µs
time=2026-11-28T17:33:23.205Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T17:33:23.205Z level=INFO msg="startup phase done" phase=claim_roots took=180µs
time=2026-11-28T17:33:23.205Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T17:33:23.260Z level=INFO msg="startup phase done" phase=sweep took=54.982ms
time=2026-11-28T17:33:23.260Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T17:33:23.260Z level=INFO msg="startup phase done" phase=credentials took=124µs
time=2026-11-28T17:33:23.260Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T17:33:23.328Z level=INFO msg="startup phase done" phase=open_state took=67.595ms
time=2026-11-28T17:33:23.329Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T17:33:23.331Z level=INFO msg=connecting host=127.0.0.1:38435 protocol=35
time=2026-11-28T17:33:23.333Z level=INFO msg=connected host=127.0.0.1:38435 took=1.048ms
time=2026-11-28T17:33:23.334Z level=INFO msg="capabilities gathering"
time=2026-11-28T17:33:23.338Z level=INFO msg="capabilities gathered" took=4.119ms tags=linux,claude,go
time=2026-11-28T17:33:23.339Z level=INFO msg="hello sent" protocol=35
time=2026-11-28T17:33:23.344Z level=INFO msg=welcome protocol=35 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.48s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m39.71s
FAIL	amadan.net/oficina/equipo/internal/headless	99.902s


receipt: test step 1m41.313s 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 1m39.71s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.9s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 13.19s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.38s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.38s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.5s 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 4c0d8440565027e4acd4ebc85fa1a4302730756c 6.48s 48.86
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 46.23, cpu waiting 31.25%, memory waiting 0.00%, io waiting 0.25%
--- 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.485s 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.527s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.86s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 660ms 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.029s 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.326s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.33s 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.475s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 13.053s 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.475s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 9.33s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.15s 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 3.982s 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.323s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.32s 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|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 3m34.697s 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 3m31.845s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 25.15s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.41s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.08s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.71s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.13s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 8.51, cpu waiting 3.48%, memory waiting 0.00%, io waiting 0.01%
--- 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   (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.58s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.24s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.90s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.25s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.14s
+ 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   (57s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 13.84s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.30s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.50s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 18.06s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (22s)
ok ./internal/headless TestMixedVersions 19.68s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.84s
+ 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 59.01, cpu waiting 36.71%, memory waiting 0.00%, io waiting 0.58%
--- 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 12.768s 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.358s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 188ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 74ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.77s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 350ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 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.227s 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.252s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
machine: 32 CPUs, load 17.88, cpu waiting 10.44%, memory waiting 0.00%, io waiting 1.14%
--- 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 40.6%, load 32.65
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1.md:109:5: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-specialists-slice-1.md:84:25: unclassified Paseo
docs/superpowers/specs/2026-11-28-dynamic-specialists.md:224:15: unclassified equipo-runner
reference scan: 3008 text files, 3232 matches, 3 failures
make[1]: *** [Makefile:238: runner-dead-references] Error 1
machine: 32 CPUs, load 32.65, cpu waiting 17.69%, memory waiting 0.00%, io waiting 0.90%
make: *** [Makefile:113: ci-shard] Error 2

amadan: step check shard 25 of 29 failed: exit status 2
--- 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 40.6%, load 26.96
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 56.23, cpu waiting 33.80%, memory waiting 0.00%, io waiting 0.64%
--- 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 40.6%, load 32.65
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 56.23, cpu waiting 35.14%, 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 40.6%, load 26.96
shard 28: make gitleaks
5:33PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
5:33PM INF 1270 commits scanned.
5:33PM INF scanned ~68960274 bytes (68.96 MB) in 24.5s
5:33PM INF no leaks found
machine: 32 CPUs, load 56.23, cpu waiting 35.14%, memory waiting 0.00%, io waiting 0.62%

amadan: job failed at step check shards 12, 25 of 29 — its output is above, not at the tail of this log
diff --git a/internal/release/renderer_manifest_test.go b/internal/release/renderer_manifest_test.go
new file mode 100644
index 00000000..0dbe2bdd
--- /dev/null
+++ b/internal/release/renderer_manifest_test.go
@@ -0,0 +1,157 @@
+package release
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+const manifestSum = "ab0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd"
+
+// A MANIFEST the build wrote: dir, file and link lines sorted by path,
+// every parent listed before its children, links resolving inside the
+// tree (through other links too).
+func TestParseRendererManifest(t *testing.T) {
+ text := "dir etc\n" +
+ "dir etc/fonts\n" +
+ "link etc/fonts/f.conf ../../usr/share/f.conf\n" +
+ "dir usr\n" +
+ "dir usr/bin\n" +
+ "link usr/bin/browser ../lib/browser\n" +
+ "link usr/bin/via ./../bin/browser\n" +
+ "dir usr/lib\n" +
+ "file usr/lib-extra " + manifestSum + " 0644\n" +
+ "file usr/lib/browser " + manifestSum + " 0755\n" +
+ "link usr/lib/up ..\n" +
+ "dir usr/share\n" +
+ "file usr/share/f.conf " + manifestSum + " 0644\n"
+ got, err := parseRendererManifest([]byte(text))
+ if err != nil {
+ t.Fatal(err)
+ }
+ want := map[string]rendererEntry{
+ "etc": {kind: "dir"},
+ "etc/fonts": {kind: "dir"},
+ "etc/fonts/f.conf": {kind: "link", target: "../../usr/share/f.conf"},
+ "usr": {kind: "dir"},
+ "usr/bin": {kind: "dir"},
+ "usr/bin/browser": {kind: "link", target: "../lib/browser"},
+ "usr/bin/via": {kind: "link", target: "./../bin/browser"},
+ "usr/lib": {kind: "dir"},
+ "usr/lib-extra": {kind: "file", sha256: manifestSum, mode: 0o644},
+ "usr/lib/browser": {kind: "file", sha256: manifestSum, mode: 0o755},
+ "usr/lib/up": {kind: "link", target: ".."},
+ "usr/share": {kind: "dir"},
+ "usr/share/f.conf": {kind: "file", sha256: manifestSum, mode: 0o644},
+ }
+ if fmt.Sprint(got) != fmt.Sprint(want) {
+ t.Fatalf("parsed\n%v\nwant\n%v", got, want)
+ }
+ if got, err := parseRendererManifest(nil); err != nil || len(got) != 0 {
+ t.Fatalf("empty MANIFEST: %v %v", got, err)
+ }
+}
+
+// Anything the build would not have written is refused: the MANIFEST is
+// read strictly, never guessed at.
+func TestParseRendererManifestRefuses(t *testing.T) {
+ file := func(path, mode string) string { return "file " + path + " " + manifestSum + " " + mode + "\n" }
+ for name, c := range map[string]struct{ text, why string }{
+ "unknown kind": {"dir usr\nfifo usr/p\n", "unknown kind"},
+ "no kind": {"usr\n", "not an entry"},
+ "dir with a field more": {"dir usr x\n", "wrong number of fields"},
+ "file with a field less": {"dir usr\nfile usr/a " + manifestSum + "\n", "wrong number of fields"},
+ "file with a field more": {"dir usr\nfile usr/a " + manifestSum + " 0644 x\n", "wrong number of fields"},
+ "empty link target": {"dir usr\nlink usr/a \n", "not a relative link target"},
+ "link with no target": {"dir usr\nlink usr/a\n", "wrong number of fields"},
+ "two spaces": {"dir usr\nfile usr/a " + manifestSum + " 0644\n", "wrong number of fields"},
+ "upper-case hash": {"dir usr\n" + file("usr/a", "0644")[:len("file usr/a ")] + strings.ToUpper(manifestSum) + " 0644\n", "not a SHA-256"},
+ "short hash": {"dir usr\nfile usr/a abcd 0644\n", "not a SHA-256"},
+ "three-digit mode": {"dir usr\n" + file("usr/a", "644"), "not a mode"},
+ "group-writable mode": {"dir usr\n" + file("usr/a", "0664"), "not a mode"},
+ "world-writable mode": {"dir usr\n" + file("usr/a", "0646"), "not a mode"},
+ "setuid mode": {"dir usr\n" + file("usr/a", "4755"), "not a mode"},
+ "not octal": {"dir usr\n" + file("usr/a", "0855"), "not a mode"},
+ "duplicate": {"dir usr\ndir usr\n", "not sorted"},
+ "unsorted": {"dir usr\ndir etc\n", "not sorted"},
+ "absolute path": {"dir /usr\n", "not a clean relative path"},
+ "dot-dot path": {"dir usr\ndir usr/..\n", "not a clean relative path"},
+ "dot-dot inside": {"dir usr\ndir usr/../etc\n", "not a clean relative path"},
+ "dot path": {"dir usr\ndir usr/.\n", "not a clean relative path"},
+ "leading dot": {"dir ./usr\n", "not a clean relative path"},
+ "empty component": {"dir usr\ndir usr//lib\n", "not a clean relative path"},
+ "trailing slash": {"dir usr/\n", "not a clean relative path"},
+ "empty path": {"dir \n", "not a clean relative path"},
+ "no-break space in a path": {"dir usr\u00a0lib\n", "not a clean relative path"},
+ "tab in a path": {"dir usr\tlib\n", "not a clean relative path"},
+ "control character": {"dir usr\x01\n", "not a clean relative path"},
+ "delete character": {"dir usr\x7f\n", "not a clean relative path"},
+ "not UTF-8": {"dir usr\xff\n", "not UTF-8"},
+ "carriage return": {"dir usr\r\n", "not a clean relative path"},
+ "no final newline": {"dir usr", "does not end in a newline"},
+ "empty line": {"dir usr\n\ndir usr/lib\n", "not an entry"},
+ "lists itself": {"file MANIFEST " + manifestSum + " 0644\n", "not a clean relative path"},
+ "parent not listed": {"dir usr/lib\n", "its directory is not listed"},
+ "parent is a file": {file("usr", "0644") + "dir usr/lib\n", "its directory is not listed"},
+ "parent is a link": {"dir etc\nlink usr etc\ndir usr/lib\n", "its directory is not listed"},
+ "absolute link target": {"dir usr\nlink usr/a /usr\n", "not a relative link target"},
+ "link climbing out": {"dir usr\nlink usr/a ../../etc\n", "climbs out of the tree"},
+ "link names nothing": {"dir usr\nlink usr/a nothing\n", "names nothing in the tree"},
+ "link through a file": {"dir usr\n" + file("usr/f", "0644") + "link usr/l f/x\n", "is not a directory"},
+ "link through a link out": {"dir usr\nlink usr/out up/../..\nlink usr/up ..\n", "climbs out of the tree"},
+ "link loop": {"dir usr\nlink usr/a b\nlink usr/b a\n", "too many links"},
+ "link target with a tab": {"dir usr\nlink usr/a \tusr\n", "not a relative link target"},
+ } {
+ t.Run(name, func(t *testing.T) {
+ got, err := parseRendererManifest([]byte(c.text))
+ if err == nil {
+ t.Fatalf("accepted %q: %v", c.text, got)
+ }
+ if !strings.Contains(err.Error(), c.why) {
+ t.Fatalf("refused %q for another reason: %v (want %q)", c.text, err, c.why)
+ }
+ })
+ }
+}
+
+// The runner maps a verification to a health state: ok, missing (no tree
+// installed), mismatch (a tree that is not the pinned one) or unpinned
+// (nothing to check against).
+func TestRendererHealth(t *testing.T) {
+ for _, c := range []struct {
+ err error
+ want string
+ is error
+ }{
+ {nil, wire.ToolHealthy, nil},
+ {&RendererError{Health: wire.ToolMissing}, wire.ToolMissing, ErrRendererMissing},
+ {&RendererError{Health: wire.ToolMismatch, Path: "usr"}, wire.ToolMismatch, ErrRendererMismatch},
+ {&RendererError{Health: wire.ToolUnpinned}, wire.ToolUnpinned, ErrRendererUnpinned},
+ {fmt.Errorf("wrapped: %w", &RendererError{Health: wire.ToolMissing}), wire.ToolMissing, ErrRendererMissing},
+ {errors.New("something else"), wire.ToolMismatch, nil},
+ } {
+ if got := RendererHealth(c.err); got != c.want {
+ t.Errorf("%v: health %q, want %q", c.err, got, c.want)
+ }
+ if c.is != nil && !errors.Is(c.err, c.is) {
+ t.Errorf("%v is not %v", c.err, c.is)
+ }
+ }
+ if errors.Is(&RendererError{Health: wire.ToolMismatch}, ErrRendererMissing) {
+ t.Error("a mismatch is not a missing tree")
+ }
+}
+
+// No pin, or one that is not a SHA-256, matches nothing: the answer is
+// unpinned, before the disk is looked at.
+func TestVerifyRendererUnpinned(t *testing.T) {
+ for _, pin := range []string{"", "not a digest", strings.ToUpper(manifestSum), manifestSum[:63]} {
+ err := VerifyRenderer("/nonexistent/renderer", pin)
+ if !errors.Is(err, ErrRendererUnpinned) || RendererHealth(err) != wire.ToolUnpinned {
+ t.Errorf("pin %q: %v", pin, err)
+ }
+ }
+}
diff --git a/internal/release/renderer_tree_test.go b/internal/release/renderer_tree_test.go
index 199d630d..ad542fb3 100644
--- a/internal/release/renderer_tree_test.go
+++ b/internal/release/renderer_tree_test.go
@@ -177,7 +177,9 @@ urls = json.loads(sys.argv[1])
m.fetch = lambda url: open(urls[url], "rb").read()
sys.exit(m.main(sys.argv[3:]))
`
- cmd := exec.Command("python3", append([]string{"-I", "-c", prelude, string(fixture), fmt.Sprint(clock), pin, out}, extra...)...)
+ // Under a group-writable umask, so nothing the script keeps may take
+ // its mode from the umask (the verifier refuses a group-writable tree).
+ cmd := exec.Command("sh", append([]string{"-c", `umask 002 && exec python3 "$@"`, "sh", "-I", "-B", "-c", prelude, string(fixture), fmt.Sprint(clock), pin, out}, extra...)...)
cmd.Env = append(os.Environ(), "PYTHONDONTWRITEBYTECODE=1")
var stdout, stderr bytes.Buffer
cmd.Stdout, cmd.Stderr = &stdout, &stderr
diff --git a/internal/release/renderer_verify.go b/internal/release/renderer_verify.go
new file mode 100644
index 00000000..9cfc7764
--- /dev/null
+++ b/internal/release/renderer_verify.go
@@ -0,0 +1,278 @@
+package release
+
+import (
+ "errors"
+ "fmt"
+ "os"
+ "path/filepath"
+ "strconv"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// The three ways VerifyRenderer can fail, as errors.Is targets. Each
+// maps to the renderer's health (RendererHealth).
+var (
+ ErrRendererMissing = errors.New("renderer missing")
+ ErrRendererMismatch = errors.New("renderer mismatch")
+ ErrRendererUnpinned = errors.New("renderer unpinned")
+)
+
+// RendererError is why an installed renderer tree is not the pinned one.
+// Health is wire.ToolMissing (no tree at the path), wire.ToolMismatch (a
+// tree that differs from the pin, or is unsafe to use) or
+// wire.ToolUnpinned (no pin to check against). Path is the entry that
+// differs, relative to the tree ("" for the tree's own directory,
+// "MANIFEST" for the list). These are diagnostics for logs, not words a
+// person reads.
+type RendererError struct {
+ Health string
+ Path string
+ Reason string
+}
+
+func (e *RendererError) Error() string {
+ if e.Path == "" {
+ return fmt.Sprintf("renderer %s: %s", e.Health, e.Reason)
+ }
+ return fmt.Sprintf("renderer %s: %s: %s", e.Health, e.Path, e.Reason)
+}
+
+func (e *RendererError) Unwrap() error {
+ switch e.Health {
+ case wire.ToolMissing:
+ return ErrRendererMissing
+ case wire.ToolUnpinned:
+ return ErrRendererUnpinned
+ }
+ return ErrRendererMismatch
+}
+
+// RendererHealth is the health a VerifyRenderer result reports: ok for
+// nil, the error's own state for a RendererError, and mismatch for any
+// other error, so nothing unexpected reads as ok.
+func RendererHealth(err error) string {
+ if err == nil {
+ return wire.ToolHealthy
+ }
+ var re *RendererError
+ if errors.As(err, &re) && (re.Health == wire.ToolMissing || re.Health == wire.ToolUnpinned) {
+ return re.Health
+ }
+ return wire.ToolMismatch
+}
+
+func rendererMismatch(path, format string, args ...any) error {
+ return &RendererError{Health: wire.ToolMismatch, Path: path, Reason: fmt.Sprintf(format, args...)}
+}
+
+// The real MANIFEST is about 250 KiB (2,316 entries); anything near this
+// is not one the build wrote.
+const rendererManifestMax = 16 << 20
+
+// VerifyRenderer checks that dir, an absolute and clean path, holds
+// exactly the renderer tree pin names: pin is the SHA-256 of the tree's
+// MANIFEST (release.rendererSHA256), and MANIFEST lists every entry
+// (scripts/build-renderer-tree.py writes it). Every entry must exist with
+// its listed type, hash and mode, every link must hold exactly its listed
+// target, nothing else may be in the tree but MANIFEST, and nothing (the
+// tree's directory, MANIFEST, any entry) may be group or world writable,
+// owned by anyone but this user or root, or (files) linked from anywhere
+// else. Nothing is followed: a link where the MANIFEST lists a file or a
+// directory is a mismatch.
+//
+// It returns nil, or a *RendererError whose Health is unpinned when pin
+// is not a SHA-256 (checked before the disk is read), missing when dir
+// does not exist, and mismatch otherwise.
+//
+// The check holds for the moment it runs. The tree stays as checked only
+// because nobody but this user and root can write it, which the check
+// makes sure of; a change by those after the check is out of its reach.
+func VerifyRenderer(dir, pin string) error {
+ if !sha256Hex(pin) {
+ return &RendererError{Health: wire.ToolUnpinned, Reason: "no renderer pin is linked into this runner"}
+ }
+ if !filepath.IsAbs(dir) || filepath.Clean(dir) != dir {
+ return rendererMismatch("", "%q is not an absolute, clean path", dir)
+ }
+ return verifyRendererTree(dir, pin, uint32(os.Geteuid()))
+}
+
+// rendererEntry is one MANIFEST line: kind "dir", "file" (sha256, mode)
+// or "link" (target).
+type rendererEntry struct {
+ kind, sha256, target string
+ mode uint32
+}
+
+// rendererLinkDepth bounds the links followed resolving one target, as
+// the build script's LINK_DEPTH does.
+const rendererLinkDepth = 40
+
+// parseRendererManifest reads a MANIFEST strictly: lines of
+// "dir <path>", "file <path> <sha256> <mode>" or "link <path> <target>",
+// fields split by one space, each line ending in a newline, sorted by
+// path with no duplicate, every parent listed as a dir before its
+// children. A path is relative and clean (no empty, "." or ".." part),
+// a hash is lower-case hex, a mode is four octal digits with no
+// group or world write, setuid, setgid or sticky bit. A link's target is
+// relative and resolves, through any links on the way, to an entry of
+// the tree without climbing out of it. Anything else is refused.
+func parseRendererManifest(b []byte) (map[string]rendererEntry, error) {
+ entries := map[string]rendererEntry{}
+ if len(b) == 0 {
+ return entries, nil
+ }
+ if !utf8.Valid(b) {
+ return nil, errors.New("MANIFEST is not UTF-8")
+ }
+ if b[len(b)-1] != '\n' {
+ return nil, errors.New("MANIFEST does not end in a newline")
+ }
+ prev := ""
+ for i, line := range strings.Split(string(b[:len(b)-1]), "\n") {
+ fields := strings.Split(line, " ")
+ bad := func(why string) error { return fmt.Errorf("MANIFEST line %d %q: %s", i+1, line, why) }
+ if len(fields) < 2 {
+ return nil, bad("not an entry")
+ }
+ kind, path := fields[0], fields[1]
+ e := rendererEntry{kind: kind}
+ switch {
+ case kind == "dir" && len(fields) == 2:
+ case kind == "file" && len(fields) == 4:
+ if !sha256Hex(fields[2]) {
+ return nil, bad("not a SHA-256")
+ }
+ mode, ok := rendererMode(fields[3])
+ if !ok {
+ return nil, bad("not a mode the tree may hold")
+ }
+ e.sha256, e.mode = fields[2], mode
+ case kind == "link" && len(fields) == 3:
+ if !manifestField(fields[2]) || strings.HasPrefix(fields[2], "/") {
+ return nil, bad("not a relative link target")
+ }
+ e.target = fields[2]
+ case kind == "dir" || kind == "file" || kind == "link":
+ return nil, bad("wrong number of fields")
+ default:
+ return nil, bad("unknown kind")
+ }
+ if !rendererPath(path) {
+ return nil, bad("not a clean relative path")
+ }
+ if i > 0 && path <= prev {
+ return nil, bad("not sorted after " + prev)
+ }
+ if slash := strings.LastIndexByte(path, '/'); slash >= 0 {
+ if entries[path[:slash]].kind != "dir" {
+ return nil, bad("its directory is not listed")
+ }
+ }
+ entries[path], prev = e, path
+ }
+ for path, e := range entries {
+ if e.kind == "link" {
+ parent := strings.Split(path, "/")
+ if _, err := resolveRendererLink(entries, parent[:len(parent)-1], e.target, 0); err != nil {
+ return nil, fmt.Errorf("MANIFEST link %s -> %s: %w", path, e.target, err)
+ }
+ }
+ }
+ return entries, nil
+}
+
+// resolveRendererLink is where target, read in directory here (names
+// from the tree's root), leads: names from the root, each step an entry
+// of the tree, never above the root. It mirrors the build script's
+// Tree.resolve.
+func resolveRendererLink(entries map[string]rendererEntry, here []string, target string, depth int) ([]string, error) {
+ if depth > rendererLinkDepth {
+ return nil, errors.New("too many links")
+ }
+ here = append([]string(nil), here...)
+ var names []string
+ for _, n := range strings.Split(target, "/") {
+ if n != "" && n != "." {
+ names = append(names, n)
+ }
+ }
+ for i, name := range names {
+ if name == ".." {
+ if len(here) == 0 {
+ return nil, errors.New("climbs out of the tree")
+ }
+ here = here[:len(here)-1]
+ continue
+ }
+ path := name
+ if len(here) > 0 {
+ path = strings.Join(here, "/") + "/" + name
+ }
+ e, ok := entries[path]
+ if !ok {
+ return nil, fmt.Errorf("%s names nothing in the tree", path)
+ }
+ if e.kind == "link" {
+ next, err := resolveRendererLink(entries, here, e.target, depth+1)
+ if err != nil {
+ return nil, err
+ }
+ here = next
+ } else {
+ here = append(here, name)
+ }
+ if i < len(names)-1 && len(here) > 0 && entries[strings.Join(here, "/")].kind != "dir" {
+ return nil, fmt.Errorf("%s is not a directory", strings.Join(here, "/"))
+ }
+ }
+ return here, nil
+}
+
+// rendererPath is a MANIFEST path: relative, clean, holdable, and not
+// MANIFEST itself. An absolute path has an empty first part.
+func rendererPath(p string) bool {
+ if !manifestField(p) || p == "MANIFEST" {
+ return false
+ }
+ for _, part := range strings.Split(p, "/") {
+ if part == "" || part == "." || part == ".." {
+ return false
+ }
+ }
+ return true
+}
+
+// manifestField is what one MANIFEST field can hold, as the build
+// script's holdable: not empty, no white space or control characters.
+// (The whole MANIFEST is checked to be UTF-8 first.) Above U+0020,
+// unicode.IsSpace and Python's str.isspace agree.
+func manifestField(s string) bool {
+ if s == "" {
+ return false
+ }
+ for _, r := range s {
+ if r < 0x20 || r == 0x7f || unicode.IsSpace(r) {
+ return false
+ }
+ }
+ return true
+}
+
+// rendererMode parses a file mode as the MANIFEST writes it ("0644"):
+// four octal digits, permission bits only, nothing group or world
+// writable.
+func rendererMode(s string) (uint32, bool) {
+ if len(s) != 4 || s[0] != '0' || strings.ContainsFunc(s, func(r rune) bool { return r < '0' || r > '7' }) {
+ return 0, false
+ }
+ m, err := strconv.ParseUint(s, 8, 32)
+ if err != nil || m&0o022 != 0 {
+ return 0, false
+ }
+ return uint32(m), true
+}
diff --git a/internal/release/renderer_verify_linux.go b/internal/release/renderer_verify_linux.go
new file mode 100644
index 00000000..346d3d08
--- /dev/null
+++ b/internal/release/renderer_verify_linux.go
@@ -0,0 +1,252 @@
+//go:build linux
+
+package release
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+ "errors"
+ "io"
+ "os"
+ "slices"
+
+ "golang.org/x/sys/unix"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// verifyRendererTree is VerifyRenderer's check of the disk, the tree to
+// be owned by uid or root. Every entry is reached from the tree's own
+// directory descriptor by one name at a time (openat, fstatat and
+// readlinkat with no-follow), so no link on disk is ever followed, and
+// the checks on a directory or file are made on the descriptor that is
+// then read.
+func verifyRendererTree(dir, pin string, uid uint32) error {
+ root, err := unix.Open(dir, unix.O_RDONLY|unix.O_DIRECTORY|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0)
+ if errors.Is(err, unix.ENOENT) {
+ return &RendererError{Health: wire.ToolMissing, Reason: dir + " does not exist"}
+ }
+ if err != nil {
+ return rendererMismatch("", "%s is not a directory this runner can read: %v", dir, err)
+ }
+ defer unix.Close(root)
+ if _, err := rendererSafe(root, "", unix.S_IFDIR, uid); err != nil {
+ return err
+ }
+ manifest, err := readRendererManifest(root, uid)
+ if err != nil {
+ return err
+ }
+ if sum := sha256.Sum256(manifest); hex.EncodeToString(sum[:]) != pin {
+ return rendererMismatch("MANIFEST", "its SHA-256 is %x, the pin is %s", sum, pin)
+ }
+ entries, err := parseRendererManifest(manifest)
+ if err != nil {
+ return rendererMismatch("MANIFEST", "%v", err)
+ }
+ w := rendererWalk{entries: entries, seen: map[string]bool{}, uid: uid}
+ if err := w.dir(root, ""); err != nil {
+ return err
+ }
+ var missing []string
+ for path := range entries {
+ if !w.seen[path] {
+ missing = append(missing, path)
+ }
+ }
+ if len(missing) > 0 {
+ slices.Sort(missing)
+ return rendererMismatch(missing[0], "listed in MANIFEST, not in the tree (%d missing)", len(missing))
+ }
+ return nil
+}
+
+// readRendererManifest reads the tree's MANIFEST: a regular file, not a
+// link, safe as any file of the tree is, and no larger than the build
+// could have written. Like every entry, it is not opened unless fstatat
+// finds a regular file there (opening a device can do things).
+func readRendererManifest(root int, uid uint32) ([]byte, error) {
+ var st unix.Stat_t
+ if err := unix.Fstatat(root, "MANIFEST", &st, unix.AT_SYMLINK_NOFOLLOW); err != nil {
+ return nil, rendererMismatch("MANIFEST", "cannot be checked: %v", err)
+ }
+ if st.Mode&unix.S_IFMT != unix.S_IFREG {
+ return nil, rendererMismatch("MANIFEST", "is a %s; the list must be a file", rendererKind(st.Mode))
+ }
+ fd, err := unix.Openat(root, "MANIFEST", unix.O_RDONLY|unix.O_NOFOLLOW|unix.O_NONBLOCK|unix.O_NOCTTY|unix.O_CLOEXEC, 0)
+ if err != nil {
+ return nil, rendererMismatch("MANIFEST", "cannot be opened as a file: %v", err)
+ }
+ f := os.NewFile(uintptr(fd), "MANIFEST")
+ defer f.Close()
+ if _, err := rendererSafe(fd, "MANIFEST", unix.S_IFREG, uid); err != nil {
+ return nil, err
+ }
+ b, err := io.ReadAll(io.LimitReader(f, rendererManifestMax+1))
+ if err != nil {
+ return nil, rendererMismatch("MANIFEST", "cannot be read: %v", err)
+ }
+ if len(b) > rendererManifestMax {
+ return nil, rendererMismatch("MANIFEST", "larger than %d bytes", rendererManifestMax)
+ }
+ return b, nil
+}
+
+// rendererSafe checks what fd is: of kind (S_IFDIR or S_IFREG), owned by
+// uid or root, nothing group or world writable, and, for a file, not
+// linked from anywhere else (one name only). It returns fd's stat.
+func rendererSafe(fd int, path string, kind uint32, uid uint32) (unix.Stat_t, error) {
+ var st unix.Stat_t
+ if err := unix.Fstat(fd, &st); err != nil {
+ return st, rendererMismatch(path, "cannot be checked: %v", err)
+ }
+ if st.Mode&unix.S_IFMT != kind {
+ return st, rendererMismatch(path, "is a %s, not a %s", rendererKind(st.Mode), rendererKind(kind))
+ }
+ if st.Uid != uid && st.Uid != 0 {
+ return st, rendererMismatch(path, "is owned by user %d, not this runner's %d or root", st.Uid, uid)
+ }
+ if st.Mode&0o022 != 0 {
+ return st, rendererMismatch(path, "is group or world writable (%04o)", st.Mode&0o7777)
+ }
+ if kind == unix.S_IFREG && st.Nlink != 1 {
+ return st, rendererMismatch(path, "has %d names, not one", st.Nlink)
+ }
+ return st, nil
+}
+
+func rendererKind(mode uint32) string {
+ switch mode & unix.S_IFMT {
+ case unix.S_IFDIR:
+ return "dir"
+ case unix.S_IFREG:
+ return "file"
+ case unix.S_IFLNK:
+ return "link"
+ }
+ return "special file"
+}
+
+type rendererWalk struct {
+ entries map[string]rendererEntry
+ seen map[string]bool
+ uid uint32
+}
+
+// dir checks the entries of the open directory fd, the tree's path rel
+// ("" for its root), and the directories under it.
+func (w *rendererWalk) dir(fd int, rel string) error {
+ names, err := w.names(fd, rel)
+ if err != nil {
+ return err
+ }
+ for _, name := range names {
+ path := name
+ if rel != "" {
+ path = rel + "/" + name
+ }
+ e := w.entries[path]
+ var st unix.Stat_t
+ if err := unix.Fstatat(fd, name, &st, unix.AT_SYMLINK_NOFOLLOW); err != nil {
+ return rendererMismatch(path, "cannot be checked: %v", err)
+ }
+ if got := rendererKind(st.Mode); got != e.kind {
+ return rendererMismatch(path, "is a %s, MANIFEST lists a %s", got, e.kind)
+ }
+ w.seen[path] = true
+ switch e.kind {
+ case "dir":
+ sub, err := unix.Openat(fd, name, unix.O_RDONLY|unix.O_DIRECTORY|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0)
+ if err != nil {
+ return rendererMismatch(path, "cannot be opened as a directory: %v", err)
+ }
+ _, err = rendererSafe(sub, path, unix.S_IFDIR, w.uid)
+ if err == nil {
+ err = w.dir(sub, path)
+ }
+ unix.Close(sub)
+ if err != nil {
+ return err
+ }
+ case "file":
+ if err := w.file(fd, name, path, e); err != nil {
+ return err
+ }
+ case "link":
+ buf := make([]byte, unix.PathMax)
+ n, err := unix.Readlinkat(fd, name, buf)
+ if err != nil || n >= len(buf) {
+ return rendererMismatch(path, "cannot be read as a link: %v", err)
+ }
+ if got := string(buf[:n]); got != e.target {
+ return rendererMismatch(path, "points at %q, MANIFEST lists %q", got, e.target)
+ }
+ }
+ }
+ return nil
+}
+
+// names lists the directory fd, sorted, refusing at once any name
+// MANIFEST does not list (MANIFEST itself, at the root, is skipped: it
+// was checked first), so an unlisted directory is never entered and a
+// huge one is never held in memory.
+func (w *rendererWalk) names(fd int, rel string) ([]string, error) {
+ buf := make([]byte, 32<<10)
+ var names []string
+ for {
+ n, err := unix.Getdents(fd, buf)
+ if errors.Is(err, unix.EINTR) {
+ continue
+ }
+ if err != nil {
+ return nil, rendererMismatch(rel, "cannot be listed: %v", err)
+ }
+ if n <= 0 {
+ break
+ }
+ var batch []string
+ _, _, batch = unix.ParseDirent(buf[:n], -1, nil)
+ for _, name := range batch {
+ path := name
+ if rel != "" {
+ path = rel + "/" + name
+ }
+ if rel == "" && name == "MANIFEST" {
+ continue
+ }
+ if _, ok := w.entries[path]; !ok {
+ return nil, rendererMismatch(path, "is in the tree, not in MANIFEST")
+ }
+ names = append(names, name)
+ }
+ }
+ slices.Sort(names)
+ return names, nil
+}
+
+// file checks a file entry: opened without following a link and without
+// blocking (a fifo swapped in after fstatat cannot hang the check), a
+// regular file with exactly the listed mode, safe, and the listed hash.
+func (w *rendererWalk) file(dirfd int, name, path string, e rendererEntry) error {
+ fd, err := unix.Openat(dirfd, name, unix.O_RDONLY|unix.O_NOFOLLOW|unix.O_NONBLOCK|unix.O_NOCTTY|unix.O_CLOEXEC, 0)
+ if err != nil {
+ return rendererMismatch(path, "cannot be opened as a file: %v", err)
+ }
+ f := os.NewFile(uintptr(fd), path)
+ defer f.Close()
+ st, err := rendererSafe(fd, path, unix.S_IFREG, w.uid)
+ if err != nil {
+ return err
+ }
+ if st.Mode&0o7777 != e.mode {
+ return rendererMismatch(path, "has mode %04o, MANIFEST lists %04o", st.Mode&0o7777, e.mode)
+ }
+ h := sha256.New()
+ if _, err := io.Copy(h, f); err != nil {
+ return rendererMismatch(path, "cannot be read: %v", err)
+ }
+ if got := hex.EncodeToString(h.Sum(nil)); got != e.sha256 {
+ return rendererMismatch(path, "has SHA-256 %s, MANIFEST lists %s", got, e.sha256)
+ }
+ return nil
+}
diff --git a/internal/release/renderer_verify_linux_test.go b/internal/release/renderer_verify_linux_test.go
new file mode 100644
index 00000000..41e21101
--- /dev/null
+++ b/internal/release/renderer_verify_linux_test.go
@@ -0,0 +1,337 @@
+//go:build linux
+
+package release
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io/fs"
+ "os"
+ "path/filepath"
+ "slices"
+ "strings"
+ "syscall"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/testci"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// writeVerifyTree writes a small renderer tree under dir/tree, as an
+// install leaves one: dirs 0755, files 0755 or 0644, relative links, and
+// its MANIFEST. It returns the tree and the pin. Modes are set
+// explicitly, so the test does not depend on the umask.
+func writeVerifyTree(t *testing.T, dir string) (string, string) {
+ t.Helper()
+ root := filepath.Join(dir, "tree")
+ mkdir := func(p string) {
+ if err := os.Mkdir(filepath.Join(root, p), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Chmod(filepath.Join(root, p), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ }
+ file := func(p, body string, mode os.FileMode) {
+ if err := os.WriteFile(filepath.Join(root, p), []byte(body), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Chmod(filepath.Join(root, p), mode); err != nil {
+ t.Fatal(err)
+ }
+ }
+ link := func(p, target string) {
+ if err := os.Symlink(target, filepath.Join(root, p)); err != nil {
+ t.Fatal(err)
+ }
+ }
+ mkdir("")
+ for _, d := range []string{"etc", "etc/fonts", "usr", "usr/bin", "usr/lib", "usr/lib/chromium", "usr/share", "usr/share/fonts"} {
+ mkdir(d)
+ }
+ file("usr/lib/chromium/chromium-headless-shell", "browser", 0o755)
+ file("usr/lib-extra", "sorts before usr/lib/", 0o644)
+ file("usr/share/fonts/f.conf", "<fontconfig/>", 0o644)
+ link("usr/bin/chromium-headless-shell", "../lib/chromium/chromium-headless-shell")
+ link("etc/fonts/f.conf", "../../usr/share/fonts/f.conf")
+ return root, writeVerifyManifest(t, root)
+}
+
+// writeVerifyManifest lists the tree as it is on disk now, writes the
+// MANIFEST (0644) and returns its SHA-256: what an attacker able to
+// rewrite the whole tree would also do.
+func writeVerifyManifest(t *testing.T, root string) string {
+ t.Helper()
+ var lines []string
+ err := filepath.WalkDir(root, func(p string, d fs.DirEntry, err error) error {
+ if err != nil || p == root {
+ return err
+ }
+ rel, _ := filepath.Rel(root, p)
+ if rel == "MANIFEST" {
+ return nil
+ }
+ info, err := os.Lstat(p)
+ if err != nil {
+ return err
+ }
+ switch {
+ case info.IsDir():
+ lines = append(lines, "dir "+rel+"\n")
+ case info.Mode()&fs.ModeSymlink != 0:
+ target, err := os.Readlink(p)
+ if err != nil {
+ return err
+ }
+ lines = append(lines, "link "+rel+" "+target+"\n")
+ default:
+ body, err := os.ReadFile(p)
+ if err != nil {
+ return err
+ }
+ sum := sha256.Sum256(body)
+ lines = append(lines, fmt.Sprintf("file %s %s %04o\n", rel, hex.EncodeToString(sum[:]), info.Mode().Perm()))
+ }
+ return nil
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ // Sorted by path, as the build sorts: "usr/lib-extra" before "usr/lib/...".
+ slices.SortFunc(lines, func(a, b string) int {
+ return strings.Compare(strings.Fields(a)[1], strings.Fields(b)[1])
+ })
+ text := strings.Join(lines, "")
+ manifest := filepath.Join(root, "MANIFEST")
+ _ = os.Remove(manifest)
+ if err := os.WriteFile(manifest, []byte(text), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Chmod(manifest, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ sum := sha256.Sum256([]byte(text))
+ return hex.EncodeToString(sum[:])
+}
+
+func TestVerifyRendererAcceptsThePinnedTree(t *testing.T) {
+ root, pin := writeVerifyTree(t, t.TempDir())
+ if err := VerifyRenderer(root, pin); err != nil {
+ t.Fatal(err)
+ }
+ if got := RendererHealth(VerifyRenderer(root, pin)); got != wire.ToolHealthy {
+ t.Fatalf("health %q", got)
+ }
+}
+
+// The verifier and scripts/build-renderer-tree.py agree on the MANIFEST:
+// the tree the build keeps verifies against the pin it prints.
+func TestVerifyRendererAcceptsTheBuiltTree(t *testing.T) {
+ testci.Files(t, "../../scripts/build-renderer-tree.py")
+ testci.Tools(t, "python3")
+ dir := t.TempDir()
+ pinFile, urls := newRendererFixture().write(t, dir)
+ tree := filepath.Join(dir, "tree")
+ pin, stderr, err := buildRendererTree(t, pinFile, urls, filepath.Join(dir, "renderer.tar.gz"), 0, "--tree", tree)
+ if err != nil {
+ t.Fatalf("build: %v\n%s", err, stderr)
+ }
+ if err := VerifyRenderer(tree, strings.TrimSpace(pin)); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestVerifyRendererMissingTree(t *testing.T) {
+ dir := t.TempDir()
+ _, pin := writeVerifyTree(t, dir)
+ for _, p := range []string{filepath.Join(dir, "absent"), filepath.Join(dir, "absent", "tree")} {
+ err := VerifyRenderer(p, pin)
+ if !errors.Is(err, ErrRendererMissing) || RendererHealth(err) != wire.ToolMissing {
+ t.Errorf("%s: %v", p, err)
+ }
+ }
+ // A path that is not absolute and clean is a caller's mistake, not
+ // a missing tree.
+ for _, p := range []string{"tree", dir + "/./tree", dir + "/tree/"} {
+ if err := VerifyRenderer(p, pin); !errors.Is(err, ErrRendererMismatch) {
+ t.Errorf("%q: %v", p, err)
+ }
+ }
+}
+
+// Every way the installed tree can differ from the pinned one is a
+// mismatch, named by the entry that differs ("" is the tree's root).
+func TestVerifyRendererRefuses(t *testing.T) {
+ const browser = "usr/lib/chromium/chromium-headless-shell"
+ const link = "usr/bin/chromium-headless-shell"
+ for _, c := range []struct {
+ name string
+ path string // the entry the error names
+ why string // and what it says of it
+ edit func(t *testing.T, root, outside string)
+ uid int // when set, verify as this user instead
+ }{
+ {name: "tampered byte", why: "has SHA-256", path: browser, edit: func(t *testing.T, root, _ string) {
+ writeTreeFile(t, filepath.Join(root, browser), "Browser", 0o755)
+ }},
+ {name: "extra file", why: "not in MANIFEST", path: "usr/lib/chromium/extra", edit: func(t *testing.T, root, _ string) {
+ writeTreeFile(t, filepath.Join(root, "usr/lib/chromium/extra"), "x", 0o644)
+ }},
+ {name: "extra file at the root", why: "not in MANIFEST", path: "extra", edit: func(t *testing.T, root, _ string) {
+ writeTreeFile(t, filepath.Join(root, "extra"), "x", 0o644)
+ }},
+ {name: "extra directory", why: "not in MANIFEST", path: "usr/lib/extra", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Mkdir(filepath.Join(root, "usr/lib/extra"), 0o755))
+ }},
+ {name: "extra fifo", why: "not in MANIFEST", path: "usr/fifo", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, syscall.Mkfifo(filepath.Join(root, "usr/fifo"), 0o644))
+ }},
+ {name: "missing file", why: "not in the tree", path: "usr/share/fonts/f.conf", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, "usr/share/fonts/f.conf")))
+ }},
+ {name: "missing directory", why: "not in the tree", path: "usr/share", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.RemoveAll(filepath.Join(root, "usr/share")))
+ }},
+ {name: "missing link", why: "not in the tree", path: link, edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, link)))
+ }},
+ {name: "link retargeted", why: "points at", path: link, edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, link)))
+ treeMust(t, os.Symlink("../lib/chromium/./chromium-headless-shell", filepath.Join(root, link)))
+ }},
+ {name: "mode widened", why: "group or world writable", path: "usr/lib-extra", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(filepath.Join(root, "usr/lib-extra"), 0o664))
+ }},
+ {name: "mode changed", why: "has mode 0700", path: browser, edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(filepath.Join(root, browser), 0o700))
+ }},
+ {name: "setuid added", why: "has mode 4755", path: browser, edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(filepath.Join(root, browser), 0o755|os.ModeSetuid))
+ }},
+ {name: "directory group writable", why: "group or world writable", path: "usr/lib", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(filepath.Join(root, "usr/lib"), 0o775))
+ }},
+ {name: "directory world writable and sticky", why: "group or world writable", path: "usr/share/fonts", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(filepath.Join(root, "usr/share/fonts"), 0o777|os.ModeSticky))
+ }},
+ {name: "root group writable", why: "group or world writable", path: "", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(root, 0o775))
+ }},
+ {name: "MANIFEST group writable", why: "group or world writable", path: "MANIFEST", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Chmod(filepath.Join(root, "MANIFEST"), 0o664))
+ }},
+ {name: "MANIFEST missing", why: "cannot be checked", path: "MANIFEST", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, "MANIFEST")))
+ }},
+ {name: "MANIFEST a link to the pinned one", why: "is a link; the list must be a file", path: "MANIFEST", edit: func(t *testing.T, root, outside string) {
+ treeMust(t, os.Rename(filepath.Join(root, "MANIFEST"), filepath.Join(outside, "MANIFEST")))
+ treeMust(t, os.Symlink(filepath.Join(outside, "MANIFEST"), filepath.Join(root, "MANIFEST")))
+ }},
+ {name: "MANIFEST a fifo", why: "is a special file; the list must be a file", path: "MANIFEST", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, "MANIFEST")))
+ treeMust(t, syscall.Mkfifo(filepath.Join(root, "MANIFEST"), 0o644))
+ }},
+ {name: "MANIFEST swapped with a matching tree", why: "the pin is", path: "MANIFEST", edit: func(t *testing.T, root, _ string) {
+ writeTreeFile(t, filepath.Join(root, browser), "another browser", 0o755)
+ writeVerifyManifest(t, root)
+ }},
+ {name: "directory replaced by a link to a copy", why: "is a link, MANIFEST lists a dir", path: "usr/lib/chromium", edit: func(t *testing.T, root, outside string) {
+ copyDir := filepath.Join(outside, "chromium")
+ treeMust(t, os.Rename(filepath.Join(root, "usr/lib/chromium"), copyDir))
+ treeMust(t, os.Symlink(copyDir, filepath.Join(root, "usr/lib/chromium")))
+ }},
+ {name: "file replaced by a link to a copy", why: "is a link, MANIFEST lists a file", path: browser, edit: func(t *testing.T, root, outside string) {
+ treeMust(t, os.Rename(filepath.Join(root, browser), filepath.Join(outside, "browser")))
+ treeMust(t, os.Symlink(filepath.Join(outside, "browser"), filepath.Join(root, browser)))
+ }},
+ {name: "link replaced by its target's copy", why: "is a file, MANIFEST lists a link", path: link, edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, link)))
+ writeTreeFile(t, filepath.Join(root, link), "browser", 0o755)
+ }},
+ {name: "file replaced by a directory", why: "is a dir, MANIFEST lists a file", path: "usr/lib-extra", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, "usr/lib-extra")))
+ treeMust(t, os.Mkdir(filepath.Join(root, "usr/lib-extra"), 0o755))
+ }},
+ {name: "directory replaced by a file", why: "is a file, MANIFEST lists a dir", path: "usr/share/fonts", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.RemoveAll(filepath.Join(root, "usr/share/fonts")))
+ writeTreeFile(t, filepath.Join(root, "usr/share/fonts"), "", 0o644)
+ }},
+ {name: "file replaced by a fifo", why: "is a special file, MANIFEST lists a file", path: "usr/lib-extra", edit: func(t *testing.T, root, _ string) {
+ treeMust(t, os.Remove(filepath.Join(root, "usr/lib-extra")))
+ treeMust(t, syscall.Mkfifo(filepath.Join(root, "usr/lib-extra"), 0o644))
+ }},
+ {name: "file hard linked from outside", why: "has 2 names", path: browser, edit: func(t *testing.T, root, outside string) {
+ treeMust(t, os.Link(filepath.Join(root, browser), filepath.Join(outside, "browser")))
+ }},
+ {name: "root a link to the pinned tree", why: "not a directory this runner can read", path: "", edit: func(t *testing.T, root, outside string) {
+ treeMust(t, os.Rename(root, filepath.Join(outside, "tree")))
+ treeMust(t, os.Symlink(filepath.Join(outside, "tree"), root))
+ }},
+ {name: "owned by another user", why: "is owned by user", path: "", uid: os.Geteuid() + 1},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ if c.uid != 0 && os.Geteuid() == 0 {
+ t.Skip("root owns the tree; any owner check passes for root")
+ }
+ dir := t.TempDir()
+ root, pin := writeVerifyTree(t, dir)
+ outside := filepath.Join(dir, "outside")
+ treeMust(t, os.Mkdir(outside, 0o755))
+ if c.edit != nil {
+ c.edit(t, root, outside)
+ }
+ var err error
+ if c.uid != 0 {
+ err = verifyRendererTree(root, pin, uint32(c.uid))
+ } else {
+ err = VerifyRenderer(root, pin)
+ }
+ var re *RendererError
+ if !errors.As(err, &re) || !errors.Is(err, ErrRendererMismatch) || RendererHealth(err) != wire.ToolMismatch {
+ t.Fatalf("want a mismatch, got %v", err)
+ }
+ if re.Path != c.path || !strings.Contains(re.Reason, c.why) {
+ t.Fatalf("got %v, want %q: ...%s", err, c.path, c.why)
+ }
+ })
+ }
+}
+
+// A MANIFEST that matches its pin is still read strictly: a pinned list
+// the build could not have written (here, a link out of the tree) is a
+// mismatch, as is one too large to be the build's.
+func TestVerifyRendererRefusesAPinnedBadManifest(t *testing.T) {
+ root, _ := writeVerifyTree(t, t.TempDir())
+ treeMust(t, os.Symlink("../../outside", filepath.Join(root, "usr/out")))
+ err := VerifyRenderer(root, writeVerifyManifest(t, root))
+ var re *RendererError
+ if !errors.As(err, &re) || re.Health != wire.ToolMismatch || re.Path != "MANIFEST" || !strings.Contains(re.Reason, "climbs out of the tree") {
+ t.Fatalf("escaping link: %v", err)
+ }
+
+ big := make([]byte, rendererManifestMax+1)
+ for i := range big {
+ big[i] = '\n'
+ }
+ writeTreeFile(t, filepath.Join(root, "MANIFEST"), string(big), 0o644)
+ sum := sha256.Sum256(big)
+ err = VerifyRenderer(root, hex.EncodeToString(sum[:]))
+ if !errors.As(err, &re) || re.Health != wire.ToolMismatch || re.Path != "MANIFEST" || !strings.Contains(re.Reason, "larger than") {
+ t.Fatalf("oversized MANIFEST: %v", err)
+ }
+}
+
+func writeTreeFile(t *testing.T, p, body string, mode os.FileMode) {
+ t.Helper()
+ treeMust(t, os.WriteFile(p, []byte(body), 0o600))
+ treeMust(t, os.Chmod(p, mode))
+}
+
+func treeMust(t *testing.T, err error) {
+ t.Helper()
+ if err != nil {
+ t.Fatal(err)
+ }
+}
diff --git a/internal/release/renderer_verify_other.go b/internal/release/renderer_verify_other.go
new file mode 100644
index 00000000..6fb9db04
--- /dev/null
+++ b/internal/release/renderer_verify_other.go
@@ -0,0 +1,11 @@
+//go:build !linux
+
+package release
+
+import "amadan.net/oficina/equipo/internal/wire"
+
+// The renderer runs only on Linux (amd64 in v1): elsewhere no tree is
+// installed and none is looked for.
+func verifyRendererTree(dir, pin string, uid uint32) error {
+ return &RendererError{Health: wire.ToolMissing, Reason: "the renderer runs only on Linux"}
+}
diff --git a/scripts/build-renderer-tree.py b/scripts/build-renderer-tree.py
index d18beed7..b93bd911 100755
--- a/scripts/build-renderer-tree.py
+++ b/scripts/build-renderer-tree.py
@@ -308,8 +308,12 @@ def build(pin_path, tar_path, keep):
tree.check(program)
manifest = tree.manifest()
if keep:
- with open(os.path.join(keep, "MANIFEST"), "wb") as f:
+ # 0644 as in the tar, whatever the umask: the verifier
+ # refuses a group or world writable MANIFEST.
+ path = os.path.join(keep, "MANIFEST")
+ with open(path, "wb") as f:
f.write(manifest)
+ os.chmod(path, 0o644)
with os.fdopen(fd, "wb") as out:
fd = None
write_tar(tree, manifest, out)