Run builds that read a Sealed value on a Server Builder (SL9) #3302
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3302"
general
weight: 0.35
nick-potts
SL9 of Sealed variables level A.
Summary
A build that reads a Sealed value now runs on a Server Builder, and only that Machine opens the value. GitHub Actions never receives one. The CLI's silent drop of Sealed build values (ruling 31) is gone: a Sealed value is either carried to the Server Builder or refused by name.
Who notices. Nobody, until an Organization turns on sealed variables. After that, a Service whose build reads a Sealed value builds on a Server even when its Preferred Builder is GitHub Actions, and the dashboard shows GitHub Actions disabled with "Uses sealed NPM_TOKEN". A Dockerfile reads the value with
ARG NPM_TOKEN, like any variable, or withRUN --mount=type=secret,id=NPM_TOKEN,env=NPM_TOKENto keep it out of the image's history. Railpack builds need no change.What ships.
GitSource.sealed, the sealed walk, thegithub_inputrefusal and strip,EnvironmentView.sealed(row IDs of browser-sealed variables).private/sealed.json, composebuild.secrets, Railpack mounts, and the names of Sealed values a Dockerfile declares asARG(private/sealed-args.json, names only). The local refusal.docs/user/builds/where-builds-run.md, and "Read a sealed value" indocs/user/builds/railpack-and-dockerfiles.md:ARGfirst, then the secret mount andPLOYZ_SEALED_HASH.Bets
GitSource.sealedand never sees the value.github_inputcarries Text only.Build RPC scope
Stays Operator. Cloud drives builds as Operator. The opened value never returns over the RPC. It lives in 0600 files inside the upload root, and output is scrubbed. A Cloud that crafts a recipe to print or exfiltrate a value is the active-Cloud gap level A accepts (Appendix C). Dropping to a narrower scope buys nothing while the recipe stays caller-authored.
Compat
One deletable place:
crates/ployz/src/sealed_compat.rsgains theployz.build.sealed.v1check, called once fromprepare.rs, so the Builder pick skips a Machine that can't open build values. It joins SL10's deletion list. Without it an old daemon still fails closed (Railpack rejects the unknown field, and a Dockerfile recipe points at a secret file the old daemon never writes).EnvironmentView.sealedis a new fact the Store gives the dashboard: the row IDs of variables the browser sealed. It is omitted when empty, so a read with no such variable serializes as on trunk. An old Store never sends it, and the dashboard reads a missing list as empty: no row is sealed and GitHub Actions stays enabled, exactly as on trunk. The Store reaches Cloud through the in-process@ployz/sdkaddon, so the two ship in one build and the old-Store case only arises across a rollback. It is the permanent fact the Preferred Builder line reads, not a mixed-version shim, so it stays off SL10's deletion list.A CLI from before SL9 that builds from a Store-resolved env still drops Sealed build values without a word, as ruling 31 described. Nothing on the Store or daemon refuses it: an old CLI ignores
GitSource.sealed. It stays closed whilesealedVariablesis off, and SL10 must keep it closed before the flag turns on.Known gaps
ARG PLOYZ_SEALED_HASHabove it. This matches Docker's own secret mounts. AnARGstep and Railpack builds rerun.ARGis in the image's history, as Docker records every build arg a step uses. The image stays on the user's Servers. The docs point to the secret mount for a value that must stay out of history.ARG, because buildx records build arg values in it. Other Builds keep it.ARGalso stays, on the Server, in BuildKit's build history until its GC (48 hours and outside the newest 50 records), in the image inspect output the Builder reads back, and in a multi-platform Build's per-platform archive. Each is a copy of what the image already holds, readable only with the Docker socket. The secret mount leaves none of them.ARGit also shows in the RUN step's name, since BuildKit expands args there. The scrub matches a value that short only asNAME=value, as it does in runtime logs.Sealed values as Dockerfile ARGs (ruling 40)
Ruling 40 replaces ruling 38, which refused
ARG <sealed name>. The operator asked for what Railway does. Railway passes a sealed variable to a Dockerfile build like any other variable, and the Dockerfile opts in withARG NAME. Sealing changes who can see a value, not whether a build can read it.ARGand writes only those names toprivate/sealed-args.json. With no Sealed value it reads and writes nothing new.private/sealed/, with$escaped as for captured args. Bake reads it through--file. No value reaches the upload, the captured recipe,bake --print, or a command line. The override is created and removed with the secret files.BUILDX_METADATA_PROVENANCE=disabled. A Build without one runs with trunk's environment and bake arguments.The secret mount stays, unchanged. The Docker receipt below shows why. A value read with
ARGlands indocker history, and a mounted value doesn't.Dockerfile cache (ruling 39, mount only)
A changed
ARGvalue already misses the cache, so ruling 39 now covers only the secret mount. A mount step stays cached when its value changes. For every Dockerfile target that reads a Sealed value, Ployz passesPLOYZ_SEALED_HASH, a hash of the ciphertext fingerprints, as a build arg. BuildKit ignores an undeclared arg, so the default is a cache hit. A Dockerfile opts into a rerun by addingARG PLOYZ_SEALED_HASHabove the mounting RUN. History then shows the hash and never the value.My call under ruling 40 is to keep
PLOYZ_SEALED_HASHunchanged. It was already wired in, it is opt-in, and it costs nothing. Removing it would leave the mount path with no way to rerun.Two alternatives were rejected. Rewriting the uploaded Dockerfile would add parser-directive, continuation and heredoc surface just for a cache nicety.
--no-cachewould lose the cache on every build, which is worse than trunk.Legacy output changes
Two changes reach a Build with no Sealed value, both in
ployz-build/src/solve.rs:namenow parses instead of being dropped.incomplete_tailalso holds back a trailing byte run that is invalid but looks incomplete. The joined text is the same. Only the point where one output event ends and the next begins moves.Evidence
Focused checks at the head, run by each round's delegate and rerun after its changes.
| Check | Result |
|---|---|
|
cargo fmt --check| ok || clippy
-p ployz-build -p ployz -p ployz-core -p ployz-store --all-targets -D warnings(macOS; ployzd is Linux-only, CI covers it) | ok || nextest
-p ployz-store(build, git, sealed, deployment) | 186 passed (fix round 1) || nextest
-p ployz(build, store_runner, sealed, prepare, preparation) | all pass but two macOS-only failures that also fail at base:reserved_characters_are_refused,ignored_special_files_do_not_enter_capture||
-p ployz-buildon Linux (cargo test) | 68 passed, plus host_policy 11 || ployzd on Linux (
--lib build::,sealed_env) | 39 and 16 passed || real-wait lint | exit 0 |
| dashboard vitest
store-variables, typecheck, oxlint on changed files | ok |Docker receipts (
#[ignore]tests inployz-build/src/tests.rs, run on Linux with dummy values):ARGline, a changed value is a cache hit. WithARG PLOYZ_SEALED_HASH, a changed value reruns the mounting RUN, and an unchanged value is a hit. No unconsumed build-arg warning. Neitherdocker historynorbake --printcontains plaintext./token.shamatches. A changed value reruns the step. The upload root is gone after the build, and nothing under the capture holds plaintext.docker historyholds the value, which is why the docs still offer the mount.On trunk, a legacy
ARG NPM_TOKENlands in history twice.Live lanes ran on one Boat Machine against a throwaway verify-dashboard Store, with
sealedVariablesset only on that Store's test Orgada. Values were sealed with the SL6 sealer to the Cluster public key and written throughPOST /api/config/write, because browser sealing (#3304) isn't on this branch. Every "0 matches" coversployz upoutput,ployz logs --buildand the dashboard Build panel. Evidence is in/tmp/swarm-3302/verify-r{1,2,3}/.| Lane | Last run | Result |
|---|---|---|
| routes-to-server | r2 (a7f6e2948) | Preferred Builder GitHub. Unsealed skips GitHub. Sealed builds on machine-1 with no workflow lookup. A second Service with no sealed value of its own routes as before. The dashboard shows "GitHub Actions · Uses sealed NPM_TOKEN", disabled. r3 couldn't run it (Store booted without
FAKE_GITHUB); nothing on its path changed since r2 || github-only | r2 | "app: Builds that read a sealed value run on your server. No other Builder in your Build Order can take it." Nothing builds, and GitHub gets no dispatch |
| railpack-setting-refused | r1 (e0158bcda) | "RAILPACK_BUILD_CMD is sealed. Railpack settings can't be sealed." 0 matches |
| dockerfile-arg | r3 (89cd41d23) |
/token.shamatches. 0 matches in output, a full Storepg_dump, and 14ps -eo argssamples taken during the build. Bake readsprivate/sealed/args.compose.yaml(0600) by path. The RUN step name shows[secret NPM_TOKEN]. History holds the value, as expected || arg-and-mount | r3 | Both hashes match. The mount value matches 0 times in history and inspect |
| arg-value-changes | r3 | A new value reruns the ARG step, and the new hash matches |
| dockerfile-secret | r3 |
/token.shamatches. 0 matches, includingdocker history --no-truncanddocker image inspect|| split-output, split-output-prefix | r3 | A value split at the 64 KiB cut, and a 7-byte prefix held across a 3s pause, match 0 times. Non-secret bytes arrive intact |
| late-output | r3 | The held
NPM_TOKEN=[secret NPM_TOKEN]line arrives after its step ends. BuildKit kills a step's backgrounded writer, so output after completion is proved by unit tests only || multibyte | r3 | Valid UTF-8, 0 replacement characters, 0 matches. The invalid-byte case is unit-proved only |
| plain output intact | r3 |
Donearrives whole, with no marker || railpack-reads-value | r3 | The hash matches. 0 matches in history, inspect and the build log |
| no-secret-files | r3 | No
private/sealed/*orargs.compose.yamlremains after success, a failed mount build, or a failed ARG build |Provenance is off only for ARG builds: the "resolving provenance" step appears in mount-only builds and not in ARG builds.
core/crates/ployz-sdk/tests/node_connect.jsfails on macOS at c914040b8 too (ERR_DLOPEN_FAILED)./varis a symlink to/private/var, so itsrequire.cachekey misses the resolved addon path. WithTMPDIR=$(realpath "$TMPDIR")it passes 7/7 at both base and head. This PR doesn't touchployz-sdk.Rebase. Rebased onto c3277a38d, after SL5 #3098, SL7 #3304 and SL5b #3335. Four conflicts, all two additions side by side:
rpc_catalog.rsandtests/capabilities.rskeepBRIDGE_IPV6_CAPABILITYandBUILD_SEALED_CAPABILITY;store-variables.tsand its test keep SL7's sealing writer andfirstBrowserSealed. At 2a1471319: fmt, the real-wait lint,ployz-core --test capabilities4/4,scrub13/13, clippy-D warningson ployz-build, ployz, ployz-store and ployz-core lib, dashboard typecheck, oxlint andstore-variables14/14, nextest ployz-store 75/75 and ployz 131/131 on macOS, and on Linux ployz-buildsealed12+1, ployzdbuild::39/39 andsealed_env16/16, plus the two ployz tests that fail on macOS only. ployz-core's lib-test clippy fails on macOS on trunk too (release_mirror.rshelpers used only on Linux).Review
Merge Danger
Door: two-way
Everything is behind
sealedVariables, which stays off. A Service with no Sealed value builds, routes and uploads as on trunk.Blast Radius: builds
A routing or capture regression would hit every Git build, so the legacy byte-for-byte checks are the ones to watch.