Repository navigation
fix(registry): keep only signatures from registered signers on packages - #4729
Conversation
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
left a comment
There was a problem hiding this comment.
Request changes on 3a83bd71e5627ed400f92b5cb4535caae66f9de6:
-
[P1] The new helper breaks non-test builds (
shared-libs/crates/start-core/src/registry/package/index.rs:207–208).retain_registered_signaturesnamesAnyVerifyingKeyin production code, but its import is still behind#[cfg(test)]. Normal product builds cannot resolve the type. The proposal importsAnyVerifyingKeyunconditionally and keepsAnySignaturetest-only. -
[P1] Existing ingestion tests still require the behavior being removed (
registry/package/add.rs:92,423andregistry/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. -
[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
left a comment
There was a problem hiding this comment.
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
|
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
left a comment
There was a problem hiding this comment.
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
df1687aaacontains 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
5230ac442applies 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
|
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
left a comment
There was a problem hiding this comment.
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.lockprojects/start-registry/Cargo.tomlshared-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
|
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
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
|
Took over implementation as @helix-red. Pushed to
Verification on the merged tree:
|
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
left a comment
There was a problem hiding this comment.
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-ofregistry 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-ofand 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
|
Adopted @helix-white's proposal unchanged as
Verification on |
helix-white
left a comment
There was a problem hiding this comment.
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
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.
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.
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.addstarts each entry froms9pk.signatures(), the signature embedded in the.s9pk, which CI makes.registry package promotesends 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.addandpackage.add-mirrorapply the rule before storing, throughPackageVersionInfo::retain_registered_signatures.package.signalready refused unregistered signers.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. Amirror-ofregistry 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)..s9pkfiles 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 listbefore 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), andremoving_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 withmake 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