@slowcook-ai/cli 0.19.0-alpha.11 → 0.19.0-alpha.16

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.
Files changed (42) hide show
  1. package/AGENTS.md +239 -0
  2. package/REPORTING.md +193 -0
  3. package/dist/cli.js +22 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/chef/drift-fix.d.ts +1 -1
  6. package/dist/commands/chef/drift-fix.d.ts.map +1 -1
  7. package/dist/commands/chef/drift-fix.js +36 -15
  8. package/dist/commands/chef/drift-fix.js.map +1 -1
  9. package/dist/commands/chef/index.js +13 -3
  10. package/dist/commands/chef/index.js.map +1 -1
  11. package/dist/commands/chef/orchestrate.d.ts +1 -1
  12. package/dist/commands/chef/orchestrate.d.ts.map +1 -1
  13. package/dist/commands/chef/orchestrate.js +32 -9
  14. package/dist/commands/chef/orchestrate.js.map +1 -1
  15. package/dist/commands/docs/index.d.ts +16 -0
  16. package/dist/commands/docs/index.d.ts.map +1 -0
  17. package/dist/commands/docs/index.js +127 -0
  18. package/dist/commands/docs/index.js.map +1 -0
  19. package/dist/commands/garnish/index.d.ts +56 -0
  20. package/dist/commands/garnish/index.d.ts.map +1 -0
  21. package/dist/commands/garnish/index.js +281 -0
  22. package/dist/commands/garnish/index.js.map +1 -0
  23. package/dist/commands/garnish/trailer.d.ts +79 -0
  24. package/dist/commands/garnish/trailer.d.ts.map +1 -0
  25. package/dist/commands/garnish/trailer.js +118 -0
  26. package/dist/commands/garnish/trailer.js.map +1 -0
  27. package/dist/commands/recon/index.d.ts +1 -1
  28. package/dist/commands/recon/index.d.ts.map +1 -1
  29. package/dist/commands/recon/index.js +9 -5
  30. package/dist/commands/recon/index.js.map +1 -1
  31. package/dist/commands/recon/stale-stubs.d.ts +4 -1
  32. package/dist/commands/recon/stale-stubs.d.ts.map +1 -1
  33. package/dist/commands/recon/stale-stubs.js +6 -1
  34. package/dist/commands/recon/stale-stubs.js.map +1 -1
  35. package/dist/commands/run-mock/index.d.ts.map +1 -1
  36. package/dist/commands/run-mock/index.js +128 -21
  37. package/dist/commands/run-mock/index.js.map +1 -1
  38. package/dist/lib/read-only.d.ts +22 -0
  39. package/dist/lib/read-only.d.ts.map +1 -0
  40. package/dist/lib/read-only.js +34 -0
  41. package/dist/lib/read-only.js.map +1 -0
  42. package/package.json +7 -5
package/AGENTS.md ADDED
@@ -0,0 +1,239 @@
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 garnish` | Local commit-gate for human tweaks on agent work — runs scoped tests, commits with `Tweaks-output-of:` trailers (learning signal for the upstream agent) | $0 |
132
+ | `slowcook run-mock <story> --garnish` | DevTools Workspaces flow — boots mock locally, disables overlay, prints Chrome pairing instructions, auto-watches saves + auto-commits via garnish on green | $0 (per-commit; LLM only if test infra needs one) |
133
+ | `slowcook docs <topic>` | Print bundled doc (`reporting`, `agents`, `read-only`) | $0 |
134
+ | `slowcook help` | List all commands | $0 |
135
+
136
+ ---
137
+
138
+ ## Pitfalls memory (read this — saves real money + time)
139
+
140
+ These are empirical lessons from the consumer dogfood. Treat them as
141
+ non-negotiable defaults unless the user specifically overrides.
142
+
143
+ ### Publishing / packaging
144
+
145
+ - **Always `pnpm publish`, never `npm publish`.** npm leaves
146
+ `workspace:^` unresolved → consumers hit `EUNSUPPORTEDPROTOCOL`. Use
147
+ `pnpm publish --tag alpha --no-git-checks` (or whichever tag).
148
+ - **Build before publish, every time.** `prepublishOnly: tsc -b` is
149
+ the guard but verify `dist/` is fresh. Stale dist has shipped before.
150
+ - **Update README / CHANGELOG every point release.** Status table, line
151
+ per release. Don't accumulate undocumented alphas.
152
+
153
+ ### pnpm + Next.js
154
+
155
+ - For consumers using Next.js + pnpm workspace, set `node-linker=hoisted`
156
+ in `.npmrc`. Default symlink layout breaks Next 16's turbopack root
157
+ inference (`couldn't find next/package.json from project directory`).
158
+ - `slowcook init mock` auto-wires the workspace when it detects pnpm.
159
+ npm/yarn consumers see a recommendation, not auto-migration (lockfile
160
+ re-resolution risk).
161
+
162
+ ### Chef stack
163
+
164
+ - **Chef never edits `tests/`, `vitest.config.*`, or `.brewing/auto-gen/`.**
165
+ These are frozen. If the only fix requires a test edit, chef returns
166
+ `pm_question`.
167
+ - **Chef-drift uses `search_replace` only**, never full-file regeneration.
168
+ Find string must appear exactly once in target.
169
+ - **Chef-orchestrate prefers `escalate` on ties.** PM is the safety valve.
170
+
171
+ ### Brew
172
+
173
+ - **Brew can't fix test infrastructure.** If the failure is in
174
+ `vitest.config.*` or `tests/_setup/`, brew will halt repeatedly. The
175
+ fix is upstream in slowcook, not in the consumer's code.
176
+ - **`--with-navigator` adds 10–20% spend** (a navigator LLM call per
177
+ iteration). Skip it on simple stories; use it when soft-prompt steering
178
+ needs hardening.
179
+
180
+ ### Refine + spec
181
+
182
+ - **PM intent in the issue body + first refine answer is contractual.**
183
+ Refine cannot silently weaken (e.g., "similar to feed" → "emoji is a
184
+ later concern" is forbidden). Only an explicit later PM comment can.
185
+ - **Side-effects audit (0.18+):** when refine detects contradiction with
186
+ a prior story, it enumerates the exact assertions that would need to
187
+ flip. PM reviews granularly.
188
+
189
+ ### Workflows
190
+
191
+ - **Self-hosted runners need `gh` CLI.** Slowcook's chef-drift workflow
192
+ installs it via the no-sudo binary. If you write a new workflow, add
193
+ the same step.
194
+ - **Chef-drift exit 1 auto-chains to chef-orchestrate** in the rewo
195
+ reference workflow shape. Mirror this if you wire your own.
196
+
197
+ ### When something goes wrong
198
+
199
+ - **Read [REPORTING.md](./REPORTING.md)** (or `slowcook docs reporting`)
200
+ before filing a bug. Don't bundle artifacts; share URLs.
201
+ - **Use `SLOWCOOK_READ_ONLY=1`** when reproducing a bug on someone else's
202
+ repo. Blocks every GitHub-side write.
203
+
204
+ ### Local-developer flow (alternative to the remote overlay)
205
+
206
+ - **`slowcook garnish`** is the right command when you (or another
207
+ engineer) edits files on top of an agent's commit. It runs the
208
+ relevant tests, commits on green with trailers that record which
209
+ upstream agent's work you tweaked. Don't `git commit` by hand on
210
+ top of agent work — you lose the learning-signal trailer.
211
+ - **`slowcook run-mock <story> --garnish`** is the right command if
212
+ you want to edit the mock app via Chrome DevTools Workspaces.
213
+ It prints the one-time Chrome setup, then auto-garnishes on save.
214
+ The remote overlay is disabled in this mode — they're alternative
215
+ feedback channels, not stacked.
216
+
217
+ ### CI/CD posture (2026-05-12)
218
+
219
+ - `main` is branch-protected: no force-push, no deletion. Admin
220
+ bypass is on, so solo merges still work. When you arrive as a
221
+ contributor, expect PR + 1 approval to land.
222
+ - Dependabot opens weekly grouped PRs (anthropic / vitest /
223
+ typescript / testing) and monthly GitHub Actions version PRs.
224
+ Auto-merge is OFF; everything goes through a human glance.
225
+ - Open ops backlog lives at [`docs/plans/ci-cd-roadmap.md`](./docs/plans/ci-cd-roadmap.md).
226
+ Two HIGH items are filed as GitHub issues; the rest are queued
227
+ in the doc until they become pressing.
228
+
229
+ ---
230
+
231
+ ## What to read next
232
+
233
+ - [README.md](./README.md) — the marketing overview + status table
234
+ - [REPORTING.md](./REPORTING.md) — how to file a slowcook bug
235
+ - [docs/plans/](./docs/plans/) — the roadmap / design docs (if a story
236
+ references one, read it before running the agent)
237
+
238
+ If anything in this doc is wrong or outdated, file a slowcook issue
239
+ following the REPORTING.md recipe.
package/REPORTING.md ADDED
@@ -0,0 +1,193 @@
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
+ The bug-report issue template (auto-applied when you click "New issue")
147
+ asks for the four URLs the maintainer needs.
148
+ - **Private bug reports** (when artifacts can't be public): same repo,
149
+ **but file a public issue** with the description + your reproduction
150
+ arrangement. Don't paste private logs into a public issue. The
151
+ maintainer responds with the access path that works for your setup.
152
+
153
+ ---
154
+
155
+ ## What you'll see when a fix ships
156
+
157
+ When the maintainer ships a fix in a new alpha (e.g., `cli@0.19.0-alpha.X`),
158
+ expect a comment on your bug issue along these lines:
159
+
160
+ > Fixed in `cli@0.19.0-alpha.X`. Bump your `.brewing/slowcook-cli-version`
161
+ > and re-run. Close this issue if resolved; comment if not.
162
+ >
163
+ > `<!-- slowcook:fix-notice cli=0.19.0-alpha.X issue=N -->`
164
+
165
+ The issue stays **open** until you confirm the fix worked. You close it.
166
+ That gives the maintainer signal that the fix actually landed in your
167
+ context — not just in slowcook's own test suite.
168
+
169
+ If the fix didn't work, comment on the issue with what's still broken.
170
+ The maintainer reopens (if you closed) or continues debugging.
171
+
172
+ ## Triage labels
173
+
174
+ The slowcook repo uses a small label set so you can filter for what's
175
+ actionable:
176
+
177
+ | Label | Meaning |
178
+ |---|---|
179
+ | `bug` | Confirmed bug. Auto-applied by the issue template. |
180
+ | `needs-info` | Maintainer needs more context (additional URL, runner output, etc.). |
181
+ | `confirmed` | Maintainer reproduced; working on a fix. |
182
+ | `regression-test-pending` | Fix landed but the regression test is still TODO. |
183
+ | `fixed-in-α.X` | Fix shipped in `cli@0.19.0-alpha.X`. Reporter to confirm + close. |
184
+ | `blocked-on-anthropic` | Bug is in the Anthropic API / SDK, not slowcook. |
185
+ | `wont-fix` | Out of scope or incompatible with architectural intent. |
186
+
187
+ Filter via GitHub's issue search, e.g.:
188
+ `gh issue list --repo aminazar/slowcook --label "fixed-in-α.13"`
189
+
190
+ ---
191
+
192
+ *This doc is intentionally short. Read [AGENTS.md](./AGENTS.md) for
193
+ the slowcook architecture overview.*
package/dist/cli.js CHANGED
@@ -87,6 +87,7 @@ Commands available in ${VERSION}:
87
87
  chef-drift (0.18.0-α.9 L1) Surgical drift-fixer. Triggered by mock-isolation / recon / brew / navigator halts.
88
88
  chef-orchestrate (0.19.0-α.2 L3) Pipeline orchestrator. Decides redispatch_brew / rebase / escalate / close on a halted PR.
89
89
  refactor (0.19.0-α.7) Rank refactor proposals by benefit/cost. Reads .brewing/refactor/proposals.json.
90
+ garnish (0.19.0-α.15) Local commit-gate for human tweaks on agent work. Runs tests, commits with learning-signal trailers.
90
91
  catchup Detect + run pipeline steps that should have triggered but didn't.
91
92
  brew Ratcheted implementation loop: flip red tests to green for one story.
92
93
  map Generate / check the repo-wide code map (APIs, pages, components, helpers, types).
@@ -229,6 +230,27 @@ async function main() {
229
230
  await refactor(args.slice(1), VERSION);
230
231
  return;
231
232
  }
233
+ case "docs":
234
+ // 0.19.0-α.13 — `slowcook docs <topic>` prints bundled docs.
235
+ // Useful when an agent / maintainer is on a fresh box without a
236
+ // cloned slowcook repo. Topics: reporting, agents, read-only.
237
+ {
238
+ const { docs } = await import("./commands/docs/index.js");
239
+ await docs(args.slice(1), VERSION);
240
+ return;
241
+ }
242
+ case "garnish":
243
+ // 0.19.0-α.15 — local commit-gate for human (or other-agent)
244
+ // tweaks layered on top of an agent's work. Detects uncommitted
245
+ // changes, runs scoped tests, commits with Tweaks-output-of:
246
+ // trailers marking each agent-authored file the tweak touched.
247
+ // A future `slowcook reflect` mines these trailers for learning
248
+ // signal (eval-set fixtures, prompt-amendment candidates).
249
+ {
250
+ const { garnish } = await import("./commands/garnish/index.js");
251
+ await garnish(args.slice(1), VERSION);
252
+ return;
253
+ }
232
254
  case "vibe":
233
255
  // 0.15.0-α.1 — design-first mockup generator (plate-pipeline α.1).
234
256
  // Reads spec + brownfield extracts + code-map; emits a runnable
package/dist/cli.js.map CHANGED
@@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AC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,IAAI;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"}
@@ -60,5 +60,5 @@ export declare function collectImportedSourceFiles(testContents: Record<string,
60
60
  * different `exists` predicate).
61
61
  */
62
62
  export declare function resolveImportToFile(importPath: string, testFile: string, repoRoot: string, exists: (p: string) => boolean): string | null;
63
- export declare function chefDrift(argv: string[], _cliVersion: string): Promise<void>;
63
+ export declare function chefDrift(argv: string[], cliVersion: string): Promise<void>;
64
64
  //# sourceMappingURL=drift-fix.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drift-fix.d.ts","sourceRoot":"","sources":["../../../src/commands/chef/drift-fix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAiEH;;;;;;;;;;;;;;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AC7B,MAAM,GAAG,IAAI,CAsBf;AAiZD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuXjF"}
@@ -25,6 +25,7 @@ import { execSync } from "node:child_process";
25
25
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
26
26
  import { dirname, join } from "node:path";
27
27
  import { AnthropicClient, CHEF_SYSTEM, buildChefPrompt, } from "@slowcook-ai/llm-anthropic";
28
+ import { isReadOnlyMode, logReadOnlyBanner } from "../../lib/read-only.js";
28
29
  const FROZEN_PATH_PATTERNS = [
29
30
  /^tests\//,
30
31
  /^vitest\.config\.(ts|mjs|js)$/,
@@ -553,9 +554,14 @@ function buildAuditCommentBody(args) {
553
554
  lines.push("");
554
555
  }
555
556
  lines.push(`**Cost:** $${move.cost_usd.toFixed(2)} (cumulative: $${args.ledger.cumulative_cost_usd.toFixed(2)})`);
557
+ // 0.19.0-α.12 — slowcook:cost HTML marker for downstream aggregation
558
+ // (`gh issue view N | grep slowcook:cost`). Format matches vibe / plate /
559
+ // brew / refine / testgen.
560
+ lines.push("");
561
+ lines.push(`<!-- slowcook:cost agent=chef-drift usd=${move.cost_usd.toFixed(4)} cumulative_usd=${args.ledger.cumulative_cost_usd.toFixed(4)} decision=${move.decision} trigger=${move.trigger_kind} story=${args.ledger.story_id} move=${move.n} cli=${args.cliVersion} -->`);
556
562
  return lines.join("\n");
557
563
  }
558
- export async function chefDrift(argv, _cliVersion) {
564
+ export async function chefDrift(argv, cliVersion) {
559
565
  const args = parseArgs(argv);
560
566
  const apiKey = process.env["ANTHROPIC_API_KEY"];
561
567
  if (!apiKey) {
@@ -563,6 +569,7 @@ export async function chefDrift(argv, _cliVersion) {
563
569
  process.exit(2);
564
570
  }
565
571
  console.log(`slowcook chef-drift · story-${args.storyId} · trigger=${args.triggerKind}${args.prNumber ? ` · finisher mode (PR #${args.prNumber})` : ""}`);
572
+ logReadOnlyBanner("chef-drift");
566
573
  // L2 finisher mode: check out the PR branch BEFORE reading any
567
574
  // ledger or repo state. The brew PR's branch has its own .brewing/
568
575
  // and a different working tree shape than main.
@@ -890,18 +897,25 @@ export async function chefDrift(argv, _cliVersion) {
890
897
  }
891
898
  // Commit chef's edits locally (workflow handles the push) when validation passed.
892
899
  // L2 finisher mode: also push to the PR's branch directly so the PR re-runs CI.
900
+ // SLOWCOOK_READ_ONLY=1 gates BOTH the commit AND the push so a maintainer
901
+ // running chef-drift on a consumer's repo doesn't pollute their git history.
893
902
  let commitSha = null;
894
903
  if (verdict.kind === "autonomous_fix" && moveEntry.post_state === "clean" && !args.dryRun) {
895
- const summary = `move ${moveN} on story-${args.storyId} — ${args.triggerKind}: ${verdict.rationale.slice(0, 120)}`;
896
- const result = commitChefEdits(args.repoRoot, summary, verdict.edits);
897
- if (result.sha) {
898
- commitSha = result.sha;
899
- console.log(` committed: ${result.sha.slice(0, 7)}`);
904
+ if (isReadOnlyMode()) {
905
+ console.log(` [SLOWCOOK_READ_ONLY=1] would commit ${verdict.edits.length} edit(s) + push to PR; skipping.`);
900
906
  }
901
- if (commitSha && prCheckout) {
902
- const pushed = pushChefEditsToPrBranch(args.repoRoot, prCheckout.branchName, prCheckout.localRef);
903
- if (pushed)
904
- console.log(` finisher: pushed ${commitSha.slice(0, 7)} → ${prCheckout.branchName}`);
907
+ else {
908
+ const summary = `move ${moveN} on story-${args.storyId} — ${args.triggerKind}: ${verdict.rationale.slice(0, 120)}`;
909
+ const result = commitChefEdits(args.repoRoot, summary, verdict.edits);
910
+ if (result.sha) {
911
+ commitSha = result.sha;
912
+ console.log(` committed: ${result.sha.slice(0, 7)}`);
913
+ }
914
+ if (commitSha && prCheckout) {
915
+ const pushed = pushChefEditsToPrBranch(args.repoRoot, prCheckout.branchName, prCheckout.localRef);
916
+ if (pushed)
917
+ console.log(` finisher: pushed ${commitSha.slice(0, 7)} → ${prCheckout.branchName}`);
918
+ }
905
919
  }
906
920
  }
907
921
  ledger.moves.push(moveEntry);
@@ -910,15 +924,22 @@ export async function chefDrift(argv, _cliVersion) {
910
924
  saveLedger(args.repoRoot, ledger);
911
925
  // Audit comment routing: in finisher mode (--pr) write to the PR;
912
926
  // otherwise write to the source issue (L1 behavior).
927
+ // SLOWCOOK_READ_ONLY=1 gates the post too — maintainer-side replay
928
+ // doesn't comment on the consumer's repo.
913
929
  if (verdict.kind === "autonomous_fix" && moveEntry.post_state === "clean" && !args.dryRun) {
914
- const body = buildAuditCommentBody({ ledger, move: moveEntry, verdict });
930
+ const body = buildAuditCommentBody({ ledger, move: moveEntry, verdict, cliVersion });
915
931
  const target = args.prNumber ?? (issueNumber > 0 ? issueNumber : null);
916
932
  if (target !== null) {
917
- try {
918
- postIssueComment(args.repoRoot, target, body);
933
+ if (isReadOnlyMode()) {
934
+ console.log(` [SLOWCOOK_READ_ONLY=1] would post audit comment on issue/PR #${target}; skipping.`);
919
935
  }
920
- catch (e) {
921
- console.warn(` warn: audit comment failed (non-fatal): ${e.message.slice(0, 200)}`);
936
+ else {
937
+ try {
938
+ postIssueComment(args.repoRoot, target, body);
939
+ }
940
+ catch (e) {
941
+ console.warn(` warn: audit comment failed (non-fatal): ${e.message.slice(0, 200)}`);
942
+ }
922
943
  }
923
944
  }
924
945
  }