Skip to content

feat: add registry assembly, signing, and verification tools - #256

Merged
ZhiXiao-Lin merged 7 commits into
mainfrom
registry-tools/bootstrap
Sep 8, 2026
Merged

ZhiXiao-Lin merged 7 commits into
mainfrom
registry-tools/bootstrap

Conversation

@ZhiXiao-Lin

Copy link
Copy Markdown
Contributor

Summary

Bootstraps the A5 official-Registry tooling by extracting the TUF signing primitives from test support into a production module and adding an operator-facing crate:

  • tuf_authoring module (a3s-use-extension): canonical JSON, Ed25519 key ids, signed role documents — the same bytes the client verifies, now shared by test support and tooling. The existing golden fixture test proves byte-level equivalence after the refactor.
  • a3s-use-registry-tools (crates/registry-tools, new workspace member): keygen (four independent role seeds, 0600, refuse-overwrite), pack (deterministic tar.gz), assemble (admission ACL + package manifest → catalog-v3 record + planning bundle + signed four-role tree), verify (reloads the tree through the same tough loader a released client uses, validates every record, planning binding, and on-disk target digest).
  • package_fingerprint promoted to a public API so registry assembly uses the exact admission-time content identity.

Testing

  • cargo test -p a3s-use-registry-tools: 6/6 (roundtrip, planning-target, tamper detection, identity mismatch, missing-ceiling, keygen overwrite refusal)
  • cargo test -p a3s-use-extension --lib: 281 passed including the plugin-v3 golden fixture (byte-identical after refactor)
  • clippy + fmt clean

End-to-end evidence

The first tree this tooling produced was verified with the real CLI against a loopback server: registry source add with the pinned root → plugin search (full TUF chain) → inspect → plan-install → apply-plan (capability generation 1, skill-host prepared) → capability snapshot (expanded content lands at the catalog-declared package.sha256) → uninstall (zero residue). Consumer side lives in A3S-Lab/Use-Registry bootstrap/dev-preview.

🤖 Generated with Claude Code

Extract the TUF signing primitives from test support into a production
tuf_authoring module (canonical JSON, Ed25519 key ids, signed role
documents) and expose the canonical expanded-package fingerprint. Build
a3s-use-registry-tools on top: keygen with offline custody seeds,
deterministic package packing, admission-driven catalog-v3 record and
planning-bundle derivation, four-role TUF tree assembly, and a verifier
that reloads the tree through the same tough loader a released client
uses.

The first published tree this tooling produced is verified end to end:
source add with a pinned root, search, inspect, reviewed plan/apply,
capability snapshot, and uninstall all pass against the bootstrapped
Use-Registry dev-preview.
ZhiXiao-Lin pushed a commit to A3S-Lab/Use-Registry that referenced this pull request Sep 7, 2026
The placeholder failed closed until the tooling had a pushed revision;
A3S-Lab/Use#256 head is the current reviewed source. Update the pin to
the Use main commit when that PR merges.
roylin and others added 6 commits September 7, 2026 13:34
Assembly now clears the metadata/ and targets/ directories it owns before
writing, so a superseded version can never linger beside a catalog that
no longer advertises it. Two integration tests cover the ongoing
publication workflow: metadata versions 1..3 assemble and verify in
place, and a 0.1.0 -> 0.2.0 republication removes the stale target
directory while the new identity verifies.

The full client path was exercised end to end against a loopback
server: install at metadata v1, republication at v2 with a package
version bump, client metadata refresh, reviewed upgrade apply to
capability generation 2, and clean uninstall.
main has been failing the test job since the gateway lease series:
tokio's OpenOptions has inherent custom_flags/mode methods, so the
shadowed std::os::unix::fs::OpenOptionsExt imports in the capability
plane stores were never used, and has_generation_lease is exercised
only by tests, so the lib target reported it as dead code.

Drop the redundant imports and gate the test-only accessor with
#[cfg(test)]. cargo clippy --workspace --all-targets --all-features
--locked -- -D warnings passes and the full workspace suite is green
(1421 passed).
rustc 1.98 reports the file-level 'use rusqlite::OptionalExtension as _'
as unused in this module while 1.97 does not, which fails the CI clippy
gate on current stable. Call the adapter fully qualified instead so the
lint cannot disagree between toolchain versions; the exact CI command
now passes under both 1.97.1 and 1.98.1.
Keep symlink metadata reads Unix-only in registry packing so Windows
builds stay warning-clean, and surface the actual Control effect
dispatch result when capability-plane fixture setup mismatches.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ZhiXiao-Lin
ZhiXiao-Lin marked this pull request as ready for review September 8, 2026 11:17
@ZhiXiao-Lin
ZhiXiao-Lin merged commit d7f6a6e into main Sep 8, 2026
ZhiXiao-Lin pushed a commit that referenced this pull request Sep 8, 2026
Record crates/registry-tools on main (#256) without claiming A5 EXIT;
production custody and official bootstrap remain open.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant