pi-dev-flow 0.89.0 → 0.90.1

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/docs/headless.md CHANGED
@@ -1,48 +1,36 @@
1
- # Driving dev-flow from an orchestrator (headless)
1
+ # Driving dev-flow headless
2
2
 
3
- For whoever puts a Pi session behind a bot, a web UI or a queue. The interactive story is in [the README](../README.md#how-you-work-it).
3
+ For anyone putting a Pi session behind a bot, a web UI or a queue. The interactive story is in the
4
+ [README](../README.md#how-it-works).
4
5
 
5
- There is **no `flow` CLI** — gates exist only inside a Pi session (the `flow` tool, `/flow`
6
- command). A remote orchestrator therefore drives a **Pi session** (e.g. via the Pi SDK) and
7
- calls the `flow` tool from inside it. That is not a limitation: the guards are harness-side,
8
- so a driver that shelled around Pi would bypass every teeth except the `pre-commit` hook.
6
+ There's **no `flow` CLI**. Gates exist only inside a Pi session, as the `flow` tool and the `/flow`
7
+ command. So an orchestrator drives a **Pi session** (for example through the Pi SDK). That's
8
+ deliberate: the guards live in the harness, so anything that went around Pi would skip all of them
9
+ except the `pre-commit` hook.
9
10
 
10
- The contract a headless driver (a session with no UI) relies on:
11
+ ## The contract
11
12
 
12
- - **Refuse → relay → `--confirmed`.** A checkpoint gate (`approve`, `verify`, `release`,
13
- `finish`) never dialogs headless — it refuses with a line that starts with the stable
14
- marker `NEEDS-OPERATOR <Question?> — …` (the four questions: Approve? / Verified? /
15
- Release? / Finish?). Route on the marker, relay the question verbatim to the human, and on
16
- their literal answer re-run the same gate with `--confirmed`. A project `flow-guard`
17
- `confirm` rule with no UI present refuses with the same marker (no question word). The
18
- marker is also on top of prose that stays readable for humans — nothing to parse beyond
19
- the first token.
20
- - **`--confirmed` is honor-system.** The plugin cannot verify a human answered; the flag
21
- means "the operator literally answered this question in chat". In remote setups the
22
- orchestrator owns that trust — relaying the exact question and adding `--confirmed` on its
23
- own inference is the one orchestrator bug dev-flow cannot catch. `--patch`/`--docs` mode
24
- grants work the same way (operator grant in chat, then `--confirmed`).
25
- - **Machine surfaces.** `flow status --json` (bound slug + per-feature stage, mode flags,
26
- branch, worktree, checks, next hint — no git subprocesses) and `flow help --json` (the
27
- gate contract as data, incl. the checkpoint questions and flag names). Both are additive:
28
- the prose views are unchanged. Read-only-safe at any stage/binding, even without
29
- `.dev-flow/`: `status`, `help`, `version`, `doctor`, `roadmap` (list).
30
- - **One session = one feature.** Bindings are per-session and survive resume/fork; a
31
- reconnecting driver either rejoins the same session or rebinds with `flow use <slug>`.
32
- Nothing auto-binds — always bind explicitly or pass the slug explicitly.
33
- Parallel features = parallel sessions.
34
- - **Budget for long gates.** `approve` runs `commands.setup`; `verify` runs build and the
35
- `dev` deploy (runs are killed past 15 min) and re-probes health with `healthWait` retries.
36
- A remote timeout must be minutes, not seconds — the gate prints progress lines while it
37
- runs.
38
- - **Edits make checks stale.** Every check carries a fingerprint of the worktree it ran against
39
- (edit-tool writes, `sed -i`, a formatter, codegen alike), and verify/release rerun records the
40
- tree has outgrown (`stale record(s) rerun after a worktree change: …`).
41
- Re-running `flow check` before `verify` after the last edit is still the tidy order; the gate no
42
- longer trusts a stale PASS if you skip it.
43
- - **Version skew.** Gates execute the dev-flow build the session loaded at start; `flow version`
44
- reports when the checkout has moved ahead of it. `flow release` turns the skew into a question —
45
- update (`/reload`, then re-run) or proceed with the old release — never a block: publishing under
46
- an older gate is a legitimate choice. The operator's proceed is stamped into the release and
47
- `release-done` repeats the acknowledgement (its after-the-fact warning stays for a release that
48
- went out without the question being answered).
13
+ - **Refuse → relay → `--confirmed`.** Without a UI, a checkpoint gate (`approve`, `verify`,
14
+ `release`, `finish`) never opens a dialog. It refuses with a line that starts with
15
+ `NEEDS-OPERATOR <Question?>`, where the question is Approve?, Verified?, Release? or Finish?. Route
16
+ on that marker, show the question to a human word for word, and when they answer, re-run the same
17
+ gate with `--confirmed`. A `flow-guard` `confirm` rule with no UI refuses with the same marker.
18
+ - **`--confirmed` runs on trust.** dev-flow can't verify that a human answered. If your
19
+ orchestrator adds `--confirmed` on its own guess, dev-flow can't catch it. `--patch` and `--docs`
20
+ grants work the same way.
21
+ - **Machine-readable output.** `flow status --json` gives the bound slug and, per feature: stage,
22
+ modes, branch, worktree, checks and next hint. `flow help --json` gives the gate contract:
23
+ questions and flag names. `status`, `help`, `version`, `doctor` and `roadmap` (list) are safe at any
24
+ time, even without `.dev-flow/`.
25
+ - **One session = one feature.** Bindings are per session and survive resume and fork. A driver that
26
+ reconnects either rejoins its session or rebinds with `flow use <slug>`. Nothing binds
27
+ automatically. Parallel features need parallel sessions.
28
+ - **Long gates need long timeouts.** `approve` runs `setup`. `verify` runs the build and the `dev`
29
+ deploy (killed after 15 minutes), then retries the health probe. Give the driver minutes, not
30
+ seconds. Gates print progress while they run.
31
+ - **Edits make checks stale.** Each check result is tied to a worktree fingerprint, and
32
+ `verify` / `release` re-run stale ones. Running `flow check` after the last edit is still the tidy
33
+ order.
34
+ - **Version skew.** Gates run the dev-flow build the session loaded at start. `flow version` says
35
+ when the checkout is newer. `flow release` asks whether to `/reload` or proceed with the old build,
36
+ and never blocks on it.