Skip to content

Commit 05fd251

Browse files
tbitcsoz-agent
andcommitted
chore: bump version to 0.11.1; merge develop; add esdb/skills commands
- Bump pyproject.toml + __init__.py to 0.11.1 - Merge origin/develop: adds skills deactivate/delete and esdb export/import/backup/rollback/compact subcommands - Resolve cli.py merge conflict (both branches added new subcommands; keep all of them — channel/esdb/skills from both sides) Co-Authored-By: Oz <oz-agent@warp.dev>
2 parents 541b678 + 9682615 commit 05fd251

18 files changed

Lines changed: 2153 additions & 9 deletions

.specsmith/requirements.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,5 +1720,110 @@
17201720
"description": "The context window MUST NEVER be allowed to reach 100% fill. A hard reservation of 15% (or MIN_FREE_TOKENS=2048, whichever is more restrictive) MUST remain free. When fill reaches the hard ceiling (default 85%), ContextFullError MUST be raised and emergency compression triggered regardless of the auto-compress toggle.",
17211721
"source": "Plan 0ca40db4 [CTX-004]",
17221722
"status": "defined"
1723+
},
1724+
{
1725+
"id": "REQ-248",
1726+
"title": "Dev/Stable Update Channel Persistence",
1727+
"description": "specsmith MUST persist a user-chosen update channel (stable or dev) to ~/.specsmith/channel. specsmith channel set {stable|dev} writes the file; channel clear removes it. effective_channel_with_source() MUST return (channel, source) where source is user when the file exists, otherwise",
1728+
"source": "ARCHITECTURE.md [Update Channel Selection]",
1729+
"status": "implemented"
1730+
},
1731+
{
1732+
"id": "REQ-249",
1733+
"title": "ESDB JSON Export Command",
1734+
"description": "specsmith esdb export [--output PATH] [--json] MUST dump all ESDB records (requirements and testcases) to a versioned JSON payload at the specified path, or default to <project>/.specsmith/esdb_export.json. Output includes esdb_version, \backend,",
1735+
"source": "ARCHITECTURE.md [ESDB Extended Management]",
1736+
"status": "implemented"
1737+
},
1738+
{
1739+
"id": "REQ-250",
1740+
"title": "ESDB JSON Import Command",
1741+
"description": "specsmith esdb import <source> [--json] MUST validate a JSON export file (checking for",
1742+
"source": "ARCHITECTURE.md [ESDB Extended Management]",
1743+
"status": "implemented"
1744+
},
1745+
{
1746+
"id": "REQ-251",
1747+
"title": "ESDB Timestamped Backup Command",
1748+
"description": "specsmith esdb backup [--dir DIR] [--json] MUST create a timestamped snapshot at <dir>/esdb_backup_<YYYYMMDDTHHMMSSZ>.json (default dir: .specsmith/backups/). The snapshot payload MUST include esdb_version, \timestamp, \backend,",
1749+
"source": "ARCHITECTURE.md [ESDB Extended Management]",
1750+
"status": "implemented"
1751+
},
1752+
{
1753+
"id": "REQ-252",
1754+
"title": "ESDB WAL Rollback Command",
1755+
"description": "specsmith esdb rollback [--steps N] [--json] MUST report the number of WAL events that would be undone. In stub mode (ChronoMemory native engine not linked) it MUST return {ok: true, steps_requested: N, records_before: N, note: \"...\"} without modifying state.",
1756+
"source": "ARCHITECTURE.md [ESDB Extended Management]",
1757+
"status": "implemented"
1758+
},
1759+
{
1760+
"id": "REQ-253",
1761+
"title": "ESDB WAL Compact Command",
1762+
"description": "specsmith esdb compact [--json] MUST request WAL compaction. In stub mode it MUST return {ok: true, backend: \"...\", records: N, note: \"...\"} without error.",
1763+
"source": "ARCHITECTURE.md [ESDB Extended Management]",
1764+
"status": "implemented"
1765+
},
1766+
{
1767+
"id": "REQ-254",
1768+
"title": "Skills Deactivate Command",
1769+
"description": "specsmith skills deactivate <skill-id> [--project-dir DIR] MUST set \u0007ctive: false in the skill's skill.json, return True on success, and exit non-zero with an error message if the skill is not found.",
1770+
"source": "ARCHITECTURE.md [AI Skills Builder]",
1771+
"status": "implemented"
1772+
},
1773+
{
1774+
"id": "REQ-255",
1775+
"title": "Skills Delete Command",
1776+
"description": "specsmith skills delete <skill-id> [--project-dir DIR] [--yes] MUST prompt for confirmation unless --yes is provided, then permanently remove the skill directory under .specsmith/skills/. Returns non-zero if the skill is not found.",
1777+
"source": "ARCHITECTURE.md [AI Skills Builder]",
1778+
"status": "implemented"
1779+
},
1780+
{
1781+
"id": "REQ-256",
1782+
"title": "MCP Server Config Generation Command",
1783+
"description": "specsmith mcp generate <description> [--json] MUST produce a deterministic MCP server configuration stub with id,",
1784+
"source": "ARCHITECTURE.md [MCP Server Generator]",
1785+
"status": "implemented"
1786+
},
1787+
{
1788+
"id": "REQ-257",
1789+
"title": "Agent Ask Keyword Dispatcher",
1790+
"description": "specsmith agent ask <prompt> [--project-dir DIR] [--json-output] MUST route prompts to the appropriate subsystem by keyword matching (compliance, audit, skill, esdb, mcp, session) without requiring an LLM. It MUST return {reply, action, prompt} and print human-readable output unless --json-output is set.",
1791+
"source": "ARCHITECTURE.md [Agent Ask Dispatcher]",
1792+
"status": "implemented"
1793+
},
1794+
{
1795+
"id": "REQ-258",
1796+
"title": "Kairos ESDB Settings Page",
1797+
"description": "The Kairos settings sidebar MUST include an ESDB page under the Specsmith umbrella group. The page MUST display current ESDB status (record count, backend, chain validity) and provide action buttons for Refresh, Export JSON, Import, Backup, Rollback, and Compact.",
1798+
"source": "ARCHITECTURE.md [Kairos Settings Extensions]",
1799+
"status": "implemented"
1800+
},
1801+
{
1802+
"id": "REQ-259",
1803+
"title": "Kairos Skills Settings Page",
1804+
"description": "The Kairos settings sidebar MUST include a Skills page under the Specsmith umbrella group. The page MUST display a description of the Skills system and instructions for using specsmith skills build and related commands.",
1805+
"source": "ARCHITECTURE.md [Kairos Settings Extensions]",
1806+
"status": "implemented"
1807+
},
1808+
{
1809+
"id": "REQ-260",
1810+
"title": "Kairos Eval Settings Page",
1811+
"description": "The Kairos settings sidebar MUST include an Eval page under the Specsmith umbrella group. The page MUST describe the evaluation tracking system and direct users to specsmith eval run for generating reports.",
1812+
"source": "ARCHITECTURE.md [Kairos Settings Extensions]",
1813+
"status": "implemented"
1814+
},
1815+
{
1816+
"id": "REQ-261",
1817+
"title": "Kairos AI Providers Table Without Column Overflow",
1818+
"description": "The Kairos Agents > Providers settings page MUST display AI models in a table with fixed-width columns (Name: 200px, Model ID: 220px, Context: 80px, Output: 80px) using ConstrainedBox + Clipped elements. Long model names such as o4-mini-deep-research MUST NOT overflow into adjacent columns.",
1819+
"source": "ARCHITECTURE.md [Kairos Settings Extensions]",
1820+
"status": "implemented"
1821+
},
1822+
{
1823+
"id": "REQ-262",
1824+
"title": "Kairos MCP AI Builder Card",
1825+
"description": "The Kairos Agents > MCP servers list page MUST include a collapsible AI Builder card that accepts a natural-language server description, calls specsmith mcp generate <description> --json, displays the generated JSON stub, and offers an 'Add to ~/.specsmith/mcp.json' button that appends the stub to the user's MCP config file.",
1826+
"source": "ARCHITECTURE.md [Kairos Settings Extensions]",
1827+
"status": "implemented"
17231828
}
17241829
]

.specsmith/testcases.json

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,5 +2462,170 @@
24622462
"input": {},
24632463
"expected_behavior": {},
24642464
"confidence": 1.0
2465+
},
2466+
{
2467+
"id": "TEST-248",
2468+
"title": "Dev/Stable Channel Persistence CLI Round-trip",
2469+
"description": "specsmith channel set dev persists the preference; channel get --json returns channel==dev source==user; channel clear reverts source to version.",
2470+
"requirement_id": "REQ-248",
2471+
"type": "cli",
2472+
"verification_method": "pytest (test_req_248_262.py::TestREQ248ChannelCLI, test_channel.py)",
2473+
"input": {},
2474+
"expected_behavior": {},
2475+
"confidence": 1.0
2476+
},
2477+
{
2478+
"id": "TEST-249",
2479+
"title": "ESDB Export Creates Versioned JSON File",
2480+
"description": "specsmith esdb export --json exits 0, returns ok==true + path; the written file contains esdb_version==1, backend, record_count, requirements, testcases.",
2481+
"requirement_id": "REQ-249",
2482+
"type": "cli",
2483+
"verification_method": "pytest (test_req_248_262.py::TestREQ249EsdbExport)",
2484+
"input": {},
2485+
"expected_behavior": {},
2486+
"confidence": 1.0
2487+
},
2488+
{
2489+
"id": "TEST-250",
2490+
"title": "ESDB Import Validates and Stages JSON",
2491+
"description": "specsmith esdb import <file> --json exits 0 for valid JSON export, staging it at .specsmith/esdb_import.json. Exits non-zero for missing or invalid JSON files.",
2492+
"requirement_id": "REQ-250",
2493+
"type": "cli",
2494+
"verification_method": "pytest (test_req_248_262.py::TestREQ250EsdbImport)",
2495+
"input": {},
2496+
"expected_behavior": {},
2497+
"confidence": 1.0
2498+
},
2499+
{
2500+
"id": "TEST-251",
2501+
"title": "ESDB Backup Creates Timestamped Snapshot",
2502+
"description": "specsmith esdb backup --json exits 0, creates a file matching esdb_backup_\\d{8}T\\d{6}Z.json with all required payload keys.",
2503+
"requirement_id": "REQ-251",
2504+
"type": "cli",
2505+
"verification_method": "pytest (test_req_248_262.py::TestREQ251EsdbBackup)",
2506+
"input": {},
2507+
"expected_behavior": {},
2508+
"confidence": 1.0
2509+
},
2510+
{
2511+
"id": "TEST-252",
2512+
"title": "ESDB Rollback Reports Steps Without State Change",
2513+
"description": "specsmith esdb rollback --steps N --json exits 0 and returns ok==true, steps_requested==N, records_before. State is unchanged (stub mode).",
2514+
"requirement_id": "REQ-252",
2515+
"type": "cli",
2516+
"verification_method": "pytest (test_req_248_262.py::TestREQ252EsdbRollback)",
2517+
"input": {},
2518+
"expected_behavior": {},
2519+
"confidence": 1.0
2520+
},
2521+
{
2522+
"id": "TEST-253",
2523+
"title": "ESDB Compact Returns OK With Note",
2524+
"description": "specsmith esdb compact --json exits 0 and returns ok==true, backend, records, note. Human-readable output contains \"compact\".",
2525+
"requirement_id": "REQ-253",
2526+
"type": "cli",
2527+
"verification_method": "pytest (test_req_248_262.py::TestREQ253EsdbCompact)",
2528+
"input": {},
2529+
"expected_behavior": {},
2530+
"confidence": 1.0
2531+
},
2532+
{
2533+
"id": "TEST-254",
2534+
"title": "Skills Deactivate Sets active=false",
2535+
"description": "After skills activate <id>, skills deactivate <id> exits 0 and the skill's skill.json has active==false. Non-existent skill exits non-zero.",
2536+
"requirement_id": "REQ-254",
2537+
"type": "cli",
2538+
"verification_method": "pytest (test_req_248_262.py::TestREQ254SkillsDeactivate, TestSkillsBuilderDeactivateDelete)",
2539+
"input": {},
2540+
"expected_behavior": {},
2541+
"confidence": 1.0
2542+
},
2543+
{
2544+
"id": "TEST-255",
2545+
"title": "Skills Delete Removes Directory",
2546+
"description": "skills delete <id> --yes exits 0 and permanently removes the skill directory. Non-existent skill exits non-zero. Sibling skills are preserved.",
2547+
"requirement_id": "REQ-255",
2548+
"type": "cli",
2549+
"verification_method": "pytest (test_req_248_262.py::TestREQ255SkillsDelete, TestSkillsBuilderDeactivateDelete)",
2550+
"input": {},
2551+
"expected_behavior": {},
2552+
"confidence": 1.0
2553+
},
2554+
{
2555+
"id": "TEST-256",
2556+
"title": "MCP Generate Produces Stub With Required Fields",
2557+
"description": "mcp generate <desc> --json exits 0 and returns a dict containing id, name, command, args (in server sub-object or flat). Description field is stable; different descriptions produce different descriptions.",
2558+
"requirement_id": "REQ-256",
2559+
"type": "cli",
2560+
"verification_method": "pytest (test_req_248_262.py::TestREQ256McpGenerate)",
2561+
"input": {},
2562+
"expected_behavior": {},
2563+
"confidence": 1.0
2564+
},
2565+
{
2566+
"id": "TEST-257",
2567+
"title": "Agent Ask Routes By Keyword And Returns Structured Output",
2568+
"description": "\u0007gent ask <prompt> --json-output exits 0 and returns {reply, action, prompt}. Keywords esdb/mcp/skill/compliance route to appropriate actions. Unknown prompt routes to action==\"unknown\".",
2569+
"requirement_id": "REQ-257",
2570+
"type": "cli",
2571+
"verification_method": "pytest (test_req_248_262.py::TestREQ257AgentAsk)",
2572+
"input": {},
2573+
"expected_behavior": {},
2574+
"confidence": 1.0
2575+
},
2576+
{
2577+
"id": "TEST-258",
2578+
"title": "Kairos ESDB Settings Page Renders Without Overflow",
2579+
"description": "The Kairos Settings > Specsmith > ESDB page renders the status row, action buttons (Refresh, Export JSON, Import, Backup, Rollback, Compact) without layout errors.",
2580+
"requirement_id": "REQ-258",
2581+
"type": "integration",
2582+
"verification_method": "manual (Rust UI build required)",
2583+
"input": {},
2584+
"expected_behavior": {},
2585+
"confidence": 1.0
2586+
},
2587+
{
2588+
"id": "TEST-259",
2589+
"title": "Kairos Skills Settings Page Renders",
2590+
"description": "The Kairos Settings > Specsmith > Skills page renders header, description, and CLI hint without errors.",
2591+
"requirement_id": "REQ-259",
2592+
"type": "integration",
2593+
"verification_method": "manual (Rust UI build required)",
2594+
"input": {},
2595+
"expected_behavior": {},
2596+
"confidence": 1.0
2597+
},
2598+
{
2599+
"id": "TEST-260",
2600+
"title": "Kairos Eval Settings Page Renders",
2601+
"description": "The Kairos Settings > Specsmith > Eval page renders header, description, and CLI hint without errors.",
2602+
"requirement_id": "REQ-260",
2603+
"type": "integration",
2604+
"verification_method": "manual (Rust UI build required)",
2605+
"input": {},
2606+
"expected_behavior": {},
2607+
"confidence": 1.0
2608+
},
2609+
{
2610+
"id": "TEST-261",
2611+
"title": "Kairos AI Providers Table Does Not Overflow Long Model Names",
2612+
"description": "In the Kairos Agents > Providers table, the model name \"o4-mini-deep-research\" is clipped to its column width (200px) and does not bleed into the Model ID column.",
2613+
"requirement_id": "REQ-261",
2614+
"type": "integration",
2615+
"verification_method": "manual (Rust UI build + visual inspection)",
2616+
"input": {},
2617+
"expected_behavior": {},
2618+
"confidence": 1.0
2619+
},
2620+
{
2621+
"id": "TEST-262",
2622+
"title": "Kairos MCP AI Builder Card Generates And Saves Stub",
2623+
"description": "In the Kairos Agents > MCP servers list, the AI Builder card accepts a description, generates a stub via specsmith, displays JSON, and appends to ~/.specsmith/mcp.json on 'Add to config' click.",
2624+
"requirement_id": "REQ-262",
2625+
"type": "integration",
2626+
"verification_method": "manual (Rust UI build required)",
2627+
"input": {},
2628+
"expected_behavior": {},
2629+
"confidence": 1.0
24652630
}
24662631
]

ARCHITECTURE.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,97 @@ Role-based scoring engine using HuggingFace benchmark data.
5959
PFW, Citations, FPD, PTAB). All stdlib urllib, no external dependencies.
6060
See `specsmith.datasources.*`.
6161

62+
## Update Channel Selection
63+
64+
The `specsmith channel` group lets users persist a `stable` or `dev`
65+
release-channel preference to `~/.specsmith/channel`.
66+
`effective_channel_with_source()` in `specsmith.channel` resolves the
67+
active channel from: (1) the persisted file, (2) the installed version
68+
string (`.devN` suffix → dev, otherwise stable).
69+
Self-update (`specsmith self-update`) and project-update checks both
70+
honour the resolved channel.
71+
72+
Subcommands: `channel get [--json]`, `channel set {stable|dev}`, `channel clear`.
73+
74+
## AI Skills Builder (Phase A)
75+
76+
The `specsmith skills` group generates, lists, activates, deactivates,
77+
tests, and deletes reusable AI agent skills stored as structured SKILL.md
78+
specifications under `.specsmith/skills/<skill-id>/`.
79+
80+
- `skills build <description>` — deterministic skill spec generation from
81+
natural-language description; writes `SKILL.md` + `skill.json`.
82+
- `skills list [--json]` — enumerate installed skills with active/inactive badge.
83+
- `skills test <skill-id>` — dry-run validation of skill spec fields.
84+
- `skills activate <skill-id>` — set `active: true` in `skill.json`.
85+
- `skills deactivate <skill-id>` — set `active: false` in `skill.json`.
86+
- `skills delete <skill-id> [--yes]` — permanently remove skill directory.
87+
88+
All read/write operations use `specsmith.skills_builder`.
89+
90+
## ESDB Extended Management
91+
92+
The `specsmith esdb` group provides full lifecycle management for the
93+
ChronoMemory Epistemic State Database.
94+
95+
**Existing:** `status`, `migrate`, `replay`
96+
97+
**New (Phase ESDB):**
98+
- `esdb export [--output PATH] [--json]` — dumps all records to a JSON
99+
snapshot at `<project>/.specsmith/esdb_export.json`.
100+
- `esdb import <source> [--json]` — validates and stages a JSON export;
101+
run `esdb migrate` to apply.
102+
- `esdb backup [--dir DIR] [--json]` — creates a timestamped snapshot at
103+
`.specsmith/backups/esdb_backup_<UTC>.json`.
104+
- `esdb rollback [--steps N] [--json]` — reports WAL events that would be
105+
undone (stub until ChronoMemory native engine is linked).
106+
- `esdb compact [--json]` — requests WAL compaction / vacuum.
107+
108+
## MCP Server Generator
109+
110+
`specsmith mcp generate <description> [--json]` produces a deterministic
111+
MCP server configuration stub from a natural-language description.
112+
The stub is a JSON object with `id`, `name`, `command`, and `args` fields
113+
suitable for appending to `~/.specsmith/mcp.json`.
114+
115+
Implemented in `specsmith.cli.main_group → mcp_group → mcp_generate_cmd`.
116+
117+
## Agent Ask Dispatcher
118+
119+
`specsmith agent ask <prompt> [--project-dir DIR] [--json-output]` is a
120+
keyword-based routing dispatcher that answers settings and status queries
121+
without an LLM.
122+
123+
Routing table (evaluated in order):
124+
1. `compliance / coverage / gaps / trace``get_compliance_summary()`
125+
2. `audit / health / governance / drift``run_audit()`
126+
3. `skill / build skill / create skill` → hints to `specsmith skills build`
127+
4. `esdb / database / backup / export / records``EsdbBridge.status()`
128+
5. `mcp / server / tool server` → hints to `specsmith mcp generate`
129+
6. `session / phase / status / project``init_session()`
130+
131+
Returns `{"reply": "...", "action": "...", "prompt": "..."}`.
132+
62133
## Kairos Integration
63134

64-
Kairos (BitConcepts/kairos) is the Rust terminal that consumes
135+
Kairos (layer1labs/kairos) is the Rust terminal that consumes
65136
`specsmith serve` as its governance backend via HTTP/WebSocket.
66137
See `specsmith.governance_logic.GovernanceHTTPServer`.
138+
139+
### Kairos Settings Extensions (v0.11.x)
140+
141+
The Kairos settings view now includes Specsmith-specific pages grouped
142+
under a **Specsmith** umbrella in the sidebar:
143+
144+
- **ESDB** — database status, export/import/backup/rollback/compact actions.
145+
- **Skills** — skills listing and management instructions.
146+
- **Eval** — evaluation suite tracking and report access.
147+
148+
The **Agents → Providers** subpage shows a fixed-width model table
149+
(Name | Model ID | Context | Output columns) with `ConstrainedBox` +
150+
`Clipped` cells to prevent text overflow on long model names such as
151+
`o4-mini-deep-research`.
152+
153+
The **Agents → MCP servers** list page includes a collapsible
154+
**AI Builder** card that invokes `specsmith mcp generate <description>`
155+
and offers one-click append to `~/.specsmith/mcp.json`.

0 commit comments

Comments
 (0)