Skip to content

refactor(kernel-agents): make the exo membrane the sole capability arg enforcer#960

Draft
grypez wants to merge 1 commit into
feat/capabilities-as-discoverable-exosfrom
refactor/retire-agent-arg-validation
Draft

refactor(kernel-agents): make the exo membrane the sole capability arg enforcer#960
grypez wants to merge 1 commit into
feat/capabilities-as-discoverable-exosfrom
refactor/retire-agent-arg-validation

Conversation

@grypez

@grypez grypez commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Explanation

Now that every capability is a pattern-guarded discoverable exo (base PR),
retires the membraneless authoring and validation paths so the exo's interface
guard is the single argument enforcer:

  • Removes the capability() authoring helper and the validateCapabilityArgs validator (and its now-dead module). The chat strategy no longer re-validates arguments before invoking — it relies on the guard rejection it already catches and reports as a tool error.
  • Adds a test/make-capability.ts helper that builds a guarded, discovered capability from the described*() combinators, and migrates the chat and JSON evaluator tests (and the capability test, repurposed to cover the surviving extract* helpers) onto it.
  • Drops the now-unused @metamask/superstruct dependency.

Breaking changes

  • capability and validateCapabilityArgs are no longer exported from @ocap/kernel-agents. Author capabilities as discoverable exos (via the described*() combinators) and convert them with discover / discoverLocal.

Test plan

  • yarn workspace @ocap/kernel-agents test:dev:quiet (50 pass)
  • yarn workspace @ocap/kernel-agents-repl test:dev:quiet (178 pass)
  • build + lint for both packages; changelog validates

…g enforcer

Now that every capability is a pattern-guarded discoverable exo, retire the
membraneless authoring and validation paths:

- Remove the `capability()` authoring helper and the `validateCapabilityArgs`
  validator (and its now-dead module). A capability's arguments are enforced
  only by its exo's interface guard; the chat strategy no longer re-validates
  before invoking, relying on the guard rejection it already catches.
- Add a `test/make-capability.ts` helper that builds a guarded, discovered
  capability from the `described*()` combinators, and migrate the chat and JSON
  evaluator tests (and the capability test, repurposed to cover the surviving
  `extract*` helpers) onto it.
- Drop the unused `@metamask/superstruct` dependency.

BREAKING: `capability` and `validateCapabilityArgs` are no longer exported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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