feat(addons): unified distribution Phase 1 — kind taxonomy + managed addon binaries - #729
Merged
Conversation
…addon binaries (#725) Part of the unified-distribution epic (#724, design: docs/specs/unified-distribution-v1.md): everything an agent installs converges on one package model, one registry, one trust chain. Package taxonomy (byte-compatible): - PackageManifest gains `kind` (context | skills | addon | grammar); default `context` is omitted on serialize, so every existing .ctxpkg stays byte-identical. Non-context kinds require schema v2 (validated). Spec §3.4 + JSON schema updated. Managed addon binaries (zero PATH interaction): - New core/addons/artifact_install.rs — the single download → SHA-256 verify → harden → atomic-rename path, extracted from grammar_install (#690), which now delegates here (byte-identical behavior, same policy gates). GrammarAsset is an alias of the shared ArtifactAsset; current_target_triple() moved here from grammar_loader. - AddonManifest gains [artifacts.<target-triple>]: `addon add` fetches the platform binary into <data_dir>/addons/bin/<name>/<version>/ (never PATH), auto-pins its hash as the spawn-time binhash, rewrites the gateway command to the absolute managed path, and records an ArtifactReceipt. addons.policy=locked blocks the fetch pre-network. Resolution order: artifacts → [install] bootstrap → PATH. - New `addon update <name>`: side-by-side version dirs, health-gated flip, prune after success — a failed update leaves the working install wired. `addon remove` deletes managed binaries. - doctor: verifies every artifact receipt (exists + hash + not revoked). 7320 lib tests pass, clippy clean, fmt applied. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 6, 2026
Closed
Co-authored-by: Cursor <cursoragent@cursor.com>
…3.9.2 block Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 of the unified-distribution epic #724 (closes #725). Design doc ships in this PR:
docs/specs/unified-distribution-v1.md.kindpackage taxonomy —PackageManifestgainskind: context | skills | addon | grammar. Defaultcontextis omitted when serializing (byte-compat: every existing.ctxpkgunchanged); non-context kinds require schema v2, enforced invalidate(). Spec §3.4 + JSON schema updated.core/addons/artifact_install.rs: the single download → SHA-256 verify → harden → atomic-rename path.grammar_install(feat: grammar tiering — long-tail tree-sitter grammars as signed runtime addons #690) now delegates here with byte-identical behavior and unchanged policy gates;GrammarAssetis an alias of the sharedArtifactAsset.[artifacts.<target-triple>]inlean-ctx-addon.toml:addon addfetches the platform binary into<data_dir>/addons/bin/<name>/<version>/(neverPATH), auto-pins the hash as spawn-time binhash, rewrites the gateway command to the absolute managed path, records anArtifactReceipt.addons.policy = lockedblocks the fetch before any network I/O. Resolution order:artifacts→[install]bootstrap →PATH.addon update <name>— side-by-side version dirs, health-gated flip, prune after success; a failed update leaves the working install wired.addon removedeletes managed binaries.Acceptance criteria (from #725)
lockedpolicy ⇒ no network fetch (unit test)default_kind_is_omitted_from_serialization)Test plan
cargo clippy --all-features -- -D warningscleanMade with Cursor