@slowcook-ai/cli 0.19.3 → 0.19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -175
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/check/index.d.ts +2 -0
- package/dist/commands/check/index.d.ts.map +1 -1
- package/dist/commands/check/index.js +9 -0
- package/dist/commands/check/index.js.map +1 -1
- package/dist/commands/check/spec-validate.d.ts +46 -0
- package/dist/commands/check/spec-validate.d.ts.map +1 -0
- package/dist/commands/check/spec-validate.js +203 -0
- package/dist/commands/check/spec-validate.js.map +1 -0
- package/dist/commands/on-brew-merged/index.d.ts.map +1 -1
- package/dist/commands/on-brew-merged/index.js +61 -0
- package/dist/commands/on-brew-merged/index.js.map +1 -1
- package/dist/commands/plate/dto-columns.d.ts +55 -0
- package/dist/commands/plate/dto-columns.d.ts.map +1 -0
- package/dist/commands/plate/dto-columns.js +135 -0
- package/dist/commands/plate/dto-columns.js.map +1 -0
- package/dist/commands/refine/agent.d.ts.map +1 -1
- package/dist/commands/refine/agent.js +12 -1
- package/dist/commands/refine/agent.js.map +1 -1
- package/dist/commands/refine/spec-validate.d.ts +18 -0
- package/dist/commands/refine/spec-validate.d.ts.map +1 -1
- package/dist/commands/refine/spec-validate.js +42 -0
- package/dist/commands/refine/spec-validate.js.map +1 -1
- package/dist/commands/upsert-agent-docs.d.ts.map +1 -1
- package/dist/commands/upsert-agent-docs.js +42 -0
- package/dist/commands/upsert-agent-docs.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,210 +1,79 @@
|
|
|
1
1
|
# @slowcook-ai/cli
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
The `slowcook` CLI — TDD-first agentic development harness. Turns a detailed user story into frozen tests, then lets agents iterate under strict guardrails until every test is green.
|
|
4
4
|
|
|
5
|
-
> ⚠️ **Active development — expect breaking changes.** Slowcook is pre-1.0 and the architecture itself is iterating in public.
|
|
5
|
+
> ⚠️ **Active development — expect breaking changes.** Slowcook is pre-1.0 and the architecture itself is iterating in public. CLI commands, file layouts, prompt contracts, and the package surface can and will change between point versions.
|
|
6
6
|
>
|
|
7
7
|
> If you're adopting slowcook today: pin exact versions in your consumer (`.brewing/slowcook-cli-version`), read each release entry in [the changelog](https://github.com/aminazar/slowcook/blob/main/CHANGELOG.md) before bumping, and treat it as a partnership — feedback from real consumers is what drives the next cut.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
# Stable line (0.13.x today; story-flow + bug-flow + chef orchestrator)
|
|
13
12
|
npm i -D @slowcook-ai/cli
|
|
14
|
-
|
|
15
|
-
# 0.16 alpha track (singular mock app + element-anchored review)
|
|
16
|
-
npm i -D @slowcook-ai/cli@alpha @slowcook-ai/mock-runtime@latest
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
The `latest` tag points at the most recent stable cut; the `alpha` tag points at the in-progress 0.16 architecture. The two are NOT installable together — pick one per consumer.
|
|
20
|
-
|
|
21
|
-
## Commands (v0.4)
|
|
22
|
-
|
|
23
|
-
### `slowcook refine` (first agent)
|
|
24
|
-
|
|
25
|
-
Drives a GitHub issue through a clarifying-question loop until a frozen spec is emitted as a draft PR. Enforces the issue-level ratchet: new issues must not silently duplicate or contradict earlier decisions.
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npx slowcook refine --issue <number> [options]
|
|
29
13
|
```
|
|
30
14
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- `ANTHROPIC_API_KEY` — for the refinement and relationship-analysis LLM calls
|
|
34
|
-
- `GITHUB_TOKEN` — with `contents: write`, `issues: write`, `pull-requests: write`
|
|
35
|
-
|
|
36
|
-
**Options:**
|
|
37
|
-
|
|
38
|
-
| Flag | Default | Description |
|
|
39
|
-
|---|---|---|
|
|
40
|
-
| `--issue <number>` | required | GitHub issue number |
|
|
41
|
-
| `--cwd <path>` | `.` | Repo working directory |
|
|
42
|
-
| `--owner <login>` | parsed from git remote | Repo owner |
|
|
43
|
-
| `--repo <name>` | parsed from git remote | Repo name |
|
|
44
|
-
| `--base <branch>` | `main` | Base branch for the draft spec PR |
|
|
45
|
-
| `--refine-model <id>` | `claude-opus-4-7` | Model for the refinement loop |
|
|
46
|
-
| `--relationship-model <id>` | `claude-sonnet-4-5` | Model for relationship analysis |
|
|
47
|
-
|
|
48
|
-
**Behaviour per invocation:**
|
|
49
|
-
|
|
50
|
-
1. Reads the issue (body + labels + comments) and all currently-active specs.
|
|
51
|
-
2. Runs a relationship analysis: `new_or_independent | overlap | contradiction`.
|
|
52
|
-
3. Acts on the verdict:
|
|
53
|
-
- **overlap** — posts a comment naming the overlapping spec ids, applies `blocked-overlap` label, exits.
|
|
54
|
-
- **contradiction** without `change-of-mind` label — posts a blocker comment, applies `blocked-contradiction` label, exits.
|
|
55
|
-
- **contradiction** with `change-of-mind` label — proceeds; the spec's `supersedes` field is populated.
|
|
56
|
-
- **new / independent** — proceeds to the refinement loop.
|
|
57
|
-
4. Runs one round of refinement: either posts clarifying questions (and exits; next invocation picks up on the next PM comment) OR emits the spec YAML, writes `specs/story-N.yaml` and updates `specs/_index.yaml`, commits + pushes a branch, opens a draft PR, applies `spec-ready` label.
|
|
58
|
-
|
|
59
|
-
Re-run on every new PM comment in the issue (via a GitHub Actions workflow triggered by `issue_comment` + `issues` events).
|
|
60
|
-
|
|
61
|
-
### `slowcook init`
|
|
62
|
-
|
|
63
|
-
Scaffold slowcook configuration in a consumer project. Writes `.brewing/*`, `.github/workflows/slowcook.yml`, and a `CODEOWNERS` section. Idempotent — re-running skips existing files unless `--force`.
|
|
15
|
+
Or pin a specific version (recommended for consumers):
|
|
64
16
|
|
|
65
17
|
```bash
|
|
66
|
-
|
|
18
|
+
npm i -D @slowcook-ai/cli@0.19.5
|
|
67
19
|
```
|
|
68
20
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
| Flag | Default | Description |
|
|
72
|
-
|---|---|---|
|
|
73
|
-
| `--cwd <path>` | `.` | Target project directory |
|
|
74
|
-
| `--owner <handle>` | detected from git remote | CODEOWNERS handle/team (e.g. `@your-handle`, `@acme/frontend`) |
|
|
75
|
-
| `--force` | false | Overwrite existing slowcook files |
|
|
76
|
-
| `--dry-run` | false | Print the plan without writing anything |
|
|
21
|
+
The `latest` tag points at the most recent stable cut. Stamp your pinned version in `.brewing/slowcook-cli-version` after `slowcook init`.
|
|
77
22
|
|
|
78
|
-
|
|
23
|
+
## Start here
|
|
79
24
|
|
|
80
|
-
|
|
25
|
+
If you're an AI agent (Claude Code, Cursor, etc.) or a developer driving slowcook in a consumer repo, the canonical pipeline reference is **[AGENTS.md](https://github.com/aminazar/slowcook/blob/main/AGENTS.md)** at the repo root. It has the decision tree, the pipeline at a glance, per-command quick reference, and an empirical pitfalls list that saves real money + time on your first session.
|
|
81
26
|
|
|
82
|
-
|
|
27
|
+
This README covers install + the top-level command surface. AGENTS.md covers WHEN to reach for which command, the pipeline flow, and the failure modes you're likely to hit.
|
|
83
28
|
|
|
84
|
-
|
|
85
|
-
- `2` — script error (no `package.json`, vitest not found, invalid JSON)
|
|
29
|
+
## Quick command reference
|
|
86
30
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Checks for frozen-path violations between two git refs. Intended for CI.
|
|
31
|
+
The pipeline is **refine → testgen → vibe → plate → recipe → brew → chef**. Each stage is an agent invocation that consumes the previous stage's output + commits its own PR.
|
|
90
32
|
|
|
91
33
|
```bash
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"files": ["vitest.config.ts", "playwright.config.ts"],
|
|
116
|
-
"partial": {
|
|
117
|
-
"package.json": {
|
|
118
|
-
"frozen_key_paths": ["scripts.test", "scripts.e2e"]
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
34
|
+
# Pipeline (agent-driven)
|
|
35
|
+
npx slowcook refine # GitHub issue → frozen spec PR
|
|
36
|
+
npx slowcook testgen # spec → failing test PR
|
|
37
|
+
npx slowcook vibe # spec → mockup PR
|
|
38
|
+
npx slowcook plate # mockup + tests → review-overlay annotations
|
|
39
|
+
npx slowcook recipe # tests + mockup → brew manifest
|
|
40
|
+
npx slowcook brew # iterate src/ until all tests pass
|
|
41
|
+
npx slowcook chef # post-merge drift-fix / orchestration
|
|
42
|
+
|
|
43
|
+
# Setup + plumbing
|
|
44
|
+
npx slowcook init # scaffold .brewing/ + .github/workflows/ in a consumer repo
|
|
45
|
+
npx slowcook refresh-knowledge # rebuild .brewing/repo-knowledge/ (auto digests + git-history mining)
|
|
46
|
+
npx slowcook upsert-agent-docs # write the managed AGENTS.md block in consumer
|
|
47
|
+
|
|
48
|
+
# Guards + checks
|
|
49
|
+
npx slowcook guard # frozen-paths check between two refs (CI)
|
|
50
|
+
npx slowcook manifest verify # confirm the recorded test set still resolves
|
|
51
|
+
npx slowcook check spec # re-run refine validators on a spec yaml (PR-amendment safety)
|
|
52
|
+
npx slowcook recon # pre-brew structural backstop
|
|
53
|
+
|
|
54
|
+
# Knowledge + accounting
|
|
55
|
+
npx slowcook knowledge add # add a curated entry to .brewing/repo-knowledge/curated/
|
|
56
|
+
npx slowcook cost log # stamp a cost marker on a story (non-Actions agents)
|
|
122
57
|
```
|
|
123
58
|
|
|
124
|
-
|
|
125
|
-
- `files` — exact path match.
|
|
126
|
-
- `partial` — for files where only certain JSON keys are frozen (e.g., only `scripts.test*` in `package.json`).
|
|
127
|
-
|
|
128
|
-
### Use in GitHub Actions
|
|
129
|
-
|
|
130
|
-
```yaml
|
|
131
|
-
# .github/workflows/frozen-paths-guard.yml
|
|
132
|
-
name: frozen-paths-guard
|
|
133
|
-
on:
|
|
134
|
-
pull_request:
|
|
135
|
-
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
136
|
-
|
|
137
|
-
jobs:
|
|
138
|
-
check:
|
|
139
|
-
runs-on: ubuntu-latest
|
|
140
|
-
steps:
|
|
141
|
-
- uses: actions/checkout@v4
|
|
142
|
-
with: { fetch-depth: 0 }
|
|
143
|
-
- uses: actions/setup-node@v4
|
|
144
|
-
with: { node-version: 20 }
|
|
145
|
-
- name: Run guard
|
|
146
|
-
env:
|
|
147
|
-
HAS_OVERRIDE: ${{ contains(github.event.pull_request.labels.*.name, 'override-freeze') }}
|
|
148
|
-
run: |
|
|
149
|
-
ARGS="--base origin/${{ github.base_ref }} --head HEAD"
|
|
150
|
-
if [ "$HAS_OVERRIDE" = "true" ]; then ARGS="$ARGS --override"; fi
|
|
151
|
-
npx --yes @slowcook-ai/cli@latest guard $ARGS
|
|
152
|
-
```
|
|
59
|
+
Run `npx slowcook <command> --help` for per-command flags. All commands accept `--cwd <path>` to operate against a directory other than `.`.
|
|
153
60
|
|
|
154
|
-
|
|
61
|
+
## Required environment
|
|
155
62
|
|
|
156
|
-
|
|
63
|
+
Most pipeline commands invoke the Anthropic API and act on GitHub:
|
|
157
64
|
|
|
158
|
-
|
|
65
|
+
- `ANTHROPIC_API_KEY` — LLM calls (refine, testgen, vibe, plate, recipe, brew, chef)
|
|
66
|
+
- `GITHUB_TOKEN` — `contents: write`, `issues: write`, `pull-requests: write` for PR + comment work
|
|
159
67
|
|
|
160
|
-
|
|
161
|
-
# Record a snapshot of every test currently discoverable
|
|
162
|
-
npx slowcook manifest record
|
|
68
|
+
`slowcook init`, `guard`, `manifest`, and `check` run locally without API/network access.
|
|
163
69
|
|
|
164
|
-
|
|
165
|
-
npx slowcook manifest verify
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
**Options (both subcommands):**
|
|
169
|
-
|
|
170
|
-
| Flag | Default | Description |
|
|
171
|
-
|---|---|---|
|
|
172
|
-
| `--stack-config <path>` | `.brewing/stack.json` | Consumer stack config |
|
|
173
|
-
| `--manifest <path>` | `.brewing/manifests/all.json` (or `.brewing/manifests/story-<id>.json` if `--story`) | Where to write / read the manifest |
|
|
174
|
-
| `--story <id>` | none | Tag manifest with a story id (enables per-story freezing) |
|
|
175
|
-
| `--cwd <path>` | `.` | Working directory for discovery commands |
|
|
176
|
-
|
|
177
|
-
**Config file** — `.brewing/stack.json` declares how to discover tests per suite:
|
|
178
|
-
|
|
179
|
-
```json
|
|
180
|
-
{
|
|
181
|
-
"language": "typescript",
|
|
182
|
-
"test": {
|
|
183
|
-
"backend": {
|
|
184
|
-
"runner": "vitest",
|
|
185
|
-
"run_command": "npx vitest run",
|
|
186
|
-
"discover_command": "npx vitest list",
|
|
187
|
-
"reporter_format": "vitest-list-lines"
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**Exit codes:**
|
|
194
|
-
|
|
195
|
-
- `record`: `0` manifest written, `2` script error (bad config, suite discovery failed)
|
|
196
|
-
- `verify`: `0` manifest matches (new tests since record are informational), `1` recorded tests no longer discoverable, `2` script error
|
|
197
|
-
|
|
198
|
-
**Use in GitHub Actions** — after the frozen-paths guard:
|
|
199
|
-
|
|
200
|
-
```yaml
|
|
201
|
-
- name: Verify test manifest
|
|
202
|
-
run: npx --yes @slowcook-ai/cli@latest manifest verify
|
|
203
|
-
```
|
|
70
|
+
## What ships in this package
|
|
204
71
|
|
|
205
|
-
|
|
72
|
+
- `slowcook` binary (entry point: `dist/cli.js`)
|
|
73
|
+
- Pipeline commands listed above
|
|
74
|
+
- Programmatic API exports for the validators (`validateEntityFieldReferences`, `validateComponentReuseShape`, `validateRouteCollisions`, `validatePlateDtoColumns`) — useful if you want to wire the lint chain into a custom CI
|
|
206
75
|
|
|
207
|
-
|
|
76
|
+
The companion packages (`@slowcook-ai/core`, `@slowcook-ai/llm-anthropic`, `@slowcook-ai/forge-github`, `@slowcook-ai/stack-ts`, `@slowcook-ai/mock-runtime`) install transitively as workspace deps. The cli is the only one you `npm i` directly.
|
|
208
77
|
|
|
209
78
|
## License
|
|
210
79
|
|
package/dist/cli.js
CHANGED
|
@@ -74,6 +74,7 @@ Usage:
|
|
|
74
74
|
slowcook port --story <id> [--cwd <path>] [--dry-run] [--force]
|
|
75
75
|
slowcook preview (deploy|teardown) --pr <number> [--ssh-key <path>] [--cwd <path>]
|
|
76
76
|
slowcook check mock-isolation [--cwd <path>]
|
|
77
|
+
slowcook check spec [file...] [--cwd <path>]
|
|
77
78
|
slowcook run-mock <story-id> [--no-poll] [--poll-seconds <n>] [--branch <ref>]
|
|
78
79
|
slowcook dispatch <step> [inputs...]
|
|
79
80
|
slowcook fixtures check [--max-age-days <n>] [--story <id>]
|
|
@@ -108,7 +109,7 @@ Commands available in ${VERSION}:
|
|
|
108
109
|
plate (0.15-α.3) Mockup amendment agent. Triggered by /plate PR comments on slowcook-mockup PRs; force-pushes amendments.
|
|
109
110
|
port (0.16-α.8) Deterministic mock/ → src/ copy. Walks mock/src/, applies useScenarioFixture → useDataDomain rewrite, prepends provenance header. Pre-brew CI step.
|
|
110
111
|
preview (0.16-α.5) SSH preview deploy. \`deploy --pr N\`: build + run the mock app on the consumer's box; post URL to PR. \`teardown --pr N\`: stop + remove.
|
|
111
|
-
check (0.16-α.13) Static structural checks. \`check mock-isolation\` verifies every import in mock/ stays inside mock/ (catches vibe-prompt slippage that breaks the mock-vs-prod separation rule).
|
|
112
|
+
check (0.16-α.13) Static structural checks. \`check mock-isolation\` verifies every import in mock/ stays inside mock/ (catches vibe-prompt slippage that breaks the mock-vs-prod separation rule). \`check spec\` (0.19.4-α) re-runs spec content validators on a PR's spec files — closes the amendment-bypass gap where refine's in-process lint never re-fires.
|
|
112
113
|
recon (0.17.6+) Pre-brew structural divergence check. Compares story tests against mock + src/, surfaces missing components / testid gaps / brownfield rename hazards. Runs in slowcook-brew-auto.yml before brew dispatch.
|
|
113
114
|
run-mock (0.16-α.17) One-command mock launch + auto-pull. \`run-mock <story>\`: checkout mockup branch, npm install in mock/, run next dev with overlay env vars, poll origin every 15s + git pull --ff-only on plate amendments.
|
|
114
115
|
dispatch Trigger a slowcook GitHub Actions workflow remotely (brew / testgen / refine).
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,IAAI,EA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AAC,GAAG,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Subcommands:
|
|
7
7
|
* - `mock-isolation` — every mock/ import resolves inside mock/
|
|
8
|
+
* - `spec` — re-run spec content validators on PRs touching
|
|
9
|
+
* specs/story-*.yaml (0.19.4-α / sc#146 #2)
|
|
8
10
|
*
|
|
9
11
|
* More to come (e.g. `mock-runtime-exports` to whitelist hooks vibe
|
|
10
12
|
* may import; `port-provenance` to verify src/ files copied via port
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/check/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/check/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB9E"}
|
|
@@ -5,17 +5,22 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Subcommands:
|
|
7
7
|
* - `mock-isolation` — every mock/ import resolves inside mock/
|
|
8
|
+
* - `spec` — re-run spec content validators on PRs touching
|
|
9
|
+
* specs/story-*.yaml (0.19.4-α / sc#146 #2)
|
|
8
10
|
*
|
|
9
11
|
* More to come (e.g. `mock-runtime-exports` to whitelist hooks vibe
|
|
10
12
|
* may import; `port-provenance` to verify src/ files copied via port
|
|
11
13
|
* carry the marker).
|
|
12
14
|
*/
|
|
13
15
|
import { runMockIsolationCheck } from "./mock-isolation.js";
|
|
16
|
+
import { runSpecValidateCli } from "./spec-validate.js";
|
|
14
17
|
export async function check(argv, _cliVersion) {
|
|
15
18
|
const sub = argv[0];
|
|
16
19
|
switch (sub) {
|
|
17
20
|
case "mock-isolation":
|
|
18
21
|
return runMockIsolationCli(argv.slice(1));
|
|
22
|
+
case "spec":
|
|
23
|
+
return runSpecValidateCli(argv.slice(1));
|
|
19
24
|
case undefined:
|
|
20
25
|
case "help":
|
|
21
26
|
case "--help":
|
|
@@ -34,11 +39,15 @@ slowcook check — static structural checks (0.16-α.13)
|
|
|
34
39
|
|
|
35
40
|
Usage:
|
|
36
41
|
slowcook check mock-isolation [--cwd <path>]
|
|
42
|
+
slowcook check spec [file...] [--cwd <path>]
|
|
37
43
|
|
|
38
44
|
Subcommands:
|
|
39
45
|
mock-isolation Verify every import in mock/ stays inside mock/.
|
|
40
46
|
Catches vibe-prompt slippage where a mock component
|
|
41
47
|
tries to import from the consumer's production src/.
|
|
48
|
+
spec Re-run spec content validators on one or more spec
|
|
49
|
+
files. Catches drift on amendment commits that
|
|
50
|
+
bypass refine's in-process lint.
|
|
42
51
|
|
|
43
52
|
Exit codes:
|
|
44
53
|
0 no violations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/check/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/check/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,IAAc,EAAE,WAAmB;IAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,gBAAgB;YACnB,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,KAAK,MAAM;YACT,OAAO,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC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AAM,wBAAwB,MAAM,CAAC,YAAY,aAAa,CACnH,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,CAAC,KAAK,CACX,yEAAyE;QACvE,8DAA8D,CACjE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook check spec [file...]` — 0.19.4-α (sc#146 finding 2).
|
|
3
|
+
*
|
|
4
|
+
* Re-runs the spec content validators (the same ones refine/agent.ts
|
|
5
|
+
* calls in-process at emit time) against one or more on-disk spec
|
|
6
|
+
* files. Designed for CI to catch drift on PRs that AMEND a spec
|
|
7
|
+
* post-merge — the in-process lint never fires on amendments because
|
|
8
|
+
* those go straight to git, bypassing refine.
|
|
9
|
+
*
|
|
10
|
+
* Three validators wrap one CLI:
|
|
11
|
+
* - validateAndRepairSpec — token truncation / shape repair
|
|
12
|
+
* - validateEntityFieldReferences — `entity.field` ↔ auto/backend-entities.md
|
|
13
|
+
* - validateComponentReuseShape — components_to_reuse mock mentions spec fields
|
|
14
|
+
*
|
|
15
|
+
* If `auto/backend-entities.md` is absent the entity-field check is
|
|
16
|
+
* skipped quietly (its `parseEntityCatalog` returns empty). Same for
|
|
17
|
+
* the mock reader when the mock/ tree is missing.
|
|
18
|
+
*
|
|
19
|
+
* Exit codes:
|
|
20
|
+
* 0 — no findings across all files
|
|
21
|
+
* 1 — at least one finding (printed)
|
|
22
|
+
* 2 — invocation error (unreadable file, parse failure, etc.)
|
|
23
|
+
*/
|
|
24
|
+
import { type SpecValidationFinding } from "../refine/spec-validate.js";
|
|
25
|
+
export interface SpecCheckPerFileResult {
|
|
26
|
+
file: string;
|
|
27
|
+
storyId: string | null;
|
|
28
|
+
findings: SpecValidationFinding[];
|
|
29
|
+
/** Set when the file couldn't be parsed at all (Zod / YAML failure). */
|
|
30
|
+
parseError?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SpecCheckResult {
|
|
33
|
+
perFile: SpecCheckPerFileResult[];
|
|
34
|
+
filesChecked: number;
|
|
35
|
+
totalFindings: number;
|
|
36
|
+
hasParseErrors: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run the check. If `specPaths` is given, validates exactly those
|
|
40
|
+
* files (used by CI which passes the PR's changed-files list). If
|
|
41
|
+
* empty/undefined, scans `specs/story-*.yaml`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runSpecValidateCheck(repoRoot: string, specPaths?: string[]): SpecCheckResult;
|
|
44
|
+
/** CLI wrapper. Wraps `runSpecValidateCheck`, prints, exits. */
|
|
45
|
+
export declare function runSpecValidateCli(argv: string[]): void;
|
|
46
|
+
//# sourceMappingURL=spec-validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-validate.d.ts","sourceRoot":"","sources":["../../../src/commands/check/spec-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,4BAA4B,CAAC;AAGpC,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAAE,GACnB,eAAe,CAuFjB;AA4BD,gEAAgE;AAChE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAgDvD"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook check spec [file...]` — 0.19.4-α (sc#146 finding 2).
|
|
3
|
+
*
|
|
4
|
+
* Re-runs the spec content validators (the same ones refine/agent.ts
|
|
5
|
+
* calls in-process at emit time) against one or more on-disk spec
|
|
6
|
+
* files. Designed for CI to catch drift on PRs that AMEND a spec
|
|
7
|
+
* post-merge — the in-process lint never fires on amendments because
|
|
8
|
+
* those go straight to git, bypassing refine.
|
|
9
|
+
*
|
|
10
|
+
* Three validators wrap one CLI:
|
|
11
|
+
* - validateAndRepairSpec — token truncation / shape repair
|
|
12
|
+
* - validateEntityFieldReferences — `entity.field` ↔ auto/backend-entities.md
|
|
13
|
+
* - validateComponentReuseShape — components_to_reuse mock mentions spec fields
|
|
14
|
+
*
|
|
15
|
+
* If `auto/backend-entities.md` is absent the entity-field check is
|
|
16
|
+
* skipped quietly (its `parseEntityCatalog` returns empty). Same for
|
|
17
|
+
* the mock reader when the mock/ tree is missing.
|
|
18
|
+
*
|
|
19
|
+
* Exit codes:
|
|
20
|
+
* 0 — no findings across all files
|
|
21
|
+
* 1 — at least one finding (printed)
|
|
22
|
+
* 2 — invocation error (unreadable file, parse failure, etc.)
|
|
23
|
+
*/
|
|
24
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
25
|
+
import { join, resolve, relative, basename } from "node:path";
|
|
26
|
+
import YAML from "yaml";
|
|
27
|
+
import { schemas } from "../refine/spec-yaml.js";
|
|
28
|
+
import { validateAndRepairSpec, validateEntityFieldReferences, validateComponentReuseShape, validateRouteCollisions, } from "../refine/spec-validate.js";
|
|
29
|
+
/**
|
|
30
|
+
* Run the check. If `specPaths` is given, validates exactly those
|
|
31
|
+
* files (used by CI which passes the PR's changed-files list). If
|
|
32
|
+
* empty/undefined, scans `specs/story-*.yaml`.
|
|
33
|
+
*/
|
|
34
|
+
export function runSpecValidateCheck(repoRoot, specPaths) {
|
|
35
|
+
const targets = specPaths && specPaths.length > 0
|
|
36
|
+
? specPaths.map((p) => (resolve(repoRoot, p)))
|
|
37
|
+
: discoverSpecs(repoRoot);
|
|
38
|
+
const entityCatalogPath = join(repoRoot, ".brewing", "repo-knowledge", "auto", "backend-entities.md");
|
|
39
|
+
const entityCatalogMd = existsSync(entityCatalogPath)
|
|
40
|
+
? readFileSync(entityCatalogPath, "utf8")
|
|
41
|
+
: "";
|
|
42
|
+
const mockReader = makeMockReader(repoRoot);
|
|
43
|
+
const perFile = [];
|
|
44
|
+
let totalFindings = 0;
|
|
45
|
+
let hasParseErrors = false;
|
|
46
|
+
for (const abs of targets) {
|
|
47
|
+
const rel = relative(repoRoot, abs);
|
|
48
|
+
const storyId = extractStoryId(rel);
|
|
49
|
+
if (!existsSync(abs)) {
|
|
50
|
+
perFile.push({
|
|
51
|
+
file: rel,
|
|
52
|
+
storyId,
|
|
53
|
+
findings: [],
|
|
54
|
+
parseError: "file not found",
|
|
55
|
+
});
|
|
56
|
+
hasParseErrors = true;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
let spec;
|
|
60
|
+
try {
|
|
61
|
+
const raw = YAML.parse(readFileSync(abs, "utf8"));
|
|
62
|
+
const parsed = schemas.Spec.safeParse(raw);
|
|
63
|
+
if (!parsed.success) {
|
|
64
|
+
perFile.push({
|
|
65
|
+
file: rel,
|
|
66
|
+
storyId,
|
|
67
|
+
findings: [],
|
|
68
|
+
parseError: parsed.error.issues
|
|
69
|
+
.map((i) => `${String(i.path.join("."))}: ${i.message}`)
|
|
70
|
+
.join("; "),
|
|
71
|
+
});
|
|
72
|
+
hasParseErrors = true;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
spec = parsed.data;
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
perFile.push({
|
|
79
|
+
file: rel,
|
|
80
|
+
storyId,
|
|
81
|
+
findings: [],
|
|
82
|
+
parseError: err instanceof Error ? err.message : String(err),
|
|
83
|
+
});
|
|
84
|
+
hasParseErrors = true;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const findings = [];
|
|
88
|
+
findings.push(...validateAndRepairSpec(spec));
|
|
89
|
+
if (entityCatalogMd) {
|
|
90
|
+
findings.push(...validateEntityFieldReferences(spec, entityCatalogMd));
|
|
91
|
+
}
|
|
92
|
+
findings.push(...validateComponentReuseShape(spec, mockReader));
|
|
93
|
+
// 0.19.4-α+ (sc#151 finding 3) — route-file collision check
|
|
94
|
+
findings.push(...validateRouteCollisions(spec, (relPath) => existsSync(resolve(repoRoot, relPath))));
|
|
95
|
+
totalFindings += findings.length;
|
|
96
|
+
perFile.push({ file: rel, storyId, findings });
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
perFile,
|
|
100
|
+
filesChecked: targets.length,
|
|
101
|
+
totalFindings,
|
|
102
|
+
hasParseErrors,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function discoverSpecs(repoRoot) {
|
|
106
|
+
const specsDir = join(repoRoot, "specs");
|
|
107
|
+
if (!existsSync(specsDir))
|
|
108
|
+
return [];
|
|
109
|
+
return readdirSync(specsDir)
|
|
110
|
+
.filter((f) => f.startsWith("story-") && f.endsWith(".yaml"))
|
|
111
|
+
.map((f) => join(specsDir, f));
|
|
112
|
+
}
|
|
113
|
+
function extractStoryId(relPath) {
|
|
114
|
+
const m = basename(relPath).match(/^story-(.+)\.yaml$/);
|
|
115
|
+
return m ? m[1] : null;
|
|
116
|
+
}
|
|
117
|
+
function makeMockReader(repoRoot) {
|
|
118
|
+
return (path) => {
|
|
119
|
+
const abs = resolve(repoRoot, path);
|
|
120
|
+
if (!existsSync(abs))
|
|
121
|
+
return null;
|
|
122
|
+
try {
|
|
123
|
+
if (statSync(abs).isFile())
|
|
124
|
+
return readFileSync(abs, "utf8");
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** CLI wrapper. Wraps `runSpecValidateCheck`, prints, exits. */
|
|
133
|
+
export function runSpecValidateCli(argv) {
|
|
134
|
+
let cwd = process.cwd();
|
|
135
|
+
const files = [];
|
|
136
|
+
for (let i = 0; i < argv.length; i++) {
|
|
137
|
+
const a = argv[i];
|
|
138
|
+
if (a === "--cwd" && argv[i + 1]) {
|
|
139
|
+
cwd = argv[i + 1];
|
|
140
|
+
i++;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (a === "--help" || a === "-h") {
|
|
144
|
+
printHelp();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
files.push(a);
|
|
148
|
+
}
|
|
149
|
+
const result = runSpecValidateCheck(cwd, files);
|
|
150
|
+
if (result.filesChecked === 0) {
|
|
151
|
+
console.log(`slowcook check spec: no spec files matched (expected specs/story-*.yaml or explicit paths).`);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
let exitCode = 0;
|
|
155
|
+
for (const f of result.perFile) {
|
|
156
|
+
if (f.parseError) {
|
|
157
|
+
console.error(`FAIL ${f.file} — parse error: ${f.parseError}`);
|
|
158
|
+
exitCode = 2;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (f.findings.length === 0) {
|
|
162
|
+
console.log(`PASS ${f.file}`);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
console.error(`FAIL ${f.file} — ${f.findings.length} finding(s):`);
|
|
166
|
+
for (const finding of f.findings) {
|
|
167
|
+
console.error(` [${finding.action}] ${finding.path} — ${finding.message}`);
|
|
168
|
+
}
|
|
169
|
+
if (exitCode === 0)
|
|
170
|
+
exitCode = 1;
|
|
171
|
+
}
|
|
172
|
+
console.error("");
|
|
173
|
+
console.error(`slowcook check spec: ${result.totalFindings} finding(s) across ${result.filesChecked} file(s).`);
|
|
174
|
+
if (exitCode !== 0)
|
|
175
|
+
process.exit(exitCode);
|
|
176
|
+
}
|
|
177
|
+
function printHelp() {
|
|
178
|
+
console.log(`
|
|
179
|
+
slowcook check spec — re-run spec content validators on PRs that touch specs/story-*.yaml
|
|
180
|
+
|
|
181
|
+
Usage:
|
|
182
|
+
slowcook check spec [file...] [--cwd <path>]
|
|
183
|
+
|
|
184
|
+
Files default to specs/story-*.yaml when none are passed. CI workflows
|
|
185
|
+
should pass the PR's changed-files list so the check stays narrow.
|
|
186
|
+
|
|
187
|
+
Validators run:
|
|
188
|
+
- validateAndRepairSpec — token truncation / shape repair
|
|
189
|
+
- validateEntityFieldReferences — entity.field references vs
|
|
190
|
+
.brewing/repo-knowledge/auto/backend-entities.md
|
|
191
|
+
- validateComponentReuseShape — proposals.ui_layout.components_to_reuse
|
|
192
|
+
mock-vs-spec field overlap
|
|
193
|
+
|
|
194
|
+
Auto-skips checks whose context is missing (no entity catalog → skip
|
|
195
|
+
entity-field check; no mock/ tree → skip reuse-shape check).
|
|
196
|
+
|
|
197
|
+
Exit codes:
|
|
198
|
+
0 no findings
|
|
199
|
+
1 at least one finding
|
|
200
|
+
2 invocation error (parse failure, missing file)
|
|
201
|
+
`);
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=spec-validate.js.map
|