SpecBridge v0.5: local MCP server, interactive task execution, and Claude Code plugin#5
Merged
Conversation
…aude Code plugin Add packages/mcp-server: a local stdio MCP server (pinned @modelcontextprotocol/sdk 1.29.0, protocol baseline 2025-11-25) exposing the shared core packages as 21 typed tools, 7 read-only resources, and 4 workflow prompts, with the stable SBMCP001-020 error envelope, bounded paginated outputs, a per-project write mutex, stderr-only structured logging, and pinned project-root resolution. The CLI gains `mcp serve|doctor|manifest|tools` and `run recover-lock`. Add the direct interactive execution lifecycle in @specbridge/execution: task_begin -> the current host session edits source -> task_complete (plus task_abort), reusing the v0.3 Git snapshots, trusted verification commands, evidence evaluation, append-only evidence, and the verified-only surgical checkbox update. A repository-local lock file serializes runs across processes; recovery is explicit and never automatic. Run schemas gain interactive kinds and lifecycle fields, backward compatibly. Add the self-contained Claude Code plugin (integrations/claude-code-plugin/specbridge): bundled cli.cjs and mcp-server.cjs (no node_modules, no monorepo paths), POSIX and Windows CLI wrappers, eight namespaced skills (approve is human-only via disable-model-invocation), a repository-local marketplace (.claude-plugin/marketplace.json), a third-party license report, a SHA-256 checksum manifest, and a reproducible release ZIP. New scripts: build:plugin, validate:plugin, verify:plugin-bundle (mandatory isolated-copy verification), mcp:inspect. Safety: no arbitrary filesystem/shell/Git MCP tool, no model-controlled stage approval, no nested Claude invocation from plugin or MCP paths (enforced by content scans and tests), candidate hash binding between validate and apply, and no automatic Git mutations of any kind. All versions move to 0.5.0. 631 tests pass (520 regression + 111 new), plus 32 CLI smoke checks and 8 isolated bundle checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The license report generator probed a fixed list of file names with existsSync, which behaves differently across filesystems: on Windows (case-insensitive) "LICENSE.md" matched express-rate-limit's and ms's "license.md", while on Linux it did not — so the ubuntu CI rebuild produced a different THIRD_PARTY_LICENSES.txt (and checksum manifest) than the committed artifact, failing the plugin-bundle reproducibility check. Discovery now lists the package directory and matches names against a case-insensitive licen[cs]e pattern with a deterministic sort, so every platform selects the same file. The committed artifact was already the complete report (generated on the case-insensitive side); only the script needed the fix, and ubuntu now reproduces the committed bytes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
v0.5 delivers the three headline capabilities from the roadmap's Phase K and beyond, strictly as adapters over the existing core packages — no workflow, verification, Git, evidence, approval, or Markdown-writing logic is duplicated:
1. Local stdio MCP server (
packages/mcp-server)@modelcontextprotocol/sdk1.29.0 (pinned exact), stable protocol baseline 2025-11-25, stdio transport only.specbridge://…), 4 workflow prompts — every tool with versioned Zod input/output schemas, annotations, and the stableSBMCP001–SBMCP020error envelope returned as tool results (never protocol errors, never stack traces).--project-root→SPECBRIDGE_PROJECT_ROOT→CLAUDE_PROJECT_DIR→ cwd); stderr-only structured logging; per-project write mutex; request cancellation propagates to verifier child processes.specbridge mcp serve|doctor|manifest|tools.2. Direct interactive task execution
task_begin→ the current session edits source →task_complete(plustask_abort), reusing the v0.3 snapshot/verification/evidence pipeline (finalizeTaskRun) unchanged: hash-exact change attribution, protected-path detection, trusted argv-only verification commands, append-only evidence, and the verified-only one-line checkbox update..specbridge/locks/interactive-task.lock) with atomic acquisition, staleness diagnosis, and the explicitspecbridge run recover-lock [--remove]recovery command — ambiguous or live locks are never removed.interactive-execution/interactive-authoringkinds pluslifecycleStatus/host/abortReason— all optional; every v0.3 record keeps validating.3. Self-contained Claude Code plugin (
integrations/claude-code-plugin/specbridge)dist/cli.cjs+dist/mcp-server.cjs(no node_modules, no workspace resolution, no monorepo paths — committed like the GitHub Action bundle so marketplace installs work from a clone), POSIX + Windows wrappers, license report, SHA-256 checksum manifest./specbridge:doctor·status·new·author·approve·implement·continue·verify.approveisdisable-model-invocation: trueand remains the human gate;implementuses the interactive lifecycle and never launches a nested Claude process (enforced by content scans + tests)..claude-plugin/marketplace.json, strict mode) and a reproducible release ZIP.pnpm build:plugin/validate:plugin/verify:plugin-bundle(mandatory isolated-copy verification: space-containing temp dir, outside fixture project, raw JSON-RPC handshake, no-monorepo-path proof).Why
The primary UX becomes: install the plugin →
/specbridge:status→/specbridge:author→ explicit human approval →/specbridge:implement(the current session edits; MCP captures actual Git changes; trusted verification runs; the checkbox flips only when verified) →/specbridge:verify. The standalone CLI remains a first-class product and the authoritative runtime; approval is deliberately not exposed as a model-controlled MCP tool (seedocs/cli-mcp-parity.md).Verification
pnpm lint/pnpm typecheckpnpm testpnpm build/build:pluginpnpm validate:pluginpnpm verify:plugin-bundlepnpm smokemcp+recover-lockchecks)Reviewer notes
RUN_KINDSextension +runTypeForKind(core), run-record optional fields (execution),policyRelevantDirtyPathsextraction andFinalizeDepsloosening (execution),candidateAnalysisexport (execution),persistArtifactsoption onverifySpecs(drift, default unchanged).@modelcontextprotocol/sdkis also a root devDependency (pinned) for the root-level test suite's in-memory client.claude --plugin-dirinside a live Claude Code session (needs an interactive host); everything headlessly testable is covered by the isolated bundle verification, and the docs describe the manual check.🤖 Generated with Claude Code