Skip to content

Commit e9a9997

Browse files
committed
chore: update project files
1 parent dd75c30 commit e9a9997

14 files changed

Lines changed: 1424 additions & 2 deletions

File tree

.specsmith/requirements.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,5 +3202,15 @@
32023202
"test_ids": [
32033203
"TEST-363"
32043204
]
3205+
},
3206+
{
3207+
"id": "REQ-363",
3208+
"title": "specsmith mcp serve: native stdio MCP server exposing governance tools to Warp, Cursor, and Claude Code agents",
3209+
"description": "specsmith exposes an MCP-compliant stdio server via 'specsmith mcp serve'. The server implements JSON-RPC 2.0 over stdin/stdout and offers six governance tools: governance_audit, governance_checkpoint, governance_preflight, governance_phase, governance_req_list, and governance_trace_seal. Any MCP client (Warp/Oz, Cursor, Claude Code) can add specsmith as a tool server and call governance commands as structured tool calls without shell roundtrips. A companion 'specsmith mcp install-warp' command prints the Warp MCP config snippet.",
3210+
"source": "docs/requirements/",
3211+
"status": "planned",
3212+
"test_ids": [
3213+
"TEST-364"
3214+
]
32053215
}
32063216
]

.specsmith/testcases.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3562,5 +3562,16 @@
35623562
"input": {},
35633563
"expected_behavior": {},
35643564
"confidence": 1.0
3565+
},
3566+
{
3567+
"id": "TEST-364",
3568+
"title": "specsmith mcp serve starts a stdio MCP server that responds to initialize, tools/list, and tools/call for all six governance tools",
3569+
"description": "",
3570+
"requirement_id": "REQ-363",
3571+
"type": "unit",
3572+
"verification_method": "pytest tests/test_mcp_server.py — tests drive the server via subprocess with JSON-RPC messages and assert structured responses for each tool",
3573+
"input": {},
3574+
"expected_behavior": {},
3575+
"confidence": 1.0
35653576
}
35663577
]

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.12.0] - 2026-06-01
9+
10+
### Added
11+
12+
- **Native MCP governance server** (`specsmith mcp serve`, REQ-363): a zero-dependency stdio MCP server implementing JSON-RPC 2.0 (MCP 2024-11-05). Exposes six structured tools to any MCP client — Warp/Oz, Cursor, Claude Code, or any IDE that supports the Model Context Protocol:
13+
- `governance_audit` — run the full governance audit, returns structured health JSON
14+
- `governance_checkpoint` — emit the GOVERNANCE ANCHOR JSON (phase, health, REQ/TEST counts, ESDB chain)
15+
- `governance_preflight` — preflight a change intent, returns decision + work_item_id
16+
- `governance_phase` — current AEE phase, readiness %, and failing checks
17+
- `governance_req_list` — list all requirements with coverage status, filterable by status
18+
- `governance_trace_seal` — seal a milestone or decision in the cryptographic trace vault
19+
- **`specsmith mcp install-warp`**: prints the Warp MCP config JSON snippet for one-paste setup. Add to **Settings → Agents → MCP servers** or pass inline to `oz agent run --mcp`.
20+
- **Warp repository workflows** (`.warp/workflows/`, REQ-362): seven `Ctrl+Shift+R`-searchable workflow YAML files for Warp terminal — Session Start, Audit, Checkpoint, Preflight, Save, Phase Status, Session End.
21+
- **`specsmith-session-governance` skill**: drift prevention, heartbeat, and preflight gate for Oz/AI sessions. Auto-discovered from `.agents/skills/`.
22+
- **`release-pilot` skill**: gitflow release-cut workflow for the Release phase.
23+
- **REQ-362** (Warp terminal integration) and **REQ-363** (MCP governance server) with corresponding test cases TEST-363 and TEST-364.
24+
- `tests/test_mcp_server.py`: 20 new pytest cases covering the MCP protocol handshake, all six tool handlers, error paths, and CLI subprocess smoke tests.
25+
26+
### Changed
27+
28+
- Version bumped from `0.11.8` to `0.12.0` (significant new capability: native MCP server).
29+
830
## [0.11.8] - 2026-05-30
931

1032
### Added

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ specsmith treats belief systems like code: codable, testable, and deployable. It
1515
epistemically-governed projects, stress-tests requirements as BeliefArtifacts, runs
1616
cryptographically-sealed trace vaults, and orchestrates AI agents under formal AEE governance.
1717

18-
**v0.11.4Codity.ai AI code review integration, 70 built-in skills, EU AI Act / NIST AI RMF compliance, context window management, and governance tools panel.**
18+
**v0.12.0Native Warp/Oz MCP governance server, repository workflows, 72 built-in skills, EU AI Act / NIST AI RMF compliance, multi-agent DAG dispatch, and context window management.**
1919
Specsmith ships a full compliance and auditability layer aligned to the EU AI Act (2024/1689)
2020
and the NIST AI Risk Management Framework 1.0. Every agent action is cryptographically sealed,
2121
every AI-generated output is disclosed, context windows are GPU-aware and protected against
@@ -922,6 +922,59 @@ oz agent run-cloud --skill "layer1labs/specsmith:specsmith-save" --prompt "save
922922

923923
---
924924

925+
## Warp Terminal Integration (v0.12.0)
926+
927+
specsmith ships native integration with [Warp](https://www.warp.dev) terminal — both as
928+
an MCP server and as repository workflows.
929+
930+
### Native MCP Governance Server
931+
932+
`specsmith mcp serve` starts a zero-dependency stdio MCP server (JSON-RPC 2.0, MCP 2024-11-05).
933+
Warp/Oz, Cursor, Claude Code, or any other MCP client can call governance commands as structured
934+
tool calls — no shell roundtrip, fully typed inputs and outputs.
935+
936+
**Setup (one time):**
937+
938+
```bash
939+
# Get the Warp config snippet
940+
specsmith mcp install-warp
941+
```
942+
943+
Copy the output JSON into **Warp Settings → Agents → MCP servers**. Or pass it inline:
944+
945+
```bash
946+
oz agent run --mcp '{"specsmith-governance": {"command": "specsmith", "args": ["mcp", "serve"]}}' \
947+
--prompt "check governance health and preflight my next change"
948+
```
949+
950+
**Six MCP tools exposed:**
951+
952+
| Tool | What it returns |
953+
|---|---|
954+
| `governance_audit` | Full audit health JSON — passed/failed checks, fixable count |
955+
| `governance_checkpoint` | GOVERNANCE ANCHOR snapshot — phase, health, REQ/TEST counts, ESDB chain |
956+
| `governance_preflight` | Preflight decision — `accepted`/`needs_clarification` + `work_item_id` |
957+
| `governance_phase` | Current AEE phase, readiness %, failing checks |
958+
| `governance_req_list` | All requirements with status + test coverage, filterable |
959+
| `governance_trace_seal` | Create a cryptographic trace vault seal |
960+
961+
### Repository Workflows (Ctrl+Shift+R)
962+
963+
Clone this repo and open it in Warp — seven governance workflows appear automatically in
964+
`Ctrl+Shift+R` search:
965+
966+
| Workflow | Command |
967+
|---|---|
968+
| specsmith — Session Start | Full bootstrap: kill → migrate → audit → sync → checkpoint |
969+
| specsmith — Audit | `specsmith audit` |
970+
| specsmith — Checkpoint | `specsmith checkpoint` (emits GOVERNANCE ANCHOR) |
971+
| specsmith — Preflight | `specsmith preflight "{{intent}}" --json` |
972+
| specsmith — Save | `specsmith save` |
973+
| specsmith — Phase Status | `specsmith phase show` |
974+
| specsmith — Session End | `specsmith save && specsmith kill-session` |
975+
976+
---
977+
925978
## The specsmith Bootstrap
926979

927980
specsmith governs itself — the specsmith repo is a specsmith-managed project. Run `specsmith audit`

docs/REQUIREMENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,3 +2562,11 @@
25622562
- **Source:** docs/requirements/
25632563
- **Test_Ids:** ['TEST-363']
25642564

2565+
## REQ-363. specsmith mcp serve: native stdio MCP server exposing governance tools to Warp, Cursor, and Claude Code agents
2566+
- **ID:** REQ-363
2567+
- **Title:** specsmith mcp serve: native stdio MCP server exposing governance tools to Warp, Cursor, and Claude Code agents
2568+
- **Description:** specsmith exposes an MCP-compliant stdio server via 'specsmith mcp serve'. The server implements JSON-RPC 2.0 over stdin/stdout and offers six governance tools: governance_audit, governance_checkpoint, governance_preflight, governance_phase, governance_req_list, and governance_trace_seal. Any MCP client (Warp/Oz, Cursor, Claude Code) can add specsmith as a tool server and call governance commands as structured tool calls without shell roundtrips. A companion 'specsmith mcp install-warp' command prints the Warp MCP config snippet.
2569+
- **Status:** planned
2570+
- **Source:** docs/requirements/
2571+
- **Test_Ids:** ['TEST-364']
2572+

docs/TESTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,3 +3042,11 @@
30423042
- **Verification Method:** Open Warp in project directory, press Ctrl+Shift+R, search 'specsmith'; confirm Session Start, Audit, Checkpoint, Preflight, Save, Phase, and Session End workflows appear.
30433043
- **Confidence:** 1.0
30443044

3045+
## TEST-364. specsmith mcp serve starts a stdio MCP server that responds to initialize, tools/list, and tools/call for all six governance tools
3046+
- **ID:** TEST-364
3047+
- **Title:** specsmith mcp serve starts a stdio MCP server that responds to initialize, tools/list, and tools/call for all six governance tools
3048+
- **Requirement ID:** REQ-363
3049+
- **Type:** unit
3050+
- **Verification Method:** pytest tests/test_mcp_server.py — tests drive the server via subprocess with JSON-RPC messages and assert structured responses for each tool
3051+
- **Confidence:** 1.0
3052+

docs/requirements/yaml_governance.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,3 +597,14 @@
597597
description: The specsmith repository ships .warp/workflows/ YAML files so developers
598598
using Warp terminal can invoke governance commands (audit, checkpoint, preflight,
599599
save, session-start) directly from the Warp command palette without context-switching.
600+
- id: REQ-363
601+
title: 'specsmith mcp serve: native stdio MCP server exposing governance tools to
602+
Warp, Cursor, and Claude Code agents'
603+
status: planned
604+
description: 'specsmith exposes an MCP-compliant stdio server via ''specsmith mcp
605+
serve''. The server implements JSON-RPC 2.0 over stdin/stdout and offers six governance
606+
tools: governance_audit, governance_checkpoint, governance_preflight, governance_phase,
607+
governance_req_list, and governance_trace_seal. Any MCP client (Warp/Oz, Cursor,
608+
Claude Code) can add specsmith as a tool server and call governance commands as
609+
structured tool calls without shell roundtrips. A companion ''specsmith mcp install-warp''
610+
command prints the Warp MCP config snippet.'

docs/site/warp-integration.md

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# Warp Terminal Integration
2+
3+
specsmith v0.12.0 ships native integration with [Warp](https://www.warp.dev) terminal at two levels:
4+
5+
1. **MCP governance server** — Warp/Oz (and any MCP client) can call governance commands as structured tool calls without shell roundtrips.
6+
2. **Repository workflows** — seven `Ctrl+Shift+R`-searchable workflows appear automatically when you open this repo in Warp.
7+
8+
---
9+
10+
## Native MCP Server Setup
11+
12+
### What it does
13+
14+
`specsmith mcp serve` starts a zero-dependency MCP server (JSON-RPC 2.0, protocol pin 2024-11-05) over stdio. Once configured in Warp, Oz can call any of six governance tools natively — getting back structured JSON, not terminal output.
15+
16+
### One-time setup
17+
18+
**Step 1:** Get the config snippet:
19+
20+
```bash
21+
specsmith mcp install-warp
22+
```
23+
24+
Output:
25+
```json
26+
{
27+
"specsmith-governance": {
28+
"command": "specsmith",
29+
"args": ["mcp", "serve", "--project-dir", "/path/to/your/project"]
30+
}
31+
}
32+
```
33+
34+
**Step 2:** Open **Warp → Settings → Agents → MCP servers** and paste the JSON.
35+
36+
After saving, Warp/Oz will show `specsmith-governance` as an available tool server. Oz will call governance commands automatically when they are relevant to the task.
37+
38+
### Using with oz agent run (inline)
39+
40+
For one-off cloud agent runs, pass the config inline:
41+
42+
```bash
43+
oz agent run \
44+
--mcp '{"specsmith-governance": {"command": "specsmith", "args": ["mcp", "serve"]}}' \
45+
--prompt "check governance health, run a preflight for my next change, and report what phase we are in"
46+
```
47+
48+
---
49+
50+
## MCP Tools Reference
51+
52+
| Tool | Description | Required inputs | Returns |
53+
|---|---|---|---|
54+
| `governance_audit` | Run the full governance audit | `project_dir` (optional) | `healthy`, `passed`, `failed`, `checks[]` |
55+
| `governance_checkpoint` | Emit GOVERNANCE ANCHOR snapshot | `project_dir` (optional) | `anchor`, `phase`, `health`, `req_count`, `test_count`, `esdb_chain_valid`, `recent_work_items` |
56+
| `governance_preflight` | Preflight a proposed change | `intent` (required), `project_dir` | `decision`, `work_item_id`, `instruction` |
57+
| `governance_phase` | Current AEE phase + readiness | `project_dir` (optional) | `phase`, `label`, `pct`, `failing_checks` |
58+
| `governance_req_list` | List all requirements | `project_dir`, `status_filter` | `total`, `covered`, `reqs[]` |
59+
| `governance_trace_seal` | Seal a milestone or decision | `seal_type`, `description`, `project_dir` | `sealed`, `seal_id`, `entry_hash` |
60+
61+
### governance_audit
62+
63+
Returns a complete governance health picture. Oz uses this to decide whether to proceed with a change.
64+
65+
```json
66+
{
67+
"healthy": true,
68+
"passed": 27,
69+
"failed": 0,
70+
"fixable": 0,
71+
"suppressed": 0,
72+
"checks": [
73+
{"name": "file-exists:AGENTS.md", "passed": true, "message": "Required file AGENTS.md exists"},
74+
...
75+
]
76+
}
77+
```
78+
79+
### governance_checkpoint
80+
81+
Emits the GOVERNANCE ANCHOR — include this verbatim in any context summary. Oz calls this automatically every 8–10 turns via the `specsmith-session-governance` skill.
82+
83+
```json
84+
{
85+
"anchor": "SPECSMITH-ANCHOR-2026-06-01T20:00:00Z",
86+
"project": "specsmith",
87+
"phase": "release",
88+
"phase_label": "🚀 Release",
89+
"phase_pct": 100,
90+
"health": "clean",
91+
"req_count": 321,
92+
"test_count": 325,
93+
"esdb_chain_valid": true,
94+
"recent_work_items": ["WI-7320B3C9"]
95+
}
96+
```
97+
98+
### governance_preflight
99+
100+
Gate every code change through this. Returns `accepted` + `work_item_id` to proceed, or `needs_clarification` with an instruction to refine the intent.
101+
102+
```json
103+
{
104+
"decision": "accepted",
105+
"work_item_id": "WI-7320B3C9",
106+
"instruction": "Change request matched existing governance scope. Proceed under Specsmith verification.",
107+
"intent": "change"
108+
}
109+
```
110+
111+
### governance_phase
112+
113+
Tells Oz what phase the project is in and what checks are failing.
114+
115+
```json
116+
{
117+
"phase": "release",
118+
"label": "🚀 Release",
119+
"pct": 75,
120+
"description": "CHANGELOG updated, release tag created, compliance report filed.",
121+
"failing_checks": ["Trace vault has seals"]
122+
}
123+
```
124+
125+
### governance_req_list
126+
127+
List requirements, optionally filtered by status (`planned`, `implemented`, `partial`, `deprecated`).
128+
129+
```json
130+
{
131+
"total": 321,
132+
"covered": 321,
133+
"reqs": [
134+
{"id": "REQ-363", "title": "specsmith mcp serve: native stdio MCP server...", "status": "implemented", "covered": true},
135+
...
136+
]
137+
}
138+
```
139+
140+
### governance_trace_seal
141+
142+
Seal types: `decision`, `milestone`, `audit-gate`, `logic-knot`, `stress-test`, `epistemic`.
143+
144+
```json
145+
{
146+
"sealed": true,
147+
"seal_id": "SEAL-0001",
148+
"seal_type": "milestone",
149+
"description": "v0.12.0 released — native MCP governance server",
150+
"timestamp": "2026-06-01T20:00:00+00:00",
151+
"entry_hash": "a3f9b2c1..."
152+
}
153+
```
154+
155+
---
156+
157+
## Repository Workflows (Ctrl+Shift+R)
158+
159+
Opening the specsmith repo in Warp automatically makes seven governance workflows available via `Ctrl+Shift+R` search.
160+
161+
| Workflow name | What it runs | When to use |
162+
|---|---|---|
163+
| specsmith — Session Start | kill → migrate → audit → sync → checkpoint | Start of every session |
164+
| specsmith — Audit | `specsmith audit` | Check governance health |
165+
| specsmith — Checkpoint | `specsmith checkpoint` | Every 8–10 turns, or before a context summary |
166+
| specsmith — Preflight | `specsmith preflight "{{intent}}" --json` | Before any code change |
167+
| specsmith — Save | `specsmith save` | After completing a feature or fix |
168+
| specsmith — Phase Status | `specsmith phase show` | See current AEE phase + failing checks |
169+
| specsmith — Session End | `specsmith save && specsmith kill-session` | End of every session |
170+
171+
### Session workflow
172+
173+
```
174+
1. Ctrl+Shift+R → "specsmith session start" → Enter
175+
(runs: kill → migrate → audit → sync → checkpoint)
176+
177+
2. Make your changes, using Preflight before each one
178+
179+
3. Ctrl+Shift+R → "specsmith save" → Enter
180+
181+
4. At end of day: Ctrl+Shift+R → "specsmith session end" → Enter
182+
```
183+
184+
---
185+
186+
## Skill Auto-Discovery
187+
188+
The specsmith repo ships five governance skills in `.agents/skills/`. Warp/Oz auto-discovers these and loads them at session start:
189+
190+
| Skill | Purpose |
191+
|---|---|
192+
| `specsmith` | Master CLI reference — session workflow, commands, audit codes |
193+
| `specsmith-audit` | Running audits and interpreting results |
194+
| `specsmith-save` | When and how to run `specsmith save` |
195+
| `specsmith-session-governance` | Drift prevention, heartbeat every 8–10 turns, preflight gate |
196+
| `release-pilot` | Gitflow release-cut workflow |
197+
198+
The `specsmith-session-governance` skill is the most important for AI sessions — it instructs Oz to enforce the preflight gate before every code change and emit a checkpoint every 8–10 turns automatically.
199+
200+
---
201+
202+
## Troubleshooting
203+
204+
**`specsmith mcp serve` not found in Warp MCP servers list**
205+
206+
Ensure specsmith is installed via pipx (not pip):
207+
```bash
208+
pipx install specsmith
209+
which specsmith # should point to ~/.local/bin/specsmith or ~/pipx/venvs/...
210+
```
211+
212+
**MCP tool call returns an error**
213+
214+
Run `specsmith audit` manually to check governance health. Some tools (like `governance_req_list`) require `.specsmith/requirements.json` to exist — run `specsmith sync` first.
215+
216+
**Checkpoint returns `phase: "unknown"`**
217+
218+
The project directory needs a `docs/SPECSMITH.yml` or `scaffold.yml` file. Run `specsmith init` or `specsmith import` to set up governance.
219+
220+
**`governance_trace_seal` fails**
221+
222+
The `.specsmith/` directory must exist. Run `specsmith sync` first.

0 commit comments

Comments
 (0)