Skip to content

Commit 94fd7e4

Browse files
SpecBridge v0.6.0: capability-driven runner platform, Codex CLI and Ollama runners (#6)
Add the capability-driven runner platform with a frozen adapter contract: versioned capability/operation/event/result/error/usage schemas (17 capability keys, 6 operations, 24 error codes, snapshot-tested), runner categories and support levels, and a profile-based registry with deterministic capability-checked selection that refuses incompatible operations before any process spawn, HTTP request, run record, or file change. Configuration gains a v2 multi-runner schema (runnerProfiles, operationDefaults, runnerPolicy, fallbacks) with URL/command/credential safety rules. v1 files stay fully readable through a version-transparent reader; migration is explicit only ("config doctor", "config migrate --dry-run|--apply") — atomic, backed up, validated, Claude behavior preserved, new providers left disabled, trusted verification commands untouched. New production adapters: - codex-cli: read-only probes (never a model request, never credential files), JSONL event normalization with reasoning redaction, JSON Schema structured output, read-only sandbox for authoring, workspace-write for task execution (unrestricted modes rejected at three layers), explicit-session resume, full failure classification. - ollama: authoring-only model API (loopback default, HTTPS-by-default for remote, redirects refused), model listing without inference, schema-validated structured output with ONE bounded correction retry, input/output limits, thinking-content redaction; task execution refused by capability. The existing Claude Code runner implements the shared contract unchanged (same process safety, permission modes, resume, prompts, configuration semantics). Authoring supports explicitly configured bounded fallback chains with append-only per-invocation attempt records (.specbridge/runs/<id>/attempts/); task execution never retries or switches providers. A reusable conformance framework (detection/structured-output/process-control/authoring/task/resume, chosen by declared capabilities) backs every production claim; mock, claude-code (fake), and codex-cli (fake) pass all applicable groups, ollama passes the authoring groups only. CLI: runner list/matrix/show/doctor/test/conformance/models, config doctor/migrate, --show-runner-plan, runner plans in dry runs. Provider claims remain informational; Git snapshots and trusted verification stay the only completion authority. Tests: 772 total (60 files) including a process-level fake Codex CLI and a real loopback fake Ollama HTTP server; no real providers, network, models, or credentials in CI. All v0.1-v0.5 suites pass unchanged; lint, typecheck, build, plugin build/validate, and isolated plugin verification pass; versions consistently 0.6.0. Gemini CLI, OpenAI-compatible, Antigravity, MCP runner tools, and the runner Skill are deferred to v0.6.1 (documented, not stubbed). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 2ea69a4 commit 94fd7e4

102 files changed

Lines changed: 20079 additions & 1881 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "specbridge",
1010
"source": "./integrations/claude-code-plugin/specbridge",
1111
"description": "Kiro-compatible spec workflows, verified interactive task execution, and deterministic drift checks.",
12-
"version": "0.5.0",
12+
"version": "0.6.0",
1313
"license": "MIT",
1414
"keywords": [
1515
"spec-driven-development",

CHANGELOG.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,140 @@
11
# Changelog
22

3+
## 0.6.0
4+
5+
Added:
6+
7+
- Capability-driven runner platform: core orchestration selects and gates
8+
runners by DECLARED CAPABILITIES (17 stable keys), never by provider
9+
names. Runner categories (`agent-cli`, `model-api`, `mock`,
10+
`experimental`) and support levels (`production`, `preview`,
11+
`experimental`, `unavailable`, `incompatible`) are explicit everywhere.
12+
- Versioned, FROZEN runner adapter contract for v0.6.1
13+
(docs/runner-adapter-contract.md) with snapshot tests guarding categories,
14+
support levels, operation names, capability keys, normalized outcomes,
15+
normalized error codes, event types, and required adapter methods — plus a
16+
minimal-adapter test proving new providers register without core changes.
17+
- Operation-specific capability validation: `stage-generation`,
18+
`stage-refinement`, `task-execution`, `task-resume`, `model-list`,
19+
`runner-test`, each with required capabilities and (for execution) a
20+
required safe boundary (`sandbox` OR the documented `toolRestriction`
21+
equivalent). Incompatible selections stop BEFORE any process spawn, HTTP
22+
request, run record, or file change, and list the missing capabilities and
23+
compatible configured profiles.
24+
- Normalized provider events (17 types, size-limited flat payloads, no
25+
reasoning content), normalized execution results (13 outcomes), normalized
26+
runner errors (24 stable codes with safe messages, remediation, and
27+
retryability), and normalized usage/cost metadata (cost is
28+
provider-reported, configured-estimate, or unavailable — never computed
29+
from hardcoded pricing; local Ollama reports `unavailable`, not zero).
30+
- Versioned runner profiles (configuration schema 2.0.0): named
31+
configurations of implementations (`codex-default`, `codex-fast`,
32+
`ollama-qwen`, …) with per-profile executable/endpoint, model, timeout,
33+
sandbox, and output limits; unique names; unknown implementations
34+
rejected.
35+
- Configuration migration tools: `specbridge config doctor` (read-only) and
36+
`specbridge config migrate --dry-run|--apply` (atomic write, recoverable
37+
`config.v1.backup.json`, validated result). The v1 schema remains fully
38+
readable before explicit migration; migration preserves the Claude Code
39+
default behavior and trusted verification commands, adds Codex/Ollama
40+
profiles DISABLED, and creates no credentials.
41+
- Deterministic runner selection with precedence explicit `--runner`
42+
operation default → global default, a capability-checked selection plan
43+
(`--show-runner-plan`, dry-run output), and network-policy enforcement
44+
(network-backed profiles are never selected implicitly).
45+
- Explicit authoring fallback policy: per-operation chains
46+
(`fallbacks.stageGeneration/.stageRefinement`), bounded correction and
47+
transport retries, and hard stop conditions (auth/permission/config
48+
failures, cancellation, quota, repository modification, real results).
49+
Disabled by default; never during task execution or resume.
50+
- Generated runner capability matrix: `specbridge runner matrix`
51+
(`--json`, `--markdown`) from registered runner metadata; plus
52+
`runner show <profile>`, `runner test <profile> [--network]`,
53+
`runner conformance <profile> [--network]`, and
54+
`runner models <profile>`.
55+
- Reusable runner conformance framework (detection, structured-output,
56+
process-control, stage-generation, stage-refinement, task-execution,
57+
resume) with capability-derived applicability; a runner is production only
58+
when every applicable group passes. Conformance uses throwaway fixture
59+
workspaces, requires `--network` for real-provider invocations, and runs
60+
fully against fake providers in CI.
61+
- Production Codex CLI runner (`codex-cli`): read-only probes for
62+
version/help/`exec --help`/`login status` (never a model request, never
63+
credential files), JSONL event capture and normalization, JSON Schema
64+
structured output with strict validation, read-only sandbox for authoring,
65+
workspace-write sandbox for task execution, explicit-session resume
66+
(`codex exec resume <id>`, never "latest"), and full failure
67+
classification (auth, permission, sandbox, quota, rate limit, timeout,
68+
cancellation, output limits).
69+
- Production Ollama authoring runner (`ollama`): loopback-default native
70+
HTTP API with strict URL safety (no credentials in URLs, no file/ftp
71+
schemes, HTTPS-by-default for remote endpoints with a labeled insecure
72+
development override, redirects never followed), model listing without
73+
inference, schema-validated non-streaming structured output at
74+
temperature 0, ONE bounded correction retry, input/output size limits,
75+
thinking-content redaction, and task execution refused by capability
76+
before any request.
77+
- Append-only per-invocation attempt records under
78+
`.specbridge/runs/<run-id>/attempts/<attempt-id>/`: capability snapshot,
79+
operation, local/network boundary, model, normalized events and result,
80+
process observation, error classification, and fallback lineage. Failed
81+
attempts (including invalid structured-output candidates) are retained.
82+
- Fake-provider test infrastructure: a process-level fake Codex CLI
83+
(26 scenarios) and a real loopback fake Ollama HTTP server (20 scenarios);
84+
CI needs no real providers, no network, no models, no credentials.
85+
86+
Changed:
87+
88+
- The existing Claude Code runner now implements the shared capability
89+
contract (category `agent-cli`, declared capability set, detection-derived
90+
support level) with its v0.3–v0.5 behavior, process safety, permission
91+
modes, resume, structured-output validation, and configuration semantics
92+
preserved unchanged.
93+
- Runner selection validates operation capabilities before execution; task
94+
execution is restricted to compatible agent CLI runners and model API
95+
runners are authoring-only.
96+
- Provider output is normalized (events, results, errors, usage) before it
97+
enters shared orchestration; run records now reference per-attempt
98+
capability snapshots and attempt metadata.
99+
- The shared prompt contract (v1.1.0) parameterizes repository access:
100+
agent CLIs receive read-only repository tools for authoring; model APIs
101+
receive an explicit no-repository-access variant. The same core safety
102+
sections appear for every provider (tested for semantic equivalence).
103+
- `runner list`/`doctor`/`show` are profile-based; the v0.3 `unsupported`
104+
stub registrations (codex/ollama/openai-compatible) were replaced by real
105+
disabled-by-default profiles, and deferred providers are no longer
106+
registered at all.
107+
108+
Security:
109+
110+
- No provider credentials stored; credential-looking configuration keys are
111+
rejected; no credential-file parsing anywhere.
112+
- No automatic paid or network-provider selection; no automatic
113+
task-execution fallback or provider switching.
114+
- No unrestricted Codex execution mode (`danger-full-access`, bypass flags,
115+
and repo-check skips rejected at three layers).
116+
- No source editing by Ollama (no repository access by construction).
117+
- No provider claims treated as task evidence; Git snapshots and trusted
118+
verification remain the only completion authority.
119+
- No shell interpolation for runner commands (argv arrays only, both
120+
schemas).
121+
- Explicit local and network data boundaries in every plan and attempt
122+
record; provider reasoning content never exposed; provider event payloads
123+
size-limited.
124+
125+
Deferred to v0.6.1:
126+
127+
- Gemini CLI runner.
128+
- OpenAI-compatible authoring runner.
129+
- Antigravity capability adapter.
130+
- MCP runner diagnostics.
131+
- Claude Code runner-management Skill (`/specbridge:runners`).
132+
133+
Deferred to v0.7:
134+
135+
- Templates, plugin SDK, runner extension SDK distribution, analyzer and
136+
verifier SDKs, extension registry, community ecosystem.
137+
3138
## 0.5.0
4139

5140
Added:

README.md

Lines changed: 107 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,46 @@ Codex, local models, or any supported coding agent.
1414
1515
> Your `.kiro` specs remain the source of truth.
1616
17-
New in v0.5 — a self-contained **Claude Code plugin** with a local MCP
17+
New in v0.6 — keep your existing `.kiro` specs and **choose a compatible
18+
coding agent or authoring model per operation**:
19+
20+
```text
21+
Spec authoring Task execution
22+
Claude Code ✓ ✓
23+
Codex CLI ✓ ✓
24+
Ollama ✓ —
25+
```
26+
27+
```bash
28+
specbridge runner matrix
29+
30+
specbridge spec generate notification-preferences \
31+
--stage requirements \
32+
--runner ollama-local
33+
34+
specbridge spec generate notification-preferences \
35+
--stage design \
36+
--runner codex-default
37+
38+
specbridge spec run notification-preferences \
39+
--task 2.3 \
40+
--runner codex-default
41+
```
42+
43+
Runner behavior is capability-driven: authoring-only model APIs (Ollama)
44+
can never execute tasks, task execution needs a safe sandbox or tool
45+
restriction, network-backed endpoints are never selected implicitly, and
46+
whatever runs, task completion still requires actual Git evidence plus
47+
trusted verification — never a provider claim. The live matrix above is
48+
generated from registered runner metadata (`specbridge runner matrix`); not
49+
every installed Codex version is compatible (`specbridge runner doctor
50+
codex-default` reports the exact capabilities).
51+
52+
SpecBridge does not include provider subscriptions, hosted models, API
53+
usage, or authentication — you install and authenticate Claude Code, the
54+
Codex CLI, or Ollama yourself. See [docs/runners.md](docs/runners.md).
55+
56+
From v0.5 — a self-contained **Claude Code plugin** with a local MCP
1857
server and verified interactive task execution:
1958

2059
```text
@@ -214,6 +253,9 @@ Working today (fully offline, no model, no API key):
214253
| `specbridge verify rules / explain <id>` | **v0.4** — inspect the stable rule registry SBV001–SBV025 |
215254
| `specbridge mcp serve / doctor / manifest / tools` | **v0.5** — local stdio MCP server (21 tools, 7 resources, 4 prompts) |
216255
| `specbridge run recover-lock` | **v0.5** — diagnose and explicitly recover the interactive execution lock |
256+
| `specbridge runner list / matrix / show / doctor` | **v0.6** — profile-based runner diagnostics and the generated capability matrix (read-only) |
257+
| `specbridge runner test / conformance / models <profile>` | **v0.6** — bounded structured-output probe (`--network`), conformance suite, provider-supported model listing |
258+
| `specbridge config doctor / migrate` | **v0.6** — configuration validation and the explicit v1 → v2 migration (dry-run by default, atomic apply with backup) |
217259

218260
Planned commands (`spec sync/export`) are registered, marked "(planned)" in
219261
`--help`, and exit with an honest error — see the [roadmap](docs/roadmap.md).
@@ -317,25 +359,27 @@ by `spec approve` — see [docs/approval-workflow.md](docs/approval-workflow.md)
317359
Runner-assisted generation (since v0.3) is always explicit opt-in; offline
318360
templates remain the default.
319361

320-
## Model-assisted authoring and task execution (v0.3)
362+
## Model-assisted authoring and task execution (v0.3, multi-runner since v0.6)
321363

322-
With a locally installed, locally authenticated Claude Code CLI (or the
323-
offline mock runner), SpecBridge can draft spec stages and execute approved
324-
tasks — with the safety model doing the real work:
364+
With a locally installed, locally authenticated agent CLI (Claude Code or
365+
Codex), a local Ollama endpoint for authoring, or the offline mock runner,
366+
SpecBridge can draft spec stages and execute approved tasks — with the
367+
safety model doing the real work:
325368

326369
```sh
327370
specbridge runner doctor claude-code
371+
specbridge runner matrix
328372

329-
specbridge spec generate notification-preferences --stage requirements
373+
specbridge spec generate notification-preferences --stage requirements --runner ollama-local
330374
specbridge spec analyze notification-preferences --stage requirements
331375
specbridge spec approve notification-preferences --stage requirements
332376

333-
specbridge spec generate notification-preferences --stage design
377+
specbridge spec generate notification-preferences --stage design --runner codex-default
334378
specbridge spec approve notification-preferences --stage design
335379
specbridge spec generate notification-preferences --stage tasks
336380
specbridge spec approve notification-preferences --stage tasks
337381

338-
specbridge spec run notification-preferences --task 2.3
382+
specbridge spec run notification-preferences --task 2.3 --runner codex-default
339383
specbridge run show <run-id>
340384
```
341385

@@ -451,19 +495,26 @@ CI for this repository runs on Linux, macOS, and Windows with Node 20/22.
451495
## Supported runners
452496

453497
Runners make SpecBridge model- and agent-agnostic. Default commands never
454-
require one.
455-
456-
| Runner | Status |
457-
| --- | --- |
458-
| `mock` | ✅ Implemented — offline, deterministic, scenario-driven, used by CI |
459-
| `claude-code` | ✅ **v0.3** — local CLI runner: generation, refinement, task execution, resume |
460-
| `codex` | ❌ Stub — honestly not implemented (roadmap) |
461-
| `ollama` | ❌ Stub — honestly not implemented |
462-
| `openai-compatible` | ❌ Stub — honestly not implemented |
463-
464-
Configuration lives in `.specbridge/config.json`
465-
([docs/agent-runners.md](docs/agent-runners.md)). Never commit API keys;
466-
SpecBridge stores no credentials of any kind.
498+
require one. Since v0.6, runners are configured as capability-checked
499+
PROFILES; the live matrix comes from `specbridge runner matrix`:
500+
501+
| Profile | Support | Author | Refine | Execute | Resume | Local |
502+
|---------|---------|--------|--------|---------|--------|-------|
503+
| claude-code | production | yes | yes | yes | yes | no |
504+
| codex-default | production | yes | yes | yes | yes | no |
505+
| ollama-local | production | yes | yes | no | no | yes |
506+
| mock | production | yes | yes | yes | yes | yes |
507+
508+
`codex-default` and `ollama-local` ship DISABLED until you enable them
509+
explicitly. Ollama is authoring-only by capability — it can never execute
510+
tasks or modify files. Gemini CLI, an OpenAI-compatible authoring runner,
511+
and Antigravity are planned for v0.6.1 (no placeholders are registered).
512+
513+
Configuration lives in `.specbridge/config.json` (schema 2.0.0; v1 files
514+
stay readable, migration is explicit — see
515+
[docs/configuration-migration.md](docs/configuration-migration.md) and
516+
[docs/runners.md](docs/runners.md)). Never commit API keys; SpecBridge
517+
stores no credentials of any kind.
467518

468519
## Security and privacy
469520

@@ -479,7 +530,7 @@ SpecBridge stores no credentials of any kind.
479530
secrets or environment variables.
480531
- Full model: [docs/security.md](docs/security.md).
481532

482-
## Limitations (v0.5)
533+
## Limitations (v0.6)
483534

484535
- The MCP server is stdio-only and local-only: no HTTP/SSE/WebSocket
485536
transport, no OAuth, no cloud hosting. One server process serves one
@@ -500,8 +551,18 @@ SpecBridge stores no credentials of any kind.
500551
references, chore-task exclusion) are labelled and never default to error.
501552
- `spec sync` and `spec export` are not implemented yet (they fail
502553
honestly). SARIF output is deferred.
503-
- Claude Code is the only production runner; codex/ollama/openai-compatible
504-
remain stubs. Claude usage happens under your own account and plan.
554+
- Production runners are claude-code, codex-cli, ollama (authoring-only),
555+
and mock. Gemini CLI, OpenAI-compatible, and Antigravity are deferred to
556+
v0.6.1 and are not registered as placeholders. Provider usage happens
557+
under your own accounts and plans; not every installed Codex version is
558+
compatible (the doctor reports the exact missing capabilities).
559+
- Ollama cannot execute tasks or modify files — by capability, not by
560+
configuration. Models are never pulled or selected automatically.
561+
- Codex resume needs an installed version with explicit session resume;
562+
without it, resume is reported unsupported instead of guessed.
563+
- Authoring fallback exists only for explicitly configured chains, only for
564+
stage generation/refinement, with bounded retries; there is no automatic
565+
provider switching anywhere else.
505566
- Task execution requires a git repository, sidecar workflow state, and
506567
fully approved stages — by design; there is no force flag.
507568
- Tasks can only auto-verify when verification commands are configured;
@@ -535,10 +596,15 @@ git snapshots, trusted verification, append-only evidence, verified-only
535596
checkbox completion, manual acceptance, resumable sessions. v0.4:
536597
deterministic drift verification (rule engine SBV001–SBV025, policies,
537598
affected-spec resolution, evidence freshness, four report formats) and the
538-
production GitHub Action. v0.5 (this release): the local stdio MCP server,
539-
direct interactive task execution, and the self-contained Claude Code
540-
plugin with its repository-local marketplace. Next — v0.6: production
541-
multi-runner support. v0.7: templates, plugin SDK, extension registry,
599+
production GitHub Action. v0.5: the local stdio MCP server, direct
600+
interactive task execution, and the self-contained Claude Code plugin with
601+
its repository-local marketplace. v0.6.0 (this release): the
602+
capability-driven runner platform with a frozen adapter contract, runner
603+
profiles and explicit configuration migration, deterministic selection and
604+
bounded authoring fallback, the conformance framework, and the production
605+
Codex CLI and Ollama (authoring-only) runners. Next — v0.6.1: Gemini CLI,
606+
OpenAI-compatible authoring, Antigravity, MCP runner diagnostics, and the
607+
runner-management Skill. v0.7: templates, plugin SDK, extension registry,
542608
community ecosystem. Full detail: [docs/roadmap.md](docs/roadmap.md).
543609

544610
## Documentation
@@ -549,6 +615,19 @@ community ecosystem. Full detail: [docs/roadmap.md](docs/roadmap.md).
549615
[Spec analysis](docs/spec-analysis.md) ·
550616
[Approval workflow](docs/approval-workflow.md) ·
551617
[Sidecar state](docs/sidecar-state.md) ·
618+
[Runners (v0.6)](docs/runners.md) ·
619+
[Runner capabilities](docs/runner-capabilities.md) ·
620+
[Runner profiles](docs/runner-profiles.md) ·
621+
[Runner selection](docs/runner-selection.md) ·
622+
[Runner fallback](docs/runner-fallback.md) ·
623+
[Runner conformance](docs/runner-conformance.md) ·
624+
[Runner adapter contract](docs/runner-adapter-contract.md) ·
625+
[Codex CLI runner](docs/codex-cli-runner.md) ·
626+
[Ollama runner](docs/ollama-runner.md) ·
627+
[Network & data boundaries](docs/network-data-boundaries.md) ·
628+
[Runner security](docs/runner-security.md) ·
629+
[Runner troubleshooting](docs/runner-troubleshooting.md) ·
630+
[Configuration migration](docs/configuration-migration.md) ·
552631
[Agent runners](docs/agent-runners.md) ·
553632
[Claude Code runner](docs/claude-code-runner.md) ·
554633
[Model-assisted authoring](docs/model-assisted-authoring.md) ·

docs/agent-runners.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ Runners make SpecBridge model- and agent-agnostic: a runner wraps one way of
44
invoking an AI coding agent. Default SpecBridge commands never require one;
55
runner execution is always explicit.
66

7-
## The contract (v0.3)
7+
> **v0.6:** runners are now selected through capability-checked PROFILES
8+
> (`claude-code`, `codex-default`, `ollama-local`, `mock`) with a frozen
9+
> adapter contract. Start at **[runners.md](runners.md)**; this page keeps
10+
> the v0.3 execution-contract fundamentals, which are unchanged.
11+
12+
## The contract (v0.3 core, extended by v0.6 capabilities)
813

914
Every runner implements the same model-agnostic contract
1015
(`@specbridge/runners`):
@@ -25,8 +30,10 @@ orchestration lives in `@specbridge/execution` and evidence evaluation in
2530
### Runner kinds and statuses
2631

2732
Kinds: `mock` (offline, deterministic), `claude-code` (local Claude Code
28-
CLI), `unsupported` (honest stubs: `codex`, `ollama`, `openai-compatible`
29-
documented on the [roadmap](roadmap.md), not implemented, never faked).
33+
CLI), `codex-cli` (local Codex CLI, v0.6), and `ollama` (local model API,
34+
authoring-only, v0.6). The v0.3-era `unsupported` stubs are gone — deferred
35+
providers (Gemini CLI, OpenAI-compatible, Antigravity) exist only on the
36+
[roadmap](roadmap.md) and are not registered as placeholders.
3037

3138
Detection statuses: `available`, `unavailable`, `unauthenticated`,
3239
`incompatible`, `misconfigured`, `error`. Only `available` permits

0 commit comments

Comments
 (0)