@ckanner/flywheel 0.31.0 → 0.32.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +122 -5
  2. package/CONTRIBUTING.md +19 -0
  3. package/LICENSE +21 -0
  4. package/README.en.md +4 -171
  5. package/README.md +152 -269
  6. package/README.zh-CN.md +116 -0
  7. package/bin/flywheel-claude-code-pro-worker.js +1 -1
  8. package/bin/flywheel-codex-pro-worker.js +1 -1
  9. package/bin/flywheel-dsh-worker.js +1 -1
  10. package/bin/flywheel.js +1 -1
  11. package/bin/runtime.js +1 -1
  12. package/docs/README.md +86 -0
  13. package/docs/README.zh-CN.md +64 -0
  14. package/docs/archive/README.md +13 -0
  15. package/docs/archive/codex-pro-adapter-handoff.md +197 -0
  16. package/docs/archive/design-v0.24.md +540 -0
  17. package/docs/design.md +812 -0
  18. package/docs/en/claude-code-pro.md +25 -16
  19. package/docs/en/configuration.md +405 -145
  20. package/docs/en/contributing.md +303 -0
  21. package/docs/en/flow-console.md +142 -24
  22. package/docs/en/getting-started.md +232 -126
  23. package/docs/en/investigation.md +263 -0
  24. package/docs/en/jev-shadow.md +5 -0
  25. package/docs/en/jev.md +240 -0
  26. package/docs/en/model-policy.md +154 -62
  27. package/docs/en/releasing.md +207 -0
  28. package/docs/en/session-evaluation.md +4 -2
  29. package/docs/en/session-recovery.md +88 -6
  30. package/docs/en/workflow.md +241 -114
  31. package/docs/evaluation/README.md +12 -0
  32. package/docs/evaluation/jev-historical-provisional.json +138 -0
  33. package/docs/evaluation/jev-historical-result-2026-11-10.json +174 -0
  34. package/docs/plans/2026-11-01-dsh-integration.md +67 -0
  35. package/docs/plans/2026-11-01-model-profiles-preflight.md +29 -0
  36. package/docs/plans/2026-11-01-npm-installation.md +19 -0
  37. package/docs/plans/2026-11-03-codex-pro-default.md +28 -0
  38. package/docs/plans/2026-11-06-adaptive-workflow.md +365 -0
  39. package/docs/plans/2026-11-07-session-lifecycle.en.md +424 -0
  40. package/docs/plans/2026-11-07-session-lifecycle.md +337 -0
  41. package/docs/plans/2026-11-08-flow-console.md +271 -0
  42. package/docs/plans/2026-11-10-jev-shadow.md +32 -0
  43. package/docs/plans/2026-11-10-task-discovery.md +17 -0
  44. package/docs/plans/2026-11-10-workbench-redesign.md +19 -0
  45. package/docs/plans/2026-11-12-feedback-driven-workflows.md +739 -0
  46. package/docs/plans/2026-11-12-unified-jev-decisions.md +89 -0
  47. package/docs/plans/2026-11-13-jev-execution-decisions.md +110 -0
  48. package/docs/plans/2026-11-13-p5-ready-queue-prewarm.md +178 -0
  49. package/docs/plans/README.md +25 -0
  50. package/docs/reviews/2026-08-24-v0.18-review-fixplan.md +265 -0
  51. package/docs/reviews/2026-09-12-pr4-pr5-review.md +70 -0
  52. package/docs/reviews/README.md +12 -0
  53. package/docs/validation/2026-11-01-npm-installation.md +105 -0
  54. package/docs/validation/2026-11-01-profiles-preflight.md +67 -0
  55. package/docs/validation/2026-11-01-results.md +114 -0
  56. package/docs/validation/2026-11-03-codex-pro-default.md +90 -0
  57. package/docs/validation/2026-11-04-dsh-native-view.md +85 -0
  58. package/docs/validation/2026-11-04-release-0.28.1.md +33 -0
  59. package/docs/validation/2026-11-04-release-0.28.2.md +35 -0
  60. package/docs/validation/2026-11-05-dsh-0.2.2-compatibility.md +26 -0
  61. package/docs/validation/2026-11-05-registry-smoke-recovery.md +26 -0
  62. package/docs/validation/2026-11-05-release-0.28.3.md +32 -0
  63. package/docs/validation/2026-11-05-subscription-model-access.md +60 -0
  64. package/docs/validation/2026-11-05-view-order.md +14 -0
  65. package/docs/validation/2026-11-07-adaptive-workflow.md +79 -0
  66. package/docs/validation/2026-11-07-claude-code-pro.md +144 -0
  67. package/docs/validation/2026-11-07-session-lifecycle.md +136 -0
  68. package/docs/validation/2026-11-08-session-p3-p4.md +99 -0
  69. package/docs/validation/2026-11-09-flow-console.md +81 -0
  70. package/docs/validation/2026-11-10-jev-shadow.md +50 -0
  71. package/docs/validation/2026-11-10-task-discovery.md +45 -0
  72. package/docs/validation/2026-11-10-workbench-redesign.md +54 -0
  73. package/docs/validation/2026-11-11-release-0.30.2.md +65 -0
  74. package/docs/validation/2026-11-11-release-0.31.0.md +46 -0
  75. package/docs/validation/2026-11-12-dsh-0.2.2-rc.2.md +58 -0
  76. package/docs/validation/2026-11-12-feedback-driven-workflows.md +187 -0
  77. package/docs/validation/2026-11-12-release-0.31.1.md +58 -0
  78. package/docs/validation/2026-11-12-session-console-ux.md +46 -0
  79. package/docs/validation/2026-11-12-unified-jev-decisions.md +93 -0
  80. package/docs/validation/2026-11-13-dsh-settings-controls.md +104 -0
  81. package/docs/validation/2026-11-13-jev-execution-decisions.md +140 -0
  82. package/docs/validation/2026-11-13-p5-ready-queue-prewarm.md +138 -0
  83. package/docs/validation/2026-11-13-p5-review-closure.md +114 -0
  84. package/docs/validation/2026-11-13-p5-tracked-runtime-fixes.md +108 -0
  85. package/docs/validation/2026-11-13-prewarm-receipts-and-expiry-tests.md +92 -0
  86. package/docs/validation/2026-11-13-workspace-redesign.md +66 -0
  87. package/docs/validation/README.md +51 -0
  88. package/docs/validation/evidence/2026-11-08-session-p3-p4.json +5430 -0
  89. package/docs/validation/evidence/2026-11-13-p5-npm-candidate.json +54 -0
  90. package/docs/validation/evidence/claude-node-bridges.txt +118 -0
  91. package/docs/validation/evidence/claude-npm-build.txt +15 -0
  92. package/docs/validation/evidence/claude-npm-candidate.json +54 -0
  93. package/docs/validation/evidence/claude-npm-install.txt +21 -0
  94. package/docs/validation/evidence/claude-npm-tests.txt +145 -0
  95. package/docs/validation/evidence/claude-plugin-tests.txt +205 -0
  96. package/docs/validation/evidence/claude-quality-gate.txt +29 -0
  97. package/docs/validation/evidence/claude-race.txt +7 -0
  98. package/docs/validation/evidence/codex-pro-070-probes.txt +4 -0
  99. package/docs/validation/evidence/dsh-bridge.txt +4 -0
  100. package/docs/validation/evidence/dsh-native-view-bridge-tests.txt +1 -0
  101. package/docs/validation/evidence/dsh-native-view-build.txt +15 -0
  102. package/docs/validation/evidence/dsh-native-view-candidate.json +54 -0
  103. package/docs/validation/evidence/dsh-native-view-inspect.txt +27 -0
  104. package/docs/validation/evidence/dsh-native-view-install-tests.txt +19 -0
  105. package/docs/validation/evidence/dsh-native-view-npm-tests.txt +143 -0
  106. package/docs/validation/evidence/dsh-native-view-plugin-tests.txt +99 -0
  107. package/docs/validation/evidence/dsh-native-view-quality-gate.txt +29 -0
  108. package/docs/validation/evidence/dsh-plugin-tests.txt +48 -0
  109. package/docs/validation/evidence/function-coverage.txt +378 -0
  110. package/docs/validation/evidence/npm-build.txt +13 -0
  111. package/docs/validation/evidence/npm-contract-tests.txt +65 -0
  112. package/docs/validation/evidence/npm-dsh-bridge.txt +18 -0
  113. package/docs/validation/evidence/npm-dsh-plugin-tests.txt +62 -0
  114. package/docs/validation/evidence/npm-function-coverage.txt +420 -0
  115. package/docs/validation/evidence/npm-install-tests.txt +20 -0
  116. package/docs/validation/evidence/npm-quality-gate.txt +29 -0
  117. package/docs/validation/evidence/npm-race.txt +7 -0
  118. package/docs/validation/evidence/pr-dsh-bridge.txt +4 -0
  119. package/docs/validation/evidence/pr-dsh-plugin-tests.txt +48 -0
  120. package/docs/validation/evidence/pr-function-coverage.txt +379 -0
  121. package/docs/validation/evidence/pr-quality-gate.txt +28 -0
  122. package/docs/validation/evidence/pr-race.txt +6 -0
  123. package/docs/validation/evidence/profiles-control-smoke.json +1 -0
  124. package/docs/validation/evidence/profiles-dsh-bridge.txt +18 -0
  125. package/docs/validation/evidence/profiles-dsh-plugin-tests.txt +59 -0
  126. package/docs/validation/evidence/profiles-function-coverage.txt +411 -0
  127. package/docs/validation/evidence/profiles-quality-gate.txt +29 -0
  128. package/docs/validation/evidence/profiles-race.txt +7 -0
  129. package/docs/validation/evidence/quality-gate.txt +28 -0
  130. package/docs/validation/evidence/race.txt +6 -0
  131. package/docs/validation/evidence/watchdog-startup-after.txt +2 -0
  132. package/docs/validation/evidence/watchdog-startup-before.txt +6 -0
  133. package/docs/validation/evidence/watchdog-startup-quality-gate.txt +29 -0
  134. package/docs/validation/evidence/watchdog-startup-race.txt +7 -0
  135. package/docs/{claude-code-pro.md → zh-CN/claude-code-pro.md} +23 -17
  136. package/docs/{configuration.md → zh-CN/configuration.md} +397 -142
  137. package/docs/zh-CN/contributing.md +240 -0
  138. package/docs/zh-CN/flow-console.md +216 -0
  139. package/docs/zh-CN/getting-started.md +352 -0
  140. package/docs/zh-CN/investigation.md +213 -0
  141. package/docs/zh-CN/jev-shadow.md +5 -0
  142. package/docs/zh-CN/jev.md +192 -0
  143. package/docs/zh-CN/model-policy.md +128 -0
  144. package/docs/zh-CN/releasing.md +120 -0
  145. package/docs/{session-evaluation.md → zh-CN/session-evaluation.md} +4 -2
  146. package/docs/{session-recovery.md → zh-CN/session-recovery.md} +75 -12
  147. package/docs/zh-CN/workflow.md +284 -0
  148. package/npm/install.js +1 -1
  149. package/package.json +12 -25
  150. package/docs/flow-console.md +0 -122
  151. package/docs/getting-started.md +0 -418
  152. package/docs/model-policy.md +0 -65
  153. package/docs/workflow.md +0 -314
@@ -1,54 +1,111 @@
1
- # From requirements to a merged PR
1
+ # Workflow: from a goal to a pull request
2
2
 
3
- [English README](../../README.en.md) · [中文](../workflow.md) · [Getting started](getting-started.md)
3
+ [Documentation](../README.md) · English · [简体中文](../zh-CN/workflow.md)
4
4
 
5
- This guide describes the **current source 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.
5
+ Flywheel turns a reviewed task contract into verified local Git changes. The host
6
+ assistant prepares the task; the Go engine owns scheduling, verification, recovery,
7
+ and delivery. The workflow console can also create and merge a PR when those remote
8
+ operations are explicitly authorized.
9
+
10
+ Use this guide for an existing repository. For installation and a disposable first
11
+ run, start with [Getting started](getting-started.md).
6
12
 
7
13
  ## 0. Normal entry: describe a goal and launch
8
14
 
9
- With a matching CLI/plugin release containing the adaptive workflow, use:
15
+ In DSH Chat, describe the requirement with the task skill:
10
16
 
11
17
  ```text
12
- /flywheel-task Fix the identified bug, add regression coverage, and complete verification. mode=auto
18
+ /flywheel-task Fix the identified issue, add regression coverage, and complete verification. mode=auto
13
19
  ```
14
20
 
15
- The current host conversation researches the code, creates or reuses the task integration worktree, prepares contracts and workflow facts, and calls `flywheel_launch`. Go validates eligibility and starts the engine; DSH associates that exact task with the initiating session's Flywheel view. There is normally no need to copy paths or repeat an authorization already given. Check `flywheel control launch --help` before relying on this new entry; older installation commands do not prove its availability.
21
+ The host researches the code, selects or reuses the task execution directory,
22
+ prepares the Spec, packets, executable acceptance checks, and workflow evidence,
23
+ then calls `flywheel_launch` within the authorized scope. The plugin associates the
24
+ actual task with the conversation. Loading a skill or receiving a proposal alone
25
+ does not mean the engine started; check the launch result and task status.
16
26
 
17
- | Choice | Selection and loop |
27
+ | Mode | Selection and execution |
18
28
  |---|---|
19
- | Auto, the new entry's default | Select Quick from supported contract facts; use Full when facts are insufficient or risks remain |
20
- | Quick | One milestone and packet: Execute, all required checks, one independent final Review, Git delivery |
21
- | Full | Plan, packet execution/review, integrated L2/L3, Judge |
22
-
23
- Quick requires clear scope, a known implementation pattern, complete verification mappings, and a final reviewer able to assess the whole task. Missing L2/L3 needs an explicit inapplicability reason. File count does not establish safety: authentication, permissions, payments, migrations, concurrency, and unresolved design use Full. An explicit Quick request still has to qualify. A verification gap or new risk causes a persisted upgrade to Full while preserving task identity, work, budget, and history.
24
-
25
- The first-success Quick path has two stage-agent calls, Execute and final Review. Host preparation, internal model/tool turns, and retries are separate. Required coverage, integration/user-path tests, and applicable defect sampling still run against the final candidate; Plan/Judge are recorded as not applicable with reasons, never as fabricated passes.
26
-
27
- Use `/flywheel-new` when the user only wants a proposal and `/flywheel-run <actual task path>` to start or resume an existing task. Preserve prior implementation and delivery authorization; honor an explicit request to review a proposal first. The sections below explain the individual checkpoints, not mandatory approval stops for the unified entry.
29
+ | Auto, the default | Go selects Quick when recorded qualification facts are sufficient; otherwise Full |
30
+ | Quick, also labelled ultraWork in the console | One milestone and packet; Execute, required checks, independent final Review, and Git delivery |
31
+ | Full | Plan, packet execution and review, integrated L2/L3 checks, and Judge |
32
+
33
+ Quick needs clear scope, a known implementation approach, complete requirement
34
+ coverage, and a final review that can assess the whole task. Missing L2/L3 checks
35
+ need explicit reasons. Authentication, permissions, payments, migrations,
36
+ concurrency, or unresolved design risks select Full. An explicit Quick request
37
+ still has to qualify; file count alone is not a risk assessment.
38
+
39
+ A first-success Quick run has two stage-agent calls: Execute and final Review.
40
+ Preparation, internal tool turns, retries, and upgrades are additional work. Required
41
+ tests, coverage, applicable L2/L3, defect sampling, budgets, and cleanup remain in
42
+ force. Plan/Judge are marked not applicable with reasons. A newly discovered risk or
43
+ verification gap saves a one-way Quick → Full upgrade, preserving work and budgets.
44
+
45
+ Use `/flywheel-new <goal>` for preparation without launching, and
46
+ `/flywheel-run <absolute-task-directory>` for an existing task. Kimi uses
47
+ `/skill:flywheel-task` and the corresponding `/skill:` names.
48
+
49
+ ## 0.1 Investigation and direct controls
50
+
51
+ Task can accept “diagnose this and explain the cause” directly, prepare its contract
52
+ and enter the Go-owned investigation. Calling New first is not required. Report-only
53
+ goals stop at the report; authorized repair continues within the original scope
54
+ when the evidence supports a conclusion. See [Investigation](investigation.md) for
55
+ contracts, evidence, JEV and recovery. New → review → Run remains appropriate when
56
+ proposal review is requested. Plan / Exec / Verify / Review / Status / Stop remain.
57
+
58
+ Full reuses a confirmed, persisted Plan checkpoint when its inputs and baseline stay
59
+ valid. Explicit Plan, verification gaps, changed contracts or untrusted baselines
60
+ still replan. Targeted executor checks complement the complete Go gate and independent
61
+ Review. Default model bindings remain; execution allowlists and verified incremental
62
+ context are independent opt-ins described in [Configuration](configuration.md).
63
+
64
+ Authorized investigations can include exact reproduction commands in private
65
+ input copies and explicit GET/HEAD requests. Their real execution boundary,
66
+ deadline, output limits and receipts belong to the investigation contract.
67
+ Enabling JEV also permits bounded choices after confirmed implementation failures:
68
+ repair, an approved feedback check, replanning, or an already allowed execution
69
+ binding. Go retains workflow eligibility and the complete final gates; a successful
70
+ feedback experiment does not complete the implementation.
28
71
 
29
72
  ## 1. Choose a model for preparation
30
73
 
31
- Preparation turns a requirement into a Spec, task packets, acceptance commands, boundaries, and recorded dry-run evidence. `flywheel-task` and `flywheel-new` use the host's current conversation model. They do not switch it based on `loops.plan`; that binding controls planning and revisions after the Go engine starts.
74
+ `flywheel-task` and `flywheel-new` run in the host's current conversation. The
75
+ `loops.plan` binding controls planning **after the engine starts**; it does not
76
+ change that host conversation's model.
32
77
 
33
- For accounts that expose the named models, these are practical starting points:
34
-
35
- | Requirement | Preparation model and effort | Reason for the recommendation |
78
+ | Preparation work | Suggested DSH provider / model | Effort |
36
79
  |---|---|---|
37
- | 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 |
38
- | A clear repository feature with known boundaries | `chatgpt/gpt-6.1-sol`, `high` | A practical default for making a concrete implementation plan |
39
- | A small, explicit fix or documentation update | `deepseek-account/deepseek-flash`, `high` | Keep preparation proportional to a narrow task |
80
+ | Architecture, protocols, lifecycle, or uncertain acceptance | `chatgpt` / `gpt-6-astra` | `high` |
81
+ | A bounded feature with established implementation patterns | `chatgpt` / `gpt-6.1-sol` | `high` |
82
+ | An explicit small fix or documentation update | `deepseek-account` / `deepseek-flash` | `high` |
40
83
 
41
- 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.
84
+ These are engineering starting points, not project benchmark results. Check exact
85
+ model IDs and supported effort in the selected account. Raising effort does not
86
+ repair missing requirements or an invalid test oracle. Runtime defaults and the
87
+ separate account channels are described in [Model policy](model-policy.md) and
88
+ [Configuration](configuration.md).
42
89
 
43
- DeepSeek uses the existing signed-in, funded DSH account. `deepseek-official` API access is an explicit alternative; the default preset has no fallback to it. User-defined fallback policies remain explicitly configured. `high` remains an engineering baseline without project A/B evidence; do not automatically raise every stage to `xhigh` or `max`.
90
+ ## 2. Choose the task execution directory
44
91
 
45
- 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).
92
+ Keep these locations distinct:
46
93
 
47
- ## 2. Choose the task execution directory
94
+ | Location | Purpose |
95
+ |---|---|
96
+ | Project workspace | Stable repository identity for Provider sessions; normally the original checkout |
97
+ | Task integration directory | Checkout and branch where contracts are prepared and verified packets are integrated |
98
+ | Task files directory | `docs/<slug>` inside that checkout; contains Spec, packets, state, and reports |
99
+ | Packet execution directory | Candidate checkout used by Execute, verification, and Review; usually an engine-managed worktree |
48
100
 
49
- First inspect the effective `worktree.enabled` setting. The default enabled mode follows the independent Worktree flow below. With automatic management off, use the selected task checkout; callers may still choose a Worktree and parallel scheduling remains independent. Session project membership is recorded separately from execution location. See the [console guide](flow-console.md).
101
+ The project workspace and execution directory may differ. Provider project
102
+ membership does not redirect file operations: prompts and evidence identify the
103
+ actual execution directory. A backend that cannot represent the selected split
104
+ `workspace-write` sandbox rejects that combination before dispatch.
50
105
 
51
- 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:
106
+ For a repository using the default worktree policy, create or deliberately reuse a
107
+ task branch and worktree before preparation. Inspect existing changes first, use
108
+ unused names, and substitute the repository's actual base branch:
52
109
 
53
110
  ```sh
54
111
  git status --short
@@ -58,50 +115,63 @@ cd ../repo-my-feature
58
115
  git branch --show-current
59
116
  ```
60
117
 
61
- 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.
118
+ Keep this task's files at `docs/my-feature` inside the selected checkout. The
119
+ integration branch is the branch checked out in the supplied `cwd`; it is not
120
+ hardcoded to `main`. Do not pair task files from one checkout with another
121
+ checkout's `cwd`, or switch its branch during a run.
62
122
 
63
- Keep the task at `docs/my-feature` **inside this worktree**. Run preparation and later CLI commands from this root. If using the desktop view, choose this task directory; leave its optional project directory blank only when the DSH session's current directory is already this worktree. 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.
123
+ `worktree.enabled` controls automatic **packet** worktree management, independently
124
+ of scheduling. With it disabled, the selected task checkout can be shared or an
125
+ external worktree can be registered before implementation. External directories
126
+ must satisfy the engine's baseline, branch, cleanliness, and ownership checks; see
127
+ [Parallel execution](flow-console.md#parallel-execution).
64
128
 
65
- 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.
129
+ ### Isolation and failure behavior
66
130
 
67
- ### Isolation has a fallback
131
+ Worktrees separate working directories and indexes; they are not security sandboxes.
132
+ The legacy serial path can record a worktree-creation failure and fall back to
133
+ in-place execution. Parallel execution with automatic worktree management requires
134
+ isolated directories and fails if they cannot be created. Disabling automatic
135
+ management explicitly permits shared-checkout execution, with different validation
136
+ and batch-delivery rules.
68
137
 
69
- 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.
70
-
71
- 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.
138
+ If isolation is required, inspect the recorded workspace mode and stop on an
139
+ unexpected fallback. Preserve existing work and resolve the failure; do not edit
140
+ `state.json` or force-reset a branch to manufacture an isolated state.
72
141
 
73
142
  ## 3. Prepare and review the contracts
74
143
 
75
- In the task worktree, ask the host to run `flywheel-new`, or inspect the bundled templates and prepare the contract files manually:
144
+ From the task integration directory, use the preparation skill or inspect the
145
+ bundled templates:
76
146
 
77
147
  ```sh
78
148
  flywheel template --list
79
149
  flywheel skills read flywheel-new
80
150
  ```
81
151
 
82
- In DSH's conversation input, select the skill from the `/` menu or send:
83
-
84
152
  ```text
85
- /flywheel-new Prepare docs/my-feature for this requirement. Research the actual code, define packets, routes, boundaries and executable acceptance checks, run L1 to record the baseline, then present the contracts for review.
153
+ /flywheel-new Prepare docs/my-feature for this requirement. Inspect the code, define bounded packets and executable acceptance checks, run the baseline checks, and present the contracts for review.
86
154
  ```
87
155
 
88
- **No initial Flywheel-view form is required.** The assistant creates or reuses the task worktree, prepares `spec.md` and task packets, and reports two absolute paths: `repo_dir` for the project worktree and `task_dir` for its `docs/my-feature` task files. A project can contain several task directories; its root alone does not identify a Flywheel task.
89
-
90
- DSH uses `/flywheel-new`. Kimi uses `/skill:flywheel-new`; the prefixes are host-specific. See the pinned [DSH skill entry contract](https://github.com/deepseek-ai/deepseek-harness/blob/b830ec950faba0a46dda564be3e2d854afed94f1/packages/client/ui-skill/README.md) and [Kimi slash-command reference](https://moonshotai.github.io/kimi-code/en/reference/slash-commands.html).
91
-
92
- A runnable task needs a reviewed `spec.md` and at least one legal `task-packet-*.md`, using the bundled schemas. The preparation should establish:
156
+ No initial console form is required. Preparation should report the actual task
157
+ execution root and task files path, while retaining the original project identity.
158
+ A repository can contain several tasks; a repository path alone does not select one.
93
159
 
94
- - Requirement IDs, expected behavior, and scope exclusions.
95
- - Packet dependencies, execution routes, editable paths, and forbidden paths.
96
- - Real L1 commands and milestone L2/L3 commands with expected exit codes.
97
- - Frozen acceptance tests or other oracles, separately protected from implementation tests.
98
- - Actual dry-run results, with failure output and exit codes where applicable.
160
+ A runnable task needs a reviewed `spec.md` and at least one legal
161
+ `task-packet-*.md`. Establish requirement IDs, exclusions, routes, editable and
162
+ protected paths, L1 commands, milestone L2/L3 commands, and actual baseline results.
163
+ Keep frozen acceptance separate from implementation tests. Executors may add normal
164
+ unit/regression tests; they may not weaken protected acceptance to obtain a pass.
99
165
 
100
- The unified entry also records `workflow` in the Spec: version, requested mode, qualification facts, code evidence, risks, and reasons for inapplicable checks. See [Workflow policy and recovery](configuration.md#workflow-policy-and-recovery). A model's low-risk label alone is insufficient. Old contracts without this field remain Full.
166
+ The Spec's `workflow` records qualification facts, risks, and reasons for inapplicable
167
+ checks. Parallel packets also need explicit `schedule.after` and `schedule.writes`.
168
+ See [Workflow policy](configuration.md#workflow-policy-and-recovery) and
169
+ [Scheduling and worktrees](configuration.md#scheduling-and-worktrees) for field
170
+ examples. Contracts without workflow remain Full; packets without scheduling
171
+ independence remain serial.
101
172
 
102
- 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.
103
-
104
- 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:
173
+ Commit the reviewed contracts so packet worktrees can obtain them from Git. Inspect
174
+ the index for unrelated changes first:
105
175
 
106
176
  ```sh
107
177
  git diff -- docs/my-feature
@@ -111,77 +181,122 @@ git diff --cached
111
181
  git commit -m "docs: prepare my-feature contracts"
112
182
  ```
113
183
 
114
- 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.
184
+ Stage any additional acceptance fixtures separately after review. The engine creates
185
+ and maintains `state.json`; neither preparation skills nor models write it.
115
186
 
116
- ## 4. Open a task-level Draft PR
187
+ ## 4. Use a task-level Draft PR when useful
117
188
 
118
- 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:
189
+ A Draft PR can provide a review location once the initial contracts are committed.
190
+ The authorized host or user can open it before execution:
119
191
 
120
192
  ```sh
121
193
  git push -u origin task/my-feature
122
194
  gh pr create --draft --base main --head task/my-feature
123
195
  ```
124
196
 
125
- 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.
126
-
127
- Keep the PR in draft while implementation and acceptance are still changing. Opening it early does not imply that it should be merged early.
197
+ Describe the problem, expected outcome, acceptance, and remaining work. Usually one
198
+ independently deliverable requirement or milestone belongs in one PR. Packets are
199
+ internal execution units, not automatically separate PRs. An early Draft PR does not
200
+ authorize merge. The console's later PR operation re-queries an existing PR after
201
+ push, avoiding duplicate creation.
128
202
 
129
- ## 5. Run from the same task worktree
203
+ ## 5. Run from the same task execution directory
130
204
 
131
- After reviewing and saving the contracts, send these skill invocations separately in DSH Chat, substituting the actual `task_dir` returned during preparation. Query after starting; use the last entry when stopping is needed:
132
-
133
- ```text
134
- /flywheel-run /absolute/path/to/repo-my-feature/docs/my-feature
135
- /flywheel-status /absolute/path/to/repo-my-feature/docs/my-feature
136
- /flywheel-stop /absolute/path/to/repo-my-feature/docs/my-feature
137
- ```
138
-
139
- The skills resolve the project root from that existing task directory and invoke the CLI. They do not require opening or filling in the view. For direct terminal use, keep the current directory at the same task worktree root:
205
+ For an existing prepared task, run these commands from its integration checkout:
140
206
 
141
207
  ```sh
142
208
  flywheel config inspect --cwd "$PWD" --task-dir "$PWD/docs/my-feature" --json
143
209
  flywheel doctor --cwd "$PWD" --task-dir "$PWD/docs/my-feature" --probe --json
144
- flywheel control start --cwd "$PWD" --task-dir "$PWD/docs/my-feature"
210
+ flywheel control launch --cwd "$PWD" --task-dir "$PWD/docs/my-feature" --mode auto
145
211
  flywheel control status --cwd "$PWD" --task-dir "$PWD/docs/my-feature"
146
212
  ```
147
213
 
148
- 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`.
214
+ Preflight sends no inference prompt and runs no acceptance command. Starting the
215
+ real task invokes the configured models. A control response's `ok` describes that
216
+ operation; overall completion is reported by `state.status`.
149
217
 
150
- For the new unified entry, use `control launch ... --mode auto` in place of `start`. It consumes prepared contracts and defaults to Auto. `start` and foreground `run` accept optional `--mode auto|quick|full`; omission retains the contract or persisted choice. Existing legacy state remains Full. Restarting or requesting Auto does not reclassify or downgrade an established Full task.
218
+ `launch` defaults to Auto. `start` and foreground `run` accept
219
+ `--mode auto|quick|full`; omission preserves the contract or persisted selection.
220
+ Status/stop never switch modes. Restarting or selecting Auto cannot downgrade an
221
+ established Full task.
151
222
 
152
- DSH's `flywheel_launch` and `flywheel_control` start explicitly associate the supplied `taskDir` and `cwd` with the initiating session. CLI registrations can retain DSH's host session ID; independent terminal runs without that identity can be selected from Recent tasks and freshly queried. The UI has no editable task/project path fields: known locations appear read-only. The host directory comes from public `workingDirectory.get(session)`; a shell `cd` alone does not change it. The plugin does not scan or guess tasks.
223
+ DSH equivalents are `/flywheel-run <absolute-task-directory>` and
224
+ `/flywheel-status <same-path>`. Starts and read-only status association make the task
225
+ available in the console. The console selects registered tasks and has no editable
226
+ task/project path fields. CLI runs with a DSH host ID can be matched to that session;
227
+ other runs remain selectable in Recent tasks. Discovery does not scan directories.
153
228
 
154
229
  ### Working directory by stage
155
230
 
156
- | Stage or entry | Working directory | Responsibility |
157
- |---|---|---|
158
- | `flywheel-task` / `flywheel-new` preparation | Task integration worktree | Host creates or reuses it according to the skill |
159
- | Full Plan / revision after upgrade | Task integration worktree | Engine uses the startup root to revise the task contracts |
160
- | Execute, L1, Review | Current packet candidate workspace, normally its packet worktree | Engine creates, records, and reuses that workspace |
161
- | Quick's applicable L2/L3 | The same packet candidate, before final Review | The engine must not validate a stale integration checkout |
162
- | Full L2/L3, Judge | Task integration worktree | Engine checks the integrated milestone |
163
- | Intake, Garden | Selected task's worktree | Host selects the root; Go writes proposals |
164
- | Status, Stop | Original task directory and execution root | Query or stop the existing task without requiring a new worktree, branch switch, or commit |
165
-
166
- Model-call permissions follow `permissions.mode`. Under `role-based`, the default for existing files that omit this setting, Plan/Execute request `workspace-write`; Review/Judge and DSH/Codex (including Codex Pro) Intake/Garden request `read-only`. Under `full-access`, every stage requests full access through the selected backend's public interface. Kimi print retains native auto behavior and provides no claimed OS-level read-only or workspace confinement. Stage duties remain unchanged: reviewers evaluate candidates, auxiliary modules produce advice, and candidate identity checks still run before and after review. See [Configuration](configuration.md) for configuration and migration details.
167
-
168
- 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.
169
-
170
- Go schedules packets serially and does not need a persistent parent model session to supervise them. `sessions.mode=scoped` permits ordinary repairs to continue the packet's Executor history, and a Reviewer may continue its own independent history for the same review scope. Every re-review still checks the complete current candidate, contract, and applicable requirements; closing old findings is insufficient. Plan history is task/milestone scoped, primary Judge and second opinion are separate, and an explicit Plan `resident-session:false` remains effective. Parallel DAG scheduling and team communication remain outside this implementation.
171
-
172
- New configuration templates explicitly select scoped mode; old files without the setting retain fresh mode. Fresh disables general role history reuse while preserving the legacy Kimi Plan resident option. Both modes journal supported main-task Codex Pro, DSH, and Kimi calls. Other adapters, mock, and Intake/Garden retain their existing paths. History reuse does not remove verification requirements or add stages to Quick's two-call first-success path. See [Session policy](configuration.md#session-policy-history-reuse-and-invocation-safety).
173
-
174
- Saved receipt recovery retains the original candidate, contract, and role guard evidence. Re-running sampling or verification cannot replace evidence bound to a pending receipt. Consuming an already completed result makes no new model request and does not bill twice; budgets constrain new dispatches. P3 uses public Codex/Claude lifecycle events, durable Go ACKs, and read-only invocation journals; recovered success still requires the original post-call candidate and role proof. P4 adds role overrides, bounded quality rebuilds, and paired evaluation, with thresholds disabled by default and live effects separately measured. See [recovery and quality](session-recovery.md) and [paired evaluation](session-evaluation.md).
175
-
176
- `flywheel-verify` runs deterministic acceptance only. Full retains the existing packet L1 / milestone L2/L3 behavior; Quick also collects applicable L2/L3 in the actual candidate workspace. It does **not** call Review or Judge, create worktrees, or perform local delivery. `--only execute` remains a partial Execute/L1 loop. A Quick task's `--only review` performs final Review without delivery; a verification gap, upgrade verdict, or lost Quick eligibility immediately saves the one-way Full checkpoint. The next complete run enters Full. `--only plan` requires Full, so explicitly request `--mode full` when a Quick task needs planning. Resume the complete run to let Go handle the remaining stages and delivery.
177
-
178
- 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.
231
+ | Stage | Execution directory |
232
+ |---|---|
233
+ | Preparation; Full Plan and permitted contract revision | Task integration checkout |
234
+ | Execute, L1, independent Review | Current packet candidate directory |
235
+ | Quick's applicable L2/L3 | The same packet candidate, before final Review |
236
+ | Full L2/L3 and Judge | Task integration checkout after packet delivery |
237
+ | Intake and Garden | Selected task execution root |
238
+ | Status and Stop | Original task files and execution root; no new branch or worktree required |
239
+
240
+ These are execution locations. Provider sessions retain the separately recorded
241
+ project workspace. The task checkout spans the deliverable; each packet directory
242
+ spans implementation, checks, review, and delivery. A new loop does not imply a new
243
+ worktree or a permanently running parent model.
244
+
245
+ ### Scheduling and role history
246
+
247
+ The embedded installation default selects `scheduler.mode=parallel` with a maximum of two.
248
+ Existing complete configuration files that omit `scheduler` remain serial, as do
249
+ explicit serial settings. Only ready packets with explicit dependencies and
250
+ nonoverlapping declared write scopes qualify. Independent worktrees permit
251
+ concurrent Execute/L1. Shared-checkout batches run Execute concurrently, then
252
+ validate and review the combined candidate. Review, integration, and final gates
253
+ remain serial. Hard budgets allow one model call in flight until its accounting is
254
+ durable. See the [console guide](flow-console.md#parallel-execution).
255
+
256
+ The optional `scheduler.dispatch="ready-queue"` fills free Execute/L1 slots among
257
+ already independent Full packets with automatic Worktrees. Review, Plan revisions
258
+ and integration still wait for started workers to settle. `scheduler.prewarm=true`
259
+ can prepare one DSH Review runtime alongside a serial packet's deterministic
260
+ checks, without sending a model prompt early. Parallel execution lanes and shared
261
+ candidates do not prewarm; after an independent cohort settles, its serial Review
262
+ path may start preparation. The useful overlap is mainly serial post-Execute L1
263
+ and applicable Quick checks. Defaults remain batch dispatch and no prewarming;
264
+ these settings do not change Task/New/Run or Auto/Quick/Full. Details and limits are
265
+ in [Configuration](configuration.md#ready-queues-and-runtime-preparation).
266
+
267
+ `scoped` history can reuse an eligible packet Executor session for repairs. Review
268
+ uses its own independent history and always evaluates the complete current candidate.
269
+ Plan is task/milestone scoped; Judge and second opinions remain separate. Old
270
+ configuration without `sessions` retains fresh behavior. Both modes preserve
271
+ invocation-safety records and block on unknown dispatch, outcome, or cleanup.
272
+ [Recovery](session-recovery.md) explains trusted receipts, durable checkpoints, and
273
+ bounded context rebuilding.
274
+
275
+ ### Partial stages and permissions
276
+
277
+ `flywheel-verify` runs deterministic acceptance without Review/Judge or Git delivery.
278
+ `--only execute` is a bounded Execute/L1 loop. Quick's `--only review` performs final
279
+ Review without delivery and saves a required Full upgrade without starting Plan.
280
+ `--only plan` requires Full. Resume the complete run for remaining stages and delivery.
281
+ The console offers the same managed stage operations with revision checks.
282
+
283
+ Model permissions follow the effective global policy and per-binding overrides.
284
+ Full access does not remove frozen boundaries or reviewer candidate checks. Kimi
285
+ print does not provide an OS sandbox guarantee. Skills also check the chosen task
286
+ location before development; direct CLI/GUI calls do not execute `SKILL.md` or create
287
+ the outer task branch. Read-only status and stopping remain available independently.
179
288
 
180
289
  ## 6. Understand local completion before merging the PR
181
290
 
182
- A packet is delivered only after required checks 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. Full additionally runs integrated L2/L3 and Judge. Quick runs applicable L2/L3 before a final Review that covers every requirement, acceptance sufficiency, and continued eligibility; it then persists that same candidate.
291
+ Local delivery requires current checks, independent Review, and verified Git
292
+ persistence of the same candidate. Packet worktrees are integrated into the task
293
+ checkout; failed delivery preserves work. Shared-checkout batches complete only
294
+ after every member passes on the combined candidate and the batch is durably saved.
295
+ Full also requires integrated L2/L3 and Judge. Quick requires a final Review covering
296
+ all requirements, acceptance sufficiency, and continued eligibility.
183
297
 
184
- After the complete task passes, inspect the integrated changes and push them:
298
+ Remote delivery is a separate operation. You can inspect and push the task branch
299
+ manually:
185
300
 
186
301
  ```sh
187
302
  git status --short
@@ -191,9 +306,17 @@ gh pr ready
191
306
  gh pr checks
192
307
  ```
193
308
 
194
- 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.
309
+ Or use the console's PR/Merge nodes after explicitly authorizing the repository,
310
+ source HEAD, task branch, and target branch. These operations require normal GitHub
311
+ CLI authentication and current local acceptance. Merge rechecks PR/head/base/checks
312
+ and binds the request to the approved head; it does not use admin bypass or enable
313
+ auto-merge implicitly. An accepted merge-queue request is not a confirmed merge.
314
+ See [PR and Merge](flow-console.md#pr-and-merge).
195
315
 
196
- 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.
316
+ Review the current diff, required CI, and current base branch before merging. Changes
317
+ after a green run may require renewed evidence. An unavailable check must be recorded
318
+ as unavailable and handled through the repository's authorized process. Publication
319
+ or deployment has its own validation and is not triggered merely by clicking Merge.
197
320
 
198
321
  ## 7. Stop and recover without losing evidence
199
322
 
@@ -201,20 +324,24 @@ Manual merge after those gates is the recommended default. Auto-merge can be app
201
324
  flywheel control stop --cwd "$PWD" --task-dir "$PWD/docs/my-feature"
202
325
  ```
203
326
 
204
- 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.
205
-
206
- Supported main-task adapters retain invocation facts and terminal receipts. Unknown dispatch, outcome, or cleanup blocks further execution in both session modes, including after a backend change. Confirm the task-owned plugin/app-server/guardian processes have ended when cleanup is uncertain; a fixed delay is not evidence, and process exit alone does not establish a known model outcome. Go must reconcile a trusted receipt against the original identity and evidence. Changing to fresh, switching task directories, resetting state, or retrying through another channel cannot bypass an unresolved invocation. Avoid broad process killing that could terminate unrelated sessions.
207
-
208
- 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.
209
-
210
- ## Reference boundaries
211
-
212
- 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.
327
+ Check the stop receipt and actual failure before resuming from the same paths with
328
+ `control start` or `/flywheel-run`. A readiness timeout or disconnected request calls
329
+ for reconciliation, not a duplicate launch. Closing a view does not stop the engine.
213
330
 
214
- 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).
331
+ Unknown dispatch, model outcome, or cleanup blocks further execution in both session
332
+ modes. Process exit alone does not prove a known model result. Go must reconcile a
333
+ trusted receipt against its original identity and evidence; switching to fresh,
334
+ changing backends, or resetting state cannot bypass an unresolved invocation.
215
335
 
216
- ## Interactive console delivery
336
+ Preserve worktrees and reports when delivery conflicts. Resolve the actual Git
337
+ conflict and let the engine revalidate. Configuration changes require an engine
338
+ restart. Controlled human interaction with an eligible existing session is described
339
+ in [Provider session interaction](flow-console.md#controlled-provider-session-interaction).
217
340
 
218
- The [workflow console](flow-console.md) adds stage controls, handoff, declared parallelism and explicitly authorized PR/Merge operations. Local completion does not authorize remote writes. An earlier Draft PR is reconciled after push; publication validates the actual merge commit separately.
341
+ ## Related guides
219
342
 
220
- Default-off [JEV shadow evaluation](jev-shadow.md) can independently observe new tasks without blocking execution on failure. Advice does not participate in Quick/Full selection or downgrade existing Full tasks. This feature requires the 0.30.1 CLI/plugin.
343
+ - [Configuration](configuration.md): model bindings, permissions, budgets, and policies.
344
+ - [Workflow console](flow-console.md): tasks, stages, sessions, run comparison, and remote delivery.
345
+ - [Recovery and context quality](session-recovery.md): interrupted calls and safe continuation.
346
+ - [JEV decisions](jev.md): one default-off switch for investigation and bounded failure decisions; Go retains workflow eligibility and acceptance.
347
+ - [System design](../design.md): authoritative implementation contracts, in Chinese.
@@ -0,0 +1,12 @@
1
+ # Evaluation data
2
+
3
+ [Documentation](../README.md) · [中文文档](../README.zh-CN.md)
4
+
5
+ These files are fixed experiment inputs and recorded outputs, not live
6
+ benchmarks. Read the [session evaluation guide](../en/session-evaluation.md)
7
+ or [JEV shadow guide](../en/jev-shadow.md) before interpreting them.
8
+
9
+ | File | Purpose |
10
+ | --- | --- |
11
+ | [jev-historical-provisional.json](jev-historical-provisional.json) | Provisional historical inputs; not a production routing policy. |
12
+ | [jev-historical-result-2026-11-10.json](jev-historical-result-2026-11-10.json) | Recorded results for the named experiment. |