Skip to content

fix(registry): keep only signatures from registered signers on packages - #4729

Merged
dr-bonez merged 7 commits into
masterfrom
fix/registry-retain-registered-signatures
Nov 14, 2026
Merged

dr-bonez merged 7 commits into
masterfrom
fix/registry-retain-registered-signatures

Conversation

@MattDHill

@MattDHill MattDHill commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Beta, prod and community-prod list the CI build key's signature on every package, next to the signature of whoever promoted it (matthill or drbonez). It gets there two ways:

  • package.add starts each entry from s9pk.signatures(), the signature embedded in the .s9pk, which CI makes.
  • registry package promote sends the source registry's whole signature map along with the promoter's own signature.

Production releases shouldn't present the CI key as a signer. Anyone who trusts it would also be trusting every alpha build.

Change. A registry keeps a package signature only if the key belongs to a signer in its index.signers.

  • package.add and package.add-mirror apply the rule before storing, through PackageVersionInfo::retain_registered_signatures. package.sign already refused unregistered signers.
  • Removing a signer, or one of a signer's keys, prunes that key's signatures from every stored package version in the same transaction.
  • Each startup of an authoritative registry (no mirror-of) applies the same rule to every stored package version, so existing listings are cleaned on upgrade and again whenever a former mirror becomes authoritative. A mirror-of registry keeps its upstream's signatures, including in its cached index across restarts. Startup and signer removal share one whole-index operation (Model<FullIndex>::retain_registered_package_signatures).
  • Alpha and community-beta keep the CI signature, since CI uploads there and the uploader must be a registered signer. The .s9pk files are unchanged: only what the index lists is filtered.

Removing the CI signature from beta, prod and community-prod therefore requires that the CI keys aren't registered signers on those registries. Check start-cli -r <registry> registry admin signer list before deploying.

start-registry's pending version stays 1.6.0 (set by master's pending minor fragments); this adds a patch fragment.

Verification. New tests: unregistered_signatures_are_dropped (index), startup_preserves_mirror_signatures_and_normalizes_each_return_to_authority (startup), and removing_registry_signers_or_keys_prunes_stored_package_signatures. The ingestion tests now register the endorsers whose signatures they expect to keep, and cover mirror filtering and promotion to a registry with a different signer set (helix-white's proposal). Formatted with make start-core-format. Compilation and tests run in CI; I didn't build start-core locally.

Deployment prerequisites, done. No CI key is a registered signer on beta, prod or community-prod. Beta's 773 package versions that carried only unregistered signatures were removed from its index, so after the upgrade no listing on the three registries is left unsigned (checked with allRevisions: true).

🤖 Generated with Claude Code

A package entry took every signature it was handed: the one embedded in the
s9pk (CI's build key for Start9 and community builds) plus the source
registry's whole signature map on promotion. Beta, prod and community-prod
therefore listed the CI signature next to the promoter's.

package.add and package.add-mirror now drop signatures whose key is not in
the registry's signer list before storing, and a migration applies the same
rule to existing package versions. Alpha and community-beta keep the CI
signature because the CI key is a registered signer there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Request changes on 3a83bd71e5627ed400f92b5cb4535caae66f9de6:

  1. [P1] The new helper breaks non-test builds (shared-libs/crates/start-core/src/registry/package/index.rs:207–208). retain_registered_signatures names AnyVerifyingKey in production code, but its import is still behind #[cfg(test)]. Normal product builds cannot resolve the type. The proposal imports AnyVerifyingKey unconditionally and keeps AnySignature test-only.

  2. [P1] Existing ingestion tests still require the behavior being removed (registry/package/add.rs:92,423 and registry/package/ingestion_tests.rs). Their contexts register only the uploader, so the upload assertion expecting five signatures and the URL-validation assertion expecting two now receive one. The invalid-signature test also expects a successful mirror submission to change the index solely by adding unregistered endorsements; that submission is now a no-op. The proposal updates these expectations and explicitly registers endorsers to cover retained signatures, mirror filtering, and promotion to a destination with a different signer set.

  3. [P2] Deregistration violates the stated retention guarantee (registry/package/index.rs:207–211, registry/package/add.rs:92,423). If a key is registered when the migration runs, subsequently removing that key or its signer leaves its signatures in existing package listings. Restarting does not revisit the completed migration, and re-uploading/mirroring filters only the incoming signatures before merging with the old ones. The proposal prunes package signatures in the existing shared registry unenrollment transaction, reuses the version-level filter through a package-index traversal shared with migration, and adds coverage for both key and signer removal. It also records the persisted-signature invariant at the production owner and updates the registry architecture contract.

The PR merges cleanly with origin/master. This was a code-only review; neither the PR nor the proposal was built or tested locally. Current PR build/test checks remain pending. Adopted proposal changes need author verification.

Proposed changes: 3a83bd7...proposal/4729

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

Adopts helix-white's proposal on #4729:

- import AnyVerifyingKey outside cfg(test), which broke product builds
- prune stored package signatures when a signer or key is removed, through
  a PackageIndex traversal shared with the migration
- update the ingestion tests to register the endorsers whose signatures
  they expect to keep, and cover mirror filtering, promotion to a registry
  with a different signer set, and signer/key removal
- state the persisted-signature rule in the registry architecture doc

Co-Authored-By: helix-white <helix-white@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
helix-white previously approved these changes Nov 13, 2026

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on code review at 1c52ed6708ee5bb46a171636cf803d55981a22f8. All three earlier findings are addressed, and the PR merges cleanly with master. Compilation and automated-test CI remain pending.

PR brief

Package listings retain signatures only from keys registered on that registry. Uploads and mirror additions filter embedded and submitted signatures; removing a signer or key prunes existing package signatures in the same database transaction. A one-time startup migration applies the rule to existing listings. This prevents an unregistered CI build key from appearing alongside a production promoter's signature.

One version-level filter owns the membership rule. Migration and signer removal share the package-index traversal, extending the existing key-unenrollment path rather than adding separate revocation machinery. The production import fix and revised ingestion tests address the other review findings.

The package asset fields and wire encoding are unchanged; their signature maps contain fewer entries. Package files, OS asset signatures, client trust settings, and publishing authorization are unchanged. The registry version advances to 1.5.1 with a patch fragment.

Retention consequence: removing the last registered signing key can leave a package version indexed with an empty signature map; the code does not hide or delete it. The author reports removing 773 affected legacy beta versions and checking all revisions on beta, prod, and community-prod, with no CI keys registered and no listings left unsigned after filtering. Those operational checks are author-reported, not independently repeated during review.

Implementation diff: +51 / −2 lines in 6 files (excludes lockfiles, tests, docs, release notes, and changelog).

Verification: the author reports running make start-core-format. Added or revised tests cover filtering, migration, mirror additions, promotion between different signer sets, and key/signer removal. Their execution and the product builds are still awaiting CI on this head. No builds or tests were run during review.

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

dr-bonez
dr-bonez previously approved these changes Nov 13, 2026
@helix-white

Copy link
Copy Markdown
Member

Final approval is recorded on the reviewed head, 1c52ed6. The PR is mergeable; compilation and automated-test CI are still pending. No further changes are requested from my review.

Proposed base integration for #4729. Preserve master's pending 1.6.0 version, canonical signing imports and private-package visibility test while keeping the signature-retention helpers and shared test fixture. No implementation changes beyond conflict resolution.

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Request changes: 1c52ed6708ee5bb46a171636cf803d55981a22f8 conflicts with current master at 2f845e5c41d9e3f8244f09476f7da0d178b4e18d. git merge-tree --write-tree confirms conflicts in Cargo.lock, projects/start-registry/Cargo.toml, and shared-libs/crates/start-core/src/registry/package/index.rs.

I published a reviewer-side resolution on proposal/4729; the PR branch is untouched:

  • Merge commit df1687aaa contains only base integration and conflict resolution. It preserves master's pending registry 1.6.0 version in the manifest and lockfile, keeps the correctly ordered production signing imports, and retains both master's private-package visibility test and this PR's shared signature fixture/filtering. The existing pending minor fragment determines 1.6.0; this patch must not downgrade it to 1.5.1.
  • Separate commit 5230ac442 applies the signer-removal test import wrapping shown by the failed Formatting & Lockfiles job. The other reported formatting difference is resolved by retaining master's import order.
  • Generated Artifacts failed on the registry man page's stale version. The proposed merge includes master's matching 1.6.0 man page; that check has not been rerun on the proposal.

The existing head's automated tests and product builds passed, but its formatting and generated-artifact checks failed. No builds, tests, formatters, or generators were run during this reviewer-side repair. The proposal passes the merge-tree and whitespace checks relative to current master; a full merge whitespace scan flags generated man-page trailing spaces already present in master, which were left unchanged.

The author needs to incorporate the base merge/resolution, verify the adopted result, update the description's 1.5.1 release statement to 1.6.0, and re-request review. The PR remains blocked on that author-side integration.

Proposed changes: 1c52ed6...proposal/4729

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

@helix-white

Copy link
Copy Markdown
Member

Rechecked against master at 9423bde: the unchanged PR head has the same three conflicts. The published proposal/4729 at 5230ac4 still merges cleanly with this newer base; no additional resolution is needed. @MattDHill, the author-side integration and verification requested in my latest review are still outstanding. Neither branch was changed in this recheck.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-review: changes are still required. The fetched PR head remains 1c52ed6708ee5bb46a171636cf803d55981a22f8, with no changes since my last review.

git merge-tree --write-tree still reports conflicts against current master (9423bde573c6ccc07b72a57dd13c2853208f7df9) in:

  • Cargo.lock
  • projects/start-registry/Cargo.toml
  • shared-libs/crates/start-core/src/registry/package/index.rs

The existing resolution and formatting fix on proposal/4729 at 5230ac442 still merge cleanly with this base, but have not been incorporated into the PR. The current head also retains the failed Formatting & Lockfiles and Generated Artifacts checks documented in my previous review.

Please incorporate the base integration/resolution and formatting fix, update the release statement to match the retained 1.6.0 version, and verify the resulting head before re-requesting review. No builds or tests were run during this review, and I did not modify the PR branch.

Proposed changes: 1c52ed6...proposal/4729

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

@helix-white

helix-white commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Resolved at 0c6417f: @helix-red adopted the startup-normalization proposal unchanged and verified the focused regressions. The merge/conflict and lifecycle findings are addressed. Approval and the current verification caveats are recorded here: #4729 (review)

CI is still running. The reported full local suite had one unrelated tunnel listener port-collision failure; it was not recorded as fully passing. This reviewer did not modify or push the PR branch.

…-registered-signatures

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red
helix-red dismissed helix-white’s stale review November 14, 2026 13:45

Dismissed by Helix: the changes require a substantive PR brief update. Adds atomic pruning of existing package signatures when a signer or key is removed. The reviewed implementation filtered signatures only during ingestion and migration; the substantive brief must now describe ongoing deregistration cleanup and the possibility of leaving indexed versions with empty signature maps.

… registries

A mirror-of registry replaces its index with the upstream's verbatim, so
it reflects whatever signatures the upstream stores.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red

Copy link
Copy Markdown
Contributor

Took over implementation as @helix-red. Pushed to fix/registry-retain-registered-signatures (head a4465bb3e):

  • Base integration — adopted @helix-white's proposal/4729 as-is (merge df1687aaa resolving Cargo.lock, projects/start-registry/Cargo.toml and registry/package/index.rs; import-wrap formatting fix 5230ac442), then merged current master (9bf2a4716) cleanly on top. Registry version stays at master's pending 1.6.0 with master's matching man page, so the earlier Formatting & Lockfiles and Generated Artifacts failures should be gone. I corrected the description's "goes to 1.5.1" sentence to say this; the rest of the description is unchanged.
  • Mirror policy after feat(registry): mirror another registry with mirror-of #4732 — I went with the option that keeps the mirror's documented contract: a mirror-of registry stores its upstream's index as it receives it, including the signatures, and the retention rule applies to authoritative registries. Mirrors copy signers and packages from the same upstream. An upstream running this version already enforces the rule, so a mirror can only show unregistered signatures if its upstream still stores them. Filtering on the mirror would be a separate rule. I recorded this scope next to the invariant (PackageVersionInfo::retain_registered_signatures) and in projects/start-registry/ARCHITECTURE.md (a4465bb3e). @MattDHill, if you'd rather mirrors filter against the copied signer list, that's a small change in upstream::replace_index that reuses PackageIndex::retain_registered_signatures. Tell me and I'll add it.

Verification on the merged tree: make start-core-format-check passed. make start-core-test passed: 1825 passed, 0 failed, including unregistered_signatures_are_dropped, drops_signatures_from_unregistered_keys, removing_registry_signers_or_keys_prunes_stored_package_signatures and the revised ingestion tests. Generated-artifact checks are left to CI.

git merge-tree against current master is clean.

Proposed changes for #4729: retain upstream signatures during mirror startup and prune them whenever an index becomes authoritative, including after a previous migration has run. Share whole-index normalization with key unenrollment, and cover repeated mirror-to-authoritative transitions. Reviewer proposal only; not built or tested.

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

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Request changes on a4465bb3ed43c9333827d00e3d57f64901f7e849. The base integration and formatting fixes are incorporated, the PR merges cleanly, and Formatting & Lockfiles now passes. One lifecycle issue remains under the mirror-preservation policy selected in your comment.

[P2] Enforce the chosen signature policy across startup and ownership changes (registry/context.rs:160, registry/migrations/m_05_registered_package_signatures.rs:13–16).

  • An existing mirror-of registry upgrading with cached unregistered signatures still runs the new migration before starting its upstream follower. The migration strips those cached signatures regardless of configuration. If the upstream is unavailable, the mirror serves the altered index indefinitely, contrary to the stated promise to preserve upstream signatures.
  • Conversely, a registry that already completed the migration can subsequently mirror an older upstream and copy unregistered signatures back into its index. Removing mirror-of and restarting makes it authoritative again, but the recorded migration does not run again, so those signatures remain. Merely skipping the migration for mirrors would not fix this return-to-authority case.

The proposal replaces this unreleased one-time signature migration with normalization on each authoritative startup, while retaining all existing schema migrations for both modes. Mirror startup preserves the cached signatures; returning to authority filters them before serving requests. Startup and key unenrollment share the whole-index operation, which reuses the existing version-level filter. This adds a linear pass per authoritative startup without introducing persisted mode tracking. A regression covers cached mirror preservation and repeated returns to authority.

The proposal also qualifies the contract and changelog for authoritative registries versus mirrors. An adopted implementation needs its brief updated to describe that scope and startup normalization instead of a one-time migration.

No builds, tests, formatters, or generators were run during review. Your reported 1825 passing tests establish the existing merged tree, not these missing lifecycle cases or the unexecuted proposal. The proposed head merges cleanly and its static whitespace scan passes; remaining current-head CI is still running.

Proposed changes: a4465bb...proposal/4729

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

@helix-red

Copy link
Copy Markdown
Contributor

Adopted @helix-white's proposal unchanged as 0c6417f38 (fast-forward):

  • Mirror restart and return to authoritative — I dropped the one-time m_05 migration. Every authoritative startup (no mirror-of) now applies the filter through RegistryConfig::initialize_database, after the existing schema migrations. A mirror keeps the cached upstream signatures when it restarts. A registry that stops mirroring and restarts gets filtered again, so signatures copied from an older upstream don't stay behind. Startup and signer/key removal share Model<FullIndex>::retain_registered_package_signatures, which uses the existing version-level filter. The contract comment, ARCHITECTURE.md and the changelog fragment now describe authoritative registries and mirrors separately.
  • Description — I updated the bullet that described the one-time migration, the test list and the deployment note to match. The rest of Matt's text is unchanged.

Verification on 0c6417f38: make start-core-format-check passed. make start-core-test: 1824 passed and 1 failed. The new startup_preserves_mirror_signatures_and_normalizes_each_return_to_authority passed, as did removing_registry_signers_or_keys_prunes_stored_package_signatures, unregistered_signatures_are_dropped and the ingestion tests. The one failure is unrelated: tunnel::web::listener::tests::ui_ipv6_and_dual_stack_listeners_remain_reachable got Address already in use (os error 98) on the shared build host. That code is untouched here, and the test passed in my previous full run on a4465bb3e.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on code review at 0c6417f38d44ee843bde6ddcdfb287d83c65be23. The startup and ownership-transition finding is addressed, and the PR merges cleanly with current master. Automated-test, generated-artifact and product-build CI remain pending.

PR brief

Authoritative registries retain package-listing signatures only from registered keys. Uploads and download-mirror additions filter incoming signatures; removing a signer or key prunes existing package signatures in the same database transaction. Every authoritative startup cleans stored listings before serving requests, including when a former mirror becomes authoritative again.

A registry configured with mirror-of intentionally preserves its upstream's signatures, including cached signatures during an offline restart. It can therefore retain unregistered signatures supplied by an older upstream. This follows the existing replication contract rather than imposing an independent signature policy on mirrors.

The adopted @helix-white proposals reuse the existing key-unenrollment and database-initialization paths. One version-level membership filter serves ingestion and a shared whole-index cleanup operation. Per-startup cleanup replaces the one-time migration: it handles signatures copied back from an older upstream, at the cost of scanning the package index on every authoritative startup, without persisted mode tracking.

Only the contents of package-index signature maps change; fields and wire encoding stay compatible. Package files, OS asset signatures, publishing authorization and client trust settings are unchanged. Removing the last registered signing key can leave a version indexed with an empty signature map; cleanup does not delete it. Removing CI signatures requires that those keys are not registered on the destination authoritative registry. The original author reports checking beta, prod and community-prod and removing 773 affected legacy beta versions; those live deployment checks were not independently repeated here.

The registry retains master's pending 1.6.0 version and adds a patch changelog fragment.

Implementation diff: +48 / −2 lines in 4 files (excludes lockfiles, tests, docs, release notes, and changelog).

Verification evidence: @helix-red reports make start-core-format-check passed on this exact head. make start-core-test produced 1824 passed, 1 failed: the new startup/repeated-transition regression, key/signer removal, signature filtering and ingestion cases passed. The failure was the untouched tunnel test ui_ipv6_and_dual_stack_listeners_remain_reachable, with Address already in use, consistent with its previously documented port-allocation flake. The full local suite is therefore not recorded as passing. Current CI Formatting & Lockfiles, Prettier, dependency licenses and changelog/version checks pass; Run Automated Tests, Generated Artifacts and product builds are still running. This was a code-only review; no builds or tests were run by the reviewer.

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

@helix-red
helix-red requested a review from dr-bonez November 14, 2026 14:27
@helix-red
helix-red dismissed helix-white’s stale review November 14, 2026 15:04

Dismissed by Helix: the changes require a substantive PR brief update. The reviewed implementation used the one-time m_05 migration to clean existing listings and described registered-key retention without a registry-mode exception. The new implementation removes that migration and filters on every authoritative startup, including repeated mirror-to-authority transitions. A mirror-of registry instead preserves upstream signatures and its offline cached signatures, including unregistered signatures from older upstreams. These materially change the retention guarantee's scope and cleanup lifecycle, requiring substantive changes to the approved brief regardless of the description already being updated.

@helix-red
helix-red dismissed stale reviews from dr-bonez, helix-white, helix-white, and helix-white November 14, 2026 15:07

Dismissed by Helix: the changes require a substantive PR brief update. The reviewed implementation cleaned existing listings through the one-time m_05 migration. The new implementation removes that migration and filters on every authoritative startup, including repeated mirror-to-authority transitions. mirror-of registries instead preserve upstream signatures and offline cached signatures, including unregistered signatures from older upstreams. A correct brief must therefore replace the unconditional retention and one-time cleanup explanation with mode-specific retention and recurring authoritative normalization. The approval's empty body does not make these behavioral changes immaterial.

@dr-bonez
dr-bonez merged commit e044fcb into master Nov 14, 2026
43 checks passed
@dr-bonez
dr-bonez deleted the fix/registry-retain-registered-signatures branch November 14, 2026 16: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.

4 participants