@ckanner/flywheel 0.27.3 → 0.28.0
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/CHANGELOG.md +15 -0
- package/README.en.md +127 -0
- package/README.md +29 -11
- package/bin/flywheel-codex-pro-worker.js +16 -0
- package/bin/flywheel.js +5 -1
- package/bin/runtime.js +14 -1
- package/docs/configuration.md +33 -2
- package/docs/en/configuration.md +193 -0
- package/docs/en/getting-started.md +244 -0
- package/docs/en/workflow.md +155 -0
- package/docs/getting-started.md +17 -9
- package/docs/workflow.md +199 -0
- package/npm/install.js +17 -7
- package/package.json +16 -10
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Install and run your first Flywheel task
|
|
2
|
+
|
|
3
|
+
[English README](../../README.en.md) · [中文](../getting-started.md) · [Workflow](workflow.md) · [Configuration](configuration.md)
|
|
4
|
+
|
|
5
|
+
This guide covers the **0.28.0 implementation**: npm installation, the DSH desktop and workers, configuration, preflight, a small task, and recovery. The checked desktop interface baseline is **DSH Mac 0.2.1-rc.5**. Real desktop UI, macOS permissions, authentication, and model inference still need testing on the intended machine.
|
|
6
|
+
|
|
7
|
+
Before installing, check `npm view @ckanner/flywheel version`. Continue with these instructions once the registry has the version you intend to use. A merged source change or GitHub Release does not establish npm publication, and an older installed release may not include these interfaces.
|
|
8
|
+
|
|
9
|
+
## 1. Prepare the environment
|
|
10
|
+
|
|
11
|
+
| Requirement | Why it is needed |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Git with your commit identity | Worktrees and local delivery commits |
|
|
14
|
+
| Node.js 22.18.0 or later and npm | Installer, launchers, and JavaScript workers |
|
|
15
|
+
| DSH Mac and its desktop-supplied `dsh` command | Desktop plugin management and DSH SDK execution |
|
|
16
|
+
| Authenticated Kimi CLI | Default Plan, frontend execution, and optional Garden |
|
|
17
|
+
| Codex executable and existing login | The hard route's Codex Pro plugin runs Codex app-server |
|
|
18
|
+
| DeepSeek and ChatGPT providers in the DSH SDK profile | Default execution, independent Review, and Judge |
|
|
19
|
+
| Go 1.27 or later | Only the Go example below and source builds; not npm binary installation |
|
|
20
|
+
|
|
21
|
+
Check command locations and versions with `git --version`, `node --version`, `npm --version`, `command -v dsh`, `dsh --version`, `kimi --version`, and `codex --version`. Check the desktop version in About as well. Use the respective tools' documented installation and login flows.
|
|
22
|
+
|
|
23
|
+
Kimi subscription, ChatGPT subscription, and DeepSeek API access are separate channels. Flywheel does not log in, copy credentials, or replace the desktop application. A task using only the default execution route can skip the hard route at runtime, but it still needs its configured Plan, Execute, Review, and Judge backends.
|
|
24
|
+
|
|
25
|
+
## 2. Install
|
|
26
|
+
|
|
27
|
+
From a terminal that can find the desktop's `dsh` command:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npx -y @ckanner/flywheel@latest install
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For an agent consuming a single JSON result, use the same command with `--json`. The installer installs its exact version globally, resolves the platform binary and workers, installs the ten bundled skills, creates global configuration only if absent, records a GUI launcher, registers the matching DSH plugin, and runs local diagnostics.
|
|
34
|
+
|
|
35
|
+
`ok:true` means the installation steps completed. `ready:true` means that local doctor found no blocker. For example, missing Kimi can produce `ok:true, ready:false` with the reason in `diagnostic.checks`. Neither result proves real authentication or inference. A failed step retains its partial results so the actual cause can be corrected before retrying.
|
|
36
|
+
|
|
37
|
+
### Useful options
|
|
38
|
+
|
|
39
|
+
| Option | Effect |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `--prefix PATH` | Choose the npm global prefix |
|
|
42
|
+
| `--project PATH` | Install skills into an existing project's `.agents/skills` and diagnose that project; CLI installation remains global |
|
|
43
|
+
| `--dsh-bin PATH` | Use the verified desktop DSH command at an explicit path |
|
|
44
|
+
| `--profile NAME` | Desktop plugin target profile, default `desktop`; unrelated to the worker's SDK profile |
|
|
45
|
+
| `--no-dsh` | Skip desktop plugin registration |
|
|
46
|
+
| `--no-global` | Set up the current persistent installation without another global install |
|
|
47
|
+
| `--timeout-ms N` | External install-step timeout; default 600000 ms, range 100–1800000 |
|
|
48
|
+
| `--json` | Emit one structured installation result |
|
|
49
|
+
|
|
50
|
+
For a user-owned global prefix:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npx -y @ckanner/flywheel@latest install --prefix "$HOME/.local"
|
|
54
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
55
|
+
flywheel version
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Add the actual prefix's `bin` directory to your shell configuration for later terminals. Supply `--dsh-bin /absolute/path/to/dsh` if necessary. Do not guess an executable path inside a macOS app bundle.
|
|
59
|
+
|
|
60
|
+
Plain `npm install --global @ckanner/flywheel` only places package files. Complete user setup explicitly afterward:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
flywheel setup --no-global
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`install` and `setup` share options. Do not use `--no-global` to turn a temporary npx cache into the permanent GUI entry.
|
|
67
|
+
|
|
68
|
+
## 3. Distinguish desktop and SDK setup
|
|
69
|
+
|
|
70
|
+
The installer uses the official desktop plugin interface with exact version selection:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
dsh plugin --profile desktop add --save-exact --ignore-scripts @ckanner/dsh-plugin-flywheel@<installed-version>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This is the command shape used internally, not a placeholder to paste literally. An independent npm DSH CLI cannot manage the reserved `desktop` profile. Reload according to the host's instructions; the Flywheel button appears in the desktop input area.
|
|
77
|
+
|
|
78
|
+
The worker defaults to a separate **`sdk` profile**. A desktop provider installation or login does not prove that the SDK profile has the same configuration or authorization. DeepSeek uses `deepseek-official`; native GPT routing uses the ChatGPT adapter. The checked adapter baseline can be installed with:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
dsh plugin --profile sdk add dsh-plugin-chatgpt@0.1.17
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
That is a checked compatibility version, not a claim about the latest adapter. Follow its authorization documentation for the chosen profile and keep `DSH_HOME` consistent. Do not copy tokens into task files or Git.
|
|
85
|
+
|
|
86
|
+
The hard route uses the installed `dsh-subagent-codex-pro@0.8.0` dependency's public machine API directly. It does not use `subagent_codex_pro` as a native LLM provider or require a parent model to delegate. Its underlying Codex app-server still needs the local Codex command and login.
|
|
87
|
+
|
|
88
|
+
### Desktop launcher
|
|
89
|
+
|
|
90
|
+
Setup creates `~/.config/flywheel/npm-launcher` and an installation record with absolute Node/CLI paths, the checked DSH entry, and the installation-time tool PATH. The desktop plugin verifies the managed launcher before using it. A user-specified `flywheelBinary` takes precedence. Missing records can use the legacy PATH lookup; damaged records or modified managed launchers fail visibly.
|
|
91
|
+
|
|
92
|
+
After moving Node or the npm prefix, or installing previously missing tools, run `flywheel setup --no-global` in a terminal where all required tools are available, preserving your original options. Save custom launcher changes before resolving a conflict. A shell export alone does not update an already running desktop process; recheck from the panel.
|
|
93
|
+
|
|
94
|
+
## 4. Select configuration and skills
|
|
95
|
+
|
|
96
|
+
Configuration precedence is task directory, project root, global file, then embedded defaults. The first complete file wins; files do not merge. Existing configuration is preserved during upgrades. Inspect the actual source:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
flywheel config inspect --cwd /absolute/path/to/repo --json
|
|
100
|
+
flywheel template flywheel.config.example.json
|
|
101
|
+
flywheel template flywheel.profiles.example.json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Use either complete template as a starting point and review it before writing a configuration file. The [configuration guide](configuration.md) covers safe export, fields, profile overrides, channel identity, and migration to `codex-pro`. `loops.plan` controls engine planning; the host's selected conversation model controls initial `flywheel-new` preparation.
|
|
105
|
+
|
|
106
|
+
The installer includes ten skills. Skills are optional host entry points; the desktop panel and CLI also work independently. To inspect or install them for an existing project:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
flywheel skills list
|
|
110
|
+
flywheel skills read flywheel-run
|
|
111
|
+
flywheel install-skills --project /absolute/path/to/repo --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Follow the host's skill-discovery rules. Copying files does not prove the host loaded them. Installer-owned unchanged snapshots can update; modified files, unowned directories, and invalid manifests are preserved and reported as conflicts.
|
|
115
|
+
|
|
116
|
+
## 5. Run preflight without inference
|
|
117
|
+
|
|
118
|
+
From the target repository:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
flywheel doctor --cwd "$PWD" --json
|
|
122
|
+
flywheel doctor --cwd "$PWD" --probe --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Local checks cover configuration, directories, command availability/version, and declared environment variables. `--probe` also initializes DSH SDK sessions, checks accepted configuration, working directory, permissions, and shutdown. It sends no inference prompt and runs no acceptance command. Provider initialization may query a model catalog and create SDK-owned cache/session files.
|
|
126
|
+
|
|
127
|
+
Codex Pro additionally verifies that the exact public machine API can be imported and that Node/Codex commands are available. It does not run a model task, prove account entitlement, or pre-check the complete policy. Its full-policy limitation remains a warning; model/effort/authorization remain unknown.
|
|
128
|
+
|
|
129
|
+
Results use `pass`, `fail`, `warn`, `unknown`, and `skipped`. A fail produces exit code 1. A successful aggregate result only covers the checks performed. No preflight creates Flywheel state, worktrees, or global configuration. Check again in the desktop panel because GUI environment and profile selection may differ.
|
|
130
|
+
|
|
131
|
+
After contracts exist, narrow the checks to the selected task:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
flywheel doctor --cwd "$PWD" --task-dir "$PWD/docs/my-feature" --probe --json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
A task without packets can be inspected during preparation, but a real start still needs at least one reviewed legal packet. Fix schema, directory, provider, or permission failures at their source.
|
|
138
|
+
|
|
139
|
+
## 6. Prepare a task
|
|
140
|
+
|
|
141
|
+
### Existing repository
|
|
142
|
+
|
|
143
|
+
Create or deliberately reuse a task integration branch and independent worktree **before** running `flywheel-new`. Prepare contracts and launch the engine from that same root, using a task path inside it. The [workflow guide](workflow.md) gives the branch commands, model recommendations, draft-PR timing, and exact working directory for each loop.
|
|
144
|
+
|
|
145
|
+
Use the bundled templates to prepare a real Spec and packets with actual acceptance commands, protected oracles, and recorded dry-run results. Commit the reviewed contracts before starting so packet worktrees can read them from Git. Do not create `state.json` manually.
|
|
146
|
+
|
|
147
|
+
### Disposable first-run example
|
|
148
|
+
|
|
149
|
+
For a first installation check, the packaged scaffold creates a separate Go addition task. The initial implementation is intentionally wrong; the executor must fix it and add ordinary tests without changing the frozen acceptance test. This example needs Go 1.27 or later and an unused destination directory.
|
|
150
|
+
|
|
151
|
+
```sh
|
|
152
|
+
FLYWHEEL_PACKAGE="$(npm root --global)/@ckanner/flywheel"
|
|
153
|
+
bash "$FLYWHEEL_PACKAGE/docs/examples/create-first-task.sh" "$HOME/flywheel-demo"
|
|
154
|
+
cd "$HOME/flywheel-demo"
|
|
155
|
+
git init -b main
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For a custom prefix, resolve the package with `npm root --global --prefix "$HOME/.local"` instead. If the CLI is not on PATH, set `FLYWHEEL_BIN` to its absolute path when invoking the script. The scaffold writes files and reads installed templates; it does not invoke models or commit anything.
|
|
159
|
+
|
|
160
|
+
The scaffold includes `sum.go`, frozen `acceptance/sum_test.go`, `docs/add/spec.md`, a packet, a complete project configuration, and ignore rules for generated/volatile files. Run every L1 command from the packet. For the shipped example:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
go test ./...
|
|
164
|
+
go test -coverprofile=coverage.out . &&
|
|
165
|
+
go tool cover -func=coverage.out |
|
|
166
|
+
awk '$NF != "100.0%" && $NF != "100%" { bad=1 } END { exit bad }'
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The initial failures are expected. Record the actual exit codes and summaries in the Spec's dry-run evidence. Review the contracts and frozen boundaries, then commit the scaffold in this new demonstration repository:
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
git add go.mod sum.go acceptance .gitignore flywheel.config.json docs/add
|
|
173
|
+
git diff --cached
|
|
174
|
+
git commit -m "docs: prepare first flywheel task"
|
|
175
|
+
git worktree add -b task/add ../flywheel-demo-add
|
|
176
|
+
cd ../flywheel-demo-add
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
This disposable scaffold generates contracts before the task worktree is created; for an existing repository, use the preparation order in the preceding section. The real run below uses the new task worktree and its own `docs/add`, so local packet delivery stays on `task/add`.
|
|
180
|
+
|
|
181
|
+
## 7. Start, observe, stop, and recover
|
|
182
|
+
|
|
183
|
+
The following commands invoke the real configured backends. Run them from the demo task worktree, or substitute your actual task name:
|
|
184
|
+
|
|
185
|
+
```sh
|
|
186
|
+
flywheel config inspect --cwd "$PWD" --task-dir "$PWD/docs/add" --json
|
|
187
|
+
flywheel doctor --cwd "$PWD" --task-dir "$PWD/docs/add" --probe --json
|
|
188
|
+
flywheel control start --cwd "$PWD" --task-dir "$PWD/docs/add"
|
|
189
|
+
flywheel control status --cwd "$PWD" --task-dir "$PWD/docs/add"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The desktop panel accepts the same two absolute paths. A control response's `ok` means the operation succeeded; task completion is determined by `state.status`. After a startup readiness timeout, query status and read logs before attempting another start.
|
|
193
|
+
|
|
194
|
+
For a foreground run that pauses before Review, use this instead of background start:
|
|
195
|
+
|
|
196
|
+
```sh
|
|
197
|
+
flywheel run docs/add --pause-before review
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
`control start` does not accept `--pause-before`, and pause mode cannot be combined with `--only`. `--only execute` runs the bounded execution/L1 loop; it is not a single model call. `--only review` returns a review result without continuing into Plan or local merge. `--only verify` runs deterministic acceptance without Review/Judge or worktree creation.
|
|
201
|
+
|
|
202
|
+
Inspect progress:
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
flywheel status docs/add
|
|
206
|
+
tail -n 80 docs/add/orchestrator.log
|
|
207
|
+
git log -5 --oneline
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Stop with:
|
|
211
|
+
|
|
212
|
+
```sh
|
|
213
|
+
flywheel control stop --cwd "$PWD" --task-dir "$PWD/docs/add"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Only resume with `control start` after confirming the previous run ended and addressing its actual error. Retain the original task/worktree paths, reports, and state. A stop result concerns engine lifetime; recorded cleanup uncertainty still needs investigation, especially for Codex Pro's separately managed processes. See [recovery](workflow.md#7-stop-and-recover-without-losing-evidence).
|
|
217
|
+
|
|
218
|
+
For the first real run, record whether the task reached `completed`, all requirements were covered, frozen acceptance remained unchanged, independent review and reports exist, and the implementation was delivered in local Git. Record actual model identity, latency, and usage separately from preflight. No check in this guide claims those results on your behalf.
|
|
219
|
+
|
|
220
|
+
## 8. Upgrade and troubleshoot
|
|
221
|
+
|
|
222
|
+
Stop active tasks and confirm their state, preserve configuration/customizations, then rerun the installation command with the original prefix/project/DSH options. To pin 0.28.0, first confirm that exact version exists in the registry and replace `@latest` with `@0.28.0`. `flywheel setup --no-global` repairs setup for the installed version without selecting a different CLI release.
|
|
223
|
+
|
|
224
|
+
Existing hard-route configuration remains unchanged after upgrade. To adopt the new plugin route, change the effective hard binding or profile to `harness: "codex-pro"`, preserve model/channel/thinking, inspect it, and restart. Do not use `subagent_codex_pro` as a provider.
|
|
225
|
+
|
|
226
|
+
| Symptom | First check |
|
|
227
|
+
|---|---|
|
|
228
|
+
| Missing `install` or `control` command | Published version, `flywheel version`, PATH, and any explicit desktop `flywheelBinary` |
|
|
229
|
+
| Install succeeds but `ready:false` | Resolve the specific `diagnostic.checks` blockers |
|
|
230
|
+
| Terminal works but the desktop does not | Managed launcher, explicit override, GUI PATH/profile/environment; rerun setup and check the panel |
|
|
231
|
+
| A configuration edit has no effect | `config inspect` source and higher-priority task/project files; restart the engine |
|
|
232
|
+
| Skill or launcher conflict | Preserve customizations, compare the specific files, and resolve the reported conflict without altering ownership hashes |
|
|
233
|
+
| Worktree creation falls back in-place | Stop if isolation is required; inspect persisted mode and preserve work before recovery |
|
|
234
|
+
| Cleanup is unconfirmed | Inspect task-owned processes and receipts before retrying; elapsed time alone is not proof |
|
|
235
|
+
|
|
236
|
+
Installation is not one atomic transaction across npm, DSH, and all skills. Correct the reported cause and retry; preserve completed steps and user files. Do not delete whole configuration directories or modify integrity manifests to bypass conflicts.
|
|
237
|
+
|
|
238
|
+
To uninstall, first stop running tasks, remove the desktop Flywheel plugin through the desktop's supported plugin-management interface, then uninstall the global CLI using the same prefix:
|
|
239
|
+
|
|
240
|
+
```sh
|
|
241
|
+
npm uninstall --global @ckanner/flywheel
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Configuration, task ledgers, modified skills, and worktrees require deliberate separate handling; do not remove them as an incidental cleanup step. Maintainer build and publication procedures are in the [release guide](https://github.com/ckanner/flywheel/blob/main/docs/en/releasing.md). Normal users do not need npm publishing credentials or GitHub OIDC to install Flywheel.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# From requirements to a merged PR
|
|
2
|
+
|
|
3
|
+
[English README](../../README.en.md) · [中文](../workflow.md) · [Getting started](getting-started.md)
|
|
4
|
+
|
|
5
|
+
This guide describes the **0.28.0 implementation** and a recommended operating workflow. It does not assert that a particular npm version has been published. Check the registry when installing. The engine's local delivery and the host's GitHub operations are separate responsibilities.
|
|
6
|
+
|
|
7
|
+
## 1. Choose a model for preparation
|
|
8
|
+
|
|
9
|
+
Preparation turns a requirement into a Spec, task packets, acceptance commands, boundaries, and recorded dry-run evidence. `flywheel-new` uses the model selected in the host's current conversation. It does not switch that model based on `loops.plan`; that binding controls planning and revisions after the Go engine starts.
|
|
10
|
+
|
|
11
|
+
For accounts that expose the named models, these are practical starting points:
|
|
12
|
+
|
|
13
|
+
| Requirement | Preparation model and effort | Reason for the recommendation |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| Ambiguous requirements, architecture, protocol, or process lifecycle changes | `chatgpt/gpt-6-astra`, `high` | Spend more reasoning on constraints, failure cases, and testable acceptance before execution |
|
|
16
|
+
| A clear repository feature with known boundaries | `chatgpt/gpt-6.1-sol`, `high` | A practical default for making a concrete implementation plan |
|
|
17
|
+
| A small, explicit fix or documentation update | `deepseek-official/deepseek-flash`, `high` | Keep preparation proportional to a narrow task |
|
|
18
|
+
|
|
19
|
+
These are engineering recommendations, not benchmark results or evidence that one setting is universally best. Confirm the exact model ID and supported effort in the selected account and adapter. The checked DSH Flash adapter accepts `off/low/high/max`, not `medium`. A catalog entry or accepted configuration does not prove that real inference has succeeded.
|
|
20
|
+
|
|
21
|
+
Use the preparation model to identify risks and improve the contract. Increasing effort cannot repair missing requirements, an invalid test oracle, or an incorrectly chosen working directory. Later execution routes and the independent Review/Judge stages remain explicit configuration; see [Configuration](configuration.md).
|
|
22
|
+
|
|
23
|
+
## 2. Create the task integration worktree first
|
|
24
|
+
|
|
25
|
+
For an existing repository, create or deliberately reuse a task branch in its own worktree before invoking `flywheel-new`. The host or user performs this step. Choose unused names and substitute the repository's actual base branch:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
git status --short
|
|
29
|
+
git fetch origin
|
|
30
|
+
git worktree add -b task/my-feature ../repo-my-feature origin/main
|
|
31
|
+
cd ../repo-my-feature
|
|
32
|
+
git branch --show-current
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Inspect the initial status before proceeding. These commands create a new task branch without moving the original checkout's `main`. Do not use forced branch replacement to resolve a naming collision. If a task branch/worktree already exists, inspect its state and reuse it deliberately.
|
|
36
|
+
|
|
37
|
+
Keep the task at `docs/my-feature` **inside this worktree**. Run preparation and later CLI commands from this root; enter these same absolute paths in the desktop panel. Do not pair the original checkout's task directory with the new worktree's `cwd`, or change the task worktree's branch during a run.
|
|
38
|
+
|
|
39
|
+
The engine's integration checkout is the supplied `cwd`, not a hardcoded `main` branch. Its packet branches normally use `flywheel/<slug>/<packet-id>` and start from that checkout's HEAD. Successful packet delivery fast-forwards into the branch currently checked out there. This is why choosing a task branch before starting matters.
|
|
40
|
+
|
|
41
|
+
### Isolation has a fallback
|
|
42
|
+
|
|
43
|
+
Worktrees isolate working directories and indexes; they are not security sandboxes. The engine normally creates a packet worktree, but a creation failure can record the reason and fall back to **in-place** execution. There is currently no switch that requires successful isolation in every case.
|
|
44
|
+
|
|
45
|
+
If strict task isolation is required and the log reports `worktree unavailable`, stop and inspect the workspace and recorded mode. Correcting a directory and restarting does not automatically convert an already persisted in-place packet into a new worktree. Preserve its work and resolve the recorded situation explicitly; do not edit `state.json`, delete results, or force-reset a branch to hide it.
|
|
46
|
+
|
|
47
|
+
## 3. Prepare and review the contracts
|
|
48
|
+
|
|
49
|
+
In the task worktree, ask the host to run `flywheel-new`, or inspect the bundled templates and prepare the contract files manually:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
flywheel template --list
|
|
53
|
+
flywheel skills read flywheel-new
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
A runnable task needs a reviewed `spec.md` and at least one legal `task-packet-*.md`, using the bundled schemas. The preparation should establish:
|
|
57
|
+
|
|
58
|
+
- Requirement IDs, expected behavior, and scope exclusions.
|
|
59
|
+
- Packet dependencies, execution routes, editable paths, and forbidden paths.
|
|
60
|
+
- Real L1 commands and milestone L2/L3 commands with expected exit codes.
|
|
61
|
+
- Frozen acceptance tests or other oracles, separately protected from implementation tests.
|
|
62
|
+
- Actual dry-run results, with failure output and exit codes where applicable.
|
|
63
|
+
|
|
64
|
+
Run the stated commands before recording their results. An intentionally failing baseline can be valid evidence; a guessed passing result cannot. Ordinary implementation and regression tests can be added by the executor. Frozen acceptance and configuration must not be rewritten to make an implementation pass.
|
|
65
|
+
|
|
66
|
+
Review the files, then commit the substantive initial contracts so packet worktrees can obtain them from Git. The following assumes the index has been checked for unrelated staged work:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
git diff -- docs/my-feature
|
|
70
|
+
git diff --cached --stat
|
|
71
|
+
git add -- docs/my-feature
|
|
72
|
+
git diff --cached
|
|
73
|
+
git commit -m "docs: prepare my-feature contracts"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Stage any additional acceptance fixtures separately after review. Do not create `state.json`; the engine initializes and maintains it. An empty commit does not replace committing the actual contracts.
|
|
77
|
+
|
|
78
|
+
## 4. Open a task-level Draft PR
|
|
79
|
+
|
|
80
|
+
Once the reviewed contracts are committed, a Draft PR gives the task a durable review location. The user or authorized host runs the GitHub steps:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
git push -u origin task/my-feature
|
|
84
|
+
gh pr create --draft --base main --head task/my-feature
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Describe the problem, expected outcome, acceptance criteria, and remaining work. Usually one independently deliverable requirement or milestone belongs in one PR. Packets are the engine's internal execution units; the engine does not automatically create a PR for each packet.
|
|
88
|
+
|
|
89
|
+
Keep the PR in draft while implementation and acceptance are still changing. Opening it early does not imply that it should be merged early.
|
|
90
|
+
|
|
91
|
+
## 5. Run from the same task worktree
|
|
92
|
+
|
|
93
|
+
With the current directory still at the task worktree root:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
flywheel config inspect --cwd "$PWD" --task-dir "$PWD/docs/my-feature" --json
|
|
97
|
+
flywheel doctor --cwd "$PWD" --task-dir "$PWD/docs/my-feature" --probe --json
|
|
98
|
+
flywheel control start --cwd "$PWD" --task-dir "$PWD/docs/my-feature"
|
|
99
|
+
flywheel control status --cwd "$PWD" --task-dir "$PWD/docs/my-feature"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Preflight does not infer with a model or execute acceptance commands. Its unknown and warning results still need interpretation. Starting the real task invokes the configured models. A control response's `ok` describes the operation; final task completion is in `state.status`.
|
|
103
|
+
|
|
104
|
+
### Working directory by stage
|
|
105
|
+
|
|
106
|
+
| Stage or entry | Working directory | Responsibility |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `flywheel-new` preparation | Task integration worktree | Host creates or reuses it according to the skill |
|
|
109
|
+
| Plan | Task integration worktree | Engine uses the startup root to revise the task contracts |
|
|
110
|
+
| Execute, L1, Review | Current packet candidate workspace, normally its packet worktree | Engine creates, records, and reuses that workspace |
|
|
111
|
+
| L2/L3, Judge | Task integration worktree | Engine checks the integrated milestone |
|
|
112
|
+
| Intake, Garden | Selected task's worktree | Host selects the root; Go writes proposals. DSH/Codex request read-only; default Kimi has no OS-level read-only guarantee |
|
|
113
|
+
| Status, Stop | Original task directory and execution root | Query or stop the existing task without requiring a new worktree, branch switch, or commit |
|
|
114
|
+
|
|
115
|
+
Every loop does not create its own worktree. The outer task worktree spans the deliverable; a packet workspace spans its execution, acceptance, review, and delivery. Plan commits valid contract revisions in the integration worktree and attempts to fast-forward existing packet worktrees to that checkpoint while preserving implementation work. Conflicts stop for resolution.
|
|
116
|
+
|
|
117
|
+
`flywheel-verify` runs deterministic acceptance only. With `--packet`, it runs that packet's L1. Without a packet, it checks unfinished packets' L1 and the current milestone's L2/L3. It does **not** call Review or Judge, create worktrees, or perform local delivery. It uses the available candidate workspace and may use the integration checkout when no packet worktree is available.
|
|
118
|
+
|
|
119
|
+
The bundled skills check task location before preparation, run, resume, and manual loop actions. By default, development starts outside `main`, `master`, a known default branch, or detached HEAD unless the user has explicitly chosen and authorized that location. Direct CLI and GUI actions do not read or execute `SKILL.md`, create the outer task branch, or inherit those host checks. Read-only status and stopping must remain available even when development-entry checks would fail.
|
|
120
|
+
|
|
121
|
+
## 6. Understand local completion before merging the PR
|
|
122
|
+
|
|
123
|
+
A packet is delivered only after L1 and independent Review match its current candidate, and Git delivery is confirmed. The engine commits implementation changes, performs `git merge --ff-only` into the integration checkout, persists delivery state, and cleans up only when safe. Failed commits or merges preserve the workspace. Milestone completion additionally requires L2/L3 and Judge.
|
|
124
|
+
|
|
125
|
+
After the complete task passes, inspect the integrated changes and push them:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
git status --short
|
|
129
|
+
git log -5 --oneline
|
|
130
|
+
git push origin task/my-feature
|
|
131
|
+
gh pr ready
|
|
132
|
+
gh pr checks
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Before merging, review the current PR diff, relevant acceptance evidence, required CI results for the current head, and the effect of the current base branch. Changes after a green run or review may require renewed evidence. If a required CI check cannot run, record the blocker and use the repository's explicitly authorized exception process; do not describe an unavailable check as passed.
|
|
136
|
+
|
|
137
|
+
Manual merge after those gates is the recommended default. Auto-merge can be appropriate for a repository with an explicit policy, required checks/reviews, protected branches, and a defined class of eligible changes. Enabling it is a host/user decision; Flywheel does not infer that permission from an early Draft PR or a local packet pass.
|
|
138
|
+
|
|
139
|
+
## 7. Stop and recover without losing evidence
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
flywheel control stop --cwd "$PWD" --task-dir "$PWD/docs/my-feature"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Check the stop result and the actual failure before resuming from the **same** root and task path with `control start` or `flywheel-run`. A startup readiness timeout is a reason to query status and logs, not to launch a duplicate run. A stopped engine does not prove that every separately managed process is gone.
|
|
146
|
+
|
|
147
|
+
Codex Pro retains a machine receipt with configuration, process, cleanup, and usage facts. If cleanup is unconfirmed after the worker started, the engine escalates and stops the current run. It does not automatically try another channel, a transport retry, or a fresh Plan call. Confirm the task-owned plugin/app-server/guardian processes have ended before attempting recovery; a fixed delay is not evidence. Avoid broad process killing that could terminate unrelated sessions.
|
|
148
|
+
|
|
149
|
+
For a delivery conflict, preserve the packet worktree, inspect Git state, resolve the conflict deliberately, then resume and let the engine revalidate evidence. Do not use forced cleanup or manual state edits as a recovery shortcut. Configuration changes require restarting the engine.
|
|
150
|
+
|
|
151
|
+
## Reference boundaries
|
|
152
|
+
|
|
153
|
+
The engine owns local state, bounded loops, verification, and Git delivery. The authorized host/user owns task-branch setup, GitHub pushes and PRs, remote CI policy, PR merge, and publication. Repository visibility and licensing are separate decisions.
|
|
154
|
+
|
|
155
|
+
Implementation references: [engine](https://github.com/ckanner/flywheel/blob/main/internal/machine/run.go), [Git/worktree operations](https://github.com/ckanner/flywheel/blob/main/internal/verify/verify.go), [design](https://github.com/ckanner/flywheel/blob/main/docs/design.md), and [bundled skills](https://github.com/ckanner/flywheel/tree/main/skills). Additional documentation: [Git worktree](https://git-scm.com/docs/git-worktree) and [GitHub auto-merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request).
|
package/docs/getting-started.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Mac 安装与首个 Flywheel 任务
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[English](en/getting-started.md) · 简体中文
|
|
4
|
+
|
|
5
|
+
本文适用于 **Flywheel 0.28.0 及以后的完整 npm 发行版**,覆盖 npm 一条命令安装 CLI、worker、DSH 插件与 skills,到配置、启动、观察、停止和恢复一个小任务。DSH 接口目标是已核对的 **Mac 桌面 0.2.1-rc.5**。真实桌面、Seatbelt 和账号调用仍需在自己的 Mac 验收,CI 不能代替这些检查。
|
|
4
6
|
|
|
5
7
|
安装前用 `npm view @ckanner/flywheel version` 确认 registry 的 latest 已更新到所需版本;源码合并或 GitHub Release 不代表 npm 已发行。旧 0.22.1 没有本教程使用的安装与 DSH 接口,当前发行状态见[发行记录](releasing.md#3-失败恢复)。
|
|
6
8
|
|
|
@@ -16,15 +18,17 @@
|
|
|
16
18
|
8. [升级、排错与卸载](#8-升级排错与卸载)
|
|
17
19
|
9. [开发与备用构建](#9-开发与备用构建)
|
|
18
20
|
|
|
21
|
+
已有业务仓库另见[从需求准备到 PR 合并](workflow.md):模型选择、任务 worktree、Draft PR 与合并时机。
|
|
22
|
+
|
|
19
23
|
## 1. 准备运行环境
|
|
20
24
|
|
|
21
25
|
| 依赖 | 用途与检查 |
|
|
22
26
|
|---|---|
|
|
23
27
|
| Git,已配置提交身份 | Flywheel 使用 worktree 和本地提交交付;执行 `git --version` |
|
|
24
|
-
| Node.js 22 或更高,npm | 安装 Flywheel 并运行 CLI 启动器/DSH worker;执行 `node --version`、`npm --version` |
|
|
28
|
+
| Node.js 22.18.0 或更高,npm | 安装 Flywheel 并运行 CLI 启动器/DSH worker;执行 `node --version`、`npm --version` |
|
|
25
29
|
| DSH Mac 桌面及其安装的 `dsh` 命令 | 在 About 核对具体版本;执行 `command -v dsh`、`dsh --version` |
|
|
26
30
|
| 已登录的 Kimi CLI | 默认 Plan、frontend、Garden 使用它;执行 `kimi --version`、`kimi --help` |
|
|
27
|
-
| 已登录的 Codex
|
|
31
|
+
| 已登录的 Codex 程序 | Codex Pro 插件在 `hard` 路由中启动其 app-server;执行 `codex --version` |
|
|
28
32
|
| SDK profile 的 DeepSeek 和 ChatGPT provider | 默认实现/评审使用;配置与授权见下一节 |
|
|
29
33
|
| Go 1.27 或更高 | 仅本文的 Go 示例和源码构建需要;npm 安装 Flywheel 不需要 Go 工具链 |
|
|
30
34
|
|
|
@@ -46,7 +50,7 @@ npx -y @ckanner/flywheel@latest install --json
|
|
|
46
50
|
|
|
47
51
|
两条命令选择一种即可。安装器按顺序完成:
|
|
48
52
|
|
|
49
|
-
1. 把本次安装器的精确版本装到 npm 全局目录,解析适合本机的 Go
|
|
53
|
+
1. 把本次安装器的精确版本装到 npm 全局目录,解析适合本机的 Go 平台包、同版本 DSH/Codex Pro workers 及精确插件依赖 `dsh-subagent-codex-pro@0.8.0`,核对 CLI 版本。
|
|
50
54
|
2. 从 Go 二进制安装全部 10 个 skills;全局配置不存在时生成默认配置,已有配置保留。
|
|
51
55
|
3. 写入 GUI 启动器和安装记录,使用绝对 Node/CLI 路径。
|
|
52
56
|
4. 通过现有桌面 `dsh` 注册精确版本的 Flywheel 插件,并通过 `plugin list` 验证安装结果。
|
|
@@ -99,7 +103,7 @@ worker 默认使用独立的 `sdk` profile。桌面已安装 provider,不代
|
|
|
99
103
|
dsh plugin --profile sdk add dsh-plugin-chatgpt@0.1.17
|
|
100
104
|
```
|
|
101
105
|
|
|
102
|
-
随后按该 provider 的文档在对应 profile 完成授权,并保持一致的 `DSH_HOME`。不需要把凭证复制到任务契约或 Git。此处不把 `subagent_codex_pro` 当成原生 LLM provider
|
|
106
|
+
随后按该 provider 的文档在对应 profile 完成授权,并保持一致的 `DSH_HOME`。不需要把凭证复制到任务契约或 Git。此处不把 `subagent_codex_pro` 当成原生 LLM provider。困难任务通过 `codex-pro` worker 直接使用已安装插件的公开 machine API,不需要 DSH 父模型再发一次工具调用。底层 Codex app-server 仍需本机 Codex 与登录;包依赖安装不代替它们。
|
|
103
107
|
|
|
104
108
|
### Mac GUI 的自动入口
|
|
105
109
|
|
|
@@ -170,7 +174,7 @@ flywheel doctor --cwd "$PWD" --probe --json
|
|
|
170
174
|
|
|
171
175
|
第一条只查有效配置、本地命令版本、目录及已声明环境变量;不会检查凭证文件、发送模型 prompt 或运行 packet 验收。第二条对选中的 DSH 绑定做 SDK 初始化、cwd/沙箱握手及正常关闭;provider 初始化可能联网查询目录,但**没有推理请求**。两者都不创建 Flywheel 状态、运行锁、worktree 或全局配置。
|
|
172
176
|
|
|
173
|
-
结果按 pass/fail/warn/unknown/skipped 展示;有 fail 时退出码 1,JSON 仍完整可读。即使 `ok:true`,unknown 的账号授权、订阅额度与实际推理仍未验证。Kimi/Codex
|
|
177
|
+
结果按 pass/fail/warn/unknown/skipped 展示;有 fail 时退出码 1,JSON 仍完整可读。即使 `ok:true`,unknown 的账号授权、订阅额度与实际推理仍未验证。Kimi/Codex 在这里只检查命令;Codex Pro 额外实际导入精确版本的公开 API,不会自动登录或试调用。Codex Pro 的完整沙箱策略只能事后审查,所以对应 sandbox 项会显示 warn,模型/配置/认证保持 unknown;`--probe` 也不会为它发送推理。DSH 同一账号、模型、effort、目录和权限只探测一次,总预算 40 秒另加清理窗口;超时后明确失败。
|
|
174
178
|
|
|
175
179
|
未指定任务时检查全部配置绑定,可能包括首个任务用不到的 Codex hard 路由。准备好任务后可把范围缩小为所需的 Plan/Execute route/Review/Judge(以及显式启用的 judge-panel):
|
|
176
180
|
|
|
@@ -184,6 +188,8 @@ flywheel doctor --cwd "$PWD" --task-dir docs/add --probe --json
|
|
|
184
188
|
|
|
185
189
|
## 6. 准备首个小任务
|
|
186
190
|
|
|
191
|
+
已有业务仓库应先建立任务集成分支和独立 worktree,再生成契约;启动时的 `cwd` 指向该 worktree。完整步骤见[从需求准备到 PR 合并](workflow.md),下面的小仓库示例用于首次运行验收。
|
|
192
|
+
|
|
187
193
|
首次建议使用单独的小仓库,便于分清安装问题和业务代码问题。npm 包附带的准备脚本会创建一个 Go 加法函数任务:初始实现故意错误,执行者需修复实现并补普通单测;独立 acceptance 测试不可修改。本示例需要 Go 1.27 或更高。
|
|
188
194
|
|
|
189
195
|
```sh
|
|
@@ -226,7 +232,7 @@ git commit -m "docs: prepare first flywheel task"
|
|
|
226
232
|
|
|
227
233
|
Git 提交身份必须已经按自己的设置配置。此时不应创建 `state.json`,它由引擎初始化。coverage 输出已被忽略,所以验收运行不会把生成物误判为候选代码漂移。
|
|
228
234
|
|
|
229
|
-
|
|
235
|
+
对于已有业务仓库,`flywheel-new` 使用当前 DSH 会话的模型生成契约;复杂需求建议选已授权的 `gpt-6-astra`、`high`,简单明确任务可沿用 Flash。它不会自动读取 `loops.plan` 来换模型,后者控制引擎运行后的 Kimi 规划/修订。可以通过 `flywheel-new` 生成并审阅契约,或者用 `flywheel template --list` 查看模板后手工准备。示例 auth 模板不是通用可运行任务,其中路径和验收命令必须改为真实项目的命令。不要照抄后直接启动。
|
|
230
236
|
|
|
231
237
|
## 7. 启动、观察、停止与恢复
|
|
232
238
|
|
|
@@ -276,7 +282,9 @@ flywheel control start --task-dir "$PWD/docs/add" --cwd "$PWD"
|
|
|
276
282
|
npx -y @ckanner/flywheel@latest install
|
|
277
283
|
```
|
|
278
284
|
|
|
279
|
-
自定义 prefix、项目 skills 或 DSH 入口时保留原参数。想固定某个已发布版本,可把 `@latest` 换成该精确版本,例如在 registry 确认 0.
|
|
285
|
+
自定义 prefix、项目 skills 或 DSH 入口时保留原参数。想固定某个已发布版本,可把 `@latest` 换成该精确版本,例如在 registry 确认 0.28.0 已发布后使用 `@0.28.0`;安装器始终为 CLI、平台包、worker 和桌面插件选择本次安装器的同一版本。已安装包的配置修复可用 `flywheel setup --no-global`,它不会将 CLI 升级到别的版本。
|
|
286
|
+
|
|
287
|
+
从 0.27.x 升级到本版后,要使用新的默认插件路径,应在有效配置的 `routes.hard`(或其 profile)设置 `"harness": "codex-pro"`,保留所选 model/thinking/channel。先用 `config inspect` 找到实际配置来源;不要把 external subagent 的工具名写成 DSH provider。
|
|
280
288
|
|
|
281
289
|
安装后对照新模板审阅需要迁移的配置,按宿主提示重新载入,运行 doctor,再用小任务验证。已有配置不会自动覆盖;特别检查任务级文件是否遮住了刚修改的项目或全局设置。安装不是跨 npm、DSH 与全部 skills 的单个事务:失败时报告已完成步骤,不擅自回退包管理器或删除用户文件。修正原因后重跑会重新核对版本与内容。
|
|
282
290
|
|
|
@@ -323,7 +331,7 @@ npm uninstall --global @ckanner/flywheel
|
|
|
323
331
|
|
|
324
332
|
## 9. 开发与备用构建
|
|
325
333
|
|
|
326
|
-
以下用于贡献代码、检查未发布分支或离线备份;普通用户使用 npm 安装。需要 Git、Go 1.27 或更高、Node.js 22 或更高:
|
|
334
|
+
以下用于贡献代码、检查未发布分支或离线备份;普通用户使用 npm 安装。需要 Git、Go 1.27 或更高、Node.js 22.18.0 或更高:
|
|
327
335
|
|
|
328
336
|
```sh
|
|
329
337
|
git clone https://github.com/ckanner/flywheel.git
|