Skip to content

Registry: tool-surface manifest, publish CLI, grants from tarball - #707

Merged
TheGreatAxios merged 9 commits into
mainfrom
cl-7582-registry-tool-surface-manifest-publish-cli-grants
Sep 10, 2026
Merged

Registry: tool-surface manifest, publish CLI, grants from tarball#707
TheGreatAxios merged 9 commits into
mainfrom
cl-7582-registry-tool-surface-manifest-publish-cli-grants

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

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.

  • Manifest. Every packed tarball's package.json carries a surface list (qualifiedId, kind: "tool" | "skill", optional approval: "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 bundled tool.mjs.
  • CLI. bun run publish-tools signs in, resolves the tenant (--tenant or 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.
  • Grants. The hub derives pinned-tool grants from the tenant's installed corbits-tools asset (local-then-inherited) through the launch-caches blob seam. describe.ts and its source imports are deleted.
  • The surface reader skips — logs, never throws — tarballs published before manifests existed, since republishing cannot heal them.

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 pass
  • bun 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

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.
@linear-code

linear-code Bot commented Sep 10, 2026

Copy link
Copy Markdown

CL-7582

@TheGreatAxios
TheGreatAxios merged commit 1404a18 into main Sep 10, 2026
24 checks passed
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