···11{
22+ "historicalNote": "This file captures implementation planning history. S1 discovery references (mill --help --json, discovery command) are historical and not part of current CLI behavior.",
23 "slices": [
34 {
45 "id": "S1",
+2
docs/exec-plans/active/vertical-slices.md
···11# Vertical Slices Plan (v0)
2233+> Historical note (2026-02-25): this execution plan captures the implementation path. Some S1 discovery references (`mill --help --json`, `discovery` command) are historical and no longer match the current CLI surface.
44+35This plan sequences integrated, testable slices from highest-leverage foundation to full v0 behavior.
4657Each slice intentionally spans:
+1-1
docs/product-specs/README.md
···11# Product Specs Index
2233-- `mill-v0-product-spec.md` — Sections 1–7 from SPEC (product definition, constraints, CLI, run model, config, discovery).
33+- `mill-v0-product-spec.md` — Sections 1–7 (product definition, constraints, CLI, run model, config, authoring help behavior).
+42-72
docs/product-specs/mill-v0-product-spec.md
···11# mill v0 Product Spec (Sections 1–7)
2233-_Source: `SPEC.md` (verbatim split for cedar-style docs tree)._
33+_Source: `SPEC.md`, updated to reflect current CLI behavior._
4455## 1) Product definition
66···6262## 3) CLI surface (v0)
63636464```bash
6565-mill run <program.ts> [--json] [--sync] [--driver <name>] [--executor <name>] [--confirm=false]
6666-mill status <runId> [--json]
6767-mill wait <runId> --timeout <seconds> [--json]
6868-mill watch <runId> [--json] [--raw]
6969-mill ls [--json] [--status <status>]
7070-mill inspect <runId>[.<spawnId>] [--json] [--session]
7171-mill cancel <runId> [--json]
7272-mill init
6565+mill run <program.ts> [--json] [--sync] [--runs-dir <path>] [--driver <name>] [--executor <name>] [--meta-json <json>]
6666+mill status <runId> [--json] [--runs-dir <path>] [--driver <name>]
6767+mill wait <runId> --timeout <seconds> [--json] [--runs-dir <path>] [--driver <name>]
6868+mill watch [--run <runId>] [--since-time <iso>] [--json] [--raw] [--runs-dir <path>] [--driver <name>]
6969+mill ls [--json] [--status <status>] [--runs-dir <path>] [--driver <name>]
7070+mill inspect <runId>[.<spawnId>] [--json] [--session] [--runs-dir <path>] [--driver <name>]
7171+mill cancel <runId> [--json] [--runs-dir <path>] [--driver <name>]
7272+mill init [--global]
7373```
74747575-Discovery (for humans and agents):
7575+Help + authoring guidance:
76767777-- `mill` (no subcommand): concise discovery card
7878-- `mill --help`: help text + authoring guidance
7979-- `mill --help --json`: machine-readable discovery payload
7777+- `mill` / `mill --help`: root help text with authoring guidance
7878+- `mill <command> --help`: command help text + authoring guidance
7979+- If resolved config overrides `authoring.instructions`, help uses that text.
8080+- Otherwise help falls back to static guidance (`systemPrompt` = WHO, `prompt` = WHAT).
80818181-No other commands in v0.
8282+No `discovery` subcommand in v0.
82838384### 3.1 Output mode contract
8485···1161171171181. Resolve config
1181192. Validate program path
119119-3. Optional interactive confirmation
120120-4. Allocate `runId`, create run directory, write initial metadata
121121-5. Start detached worker process
122122-6. Return immediately (`runId`, `status=running`, paths)
120120+3. Allocate `runId`, create run directory, write initial metadata
121121+4. Start detached worker process
122122+5. Return immediately (`runId`, `status=running`, paths)
123123124124`--sync` blocks until completion (implemented as submit + wait internally).
125125···149149150150## 6) Config contract (`mill.config.ts`)
151151152152-```ts
153153-import { defineConfig } from "@mill/core";
154154-155155-export default defineConfig({
156156- defaultDriver: "default",
157157- defaultModel: "openai/gpt-5.3-codex",
158158- defaultExecutor: "direct",
159159-160160- drivers: {
161161- default: processDriver({
162162- command: "pi",
163163- args: ["-p"],
164164- codec: piCodec(),
165165- env: {},
166166- }),
167167- },
168168-169169- executors: {
170170- direct: directExecutor(),
171171- vm: vmExecutor({ runtime: "docker", image: "mill-sandbox:latest" }),
172172- },
152152+Minimal import-free config (works for both local and global config paths):
173153154154+```ts
155155+export default {
156156+ // Optional overrides:
157157+ // defaultDriver: "pi",
158158+ // defaultExecutor: "direct",
159159+ // defaultModel: "openai-codex/gpt-5.3-codex",
174160 authoring: {
175161 instructions:
176176- "Use systemPrompt for WHO and prompt for WHAT. Prefer cheaper models for search and stronger models for synthesis.",
162162+ "Use systemPrompt for WHO (role/method), prompt for WHAT (explicit task + scope + validation).",
177163 },
164164+};
165165+```
178166179179- extensions: [
180180- // optional
181181- ],
182182-});
183183-```
167167+`mill init` writes `./mill.config.ts`.
168168+`mill init --global` writes `~/.mill/config.ts`.
184169185170### 6.1 Config resolution order
186171···195180- Resolved env values are normalized into config/services and passed downward.
196181- Runtime/domain modules must not read `process.env` directly.
197182198198-## 7) Discovery contract (`mill --help --json`)
183183+## 7) Authoring help contract
184184+185185+`mill` help output is the primary authoring guide for humans/agents.
186186+187187+Behavior:
199188200200-`mill --help --json` MUST include enough info for an agent to author a program without extra docs:
189189+1. `mill` and `mill --help` print root help + authoring guidance.
190190+2. `mill <command> --help` prints command help + authoring guidance.
191191+3. If resolved config provides a custom `authoring.instructions` override, that text replaces static guidance in help output.
192192+4. If config does not override authoring instructions, help falls back to static guidance:
193193+ - `systemPrompt` = WHO the agent is
194194+ - `prompt` = WHAT to do now
201195202202-```json
203203-{
204204- "discoveryVersion": 1,
205205- "programApi": {
206206- "spawnRequired": ["agent", "systemPrompt", "prompt"],
207207- "spawnOptional": ["model"],
208208- "resultFields": ["text", "sessionRef", "agent", "model", "driver", "exitCode", "stopReason"]
209209- },
210210- "drivers": {
211211- "default": {
212212- "description": "Local process driver",
213213- "modelFormat": "provider/model-id",
214214- "models": ["openai/gpt-5.3-codex", "anthropic/claude-sonnet-4-6"]
215215- }
216216- },
217217- "authoring": {
218218- "instructions": "...from config..."
219219- },
220220- "async": {
221221- "submit": "mill run <program.ts> --json",
222222- "status": "mill status <runId> --json",
223223- "wait": "mill wait <runId> --timeout 30 --json"
224224- }
225225-}
226226-```
196196+There is no dedicated `discovery` subcommand in CLI v0.