carlos / platform Public

Merge origin/main c340dd43 into managed-fleets-2b2

Brings in main's five commits past 65951fbb: edaed836 (docs: BYO
LiveKit), 02fa02e3 (edge burst flood test), ca75631f (rootfs /etc/hosts,
#1349, with its census overlay), d74dff11 (changelog) and c340dd43
(media: SDR video up to 1080p, 3 hours).

Census chain: the one conflict, plan14-root-reads-chain.tsv, resolved
with main's lines byte for byte in main's order, ending with
plan14-root-reads-rootfs-etc-hosts-1349.tsv, then the
plan14-root-reads-managed-fleets-2b2.tsv line last.

make census-propose NAME=managed-fleets-2b2, rerun with the claims rebuilt
verbatim from the overlay, rewrote nothing: no unit's digest moved under
main's commits and no envelope needed re-pinning (#1349 re-pins
internal/rootfsimage in its own overlay). Seal unchanged:
892cf87d -> 4bb3547d064b71134612e74b3b8269e16356d2832a8e579ace150349e55c6a27.
make census-card: Nothing to approve. No new record-write census layer
on main; the code-health record is unchanged and make code-health passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ca5fd6e2df9d74d45e6e21f17c287c26567de4bc parent 906c146parent c340dd4
28 files changed, +1,271 −33
  • approved_rootfs_copy_test.go +4 −2
  • docs/site/changelog.json +57 −0
  • docs/site/live-streams-bring-your-own-livekit.md +234 −0
  • docs/site/media-conversion.md +1 −1
  • docs/site/nav.json +5 −0
  • docs/site/rootfs.md +2 −0
  • docs/superpowers/notes/LUNA-COPY-BRIEF-media-conversion-7.md +29 −0
  • docs/superpowers/notes/LUNA-COPY-RESULT-media-conversion-7.md +9 −0
  • docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit.md +33 −0
  • docs/superpowers/notes/census-proposal-rootfs-etc-hosts-1349.md +11 −0
  • docs/superpowers/notes/media-conversion-copy-deck.md +14 −1
  • docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md +7 −2
  • docs/superpowers/plans/2026-11-16-media-conversion-plan-2-console.md +2 −2
  • docs/superpowers/reviews/CODEX-FINDINGS-media-three-hour-sdr.md +32 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-media-three-hour-sdr.md +59 −0
  • docs/superpowers/specs/2026-11-16-video-conversion-design.md +111 −5
  • internal/console/apimedia_test.go +17 −1
  • internal/edge/burst_test.go +82 −6
  • internal/media/limits.go +8 −1
  • internal/media/media_test.go +91 −7
  • internal/mediajobs/jobs_test.go +117 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-rootfs-etc-hosts-1349.tsv +3 −0
  • internal/rootfsimage/mounts.go +46 −3
  • internal/rootfsimage/mounts_test.go +139 −0
  • internal/sim/mediajobs/invariants_test.go +58 −0
  • internal/sim/mediajobs/witness_test.go +95 −1
  • ship_rootfs_test.go +4 −0

CI failed — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-1AcK8e
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading golang.org/x/net v0.62.0
go: downloading github.com/superfly/ltx v0.5.1
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
=== launchctx (4 s, from +0 s)
ok  	amadan.net/carlos/platform.git/launchctx	0.015s
?   	amadan.net/carlos/platform.git/launchctx/controlname	[no test files]
?   	amadan.net/carlos/platform.git/launchctx/wireid	[no test files]
=== vet (169 s, from +0 s)
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
=== vet-tags (192 s, from +0 s)
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (386 s, from +13 s)
ok  	github.com/carlosframework/platform/cmd/carlos-media	122.790s
?   	github.com/carlosframework/platform/cmd/changelog	[no test files]
ok  	github.com/carlosframework/platform/cmd/console	211.663s
ok  	github.com/carlosframework/platform/cmd/mediaimage	41.816s
ok  	github.com/carlosframework/platform/cmd/moveprobe	15.246s
ok  	github.com/carlosframework/platform/cmd/pricebook-export	0.050s
ok  	github.com/carlosframework/platform/cmd/rootfswitness	0.178s
ok  	github.com/carlosframework/platform/cmd/runsc-assets	0.119s
ok  	github.com/carlosframework/platform/cmd/zddprobe	0.914s
ok  	github.com/carlosframework/platform/internal/agentsock	0.067s
ok  	github.com/carlosframework/platform/internal/alerting	0.020s
ok  	github.com/carlosframework/platform/internal/analytics	0.317s
ok  	github.com/carlosframework/platform/internal/appconfig	42.458s
ok  	github.com/carlosframework/platform/internal/apperr	0.394s
ok  	github.com/carlosframework/platform/internal/applog	0.554s
ok  	github.com/carlosframework/platform/internal/apppolicy	2.090s
ok  	github.com/carlosframework/platform/internal/assetcache	0.449s
ok  	github.com/carlosframework/platform/internal/awsinv	0.022s
ok  	github.com/carlosframework/platform/internal/awsmanaged	10.740s
ok  	github.com/carlosframework/platform/internal/awsregiongroup	0.328s
ok  	github.com/carlosframework/platform/internal/awsterminations	0.021s
ok  	github.com/carlosframework/platform/internal/backupswords	0.013s
ok  	github.com/carlosframework/platform/internal/billing	0.090s
ok  	github.com/carlosframework/platform/internal/billing/billingtest	0.066s
ok  	github.com/carlosframework/platform/internal/billingstripe	1.763s
ok  	github.com/carlosframework/platform/internal/boxchoice	0.020s
ok  	github.com/carlosframework/platform/internal/boxid	2.183s
?   	github.com/carlosframework/platform/internal/boxid/boxidtest	[no test files]
?   	github.com/carlosframework/platform/internal/boxid/internal/signtest	[no test files]
ok  	github.com/carlosframework/platform/internal/boxroles	0.015s
ok  	github.com/carlosframework/platform/internal/boxself	0.174s
ok  	github.com/carlosframework/platform/internal/boxvolumes	0.036s
ok  	github.com/carlosframework/platform/internal/caps	3.582s
ok  	github.com/carlosframework/platform/internal/certwarm	0.020s
ok  	github.com/carlosframework/platform/internal/cgroup	1.376s
ok  	github.com/carlosframework/platform/internal/changelog	3.541s
ok  	github.com/carlosframework/platform/internal/clamd	0.069s
?   	github.com/carlosframework/platform/internal/cliflag	[no test files]
ok  	github.com/carlosframework/platform/internal/clireg	0.014s
ok  	github.com/carlosframework/platform/internal/codehealth	15.402s
ok  	github.com/carlosframework/platform/internal/compute	0.011s
ok  	github.com/carlosframework/platform/internal/consolefleet	0.014s
?   	github.com/carlosframework/platform/internal/controlname	[no test files]
?   	github.com/carlosframework/platform/internal/controlsock	[no test files]
ok  	github.com/carlosframework/platform/internal/dbdoor	11.099s
ok  	github.com/carlosframework/platform/internal/dbdoor/dbdoortest	0.019s
ok  	github.com/carlosframework/platform/internal/dbquery	0.023s
ok  	github.com/carlosframework/platform/internal/dbreads	3.060s
?   	github.com/carlosframework/platform/internal/dbreads/dbreadstest	[no test files]
ok  	github.com/carlosframework/platform/internal/dbverify	0.011s
ok  	github.com/carlosframework/platform/internal/demo	0.007s
ok  	github.com/carlosframework/platform/internal/demobuild	2.660s
ok  	github.com/carlosframework/platform/internal/democlaim	0.534s
ok  	github.com/carlosframework/platform/internal/devbox	12.443s
ok  	github.com/carlosframework/platform/internal/dnsrec	0.010s
ok  	github.com/carlosframework/platform/internal/docsite	0.079s
ok  	github.com/carlosframework/platform/internal/domainreg	0.009s
ok  	github.com/carlosframework/platform/internal/domains	66.382s
ok  	github.com/carlosframework/platform/internal/doorkey	0.022s
ok  	github.com/carlosframework/platform/internal/economics	0.018s
ok  	github.com/carlosframework/platform/internal/edgefence	0.077s
ok  	github.com/carlosframework/platform/internal/edgeguard	0.220s
?   	github.com/carlosframework/platform/internal/edgeproof	[no test files]
ok  	github.com/carlosframework/platform/internal/edgesfile	0.048s
ok  	github.com/carlosframework/platform/internal/egressaddr	0.020s
ok  	github.com/carlosframework/platform/internal/execsandbox	104.327s
ok  	github.com/carlosframework/platform/internal/fileacl	0.008s
ok  	github.com/carlosframework/platform/internal/fleetapi	2.070s
ok  	github.com/carlosframework/platform/internal/fleetstore	0.004s
ok  	github.com/carlosframework/platform/internal/fxrate	0.018s
ok  	github.com/carlosframework/platform/internal/gate	3.895s
ok  	github.com/carlosframework/platform/internal/genselect	0.102s
ok  	github.com/carlosframework/platform/internal/geo	0.071s
ok  	github.com/carlosframework/platform/internal/geoip	0.136s
ok  	github.com/carlosframework/platform/internal/groupadmission	0.008s
ok  	github.com/carlosframework/platform/internal/grouprollaws	16.876s
ok  	github.com/carlosframework/platform/internal/hadeparture	0.011s
ok  	github.com/carlosframework/platform/internal/hafresh	0.011s
ok  	github.com/carlosframework/platform/internal/hairpin	0.173s
ok  	github.com/carlosframework/platform/internal/historyreadback	0.952s
ok  	github.com/carlosframework/platform/internal/hostactors	22.515s
ok  	github.com/carlosframework/platform/internal/hostbox	20.140s
ok  	github.com/carlosframework/platform/internal/hostclaim	2.141s
ok  	github.com/carlosframework/platform/internal/hostenv	0.038s
ok  	github.com/carlosframework/platform/internal/hostevidence	0.016s
ok  	github.com/carlosframework/platform/internal/hostexec	22.551s
ok  	github.com/carlosframework/platform/internal/hostfence	0.156s
ok  	github.com/carlosframework/platform/internal/hostfiles	25.549s
ok  	github.com/carlosframework/platform/internal/hostfloor	0.058s
ok  	github.com/carlosframework/platform/internal/hostguard	1.458s
ok  	github.com/carlosframework/platform/internal/hostops	7.292s
?   	github.com/carlosframework/platform/internal/hostops/fencerelease	[no test files]
ok  	github.com/carlosframework/platform/internal/hostops/internal/fencerelease	0.034s
ok  	github.com/carlosframework/platform/internal/hostquarantine	0.010s
ok  	github.com/carlosframework/platform/internal/hostrelocate	1.832s
ok  	github.com/carlosframework/platform/internal/hostresolve	0.679s
ok  	github.com/carlosframework/platform/internal/hostwrite	0.008s
ok  	github.com/carlosframework/platform/internal/infraview	0.019s
ok  	github.com/carlosframework/platform/internal/ingresshealth	0.013s
ok  	github.com/carlosframework/platform/internal/ingresshealth/awstg	0.012s
ok  	github.com/carlosframework/platform/internal/instancectl	60.897s
ok  	github.com/carlosframework/platform/internal/instanceexec	8.549s
ok  	github.com/carlosframework/platform/internal/instancefs	0.036s
ok  	github.com/carlosframework/platform/internal/instancekey	0.013s
ok  	github.com/carlosframework/platform/internal/instanceupdates	0.031s
ok  	github.com/carlosframework/platform/internal/interactive	0.662s
ok  	github.com/carlosframework/platform/internal/launchd	0.008s
ok  	github.com/carlosframework/platform/internal/layout	24.644s
ok  	github.com/carlosframework/platform/internal/layout/pubclass	101.766s
ok  	github.com/carlosframework/platform/internal/lbhealth	0.007s
ok  	github.com/carlosframework/platform/internal/lease	149.143s
ok  	github.com/carlosframework/platform/internal/lease/leasetest	1.258s
ok  	github.com/carlosframework/platform/internal/lease/locktest	0.021s
ok  	github.com/carlosframework/platform/internal/ledger	0.052s
ok  	github.com/carlosframework/platform/internal/mail	0.896s
ok  	github.com/carlosframework/platform/internal/mailer	0.807s
ok  	github.com/carlosframework/platform/internal/mailsubmit	1.031s
ok  	github.com/carlosframework/platform/internal/mailwire	0.015s
ok  	github.com/carlosframework/platform/internal/maintenance	0.213s
ok  	github.com/carlosframework/platform/internal/maintenanceexec	8.153s
ok  	github.com/carlosframework/platform/internal/maintenanceguard	0.393s
ok  	github.com/carlosframework/platform/internal/managedboot	3.203s
?   	github.com/carlosframework/platform/internal/managedboot/boottest	[no test files]
?   	github.com/carlosframework/platform/internal/managedboot/roottest	[no test files]
ok  	github.com/carlosframework/platform/internal/media	1.892s
ok  	github.com/carlosframework/platform/internal/media/mediatest	0.005s
ok  	github.com/carlosframework/platform/internal/mediaaws	60.913s
ok  	github.com/carlosframework/platform/internal/mediahandler	42.562s
ok  	github.com/carlosframework/platform/internal/mediajobs	0.899s
ok  	github.com/carlosframework/platform/internal/medialocal	9.983s
ok  	github.com/carlosframework/platform/internal/metrics	0.132s
ok  	github.com/carlosframework/platform/internal/minorunits	0.010s
ok  	github.com/carlosframework/platform/internal/moves	53.968s
ok  	github.com/carlosframework/platform/internal/moves/archive	2.341s
ok  	github.com/carlosframework/platform/internal/moves/offlinerun	0.099s
ok  	github.com/carlosframework/platform/internal/namedunits	0.029s
ok  	github.com/carlosframework/platform/internal/objstore	1.612s
ok  	github.com/carlosframework/platform/internal/ops	16.154s
ok  	github.com/carlosframework/platform/internal/pageindex	3.785s
ok  	github.com/carlosframework/platform/internal/parity	0.118s
?   	github.com/carlosframework/platform/internal/parity/cmd/parity-doc	[no test files]
ok  	github.com/carlosframework/platform/internal/park	0.573s
ok  	github.com/carlosframework/platform/internal/perf	0.188s
ok  	github.com/carlosframework/platform/internal/plans	0.122s
ok  	github.com/carlosframework/platform/internal/privatefile	0.008s
ok  	github.com/carlosframework/platform/internal/provision	238.638s
ok  	github.com/carlosframework/platform/internal/proxyproto	0.931s
ok  	github.com/carlosframework/platform/internal/publicrelease	0.031s
ok  	github.com/carlosframework/platform/internal/ratelimit	0.165s
ok  	github.com/carlosframework/platform/internal/regionlabel	0.040s
ok  	github.com/carlosframework/platform/internal/regionname	0.024s
ok  	github.com/carlosframework/platform/internal/registrar	0.004s
ok  	github.com/carlosframework/platform/internal/registrar/openprovider	0.554s
?   	github.com/carlosframework/platform/internal/registrar/registrartest	[no test files]
ok  	github.com/carlosframework/platform/internal/registry	87.099s
ok  	github.com/carlosframework/platform/internal/relay	7.636s
ok  	github.com/carlosframework/platform/internal/release	92.792s
ok  	github.com/carlosframework/platform/internal/replicagen	0.025s
ok  	github.com/carlosframework/platform/internal/replicas	0.091s
ok  	github.com/carlosframework/platform/internal/reqrec	6.703s
ok  	github.com/carlosframework/platform/internal/rollout	11.369s
ok  	github.com/carlosframework/platform/internal/rolloutwords	0.033s
ok  	github.com/carlosframework/platform/internal/rootaws	102.333s
ok  	github.com/carlosframework/platform/internal/rootfsimage	1.193s
ok  	github.com/carlosframework/platform/internal/rootparticipation	0.132s
ok  	github.com/carlosframework/platform/internal/rootstate	0.077s
ok  	github.com/carlosframework/platform/internal/runs	0.719s
ok  	github.com/carlosframework/platform/internal/s3compat	0.016s
ok  	github.com/carlosframework/platform/internal/s3fake	1.251s
ok  	github.com/carlosframework/platform/internal/safefile	0.043s
ok  	github.com/carlosframework/platform/internal/schedule	25.179s
ok  	github.com/carlosframework/platform/internal/seeds	0.054s
ok  	github.com/carlosframework/platform/internal/sim/litestreamfacts	4.611s
ok  	github.com/carlosframework/platform/internal/sim/mediajobs	51.749s
ok  	github.com/carlosframework/platform/internal/sim/regionha	25.049s
ok  	github.com/carlosframework/platform/internal/status	0.710s
ok  	github.com/carlosframework/platform/internal/steering	0.271s
ok  	github.com/carlosframework/platform/internal/stopevidence	0.456s
ok  	github.com/carlosframework/platform/internal/storecfg	0.368s
ok  	github.com/carlosframework/platform/internal/svcrole	0.012s
ok  	github.com/carlosframework/platform/internal/systemd	6.331s
?   	github.com/carlosframework/platform/internal/systemdshow	[no test files]
ok  	github.com/carlosframework/platform/internal/team	3.782s
ok  	github.com/carlosframework/platform/internal/teamcontract	0.215s
ok  	github.com/carlosframework/platform/internal/telemetry	0.036s
ok  	github.com/carlosframework/platform/internal/termfence	3.944s
ok  	github.com/carlosframework/platform/internal/timerspec	0.029s
ok  	github.com/carlosframework/platform/internal/tsidentity	4.215s
ok  	github.com/carlosframework/platform/internal/tunnelclient	0.410s
ok  	github.com/carlosframework/platform/internal/unixdial	0.017s
ok  	github.com/carlosframework/platform/internal/updatewords	0.045s
ok  	github.com/carlosframework/platform/internal/upstreamguard	0.020s
?   	github.com/carlosframework/platform/internal/upstreamguard/guardtest	[no test files]
ok  	github.com/carlosframework/platform/internal/usage	0.025s
ok  	github.com/carlosframework/platform/internal/version	0.012s
ok  	github.com/carlosframework/platform/internal/vet	2.662s
ok  	github.com/carlosframework/platform/internal/zonehost	0.020s
ok  	github.com/carlosframework/platform/internal/zonehost/route53zones	0.089s
?   	github.com/carlosframework/platform/internal/zonehost/zonehosttest	[no test files]
?   	github.com/carlosframework/platform/scripts/gitleaks-gate	[no test files]
ok  	github.com/carlosframework/platform/scripts/govulncheck-gate	0.018s
ok  	github.com/carlosframework/platform/scripts/pathmapcheck	0.134s
ok  	github.com/carlosframework/platform/scripts/region-ha-g2/fixture	5.094s
ok  	github.com/carlosframework/platform/scripts/stateless-replicas-drill	1.268s
ok  	github.com/carlosframework/platform/scripts/witness-pointer	0.062s
=== cutover-witness (148 s, from +13 s)
ok  	github.com/carlosframework/platform	1.697s
=== internal_grouproll@0 (280 s, from +72 s)
ok  	github.com/carlosframework/platform/internal/grouproll	278.477s
=== internal_grouproll@1 (285 s, from +72 s)
ok  	github.com/carlosframework/platform/internal/grouproll	283.489s
=== internal_activator@0 (154 s, from +139 s)
ok  	github.com/carlosframework/platform/internal/activator	150.052s
=== internal_activator@1 (133 s, from +139 s)
ok  	github.com/carlosframework/platform/internal/activator	128.005s
=== internal_activator@2 (134 s, from +139 s)
ok  	github.com/carlosframework/platform/internal/activator	129.066s
=== internal_activator@3 (185 s, from +139 s)
ok  	github.com/carlosframework/platform/internal/activator	180.288s
=== internal_edge@0 (199 s, from +159 s)
ok  	github.com/carlosframework/platform/internal/edge	190.552s
=== internal_edge@1 (149 s, from +159 s)
ok  	github.com/carlosframework/platform/internal/edge	139.055s
=== internal_edge@2 (164 s, from +159 s)
ok  	github.com/carlosframework/platform/internal/edge	155.493s
=== internal_edge@3 (231 s, from +159 s)
ok  	github.com/carlosframework/platform/internal/edge	221.682s
=== root@0 (127 s, from +160 s)
ok  	github.com/carlosframework/platform	115.547s
=== root@1 (117 s, from +160 s)
ok  	github.com/carlosframework/platform	106.368s
=== root@2 (131 s, from +160 s)
ok  	github.com/carlosframework/platform	119.391s
=== root@3 (122 s, from +160 s)
ok  	github.com/carlosframework/platform	111.424s
=== root@4 (123 s, from +160 s)
ok  	github.com/carlosframework/platform	111.619s
=== internal_host@0 (150 s, from +214 s)
ok  	github.com/carlosframework/platform/internal/host	146.366s
=== internal_host@1 (142 s, from +214 s)
ok  	github.com/carlosframework/platform/internal/host	138.176s
=== internal_host@2 (202 s, from +214 s)
ok  	github.com/carlosframework/platform/internal/host	198.117s
=== internal_host@3 (309 s, from +214 s)
ok  	github.com/carlosframework/platform/internal/host	304.929s
=== internal_host@4 (142 s, from +214 s)
ok  	github.com/carlosframework/platform/internal/host	138.057s
=== internal_host@5 (204 s, from +214 s)
ok  	github.com/carlosframework/platform/internal/host	200.229s
=== internal_console@0 (201 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	193.086s
=== internal_console@1 (214 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	206.281s
=== internal_console@2 (207 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	199.380s
=== internal_console@3 (250 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	241.724s
=== internal_console@4 (196 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	189.426s
=== internal_console@5 (210 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	201.331s
=== internal_console@6 (210 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	200.784s
=== internal_console@7 (216 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	207.681s
=== internal_console@8 (214 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	205.542s
=== internal_console@9 (241 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	233.165s
=== internal_console@10 (222 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	213.316s
=== internal_console@11 (259 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	249.807s
=== internal_console@12 (291 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	283.349s
=== internal_console@13 (215 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	206.151s
=== internal_console@14 (210 s, from +217 s)
ok  	github.com/carlosframework/platform/internal/console	201.896s
=== internal_console@15 (254 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	248.034s
=== internal_console@16 (206 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	199.279s
=== internal_console@17 (199 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	191.695s
=== internal_console@18 (209 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	203.560s
=== internal_console@19 (201 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	193.442s
=== internal_console@20 (201 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	193.471s
=== internal_console@21 (229 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	222.212s
=== internal_console@22 (218 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	211.165s
=== internal_console@23 (230 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/console	221.828s
=== lists: internal_console 217 s, internal_edge 158 s, internal_activator 138 s, internal_host 212 s, root 159 s, internal_grouproll 72 s
=== cpu: the gate used 12685 cpu-seconds in 523 s, about 24.3 of 32 cores; the machine as a whole was 81% busy
=== opentofu ===
opentofu: 37 test files in 11 suites, OpenTofu v1.13.9
  initialised in 14 s
  ok      19 s  infra/modules/box-fence-writer/tests/writer.tftest.hcl  Success! 1 passed, 0 failed.
  ok      30 s  infra/modules/deployment-buckets/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      20 s  infra/modules/deployment-buckets/tests/db_reads.tftest.hcl  Success! 1 passed, 0 failed.
  ok      22 s  infra/modules/deployment-buckets/tests/evidence.tftest.hcl  Success! 1 passed, 0 failed.
  ok      32 s  infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl  Success! 3 passed, 0 failed.
  ok      29 s  infra/modules/deployment-buckets/tests/media_results.tftest.hcl  Success! 2 passed, 0 failed.
  ok      86 s  infra/modules/media-engine/tests/media_engine.tftest.hcl  Success! 24 passed, 0 failed.
  ok      36 s  infra/modules/pdf-host/tests/computed.tftest.hcl  Success! 2 passed, 0 failed.
  ok      58 s  infra/modules/pdf-host/tests/pdf_host.tftest.hcl  Success! 24 passed, 0 failed.
  ok      41 s  infra/modules/region-group-operator-document/tests/document.tftest.hcl  Success! 12 passed, 0 failed.
  ok      18 s  infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl  Success! 2 passed, 0 failed.
  ok      59 s  infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl  Success! 30 passed, 0 failed.
  ok      45 s  infra/modules/region-host/tests/alert_publish.tftest.hcl  Success! 18 passed, 0 failed.
  ok      41 s  infra/modules/region-host/tests/alerts_topic.tftest.hcl  Success! 16 passed, 0 failed.
  ok      12 s  infra/modules/region-host/tests/analytics_prune.tftest.hcl  Success! 2 passed, 0 failed.
  ok      17 s  infra/modules/region-host/tests/console_mail.tftest.hcl  Success! 4 passed, 0 failed.
  ok       9 s  infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl  Success! 1 passed, 0 failed.
  ok      70 s  infra/modules/region-host/tests/group.tftest.hcl  Success! 32 passed, 0 failed.
  ok      10 s  infra/modules/region-host/tests/group_alarms.tftest.hcl  Success! 4 passed, 0 failed.
  ok      11 s  infra/modules/region-host/tests/group_iam.tftest.hcl  Success! 4 passed, 0 failed.
  ok       7 s  infra/modules/region-host/tests/group_isolation.tftest.hcl  Success! 1 passed, 0 failed.
  ok      35 s  infra/modules/region-host/tests/group_operator.tftest.hcl  Success! 13 passed, 0 failed.
  ok       9 s  infra/modules/region-host/tests/group_user_data.tftest.hcl  Success! 3 passed, 0 failed.
  ok      27 s  infra/modules/region-host/tests/health_alarms.tftest.hcl  Success! 10 passed, 0 failed.
  ok      10 s  infra/modules/region-host/tests/ingress_drain_read.tftest.hcl  Success! 4 passed, 0 failed.
  ok       6 s  infra/modules/region-host/tests/instance_metadata.tftest.hcl  Success! 1 passed, 0 failed.
  ok      21 s  infra/modules/region-host/tests/mailer.tftest.hcl  Success! 6 passed, 0 failed.
  ok      12 s  infra/modules/region-host/tests/mailer_group.tftest.hcl  Success! 2 passed, 0 failed.
  ok      14 s  infra/modules/region-host/tests/managed_fleets/group_refusal.tftest.hcl  Success! 2 passed, 0 failed.
  ok     107 s  infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl  Success! 46 passed, 0 failed.
  ok      70 s  infra/modules/region-host/tests/store_conversion.tftest.hcl  Success! 27 passed, 0 failed.
  ok      18 s  infra/modules/region-host/tests/store_scanning.tftest.hcl  Success! 4 passed, 0 failed.
  ok      31 s  infra/modules/region-host/tests/store_versioning.tftest.hcl  Success! 11 passed, 0 failed.
  ok      20 s  infra/modules/region-host/tests/user_data_ignored.tftest.hcl  Success! 3 passed, 0 failed.
  ok      12 s  infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      16 s  infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl  Success! 5 passed, 0 failed.
  ok      28 s  infra/modules/scanner-host/tests/scanner_host.tftest.hcl  Success! 14 passed, 0 failed.
opentofu: 37 files in 208 s
opentofu: PASS
=== cross ===
--- shard 0 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/arm64
--- shard 1 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/amd64
--- shard 2 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling linux/arm64
linux/arm64 carlos binary: 66257058 bytes (ceiling 70000000)
--- shard 3 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling windows/amd64
--- shard 4 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling windows/arm64
=== minio-contract ===
go version go1.26.10 linux/arm64
minio contract: arm64, minio RELEASE.2025-09-07T16-13-09Z, mc RELEASE.2025-08-13T08-35-41Z
  minio: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/minio/minio.linux-arm64.RELEASE.2025-09-07T16-13-09Z
  minio: downloaded, digest verified
  mc: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/minio/mc.linux-arm64.RELEASE.2025-08-13T08-35-41Z
  mc: downloaded, digest verified
  minio healthy on 127.0.0.1:32831
Added `local` successfully.
Bucket created successfully `local/contract-bucket`.
Bucket created successfully `local/denied-bucket`.
Created policy `contract-only` successfully.
Added user `scopeduser` successfully.
Attached Policies: [contract-only]
To User: scopeduser
  buckets and scoped user ready
=== RUN   TestDeliveredContractMinio
=== RUN   TestDeliveredContractMinio/put
=== RUN   TestDeliveredContractMinio/get_round-trips_the_body
=== RUN   TestDeliveredContractMinio/list_shows_the_key
=== RUN   TestDeliveredContractMinio/head_and_list_agree_on_the_version
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed
=== RUN   TestDeliveredContractMinio/delete_removes_it
=== RUN   TestDeliveredContractMinio/cross-bucket_denial
--- PASS: TestDeliveredContractMinio (0.03s)
    --- PASS: TestDeliveredContractMinio/put (0.00s)
    --- PASS: TestDeliveredContractMinio/get_round-trips_the_body (0.00s)
    --- PASS: TestDeliveredContractMinio/list_shows_the_key (0.00s)
    --- PASS: TestDeliveredContractMinio/head_and_list_agree_on_the_version (0.00s)
    --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload (0.00s)
    --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route (0.02s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed (0.00s)
    --- PASS: TestDeliveredContractMinio/delete_removes_it (0.00s)
    --- PASS: TestDeliveredContractMinio/cross-bucket_denial (0.00s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.038s
=== RUN   TestT4StorageProbeMinio
2026/11/25 18:04:06 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18EB5BD4ED356157, HostID: 13137d87cb714c8c05e1dff13a2f463fc9cdcb2adce6fb12fe452fcc325ecb1c, api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
--- PASS: TestT4StorageProbeMinio (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/host	0.042s
=== RUN   TestS3StoreMinioContract
=== RUN   TestS3StoreMinioContract/conditional_get_and_etag_listing
=== RUN   TestS3StoreMinioContract/bump_through_every_mutation_path
--- PASS: TestS3StoreMinioContract (0.03s)
    --- PASS: TestS3StoreMinioContract/conditional_get_and_etag_listing (0.01s)
    --- PASS: TestS3StoreMinioContract/bump_through_every_mutation_path (0.02s)
PASS
ok  	github.com/carlosframework/platform/internal/release	0.041s
Bucket created successfully `local/analytics-versions`.
local/analytics-versions versioning is enabled
Created policy `analytics-versions` successfully.
Added user `analyticsversions` successfully.
Attached Policies: [analytics-versions]
To User: analyticsversions
=== RUN   TestS3StoreMinioVersions
--- PASS: TestS3StoreMinioVersions (0.03s)
PASS
ok  	github.com/carlosframework/platform/internal/release	0.041s
Bucket created successfully `local/store-versioned`.
local/store-versioned versioning is enabled
Created policy `store-versioned` successfully.
Added user `storeversioned` successfully.
Attached Policies: [store-versioned]
To User: storeversioned
=== RUN   TestVersionedContractMinio
--- PASS: TestVersionedContractMinio (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.020s
=== RUN   TestEndToEndMinio
=== RUN   TestEndToEndMinio/plan
=== RUN   TestEndToEndMinio/roll
=== RUN   TestEndToEndMinio/replace
=== RUN   TestEndToEndMinio/remove
--- PASS: TestEndToEndMinio (0.46s)
    --- PASS: TestEndToEndMinio/plan (0.01s)
    --- PASS: TestEndToEndMinio/roll (0.12s)
    --- PASS: TestEndToEndMinio/replace (0.15s)
    --- PASS: TestEndToEndMinio/remove (0.15s)
PASS
ok  	github.com/carlosframework/platform/internal/grouproll	0.471s
Bucket created successfully `local/dbf-deploy`.
Bucket created successfully `local/dbf-data-ie`.
Bucket created successfully `local/dbf-data-uk`.
local/dbf-deploy versioning is enabled
Created policy `dbf-console` successfully.
Created policy `dbf-ukbox` successfully.
Added user `dbfconsole` successfully.
Added user `dbfukbox` successfully.
Attached Policies: [dbf-console]
To User: dbfconsole
Attached Policies: [dbf-ukbox]
To User: dbfukbox
=== RUN   TestDBForwardMinio
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/25 18:04:13 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/25 18:04:13 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/25 18:04:13 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/25 18:04:13 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/25 18:04:13 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/25 18:04:13 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/25 18:04:13 console: could not notify member@example.com of a CLI token issue: keymail: lookup member@example.com: keymail: GET /api/federation/lookup?addr=member%40example.com&from=console%40127.0.0.1%3A41907: could not determine target mailbox
    agent.go:136: dbreads: dbr_fvtwk5xz3nrcbcody3nvbxxnj4: planned 3 files (1544 bytes) and restored to 3 in 15ms
    agent.go:136: dbreads: dbr_fvtwk5xz3nrcbcody3nvbxxnj4: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/25 18:04:14 console: db read dbr_fvtwk5xz3nrcbcody3nvbxxnj4: relayed 1 chunks (102 bytes) in 1.006s, ended done
    agent.go:136: dbreads: dbr_qcmddqfsiqpvbnjaaij63x5xci: planned 1 files (720 bytes) and restored to 1 in 11ms
    agent.go:136: dbreads: dbr_qcmddqfsiqpvbnjaaij63x5xci: output 5 bytes in 1 confirmed chunks in 1ms
2026/11/25 18:04:15 console: db read dbr_qcmddqfsiqpvbnjaaij63x5xci: relayed 1 chunks (102 bytes) in 1.005s, ended done
    agent.go:136: dbreads: dbr_rxeb4lxgwgjefotjfcygx7i3iu: planned 3 files (1544 bytes) and held through 3 in 12ms
    agent.go:136: dbreads: dbr_rxeb4lxgwgjefotjfcygx7i3iu: output 1544 bytes in 1 confirmed chunks in 1ms
2026/11/25 18:04:16 console: db read dbr_rxeb4lxgwgjefotjfcygx7i3iu: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN   TestDBForwardMinio/by_disconnect
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_mvf2ygvd6psill4vc7mqd3ltqy: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/25 18:04:16 console: db read dbr_mvf2ygvd6psill4vc7mqd3ltqy: relayed 0 chunks (0 bytes) in 27ms, ended client gone
    agent.go:136: dbreads: dbr_mvf2ygvd6psill4vc7mqd3ltqy: output 5 bytes in 1 confirmed chunks in 104ms
=== RUN   TestDBForwardMinio/by_timeout
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_67oj7uyd2zlzuzappcuwz6ihe4: planned 3 files (1544 bytes) and restored to 3 in 12ms
2026/11/25 18:04:37 console: db read dbr_67oj7uyd2zlzuzappcuwz6ihe4: relayed 0 chunks (0 bytes) in 19.822s, ended no-result
    agent.go:136: dbreads: dbr_67oj7uyd2zlzuzappcuwz6ihe4: output 5 bytes in 1 confirmed chunks in 19.796s
--- PASS: TestDBForwardMinio (23.49s)
    --- PASS: TestDBForwardMinio/by_disconnect (0.24s)
    --- PASS: TestDBForwardMinio/by_timeout (19.93s)
PASS
ok  	github.com/carlosframework/platform/internal/console	23.537s
Bucket created successfully `local/media-transfers`.
Bucket created successfully `local/media-transfer-results`.
local/media-transfer-results versioning is enabled
Created policy `media-transfers` successfully.
Added user `mediatransfers` successfully.
Attached Policies: [media-transfers]
To User: mediatransfers
=== RUN   TestMediaTransfersMinio
    upload.go:117: codec: the store already holds video.mp4
    upload.go:117: codec: the store already holds video.m3u8
    upload.go:117: codec: the store already holds poster.jpg
--- PASS: TestMediaTransfersMinio (0.07s)
PASS
ok  	github.com/carlosframework/platform/internal/mediaaws	0.076s
Bucket created successfully `local/media-local-store`.
Bucket created successfully `local/media-local-results`.
Created policy `media-local` successfully.
Added user `medialocal` successfully.
Attached Policies: [media-local]
To User: medialocal
=== RUN   TestLocalEndToEndMinio
--- PASS: TestLocalEndToEndMinio (0.54s)
PASS
ok  	github.com/carlosframework/platform/internal/medialocal	0.547s
=== RUN   TestHeldHandoverTwoBoxMinio
2026/11/25 18:04:42 edge: mesh key: minted
2026/11/25 18:04:42 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/25 18:04:42 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/25 18:04:42 tenant admission is open. accepting tenant work
2026/11/25 18:04:42 activator: HA placement host=shop-c1698df7.example.test kind=Place ref=annie reason=roomiest generation=2026-11-25T18:04:42Z lock_generation=0
2026/11/25 18:04:42 lease: t8-c1698df7/shop-c1698df7.example.test: HA lease acquired in 4ms (first wake)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: started carlos-instance@shop\x2dc1698df7.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 6ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: carlos-instance@shop\x2dc1698df7.example.test.service launched in 7ms, healthy 0s later
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: woke in 20ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 7ms
2026/11/25 18:04:42 lease: t8-c1698df7/plain-c1698df7.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/25 18:04:42 activator: no replica for plain-c1698df7.example.test in s3://contract-bucket/t8-c1698df7/plain-c1698df7.example.test — booting fresh
2026/11/25 18:04:42 activator: plain-c1698df7.example.test: started carlos-instance@plain\x2dc1698df7.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 1ms, instance key 0s, env 4ms, control socket 0s, key gate 0s, logs 0s) 5ms, launch file 0s, gate 0s, root start 1ms)
2026/11/25 18:04:42 activator: plain-c1698df7.example.test: carlos-instance@plain\x2dc1698df7.example.test.service launched in 6ms, healthy 0s later
2026/11/25 18:04:42 activator: plain-c1698df7.example.test: woke in 93ms: checks 0s, lease 2ms, restore 19ms, identity 0s, protect 0s, spawn 7ms, replicate 66ms
2026/11/25 18:04:42 lease: t8-c1698df7/bot0.shop.bac.sidecar.internal: HA lease acquired in 4ms (first wake)
2026/11/25 18:04:42 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/25 18:04:42 activator: bot0.shop.bac.sidecar.internal: woke in 19ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, settle 0s, replicate 7ms
2026/11/25 18:04:42 activator: next-due probe plain-c1698df7.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/25 18:04:42 activator: plain-c1698df7.example.test hibernated
2026/11/25 18:04:42 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:00f38e4f1672577cf61f486aee6f34dd549e67b085bbe67b84e9c0b4d3444157) in 5ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/25 18:04:42 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/25 18:04:42 activator: next-due probe shop-c1698df7.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: released with a marker (clean true, txid 1, files 3:83213cfd98cd505f1161d3aaf560fb319f97b134299746eff333f1f97fc3eaa4) in 5ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/25 18:04:42 activator: shop-c1698df7.example.test hibernated
2026/11/25 18:04:42 lease: t8-c1698df7/shop-c1698df7.example.test: HA lease acquired in 3ms (clean marker)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: restored (other-box)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: started carlos-instance@shop\x2dc1698df7.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 0s, control socket 0s, key gate 0s, logs 0s) 1ms, launch file 0s, gate 0s, root start 1ms)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: carlos-instance@shop\x2dc1698df7.example.test.service launched in 2ms, healthy 0s later
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: woke in 88ms: checks 0s, lease 3ms, restore 27ms, identity 0s, protect 0s, spawn 2ms, replicate 55ms
2026/11/25 18:04:42 edge: ha-take shop-c1698df7.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/25 18:04:42 edge: forward shop-c1698df7.example.test: annie handed the request over to betty; sending it there (occurrence #1)
    hadrain_twobox_minio_linux_test.go:1238: drain report: {V:1 Transaction:t8-witness Incarnation:30fb739c105ff6f81f800dfe3f976300 Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-25 18:04:42.385492861 +0000 UTC FinishedAt:2026-11-25 18:04:42.532875399 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-c1698df7.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:plain-c1698df7.example.test Kind:other Marker:true Clean:true Reason:} {Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:116 Todays:0 RefusedAtOnce:1} Closed:0 Quiet:{DrainQuiet:{Waking:0 Stopping:0 Recovering:0 Owed:0} Held:[]}}
    hadrain_twobox_minio_linux_test.go:1239: driver calls: [begin shop-c1698df7.example.test <nil> stop plain-c1698df7.example.test marker=true clean=true <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> releasing shop-c1698df7.example.test <nil> stop shop-c1698df7.example.test marker=true clean=true <nil> taken shop-c1698df7.example.test betty <nil> end-moves]
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/bot0.shop.bac.sidecar.internal/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/bot0.shop.bac.sidecar.internal/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/bot0.shop.bac.sidecar.internal/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/bot0.shop.bac.sidecar.internal/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/bot0.shop.bac.sidecar.internal/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/bot0.shop.bac.sidecar.internal/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-c1698df7/plain-c1698df7.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/bot0.shop.bac.sidecar.internal/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/head.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/generations/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/files/0/manifest.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/files/0/objects/0000000000000001-f97124367d31506b68abe9ac18b654cad4da3ebbb51c77d2a5d25062eac592a1
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/files/0/objects/0000000000000003-7d7cb8ab7856cb646a9ce1687f092e3f2bbcba7a30f81916d8d531381bfd6fcf
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/0000/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/0000/0000000000000002-0000000000000002.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-c1698df7/shop-c1698df7.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-c1698df7/shop-c1698df7.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1243: drain took 197ms; S3 calls 51 (DELETE lock=1 GET files=3 GET head=1 GET lock=3 GET replica=2 LIST replica=34 PUT lock=3 PUT replica=4); deployment store calls 20 (GET edges=14 LIST edges=4 PUT edges=2)
    hadrain_twobox_minio_linux_test.go:1367: the fenced A's start gate answers 503 "This service is unavailable. Try again later.\n" (Retry-After "10")
2026/11/25 18:04:42 lease: t8-c1698df7/plain-c1698df7.example.test: acquired in 1ms (client 0s, lock read and write 1ms)
2026/11/25 18:04:42 activator: plain-c1698df7.example.test: started carlos-instance@plain\x2dc1698df7.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 0s, control socket 0s, key gate 0s, logs 0s) 0s, launch file 0s, gate 0s, root start 1ms)
2026/11/25 18:04:42 activator: plain-c1698df7.example.test: carlos-instance@plain\x2dc1698df7.example.test.service launched in 1ms, healthy 0s later
2026/11/25 18:04:42 lease: /tmp/carlos-minio-contract-kr9OBA/g/dw1832697968/data/instances/plain-c1698df7.example.test/plain-c1698df7.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/25 18:04:42 activator: plain-c1698df7.example.test: woke in 8ms: checks 0s, lease 1ms, restore 0s, identity 0s, protect 1ms, spawn 2ms, replicate 4ms
2026/11/25 18:04:42 activator: next-due probe shop-c1698df7.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/25 18:04:42 activator: shop-c1698df7.example.test: released with a marker (clean true, txid 2, files 3:83213cfd98cd505f1161d3aaf560fb319f97b134299746eff333f1f97fc3eaa4) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/25 18:04:42 activator: shop-c1698df7.example.test hibernated
2026/11/25 18:04:42 tenant admission is closed for shutdown
2026/11/25 18:04:42 activator: next-due probe plain-c1698df7.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/25 18:04:42 activator: plain-c1698df7.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.57s)
=== RUN   TestHeldHandoverLostLeaseMinio
2026/11/25 18:04:42 edge: mesh key: minted
2026/11/25 18:04:42 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/25 18:04:42 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/25 18:04:42 tenant admission is open. accepting tenant work
2026/11/25 18:04:42 activator: HA placement host=shop-22227252.example.test kind=Place ref=annie reason=roomiest generation=2026-11-25T18:04:42Z lock_generation=0
2026/11/25 18:04:42 lease: t8-22227252/shop-22227252.example.test: HA lease acquired in 3ms (first wake)
2026/11/25 18:04:42 activator: shop-22227252.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/25 18:04:42 activator: shop-22227252.example.test: started carlos-instance@shop\x2d22227252.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 5ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/25 18:04:42 activator: shop-22227252.example.test: carlos-instance@shop\x2d22227252.example.test.service launched in 7ms, healthy 0s later
2026/11/25 18:04:42 activator: shop-22227252.example.test: woke in 17ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 6ms
2026/11/25 18:04:42 activator: next-due probe shop-22227252.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/25 18:04:42 activator: final checkpoint shop-22227252.example.test: lease: release marker owed for s3://contract-bucket/t8-22227252/shop-22227252.example.test/lock.json (If-Match "89610f611247a8c083a6ddb12a6dfb95"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/25 18:04:42 activator: shop-22227252.example.test hibernated
2026/11/25 18:04:42 activator: handover of shop-22227252.example.test left: released without a marker; its held requests get today's answer
    hadrain_twobox_minio_linux_test.go:1469: the held request's hold ended "shop-22227252.example.test client 4 "
    hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-22227252.example.test <nil> releasing shop-22227252.example.test <nil> stop shop-22227252.example.test marker=false clean=false <nil> left shop-22227252.example.test released without a marker]
    hadrain_twobox_minio_linux_test.go:1487: a request after the loss: 503 "This instance cannot wake right now. Please try again shortly.\n" (Retry-After "10", holder "none", 0s, err <nil>)
2026/11/25 18:04:42 tenant admission is closed for shutdown
2026/11/25 18:04:42 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.27s)
PASS
ok  	github.com/carlosframework/platform/internal/host	0.881s
Bucket created successfully `local/gen-take`.
local/gen-take versioning is enabled
Created policy `gen-take` successfully.
Added user `gentake` successfully.
Attached Policies: [gen-take]
To User: gentake
=== RUN   TestGenerationTakeMinio
=== RUN   TestGenerationTakeMinio/take
2026/11/25 18:04:44 lease: instances/gen-1795629884060839845.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/25 18:04:44 lease: instances/gen-1795629884060839845.shop.example.com: HA lease acquired in 3ms (holder terminated)
    gentake_minio_test.go:308: a second create-only copy onto instances/gen-1795629884060839845.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/25 18:04:44 ERROR retention enforcement failed system=store db=w.example.com.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/25 18:04:44 ERROR enforce L0 time retention system=store db=w.example.com.db error="fetch l1 files: lease: a write has waited too long to reach storage (write fence)"
2026/11/25 18:04:44 http: proxy error: context canceled
2026/11/25 18:04:44 ERROR retention enforcement failed system=store db=w.example.com.db error="enforce snapshot retention: remove ltx files: lease: a write has waited too long to reach storage (write fence)"
=== RUN   TestGenerationTakeMinio/switch-412
2026/11/25 18:04:44 lease: instances/gen-1795629884183666790.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/25 18:04:44 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/25 18:04:44 lease: instances/gen-1795629884183666790.shop.example.com: HA lease acquired in 3ms (clean marker)
=== RUN   TestGenerationTakeMinio/copy-version
=== RUN   TestGenerationTakeMinio/store-time
2026/11/25 18:04:44 lease: instances/gen-1795629884280449817.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/25 18:04:44 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: fetch ltx files: lease: a write has waited too long to reach storage (write fence)"
2026/11/25 18:04:44 lease: instances/gen-1795629884280449817.shop.example.com: HA lease acquired in 2ms (clean marker)
2026/11/25 18:04:44 lease: instances/gen-1795629884280449817.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/25 18:04:44 lease: instances/gen-1795629884280449817.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/25 18:04:44 lease: instances/gen-1795629884280449817.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/25 18:04:44 lease: instances/gen-1795629884280449817.shop.example.com: HA lease acquired in 2ms (unclean marker)
=== RUN   TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.33s)
    --- PASS: TestGenerationTakeMinio/take (0.12s)
    --- PASS: TestGenerationTakeMinio/switch-412 (0.09s)
    --- PASS: TestGenerationTakeMinio/copy-version (0.01s)
    --- PASS: TestGenerationTakeMinio/store-time (0.10s)
    --- PASS: TestGenerationTakeMinio/skew (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/lease	0.341s
minio contract: PASS
=== staticcheck ===
go version go1.26.10 linux/arm64
go: downloading honnef.co/go/tools v0.8.2
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/sync v0.23.0
go: downloading golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
staticcheck: clean
=== govulncheck ===
go version go1.26.10 linux/arm64
go: downloading golang.org/x/vuln v1.8.0
go: downloading golang.org/x/telemetry v0.0.0-20260908163034-4bcc4b2ee518
go: downloading golang.org/x/tools v0.50.0
govulncheck: scanned github.com/carlosframework/platform, amadan.net/carlos/platform.git/launchctx
GO-2026-6859  called  stdlib@v1.26.10, fixed in v1.26.11
    HTTP/1 server crash due to MaxBytesReader header race in net/http
    excepted until 2027-01-31 (.amadan/govulncheck-exceptions.tsv:9): net/http MaxBytesReader header race, fixed in go1.26.11. CI and releases stay on go1.26.10 because 1.26.11 deadlocks the edge's Expect: 100-continue path (#897, .amadan/go-toolchain.sh); #904 checked every production MaxBytesReader site and found it unreachable.
GO-2026-5932  required  golang.org/x/crypto@v0.58.0, fixed in v0.58.1-0.20261009181718-2f1f834330b2
    The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues
    not fatal: no call path to the vulnerable code
govulncheck: clean (2 finding(s), none called outside .amadan/govulncheck-exceptions.tsv)
=== code-health ===
go version go1.26.10 linux/arm64
    codehealth_test.go:42: scanned in 1m48.756s
    codehealth_test.go:107: line metrics (code lines, then physical):
          file-lines  5471  7324  internal/activator activator_test.go
          file-lines  4210  7039  internal/console server.go
          file-lines  4175  6358  . apimode.go
          file-lines  3785  7224  internal/activator activator.go
          file-lines  3530  4459  . apimode_test.go
          file-lines  3261  3864  internal/registry registry_test.go
          file-lines  3209  6395  internal/host agent.go
          file-lines  3094  3992  internal/provision reconcile_test.go
          func-lines   870   891  internal/host plan14InstalledClaimLaunch
          func-lines   810  1275  internal/provision Reconcile
          func-lines   769  1242  internal/console (*Server).handleAPIInstanceCreate
          func-lines   688  1243  internal/host runAgent
          func-lines   571   908  internal/activator (*Service).doWakeOnce
          func-lines   538   546  internal/host runServingParkPeerNamespace
          func-lines   519   712  . runRoute
          func-lines   509   569  internal/host TestPagingIsRateLimited
          func-lines   494   809  internal/release adoptHost
          func-lines   441   500  internal/host TestRootInstanceStopExecStop
          func-lines   421   436  internal/host (*ClaimWakeAssembly).Build
          func-lines   421   437  internal/team TestFixture
          func-lines   412   414  internal/console TestDemoProtectionsSourceToLimitAndTakedown
          func-lines   408   485  . TestFleetAppServesThroughTheHub
          func-lines   402   406  internal/registry (*Registry).haJournal
          func-lines   400   868  internal/provision rootReadArchivedChain
          func-lines   399   732  internal/release PassFilter
          func-lines   390   398  internal/host runFilesSeedPreparationWithLive
          func-lines   383   406  internal/console TestDemoSourceToLiveAndUpdate
          func-lines   378   898  internal/edge (*Edge).ServeHTTP
          func-lines   374   377  internal/host plan14RequiredArtifactsRootRunner
          func-lines   371   417  internal/host TestRootEgressKernelProof
          func-lines   367   584  internal/console (*Server).handleAPIShip
          func-lines   366   636  cmd/console serve
          func-lines   364   371  internal/host testRootMigrationBootstrap
          func-lines   360   362  internal/edge TestDemoAPIAliasBoundary
          func-lines   357   358  internal/registry (*Registry).dispatchRemote
          func-lines   355   372  internal/host TestRootSandboxUpdateFromOldBox
          func-lines   343   354  internal/analytics Prune
          func-lines   340   353  internal/host newColdRootHarness
          func-lines   335   557  internal/console (*Store).migrate
          func-lines   334   334  internal/host TestPlan12RecoveryRestoreSourceDatabase
          func-lines   330   371  internal/edge TestRegionalNameNeverLeavesItsRegion
          func-lines   329   471  . runDeploy
          func-lines   329   329  internal/host TestPlan12RecoveryRestoreSourceDatabase.func1
          func-lines   327   369  internal/edge TestTunnelWebSocketEndToEnd
          func-lines   325   455  internal/objstore TestDeliveredContractMinio
          func-lines   320   654  internal/appconfig SyncExecWithCallbacks
          func-lines   315   318  internal/host plan14TimerIntention
          func-lines   311   314  internal/host plan14TimerIntention.func1
          func-lines   310   315  internal/hostbox ColdHandover.Run
          func-lines   308   309  internal/host rootFilesSeedIsolatedWitness
          func-lines   305   323  internal/host hairpinKernelWitness
          func-lines   304   308  internal/console TestHAP2ProductionDoors
          func-lines   302   329  internal/host TestRootG2PoolIngress
        release-importers: . cmd/console internal/activator internal/analytics internal/appconfig internal/apperr internal/applog internal/apppolicy internal/boxid internal/boxvolumes internal/console internal/dbreads internal/dbreads/dbreadstest internal/dbverify internal/demobuild internal/domains internal/doorkey internal/edge internal/edgeproof internal/edgesfile internal/fleetapi internal/grouproll internal/grouprollaws internal/historyreadback internal/host internal/hostactors internal/hostbox internal/hostclaim internal/hostevidence internal/hostexec internal/hostfence internal/hostfiles internal/hostfloor internal/hostguard internal/hostops internal/hostrelocate internal/hostresolve internal/instancectl internal/instanceupdates internal/interactive internal/layout internal/lease internal/ledger internal/mail internal/mailer internal/mailsubmit internal/metrics internal/moves internal/objstore internal/ops internal/park internal/plans internal/provision internal/relay internal/rollout internal/rootfsimage internal/runs internal/s3fake internal/schedule internal/seeds internal/status internal/telemetry internal/usage internal/vet scripts/pathmapcheck scripts/witness-pointer
        not scanned (214 files):
          cmd/carlos-media/drill_other.go: built only for other systems or tags
          cmd/carlos-media/harden_other.go: built only for other systems or tags
          cmd/console/fleetsocket_other.go: built only for other systems or tags
          cmd/console/servelock_windows.go: built only for other systems or tags
          cmd/moveprobe/detach_windows.go: built only for other systems or tags
          cmd/rootfswitness/mmap_other.go: built only for other systems or tags
          devbox_acl_other.go: built only for other systems or tags
          devbox_envfile_darwin_test.go: built only for other systems or tags
          devbox_envfile_other.go: built only for other systems or tags
          domains_transfer_signals_other.go: built only for other systems or tags
          interactive_term_darwin.go: built only for other systems or tags
          interactive_term_other.go: built only for other systems or tags
          internal/activator/claimprocess_root_other.go: built only for other systems or tags
          internal/activator/escrow_stamp_other.go: built only for other systems or tags
          internal/activator/fleetreserve_other.go: built only for other systems or tags
          internal/activator/harecord_other.go: built only for other systems or tags
          internal/activator/ownenv_other.go: built only for other systems or tags
          internal/activator/pty_other.go: built only for other systems or tags
          internal/activator/race_on_test.go: built only for other systems or tags
          internal/activator/rolelaunch_other.go: built only for other systems or tags
          internal/assetcache/statfs_other.go: built only for other systems or tags
          internal/boxself/io_other.go: built only for other systems or tags
          internal/cgroup/cleanup_other.go: built only for other systems or tags
          internal/cgroup/cleanup_other_test.go: built only for other systems or tags
          internal/cgroup/hostprocs_other.go: built only for other systems or tags
          internal/cgroup/recreate_other.go: built only for other systems or tags
          internal/cgroup/role_other.go: built only for other systems or tags
          internal/cgroup/shim_other.go: built only for other systems or tags
          internal/cgroup/strict_other.go: built only for other systems or tags
          internal/cgroup/verify_other.go: built only for other systems or tags
          internal/console/claim_sql_identity_other.go: built only for other systems or tags
          internal/console/geoipverify_other.go: built only for other systems or tags
          internal/console/hostreports_process_other.go: built only for other systems or tags
          internal/console/replicaview_other.go: built only for other systems or tags
          internal/console/restore_sim_nice_other_test.go: built only for other systems or tags
          internal/console/scalecost_other_test.go: built only for other systems or tags
          internal/console/seedscratch_windows.go: built only for other systems or tags
          internal/dbreads/worker_other.go: built only for other systems or tags
          internal/demobuild/security_other.go: built only for other systems or tags
          internal/democlaim/source_other.go: built only for other systems or tags
          internal/devbox/peer_darwin.go: built only for other systems or tags
          internal/devbox/peer_darwin_test.go: built only for other systems or tags
          internal/devbox/peer_other.go: built only for other systems or tags
          internal/devbox/socketcheck_other.go: built only for other systems or tags
          internal/edge/devboxpeer_other.go: built only for other systems or tags
          internal/edge/hairpin_other.go: built only for other systems or tags
          internal/edge/heldbudget_other.go: built only for other systems or tags
          internal/edge/purge_listen_unix.go: built only for other systems or tags
          internal/edge/purge_listen_windows.go: built only for other systems or tags
          internal/edge/race_on_test.go: built only for other systems or tags
          internal/edge/replicaconsole_owner_other.go: built only for other systems or tags
          internal/edge/replicaconsole_peer_other.go: built only for other systems or tags
          internal/edge/replicaconsole_socket_other_test.go: built only for other systems or tags
          internal/edge/static_artifact_other.go: built only for other systems or tags
          internal/edge/static_recordlock_other.go: built only for other systems or tags
          internal/edge/static_sweep_other.go: built only for other systems or tags
          internal/execsandbox/cleanup_other.go: built only for other systems or tags
          internal/execsandbox/file_other.go: built only for other systems or tags
          internal/execsandbox/oci_other.go: built only for other systems or tags
          internal/fileacl/fileacl_darwin.go: built only for other systems or tags
          internal/fileacl/fileacl_darwin_amd64.s: built only for other systems or tags
          internal/fileacl/fileacl_darwin_arm64.s: built only for other systems or tags
          internal/fileacl/fileacl_darwin_test.go: built only for other systems or tags
          internal/grouproll/state_other.go: built only for other systems or tags
          internal/grouprollaws/pty_darwin.go: built only for other systems or tags
          internal/grouprollaws/pty_other.go: built only for other systems or tags
          internal/hairpin/native_other.go: built only for other systems or tags
          internal/host/applylock_other_test.go: built only for other systems or tags
          internal/host/bootstrapfs_other.go: built only for other systems or tags
          internal/host/boxroles_config_other.go: built only for other systems or tags
          internal/host/claimfilesseed_delegation_other.go: built only for other systems or tags
          internal/host/claimfilesseed_transport_other.go: built only for other systems or tags
          internal/host/claimjournal_containment_other.go: built only for other systems or tags
          internal/host/claimjournal_migration_other.go: built only for other systems or tags
          internal/host/claimlaunch_kernel_other.go: built only for other systems or tags
          internal/host/claimlaunch_rev2_other_test.go: built only for other systems or tags
          internal/host/claimproduction_other.go: built only for other systems or tags
          internal/host/claimready_other.go: built only for other systems or tags
          internal/host/claimroleassembly_other.go: built only for other systems or tags
          internal/host/claimservingartifact_other.go: built only for other systems or tags
          internal/host/claimservinghandover_reboot_other.go: built only for other systems or tags
          internal/host/claimservinghandover_reboot_other_test.go: built only for other systems or tags
          internal/host/claimservingpark_other.go: built only for other systems or tags
          internal/host/claimstate_other.go: built only for other systems or tags
          internal/host/claimstop_kernel_other.go: built only for other systems or tags
          internal/host/claimtoken_inventory_other.go: built only for other systems or tags
          internal/host/claimunit_dropin_other.go: built only for other systems or tags
          internal/host/claimunit_files_other.go: built only for other systems or tags
          internal/host/claimunit_migrate_other.go: built only for other systems or tags
          internal/host/claimunit_ready_other.go: built only for other systems or tags
          internal/host/claimunit_socket_migration_other.go: built only for other systems or tags
          internal/host/consolefleet_owner_other.go: built only for other systems or tags
          internal/host/dbreads_other.go: built only for other systems or tags
          internal/host/egress_rail_other.go: built only for other systems or tags
          internal/host/fileowner_other.go: built only for other systems or tags
          internal/host/flock_windows.go: built only for other systems or tags
          internal/host/group_config_other.go: built only for other systems or tags
          internal/host/group_maintenance_other.go: built only for other systems or tags
          internal/host/group_maintenance_verbs_other.go: built only for other systems or tags
          internal/host/group_receipt_other.go: built only for other systems or tags
          internal/host/hadrain_call_other.go: built only for other systems or tags
          internal/host/hadrain_socket_other.go: built only for other systems or tags
          internal/host/hadrainfence_other.go: built only for other systems or tags
          internal/host/headroom_other.go: built only for other systems or tags
          internal/host/installchannel_other.go: built only for other systems or tags
          internal/host/managedboot_other.go: built only for other systems or tags
          internal/host/metrics_nested_other.go: built only for other systems or tags
          internal/host/movesfloor_other.go: built only for other systems or tags
          internal/host/movesfloorgate_other.go: built only for other systems or tags
          internal/host/movesheldrelease_other.go: built only for other systems or tags
          internal/host/movesmeasure_other.go: built only for other systems or tags
          internal/host/offcloudcredentials_other.go: built only for other systems or tags
          internal/host/registrychild_exec_other.go: built only for other systems or tags
          internal/host/registrychild_other.go: built only for other systems or tags
          internal/host/registryowner_chown_other.go: built only for other systems or tags
          internal/host/registryowner_descriptor_unix.go: built only for other systems or tags
          internal/host/replicahealth_other.go: built only for other systems or tags
          internal/host/rootgeneration_census_other.go: built only for other systems or tags
          internal/host/rootgeneration_kernel_other.go: built only for other systems or tags
          internal/host/rootgeneration_payload_other.go: built only for other systems or tags
          internal/host/rootgeneration_retired_other.go: built only for other systems or tags
          internal/host/rootmigration_production_other.go: built only for other systems or tags
          internal/host/runscset_other.go: built only for other systems or tags
          internal/host/sandboxenv_other.go: built only for other systems or tags
          internal/host/statfs_windows.go: built only for other systems or tags
          internal/host/systemapply_other.go: built only for other systems or tags
          internal/hostbox/census_vendor_other.go: built only for other systems or tags
          internal/hostbox/inventory_identity_other.go: built only for other systems or tags
          internal/hostbox/journalmigration_other.go: built only for other systems or tags
          internal/hostbox/journalnamespace_other.go: built only for other systems or tags
          internal/hostbox/journaltrust_other.go: built only for other systems or tags
          internal/hostbox/migration_census_other.go: built only for other systems or tags
          internal/hostbox/typedpark_other.go: built only for other systems or tags
          internal/hostenv/group_other.go: built only for other systems or tags
          internal/hostenv/write_other.go: built only for other systems or tags
          internal/hostenv/write_other_test.go: built only for other systems or tags
          internal/hostexec/clock_other.go: built only for other systems or tags
          internal/hostexec/clock_other_test.go: built only for other systems or tags
          internal/hostexec/local_other.go: built only for other systems or tags
          internal/hostexec/pending_other.go: built only for other systems or tags
          internal/hostexec/probe_other.go: built only for other systems or tags
          internal/hostexec/rootprocess_other.go: built only for other systems or tags
          internal/hostfiles/dir_other.go: built only for other systems or tags
          internal/hostfiles/refuse_other.go: built only for other systems or tags
          internal/hostfiles/watch_other.go: built only for other systems or tags
          internal/hostfloor/controllers_other.go: built only for other systems or tags
          internal/hostfloor/image_other.go: built only for other systems or tags
          internal/hostguard/flock_other.go: built only for other systems or tags
          internal/hostguard/flock_other_test.go: built only for other systems or tags
          internal/hostguard/record_other.go: built only for other systems or tags
          internal/instancectl/claimexec_other.go: built only for other systems or tags
          internal/instancectl/claimexec_socket_other.go: built only for other systems or tags
          internal/instancectl/claimlaunch_snapshot_other.go: built only for other systems or tags
          internal/instancectl/claimnetwork_other.go: built only for other systems or tags
          internal/instancectl/demo_snapshot_other.go: built only for other systems or tags
          internal/instancectl/egress_cgroup_other.go: built only for other systems or tags
          internal/instancectl/egress_dropin_other.go: built only for other systems or tags
          internal/instancectl/fleetsize_other.go: built only for other systems or tags
          internal/instancectl/gvisorprobe_other.go: built only for other systems or tags
          internal/instancectl/peer_other.go: built only for other systems or tags
          internal/instancectl/peer_tuple_other.go: built only for other systems or tags
          internal/instancectl/rootfs_identity_other.go: built only for other systems or tags
          internal/instanceexec/claimexec_other.go: built only for other systems or tags
          internal/instanceexec/exec_rootfs_other.go: built only for other systems or tags
          internal/instanceexec/probe_gvisor_other.go: built only for other systems or tags
          internal/instanceexec/probe_hardening_other.go: built only for other systems or tags
          internal/instanceexec/probe_other.go: built only for other systems or tags
          internal/instanceexec/probe_rootfs_other.go: built only for other systems or tags
          internal/instanceexec/sandbox_other.go: built only for other systems or tags
          internal/instanceexec/scope_other.go: built only for other systems or tags
          internal/instanceexec/stop_other.go: built only for other systems or tags
          internal/instanceexec/tty_other.go: built only for other systems or tags
          internal/instancefs/instancefs_other.go: built only for other systems or tags
          internal/launchd/activate_darwin.go: built only for other systems or tags
          internal/launchd/activate_darwin_amd64.s: built only for other systems or tags
          internal/launchd/activate_darwin_arm64.s: built only for other systems or tags
          internal/launchd/activate_darwin_test.go: built only for other systems or tags
          internal/layout/journal_other.go: built only for other systems or tags
          internal/layout/links_other.go: built only for other systems or tags
          internal/mailer/keys_other.go: built only for other systems or tags
          internal/maintenanceexec/run_other.go: built only for other systems or tags
          internal/managedboot/admission_other.go: built only for other systems or tags
          internal/managedboot/identity_other.go: built only for other systems or tags
          internal/mediahandler/collect_other.go: built only for other systems or tags
          internal/mediahandler/procs_other.go: built only for other systems or tags
          internal/medialocal/runner_other.go: built only for other systems or tags
          internal/moves/archive/open_other.go: built only for other systems or tags
          internal/moves/archive/sync_other.go: built only for other systems or tags
          internal/ops/flock_windows.go: built only for other systems or tags
          internal/park/local_other.go: built only for other systems or tags
          internal/privatefile/io_other.go: built only for other systems or tags
          internal/proxyproto/peek_other.go: built only for other systems or tags
          internal/relay/race_on_test.go: built only for other systems or tags
          internal/release/consumedfence_other.go: built only for other systems or tags
          internal/release/digestcache_other.go: built only for other systems or tags
          internal/rootaws/credentials_other.go: built only for other systems or tags
          internal/rootaws/open_darwin.go: built only for other systems or tags
          internal/rootfsimage/dir_other.go: built only for other systems or tags
          internal/rootstate/authoritydir_other.go: built only for other systems or tags
          internal/rootstate/authorityfile_other.go: built only for other systems or tags
          internal/rootstate/file_other.go: built only for other systems or tags
          internal/rootstate/link_other.go: built only for other systems or tags
          internal/rootstate/persistent_other.go: built only for other systems or tags
          internal/rootstate/state_other.go: built only for other systems or tags
          internal/safefile/file_other.go: built only for other systems or tags
          internal/safefile/reap_other.go: built only for other systems or tags
          internal/stopevidence/fds_other.go: built only for other systems or tags
          internal/stopevidence/fds_other_test.go: built only for other systems or tags
          internal/stopevidence/holders_other.go: built only for other systems or tags
          internal/stopevidence/reconstruct_other.go: built only for other systems or tags
          internal/team/storelock_other.go: built only for other systems or tags
          internal/team/storelock_windows.go: built only for other systems or tags
          move_offline_run_other.go: built only for other systems or tags
          system_group_other.go: built only for other systems or tags
        
    codehealth_test.go:115: fatal               1094 at  474 sites  log.Fatal*, (*log.Logger).Fatal* and os.Exit in the root package's production files
    codehealth_test.go:115: sleep               1005 at  811 sites  time.Sleep in test files
    codehealth_test.go:115: db-no-context        885 at  703 sites  database calls with no context (dbOpWithoutContext) in production files
    codehealth_test.go:115: host-context         188 at  142 sites  context.Background and context.TODO in internal/host production files
    codehealth_test.go:115: func-lines         18604 at   45 sites  functions over 300 code lines (blank and comment-only lines not counted)
    codehealth_test.go:115: file-lines         30735 at    8 sites  files over 3,000 code lines, counted the same way
    codehealth_test.go:115: release-importers     66 at    1 sites  packages whose production files import internal/release
--- PASS: TestCodeHealth (108.76s)
PASS
ok  	github.com/carlosframework/platform/internal/codehealth	109.826s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: comparing with the merge base c340dd431fdd4d6ecc709bdff22b0a6ce3253ec8 (main is c340dd431fdd4d6ecc709bdff22b0a6ce3253ec8)
=== RUN   TestRecordAgainstBase
--- PASS: TestRecordAgainstBase (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/codehealth	0.008s
code-health record: no line went up without a reason
=== race ===
go version go1.26.10 linux/arm64
GATE_RACE=1 .amadan/test-gate.sh
=== internal_systemd@0 (14 s, from +13 s)
ok  	github.com/carlosframework/platform/internal/systemd	12.964s
=== internal_rootaws@0 (26 s, from +34 s)
ok  	github.com/carlosframework/platform/internal/rootaws	25.286s
=== internal_activator@0 (266 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	263.799s
=== internal_activator@1 (264 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	261.759s
=== internal_activator@2 (277 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	274.773s
=== internal_activator@3 (417 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	414.130s
=== internal_activator@4 (275 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	272.767s
=== internal_activator@5 (311 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	308.370s
=== internal_activator@6 (320 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	317.675s
=== internal_activator@7 (410 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	407.624s
=== internal_edge@0 (84 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	81.227s
=== internal_edge@1 (81 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	78.325s
=== internal_edge@2 (199 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	195.859s
=== internal_edge@3 (141 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	138.151s
=== internal_edge@4 (161 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	157.764s
=== internal_edge@5 (217 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	214.462s
=== internal_edge@6 (227 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	224.190s
=== internal_edge@7 (206 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	203.357s
=== internal_edge@8 (221 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	218.207s
=== internal_edge@9 (278 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	275.089s
=== internal_edge@10 (215 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	212.246s
=== internal_edge@11 (216 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	212.645s
=== internal_edge@12 (299 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	296.187s
=== internal_edge@13 (296 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	292.907s
=== internal_edge@14 (200 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	197.079s
=== internal_edge@15 (242 s, from +133 s)
ok  	github.com/carlosframework/platform/internal/edge	238.926s
=== internal_host@0 (9 s, from +193 s)
ok  	github.com/carlosframework/platform/internal/host	4.908s
=== internal_host@1 (17 s, from +193 s)
ok  	github.com/carlosframework/platform/internal/host	13.098s
=== lists: internal_edge 132 s, internal_activator 111 s, internal_host 193 s, internal_rootaws 34 s, internal_systemd 13 s
=== cpu: the gate used 7627 cpu-seconds in 528 s, about 14.4 of 32 cores; the machine as a whole was 45% busy
=== gitleaks ===
go version go1.26.10 linux/arm64
go: downloading github.com/zricethezav/gitleaks/v8 v8.30.1
go: downloading github.com/rs/zerolog v1.33.0
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/spf13/viper v1.19.0
go: downloading github.com/mholt/archives v0.1.2
go: downloading github.com/gitleaks/go-gitdiff v0.9.1
go: downloading github.com/h2non/filetype v1.1.3
go: downloading github.com/charmbracelet/lipgloss v0.5.0
go: downloading github.com/BobuSumisu/aho-corasick v1.0.3
go: downloading golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa
go: downloading github.com/fatih/semgroup v1.2.0
go: downloading github.com/hashicorp/go-version v1.7.0
go: downloading github.com/Masterminds/sprig/v3 v3.3.0
go: downloading github.com/spf13/afero v1.12.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/magiconair/properties v1.8.9
go: downloading github.com/spf13/cast v1.7.1
go: downloading github.com/fsnotify/fsnotify v1.8.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/pelletier/go-toml/v2 v2.2.3
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading golang.org/x/sync v0.11.0
go: downloading github.com/muesli/termenv v0.15.1
go: downloading github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68
go: downloading github.com/mattn/go-runewidth v0.0.14
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading dario.cat/mergo v1.0.1
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.3.0
go: downloading github.com/huandu/xstrings v1.5.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/shopspring/decimal v1.4.0
go: downloading golang.org/x/crypto v0.35.0
go: downloading github.com/STARRY-S/zip v0.2.1
go: downloading github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3
go: downloading github.com/bodgit/sevenzip v1.6.0
go: downloading github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
go: downloading github.com/klauspost/compress v1.17.11
go: downloading github.com/klauspost/pgzip v1.2.6
go: downloading github.com/minio/minlz v1.0.0
go: downloading github.com/nwaples/rardecode/v2 v2.1.0
go: downloading github.com/pierrec/lz4/v4 v4.1.21
go: downloading github.com/sorairolake/lzip-go v0.3.5
go: downloading github.com/therootcompany/xz v1.0.1
go: downloading github.com/ulikunitz/xz v0.5.12
go: downloading golang.org/x/text v0.22.0
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/aymanbagabas/go-osc52/v2 v2.0.1
go: downloading golang.org/x/sys v0.30.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading go4.org v0.0.0-20230225012048-214862532bf5
go: downloading github.com/hashicorp/golang-lru/v2 v2.0.7
go: downloading github.com/bodgit/plumbing v1.3.0
go: downloading github.com/bodgit/windows v1.0.1
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading github.com/hashicorp/errwrap v1.1.0
self-test: reported source file: a key
self-test: reported source file: a 64-hex key
self-test: reported source file: a census-shaped entry
self-test: reported source file: a key marked gitleaks:allow
self-test: reported source file: a test's fake value outside tests
self-test: reported allowed file: another key beside its allowed value
self-test: reported a tracked file named gitleaks-gate-sentinel.env
self-test: reported 97 near misses of the names notscanned.go lists
self-test: skipped  the 32 files notscanned.go lists
self-test: refused  a notscanned.go entry git does not track
self-test: refused  a config that does not parse
self-test: refused  a config that does not exist
self-test: refused  a missing gitleaks binary
self-test: 6 planted keys reported, 130 tracked files judged, 3 broken setups refused
gitleaks: scanned 11559 tracked files; 32 not scanned, by exact path (scripts/gitleaks-gate/notscanned.go)
internal/host/managedboot_linux_test.go:37: generic-api-key
internal/managedboot/identity_linux_test.go:148: generic-api-key
internal/provision/managed_fleets_2b2_census_test.go:110: generic-api-key
gitleaks-gate: 3 findings above: remove the value and rotate it if it was ever real; a fake a test needs is allowed by exact value in .gitleaks.toml
exit status 1
make: *** [Makefile:142: gitleaks] Error 1

amadan: step gitleaks failed: exit status 2

amadan: job failed at step gitleaks — its output is above, not at the tail of this log
diff --git a/approved_rootfs_copy_test.go b/approved_rootfs_copy_test.go
index c6d3843a3..de55a3986 100644
--- a/approved_rootfs_copy_test.go
+++ b/approved_rootfs_copy_test.go
@@ -21,7 +21,7 @@ import (
const rootfsCopyRecordPath = "docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md"
// Canonical ids only: two digits from C01 to C99, three digits from C100
-// (Plan 4 runs to RFS-4-C146; RFS-4-C147 is the rootfs-default-home follow-up). No leading zero on a three-digit id, no C00.
+// (Plan 4 runs to RFS-4-C146; RFS-4-C147 is the rootfs-default-home follow-up, RFS-4-C155 the /etc/hosts one). No leading zero on a three-digit id, no C00.
var rootfsCopyIDPattern = regexp.MustCompile(`^RFS-[1-6]-C(0[1-9]|[1-9][0-9]{1,2})$`)
// rootfsCopyIDs is the deck's inventory, pinned as a literal list in the
@@ -82,7 +82,7 @@ var rootfsCopyIDs = []string{
"RFS-4-C33", "RFS-4-C34", "RFS-4-C35", "RFS-4-C36",
"RFS-4-C37", "RFS-4-C38", "RFS-4-C39", "RFS-4-C40",
"RFS-4-C41", "RFS-4-C42", "RFS-4-C43", "RFS-4-C44",
- "RFS-4-C45", "RFS-4-C46", "RFS-4-C47", "RFS-4-C147", "RFS-4-C48",
+ "RFS-4-C45", "RFS-4-C46", "RFS-4-C47", "RFS-4-C147", "RFS-4-C155", "RFS-4-C48",
"RFS-4-C49", "RFS-4-C50", "RFS-4-C51", "RFS-4-C52",
"RFS-4-C53", "RFS-4-C54", "RFS-4-C55", "RFS-4-C56",
"RFS-4-C57", "RFS-4-C58", "RFS-4-C59", "RFS-4-C60",
@@ -254,6 +254,8 @@ var rootfsCopyBuilt = []string{
"RFS-4-C141", "RFS-4-C142", "RFS-4-C143", "RFS-4-C144", "RFS-4-C146",
// rootfs-default-home (2026-11-01): HOME is /tmp unless set (docs/site/rootfs.md)
"RFS-4-C147",
+ // rootfs-etc-hosts-1349 (2026-11-22): carlos ship adds /etc/hosts (docs/site/rootfs.md)
+ "RFS-4-C155",
// rails-guide-run-console (2026-11-06): Commands and consoles on the
// Rootfs page and the Rails guide's pointer; RFS-4-C100 struck
"RFS-4-C148", "RFS-4-C149", "RFS-4-C150", "RFS-4-C151", "RFS-4-C152", "RFS-4-C153", "RFS-4-C154",
diff --git a/docs/site/changelog.json b/docs/site/changelog.json
index 8c28a0e21..1b9e2023a 100644
--- a/docs/site/changelog.json
+++ b/docs/site/changelog.json
@@ -2,6 +2,63 @@
"//": "Generated by go run ./cmd/changelog from git, the published release notes and Amadan. Do not edit; regenerate.",
"repo": "https://amadan.net/carlos/platform",
"releases": [
+ {
+ "tag": "v0.43.5",
+ "date": "2026-11-24",
+ "sha": "33148c5bc52b0ba9de939ef76e200f6500bd9ab0",
+ "published": true,
+ "notes_url": "https://github.com/carlosframework/releases/releases/tag/v0.43.5",
+ "notes": {
+ "form": "markdown",
+ "md": "#### What's new\n\n- **A new instance starts with its config.** The first time a new instance wakes, its process now starts with the app's config already in place. Before, the first start ran briefly without it and was then restarted.\n\n#### For operators\n\n- **Roll order.** Roll your development deployment first, then production. Boxes first, then the console. The fix is in the box agent and activator; nothing needs setting.\n- **Coming from v0.43.3 or older?** Read the v0.43.4 notes too."
+ },
+ "changes": [
+ {
+ "sha": "33148c5bc52b0ba9de939ef76e200f6500bd9ab0",
+ "date": "2026-11-24",
+ "subject": "A new instance's first process starts with its config",
+ "branch": "instance-ready-before-wake",
+ "branch_url": "https://amadan.net/carlos/platform/-/branch/instance-ready-before-wake",
+ "commits": 3,
+ "discussions": [
+ {
+ "id": 280,
+ "title": "Root trusts service-writable hostguard and health records under /data (claim root paths)",
+ "state": "open"
+ },
+ {
+ "id": 1386,
+ "title": "A new instance of an already staged build waits about 17 s for a whole-box root pass before it can wake",
+ "state": "open"
+ }
+ ],
+ "credit": [
+ {
+ "person": "Paul Campbell",
+ "agents": [
+ "claude"
+ ]
+ }
+ ]
+ },
+ {
+ "sha": "67a5b32da13c72d79b256e8b389a3f61e0ee41c2",
+ "date": "2026-11-24",
+ "subject": "changelog: regenerate through v0.43.4 (release step 11b)",
+ "branch": "changelog-v0.43.4",
+ "branch_url": "https://amadan.net/carlos/platform/-/branch/changelog-v0.43.4",
+ "commits": 1,
+ "credit": [
+ {
+ "person": "Paul Campbell",
+ "agents": [
+ "claude"
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"tag": "v0.43.4",
"date": "2026-11-24",
diff --git a/docs/site/live-streams-bring-your-own-livekit.md b/docs/site/live-streams-bring-your-own-livekit.md
new file mode 100644
index 000000000..5195a5e07
--- /dev/null
+++ b/docs/site/live-streams-bring-your-own-livekit.md
@@ -0,0 +1,234 @@
+# Live streams with your own LiveKit
+
+Your app can run a live stream with chat on your own [LiveKit Cloud](https://livekit.io) project. One person streams, viewers watch and chat, and LiveKit records the stream into your app's own store. Then your app converts the recording with [media conversion](/docs/media-conversion) and plays it back like any other upload.
+
+The platform does not run LiveKit for you here. Your app holds its own LiveKit key, talks to LiveKit Cloud directly, and LiveKit bills your own LiveKit account.
+
+## Before you start
+
+You need:
+
+- A LiveKit Cloud project. Its settings page gives you the project URL, such as `wss://shop-a1b2c3.livekit.cloud`, and an API key and secret.
+- An object store for the app, made with `carlos store create --app shop`, on a deployment with media conversion turned on. The store must pass the check on the media conversion page. A store made with `carlos store create` and left alone passes.
+- A Service credential for media conversion, as in [the media conversion example](/docs/media-conversion#an-example).
+
+What the platform needs from your app:
+
+- **No egress setting.** Instances can already reach public addresses, and LiveKit Cloud's API and project hosts are public. `carlos apps set --egress-allow` is only for private addresses, and it takes IP addresses, not hostnames.
+- **A public route for LiveKit's webhook.** LiveKit calls your app when a recording is done. Any path on your app's own hostname works, such as `https://shop.example.com/livekit/webhook`. A host behind [carlos gate](/docs/cli#carlos-gate) can't receive it, because the gate asks every request for the password.
+- **The store's region in every recording request.** If you leave both the region and endpoint out, LiveKit asks S3 for the bucket's location, and the store's credential isn't allowed to ask.
+- **No tags on recordings.** LiveKit can tag the files it uploads. Leave that empty: the store's credential can't tag objects, so S3 refuses the upload.
+
+## How it fits together
+
+```text
+# once
+carlos env set --app shop LIVEKIT_URL=wss://shop-a1b2c3.livekit.cloud
+carlos secrets set --app shop LIVEKIT_API_KEY=APIa1b2c3d4
+carlos secrets set --app shop LIVEKIT_API_SECRET - < livekit-secret.txt
+add https://shop.example.com/livekit/webhook as a webhook in the LiveKit project
+
+# per stream, on the app's server
+1. mint a token for the streamer and one for each viewer -> the browsers join the room
+2. start an Egress to the app's store -> LiveKit records the room
+3. LiveKit POSTs egress_ended to /livekit/webhook -> the recording's key
+4. POST the key to media conversion, poll until done -> the files to play
+```
+
+The API key and secret are secrets, so they go in with `carlos secrets set`. The `-` reads the secret from the file, so it never appears on your command line. The project URL isn't secret. Your browser code needs it too.
+
+The examples below are in Go, with LiveKit's server SDK (`github.com/livekit/server-sdk-go/v2`) and its protocol package (`github.com/livekit/protocol`). LiveKit's other server SDKs have the same calls.
+
+## Tokens for the streamer and the viewers
+
+A browser joins a LiveKit room with a token your server signs. Every token names the room, a participant identity and what that participant may do. Use your own user ID as the identity, so each person appears once.
+
+```go
+import (
+ "os"
+ "time"
+
+ "github.com/livekit/protocol/auth"
+)
+
+// joinToken lets one person into a stream's room. The streamer may publish
+// a camera and microphone; viewers only watch. Everyone may chat.
+func joinToken(room, identity, name string, streamer bool) (string, error) {
+ grant := &auth.VideoGrant{RoomJoin: true, Room: room}
+ grant.SetCanSubscribe(true)
+ grant.SetCanPublish(streamer)
+ grant.SetCanPublishData(true)
+ return auth.NewAccessToken(os.Getenv("LIVEKIT_API_KEY"), os.Getenv("LIVEKIT_API_SECRET")).
+ SetVideoGrant(grant).
+ SetIdentity(identity).
+ SetName(name).
+ SetValidFor(10 * time.Minute).
+ ToJWT()
+}
+```
+
+Set the chat permission even for viewers. If you leave it out, LiveKit gives each participant the same chat permission as their publish permission, so viewers couldn't chat.
+
+Your server decides who is the streamer. Mint a streamer token only for the person who owns the stream, and viewer tokens for everyone else allowed to watch. The token only has to be valid when the browser connects. LiveKit keeps a connected browser's session going after that.
+
+## Chat
+
+Chat travels as LiveKit data messages inside the room. In the browser, the LiveKit client sends reliable data messages and receives them through the `RoomEvent.DataReceived` event. Send each message as a small JSON object, such as `{"text": "hello"}`. One reliable message can carry up to 15 KiB.
+
+LiveKit doesn't store data messages. A viewer who joins late sees only the messages sent after they joined. If you want chat history or a record for moderation, have the browser also send each message to your server, and keep it there.
+
+To stop someone chatting, your server calls `UpdateParticipant` on LiveKit's room service with `CanPublishData` set to false. To remove them from the stream, it calls `RemoveParticipant`. Both are on `lksdk.NewRoomServiceClient`.
+
+## Recording into your store
+
+Your server starts an Egress, LiveKit's recorder, and points it at the app's store with the store's own credentials. The platform delivers them to every instance as `CARLOS_STORE_BUCKET`, `CARLOS_STORE_REGION`, `CARLOS_STORE_ACCESS_KEY` and `CARLOS_STORE_SECRET_KEY`.
+
+A room composite Egress records the room as one MP4, laid out the way a viewer sees it:
+
+```go
+import (
+ "context"
+ "os"
+
+ "github.com/livekit/protocol/livekit"
+ lksdk "github.com/livekit/server-sdk-go/v2"
+)
+
+func storeUpload() *livekit.S3Upload {
+ return &livekit.S3Upload{
+ AccessKey: os.Getenv("CARLOS_STORE_ACCESS_KEY"),
+ Secret: os.Getenv("CARLOS_STORE_SECRET_KEY"),
+ Region: os.Getenv("CARLOS_STORE_REGION"), // required: see Before you start
+ Bucket: os.Getenv("CARLOS_STORE_BUCKET"),
+ // No Tagging. The store refuses tagged uploads.
+ }
+}
+
+// startRecording records the whole room under recordings/<id>/.
+func startRecording(ctx context.Context, room, id string) (string, error) {
+ egress := lksdk.NewEgressClient(os.Getenv("LIVEKIT_URL"), os.Getenv("LIVEKIT_API_KEY"), os.Getenv("LIVEKIT_API_SECRET"))
+ info, err := egress.StartRoomCompositeEgress(ctx, &livekit.RoomCompositeEgressRequest{
+ RoomName: room,
+ Layout: "speaker",
+ FileOutputs: []*livekit.EncodedFileOutput{{
+ FileType: livekit.EncodedFileType_MP4,
+ Filepath: "recordings/" + id + "/",
+ Output: &livekit.EncodedFileOutput_S3{S3: storeUpload()},
+ }},
+ })
+ if err != nil {
+ return "", err
+ }
+ return info.EgressId, nil
+}
+```
+
+`Filepath` ends in `/`, so LiveKit names the file itself inside that folder, as `<room>-<time>.mp4`. That also keeps a retried recording from overwriting the first try. Don't record under `derived/`: media conversion won't take a source there.
+
+A track Egress records one track as it arrives. Video is not re-encoded. Audio is re-encoded as stereo Opus. LiveKit picks the file type from the track: WebM or MP4 for video, and Ogg for audio. Media conversion reads all three. Use it when you only need the streamer's camera or microphone:
+
+```go
+info, err := egress.StartTrackEgress(ctx, &livekit.TrackEgressRequest{
+ RoomName: room,
+ TrackId: trackID,
+ Output: &livekit.TrackEgressRequest_File{File: &livekit.DirectFileOutput{
+ Filepath: "recordings/" + id + "/",
+ Output: &livekit.DirectFileOutput_S3{S3: storeUpload()},
+ }},
+})
+```
+
+LiveKit uploads the file when the recording stops. It also writes a small JSON manifest beside the file. Set `DisableManifest: true` on the output if you don't want it.
+
+If your app also gets `CARLOS_STORE_ENDPOINT`, use that S3-compatible endpoint as `Endpoint` and set `ForcePathStyle: true`. LiveKit has to be able to reach that endpoint over the internet.
+
+## When the recording is done
+
+LiveKit POSTs events to the webhook URL you set in the LiveKit project, with `Content-Type: application/webhook+json`. Each one carries an `Authorization` token signed with the webhook's configured signing key. Configure the webhook to use the API key above, so the SDK can verify it for you. The one you need is `egress_ended`:
+
+```go
+import (
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/livekit/protocol/auth"
+ "github.com/livekit/protocol/livekit"
+ "github.com/livekit/protocol/webhook"
+)
+
+func livekitWebhook(w http.ResponseWriter, r *http.Request) {
+ keys := auth.NewSimpleKeyProvider(os.Getenv("LIVEKIT_API_KEY"), os.Getenv("LIVEKIT_API_SECRET"))
+ event, err := webhook.ReceiveWebhookEvent(r, keys)
+ if err != nil {
+ http.Error(w, "signature does not verify", http.StatusUnauthorized)
+ return
+ }
+ if event.GetEvent() == webhook.EventEgressEnded {
+ info := event.GetEgressInfo()
+ switch {
+ case info.GetBackupStorageUsed():
+ // The upload to your store failed. See "When an upload fails".
+ case info.GetStatus() == livekit.EgressStatus_EGRESS_COMPLETE,
+ info.GetStatus() == livekit.EgressStatus_EGRESS_LIMIT_REACHED:
+ for _, f := range info.GetFileResults() {
+ queueConversion(f.GetFilename(), time.Duration(f.GetDuration()))
+ }
+ default:
+ // EGRESS_FAILED: info.GetError() says why.
+ }
+ }
+ w.WriteHeader(http.StatusOK)
+}
+```
+
+`Filename` is the recording's key in your store, such as `recordings/a1b2/stream-a1b2-2026-11-25T101500.mp4`. `Duration` is in nanoseconds. `EGRESS_LIMIT_REACHED` means LiveKit stopped a long recording at its time limit, and the file up to that point is still in your store.
+
+LiveKit retries a webhook a few times and may send one more than once. Make the handler safe to run twice. Submitting the same key with the same preset and class to media conversion twice is already safe: the second `POST` returns the first job.
+
+## Converting and playing the recording
+
+Send the recording's key to media conversion, as on the [media conversion page](/docs/media-conversion#starting-a-conversion):
+
+```http
+POST /api/cli/apps/{account}/shop/media/conversions
+Authorization: Bearer <service token>
+{"key": "recordings/a1b2/stream-a1b2-2026-11-25T101500.mp4", "class": "long"}
+```
+
+Ask for `"class": "long"` when the recording is longer than 10 minutes. A short job converts up to 10 minutes and reports `needs_long_class` for anything longer. A video track above 1080p also needs the long class. A long job converts up to 3 hours of SDR video at or below 1080p. LiveKit Cloud limits a room-composite file to 3 hours. A room composite recording is 720p SDR at 30 frames a second, with Opus sound, unless you ask for other encoding options. Media conversion reads that MP4.
+
+Poll the job until it is `done`, save the output keys with the stream, and serve them as the page's [Serving](/docs/media-conversion#serving) section describes: the playlist and the MP4 from your app's own origin, side by side.
+
+Conversion counts against your account's [media allowance](/docs/media-conversion#the-allowance) like any other video.
+
+## When an upload fails
+
+If LiveKit can't upload the recording to your store, the recording isn't in your store and there is nothing to convert. Two common causes:
+
+- **The store is full.** A store past its plan's storage allowance refuses new objects, recordings included.
+- **The credential changed while the stream ran.** LiveKit uses the credential it was given when the recording started, and uploads at the end. If you run `carlos store rotate --finish --app shop` during a stream, the old credential stops working and the upload fails. Finish a rotation only when no recording is running.
+
+Without a backup copy, the webhook reports `EGRESS_FAILED`, and its error says the upload failed. With backup storage, it reports `EGRESS_COMPLETE` with `backup_storage_used` set instead.
+
+LiveKit Cloud can keep a copy of a recording whose upload failed in its own backup storage for 7 days. LiveKit turns this on for a project when you ask. When it happens, `manifest_location` in the webhook points to a manifest for retrieving it, and its file URLs are valid for 7 days. The recording is at LiveKit, not in your store.
+
+## Virus scanning
+
+If your store has [virus scanning](/docs/cli#carlos-store-scan), a recording is scanned like any other new object. Most recordings are bigger than the scanner's size limit, 25 MiB unless your operator changed it, so they are counted as skipped, not scanned. Media conversion doesn't wait for a scan. It only refuses an object a scan has found infected while the store enforces scanning.
+
+## Privacy: a third party in the media path
+
+With this setup, LiveKit Cloud carries every stream. The video, the audio and the chat pass through LiveKit's servers, and LiveKit records the stream before it reaches your store. LiveKit also holds your store's credential while a recording runs. That credential can read, overwrite and delete every object in your app's store, not only recordings. It cannot change object tags or bucket settings.
+
+The platform doesn't tell your users any of this. Whether and how to tell them is your app's decision. If you do, say it where people decide to stream or watch: near the start of your app's description, and on anything the stream produces, such as the recording's page.
+
+## Billing
+
+LiveKit bills your own LiveKit account for everything LiveKit does: participant minutes, data sent out of LiveKit to viewers, and Egress recording time. Check LiveKit's pricing page for current prices and free allowances. A room composite recording is billed as transcoding minutes. A track recording is billed at the track-egress rate.
+
+The platform bills your account as usual for the instance, the recording's storage in your store, and the media minutes used for conversion.
+
+## Not yet supported
+
+- **A credential that can only write recordings.** LiveKit needs your store's one credential, which can also read, overwrite and delete every other object in the store. The platform can't yet give an app a narrower credential to hand to a third party.
diff --git a/docs/site/media-conversion.md b/docs/site/media-conversion.md
index cd904e8aa..8570f8bf6 100644
--- a/docs/site/media-conversion.md
+++ b/docs/site/media-conversion.md
@@ -203,7 +203,7 @@ A video above 1080p converts only in the long class. The short class refuses it
| | `video-720p` | `audio-aac` |
| --- | --- | --- |
-| Length, sources up to 1080p | 2 hours | 8 hours |
+| Length, sources up to 1080p | 3 hours | 8 hours |
| Length, HDR sources up to 1080p | 75 minutes | |
| Length, sources above 1080p | 30 minutes | |
| Source size | 40 GiB | 10 GiB |
diff --git a/docs/site/nav.json b/docs/site/nav.json
index ec8ce392c..9da2d31cd 100644
--- a/docs/site/nav.json
+++ b/docs/site/nav.json
@@ -48,6 +48,11 @@
"label": "Media conversion",
"blurb": "Turn an uploaded video or audio file into files for browser playback, and serve them from your app."
},
+ {
+ "slug": "live-streams-bring-your-own-livekit",
+ "label": "Live streams with your own LiveKit",
+ "blurb": "Stream with chat on your own LiveKit Cloud project, record into your store, and play the recording back."
+ },
{
"slug": "scan-callbacks",
"label": "Receiving scan results",
diff --git a/docs/site/rootfs.md b/docs/site/rootfs.md
index c01f2f9d9..d77ea92a8 100644
--- a/docs/site/rootfs.md
+++ b/docs/site/rootfs.md
@@ -49,6 +49,8 @@ Every process of the instance gets the same environment: web, the workers and re
- HOME is /tmp unless the image or the app sets it.
+- /etc/hosts contains 127.0.0.1 localhost and ::1 localhost ip6-localhost ip6-loopback unless the image has a non-empty regular file there, or a link to one. carlos ship adds it when needed because Docker and Kubernetes write /etc/hosts when a container starts, and the read-only image prevents the app from creating it.
+
## Health
web must answer GET / on CARLOS_SOCKET with a status below 500 within 120 seconds of starting. Until it does, the instance does not serve and its workers do not start.
diff --git a/docs/superpowers/notes/LUNA-COPY-BRIEF-media-conversion-7.md b/docs/superpowers/notes/LUNA-COPY-BRIEF-media-conversion-7.md
new file mode 100644
index 000000000..771a73a69
--- /dev/null
+++ b/docs/superpowers/notes/LUNA-COPY-BRIEF-media-conversion-7.md
@@ -0,0 +1,29 @@
+# Copy pass 7: media conversion, three hours of SDR video (spec §11 A9)
+
+You are the copy-review gate itself for this set. Paul delegated copy review of platform UI, CLI, email and docs copy inside a plan to you on 2026-10-25; your verdicts ARE the review. Do NOT run the copy-review skill or start any server, and do not edit any file. You are writing a review report.
+
+Same feature, house rules and rulings as `docs/superpowers/notes/LUNA-COPY-BRIEF-media-conversion.md` and pass 6 (`LUNA-COPY-BRIEF-media-conversion-6.md` and its result `LUNA-COPY-RESULT-media-conversion-6.md`; read all three). What changed is spec amendment A9 in `docs/superpowers/specs/2026-11-16-video-conversion-design.md` §11 (read it): on 2026-11-25 Paul raised the length limit for SDR video at or below 1080p from 2 hours to 3, so LiveKit Cloud recordings (up to 3 hours a file) convert in one job.
+
+In `docs/superpowers/notes/media-conversion-copy-deck.md`, review ONLY the rows marked "(pending Luna pass 7)", and the one row marked "removed by A9". There are three:
+
+1. `docs.media.limits.8`, a table line in "Limits" on `docs/site/media-conversion.md`. Only the figure changed, 2 hours to 3. Read it in its table, beside the HDR row (75 minutes) and the above-1080p row (30 minutes). Table rows keep their column count and the `\|` escapes as the deck writes them.
+2. `docs.livekit.convert.2`, a paragraph in "Converting and playing the recording" on `docs/site/live-streams-bring-your-own-livekit.md`. Only "up to 2 hours" changed to "up to 3 hours".
+3. `docs.livekit.unsupported.long`, an item removed from that page's "Not yet supported" list. Read the list as it now stands (one item left) and say whether the section still reads right, or whether the removal leaves anything on the page that still says or implies 2 hours.
+
+Readers are app developers. The facts these rows must state, all from A9 and A7:
+
+- A long video job converts up to 3 hours of SDR video at or below 1080p, 75 minutes of HDR video at or below 1080p, and 30 minutes of video above 1080p (HDR or not). Audio converts up to 8 hours. Each is a deployment setting an operator can change.
+- A room composite from LiveKit is 720p SDR, so its limit is the 3-hour one. LiveKit Cloud limits a room-composite file to 3 hours.
+- Unverified, and deliberately not promised on the page: whether a recording LiveKit stops exactly at its 3-hour limit reports a duration at or under 3 hours. The probe refuses a source even 1 ms over the maximum. Do not add a promise that every recording at the limit converts. If you think the page needs a sentence about this, propose it under Flags, not in the table.
+- While a long video job runs it holds 2 media minutes per minute of its grant against the allowance (A7), so a 3-hour job holds 360 media minutes until it ends, and a done 3-hour SDR job is charged 180. The media page's allowance section already says how holding works; say under Flags if you think the LiveKit page needs the figure.
+
+## Rules for this set, on top of pass 1's and pass 6's house rules
+
+- Not copy, leave them: job codes (`needs_long_class`, `source_too_long`), the class names `short` and `long`, `"class": "long"`, preset names, setting names, and the figures above.
+- Say "1080p" as the deck already does; don't introduce "Full HD", "4K" or pixel counts the rows don't need.
+- No em dashes. Plain, direct sentences.
+- Change a row only when the change helps the reader act or avoids a misreading: a sentence that misleads, can't be parsed, contradicts its sibling or a fact above, or doesn't say what to do when the reader can do something. Consistency with the approved rows around it matters more than polish on one line. Don't rewrite for taste.
+
+## What to return
+
+A table `key | new | why`, with only the rows you change, each with its full new text in the row's own form. Unchanged rows are approved as they are. Then `## Flags` with only what Paul must decide or a fact you could not verify against the spec or code, each with your recommendation, or "none".
diff --git a/docs/superpowers/notes/LUNA-COPY-RESULT-media-conversion-7.md b/docs/superpowers/notes/LUNA-COPY-RESULT-media-conversion-7.md
new file mode 100644
index 000000000..561af2388
--- /dev/null
+++ b/docs/superpowers/notes/LUNA-COPY-RESULT-media-conversion-7.md
@@ -0,0 +1,9 @@
+| key | new | why |
+|---|---|---|
+| `docs.livekit.convert.2` | Ask for `"class": "long"` when the recording is longer than 10 minutes. A short job converts up to 10 minutes and reports `needs_long_class` for anything longer. A video track above 1080p also needs the long class. A long job converts up to 3 hours of SDR video at or below 1080p. LiveKit Cloud limits a room-composite file to 3 hours. A room composite recording is 720p SDR at 30 frames a second, with Opus sound, unless you ask for other encoding options. Media conversion reads that MP4. | States the SDR condition and restores LiveKit Cloud’s file limit, which the removed item previously explained. |
+| `docs.livekit.unsupported.long` | removed | The remaining item reads correctly, and no 2-hour statement or implication remains on the page. |
+
+## Flags
+
+- Whether a recording stopped at LiveKit’s 3-hour limit reports a duration at or below 3 hours is unverified. Recommend keeping the page from promising that every such recording converts.
+- Recommend not duplicating the `360` held and `180` charged media-minute figures here. The page already links to the media allowance section that explains them.
\ No newline at end of file
diff --git a/docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit.md b/docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit.md
new file mode 100644
index 000000000..f636dcf2d
--- /dev/null
+++ b/docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit.md
@@ -0,0 +1,33 @@
+# Docs and copy pass: live streams on your own LiveKit
+
+You are the copy-review gate itself for this page. Paul delegated copy review of platform UI, CLI, email and docs copy to you on 2026-10-25; your verdicts ARE the review. Do NOT run the copy-review skill or start any server. Do not modify any file. You are writing a review report.
+
+## The page
+
+`docs/site/live-streams-bring-your-own-livekit.md`, a new docs site page, and its one entry in `docs/site/nav.json` (label and blurb). Readers are app builders on the platform who want a live stream with chat on their own LiveKit Cloud project, recorded into their app's store and converted for playback. Compare the voice and shape with `docs/site/media-conversion.md` and `docs/site/scan-callbacks.md`, the two pages it sits beside.
+
+## House rules (Paul's)
+
+- No em or en dashes used as dashes. Use a full stop and a new sentence.
+- Plain, direct, calm. No exclamation marks, no marketing tone, no "simply", no "please" padding, no filler.
+- Say what happened, then what to do. If the reader cannot fix it themselves, say who can.
+- Developer-facing, so technical words (Egress, webhook, multipart, token, grant) are fine where the reader needs them. Undefined jargon is not.
+- Neutral examples only (`shop`, `shop.example.com`, `recordings/a1b2/...`). Never a customer or tenant name.
+- Code samples stay in Go. Do not rewrite code unless a comment or string in it breaks a rule above or is wrong.
+
+## Facts to check against
+
+These are established; flag any sentence on the page that contradicts or overstates them.
+
+- Instances reach public addresses with no setting. The fence denies only loopback, private, link-local, CGNAT, multicast, reserved ranges and the metadata service (`internal/host/units/carlos-instance@.service`, the `IPAddressDeny=` line and its comment; `internal/egressaddr/egressaddr.go` `FenceDeny`). `carlos apps set --egress-allow` takes private IP addresses and ranges only (`docs/site/cli.md`, the `--egress-allow` paragraph).
+- A host behind `carlos gate` asks every request for the password (`internal/gate/gate.go` header; `docs/site/cli.md` "carlos gate"; the email events push paragraph says such an app cannot receive pushes).
+- The store user's policy is `storePolicyJSON` in `internal/objstore/aws.go`: GetObject, PutObject, DeleteObject, GetObjectTagging and the two multipart actions on objects, ListBucket on the bucket, an explicit Deny on PutObjectTagging, a Deny on PutObject carrying a platform tag key, and a PutObject Deny past the storage grace. There is no GetBucketLocation in it. AWS requires s3:PutObjectTagging for a PutObject that sets tags, so any tagged upload is refused.
+- LiveKit's S3 uploader (github.com/livekit/storage s3.go) asks for the bucket's location only when region and endpoint are both empty; it sends no ACL and no encryption header; it uploads files over 16 MiB in parts.
+- Media conversion: `docs/site/media-conversion.md` (classes and limits, refusals, Serving, the allowance). Conversion does not wait for a scan; it refuses an object only when a HEAD is denied (`internal/console/apimedia.go`, `handleAPIMediaSubmit` step 9).
+- Scanning skips objects above `CARLOS_CLAMD_MAX_BYTES`, 25 MiB by default (`docs/site/cli.md`, carlos store scan).
+- Under the media roadmap (`docs/superpowers/specs/2026-09-07-media-platform-roadmap-design.md` §8), the recipient of an egress is the app's decision, never the platform's. The privacy section must leave the decision with the app and must not promise that the platform discloses anything.
+
+## What to return
+
+1. A table `location | old | new | why`, with only the sentences you change, quoting the old text exactly so it can be applied verbatim. Rows you leave alone are approved as they are.
+2. A `## Flags` section with only what Paul must decide, or a fact you could not verify. Keep it short and give your recommendation for each. Write "none" if there are none.
diff --git a/docs/superpowers/notes/census-proposal-rootfs-etc-hosts-1349.md b/docs/superpowers/notes/census-proposal-rootfs-etc-hosts-1349.md
new file mode 100644
index 000000000..f647875cb
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-rootfs-etc-hosts-1349.md
@@ -0,0 +1,11 @@
+# Census approval: rootfs-etc-hosts-1349
+
+Ruling `census-ruling-rootfs-etc-hosts-1349`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+Envelopes re-pinned: `internal/rootfsimage`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Seal: `892cf87db700600490e3ec9e944f9dbe7151e43bc5471090634f1735bcb9a7bd` → `892cf87db700600490e3ec9e944f9dbe7151e43bc5471090634f1735bcb9a7bd`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-etc-hosts-1349.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/media-conversion-copy-deck.md b/docs/superpowers/notes/media-conversion-copy-deck.md
index bc995a872..ed5d0ffea 100644
--- a/docs/superpowers/notes/media-conversion-copy-deck.md
+++ b/docs/superpowers/notes/media-conversion-copy-deck.md
@@ -514,7 +514,7 @@ row is applied to the page verbatim.
| `docs.media.limits.5` | \| `audio-aac` \| sources up to 256 MiB \| 2 hours \| 10 minutes \| 50 minutes \| |
| `docs.media.limits.6` | A video above 1080p converts only in the long class. The short class refuses it with `needs_long_class`, however short it is. A long job converts up to the preset's maximum: | (approved, Luna pass 6)
| `docs.media.limits.7` | \| \| `video-720p` \| `audio-aac` \| |
-| `docs.media.limits.8` | \| Length, sources up to 1080p \| 2 hours \| 8 hours \| |
+| `docs.media.limits.8` | \| Length, sources up to 1080p \| 3 hours \| 8 hours \| | (approved, Luna pass 7; spec §11 A9, was 2 hours)
| `docs.media.limits.8a` | \| Length, HDR sources up to 1080p \| 75 minutes \| \| | (approved, Luna pass 6)
| `docs.media.limits.9` | \| Length, sources above 1080p \| 30 minutes \| \| |
| `docs.media.limits.10` | \| Source size \| 40 GiB \| 10 GiB \| |
@@ -548,6 +548,19 @@ carries them yet (plan 3 writes it); the pack's price is left out.
| `docs.plans.media.notice` | Apart from the ceilings above (email, storage, bandwidth, PDFs and media minutes at twice their limits), whatever acts after grace starts only once grace has ended and an owner received notice at least 3 days earlier. (only the parenthesis changed) |
| `docs.readme.media` | For video and audio, [media conversion](docs/site/media-conversion.md) runs in the region of the app's store, and a store in a region with no conversion engine is refused rather than converted elsewhere. (README.md, after the PDF service sentence) |
+### LiveKit live streams page (spec §11 A9)
+
+`docs/site/live-streams-bring-your-own-livekit.md`, carried onto this
+branch from `docs-live-byo-livekit` (its own Luna pass:
+`LUNA-DOCS-BRIEF-live-byo-livekit.md`). Only the rows A9 changes are here,
+approved by Luna pass 7 (`LUNA-COPY-BRIEF-media-conversion-7.md`, result
+`LUNA-COPY-RESULT-media-conversion-7.md`), applied verbatim.
+
+| Key | Text |
+|---|---|
+| `docs.livekit.convert.2` | Ask for `"class": "long"` when the recording is longer than 10 minutes. A short job converts up to 10 minutes and reports `needs_long_class` for anything longer. A video track above 1080p also needs the long class. A long job converts up to 3 hours of SDR video at or below 1080p. LiveKit Cloud limits a room-composite file to 3 hours. A room composite recording is 720p SDR at 30 frames a second, with Opus sound, unless you ask for other encoding options. Media conversion reads that MP4. | (approved, Luna pass 7; A9, was "up to 2 hours")
+| `docs.livekit.unsupported.long` | (removed by A9: the "Not yet supported" item "Converting recordings longer than 2 hours", which told streamers to stop and restart a recording before 2 hours) |
+
## The engine binary (plan 3)
**Approved 2026-11-19** by Luna pass 5, every row from here to the end of
diff --git a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
index a70db34f1..8e3461e13 100644
--- a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
+++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
@@ -290,6 +290,7 @@ From the plan: Placeholders: `<app>` an app; `<fleet>` a fleet name; `<region>`
| RFS-4-C46 | docs/site/rootfs.md | CARLOS_DB is the instance's SQLite database, the one file the platform replicates. An app that keeps its data somewhere else can ignore it. | approved |
| RFS-4-C47 | docs/site/rootfs.md (fact) | CARLOS_HOST, CARLOS_REGION, CARLOS_CONTROL_SOCKET and CARLOS_PURGE mean what they mean for a binary instance, as [What an instance is started with](/docs/cli#what-an-instance-is-started-with) says. | approved |
| RFS-4-C147 | docs/site/rootfs.md (fact, rootfs-default-home) | HOME is /tmp unless the image or the app sets it. | approved |
+| RFS-4-C155 | docs/site/rootfs.md (fact, rootfs-etc-hosts-1349) | /etc/hosts contains 127.0.0.1 localhost and ::1 localhost ip6-localhost ip6-loopback unless the image has a non-empty regular file there, or a link to one. carlos ship adds it when needed because Docker and Kubernetes write /etc/hosts when a container starts, and the read-only image prevents the app from creating it. | approved |
| RFS-4-C48 | docs/site/rootfs.md | Health | approved |
| RFS-4-C49 | docs/site/rootfs.md | web must answer GET / on CARLOS_SOCKET with a status below 500 within 120 seconds of starting. Until it does, the instance does not serve and its workers do not start. | approved |
| RFS-4-C50 | docs/site/rootfs.md | What it can write | approved |
@@ -605,6 +606,10 @@ brought carlos run and terminal sessions to rootfs instances, so the line
was wrong. RFS-4-C148 to C154 replace it with a Commands and consoles
section on the Rootfs page and a pointer in the Rails guide; Paul approved
all seven unchanged in his copy review on 2026-11-06.
+RFS-4-C155 (2026-11-22, #1349: carlos ship adds /etc/hosts) was approved
+by a Luna copy pass under Paul's delegation; its revision was applied,
+then ", or a link to one" added when Astra R1 kept a symlinked hosts
+file's target.
Recounted from the rows on 2026-10-30 (Plan 6 amendment, Astra R1 P2-7);
the earlier counts had not followed Plans 1 and 4's later rows.
@@ -612,7 +617,7 @@ the earlier counts had not followed Plans 1 and 4's later rows.
- Plan 1: 99 live, 0 struck, 99 rows
- Plan 2: 12 live, 0 struck, 12 rows
- Plan 3: 32 live, 3 struck, 35 rows
-- Plan 4: 150 live, 3 struck, 153 rows (RFS-4-C100 struck and RFS-4-C148 to C154 added on 2026-11-06)
+- Plan 4: 151 live, 3 struck, 154 rows (RFS-4-C100 struck and RFS-4-C148 to C154 added on 2026-11-06; RFS-4-C155 added on 2026-11-22)
- Plan 5: 44 live, 0 struck, 44 rows
- Plan 6: 75 live, 0 struck, 75 rows (RFS-6-C47 revised and RFS-6-C65 added and approved on 2026-10-30; RFS-6-C66 to C75 added and approved on 2026-10-31)
-- Total: 412 live, 6 struck, 418 rows
+- Total: 413 live, 6 struck, 419 rows
diff --git a/docs/superpowers/plans/2026-11-16-media-conversion-plan-2-console.md b/docs/superpowers/plans/2026-11-16-media-conversion-plan-2-console.md
index 8bf0f97aa..3e739ea62 100644
--- a/docs/superpowers/plans/2026-11-16-media-conversion-plan-2-console.md
+++ b/docs/superpowers/plans/2026-11-16-media-conversion-plan-2-console.md
@@ -16,7 +16,7 @@
- Execution id: 32 hex characters from 16 bytes of `crypto/rand`. It is RunTask's `startedBy` and its idempotency token.
- Output keys: `derived/<key>/<etag>/<preset>/<execution>/` + `video.mp4`, `video.m3u8`, `poster.jpg` (video) or `audio.mp4`, `audio.m3u8`, `peaks.json` (audio). Result object: `media-results/<execution>.json` in the deployment bucket, read bounded to 64 KiB.
- Classes (§7.1): video short (picked up to 1 GiB): 4 vCPU, 8 GB, deadline 15 min, granted 10 min; video long: 16 vCPU, 32 GB, 50 min, the video maximum; audio short (up to 256 MiB): 1 vCPU, 2 GB, 10 min, 2 h; audio long: 2 vCPU, 4 GB, 50 min, the audio maximum. Ephemeral storage 20 GiB, or source size plus 8 GiB when more.
-- Maximums (settings, `CARLOS_MEDIA_LIMITS`; plan 1's values, spec §11 A7): video 2 h up to 1080p, 75 min for HDR up to 1080p (`video_max_hdr`), 30 min above 1080p, 40 GiB; audio 8 h, 10 GiB; 3840x2160, 60 fps. The short video class takes nothing above 1080p (A7).
+- Maximums (settings, `CARLOS_MEDIA_LIMITS`; plan 1's values, spec §11 A7, and A9's three hours): video 3 h for SDR up to 1080p (A9; 2 h before it), 75 min for HDR up to 1080p (`video_max_hdr`), 30 min above 1080p, 40 GiB; audio 8 h, 10 GiB; 3840x2160, 60 fps. The short video class takes nothing above 1080p (A7).
- Fair use: 6 short and 2 long tasks in the deployment, 2 short and 1 long per account, counted as rows with a dispatched execution and `task_stopped` false; per account 20 queued or running (429) and 30 submissions a minute with a burst of 10 (429); deployment-wide 200 queued (503).
- Stop grace 30 s. Full bound = `deadline_s` + 30 s. Grant lifetime 1 h. Deadline at most 50 min. Under 3 min of deadline: wait while the account has another execution running, else fail `allowance_exceeded` uncharged.
- Weights: `video-720p` 1, video above 1080p 2 (spec §11 A7, Paul's option A), `audio-aac` 0.1, held as tenths (10, 20 and 1) so every allowance figure is an integer: units = milliseconds × weight-tenths. A settled row is charged at the weight its probe measured (`weight_tenths`); a running long video row is reserved at 2.
@@ -116,7 +116,7 @@ The deck holds every string Tasks 3 to 11 write. Drafts below; implementers copy
- `const (StopGrace = 30*time.Second; GrantLifetime = time.Hour; GrantMintSlack = 5*time.Minute; EngineRecordRetention = time.Hour; MinDeadline = 3*time.Minute; MaxDeadline = 50*time.Minute; PassEvery = 5*time.Second; FailedRetention = 90*24*time.Hour; MaxResultBytes = 64 << 10; MaxOverrideBytes = 8192; MaxPutBytes = 5 << 30; ScratchFloorGiB = 20; ScratchHeadroom = 8 << 30)`. `EngineRecordRetention` and `MaxOverrideBytes` are plan 1 measurements.
- `func DeadlineSleep(start time.Time, deadline time.Duration, expiry time.Time) time.Duration`: the earlier of `start+deadline` and `expiry−StopGrace`, minus `start` (may be ≤ 0). Plan 3's deadline container and local runner both use it.
- `func EphemeralGiB(sourceBytes int64) int`: 0 when `ceil((bytes+8 GiB)/GiB) <= 20`, else that figure (at most 200).
- - `type Limits struct{ VideoMax, VideoMaxHDR, VideoMaxHi, AudioMax time.Duration; VideoBytes, AudioBytes int64; AccountMinutes int64; Short, Long, AccountShort, AccountLong, AccountActive, PerMinute, Burst, Queue int }` and `func ParseLimits(v string) (Limits, error)`: comma-separated `key=value`; keys `video_max`, `video_max_hdr` (A7, default 75m), `video_max_hi`, `video_bytes`, `audio_max`, `audio_bytes`, `account_minutes`, `short`, `long`, `account_short`, `account_long`, `account_active`, `per_minute`, `burst`, `queue`; durations in Go syntax, bytes as an integer or `<n>GiB`/`<n>MiB`; `""` gives `2h,30m,40GiB,8h,10GiB,0,6,2,2,1,20,30,10,200`; unknown, duplicate, negative or zero-count keys are errors; `account_minutes` may be 0.
+ - `type Limits struct{ VideoMax, VideoMaxHDR, VideoMaxHi, AudioMax time.Duration; VideoBytes, AudioBytes int64; AccountMinutes int64; Short, Long, AccountShort, AccountLong, AccountActive, PerMinute, Burst, Queue int }` and `func ParseLimits(v string) (Limits, error)`: comma-separated `key=value`; keys `video_max`, `video_max_hdr` (A7, default 75m), `video_max_hi`, `video_bytes`, `audio_max`, `audio_bytes`, `account_minutes`, `short`, `long`, `account_short`, `account_long`, `account_active`, `per_minute`, `burst`, `queue`; durations in Go syntax, bytes as an integer or `<n>GiB`/`<n>MiB`; `""` gives `3h,30m,40GiB,8h,10GiB,0,6,2,2,1,20,30,10,200` (`video_max` 3h since spec §11 A9); unknown, duplicate, negative or zero-count keys are errors; `account_minutes` may be 0.
- `func (l Limits) MaxBytes(preset string) int64`, `func (l Limits) Granted(k ClassKey) time.Duration` (the class figure, or the preset maximum for long).
- Error codes as `const Code… = "…"` for every code in the deck's `media.job.*` rows plus `CodeRetired = "retired"`; `var HandlerCodes map[string]bool` (the codes a result object may carry: every `media.job.*` code except `grant_expired`, `deadline_exceeded`, `engine_unavailable`, `engine_lost`, `retired`, `store_changed`, `store_writes_denied`).
- Exit codes: `ExitDone = 0`, `ExitFailed = 1`, `ExitGrantExpired = 75`, `DeadlineExitReached = 0`, `DeadlineExitBadInput = 3`, `DeadlineExitStopped = 143`; container names `ContainerCodec = "codec"`, `ContainerDeadline = "deadline"`; env names `PayloadEnv = "CARLOS_MEDIA_JOB"`, `DeadlineEnv = "CARLOS_MEDIA_DEADLINE_S"`, `ExpiryEnv = "CARLOS_MEDIA_GRANT_EXPIRY"`.
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-media-three-hour-sdr.md b/docs/superpowers/reviews/CODEX-FINDINGS-media-three-hour-sdr.md
new file mode 100644
index 000000000..028c4d36c
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-media-three-hour-sdr.md
@@ -0,0 +1,32 @@
+No P1 findings. Two P2 findings, both in the **execution-window accounting** fault family.
+
+1. **P2 — §1 / A9: the claimed worst-case duration omits work and mixes clock origins.**
+ [A9:1161](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-three-hour-sdr/docs/superpowers/specs/2026-11-16-video-conversion-design.md:1161) totals only download, video encode and media upload. The handler also probes, produces the poster, packages the playlist, uploads the other outputs and writes the result ([run.go:134](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-three-hour-sdr/internal/mediahandler/run.go:134), [run.go:96](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-three-hour-sdr/internal/mediahandler/run.go:96)). The probe alone permits 60 seconds.
+
+ The quoted 41.34 minutes is therefore a subtotal, not a worst case. At 5.85, that subtotal is 38.90 minutes; including the stated startup and stop grace gives **39.93 minutes**, so “the same sum is 38.9” is incorrect. Near the quoted break-even speed, omitted work can exhaust the remaining deadline.
+
+ **Fix:** distinguish the plan’s formula from the complete execution estimate; budget the omitted work and explain grant-mint, RunTask, deadline-start and expiry timing. Account explicitly for `GrantMintSlack` without treating time before minting as consumed grant lifetime. Image pull is already included in the measured RunTask-to-RUNNING startup. Correct the faster-run total and qualify the break-even speeds as estimates. The present figures leave substantial margin; this finding does not establish that three hours fail.
+
+2. **P2 — §1 / fit test: the test ignores the engine’s effective deadline cap.**
+ [media_test.go:314](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-three-hour-sdr/internal/media/media_test.go:314) compares against `long.Deadline`. Production dispatch instead uses `min(spec.Deadline, media.MaxDeadline)` ([dispatch.go:178](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-three-hour-sdr/internal/mediajobs/dispatch.go:178)); the timer also applies expiry minus stop grace through [DeadlineSleep:256](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-three-hour-sdr/internal/media/media.go:256).
+
+ **Failure scenario:** reducing `MaxDeadline` to 40 minutes leaves this fit test passing, although its own slower-run subtotal is 41.34 minutes and production terminates earlier.
+
+ **Fix:** test the effective deadline and expiry window, including the overhead budget from finding 1. Add a focused case proving that a window shorter than the required runtime fails.
+
+No P3 findings.
+
+The remaining checks support the change:
+
+- The rule gives **180 minutes at 5.85** and **165 at 5.42**. The **33.34 GiB** threshold is correct; reducing source size resolves that particular rule shortfall.
+- Three hours produces approximately **3.548 GB** before container overhead. Output, playlist, fragment and scratch bounds have room.
+- Reservation remains **360 allowance minutes**; completed SDR charges **180**. I found no new under-reservation or done-charge escape, beyond the explicitly excluded existing timing residual.
+- The boundary tests pin three hours, 75 minutes, 30 minutes and their 1 ms refusals. Refusal messages cover all three categories. Payload fields and strict decoding remain compatible.
+- The deterministic three-hour simulation witness is acceptable coverage for this change. Existing I9 rejects repeated Runs, and checks occur after each simulation action; I found no new false positive involving requeue, retirement or ambiguous launch.
+- Luna’s changes were applied verbatim. LiveKit’s unverified cutoff duration **should not block**: the documented maximum is explicit, and the page does not guarantee conversion of every recording stopped at LiveKit’s limit.
+
+Validation: static review and arithmetic recomputation completed; `git diff --check` passed. Targeted Go tests could not start because the sandbox is read-only. GOCACHE remained unset; no files changed.
+
+**Census: clean by diff and static dependency inspection.** The only changed production Go file, `internal/media/limits.go`, is outside the root binary’s dependency closure; no infrastructure or unit files changed.
+
+READY AFTER FIXES
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-media-three-hour-sdr.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-media-three-hour-sdr.md
new file mode 100644
index 000000000..c57e62df6
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-media-three-hour-sdr.md
@@ -0,0 +1,59 @@
+# Review brief: branch `media-three-hour-sdr` (three hours of SDR video, spec §11 A9), round 1 of 3
+
+Repo carlos/platform, branch `media-three-hour-sdr`, commit named in the reviewer's prompt.
+Under review: the diff `65951fbb..media-three-hour-sdr` (65951fbb is `origin/main` when the branch was cut).
+Authorities: `docs/superpowers/specs/2026-11-16-video-conversion-design.md` (merged; §5 to §7 and §11 A1 to A8), and its new amendment A9 on this branch, which is the change under review. Plans `docs/superpowers/plans/2026-11-16-media-conversion-plan-1-spike.md` (Task 5 Step 4's rule for the maximums), `-plan-2-console.md` and `-plan-3-engine.md` (merged). The measurements are the merged spike report, `docs/superpowers/reviews/2026-11-16-media-conversion-spike.md` (Task 5's table and "Step 4: maximums", Task 6).
+
+The diff also carries `docs/site/live-streams-bring-your-own-livekit.md`, merged in from the unmerged branch `docs-live-byo-livekit` (commit 5e15caf8), because that page states the old 2-hour limit. Review only A9's edit to that page (its "Converting and playing the recording" paragraph and its "Not yet supported" list); the rest of the page is that branch's own work and is not an authority for anything here. Do not review against any other unmerged branch.
+
+You are an independent reviewer. Read A9, then the code, and check every claim against the code and the spike report. This change touches billing and limits: the per-file maximum, the grant, the reservation and the charge.
+
+## Fixed: do not re-argue
+
+- Paul's ruling, 2026-11-25: `video_max` (SDR video at or below 1080p) becomes 3 hours so LiveKit Cloud recordings (up to 3 hours a file) convert. HDR up to 1080p stays 75 minutes, above 1080p 30 minutes.
+- Paul's instruction for the fit: if 3 hours did not fit inside the 50-minute deadline and the one-hour grant, the change stops; the deadline and the grant are not to be raised. Plan 1's 40-minute rule is the stricter test with a 10-minute margin; A9 states that 3 hours pass it at the 5.85 run and miss it by one 15-minute step at the 5.42 run, and pass the deadline and grant at both. Report it if that arithmetic or its inputs are wrong, or if a term is missing; do not re-argue whether the 40-minute rule or the deadline is the stop criterion.
+- A7's rulings: weights 1, 2 and 0.1; a long video reserved at weight 2 before its probe; a row settled with no source facts read charged at weight 1; A2's residual (a compromised codec can under-report its own duration within its grant).
+- Known and pre-existing, out of scope unless the larger bound makes them worse: ECS's `stoppedAt` lag (A7 "Still open", up to 35 s past a row's full bound); A8's "What remains".
+- The LiveKit page deliberately does not promise that a recording stopped at LiveKit's own 3-hour limit converts (A9 "Open"); Luna pass 7 agreed. Say whether that open point should block this change, with your reasoning; do not propose verifying it against LiveKit (no AWS or LiveKit calls are possible here).
+
+## What to check
+
+1. **The fit (A9).** Recompute every figure from the spike report: `t_start` 31.7 s, `B` 95.3 MB/s, `S` 40 GiB, the two long-class 1080p SDR runs at `medium` (5.85 for the 1-hour source, 5.42 for the 30 GiB one), the rule `D = (40 min - t_start - S/B) x v` rounded down to 15 minutes, and the deadline and grant sums with the upload at the output ceiling (2,500 kbit/s plus 128 kbit/s of audio). Is anything the spec defines missing from the sum: `GrantMintSlack`, the `deadline` container's earlier stop at the grant's expiry less the stop grace (`media.DeadlineSleep`), when the deadline clock starts relative to `t_start` and the image pull, the poster, the playlist and result writes? Are the slow-host break-even speeds (4.30 with a 40 GiB source, 3.70 with a few gigabytes) right? Is "the binding term is the 40 GiB size limit" true, and is the 33.3 GiB figure right? `TestDefaultMaximumsFitTheLongClass` (`internal/media/media_test.go`) encodes this arithmetic: is it faithful to the rule, and does it fail for a default the engine cannot convert?
+2. **Every reader of `VideoMax`.** `media.Limits` (`internal/media/limits.go`: `DefaultLimits`, `MaxHDR`, `MaxDuration`, `Granted`), `fit` and `launch` in `internal/mediajobs/dispatch.go` (the payload's `MaxMS`, `MaxHDRMS`, `MaxHiMS`, `GrantedMS`), `check` in `internal/mediahandler/probe.go`, the `-t` and duration clamps in `internal/mediahandler/run.go` and `ffmpeg.go`, `mediaJobMessage` in `internal/console/media_copy.go`, and `validMediaLimits` in `internal/console/mediawire.go`. Grep for anything else that assumes a 2-hour video maximum, or that a long row's grant is at most some figure (`7200`, `2 * time.Hour`, `2h`). Check the output and scratch bounds a 3-hour job meets: `media.MaxPutBytes`, `playlistBound` and `maxFragments` (`internal/mediahandler/collect.go`, `fmp4.go`), `media.EphemeralGiB`, `output_too_large`.
+3. **Money: the reservation, the fit and the door.** A long video row reserves `2 x max(granted_s, deadline_s + 30) x 1000` units (`usageSQL`, `reserveWeightSQL` in `internal/mediajobs/metering.go`); with a 3-hour grant that is 360 allowance minutes. Check `fit`'s arithmetic and its overflow guard with the larger figure, the 3-minute minimum deadline path, the door's 402 at twice the limit (`mediaFairUse`, `internal/console/apimedia.go`), the hourly cap measure and billing page if they read `media_jobs`, and `engine_lost`'s full-bound charge. Can any path reserve less than a 3-hour row can be charged, or charge a done row more than `w x granted_s`? A9 says none of this needs a code change: is that true?
+4. **The simulation's new I8 (grant) checks** (`internal/sim/mediajobs/invariants_test.go`, `checkPayload`; witnesses in `witness_test.go`: five new cases in `TestCheckerCatchesEachInvariant`, `payloadFor`, and `TestWitnessThreeHourSDR`). Are they stated from the spec rather than copied from the job table? Could any of them pass a broken implementation, or fire on a legitimate sweep row (a requeued row, a retired row, an ambiguous Run, a Run of a prior execution)? The sweep's 200 seeds pass; it reaches no done long video over 2 hours (69 done finishes in 200 seeds), so the counter for that was dropped and `TestWitnessThreeHourSDR` covers the path instead. Is that acceptable, or should the sweep reach it?
+5. **The tests.** `TestThreeHourSDRConverts` and `TestThreeHourGrantFitsTwiceTheAllowance` (`internal/mediajobs/jobs_test.go`), the SDR refusal in `TestGetFailedMessageComesFromTheDeck` and the `mediaDuration` row (`internal/console/apimedia_test.go`), and the updated `TestClassTable`, `TestParseLimits`, `TestMaxDuration`. Do they pin the values (3 hours, 75 minutes, 30 minutes, 360 reserved, 180 charged) and the 1 ms boundaries, so that each would fail against a wrong default or a wrong maximum in the payload? Is the refusal message's maximum checked for SDR, HDR and above 1080p?
+6. **Wire compatibility.** A9 says no payload or result field changes, so an older image converts 3 hours from a newer console and an older console keeps sending 2 hours. Verify against `media.Payload` and the codec's strict decode.
+7. **Docs and copy.** `docs/site/media-conversion.md` (the limits table), A9's edits to the LiveKit page, the copy deck rows (`docs/superpowers/notes/media-conversion-copy-deck.md`, "LiveKit live streams page" and `docs.media.limits.8`), and Luna pass 7 (`docs/superpowers/notes/LUNA-COPY-BRIEF-media-conversion-7.md`, `LUNA-COPY-RESULT-media-conversion-7.md`, applied verbatim). Flag any sentence that says something the code does not do, and anything left in the docs or the spec body that still says 2 hours for SDR video where it should not. The spec's A7 text and decision 5 are history and keep their figures.
+8. **Census.** `make census-card` reports the census clean on this branch (no file of the root binary's scope changed). Confirm from the diff, or say which file it missed.
+
+Results so far: `go build ./...` clean; targeted tests pass for `internal/media`, `internal/mediajobs`, `internal/mediahandler`, `internal/sim/mediajobs` (the 200-seed sweep included), `internal/docsite`, and `internal/console` with `-run 'Guard|Media|media|Copy|Styleguide|Plan'`. Mutation: a 3 h 15 min default fails `TestDefaultMaximumsFitTheLongClass`; each new sim witness reports exactly one I8 violation.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+ Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review. (The
+ census, and review of any newly changed security, root, termination
+ or production-storage behaviour, still check the fix; see AGENTS.md,
+ "Stopping rules".)
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for
+ another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not
+raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section or task, the problem,
+the evidence (file:line, verified), the failure scenario, a concrete
+fix and the invariant or trust boundary it breaks (that is its fault
+family). Then a census line: confirm the census is clean, or name the file. End with exactly one verdict:
+
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another
+ round.
+- **NOT READY**: one or more P1s, listed.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites.
diff --git a/docs/superpowers/specs/2026-11-16-video-conversion-design.md b/docs/superpowers/specs/2026-11-16-video-conversion-design.md
index a50fc5831..01cfb694d 100644
--- a/docs/superpowers/specs/2026-11-16-video-conversion-design.md
+++ b/docs/superpowers/specs/2026-11-16-video-conversion-design.md
@@ -173,9 +173,9 @@ belong to one execution:
`<etag>` is the source's ETag without quotes
(`internal/objstore/clamav.go:517`). Each PUT is create-only (`If-None-Match:
*`, signed). **Every output stays under the 5 GB a single PUT carries (paul
-R-X):** two hours of video at the bitrate ceiling is about 2.4 GB, and eight
-hours of audio about 0.5 GB; the handler fails `output_too_large` rather than
-exceed it. A later ladder preset is a sibling directory. The app learns the
+R-X):** three hours of video at the bitrate ceiling is about 3.5 GB
+(§11 A9), and eight hours of audio about 0.5 GB; the handler fails
+`output_too_large` rather than exceed it. A later ladder preset is a sibling directory. The app learns the
keys from the job (§5.2); no platform code reads the tenant's bucket to learn
what was converted, and there is no `result.json` **(my call under R-C: it
added a writer and no authority)**.
@@ -671,11 +671,12 @@ the probe with `needs_long_class`, and the app submits it again with
`"class": "long"`: a new job, since requeue was cut. Ephemeral storage is 20
GiB, or the source size plus 8 GiB when that is more.
-**Maximums (the spike's values, §11 A7; estimates before it).**
+**Maximums (the spike's values, §11 A7, and three hours of SDR, A9;
+estimates before them).**
| | `video-720p` | `audio-aac` |
|---|---|---|
-| Duration, sources up to 1080p | 2 hours | 8 hours |
+| Duration, sources up to 1080p (video: SDR, A9) | 3 hours | 8 hours |
| Duration, HDR sources up to 1080p (A7) | 75 minutes | |
| Duration, sources above 1080p | 30 minutes | |
| Source size | 40 GiB | 10 GiB |
@@ -1141,6 +1142,111 @@ the outputs. Store destroy gains the refusal of §5.3.
`checkOutputs`), and no rule of ours reaches. S3 offers no way to
refuse such a completion; closing it would need a platform rule on
tenant buckets or a sweep of `derived/`, both outside this amendment.
+- **A9, three hours of SDR video** (Paul, 2026-11-25). LiveKit Cloud
+ records up to 3 hours per file, so `video_max` (SDR sources up to
+ 1080p) rises from 2 hours to 3. `video_max_hdr` stays 75 minutes,
+ `video_max_hi` 30 minutes, and the deadline (50 minutes), the grant
+ (one hour, R-K), the classes and `video_bytes` (40 GiB) are unchanged.
+ Where this differs from §5.1, §7.1, A7 or decision 5, it overrides
+ them.
+ - **The fit, by plan 1 Task 5 Step 4's rule.** `D = (40 min - t_start -
+ S/B) x v`, rounded down to 15 minutes, with the spike's `t_start`
+ 31.7 s (p95), `B` 95.3 MB/s (p5) and `S` 40 GiB, so the download is
+ 450.7 s and 1,917.6 s remain for the encode. The spike has two
+ long-class 1080p SDR runs at `medium`: the 1-hour source at 5.85
+ times real time and the 30 GiB, 1 h 43 min source at 5.42. At 5.85, D
+ is 187.0 minutes, which rounds down to 180: 3 hours fit, with no
+ 15-minute step to spare. At 5.42, D is 173.2 minutes, which rounds
+ down to 165: 3 hours do not fit the 40-minute rule, by one step.
+ - **The whole run against the deadline and the grant** (Astra round 1,
+ P2-1 and P2-2). The rule counts only the start, the download and the
+ encode; its 10 minutes below the deadline are the margin for the rest.
+ The whole run, timed from the `deadline` container's start, which the
+ codec's `START` dependency puts first, is: the 450.7 s download, the
+ probe at its own 60 s bound (§6), the encode, the media file's upload
+ at the output ceiling (2,500 kbit/s of video and 128 kbit/s of audio
+ for 3 hours is 3.55 GB, sent at `B`: 37.2 s; the spike sent 1.66 GB
+ in 14.5 s), and 30 s for the poster, the playlist and the three small
+ PUTs (the poster took at most 0.9 s in the spike, and the others are
+ kilobytes). At 5.42 that is 2,570.5 s, or 42.8 minutes; at 5.85, 40.4
+ minutes. The window is the `deadline` container's sleep
+ (`media.DeadlineSleep`): the class's 50 minutes held to `MaxDeadline`,
+ or the grant's expiry less the 30 s stop grace if that comes first.
+ The grant is minted before `RunTask`; with at most 60 s for the
+ presign and `RunTask` calls (their call bounds) and the 31.7 s start,
+ which includes the image pull, the expiry less the grace falls 58.0
+ minutes after the container starts, so the 50-minute deadline is the
+ one that binds. The slower run ends 7.2 minutes inside it, and 44.4
+ minutes after the mint (44.9 with the stop grace) against the one-hour
+ grant. `GrantMintSlack` bounds how long after dispatch the grant may
+ be minted, not the grant's own hour, so it takes nothing from the
+ window. So 3 hours end inside the deadline and the grant on both runs,
+ and inside the plan's 40-minute rule only on the faster one.
+ `TestDefaultMaximumsFitTheLongClass` checks the rule and this window
+ for each default maximum, through `DeadlineSleep` and `MaxDeadline`,
+ and shows that a 40-minute deadline cap or a 42-minute grant would
+ refuse 3 hours.
+ - **The binding term is the 40 GiB size limit.** The download of `S` is
+ 7.5 minutes of the 40. At 5.42 the rule reaches 3 hours for sources up
+ to 33.3 GiB (30 GiB in 5 GiB steps), and every 3-hour source smaller
+ than that fits the rule on either run. A 40 GiB, 3-hour source is
+ about 32 Mbit/s, far above a 720p room composite from LiveKit, whose
+ download takes well under a minute. `video_bytes` stays 40 GiB; an
+ operator who wants the rule to hold on the slower run for every
+ admitted source can set it to 30 GiB.
+ - **What a slow host costs.** The spike saw one short-class cell vary
+ by up to 45 % between Fargate hosts, and each long-class cell ran
+ once. By the whole-run estimate above, 3 hours of SDR miss the
+ deadline below about 4.46 times real time with a 40 GiB source, and
+ below about 3.82 with a 4 GB one. These are estimates from one run of
+ each long cell, not measurements. A
+ run that misses it fails `deadline_exceeded` and is charged its
+ engine time, about 50.5 minutes at weight 1, as any overrun is.
+ - **Outputs and storage.** 3 hours at the ceiling is 3.55 GB, under the
+ 5 GB of one PUT (`output_too_large` is unchanged); the playlist has
+ about 2,700 entries, far under its 4 MiB bound; ephemeral storage
+ (the source plus 8 GiB, at least 20 GiB) holds the output.
+ - **Billing and the reservation.** A long video row is still reserved
+ at weight 2 before its probe (A7), so a 3-hour grant holds `2 x
+ max(180, 50.5)` = 360 allowance minutes while it runs, where 2 hours
+ held 240. A done 3-hour SDR job up to 1080p is charged 180. The
+ dispatch fit (§7.3) already grants `min(3 h, R/2)` and fits the
+ deadline to `R/2` less the stop grace, so an account needs 360
+ minutes free below twice its limit for the full 3 hours (a limit of
+ 180 with nothing used is exactly enough). With less, the allowance
+ grants less and a longer source exits `allowance_exceeded` at the
+ probe, charged the minutes used so far. On the proposed plans, Free
+ (30) is granted at most 30 minutes, as before, and Personal (600)
+ the full 3 hours while 360 of its 1,200 remain. The door's 402 reads
+ settled charges at twice the limit and is unchanged. An `engine_lost`
+ row is still charged its full bound, `deadline_s` plus the stop
+ grace. None of this needs a code change; the simulation's I8 gains
+ grant checks (a row's grant and deadline within its class's figures,
+ a done row's source no longer than its grant, and each Run's payload
+ carrying the row's grant and the deployment's maximums) and a
+ 3-hour witness.
+ - **Mixed versions and settings.** The maximum travels in the payload's
+ existing `d` field and the codec enforces whatever it is sent, so no
+ payload version changes: an older image converts 3 hours from a newer
+ console, and an older console keeps sending 2 hours. A deployment
+ that sets `video_max` in `CARLOS_MEDIA_LIMITS` keeps its own value.
+ - **Open: a recording stopped at LiveKit's limit (unverified).** The
+ probe refuses a source 1 ms over the maximum. A room composite that
+ LiveKit ends at its 3-hour limit (`EGRESS_LIMIT_REACHED`) may report a
+ container duration a little over 3 hours, and would then be refused
+ `source_too_long`. One real recording run to the limit settles it.
+ If it runs over, the remedy is a small margin on `video_max` (the
+ unrounded rule at 5.85 allows 187 minutes), which is Paul's call; the
+ LiveKit page does not promise that a file at the limit converts.
+ - **Review.** Astra round 1 of 3 (brief
+ `docs/superpowers/reviews/CODEX-REVIEW-BRIEF-media-three-hour-sdr.md`,
+ findings `CODEX-FINDINGS-media-three-hour-sdr.md` beside it): READY
+ AFTER FIXES, no P1, two P2s in one fault family, the execution
+ window's accounting. P2-1 (the run omitted the probe and the small
+ outputs, and mixed clock origins) and P2-2 (the fit test ignored
+ `MaxDeadline` and the grant's expiry) are fixed above and in the
+ test, without another round (stopping rule 1). It found the census
+ clean and judged the open LiveKit point not blocking.
## 12. Decisions for Paul
diff --git a/internal/console/apimedia_test.go b/internal/console/apimedia_test.go
index be5ea48a4..0a7020ba0 100644
--- a/internal/console/apimedia_test.go
+++ b/internal/console/apimedia_test.go
@@ -640,6 +640,22 @@ func TestGetFailedMessageComesFromTheDeck(t *testing.T) {
if r := f.get(sub.job.ID); r.job.Error == nil || r.job.Error.Message != "the file is longer than 30 minutes, the maximum for this preset" {
t.Fatalf("source_too_long: %s", r.raw)
}
+ // SDR up to 1080p 1 s over its 3-hour maximum (spec §11 A9): the
+ // handler's failure result for a 1080p H.264 source of 3 h 0 min 1 s,
+ // named with the SDR maximum.
+ sdrProbe := []byte(`{"streams":[{"index":0,"codec_type":"video","codec_name":"h264","width":1920,"height":1080,` +
+ `"avg_frame_rate":"30/1","r_frame_rate":"30/1","color_transfer":"bt709"}],"format":{"duration":"10801.000000"}}`)
+ sdrLong, refused := mediahandler.ProbeFailure("0123456789abcdef0123456789abcdef", media.PresetVideo720p, media.JobLimits{
+ SourceBytes: l.VideoBytes, GrantedMS: l.VideoMax.Milliseconds(), GrantedBy: "class",
+ MaxMS: l.VideoMax.Milliseconds(), MaxHDRMS: l.MaxHDR().Milliseconds(), MaxHiMS: l.VideoMaxHi.Milliseconds(), OutputBytes: media.MaxPutBytes,
+ }, sdrProbe)
+ if !refused || sdrLong.Error != media.CodeSourceTooLong {
+ t.Fatalf("the handler's probe check answered %+v, refused %v", sdrLong, refused)
+ }
+ fail("source_too_long", sdrLong)
+ if r := f.get(sub.job.ID); r.job.Error == nil || r.job.Error.Message != "the file is longer than 3 hours, the maximum for this preset" {
+ t.Fatalf("source_too_long for SDR: %s", r.raw)
+ }
fail("needs_long_class", media.Result{V: 1, Execution: "x", Error: "needs_long_class"})
if r := f.get(sub.job.ID); r.job.Error == nil ||
r.job.Error.Message != "the file is longer than 10 minutes, the most the short class converts. submit it again in the long class" {
@@ -764,7 +780,7 @@ func TestMediaCopyCoversEveryCode(t *testing.T) {
t.Errorf("no phrase for store check %s", c)
}
}
- for d, want := range map[time.Duration]string{2 * time.Hour: "2 hours", time.Hour: "1 hour", 30 * time.Minute: "30 minutes",
+ for d, want := range map[time.Duration]string{2 * time.Hour: "2 hours", 3 * time.Hour: "3 hours", time.Hour: "1 hour", 30 * time.Minute: "30 minutes",
10 * time.Minute: "10 minutes", 90 * time.Minute: "90 minutes", 45 * time.Second: "45 seconds"} {
if got := mediaDuration(d); got != want {
t.Errorf("mediaDuration(%s) = %q, want %q", d, got, want)
diff --git a/internal/edge/burst_test.go b/internal/edge/burst_test.go
index 115a048a2..486322a1c 100644
--- a/internal/edge/burst_test.go
+++ b/internal/edge/burst_test.go
@@ -2,6 +2,8 @@ package edge
import (
"net/netip"
+ "reflect"
+ "runtime"
"sync"
"sync/atomic"
"testing"
@@ -363,18 +365,23 @@ func TestBurstSingleKeyFloodBounded(t *testing.T) {
}
b, c := burstTestLimiter()
// A flood that never lets 60 land inside a window: one note per 2 s.
- allocs := testing.AllocsPerRun(1, func() {
+ flood := func() {
for i := 0; i < 1_000_000; i++ {
b.note("bab/shop", burstClientB)
c.advance(2 * time.Second)
}
- })
+ }
+ // The first pass makes the counter and its ring, so it must allocate: a
+ // count of 0 here means the measurement is broken, not the limiter.
+ if warm := allocsUnder(flood); warm == 0 {
+ t.Fatal("the first flood counted no allocations, but it makes the counter and its ring: allocsUnder is not seeing them")
+ }
+ // The second pass reuses the ring, so it allocates nothing per note.
+ // Allow a handful for the runtime.
+ allocs := allocsUnder(flood)
if n := b.counterCount(); n != 1 {
t.Fatalf("counters = %d, want 1", n)
}
- // AllocsPerRun runs the function once to warm up and once measured; the
- // ring is made in the first, so the measured pass allocates nothing per
- // note. Allow a handful for the runtime.
if allocs > 10 {
t.Fatalf("1,000,000 notes allocated %v times", allocs)
}
@@ -385,7 +392,7 @@ func TestBurstSingleKeyFloodBounded(t *testing.T) {
// A flood inside a cool-down is a no-op: no counters, no allocation.
b2, _ := burstTestLimiter()
b2.apply(burstClientA, b2.now().Add(time.Minute))
- allocs = testing.AllocsPerRun(1, func() {
+ allocs = allocsUnder(func() {
for i := 0; i < 1_000_000; i++ {
b2.note("bab/shop", burstClientA)
}
@@ -395,6 +402,75 @@ func TestBurstSingleKeyFloodBounded(t *testing.T) {
}
}
+// allocsUnder runs f once and reports the heap allocations made on f's own
+// call stack, leaving out every other goroutine's.
+//
+// testing.AllocsPerRun and runtime.MemStats count the whole process, and
+// goroutines from earlier tests in this package are still running when a
+// test starts. TestHeldDialClientCancelReturnsAtOnce is one: its client
+// gives up after 100 ms, but http.Transport finishes a dial it has started
+// even when the request is cancelled (net/http detaches the dial from the
+// request's context), so the edge's local-dial hold goes on redialling the
+// dead port every 100 ms for the rest of its 2 s. A million notes take long
+// enough for some of those redials to land in a process-wide count: CI saw
+// 21 and 25 allocations against a limit of 10.
+//
+// With MemProfileRate at 1 the heap profile records every allocation with
+// its stack, so the allocations made under allocsMark, and so under f, can be
+// told apart. Both limits err towards counting fewer. The profile keeps 32
+// frames, so an allocation more than about 25 calls below f is missed. Small
+// pointer-free allocations that share one 16-byte block are recorded once
+// per block, so a per-note one would still count tens of thousands over a
+// million notes. A caller should check that a pass it knows allocates gets a
+// count above zero, so a broken measurement cannot pass as a clean one.
+func allocsUnder(f func()) int64 {
+ rate := runtime.MemProfileRate
+ runtime.MemProfileRate = 1
+ defer func() { runtime.MemProfileRate = rate }()
+ before := allocsMarked()
+ allocsMark(f)
+ return allocsMarked() - before
+}
+
+// allocsMark is the frame allocsUnder looks for in each allocation's stack.
+//
+//go:noinline
+func allocsMark(f func()) { f() }
+
+// allocsMarked sums the allocations, over the whole run so far, whose stack
+// passes through allocsMark.
+func allocsMarked() int64 {
+ // MemProfile reports as of the last completed collection; runtime.GC
+ // completes one, so every allocation made before this call is included.
+ runtime.GC()
+ var recs []runtime.MemProfileRecord
+ for n := 64; ; {
+ recs = make([]runtime.MemProfileRecord, n)
+ got, ok := runtime.MemProfile(recs, true)
+ if ok {
+ recs = recs[:got]
+ break
+ }
+ n = got + got/4 // more records than fit: make room and read again
+ }
+ mark := runtime.FuncForPC(reflect.ValueOf(allocsMark).Pointer()).Name()
+ var total int64
+ for i := range recs {
+ frames := runtime.CallersFrames(recs[i].Stack())
+ for {
+ fr, more := frames.Next()
+ if fr.Function == mark {
+ total += recs[i].AllocObjects
+ break
+ }
+ if !more {
+ break
+ }
+ }
+ }
+ return total
+}
+
func TestBurstRingHoldsAtMost60Timestamps(t *testing.T) {
b, c := burstTestLimiter()
for i := 0; i < 5000; i++ {
diff --git a/internal/media/limits.go b/internal/media/limits.go
index 57bcaa377..97355b5f5 100644
--- a/internal/media/limits.go
+++ b/internal/media/limits.go
@@ -11,6 +11,13 @@ import (
// per-file maximums (spec §7.1), the per-account allowance used when there
// is no plan catalog (§7.3), and the fair-use figures (§7.2).
//
+// VideoMax is 3 hours (spec §11 A9, Paul 2026-11-25), so a LiveKit Cloud
+// recording, up to 3 hours a file, converts in one job: at the spike's
+// 5.85 times real time for 1080p SDR on the long class, 3 hours fit the
+// plan's 40-minute rule with a 40 GiB source, and at its slowest SDR run
+// (5.42) they still end inside the 50-minute deadline.
+// TestDefaultMaximumsFitTheLongClass holds the arithmetic.
+//
// VideoMaxHDR is the maximum for an HDR video source up to 1080p, held to
// VideoMax (MaxHDR): the spike converted 1080p HDR at 2.71 times real
// time on the long class, against 5.85 for SDR, so two hours of it do not
@@ -29,7 +36,7 @@ type Limits struct {
// DefaultLimits is what ParseLimits("") gives.
func DefaultLimits() Limits {
return Limits{
- VideoMax: 2 * time.Hour,
+ VideoMax: 3 * time.Hour,
VideoMaxHDR: 75 * time.Minute,
VideoMaxHi: 30 * time.Minute,
VideoBytes: 40 << 30,
diff --git a/internal/media/media_test.go b/internal/media/media_test.go
index 19dc08c8b..4c35949bd 100644
--- a/internal/media/media_test.go
+++ b/internal/media/media_test.go
@@ -120,7 +120,7 @@ func TestClassTable(t *testing.T) {
// Above 1080p converts on the long video class only (spec §11 A7):
// at 4 vCPU 4K HDR ran at 0.27 times real time.
{ClassKey{PresetVideo720p, ClassShort}, 4096, 8192, 15 * time.Minute, 10 * time.Minute, false},
- {ClassKey{PresetVideo720p, ClassLong}, 16384, 32768, 50 * time.Minute, 2 * time.Hour, true},
+ {ClassKey{PresetVideo720p, ClassLong}, 16384, 32768, 50 * time.Minute, 3 * time.Hour, true},
{ClassKey{PresetAudioAAC, ClassShort}, 1024, 2048, 10 * time.Minute, 2 * time.Hour, false},
{ClassKey{PresetAudioAAC, ClassLong}, 2048, 4096, 50 * time.Minute, 8 * time.Hour, false},
} {
@@ -182,7 +182,7 @@ func TestParseLimits(t *testing.T) {
t.Fatal(err)
}
want := Limits{
- VideoMax: 2 * time.Hour, VideoMaxHDR: 75 * time.Minute, VideoMaxHi: 30 * time.Minute, VideoBytes: 40 << 30,
+ VideoMax: 3 * time.Hour, VideoMaxHDR: 75 * time.Minute, VideoMaxHi: 30 * time.Minute, VideoBytes: 40 << 30,
AudioMax: 8 * time.Hour, AudioBytes: 10 << 30, AccountMinutes: 0,
Short: 6, Long: 2, AccountShort: 2, AccountLong: 1, AccountActive: 20,
PerMinute: 30, Burst: 10, Queue: 200,
@@ -220,9 +220,11 @@ func TestParseLimits(t *testing.T) {
}
}
-// TestMaxDuration: 2 hours for SDR up to 1080p, 75 minutes for HDR up to
-// 1080p (the spike's 1080p HDR ran at 2.71 times real time on the long
-// class, spec §11 A7), 30 minutes above 1080p whatever the transfer.
+// TestMaxDuration: 3 hours for SDR up to 1080p (spec §11 A9, Paul
+// 2026-11-25: a LiveKit Cloud recording is up to 3 hours a file), 75
+// minutes for HDR up to 1080p (the spike's 1080p HDR ran at 2.71 times
+// real time on the long class, spec §11 A7), 30 minutes above 1080p
+// whatever the transfer.
func TestMaxDuration(t *testing.T) {
l := DefaultLimits()
for _, c := range []struct {
@@ -231,8 +233,9 @@ func TestMaxDuration(t *testing.T) {
hdr bool
want time.Duration
}{
- {PresetVideo720p, 1920, 1080, false, 2 * time.Hour},
- {PresetVideo720p, 1080, 1920, false, 2 * time.Hour},
+ {PresetVideo720p, 1920, 1080, false, 3 * time.Hour},
+ {PresetVideo720p, 1080, 1920, false, 3 * time.Hour},
+ {PresetVideo720p, 1280, 720, false, 3 * time.Hour},
{PresetVideo720p, 1920, 1080, true, 75 * time.Minute},
{PresetVideo720p, 1080, 1920, true, 75 * time.Minute},
{PresetVideo720p, 2560, 1440, false, 30 * time.Minute},
@@ -260,6 +263,87 @@ func TestMaxDuration(t *testing.T) {
}
}
+// TestDefaultMaximumsFitTheLongClass (spec §11 A9): each default video
+// maximum against the spike's measurements on the long class at medium
+// (docs/superpowers/reviews/2026-11-16-media-conversion-spike.md, Task 5),
+// so raising one past what the engine converts in its window fails here.
+//
+// First plan 1 Task 5 Step 4's rule, D = (40 min - t_start - S/B) x v
+// rounded down to 15 minutes, with t_start the p95 start (31.7 s), B the
+// p5 download (95.3 MB/s), S the video size maximum and v the cell's
+// speed. At the slower 1080p SDR run, the 30 GiB source at 5.42 times
+// real time, the rule gives 165 minutes, so 3 hours rest on the 1-hour
+// run's 5.85 for the rule (A9).
+//
+// Then the whole run at each cell's slowest speed against the window the
+// engine gives it: the download, the probe at its own 60 s bound (spec
+// §6), the encode, the media file's upload at the output ceiling
+// (2,500 kbit/s of video plus 128 kbit/s of audio, sent at B) and 30 s
+// for the poster, the playlist and the three small PUTs, against the
+// class's deadline held to MaxDeadline and the grant's expiry less the
+// stop grace (DeadlineSleep), with the grant minted 60 s of call bounds
+// and t_start before the deadline container starts.
+func TestDefaultMaximumsFitTheLongClass(t *testing.T) {
+ l := DefaultLimits()
+ const (
+ budget = 40 * time.Minute
+ start = 31700 * time.Millisecond
+ bps = 95.3e6 // bytes a second
+ probe = 60 * time.Second
+ rest = 30 * time.Second
+ calls = 60 * time.Second // the presign and RunTask between the mint and the start
+ )
+ secs := func(bytes float64) time.Duration { return time.Duration(bytes / bps * float64(time.Second)) }
+ download := secs(float64(l.VideoBytes))
+ rule := func(v float64) time.Duration {
+ d := time.Duration(float64(budget-start-download) * v)
+ return d - d%(15*time.Minute)
+ }
+ long, _ := Class(ClassKey{PresetVideo720p, ClassLong})
+ window := func(maxDeadline, grant time.Duration) time.Duration {
+ mint := time.Date(2026, 11, 25, 12, 0, 0, 0, time.UTC)
+ return DeadlineSleep(mint.Add(calls+start), min(long.Deadline, maxDeadline), mint.Add(grant))
+ }
+ required := func(max time.Duration, v float64) time.Duration {
+ out := (2500e3 + 128e3) / 8 * max.Seconds()
+ if out >= MaxPutBytes {
+ t.Errorf("%s at the bitrate ceiling is %.0f bytes, over one PUT's %d", max, out, int64(MaxPutBytes))
+ }
+ return download + probe + time.Duration(float64(max)/v) + secs(out) + rest
+ }
+ for _, c := range []struct {
+ name string
+ max time.Duration
+ rule, slow float64
+ }{
+ {"SDR up to 1080p", l.VideoMax, 5.85, 5.42},
+ {"HDR up to 1080p", l.MaxHDR(), 2.71, 2.71},
+ {"above 1080p", l.VideoMaxHi, 1.20, 1.20},
+ } {
+ if got := rule(c.rule); got < c.max {
+ t.Errorf("%s: the plan's rule at %.2f times real time gives %s, under the %s maximum", c.name, c.rule, got, c.max)
+ }
+ if need, w := required(c.max, c.slow), window(MaxDeadline, GrantLifetime); need > w {
+ t.Errorf("%s: %s at %.2f needs %s from the deadline container's start, and the engine allows %s", c.name, c.max, c.slow, need, w)
+ }
+ }
+ // The window check bites: 3 hours of SDR at 5.42 need about 42.8
+ // minutes, so a 40-minute deadline cap, or a grant that expires 42
+ // minutes after its mint, leaves too little.
+ need := required(l.VideoMax, 5.42)
+ for _, c := range []struct {
+ name string
+ maxDeadline, grant time.Duration
+ }{
+ {"a 40-minute deadline cap", 40 * time.Minute, GrantLifetime},
+ {"a 42-minute grant", MaxDeadline, 42 * time.Minute},
+ } {
+ if w := window(c.maxDeadline, c.grant); need <= w {
+ t.Errorf("%s leaves %s and 3 hours of SDR need %s: the window check cannot fail", c.name, w, need)
+ }
+ }
+}
+
func TestEphemeralGiB(t *testing.T) {
for _, c := range []struct {
bytes int64
diff --git a/internal/mediajobs/jobs_test.go b/internal/mediajobs/jobs_test.go
index c2ed70304..4ef54882b 100644
--- a/internal/mediajobs/jobs_test.go
+++ b/internal/mediajobs/jobs_test.go
@@ -16,6 +16,7 @@ import (
"github.com/carlosframework/platform/internal/media"
"github.com/carlosframework/platform/internal/media/mediatest"
+ "github.com/carlosframework/platform/internal/mediahandler"
)
var (
@@ -2206,7 +2207,7 @@ func TestLongVideoReservesTwice(t *testing.T) {
key, preset, class string
want int64
}{
- {"uploads/long.mov", video, media.ClassLong, 20 * (2 * time.Hour).Milliseconds()},
+ {"uploads/long.mov", video, media.ClassLong, 20 * (3 * time.Hour).Milliseconds()},
{"uploads/short.mov", video, "", 10 * ((15 * time.Minute).Milliseconds() + stop)},
{"uploads/long.m4a", audio, media.ClassLong, 1 * (8 * time.Hour).Milliseconds()},
} {
@@ -2263,3 +2264,118 @@ func TestLegacyRowsKeepTheirWeight(t *testing.T) {
t.Fatalf("legacy rows charged %d units, want %d", u.Charged, want)
}
}
+
+// TestThreeHourSDRConverts (spec §11 A9, Paul 2026-11-25: LiveKit Cloud
+// records up to 3 hours a file): with the default limits a long video is
+// granted 3 hours and reserved at weight 2, 360 allowance minutes; its
+// payload names the three maximums; the codec's own probe check, given
+// that payload, converts 3 hours of SDR up to 1080p and refuses 1 ms more,
+// while HDR up to 1080p keeps 75 minutes and above 1080p keeps 30. Done at
+// 3 hours of 1080p, the job is charged 180 minutes at weight 1.
+func TestThreeHourSDRConverts(t *testing.T) {
+ h := newHarness(t, "", nil)
+ j := h.submit("acct1", "shop", "uploads/stream.mp4", video, media.ClassLong, 3<<30)
+ r, task := h.run(j)
+ if r.GrantedS != 3*3600 || r.DeadlineS != 50*60 {
+ t.Fatalf("granted %d s, deadline %d s; want 10800 and 3000", r.GrantedS, r.DeadlineS)
+ }
+ if u := h.usage("acct1", h.now); u.Reserved != 20*(3*time.Hour).Milliseconds() || u.Charged != 0 {
+ t.Fatalf("usage %+v, want 360 minutes reserved", u)
+ }
+ req := h.eng.Requests(r.Execution)
+ var p media.Payload
+ if len(req) != 1 || json.Unmarshal(req[0].Payload, &p) != nil {
+ t.Fatalf("run requests %+v", req)
+ }
+ want := media.JobLimits{SourceBytes: 40 << 30, GrantedMS: 10_800_000, GrantedBy: grantedByClass,
+ MaxMS: 10_800_000, MaxHDRMS: 4_500_000, MaxHiMS: 1_800_000, OutputBytes: media.MaxPutBytes}
+ if p.Limits != want {
+ t.Fatalf("payload limits %+v, want %+v", p.Limits, want)
+ }
+ for _, c := range []struct {
+ name string
+ width, height int
+ transfer, sec string
+ want string
+ }{
+ {"3 h of 1080p SDR", 1920, 1080, "bt709", "10800.000000", ""},
+ {"3 h and 1 ms of 1080p SDR", 1920, 1080, "bt709", "10800.001000", media.CodeSourceTooLong},
+ {"3 h of portrait 720p", 720, 1280, "", "10800.000000", ""},
+ {"3 h and 1 ms of portrait 720p", 720, 1280, "", "10800.001000", media.CodeSourceTooLong},
+ {"76 min of 1080p SDR", 1920, 1080, "bt709", "4560.000000", ""},
+ {"75 min of 1080p HLG", 1920, 1080, "arib-std-b67", "4500.000000", ""},
+ {"75 min and 1 ms of 1080p HLG", 1920, 1080, "arib-std-b67", "4500.001000", media.CodeSourceTooLong},
+ {"75 min and 1 ms of 1080p PQ", 1080, 1920, "smpte2084", "4500.001000", media.CodeSourceTooLong},
+ {"30 min of 4K", 3840, 2160, "bt709", "1800.000000", ""},
+ {"30 min and 1 ms of 4K", 3840, 2160, "bt709", "1800.001000", media.CodeSourceTooLong},
+ {"30 min and 1 ms of 1440p", 2560, 1440, "", "1800.001000", media.CodeSourceTooLong},
+ } {
+ probe := fmt.Sprintf(`{"streams":[{"index":0,"codec_type":"video","codec_name":"h264","width":%d,"height":%d,`+
+ `"avg_frame_rate":"30/1","r_frame_rate":"30/1","color_transfer":%q}],"format":{"duration":%q}}`, c.width, c.height, c.transfer, c.sec)
+ res, refused := mediahandler.ProbeFailure(r.Execution, video, p.Limits, []byte(probe))
+ switch {
+ case c.want == "" && refused:
+ t.Errorf("%s: refused %s, want it to convert", c.name, res.Error)
+ case c.want != "" && (!refused || res.Error != c.want):
+ t.Errorf("%s: refused %v with %q, want %s", c.name, refused, res.Error, c.want)
+ }
+ }
+ h.now = h.now.Add(32 * time.Minute)
+ h.codecSucceedsAt(r, (3 * time.Hour).Milliseconds(), 1920, 1080)
+ h.finish(task, media.ExitDone)
+ h.track()
+ got := h.row(j)
+ if got.State != stateDone || got.SourceMS != 10_800_000 || got.WeightTenths != 10 {
+ t.Fatalf("done row: %s source %d ms weight %d", got.State, got.SourceMS, got.WeightTenths)
+ }
+ if m, err := h.jobs.ChargedMinutes(tctx, "acct1", h.now); err != nil || m != 180 {
+ t.Fatalf("charged %d minutes, want 180 (%v)", m, err)
+ }
+}
+
+// TestThreeHourGrantFitsTwiceTheAllowance (spec §7.3, §11 A7 and A9): a
+// long video reserves at weight 2, so 3 hours need 360 allowance minutes
+// free. An account with a limit of 180 (R = 360) is granted the full 3
+// hours with a reservation of exactly twice its limit, and nothing else of
+// its fits until that settles; at 179 (R = 358) the allowance grants 179
+// minutes, and the codec answers allowance_exceeded for 3 hours of SDR.
+// A 3-hour done job charges 180 minutes, under the door's 402 at twice
+// 180.
+func TestThreeHourGrantFitsTwiceTheAllowance(t *testing.T) {
+ h := newHarness(t, "account_long=2,long=4", map[string]int64{"acct1": 180, "acct2": 179})
+ a := h.submit("acct1", "shop", "uploads/stream-1.mp4", video, media.ClassLong, 3<<30)
+ ra, task := h.run(a)
+ if ra.GrantedS != 10800 || ra.DeadlineS != 3000 {
+ t.Fatalf("limit 180: granted %d s, deadline %d s; want 10800 and 3000", ra.GrantedS, ra.DeadlineS)
+ }
+ if u := h.usage("acct1", h.now); u.Charged+u.Reserved != 2*180*unitsPerMinute {
+ t.Fatalf("limit 180: usage %+v, want exactly twice the limit", u)
+ }
+ b := h.submit("acct1", "shop", "uploads/stream-2.mp4", video, media.ClassLong, 3<<30)
+ if h.dispatch(media.ClassLong) != nil || h.row(b).State != stateQueued {
+ t.Fatal("a second long video dispatched with R = 0")
+ }
+ h.now = h.now.Add(32 * time.Minute)
+ h.codecSucceedsAt(ra, (3 * time.Hour).Milliseconds(), 1920, 1080)
+ h.finish(task, media.ExitDone)
+ h.track()
+ if m, err := h.jobs.ChargedMinutes(tctx, "acct1", h.now); err != nil || m != 180 || m/2 >= 180 {
+ t.Fatalf("limit 180: charged %d minutes, want 180, under the 402 at 360 (%v)", m, err)
+ }
+
+ c := h.submit("acct2", "shop", "uploads/stream-3.mp4", video, media.ClassLong, 3<<30)
+ rc, _ := h.run(c)
+ if rc.GrantedS != 179*60 || rc.DeadlineS != 3000 {
+ t.Fatalf("limit 179: granted %d s, deadline %d s; want 10740 and 3000", rc.GrantedS, rc.DeadlineS)
+ }
+ var p media.Payload
+ if req := h.eng.Requests(rc.Execution); len(req) != 1 || json.Unmarshal(req[0].Payload, &p) != nil ||
+ p.Limits.GrantedMS != 179*60000 || p.Limits.GrantedBy != grantedByAllowance || p.Limits.MaxMS != 10_800_000 {
+ t.Fatalf("limit 179: payload limits %+v", p.Limits)
+ }
+ probe := []byte(`{"streams":[{"index":0,"codec_type":"video","codec_name":"h264","width":1920,"height":1080,` +
+ `"avg_frame_rate":"30/1","r_frame_rate":"30/1"}],"format":{"duration":"10800.000000"}}`)
+ if res, refused := mediahandler.ProbeFailure(rc.Execution, video, p.Limits, probe); !refused || res.Error != media.CodeAllowanceExceeded {
+ t.Fatalf("limit 179, 3 h of SDR: refused %v with %q, want allowance_exceeded", refused, res.Error)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index f1cedeabf..9c74edcaa 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -291,4 +291,5 @@ plan14-root-reads-console-addr-from-install.tsv f273b5cb7bbf37b6dca4bb964a9293cb
plan14-root-reads-instance-ready-before-wake.tsv aa953b1a43009c8208e44c67f5b8127ae1914b15d8b8822bcf16b19a6abdf121
plan14-root-reads-media-results-cleanup.tsv 6921575b59564ed947e30c02e314dd429016c6c11a85db9b8af50b2f31d5a5db
plan14-root-reads-release-copy-across-consoles.tsv 892cf87db700600490e3ec9e944f9dbe7151e43bc5471090634f1735bcb9a7bd
+plan14-root-reads-rootfs-etc-hosts-1349.tsv 892cf87db700600490e3ec9e944f9dbe7151e43bc5471090634f1735bcb9a7bd
plan14-root-reads-managed-fleets-2b2.tsv 4bb3547d064b71134612e74b3b8269e16356d2832a8e579ace150349e55c6a27
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-etc-hosts-1349.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-etc-hosts-1349.tsv
new file mode 100644
index 000000000..1a9148827
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-etc-hosts-1349.tsv
@@ -0,0 +1,3 @@
+# Census overlay rootfs-etc-hosts-1349, written by census-propose (#369). census-ruling-rootfs-etc-hosts-1349, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-rootfs-etc-hosts-1349.md.
+# 0 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@coverage internal/rootfsimage 2ba2c948bcf471414042cd8c0a8ac110bb06291ec9d0d46f388d83a5fd781ac5
diff --git a/internal/rootfsimage/mounts.go b/internal/rootfsimage/mounts.go
index d5f1fcfd2..34d46cc3d 100644
--- a/internal/rootfsimage/mounts.go
+++ b/internal/rootfsimage/mounts.go
@@ -16,8 +16,20 @@ var MountPoints = []string{"data", "run/carlos", "opt/carlos", "tmp", "dev", "pr
// onto each: root's resolver copy onto etc/resolv.conf.
var MountFiles = []string{"etc/resolv.conf"}
+// DefaultHosts is the /etc/hosts an image gets when it brings none (#1349).
+// Docker and Kubernetes write /etc/hosts into a container when it starts,
+// so an image's layers almost never carry one, and libraries that read it
+// (Ruby's Resolv, which Excon uses) fail without it. Only localhost: the
+// instance's hostname is the box's and is not known when the image is
+// built.
+const DefaultHosts = "127.0.0.1\tlocalhost\n::1\tlocalhost ip6-localhost ip6-loopback\n"
+
+// hostsFile is where DefaultHosts goes.
+const hostsFile = "etc/hosts"
+
// AddMountPoints adds what MountPoints and MountFiles name that the tree
-// does not have, and the parents they need. A new directory is 0:0 mode 0755
+// does not have, and the parents they need, and DefaultHosts at etc/hosts
+// unless the image has its own non-empty hosts file. A new directory is 0:0 mode 0755
// ("tmp" is 01777), a new file 0:0 0644 and empty, all with the time of the
// tree's newest entry, so that adding them does not make a rebuild of the
// same source differ.
@@ -28,7 +40,9 @@ var MountFiles = []string{"etc/resolv.conf"}
// Lookup, not Resolve: a symlink at "tmp" would send the mount somewhere
// else.) A mount file that is not a regular file, such as the symlink most
// images make of resolv.conf, becomes the empty file, since the box binds
-// over it.
+// over it. An etc/hosts that is missing, empty (the placeholder a container
+// export leaves), a directory, or a symlink that leads nowhere useful
+// becomes DefaultHosts, 0:0 0644 (addDefaultHosts).
func AddMountPoints(t *Tree) error {
when := t.Newest()
for _, p := range MountPoints {
@@ -51,7 +65,36 @@ func AddMountPoints(t *Tree) error {
return err
}
}
- return nil
+ return addDefaultHosts(t, when)
+}
+
+// addDefaultHosts writes DefaultHosts at etc/hosts unless the tree has a
+// non-empty regular file there. A symlink there that resolves inside the
+// tree to a non-empty regular file is replaced by that file (a hard link
+// to its bytes, with its mode, owner and time), since its target may sit
+// under a directory a box mounts over.
+func addDefaultHosts(t *Tree, when time.Time) error {
+ if err := t.mountDir(parentOf(hostsFile), when); err != nil {
+ return err
+ }
+ e, ok := t.Lookup(hostsFile)
+ if ok && e.Type == TypeFile && e.Size > 0 {
+ return nil
+ }
+ if ok && e.Type == TypeSymlink {
+ if p, found := t.Resolve(hostsFile); found {
+ if target, ok := t.Lookup(p); ok && target.Type == TypeFile && target.Size > 0 {
+ c := *target
+ c.Path = hostsFile
+ return t.add(&c)
+ }
+ }
+ }
+ src, err := t.writeBlob(strings.NewReader(DefaultHosts), int64(len(DefaultHosts)))
+ if err != nil {
+ return err
+ }
+ return t.add(&Entry{Path: hostsFile, Type: TypeFile, Mode: 0o644, ModTime: when, Size: int64(len(DefaultHosts)), src: src})
}
// mountDir makes sure p and each of its parents is a directory of the tree.
diff --git a/internal/rootfsimage/mounts_test.go b/internal/rootfsimage/mounts_test.go
index 53ed2ff08..5d176bc2f 100644
--- a/internal/rootfsimage/mounts_test.go
+++ b/internal/rootfsimage/mounts_test.go
@@ -164,3 +164,142 @@ func TestAddMountPointsOnAnEmptyTreeUsesTheRootsTime(t *testing.T) {
t.Errorf("data mtime = %v, want the root's %v", e.ModTime, tr.Root.ModTime)
}
}
+
+// #1349: an image has no /etc/hosts of its own (Docker and Kubernetes write
+// one at start), so ship adds one naming localhost.
+const wantHosts = "127.0.0.1\tlocalhost\n::1\tlocalhost ip6-localhost ip6-loopback\n"
+
+func TestAddMountPointsAddsADefaultHostsFile(t *testing.T) {
+ for _, c := range []struct {
+ name string
+ es []tEntry
+ }{
+ {"no etc at all", []tEntry{{name: "app/run", typ: tar.TypeReg, mode: 0o755, body: "x", mtime: 1_700_000_500}}},
+ {"no hosts", []tEntry{{name: "etc/", typ: tar.TypeDir, mode: 0o755, mtime: 1_700_000_500}}},
+ {"an empty hosts", []tEntry{{name: "etc/hosts", typ: tar.TypeReg, mode: 0o600, mtime: 1_700_000_500}}},
+ {"a dangling hosts symlink", []tEntry{
+ {name: "etc/", typ: tar.TypeDir, mode: 0o755, mtime: 1_700_000_500},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "../run/hosts"},
+ }},
+ {"a looping hosts symlink", []tEntry{
+ {name: "etc/", typ: tar.TypeDir, mode: 0o755, mtime: 1_700_000_500},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "hosts.b"},
+ {name: "etc/hosts.b", typ: tar.TypeSymlink, link: "hosts"},
+ }},
+ {"a hosts symlink to an empty file", []tEntry{
+ {name: "etc/hosts.real", typ: tar.TypeReg, mode: 0o644, mtime: 1_700_000_500},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "hosts.real"},
+ }},
+ {"a hosts symlink to a directory", []tEntry{
+ {name: "etc/hosts.d/", typ: tar.TypeDir, mode: 0o755, mtime: 1_700_000_500},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "hosts.d"},
+ }},
+ {"a hosts directory", []tEntry{
+ {name: "etc/hosts/", typ: tar.TypeDir, mode: 0o755, mtime: 1_700_000_500},
+ {name: "etc/hosts/x", typ: tar.TypeReg, mode: 0o644, body: "x"},
+ }},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ tr := NewTree(t.TempDir())
+ apply(t, tr, layerTar(t, c.es...))
+ newest := tr.Newest()
+ if err := AddMountPoints(tr); err != nil {
+ t.Fatal(err)
+ }
+ h := mustLookup(t, tr, "etc/hosts")
+ if h.Type != TypeFile || h.Mode != 0o644 || h.UID != 0 || h.GID != 0 || h.LinkTarget != "" || h.Size != int64(len(wantHosts)) || !h.ModTime.Equal(newest) {
+ t.Errorf("etc/hosts = %+v, want a 0:0 0644 regular file of %d bytes dated %v", h, len(wantHosts), newest)
+ }
+ if got := readAll(t, tr, h); got != wantHosts {
+ t.Errorf("etc/hosts holds %q, want %q", got, wantHosts)
+ }
+ if _, ok := tr.Lookup("etc/hosts/x"); ok {
+ t.Error("the directory's contents stayed")
+ }
+ // A second call changes nothing.
+ n := len(tr.Entries())
+ if err := AddMountPoints(tr); err != nil {
+ t.Fatal(err)
+ }
+ if len(tr.Entries()) != n || readAll(t, tr, mustLookup(t, tr, "etc/hosts")) != wantHosts {
+ t.Error("a second call changed the tree")
+ }
+ })
+ }
+}
+
+func TestAddMountPointsKeepsTheImagesOwnHostsFile(t *testing.T) {
+ tr := NewTree(t.TempDir())
+ apply(t, tr, layerTar(t,
+ tEntry{name: "etc/", typ: tar.TypeDir, mode: 0o755},
+ tEntry{name: "etc/hosts", typ: tar.TypeReg, mode: 0o600, uid: 5, body: "127.0.0.1 localhost\n10.0.0.9 db\n"},
+ ))
+ if err := AddMountPoints(tr); err != nil {
+ t.Fatal(err)
+ }
+ h := mustLookup(t, tr, "etc/hosts")
+ if got := readAll(t, tr, h); got != "127.0.0.1 localhost\n10.0.0.9 db\n" {
+ t.Errorf("etc/hosts = %q, want the image's bytes", got)
+ }
+ if h.Mode != 0o600 || h.UID != 5 {
+ t.Errorf("etc/hosts = %+v, want the image's mode and owner", h)
+ }
+}
+
+// Astra R1 P2: a hosts symlink that leads, inside the image, to a non-empty
+// regular file keeps that file's bytes, materialised at etc/hosts (so a
+// target under a directory a box mounts over is not lost).
+func TestAddMountPointsKeepsAHostsSymlinksTarget(t *testing.T) {
+ const own = "127.0.0.1 localhost\n10.0.0.9 db\n"
+ for _, c := range []struct {
+ name string
+ es []tEntry
+ }{
+ {"relative", []tEntry{
+ {name: "etc/hosts.real", typ: tar.TypeReg, mode: 0o640, uid: 5, gid: 6, body: own, mtime: 1_600_000_000},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "hosts.real"},
+ }},
+ {"absolute and chained", []tEntry{
+ {name: "nix/store/abc-hosts", typ: tar.TypeReg, mode: 0o640, uid: 5, gid: 6, body: own, mtime: 1_600_000_000},
+ {name: "etc/static/hosts", typ: tar.TypeSymlink, link: "/nix/store/abc-hosts"},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "/etc/static/hosts"},
+ }},
+ {"into a directory boxes mount over", []tEntry{
+ {name: "run/hosts", typ: tar.TypeReg, mode: 0o640, uid: 5, gid: 6, body: own, mtime: 1_600_000_000},
+ {name: "etc/hosts", typ: tar.TypeSymlink, link: "../run/hosts"},
+ }},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ tr := NewTree(t.TempDir())
+ apply(t, tr, layerTar(t, c.es...))
+ if err := AddMountPoints(tr); err != nil {
+ t.Fatal(err)
+ }
+ h := mustLookup(t, tr, "etc/hosts")
+ if h.Type != TypeFile || h.LinkTarget != "" || h.Size != int64(len(own)) || h.Mode != 0o640 || h.UID != 5 || h.GID != 6 {
+ t.Errorf("etc/hosts = %+v, want a copy of the link's target", h)
+ }
+ if got := readAll(t, tr, h); got != own {
+ t.Errorf("etc/hosts holds %q, want the target's bytes", got)
+ }
+ n := len(tr.Entries())
+ if err := AddMountPoints(tr); err != nil {
+ t.Fatal(err)
+ }
+ if len(tr.Entries()) != n || readAll(t, tr, mustLookup(t, tr, "etc/hosts")) != own {
+ t.Error("a second call changed the tree")
+ }
+ })
+ }
+}
+
+func TestAddMountPointsRefusesASymlinkAtEtcForTheHostsFile(t *testing.T) {
+ // etc is a parent of a mount file already; the hosts file never follows
+ // a link out of it.
+ tr := NewTree(t.TempDir())
+ apply(t, tr, layerTar(t, tEntry{name: "etc", typ: tar.TypeSymlink, link: "usr/etc"}))
+ var me MountPointError
+ if err := AddMountPoints(tr); !errors.As(err, &me) || me != (MountPointError{"etc", "symlink"}) {
+ t.Errorf("err = %v, want the etc symlink refused", err)
+ }
+}
diff --git a/internal/sim/mediajobs/invariants_test.go b/internal/sim/mediajobs/invariants_test.go
index 3bf080a2c..e7b265182 100644
--- a/internal/sim/mediajobs/invariants_test.go
+++ b/internal/sim/mediajobs/invariants_test.go
@@ -60,6 +60,16 @@ import (
// 0.1 for audio; a settled row is charged at the weight its row
// stores, which is never above that reservation weight and is 2 only
// on a long video whose codec reported a source above 1080p.
+// - I8 (grant, spec §7.3, §11 A2 and A9). Every dispatched row's
+// granted_s is at most its class's granted figure (the deployment's
+// video_max or audio_max on a long row) and its deadline_s at most
+// its class's deadline, so no reservation passes what its class can
+// cost; a done row's source_ms is at most its granted_s, so its
+// charge is at most w × granted_s. Every Run that was not rejected
+// carries the row's grant and the deployment's maximums in its
+// payload: GrantedMS is granted_s, so the codec converts and reports
+// no more than was reserved, and MaxMS, MaxHDRMS and MaxHiMS are the
+// configured duration maximums for the preset.
// - I3 (weight). A charged row settles at weight 2 exactly when it is a
// long video and the job table read, in the step it settled, a result
// whose source facts its codec wrote above 1080p. Any other charged
@@ -542,6 +552,7 @@ func check(w *world) {
}
}
}
+ checkGrants(w, rows)
for _, a := range accounts {
if limit := w.allowance[a]; limit > 0 {
if most := 2 * limit * 600000; used[a] > most {
@@ -555,6 +566,9 @@ func check(w *world) {
if r.Misconfigured != "" {
w.fail("I8", "an execution of %s was run on a revision refused for %s", r.Class, r.Misconfigured)
}
+ if row, ok := byExec[r.Execution]; ok && !r.Rejected {
+ w.checkPayload(row)
+ }
if row, ok := byExec[r.Execution]; ok && r.At.Sub(time.UnixMilli(row.DispatchedAt)) > media.GrantMintSlack {
w.fail("I1", "row %s's execution was run %s after its dispatch, past the %s the pass's bounds allow", shortID(row.JobID), r.At.Sub(time.UnixMilli(row.DispatchedAt)), media.GrantMintSlack)
}
@@ -710,3 +724,47 @@ func (w *world) checkPrune(prune func() error) error {
}
return nil
}
+
+// checkGrants is I8 (grant) over the rows: each dispatched row's grant and
+// deadline within its class's figures, and a done row's source no longer
+// than its grant.
+func checkGrants(w *world, rows []row) {
+ for _, r := range rows {
+ if r.Execution == "" {
+ continue
+ }
+ k := media.ClassKey{Preset: r.Preset, Class: r.Class}
+ spec, ok := media.Class(k)
+ if !ok {
+ w.fail("I8", "row %s was dispatched in class %s, which has no row", shortID(r.JobID), k)
+ continue
+ }
+ if most := w.limits.Granted(k).Milliseconds(); r.GrantedS*1000 > most {
+ w.fail("I8", "row %s %s was granted %d s, over its class's %d ms", shortID(r.JobID), k, r.GrantedS, most)
+ }
+ if most := min(spec.Deadline, media.MaxDeadline).Milliseconds(); r.DeadlineS*1000 > most {
+ w.fail("I8", "row %s %s has a deadline of %d s, over its class's %d ms", shortID(r.JobID), k, r.DeadlineS, most)
+ }
+ if r.State == "done" && r.SourceMS > r.GrantedS*1000 {
+ w.fail("I8", "row %s is done with a %d ms source, longer than its %d s grant", shortID(r.JobID), r.SourceMS, r.GrantedS)
+ }
+ }
+}
+
+// checkPayload is I8 (grant) for one Run: the payload's limits are the
+// row's grant and the deployment's duration maximums for its preset.
+func (w *world) checkPayload(r row) {
+ _, p, ok := w.lastRequest(r.Execution)
+ if !ok {
+ return // lastRequest reported a payload that does not decode
+ }
+ maxMS, hdrMS, hiMS := w.limits.AudioMax.Milliseconds(), int64(0), int64(0)
+ if r.Preset == media.PresetVideo720p {
+ maxMS, hdrMS, hiMS = w.limits.VideoMax.Milliseconds(), w.limits.MaxHDR().Milliseconds(), w.limits.VideoMaxHi.Milliseconds()
+ }
+ l := p.Limits
+ if l.GrantedMS != r.GrantedS*1000 || l.MaxMS != maxMS || l.MaxHDRMS != hdrMS || l.MaxHiMS != hiMS {
+ w.fail("I8", "execution %s's payload grants %d ms with maximums %d, %d and %d ms; its row was granted %d s, and the deployment's maximums are %d, %d and %d ms",
+ shortID(r.Execution), l.GrantedMS, l.MaxMS, l.MaxHDRMS, l.MaxHiMS, r.GrantedS, maxMS, hdrMS, hiMS)
+ }
+}
diff --git a/internal/sim/mediajobs/witness_test.go b/internal/sim/mediajobs/witness_test.go
index 142d0279b..769c4998c 100644
--- a/internal/sim/mediajobs/witness_test.go
+++ b/internal/sim/mediajobs/witness_test.go
@@ -610,6 +610,50 @@ func TestWitnessAbove1080pWeighsTwice(t *testing.T) {
}
}
+// TestWitnessThreeHourSDR (spec §11 A9): with the default limits, an
+// account with a limit of 180 (R = 360 minutes) runs a long video, which
+// reserves at weight 2 and so is granted the full 3 hours, exactly twice
+// the limit; its codec reports 3 hours of 1080p SDR, charged 180 at
+// weight 1. A codec reporting 1 ms over its 3-hour grant fails the job,
+// and the charge stays inside the reservation. Every step is checked
+// against I1 to I9, the payload's grant and maximums among them.
+func TestWitnessThreeHourSDR(t *testing.T) {
+ w := newWitness(t, "", map[string]int64{"acct1": 180})
+ w.object(shop, "uploads/stream-1.mp4", 3<<30)
+ job, task := w.runJob(t, shop, "uploads/stream-1.mp4", video, media.ClassLong)
+ r := w.rowOf(t, shop, job.ID)
+ if r.GrantedS != 10800 || r.DeadlineS != 3000 || reservation(r) != 2*180*600000 {
+ t.Fatalf("long video: granted %d s, deadline %d s, reserved %d", r.GrantedS, r.DeadlineS, reservation(r))
+ }
+ if _, p, _ := w.lastRequest(r.Execution); p.Limits.GrantedMS != 10_800_000 || p.Limits.MaxMS != 10_800_000 ||
+ p.Limits.MaxHDRMS != 4_500_000 || p.Limits.MaxHiMS != 1_800_000 {
+ t.Fatalf("payload limits %+v", p.Limits)
+ }
+ w.now = w.now.Add(32 * time.Minute)
+ w.codecSucceedsAs(r.Execution, (3 * time.Hour).Milliseconds(), 0, sourcePicture{1920, 1080, false})
+ w.finish(t, task, media.ExitDone)
+ w.track(t)
+ r = w.rowOf(t, shop, job.ID)
+ if r.State != "done" || r.SourceMS != 10_800_000 || r.WeightTenths != 10 || charge(r) != 180*600000 {
+ t.Fatalf("3 h done: %s source %d weight %d charge %d", r.State, r.SourceMS, r.WeightTenths, charge(r))
+ }
+ if m, err := w.jobs.ChargedMinutes(ctx, "acct1", w.now); err != nil || m != 180 {
+ t.Fatalf("charged %d minutes, want 180 (%v)", m, err)
+ }
+
+ other := appRef{"acct2", "shop"}
+ w.object(other, "uploads/stream-2.mp4", 3<<30)
+ oj, ot := w.runJob(t, other, "uploads/stream-2.mp4", video, media.ClassLong)
+ or := w.rowOf(t, other, oj.ID)
+ w.now = w.now.Add(32 * time.Minute)
+ w.codecSucceedsAs(or.Execution, (3*time.Hour).Milliseconds()+1, 0, sourcePicture{1920, 1080, false})
+ w.finish(t, ot, media.ExitDone)
+ w.track(t)
+ if or = w.rowOf(t, other, oj.ID); or.State != "failed" || or.SourceMS != 0 || charge(or) > reservation(or) {
+ t.Fatalf("1 ms over the grant: %s %q source %d charge %d reservation %d", or.State, or.Error, or.SourceMS, charge(or), reservation(or))
+ }
+}
+
// TestWitnessRetiredBeforeAndAfterTheRead (spec §11 A7; Astra round 1,
// P2-1): a long 4K video whose app is retired after the job table read its
// result settles failed retired at weight 2, the weight of the facts it
@@ -870,7 +914,7 @@ func TestCheckerCatchesEachInvariant(t *testing.T) {
f.w.insertRow(x)
f.w.engine.SetLag(mediatest.Lag{Create: 5 * time.Minute})
f.w.engine.Script(mediatest.RunAmbiguousCreatedLate)
- if _, err := f.w.rec.Run(ctx, media.RunRequest{Execution: x.Execution, Class: media.ClassKey{Preset: video, Class: media.ClassShort}}); err == nil {
+ if _, err := f.w.rec.Run(ctx, media.RunRequest{Execution: x.Execution, Class: media.ClassKey{Preset: video, Class: media.ClassShort}, Payload: f.w.payloadFor(t, x, nil)}); err == nil {
t.Fatal("the scripted ambiguous answer did not happen")
}
check(f.w)
@@ -915,6 +959,37 @@ func TestCheckerCatchesEachInvariant(t *testing.T) {
x.Execution, x.GrantedS, x.DeadlineS = strings.Repeat("8", 32), 7200, 3000
f.w.insertRow(x)
}},
+ {"I8", "a long video granted past the video maximum", func(t *testing.T, f fixture) {
+ x := f.r
+ x.Class, x.TaskARN, x.Key = media.ClassLong, "", "uploads/clip-6.mov"
+ x.JobID = media.JobID(x.Key, x.ETag, video, media.ClassLong)
+ x.Execution, x.GrantedS, x.DeadlineS = strings.Repeat("9", 32), int64(f.w.limits.VideoMax/time.Second)+1, 3000
+ f.w.insertRow(x)
+ }},
+ {"I8", "a long video with a deadline past its class's", func(t *testing.T, f fixture) {
+ x := f.r
+ x.Class, x.TaskARN, x.Key = media.ClassLong, "", "uploads/clip-6.mov"
+ x.JobID = media.JobID(x.Key, x.ETag, video, media.ClassLong)
+ x.Execution, x.GrantedS, x.DeadlineS = strings.Repeat("9", 32), 600, 3001
+ f.w.insertRow(x)
+ }},
+ {"I8", "a done row with a source longer than its grant", func(t *testing.T, f fixture) {
+ f.w.exec(t, `UPDATE media_jobs SET granted_s = ? WHERE job_id = ?`, f.d.SourceMS/1000-1, f.d.JobID)
+ }},
+ {"I8", "a Run whose payload grants more than its row", func(t *testing.T, f fixture) {
+ b := f.w.payloadFor(t, f.r, func(l *media.JobLimits) { l.GrantedMS++ })
+ f.w.engine.Script(mediatest.RunAmbiguousNotCreated)
+ if _, err := f.w.rec.Run(ctx, media.RunRequest{Execution: f.r.Execution, Class: media.ClassKey{Preset: video, Class: media.ClassShort}, Payload: b}); err == nil {
+ t.Fatal("the scripted transport error did not happen")
+ }
+ }},
+ {"I8", "a Run whose payload names a shorter video maximum", func(t *testing.T, f fixture) {
+ b := f.w.payloadFor(t, f.r, func(l *media.JobLimits) { l.MaxMS -= 60000 })
+ f.w.engine.Script(mediatest.RunAmbiguousNotCreated)
+ if _, err := f.w.rec.Run(ctx, media.RunRequest{Execution: f.r.Execution, Class: media.ClassKey{Preset: video, Class: media.ClassShort}, Payload: b}); err == nil {
+ t.Fatal("the scripted transport error did not happen")
+ }
+ }},
{"I1", "an execution Run more than GrantMintSlack after its dispatch", func(t *testing.T, f fixture) {
f.w.now = f.w.now.Add(media.GrantMintSlack + time.Second)
f.w.engine.Script(mediatest.RunRejectedFinal) // no task, so only the late Run is wrong
@@ -973,6 +1048,25 @@ func TestCheckerCatchesEachInvariant(t *testing.T) {
}
}
+// payloadFor is a Run payload for row r's execution as the job table
+// writes its limits (I8, grant): r's grant and the deployment's
+// maximums, edited by mutate when it is not nil.
+func (w *world) payloadFor(t *testing.T, r row, mutate func(*media.JobLimits)) []byte {
+ t.Helper()
+ l := media.JobLimits{GrantedMS: r.GrantedS * 1000, MaxMS: w.limits.AudioMax.Milliseconds()}
+ if r.Preset == video {
+ l.MaxMS, l.MaxHDRMS, l.MaxHiMS = w.limits.VideoMax.Milliseconds(), w.limits.MaxHDR().Milliseconds(), w.limits.VideoMaxHi.Milliseconds()
+ }
+ if mutate != nil {
+ mutate(&l)
+ }
+ b, err := json.Marshal(media.Payload{V: media.PayloadVersion, Execution: r.Execution, Preset: r.Preset, Limits: l})
+ if err != nil {
+ t.Fatal(err)
+ }
+ return b
+}
+
// settledFailed is a video row of class that failed engine_failed and
// settled at weight, charged 1 s, with no task ever observed (so I3's
// charge checks pass and only the weight is in question).
diff --git a/ship_rootfs_test.go b/ship_rootfs_test.go
index 1d1458d04..822ebc5bd 100644
--- a/ship_rootfs_test.go
+++ b/ship_rootfs_test.go
@@ -256,11 +256,15 @@ func TestShipRootfsDirectFromADirectory(t *testing.T) {
}
want := append([]string{"rails/bin/rails", "rails/config/application.rb", "usr/bin/ruby"}, rootfsimage.MountPoints...)
want = append(want, rootfsimage.MountFiles...)
+ want = append(want, "etc/hosts")
for _, p := range want {
if _, err := fs.Stat(sb, p); err != nil {
t.Errorf("image lacks %s: %v", p, err)
}
}
+ if hosts, err := fs.ReadFile(sb, "etc/hosts"); err != nil || string(hosts) != rootfsimage.DefaultHosts {
+ t.Errorf("etc/hosts in the image: %v, %q", err, hosts)
+ }
body, err := fs.ReadFile(sb, "rails/bin/rails")
if err != nil || !bytes.Equal(body, rootfsTestELF(elf.EM_AARCH64)) {
t.Errorf("rails/bin/rails in the image: %v, %q", err, body)