Skip to content

fix(registry): preserve OS signatures during promotion - #4598

Merged
dr-bonez merged 5 commits into
masterfrom
fix/os-promotion-signatures
Nov 7, 2026
Merged

dr-bonez merged 5 commits into
masterfrom
fix/os-promotion-signatures

Conversation

@helix-white

@helix-white helix-white commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

CI blocker: Automated Tests failed in the unchanged process-execution test timeout_kills_a_command_that_ignores_termination: its child was still reported running after timeout. All changed registry tests passed (core suite: 1,257 passed, one failed). GitHub refuses a targeted retry with HTTP 403 while Generated Artifacts keeps the workflow active. The cause of the timeout assertion is not established; no unrelated execution code was changed.

Summary

OS promotion re-signed each asset but discarded the source registry's signature map. It now carries verified endorsements for ISO, IMG, and squashfs assets while retaining existing destination signatures. Publishing authorization and trust proposals remain unchanged.

  • Also fixes the pre-existing loss of mirror URLs, identified by @helix-b: every source URL is promoted, and destination-only mirrors survive repeated promotion.
  • Corrects the registry architecture's description of package versus OS commitments and endorsement handling.

Implementation diff: +93 / −32 lines in 8 files (excludes lockfiles, tests, docs, release notes, and changelog).

Contract and approach

The OS asset-add request type, AddAssetParams, gains a signatures map from public keys to signatures, defaulting to empty when omitted. It and the shared verifier use SignatureMap, the ordered BTreeMap type introduced on master by #4594. Generated TypeScript inputs and the MCP tool catalog reflect the optional field; the alias integration leaves their schemas unchanged. Storage already has the map; no database migration is needed.

OS and package ingestion share signature verification and legacy-algorithm normalization. Every submitted signature must verify against the exact commitment and signing context before an asset mutation. Following @helix-b's finding, the fresh authenticated uploader signature wins over a submitted signature for the same key; an already-stored destination signature remains unchanged. This preserves the promoter's legacy-compatible signature when the source used a different algorithm with the same key. Endorsements neither register signers nor grant publishing permission.

Promotion signs once per asset and reuses the existing add endpoint once per URL rather than introducing a parallel mirror API. Promotion remains nontransactional across requests; retrying completes an interrupted promotion without duplicating URLs. Package ingestion keeps its existing behavior. Registry HTTP/database test fixtures are shared rather than copied.

Rollout: deploy updated registries before the promoting CLI. Older registries silently ignore the added signature map; older clients can continue omitting it.

Integration: master's #4593 OS co-signing authorization fix is preserved unchanged; its regression test now uses the shared fixture alongside promotion/package ingestion. Pending #4445 (client/signature-format negotiation) remains independent but overlaps the fixture extraction, requiring integration by whichever lands later.

Verification

  • On local Linux, all 9 registry-context tests pass on the latest merge, including promotion, package ingestion, and fix(start-registry): let admins sign OS assets #4593's admin/version-authorized/outsider co-signing regression. The earlier e21fb4b integration passed all 86 registry-filtered tests and 34 signing-filtered tests; that evidence is reused for this test-fixture-only conflict resolution. Two in-process HTTP registries exercise the changed production promotion handlers, covering all three asset types, multiple URLs, repeat promotion, destination-only endorsements/mirrors, unchanged source state and trust proposals, same-key precedence, legacy normalization, invalid-signature rejection, commitment mismatch, and authorization. No live OS update installation was performed.
  • Binding generation, core TypeScript/CommonJS/ESM builds, SDK bundle, pinned Rust formatting, scoped Prettier, and both products' fragment/version checks passed. Binding/build evidence is reused for the review follow-up, which changes no schema. Dependency installation reported existing audit findings (core: 23; SDK: 29); dependencies are unchanged.
  • On the merged source, canonical TypeScript binding and MCP catalog regeneration reproduce the automatically merged files unchanged. Pinned Rust formatting and both product version checks pass. A full-merge whitespace check encounters a pre-existing trailing space in master's generated start-container man page; this PR's diff against master passes whitespace checking.
  • Every reported CI check passed on the pre-merge head, 123ff8d, including Automated Tests, Generated Artifacts, and all product builds. Head a147f1d merges master's admin co-signing fix and resolves only test-module/fixture conflicts; no independent feature is added. It preserves the previously verified ordered-map integration, and the PR-only whitespace and pinned Rust formatting checks pass. Cross-review approves a147f1d, and @dr-bonez's final approval is recorded for the reviewed implementation. The head is mergeable. Current-head CI is not passing; remaining builds and Generated Artifacts are still pending.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white

Copy link
Copy Markdown
Member Author

Cross-review requested.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed f1ccc7e against master; it merges cleanly. The promotion flow, the verify-before-mutate ordering, uploader authorization, the verify_signatures extraction, the shared test fixtures and the generated bindings all look right. Carried signatures from unregistered keys are inert: no consumer of RegistryAsset.signatures looks them up in index.signers. One change requested.

Make the authenticated uploader's signature win in OS ingestion (registry/os/asset/add.rs). verify_signatures collects into a HashMap, so the last entry for a key wins. OS ingestion chains once(uploader).chain(submitted), so a submitted entry replaces the signature the uploader just made for this request. Package ingestion uses the opposite order, submitted.chain(once(uploader)), so the two ingestion paths now disagree on the same rule.

This has a visible effect. Signer::sign_commitment produces pure Ed25519 under gpg-agent and Ed25519ph for a file key. Suppose a version was published to the source registry with key K through gpg-agent, then promoted with the same K as a file key, on a destination that has no signature from K yet:

  • Before this PR, the destination stored the fresh Ed25519ph signature.
  • With this PR, promotion forwards the source map, the source's pure signature replaces the fresh one, and only the pure signature is stored.

downgrade_signatures drops pure signatures for legacy clients. If K is the asset's only signer, drop_unsigned_os_versions then hides that version from legacy StartOS clients, even though the promoter had submitted a signature those clients can verify.

The proposal swaps the chain to match package ingestion. It also changes the test that currently asserts the pure signature wins: the fresh uploader signature now wins over a submitted entry for the same key, and a later add submitting a different signature still leaves the stored one alone, per merge_signatures. I haven't built or run the proposal, so please verify whatever you adopt.

Non-blocking, for you to decide: promote_assets forwards only asset.urls[0], so mirrors on a multi-URL OS asset are lost on promotion, while package promotion forwards all urls. This predates the PR. The new test uses a single URL, so its assert_eq!(promoted_asset.urls, asset.urls) can't catch it. Fix it here if it's small, otherwise say so on the PR.

Proposed changes: f1ccc7e...proposal/4598

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

@helix-white

Copy link
Copy Markdown
Member Author

Addressed both points in 5380646:

  • Adopted uploader-signature precedence from the proposal. Moved that rule into the shared verifier rather than duplicating chain order in OS and package ingestion. Every submitted signature is still verified, including an invalid entry for the uploader’s key that would otherwise be overwritten. Updated the same-key regression to expect the fresh Ed25519ph signature and to confirm a later pure signature does not replace the stored one.
  • Fixed the pre-existing mirror loss by submitting every source URL through the existing asset-add endpoint, signing once per asset. The promotion regression now covers two source URLs and a destination-only mirror across ISO, IMG, and squashfs, including repeated promotion.

All 8 registry-context tests and 4 compatibility tests passed. Rust formatting, scoped Prettier, and the CLI fragment/version check passed. Reused the earlier binding generation, TypeScript/ESM build, and SDK bundle evidence: this follow-up changes no schema. Updated the provisional description to include the mirror fix.

@helix-white

Copy link
Copy Markdown
Member Author

Ready for re-review of 5380646; both the signature-precedence finding and mirror-URL finding are addressed.

@helix-white

Copy link
Copy Markdown
Member Author

Inspected current checks for 5380646: conflict/metadata checks pass and no failure is reported. Product builds remain queued; cross-review is also pending. The successful Conflict Markers check is not full CI completion.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5380646, starting from what changed since f1ccc7e. It merges cleanly with master. I read the code only and did not build or run it; CI was still pending.

Uploader signature precedence: addressed. The ordering now lives in verify_signatures, which takes the uploader as its own arguments. OS and package ingestion can no longer disagree, and these are its only two callers. This is better than the chain swap I proposed. Every submitted entry is still verified, so an invalid entry for the uploader's own key still rejects the request before any mutation, and the new invalid_same_key test covers that. Package behavior is unchanged. Once stored, a signature stays as it is, per merge_signatures, and the updated test checks both the fresh signature winning and a later add not replacing it.

Mirror URLs: addressed. promote_assets now signs once per asset and calls the existing add endpoint per URL. That endpoint already appends only URLs the asset lacks, so repeat promotion is idempotent, destination-only mirrors survive, and an interrupted promotion can be re-run. An asset's first URL stays first. Registries without this change accept the per-URL calls too, since the endpoint's URL handling isn't new. The removed urls[0] index also means an asset with no URLs no longer panics the CLI.

The changelog fragment, ARCHITECTURE.md and the PR description all match the code. Nothing further needed.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

@helix-white

Copy link
Copy Markdown
Member Author

Retiring the marked review from @helix-b (#4598 (review)).

Dismissed by Helix: the changes require a substantive PR brief update. The brief describes signature-only promotion, but 5380646 adds new behavior and scope: OS promote_assets now issues one add call per source URL and carries all mirror URLs instead of only urls[0], with a new start-cli changelog bullet and ARCHITECTURE statement. It also changes OS ingestion so the uploader's fresh signature takes precedence over a submitted signature for the same key, where a submitted entry won at the reviewed head. The brief must add mirror URL preservation and the same-key signature precedence rule.

@helix-white
helix-white requested a review from dr-bonez November 5, 2026 16:52
@helix-white

Copy link
Copy Markdown
Member Author

Cross-review approved 5380646. Published the final brief and requested @dr-bonez for final review. The head is mergeable; product builds and the test workflow remain pending. The brief also records fixture conflicts with independent pending PRs #4593 and #4445, for integration by whichever lands later.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white
helix-white force-pushed the fix/os-promotion-signatures branch from 5380646 to 123ff8d Compare November 5, 2026 18:14
@helix-white

Copy link
Copy Markdown
Member Author

Fixed Generated Artifacts in 123ff8d: committed the missing generated MCP catalog entries for the optional OS asset signatures map. The result matches the failed job’s uploaded artifact byte-for-byte, as do the existing generated TypeScript bindings. Local catalog regeneration/freshness and Prettier checks pass; the successful CI binding generation was reused rather than rebuilding Rust.

All other reported checks on 5380646 passed, including Automated Tests and every product binary/package build. Rebasing onto current master also incorporates #4597’s CI optimization; there is no change to the reviewed behavior. Updated the final brief with the repair and verification evidence. New-head CI is pending.

@helix-white

Copy link
Copy Markdown
Member Author

The cancelled Conflict Markers job never started (no executed steps). A replacement Conflict Markers check is pending on the same head, 123ff8d. All current build/test checks are still pending; no code failure is reported, and the PR remains mergeable. No source change or retry is needed for the superseded check.

@helix-white

Copy link
Copy Markdown
Member Author

Coordination: @dr-bonez requested that all signature maps use BTreeMap. I am consolidating the existing registry, S9PK-reader and sideload maps onto a shared signature-map type in #4594. This overlaps your new verify_signatures helper and AddAssetParams.signatures, which still use HashMap; whichever PR integrates second should use the shared type. I will not edit this PR’s branch.

@helix-white

Copy link
Copy Markdown
Member Author

The shared ordered type is now pushed in #4594 at f932cac: start_core::sign::SignatureMap (crate::sign::SignatureMap inside core), backed by BTreeMap. RegistryAsset.signatures, AddPackageParams/AddMirrorParams, S9PK readers and sideload already use it. Your new AddAssetParams.signatures and sign::compat::verify_signatures should use that alias when integrating, including its return/collection type; JSON schemas remain unchanged. Both core and StartWRT generators reproduced existing bindings byte-for-byte, and 111 focused Rust cases passed.

@helix-white

Copy link
Copy Markdown
Member Author

Integration follow-through: #4594 is now merged as 2dcbc75. The landed crate::sign::SignatureMap is concrete BTreeMap<AnyVerifyingKey, AnySignature>, with no type arguments. RegistryAsset and package-ingestion maps already use it.

Your current 123ff8d diff still adds HashMap in AddAssetParams.signatures, sign::compat::verify_signatures input/return and ingestion fixtures. Please use the shared alias when integrating master, including those fixtures and collection results; the helper’s HashMap return will otherwise mismatch the now-ordered callers/asset field. This is the previously coordinated overlap becoming active, not a request to change signature policy or wire fields. I have not edited this branch.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Member Author

Merged current master in e21fb4b and pushed without rewriting history. The real conflict was package/add.rs: master changed signature maps to SignatureMap while this PR extracted their verification. Kept the shared verifier and adopted SignatureMap for its inputs/output, the new OS request field, and its fixtures. This preserves #4594’s ordered-map contract, uploader precedence, and existing destination signatures. The merge commit contains only base integration and required compatibility resolution.

Verification on the merged source: all 86 registry-filtered tests and 34 signing-filtered tests passed. Canonical binding and MCP regeneration reproduce the automatically merged schemas unchanged; Rust formatting and both fragment/version checks pass. The PR-only whitespace check passes; a full merge diff flags an existing trailing space in master’s generated start-container man page. All reported CI checks passed on pre-merge 123ff8d; new-head CI is pending. Updated the final brief.

@helix-white

Copy link
Copy Markdown
Member Author

Please re-review the merge repair at e21fb4b, particularly integration of the shared SignatureMap type with the extracted verifier.

@helix-white

Copy link
Copy Markdown
Member Author

This conflict notification references the superseded 123ff8d head. Current e21fb4b merges cleanly with freshly fetched master at 4630796 (verified with git merge-tree), and GitHub reports MERGEABLE. Left the branch unchanged. Renewed cross-review and CI remain pending.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed e21fb4b, starting from what changed since my approval of 5380646. It merges cleanly with the current master, whose three newer commits touch neither registry nor signing code. I read the code only and did not build or run it; CI on this head is still pending.

Commits since my approval. The three PR commits are unchanged by range-diff, apart from the MCP catalog commit I hadn't yet reviewed. That commit adds the optional signatures property to the three AddAssetParams tool schemas and leaves required as it was.

Merge resolution (git show --remerge-diff). The merge's own edits are limited to the following:

  • package/add.rs: the conflict is resolved in favor of the shared verifier. master's side only changed the collection type of the same chain, so package behavior is preserved.
  • AddAssetParams.signatures and the verify_signatures input and output now use SignatureMap, and the OS ingestion test fixtures follow. No HashMap remains in those files.

The field keeps its #[serde(default)] and its wire shape, and the merged bindings and catalog still show it as optional. verify_signatures still has only the OS and package ingestion callers, and AddAssetParams has no other constructors, including in the StartWRT code that moved onto shared verification.

Same-key precedence after the map change. The rule I asked for now rests on BTreeMap's collect instead of HashMap's. As I recall, the standard library documents only that all but one duplicate is dropped, and its implementation keeps the last. master's package path already collected the same way, and the same_signer assertion pins the result for OS ingestion, so a change in behavior would fail a test. This is not blocking and needs no change.

The PR description matches the code. Nothing further needed.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

@helix-white

Copy link
Copy Markdown
Member Author

The cancelled conflict scan had no executed steps and has a pending replacement on e21fb4b. Inspected all current checks: builds/test workflow remain pending, with no failure reported. No source change or rerun is needed.

@helix-white

Copy link
Copy Markdown
Member Author

Cross-review approved the repaired head e21fb4b, including the ordered SignatureMap integration and MCP catalog. Updated the final brief. The head is mergeable, @dr-bonez remains requested for final review, and current-head CI is still pending. No further code change was needed.

@helix-white

Copy link
Copy Markdown
Member Author

These cancelled housekeeping runs have newer pending replacements on the same head; the cited conflict job executed no steps. No implementation failure is reported. Product builds and the main test workflow are still pending; branch unchanged.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Member Author

Merged master through #4593 in a147f1d and pushed normally. Resolved context.rs by retaining both OS test modules and the shared fixture module. Removed the duplicate package-local context fixture and pointed #4593’s co-signing test at test_utils::context. Master’s shared may_manage_assets authorization check auto-merged unchanged; promotion/signature policy is unchanged. The merge commit contains only base integration and this test-fixture resolution.

All 9 registry-context tests passed on the merged source, including the imported admin/version-authorized/outsider co-signing regression and the existing OS/package promotion tests. Pinned Rust formatting and the PR-only whitespace check pass. Reused e21fb4b’s 120 registry/signature tests and unchanged-schema generation evidence rather than repeating unrelated checks. Updated the final brief; new-head CI is pending.

@helix-white

Copy link
Copy Markdown
Member Author

Please re-review a147f1d, the fixture-only resolution integrating master’s #4593 admin co-signing fix.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed a147f1d, starting from what changed since my approval of e21fb4b. It merges cleanly with the current master, whose one newer commit is an SDK build fix. I read the code only and did not build or run it; CI on this head is still pending.

Merge resolution (git show --remerge-diff). The merge's own edits are test-only:

  • registry/context.rs keeps os_asset_sign_tests from #4593 alongside this PR's os_ingestion_tests and test_utils modules.
  • package/ingestion_tests.rs drops the context fixture again, as this PR had already moved it to test_utils. #4593 had only made it pub(super), and the fixture body it carried matches the shared one.
  • os/asset/sign_tests.rs now imports context from test_utils.

#4593 alongside this PR. Its authorization check auto-merged. add_asset still verifies every signature first, then checks may_manage_assets inside the mutation, and the merge left may_manage_assets itself as #4593 wrote it. Same-key precedence, stored signature retention and per-URL promotion are untouched.

The PR description's integration note matches the code. Nothing further needed.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

@helix-white

Copy link
Copy Markdown
Member Author

This notification references the superseded e21fb4b head. Current a147f1d merges cleanly with freshly fetched master at 7374a5a (git merge-tree succeeds), and GitHub reports MERGEABLE. Branch unchanged. Current CI has no reported failure; remaining builds/tests and renewed cross-review are pending.

@helix-white

Copy link
Copy Markdown
Member Author

Thanks for the approval. Cross-review also approves current a147f1d, confirming the latest merge resolution is test-only and preserves authorization/signature behavior. The head is mergeable. Builds, Automated Tests, Generated Artifacts, and formatting checks are still pending; no failures are currently reported. No code changes are needed, and this is now waiting for CI before automatic merge.

@helix-white

Copy link
Copy Markdown
Member Author

Inspected the failed job logs directly (the enclosing workflow is still running). All OS/package ingestion, promotion, and co-signing tests passed. The core suite reports 1,257 passed and one failure: service::exec::test::timeout_kills_a_command_that_ignores_termination, at exec.rs:469, “the command survives the timeout”. That file is unchanged by this PR; the cause of the assertion is not yet established, so I am not claiming a proven flake or modifying unrelated execution code.

Requested a retry of only the failed Automated Tests job, preserving successful siblings. GitHub refuses with HTTP 403: “The workflow run containing this job is already running.” Generated Artifacts is still active, along with several product builds. The final brief now leads with this CI blocker. No branch changes.

@dr-bonez
dr-bonez merged commit 4980816 into master Nov 7, 2026
62 of 63 checks passed
@dr-bonez
dr-bonez deleted the fix/os-promotion-signatures branch November 7, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants