refactor(kernel-agents): make the exo membrane the sole capability arg enforcer#960
Draft
grypez wants to merge 1 commit into
Draft
Conversation
…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>
4 tasks
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.
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:
capability()authoring helper and thevalidateCapabilityArgsvalidator (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.test/make-capability.tshelper that builds a guarded, discovered capability from thedescribed*()combinators, and migrates the chat and JSON evaluator tests (and the capability test, repurposed to cover the survivingextract*helpers) onto it.@metamask/superstructdependency.Breaking changes
capabilityandvalidateCapabilityArgsare no longer exported from@ocap/kernel-agents. Author capabilities as discoverable exos (via thedescribed*()combinators) and convert them withdiscover/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+lintfor both packages; changelog validates