feat(claude): emit plugin bin/ executables (#187 slice 1) - #282
Conversation
Add a host-scoped claude.bin directory surface that preserves authored bytes and executable modes, with capability evidence and native host validation.
🦋 Changeset detectedLatest commit: 79fa2a5 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79fa2a5bf7
ℹ️ 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".
| if (!isInside(loaded.context.projectRoot, source)) { | ||
| bins.push({ files: [], issue: 'outside', provenance: { ...provenance }, source, target: binSource.target }); |
There was a problem hiding this comment.
Resolve bin roots before checking project containment
When claude.bin names a symlink located inside the project whose target is outside it, this lexical isInside check passes and the subsequent stat/enumeration follows the symlink. Public callers of normalizeProject can therefore receive a plan that copies external files, while ProjectService fails earlier with the generic AB7003 snapshot error instead of the intended claude.bin.directory.outside diagnostic. Resolve the physical bin root and verify it remains inside the canonical project root before enumeration.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
| resolvedConfigPath, | ||
| ...(await sourcePaths(resolvedRoot, resolvedOutputRoots)), | ||
| ...(await payloadSourcePaths(resolvedRoot, payloadRoots)), | ||
| ...(await payloadSourcePaths(resolvedRoot, additionalSourceRoots)), |
There was a problem hiding this comment.
Track executable bits in bin freshness snapshots
If a bin command loses its execute bits after normalization but before emission, the plan has already passed planClaudeBin, emit.ts copies the command's current non-executable mode, and the post-build freshness check still succeeds because sourceInput records only the file path and content hash. Thus an epoch can publish a broken bare command without reporting that the source changed; include bin modes in the freshness identity or revalidate the planned executable state before publication.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
claude.binconfig surface: a project-authored directory lowered byte-for-byte into the Claude plugin-rootbin/convention (executables added to the Bash tool's PATH and invokable as bare commands while the plugin is enabled), preserving executable modes through prebuilt copy entries.binSourcehook (mirroringnativeHookSource), with containment, missing/empty/not-a-directory, and source-shape issues carried on the model and diagnosed at plan time; top-level non-executable files are a build error with achmod +xrecovery.binpayload destination (AB4741 now points authors atclaude.bin), records bin roots in the project-identity snapshot so dev rebuilds track executable changes, and acceptsbin/in artifact validation.bin) driven by new pinnedplugin.binfacts inclaude-2.1.250.json, including the documented claude.ai organization-distribution prohibition, with dated 2026-09-01 citations of https://code.claude.com/docs/en/plugins-reference and https://code.claude.com/docs/en/plugins, plus a recorded native proof against the locally observed Claude Code 2.1.257 (claude plugin validate --strictaccepts an emitted plugin with an executablebin/command). The unifiedpluginbundle keeps anunavailablebin row per the lsp intersection convention while its Claude half emits the directory; adapter revisions bumped (claude 1.6.0, plugin 1.5.0).Part of #187 slice 1 (systematic Claude host-parity pass).
Test plan
pnpm typecheckpnpm lint(0 errors, 0 warnings)