feat(claude): validate artifacts with host devtools - #193
Conversation
🦋 Changeset detectedLatest commit: ef0fe49 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36e73400e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let version: string | undefined; | ||
| try { | ||
| const probe = await run(Object.freeze({ args: Object.freeze(['--version']), cwd, executable })); | ||
| if (probe.exitCode !== 0 || probe.termination !== undefined) { |
There was a problem hiding this comment.
Fail validation when the Claude version probe fails
When an installed claude --version invocation times out, exceeds the output limit, or exits nonzero, this returns only an informational AB6019 and skips the actual validator. Consequently, agent-bundle validate --artifact … --strict still exits successfully even though host validation did not run. Reserve the unavailable/info result for a genuinely missing executable and report bounded or nonzero probe failures as AB6022 errors.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in #215. A version probe that times out, exceeds the output limit, exits nonzero, or fails to spawn for any non-ENOENT reason now returns status 'failed' with an AB6022 error diagnostic, so validate --artifact --strict no longer succeeds when host validation never ran. The informational AB6019/'unavailable' result is reserved for a genuinely missing executable (ENOENT). Covered by four new regression tests.
| ): Promise<ClaudePluginValidationReport> => { | ||
| const executable = options.executable ?? 'claude'; | ||
| const run = options.run ?? runClaudeCommand; | ||
| const cwd = dirname(options.pluginDirectory); |
There was a problem hiding this comment.
Resolve relative plugin paths before changing cwd
For the newly exported test helper, a multi-segment relative path such as fixtures/plugin sets the child cwd to fixtures while still passing fixtures/plugin to Claude, so the host resolves it as fixtures/fixtures/plugin. Resolve the plugin directory to an absolute path before deriving cwd and constructing the validation arguments.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in #215. The plugin directory is resolved to an absolute path before deriving the child cwd and the plugin validate arguments, so a multi-segment relative path such as fixtures/plugin no longer resolves as fixtures/fixtures/plugin. Regression test asserts absolute args and correct cwd through the injectable run seam.
Run Claude's strict plugin validator through a bounded process so built bundles carry real-host evidence while missing CLIs remain explicit unavailable states.
Describe the developer-tool invocation as artifact validation so the pinned evidence matches the exposed CLI surface.
Keep the deleted-source consumer proof strict while accepting either observed Claude validation or the explicit unavailable diagnostic on hosts without the CLI.
27476a8 to
ef0fe49
Compare
Summary
claude plugin validate <bundle-dir> --strictthrough the shared bounded process runner for built Claude and unified plugin targets--strictis selected, and report missing Claude as an explicit unavailable state--plugin-dirregistration, public test-helper coverage, docs, capability evidence, and a minor changesetTest plan
pnpm buildpnpm typecheckpnpm lintAGENT_BUNDLE_PACKAGE_PREBUILT=1 pnpm test:packed:nativewith Claude Code 2.1.251 (real strict validation and inline registration observed; 6 passed, subscription eval intentionally skipped)Tracking
plugin detailsinventory projection as a follow-up under Track Claude Code plugin contract parity beyond the current adapter #187; this PR deliberately does not reimplement Claude's host-owned token costing.