Repository navigation
Conversation
#4535 made sideload load the package with deserialize_local, which reads the supplemental-signature trailer at the end of the file. On an upload that blocks until the last byte arrives, and services.install only inserts the Installing entry after the loader returns, so the package never appeared (nor showed upload progress) until the upload finished. Sideload now loads only the header via load_deferring_signers, which returns the trailer read and signer-policy check as a deferred future. install() runs it inside the reload guard before unpacking, so a rejected signer still fails the install with the usual notification and rollback. load_with_signers keeps its full read for every other caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
Two changes needed in shared-libs/crates/start-core/src/service/service_map.rs:
- P1 — Declare the loader result type parameter.
installusesLinFuture<Output = Result<L, Error>>andL: LoadedS9pk<S>, but its generic parameter list still declares onlyF,Fut, andS. This prevents start-core from compiling. The proposal addsLto the declaration. - P1 — Start progress syncing before awaiting signer verification. With a signer policy,
check.awaitreads the footer and therefore waits for the upload to finish. Thesync_to_dbtask is spawned only after that await, leaving the newly inserted Installed services entry frozen at its initial upload snapshot for the rest of the upload. The proposal starts the existing guarded sync task first, retaining signer verification before any unpacking. Its localNonDetachingJoinHandlestill cleans up on rejection or cancellation. Please extend regression coverage to assert that package-data progress advances while the trailer remains gated; the added loader test cannot catch this ordering bug.
Proposed changes: f8a19ec...proposal/4592
Reviewed the diff, loader callers, trailer reading, upload source, and install rollback/cancellation paths. The reviewed head merges cleanly into fix/pcp-v6-link-local-gateway. Only the successful Conflict Markers check is reported; no compile/test evidence is present. No builds or tests run during review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Closing at @dr-bonez's request. A separate counter-PR will send supplemental signature candidates in the sideload request and verify them against the uploaded archive's commitment, rather than defer a backend trailer read. |
|
Replacement counter-PR: #4594. It sends signature candidates up front from the browser and CLI and leaves the install/progress lifecycle unchanged. |
Stacked on #4589, which carries the 0.4.1.3 bump. Retarget to
masteronce that merges.Problem
Since #4535, clicking Install on the sideload page navigates to Installed services, but the package doesn't appear (and shows no upload progress) until the whole upload has finished.
#4535 switched
load_with_signersfromS9pk::deserializetoS9pk::deserialize_local, which also reads the supplemental-signature trailer that sits after the archive. During a sideload the source is the upload stream, so that read blocks until the last byte arrives.ServiceMap::installinserts theInstallingentry only after its loader returns, so the entry is written at upload end. Reproduced on a dev box: the firstpackageDatapatch for the package arrived withUploadingalready at 100% andValidating Headerscomplete.Change
s9pk::load_deferring_signersreads only the header. When a signer policy applies, it returns the trailer read plus policy check as a deferredSignerCheckfuture.load_with_signerskeeps its full read and immediate check for every other caller (CLI, tests).S9pk::read_trailersplits the trailer read out ofdeserialize_local.ServiceMap::installaccepts a loader that returns either anS9pkor an(S9pk, Option<SignerCheck>)(theLoadedS9pktrait), so the other install callers don't change. It runs the check inside the reload guard before unpacking, so a rejected signer still fails the install with the usual "Installing failed" notification and rollback.One behaviour change: an untrusted sideload now appears as installing for the length of its upload before failing, instead of failing before it appears.
Verification
s9pk_trailer_deferred_signer_check_waits_for_the_trailer_but_the_header_does_not: a source that blocks every read past the archive. The header load must return, and the check must stay pending until the gate opens, then accept a pinned endorser and reject an unpinned one.make start-core-format-checkpasses. start-core was not compiled locally; compile and tests run in CI.🤖 Generated with Claude Code