Registry: tool-surface manifest, publish CLI, grants from tarball - #707
Merged
TheGreatAxios merged 9 commits intoSep 10, 2026
Merged
Conversation
Pins the ToolSurfaceManifest arktype contract, the tarball-carried surface the packer must synthesize, loader-parity of the packed qualifiedIds, parity with the source-importing describer it replaces, and round-tripping a packed tarball through the new blob-backed manifest reader. Red until the schema, packer change, and reader land.
The packer now enumerates the package's exported tool bundles at pack time and writes a validated ToolSurfaceManifest (qualifiedId, kind, optional ask approval) into the synthesized package.json beside interchange.tools, and a new injected-blob readToolSurfaceManifests reads those manifests back out of a packed tarball tree. This is the pack boundary the hub will read installed grants from instead of importing each package's source.
The hub's toolGrantsForPins port becomes tenant-scoped and async: for the launch's tenant it resolves the corbits-tools package-registry asset (local first, then inherited) and reads each packed tarball's ToolSurfaceManifest through the cached launch-path asset service, minting the same tool:<qualifiedId>/invoke grant shape as before. The source-importing describer and its tests are deleted; the packed tarball tests now pin loader-parity of the manifest's qualifiedIds directly. The port was declared but never consumed inside @corbits/chat, so reshaping it touches only this wiring and the test doubles.
…enant bun run publish-tools signs an admin in (never up), resolves the target tenant from --tenant or the admin's sole membership, and reuses publishCorbitsToolsRegistry to find-or-create the corbits-tools asset and PUT the packed tarballs over the hub's native tenant asset routes. The tenant must already exist — genesis signup or bun run dev created it — so this command only installs, it never provisions.
The setup hop now signs in as the genesis owner, resolves the already-existing root bench from --tenant, and publishes over the native asset routes exactly as bun run publish-tools does, instead of calling the publisher with the suite's own privileged cookie jar.
Covers manifest ownership in the tool-registry-publish README, the bun run publish-tools republish flow in local-dev, and the CLI's install-onto-existing-tenant shape plus the installed-manifest grant source in seed-reconciliation.
Registries published before manifests existed still hold tarballs with no surface key, and shouldPublishTarball never re-uploads an existing name@version to heal them. One unreadable blob now degrades to a log line instead of failing every grants read.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Linear: CL-7582
Summary
Tool packages now carry their surface in the tarball, and the hub reads grants from the installed asset instead of importing package source.
package.jsoncarries asurfacelist (qualifiedId,kind: "tool" | "skill", optionalapproval: "ask"), written by the packer and validated with an arktype schema at the pack boundary. A pack-time test pins parity with the ids the runtime loader derives from each bundledtool.mjs.bun run publish-toolssigns in, resolves the tenant (--tenantor the signed-in principal's sole membership), and installs via the existing native asset routes (POST /api/tenants/:tid/assets+PUT .../tarballs/:filename). No daemon, no new hub route.corbits-toolsasset (local-then-inherited) through the launch-caches blob seam.describe.tsand its source imports are deleted.No new table, no migration. Hub boot still seeds nothing. Launch-side consumption of the grants port is unchanged (a pre-existing gap, addressed with onboarding in CL-7584).
Test plan
bun test packages/tool-registry-publish— 78 pass (manifest schema, per-package pack parity, reader round-trip, legacy-tarball tolerance)bun test apps/hub/src/tool-grants.test.ts— 6 pass (grants derive from an in-memory asset, no source imports)bun test packages/chat— 963 pass;packages/agent-directory— 86 passbun test scripts/e2e/local-rip.test.ts— 1 pass (real hub + Postgres: publish-tools installs onto the genesis-created bench)bun run check— exit 0