feat(capabilities): PR-3 — discovery→registry sync (zero-code onboarding)#681
Merged
Conversation
…ing G2)
Reads Capability Descriptors (PR-1) that a provider publishes in their
orchestrator's /discovery advertisement and runs them through the shipped
cap-lifecycle: validate → dedup by semantic_key → NEW identity registers into
the universal overlay (so the agent can describe/list it), EXISTING same-name is
an idempotent refresh, DIFFERENT name is a synonym and is SKIPPED + reported.
This turns "provider does work" into "it just works" — no hand-run cap_add, no
hardcoded per-cap map.
- lib/capabilities/discovery-sync.ts: PURE projection + planner (descriptorToEntry,
synthesizeUsage from the io contract, planDiscoverySync, extractDescriptors —
tolerant of array / {runners} / {orchestrators} shapes, ignores legacy
no-descriptor entries) + thin I/O (applyDiscoverySync, fetchDiscoveryDescriptors).
- app/api/cron/capability-sync/route.ts: DEFAULT-OFF (CAP_DISCOVERY_SYNC_ENABLED),
CRON_SECRET-guarded, best-effort per URL.
SAFETY: additive (new module + default-off route, no edits to existing paths);
fail-open (bad descriptor/URL skipped, never thrown); writes only the
operator-governed universal overlay. Golden green; 12 unit tests.
Plan: LIVE-RUNNER-CAP-ADOPTION-PROPOSAL.html §4 (PR-3). Reuses PR-1 descriptor
schema + the shipped registry-overlay + cap_add dedup semantics.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
PR-3 of the zero-code capability-provider onboarding effort (plan:
LIVE-RUNNER-CAP-ADOPTION-PROPOSAL.html§4, gap G2). Builds on PR-1 (#680).What
Ingests Capability Descriptors a provider publishes in their orchestrator's
/discoveryadvertisement and runs them through the shipped cap-lifecycle — so onboarding needs no hand-runcap_addand no hardcoded per-cap map.validate(PR-1) →dedupbysemantic_key→ NEW identity registers into the universal overlay (describable/listable) · EXISTING same-name = idempotent refresh · different name = synonym, skipped + reported.Files (all new — additive)
lib/capabilities/discovery-sync.ts— pure projection + planner (descriptorToEntry,synthesizeUsagefrom theiocontract,planDiscoverySync,extractDescriptors— tolerant ofarray/{runners}/{orchestrators}shapes, ignores legacy no-descriptor entries) + thin I/O (applyDiscoverySync,fetchDiscoveryDescriptors).app/api/cron/capability-sync/route.ts— DEFAULT-OFF (CAP_DISCOVERY_SYNC_ENABLED),CRON_SECRET-guarded, best-effort per URL.tests/unit/capability-discovery-sync.test.ts— 12 tests.No-regression guarantees
CAP_DISCOVERY_SYNC_ENABLED=1.cap_add/cap_seed.Consumes / enables
validateDescriptor+ the shippedregistry-overlay.usageblock sodescribe_capabilityshows the right verb (run_capabilityfor text,create_mediafor media) — therun_capabilityverb lands in PR-4 (paired with PR-2's descriptor-driven SDK dispatch).🤖 Generated with Claude Code