@slowcook-ai/cli 0.19.0-alpha.1 → 0.19.0-alpha.14
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/AGENTS.md +212 -0
- package/REPORTING.md +154 -0
- package/dist/cli.js +36 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/brew/agent.d.ts +129 -0
- package/dist/commands/brew/agent.d.ts.map +1 -1
- package/dist/commands/brew/agent.js +132 -0
- package/dist/commands/brew/agent.js.map +1 -1
- package/dist/commands/brew/index.d.ts.map +1 -1
- package/dist/commands/brew/index.js +72 -0
- package/dist/commands/brew/index.js.map +1 -1
- package/dist/commands/brew/pair-navigator.d.ts +112 -0
- package/dist/commands/brew/pair-navigator.d.ts.map +1 -0
- package/dist/commands/brew/pair-navigator.js +183 -0
- package/dist/commands/brew/pair-navigator.js.map +1 -0
- package/dist/commands/chef/drift-fix.d.ts +1 -1
- package/dist/commands/chef/drift-fix.d.ts.map +1 -1
- package/dist/commands/chef/drift-fix.js +36 -15
- package/dist/commands/chef/drift-fix.js.map +1 -1
- package/dist/commands/chef/index.js +13 -3
- package/dist/commands/chef/index.js.map +1 -1
- package/dist/commands/chef/orchestrate.d.ts +34 -0
- package/dist/commands/chef/orchestrate.d.ts.map +1 -0
- package/dist/commands/chef/orchestrate.js +408 -0
- package/dist/commands/chef/orchestrate.js.map +1 -0
- package/dist/commands/docs/index.d.ts +16 -0
- package/dist/commands/docs/index.d.ts.map +1 -0
- package/dist/commands/docs/index.js +127 -0
- package/dist/commands/docs/index.js.map +1 -0
- package/dist/commands/init/mock.d.ts +46 -0
- package/dist/commands/init/mock.d.ts.map +1 -1
- package/dist/commands/init/mock.js +142 -2
- package/dist/commands/init/mock.js.map +1 -1
- package/dist/commands/recon/index.d.ts +1 -1
- package/dist/commands/recon/index.d.ts.map +1 -1
- package/dist/commands/recon/index.js +293 -6
- package/dist/commands/recon/index.js.map +1 -1
- package/dist/commands/recon/reuse.d.ts +150 -0
- package/dist/commands/recon/reuse.d.ts.map +1 -0
- package/dist/commands/recon/reuse.js +335 -0
- package/dist/commands/recon/reuse.js.map +1 -0
- package/dist/commands/recon/shape-preserve.d.ts +46 -0
- package/dist/commands/recon/shape-preserve.d.ts.map +1 -1
- package/dist/commands/recon/shape-preserve.js +126 -0
- package/dist/commands/recon/shape-preserve.js.map +1 -1
- package/dist/commands/recon/stale-stubs.d.ts +65 -0
- package/dist/commands/recon/stale-stubs.d.ts.map +1 -0
- package/dist/commands/recon/stale-stubs.js +84 -0
- package/dist/commands/recon/stale-stubs.js.map +1 -0
- package/dist/commands/refactor/index.d.ts +15 -0
- package/dist/commands/refactor/index.d.ts.map +1 -0
- package/dist/commands/refactor/index.js +126 -0
- package/dist/commands/refactor/index.js.map +1 -0
- package/dist/commands/refactor/score.d.ts +38 -0
- package/dist/commands/refactor/score.d.ts.map +1 -0
- package/dist/commands/refactor/score.js +79 -0
- package/dist/commands/refactor/score.js.map +1 -0
- package/dist/commands/refactor/types.d.ts +64 -0
- package/dist/commands/refactor/types.d.ts.map +1 -0
- package/dist/commands/refactor/types.js +26 -0
- package/dist/commands/refactor/types.js.map +1 -0
- package/dist/lib/read-only.d.ts +22 -0
- package/dist/lib/read-only.d.ts.map +1 -0
- package/dist/lib/read-only.js +34 -0
- package/dist/lib/read-only.js.map +1 -0
- package/package.json +7 -5
package/AGENTS.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# slowcook for AI agents
|
|
2
|
+
|
|
3
|
+
You're an AI coding agent (Claude Code, Cursor, etc.) helping a human
|
|
4
|
+
ship features through slowcook. **This doc is the canonical entry
|
|
5
|
+
point.** Read it before running any `slowcook` command.
|
|
6
|
+
|
|
7
|
+
> Forge support today: **GitHub only.** No GitLab/Bitbucket adapter
|
|
8
|
+
> ships yet. If the consumer's repo is on a different forge, slowcook
|
|
9
|
+
> won't run — escalate that to the human.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Decision tree (start here)
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
What is the human asking?
|
|
17
|
+
|
|
18
|
+
├── "set up slowcook on this repo"
|
|
19
|
+
│ ├── greenfield (no src/) → `slowcook init`
|
|
20
|
+
│ └── brownfield (existing src/) → `slowcook init from-prod`
|
|
21
|
+
│ then `slowcook init entities`
|
|
22
|
+
│
|
|
23
|
+
├── "ship a feature / story"
|
|
24
|
+
│ ├── 1. Human files a GitHub issue describing the feature
|
|
25
|
+
│ │ (you may help draft it; final wording is theirs)
|
|
26
|
+
│ ├── 2. `gh workflow run slowcook-refine.yml -f issue=<num>`
|
|
27
|
+
│ │ → refine asks clarifying questions on the issue
|
|
28
|
+
│ ├── 3. Human answers; refine emits a spec PR
|
|
29
|
+
│ ├── 4. Human merges spec PR; vibe + recipe (testgen) workflows
|
|
30
|
+
│ │ auto-dispatch and open mockup + tests PRs
|
|
31
|
+
│ ├── 5. Human merges mockup + tests; `slowcook brew` workflow
|
|
32
|
+
│ │ auto-dispatches and opens a brew PR
|
|
33
|
+
│ ├── 6. If brew halts: chef-drift auto-dispatches; if
|
|
34
|
+
│ │ chef-drift exits 1 in --pr mode the workflow chains
|
|
35
|
+
│ │ to chef-orchestrate (decides redispatch / rebase /
|
|
36
|
+
│ │ escalate / close)
|
|
37
|
+
│ └── 7. All-green brew PR ships
|
|
38
|
+
│
|
|
39
|
+
├── "investigate a bug filed on the consumer's repo"
|
|
40
|
+
│ ├── `slowcook investigate --issue <num>` emits bug-profile
|
|
41
|
+
│ └── then `slowcook recipe --regression` emits a failing test
|
|
42
|
+
│
|
|
43
|
+
├── "audit my codebase for refactors / dead stubs"
|
|
44
|
+
│ ├── `slowcook recon --reuse-scan` near-duplicate components
|
|
45
|
+
│ ├── `slowcook recon --stub-scan` stale @slowcook-stub markers
|
|
46
|
+
│ └── `slowcook refactor` ranks proposals.json
|
|
47
|
+
│
|
|
48
|
+
└── "I'm reproducing a slowcook bug"
|
|
49
|
+
→ read REPORTING.md (or `slowcook docs reporting`)
|
|
50
|
+
→ set SLOWCOOK_READ_ONLY=1 before running anything on
|
|
51
|
+
someone else's repo
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Pipeline at a glance
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
issue
|
|
60
|
+
│
|
|
61
|
+
▼
|
|
62
|
+
refine ────────► spec PR ────────► (merge)
|
|
63
|
+
│
|
|
64
|
+
├──► vibe ────► mockup PR
|
|
65
|
+
│ │
|
|
66
|
+
│ ▼ (merge)
|
|
67
|
+
│
|
|
68
|
+
└──► recipe ────► tests PR
|
|
69
|
+
│
|
|
70
|
+
▼ (merge)
|
|
71
|
+
│
|
|
72
|
+
▼
|
|
73
|
+
port
|
|
74
|
+
│
|
|
75
|
+
▼
|
|
76
|
+
recon (gate)
|
|
77
|
+
│
|
|
78
|
+
▼
|
|
79
|
+
brew ──┐
|
|
80
|
+
│ │
|
|
81
|
+
(halt: AGENT_STALLED, │
|
|
82
|
+
MOCKUP_DESIGN_CONFLICT,│
|
|
83
|
+
MANIFEST_DRIFT, ...) │
|
|
84
|
+
│ │
|
|
85
|
+
▼ │
|
|
86
|
+
chef-drift ─┤
|
|
87
|
+
(exit 1? │
|
|
88
|
+
auto-chains │
|
|
89
|
+
to ...) │
|
|
90
|
+
│ │
|
|
91
|
+
▼ │
|
|
92
|
+
chef-orchestrate
|
|
93
|
+
├── escalate (PM)
|
|
94
|
+
├── close (superseded)
|
|
95
|
+
├── rebase (BEHIND main)
|
|
96
|
+
└── redispatch_brew
|
|
97
|
+
│
|
|
98
|
+
▼
|
|
99
|
+
back to brew or done
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Per-command quick reference
|
|
105
|
+
|
|
106
|
+
All commands accept `--help` for full flag listings. One-line summaries:
|
|
107
|
+
|
|
108
|
+
| Command | What it does | Cost / time |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `slowcook init` | Scaffold slowcook into a greenfield project (workflows, mock dir, etc.) | $0 / <1 min |
|
|
111
|
+
| `slowcook init from-prod` | Brownfield: emit `mock/` from `src/` per 4-strategy taxonomy | $0 / <1 min |
|
|
112
|
+
| `slowcook init entities` | Walk `supabase/migrations/*.sql` → emit per-table TS interface + zod schema | $0 / seconds |
|
|
113
|
+
| `slowcook init mock` | Add `mock/` skeleton + auto-wire pnpm workspace if applicable | $0 / seconds |
|
|
114
|
+
| `slowcook refine` | Read source issue, ask clarifying questions, emit spec yaml + PR | ~$0.50–1.50 |
|
|
115
|
+
| `slowcook vibe` | Read spec, emit mockup PR (mock-runtime React app) | ~$1–2 |
|
|
116
|
+
| `slowcook plate` | Apply `/plate <instruction>` PR-comment amendments to a mockup PR | ~$0.30–1.50 |
|
|
117
|
+
| `slowcook recipe` | (= `testgen`) emit tier-1 + tier-2 acceptance tests | ~$1–2 |
|
|
118
|
+
| `slowcook port` | Deterministic copy `mock/src/*` → `src/*`, rewrite mock-runtime imports | $0 / seconds |
|
|
119
|
+
| `slowcook recon` | Pre-brew structural backstop (renames + testid gaps + history conflicts) | $0 / seconds |
|
|
120
|
+
| `slowcook recon --reuse-scan` | Story-agnostic: flag near-duplicate components/APIs | $0 / seconds |
|
|
121
|
+
| `slowcook recon --stub-scan` | Find `@slowcook-stub` markers older than `--stub-max-age-days` | $0 / seconds |
|
|
122
|
+
| `slowcook brew [--with-navigator]` | Ratcheted implementation loop. `--with-navigator` adds pair-brew (~10–20% cost surcharge) | ~$0.50–3 |
|
|
123
|
+
| `slowcook brew --pair-sim` | Local-only pair-brew simulator (driver+navigator over a fixture) | varies |
|
|
124
|
+
| `slowcook chef --pr <n>` | Classify failing PR (self-fail / external / infra / out-of-date) | $0 (deterministic) |
|
|
125
|
+
| `slowcook chef-drift` | Surgical drift-fixer: triggered on mock-isolation / recon escalation / brew halt | ~$0.05–0.50/move |
|
|
126
|
+
| `slowcook chef-orchestrate --pr <n> --story <id>` | Decide redispatch_brew / rebase / escalate / close on a halted PR | ~$0.01–0.05 |
|
|
127
|
+
| `slowcook investigate --issue <n>` | Diagnose a bug from a GitHub issue, emit bug-profile JSON | ~$1–3 |
|
|
128
|
+
| `slowcook recipe --regression --bug-profile <path>` | Emit failing regression test for a sift'd bug | ~$0.50–1 |
|
|
129
|
+
| `slowcook sift --bug-profile <path>` | Narrow red→green ratchet for a bug fix, bounded by `fix_scope` | ~$0.50–2 |
|
|
130
|
+
| `slowcook refactor` | Read `.brewing/refactor/proposals.json`, rank by benefit/cost | $0 |
|
|
131
|
+
| `slowcook docs <topic>` | Print bundled doc (`reporting`, `agents`, `read-only`) | $0 |
|
|
132
|
+
| `slowcook help` | List all commands | $0 |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Pitfalls memory (read this — saves real money + time)
|
|
137
|
+
|
|
138
|
+
These are empirical lessons from the consumer dogfood. Treat them as
|
|
139
|
+
non-negotiable defaults unless the user specifically overrides.
|
|
140
|
+
|
|
141
|
+
### Publishing / packaging
|
|
142
|
+
|
|
143
|
+
- **Always `pnpm publish`, never `npm publish`.** npm leaves
|
|
144
|
+
`workspace:^` unresolved → consumers hit `EUNSUPPORTEDPROTOCOL`. Use
|
|
145
|
+
`pnpm publish --tag alpha --no-git-checks` (or whichever tag).
|
|
146
|
+
- **Build before publish, every time.** `prepublishOnly: tsc -b` is
|
|
147
|
+
the guard but verify `dist/` is fresh. Stale dist has shipped before.
|
|
148
|
+
- **Update README / CHANGELOG every point release.** Status table, line
|
|
149
|
+
per release. Don't accumulate undocumented alphas.
|
|
150
|
+
|
|
151
|
+
### pnpm + Next.js
|
|
152
|
+
|
|
153
|
+
- For consumers using Next.js + pnpm workspace, set `node-linker=hoisted`
|
|
154
|
+
in `.npmrc`. Default symlink layout breaks Next 16's turbopack root
|
|
155
|
+
inference (`couldn't find next/package.json from project directory`).
|
|
156
|
+
- `slowcook init mock` auto-wires the workspace when it detects pnpm.
|
|
157
|
+
npm/yarn consumers see a recommendation, not auto-migration (lockfile
|
|
158
|
+
re-resolution risk).
|
|
159
|
+
|
|
160
|
+
### Chef stack
|
|
161
|
+
|
|
162
|
+
- **Chef never edits `tests/`, `vitest.config.*`, or `.brewing/auto-gen/`.**
|
|
163
|
+
These are frozen. If the only fix requires a test edit, chef returns
|
|
164
|
+
`pm_question`.
|
|
165
|
+
- **Chef-drift uses `search_replace` only**, never full-file regeneration.
|
|
166
|
+
Find string must appear exactly once in target.
|
|
167
|
+
- **Chef-orchestrate prefers `escalate` on ties.** PM is the safety valve.
|
|
168
|
+
|
|
169
|
+
### Brew
|
|
170
|
+
|
|
171
|
+
- **Brew can't fix test infrastructure.** If the failure is in
|
|
172
|
+
`vitest.config.*` or `tests/_setup/`, brew will halt repeatedly. The
|
|
173
|
+
fix is upstream in slowcook, not in the consumer's code.
|
|
174
|
+
- **`--with-navigator` adds 10–20% spend** (a navigator LLM call per
|
|
175
|
+
iteration). Skip it on simple stories; use it when soft-prompt steering
|
|
176
|
+
needs hardening.
|
|
177
|
+
|
|
178
|
+
### Refine + spec
|
|
179
|
+
|
|
180
|
+
- **PM intent in the issue body + first refine answer is contractual.**
|
|
181
|
+
Refine cannot silently weaken (e.g., "similar to feed" → "emoji is a
|
|
182
|
+
later concern" is forbidden). Only an explicit later PM comment can.
|
|
183
|
+
- **Side-effects audit (0.18+):** when refine detects contradiction with
|
|
184
|
+
a prior story, it enumerates the exact assertions that would need to
|
|
185
|
+
flip. PM reviews granularly.
|
|
186
|
+
|
|
187
|
+
### Workflows
|
|
188
|
+
|
|
189
|
+
- **Self-hosted runners need `gh` CLI.** Slowcook's chef-drift workflow
|
|
190
|
+
installs it via the no-sudo binary. If you write a new workflow, add
|
|
191
|
+
the same step.
|
|
192
|
+
- **Chef-drift exit 1 auto-chains to chef-orchestrate** in the rewo
|
|
193
|
+
reference workflow shape. Mirror this if you wire your own.
|
|
194
|
+
|
|
195
|
+
### When something goes wrong
|
|
196
|
+
|
|
197
|
+
- **Read [REPORTING.md](./REPORTING.md)** (or `slowcook docs reporting`)
|
|
198
|
+
before filing a bug. Don't bundle artifacts; share URLs.
|
|
199
|
+
- **Use `SLOWCOOK_READ_ONLY=1`** when reproducing a bug on someone else's
|
|
200
|
+
repo. Blocks every GitHub-side write.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## What to read next
|
|
205
|
+
|
|
206
|
+
- [README.md](./README.md) — the marketing overview + status table
|
|
207
|
+
- [REPORTING.md](./REPORTING.md) — how to file a slowcook bug
|
|
208
|
+
- [docs/plans/](./docs/plans/) — the roadmap / design docs (if a story
|
|
209
|
+
references one, read it before running the agent)
|
|
210
|
+
|
|
211
|
+
If anything in this doc is wrong or outdated, file a slowcook issue
|
|
212
|
+
following the REPORTING.md recipe.
|
package/REPORTING.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Reporting a slowcook bug
|
|
2
|
+
|
|
3
|
+
Slowcook runs across several agents (refine / vibe / plate / testgen /
|
|
4
|
+
brew / chef / recon) and several surfaces (issues, PRs, workflow logs,
|
|
5
|
+
artifacts). When something goes wrong, the maintainer needs the full
|
|
6
|
+
reproduction context — but **we deliberately don't accept artifact
|
|
7
|
+
uploads or "report bundles."** Real-data fragments (database rows,
|
|
8
|
+
user emails, draft spec text) often live inside slowcook prompts; a
|
|
9
|
+
bundler is hard to verify against secret leakage. Instead we lean on
|
|
10
|
+
GitHub-native surfaces that you control.
|
|
11
|
+
|
|
12
|
+
> **Forge support today: GitHub only.** Slowcook's `forge` adapter
|
|
13
|
+
> currently has one implementation: `@slowcook-ai/forge-github`. GitLab,
|
|
14
|
+
> Bitbucket, etc. are architecturally possible (the core defines a
|
|
15
|
+
> `ForgeAdapter` interface) but no other adapter is published. If your
|
|
16
|
+
> consumer repo lives on GitLab, slowcook won't run today.
|
|
17
|
+
|
|
18
|
+
This doc covers how to file a bug for both **public OSS repos** and
|
|
19
|
+
**private repos** (both on GitHub).
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## OSS / public repos (default path)
|
|
24
|
+
|
|
25
|
+
If your repo is public + Actions logs are public (the default),
|
|
26
|
+
**share four URLs** in a slowcook GitHub issue:
|
|
27
|
+
|
|
28
|
+
1. **Source-issue URL** — the issue that started the story (e.g.,
|
|
29
|
+
`https://github.com/<you>/<repo>/issues/149`). This carries the
|
|
30
|
+
full refine Q&A trail + every agent's `slowcook:cost` markers
|
|
31
|
+
for the story.
|
|
32
|
+
2. **PR URL(s)** — whichever slowcook-bot PRs are involved
|
|
33
|
+
(`/spec/`, `/mockup/`, `/tests/`, `/brew/`).
|
|
34
|
+
3. **Workflow run URL** — the specific failed run (e.g.,
|
|
35
|
+
`https://github.com/<you>/<repo>/actions/runs/25381565696`).
|
|
36
|
+
Logs are public; artifacts (`.brewing/chef/`, `.brewing/chef-drift-input/`,
|
|
37
|
+
etc.) are downloadable.
|
|
38
|
+
4. **What you expected vs. what happened** — one-paragraph summary.
|
|
39
|
+
|
|
40
|
+
That's it. Maintainer reads the workflow log + downloads artifacts
|
|
41
|
+
without needing any access from you.
|
|
42
|
+
|
|
43
|
+
### Reproducing locally
|
|
44
|
+
|
|
45
|
+
You can reproduce the exact LLM input chef-drift saw by:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# 1. Download the chef-drift artifact from the failing run
|
|
49
|
+
gh run download <run-id> -n chef-drift-story-<id> -D /tmp/chef-drift-repro
|
|
50
|
+
|
|
51
|
+
# 2. Re-dispatch chef-drift locally with the captured input
|
|
52
|
+
cd <your-repo>
|
|
53
|
+
ANTHROPIC_API_KEY=... slowcook chef-drift \
|
|
54
|
+
--story <id> \
|
|
55
|
+
--trigger brew_halt_class \
|
|
56
|
+
--trigger-detail "..." \
|
|
57
|
+
--trigger-raw /tmp/chef-drift-repro/halt-trigger.json \
|
|
58
|
+
--dry-run
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Same input → same prompt → reproducible LLM output (modulo
|
|
62
|
+
inherent stochasticity, which Anthropic's `temperature=0` minimises).
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Private repos
|
|
67
|
+
|
|
68
|
+
If your repo is private, neither logs nor artifacts are visible to
|
|
69
|
+
the slowcook maintainer. Two options:
|
|
70
|
+
|
|
71
|
+
### Preferred: read-only triage role for the duration of the bug
|
|
72
|
+
|
|
73
|
+
In your GitHub repo settings → Collaborators → add **`@aminazar`**
|
|
74
|
+
(slowcook's maintainer today; check the [repo](https://github.com/aminazar/slowcook)
|
|
75
|
+
for the current owner) as a **Triage** role. That gives them:
|
|
76
|
+
|
|
77
|
+
- Read access to source, PRs, issues, workflow logs, artifacts
|
|
78
|
+
- No ability to push, merge, change settings, or run actions
|
|
79
|
+
|
|
80
|
+
When the bug is resolved (or after a fixed window — 7 days is a
|
|
81
|
+
reasonable default), revoke. @aminazar doesn't expect indefinite
|
|
82
|
+
access.
|
|
83
|
+
|
|
84
|
+
### Fallback: scoped read-only PAT
|
|
85
|
+
|
|
86
|
+
If you'd rather not add a collaborator, generate a fine-grained
|
|
87
|
+
Personal Access Token with **read-only** scope on **just that one
|
|
88
|
+
repo** + only the permissions slowcook needs:
|
|
89
|
+
|
|
90
|
+
- `Contents: Read`
|
|
91
|
+
- `Issues: Read`
|
|
92
|
+
- `Pull requests: Read`
|
|
93
|
+
- `Actions: Read`
|
|
94
|
+
|
|
95
|
+
Share via 1Password or a similar trusted channel. Maintainer uses it
|
|
96
|
+
for the bug investigation only + revokes when done.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## What slowcook does NOT accept
|
|
101
|
+
|
|
102
|
+
- **Artifact uploads / log bundles via email or chat.** Real-data
|
|
103
|
+
fragments live inside agent prompts (a brew agent's prompt
|
|
104
|
+
includes test fixture rows that may have realistic-looking user
|
|
105
|
+
emails; a refine agent's prompt includes the spec body). A
|
|
106
|
+
bundler can't verifiably scrub these. We won't accept the risk.
|
|
107
|
+
- **Auto-telemetry.** No slowcook command phones home or sends usage
|
|
108
|
+
data to the maintainer. Cost / activity is visible to YOU via the
|
|
109
|
+
`slowcook:cost` markers on your own GitHub issues + PRs;
|
|
110
|
+
aggregating it for someone else is your call, not ours.
|
|
111
|
+
- **Direct API key sharing.** If a bug needs the maintainer to
|
|
112
|
+
re-run an agent live (rare), they can run it under their own
|
|
113
|
+
ANTHROPIC_API_KEY — never yours.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Cost-marker recipe (handy for bug reports)
|
|
118
|
+
|
|
119
|
+
Every agent in the slowcook pipeline emits an HTML cost marker on
|
|
120
|
+
its comments. To see what your story cost / which agent did what:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
gh issue view <issue-num> --comments | grep "slowcook:cost"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Output looks like:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
<!-- slowcook:cost agent=refine usd=0.4630 round=questions ... -->
|
|
130
|
+
<!-- slowcook:cost agent=refine usd=0.6514 round=spec ... -->
|
|
131
|
+
<!-- slowcook:cost agent=testgen usd=0.6134 ... -->
|
|
132
|
+
<!-- slowcook:cost agent=brew usd=0.6291 iterations=3 halted=AGENT_STALLED_NO_EDITS ... -->
|
|
133
|
+
<!-- slowcook:cost agent=chef-drift usd=0.0123 decision=halt move=1 ... -->
|
|
134
|
+
<!-- slowcook:cost agent=chef-orchestrate usd=0.0123 kind=close pr=153 ... -->
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
When filing a bug, you can paste the relevant markers directly into
|
|
138
|
+
the issue — they're machine-readable + identify the involved agent
|
|
139
|
+
without any custom bundling.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Where to file
|
|
144
|
+
|
|
145
|
+
- **Public bug reports**: <https://github.com/aminazar/slowcook/issues>
|
|
146
|
+
- **Private bug reports** (when artifacts can't be public): same repo,
|
|
147
|
+
**but file a public issue** with the description + your reproduction
|
|
148
|
+
arrangement. Don't paste private logs into a public issue. The
|
|
149
|
+
maintainer responds with the access path that works for your setup.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
*This doc is intentionally short. Read [AGENTS.md](./AGENTS.md) for
|
|
154
|
+
the slowcook architecture overview.*
|
package/dist/cli.js
CHANGED
|
@@ -83,7 +83,10 @@ Commands available in ${VERSION}:
|
|
|
83
83
|
recipe Generate Vitest tests from merged specs (a "recipe" — the test contract brew follows). Aliases: testgen.
|
|
84
84
|
investigate (alpha.2a, scaffold) Diagnose a bug from a GitHub issue and emit a bug-profile.
|
|
85
85
|
sift (alpha.4) Narrow red→green ratchet for a bug fix; bounded by bug-profile fix_scope.
|
|
86
|
-
chef (alpha.5c)
|
|
86
|
+
chef (alpha.5c) PR-CI failure classifier — dispatches retry / escalate based on check status.
|
|
87
|
+
chef-drift (0.18.0-α.9 L1) Surgical drift-fixer. Triggered by mock-isolation / recon / brew / navigator halts.
|
|
88
|
+
chef-orchestrate (0.19.0-α.2 L3) Pipeline orchestrator. Decides redispatch_brew / rebase / escalate / close on a halted PR.
|
|
89
|
+
refactor (0.19.0-α.7) Rank refactor proposals by benefit/cost. Reads .brewing/refactor/proposals.json.
|
|
87
90
|
catchup Detect + run pipeline steps that should have triggered but didn't.
|
|
88
91
|
brew Ratcheted implementation loop: flip red tests to green for one story.
|
|
89
92
|
map Generate / check the repo-wide code map (APIs, pages, components, helpers, types).
|
|
@@ -194,6 +197,18 @@ async function main() {
|
|
|
194
197
|
await chefDrift(args.slice(1), VERSION);
|
|
195
198
|
return;
|
|
196
199
|
}
|
|
200
|
+
case "chef-orchestrate":
|
|
201
|
+
// 0.19.0-α.2 L3 — chef as pipeline orchestrator. Reads the chef-
|
|
202
|
+
// drift ledger + PR state + spec + open PRs and decides between
|
|
203
|
+
// redispatch_brew / rebase / escalate / close. Sibling to chef-
|
|
204
|
+
// drift; runs AFTER chef-drift halts. α.0 implements escalate +
|
|
205
|
+
// close end-to-end; redispatch + rebase persist the verdict for
|
|
206
|
+
// a follow-up workflow step to act on.
|
|
207
|
+
{
|
|
208
|
+
const { chefOrchestrate } = await import("./commands/chef/orchestrate.js");
|
|
209
|
+
await chefOrchestrate(args.slice(1), VERSION);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
197
212
|
case "map":
|
|
198
213
|
await map(args.slice(1), VERSION);
|
|
199
214
|
return;
|
|
@@ -203,6 +218,26 @@ async function main() {
|
|
|
203
218
|
// context without paying for `map generate`'s full ts-morph scan.
|
|
204
219
|
await extract(args.slice(1), VERSION);
|
|
205
220
|
return;
|
|
221
|
+
case "refactor":
|
|
222
|
+
// 0.19.0-α.7 — refactor command (#64). Reads candidate refactor
|
|
223
|
+
// proposals from .brewing/refactor/proposals.json, filters by
|
|
224
|
+
// --scope patterns, ranks by benefit/cost. α.7 ships
|
|
225
|
+
// ranking + reporting only; LLM-backed proposal generation +
|
|
226
|
+
// auto-application land in later alphas.
|
|
227
|
+
{
|
|
228
|
+
const { refactor } = await import("./commands/refactor/index.js");
|
|
229
|
+
await refactor(args.slice(1), VERSION);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
case "docs":
|
|
233
|
+
// 0.19.0-α.13 — `slowcook docs <topic>` prints bundled docs.
|
|
234
|
+
// Useful when an agent / maintainer is on a fresh box without a
|
|
235
|
+
// cloned slowcook repo. Topics: reporting, agents, read-only.
|
|
236
|
+
{
|
|
237
|
+
const { docs } = await import("./commands/docs/index.js");
|
|
238
|
+
await docs(args.slice(1), VERSION);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
206
241
|
case "vibe":
|
|
207
242
|
// 0.15.0-α.1 — design-first mockup generator (plate-pipeline α.1).
|
|
208
243
|
// Reads spec + brownfield extracts + code-map; emits a runnable
|
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,E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AI;YACP,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;YACnC,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI;YACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO;QACT;YACE,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;IACjC,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -47,7 +47,136 @@ export interface BrewContext {
|
|
|
47
47
|
* editing a frozen UI file.
|
|
48
48
|
*/
|
|
49
49
|
mode?: "legacy" | "plate";
|
|
50
|
+
/**
|
|
51
|
+
* 0.19.0-alpha.4 — pair-brew navigator hook (production wiring of
|
|
52
|
+
* the validated pair-sim experiment). Fires AFTER the iteration's
|
|
53
|
+
* existing regression / no-progress checks have passed, BEFORE the
|
|
54
|
+
* checkpoint is committed. Use it to add a "design fidelity / cross-
|
|
55
|
+
* story risk / responsive / accessibility" verdict beyond what
|
|
56
|
+
* vitest can observe.
|
|
57
|
+
*
|
|
58
|
+
* Returning a verdict with `overall: "block"` causes the iteration
|
|
59
|
+
* to revert + treat as a no-progress iter (its concerns fold into
|
|
60
|
+
* the next iter's `prior_attempts` history). Returning null OR a
|
|
61
|
+
* non-block verdict lets the iteration proceed to checkpoint as
|
|
62
|
+
* normal.
|
|
63
|
+
*
|
|
64
|
+
* Default: undefined — no behavioral change vs pre-α.4 brew. Inject
|
|
65
|
+
* via the cli's `--with-navigator` flag (wired up in α.5+) or via
|
|
66
|
+
* a unit-test stub.
|
|
67
|
+
*/
|
|
68
|
+
navigatorHook?: NavigatorHook;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 0.19.0-alpha.4 — interface for the pair-brew navigator review.
|
|
72
|
+
* Pure I/O contract; brew/agent.ts calls it with iteration context
|
|
73
|
+
* and consumes the verdict deterministically. The default Anthropic-
|
|
74
|
+
* backed implementation lives in `pair-navigator.ts`; tests inject
|
|
75
|
+
* a stub.
|
|
76
|
+
*/
|
|
77
|
+
export interface NavigatorHook {
|
|
78
|
+
/**
|
|
79
|
+
* Called after a successful iteration's existing checks pass + before
|
|
80
|
+
* the checkpoint is committed. Implementations may call an LLM, do
|
|
81
|
+
* static analysis, or return null to abstain.
|
|
82
|
+
*
|
|
83
|
+
* @returns null when the navigator abstains (no opinion / disabled
|
|
84
|
+
* for this iter); a NavigatorHookVerdict otherwise.
|
|
85
|
+
*/
|
|
86
|
+
review(input: NavigatorHookInput): Promise<NavigatorHookVerdict | null>;
|
|
87
|
+
}
|
|
88
|
+
export interface NavigatorHookInput {
|
|
89
|
+
iteration: number;
|
|
90
|
+
storyId: string;
|
|
91
|
+
/** Files changed by this iteration. */
|
|
92
|
+
filesTouched: string[];
|
|
93
|
+
/** Diff lines added in this iteration. */
|
|
94
|
+
linesAdded: number;
|
|
95
|
+
/** Diff lines removed in this iteration. */
|
|
96
|
+
linesRemoved: number;
|
|
97
|
+
/** Driver's stated rationale for the changes. */
|
|
98
|
+
rationale: string;
|
|
99
|
+
/** Tests that just went red→green this iter. */
|
|
100
|
+
gainedTests: string[];
|
|
101
|
+
/** Repo root, so the hook can read additional context if needed. */
|
|
102
|
+
repoRoot: string;
|
|
103
|
+
}
|
|
104
|
+
export interface NavigatorHookVerdict {
|
|
105
|
+
overall: "approve" | "block";
|
|
106
|
+
/** Per-axis concerns; surfaced in audit + folded into next iter on block. */
|
|
107
|
+
concerns: string[];
|
|
108
|
+
/** Cost incurred (USD). Tracked against budget by callers that care. */
|
|
109
|
+
costUsd?: number;
|
|
110
|
+
/**
|
|
111
|
+
* 0.19.0-alpha.5 (#77) — when navigator's soft signals (concerns
|
|
112
|
+
* folded into prompts) have been ignored across iterations, it may
|
|
113
|
+
* emit a HARD signal: a failing test that codifies the concern. The
|
|
114
|
+
* test file is written into tests/navigator/ + becomes part of the
|
|
115
|
+
* next iter's red-set, so driver MUST satisfy it.
|
|
116
|
+
*
|
|
117
|
+
* Path constraints (validated by validateProposedTestPath):
|
|
118
|
+
* - must start with `tests/navigator/`
|
|
119
|
+
* - must end with `.test.ts` or `.test.tsx`
|
|
120
|
+
* - no .. or absolute paths
|
|
121
|
+
* Content is the literal file body (vitest test).
|
|
122
|
+
*
|
|
123
|
+
* Optional. Hook implementations gate this on their own escalation
|
|
124
|
+
* heuristics (e.g., 2+ consecutive blocks on the same concern).
|
|
125
|
+
*/
|
|
126
|
+
proposedTest?: {
|
|
127
|
+
path: string;
|
|
128
|
+
content: string;
|
|
129
|
+
};
|
|
50
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* 0.19.0-alpha.4 — pure decision helper for navigator verdicts. Pulled
|
|
133
|
+
* out of the runBrew loop so unit tests can exercise the consumer
|
|
134
|
+
* logic without standing up the full brew context.
|
|
135
|
+
*
|
|
136
|
+
* Inputs: a verdict (or null when no hook configured / abstaining).
|
|
137
|
+
* Output: { action, concernsSummary, costUsd } — concernsSummary is
|
|
138
|
+
* only set when action='block' (used for revert-history note).
|
|
139
|
+
*/
|
|
140
|
+
export declare function decideNavigatorAction(verdict: NavigatorHookVerdict | null): {
|
|
141
|
+
action: "approve" | "block";
|
|
142
|
+
concernsSummary: string;
|
|
143
|
+
costUsd: number;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* 0.19.0-alpha.5 (#77) — validate a navigator-proposed test path.
|
|
147
|
+
* Pure: takes a candidate path string + returns either the normalized
|
|
148
|
+
* path or an error reason. Centralizes the path-shape rules so brew's
|
|
149
|
+
* apply step + tests share the same gate.
|
|
150
|
+
*
|
|
151
|
+
* Rules:
|
|
152
|
+
* - must be relative
|
|
153
|
+
* - must start with `tests/navigator/`
|
|
154
|
+
* - must end with `.test.ts` or `.test.tsx`
|
|
155
|
+
* - no `..` segments
|
|
156
|
+
* - no leading slash
|
|
157
|
+
*/
|
|
158
|
+
export declare function validateProposedTestPath(path: string): {
|
|
159
|
+
ok: true;
|
|
160
|
+
path: string;
|
|
161
|
+
} | {
|
|
162
|
+
ok: false;
|
|
163
|
+
reason: string;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* 0.19.0-alpha.5 (#77) — extract a navigator-proposed test from a
|
|
167
|
+
* verdict. Pure: returns the validated file payload OR null when the
|
|
168
|
+
* verdict has no proposedTest / fails validation. Caller owns the
|
|
169
|
+
* write side-effect.
|
|
170
|
+
*
|
|
171
|
+
* Note: only proposedTests on BLOCK verdicts are honored. An approve
|
|
172
|
+
* verdict with proposedTest is a logic error in the hook and we
|
|
173
|
+
* silently drop it (this prevents a navigator from polluting tests/
|
|
174
|
+
* mid-run on iterations it actually approved of).
|
|
175
|
+
*/
|
|
176
|
+
export declare function extractNavigatorProposedTest(verdict: NavigatorHookVerdict | null): {
|
|
177
|
+
path: string;
|
|
178
|
+
content: string;
|
|
179
|
+
} | null;
|
|
51
180
|
export interface FrozenPaths {
|
|
52
181
|
directories: string[];
|
|
53
182
|
files: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/brew/agent.ts"],"names":[],"mappings":"AAaA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAKL,KAAK,WAAW,EAIjB,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