@davidahmann/mill 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/README.md +141 -32
  2. package/dist/audit/repository.d.ts.map +1 -1
  3. package/dist/audit/repository.js +2 -0
  4. package/dist/audit/repository.js.map +1 -1
  5. package/dist/cli-program.d.ts.map +1 -1
  6. package/dist/cli-program.js +189 -0
  7. package/dist/cli-program.js.map +1 -1
  8. package/dist/contracts/schemas.d.ts +467 -2
  9. package/dist/contracts/schemas.d.ts.map +1 -1
  10. package/dist/contracts/schemas.js +211 -1
  11. package/dist/contracts/schemas.js.map +1 -1
  12. package/dist/index.d.ts +7 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +7 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/planning/closure.d.ts +24 -0
  17. package/dist/planning/closure.d.ts.map +1 -0
  18. package/dist/planning/closure.js +68 -0
  19. package/dist/planning/closure.js.map +1 -0
  20. package/dist/planning/outcomes.d.ts +6 -0
  21. package/dist/planning/outcomes.d.ts.map +1 -0
  22. package/dist/planning/outcomes.js +36 -0
  23. package/dist/planning/outcomes.js.map +1 -0
  24. package/dist/planning/tasks.d.ts +32 -0
  25. package/dist/planning/tasks.d.ts.map +1 -0
  26. package/dist/planning/tasks.js +305 -0
  27. package/dist/planning/tasks.js.map +1 -0
  28. package/dist/repository/intelligence.d.ts +78 -0
  29. package/dist/repository/intelligence.d.ts.map +1 -0
  30. package/dist/repository/intelligence.js +537 -0
  31. package/dist/repository/intelligence.js.map +1 -0
  32. package/dist/repository/native-adoption.d.ts +36 -0
  33. package/dist/repository/native-adoption.d.ts.map +1 -0
  34. package/dist/repository/native-adoption.js +146 -0
  35. package/dist/repository/native-adoption.js.map +1 -0
  36. package/dist/repository/scan.d.ts.map +1 -1
  37. package/dist/repository/scan.js +4 -0
  38. package/dist/repository/scan.js.map +1 -1
  39. package/dist/runtime/authority-plans.d.ts +43 -0
  40. package/dist/runtime/authority-plans.d.ts.map +1 -0
  41. package/dist/runtime/authority-plans.js +173 -0
  42. package/dist/runtime/authority-plans.js.map +1 -0
  43. package/dist/runtime/codex.d.ts.map +1 -1
  44. package/dist/runtime/codex.js +24 -5
  45. package/dist/runtime/codex.js.map +1 -1
  46. package/dist/runtime/context.d.ts.map +1 -1
  47. package/dist/runtime/context.js +36 -0
  48. package/dist/runtime/context.js.map +1 -1
  49. package/dist/runtime/delivery.d.ts +8 -1
  50. package/dist/runtime/delivery.d.ts.map +1 -1
  51. package/dist/runtime/delivery.js +187 -74
  52. package/dist/runtime/delivery.js.map +1 -1
  53. package/dist/runtime/effect-boundary.d.ts +38 -0
  54. package/dist/runtime/effect-boundary.d.ts.map +1 -0
  55. package/dist/runtime/effect-boundary.js +59 -0
  56. package/dist/runtime/effect-boundary.js.map +1 -0
  57. package/dist/runtime/github.d.ts +24 -0
  58. package/dist/runtime/github.d.ts.map +1 -1
  59. package/dist/runtime/github.js +117 -2
  60. package/dist/runtime/github.js.map +1 -1
  61. package/dist/runtime/inputs.js.map +1 -1
  62. package/dist/runtime/lifecycle.d.ts +5 -0
  63. package/dist/runtime/lifecycle.d.ts.map +1 -1
  64. package/dist/runtime/lifecycle.js +60 -16
  65. package/dist/runtime/lifecycle.js.map +1 -1
  66. package/dist/runtime/merge.d.ts +73 -0
  67. package/dist/runtime/merge.d.ts.map +1 -0
  68. package/dist/runtime/merge.js +299 -0
  69. package/dist/runtime/merge.js.map +1 -0
  70. package/dist/runtime/public-metadata.d.ts +3 -0
  71. package/dist/runtime/public-metadata.d.ts.map +1 -0
  72. package/dist/runtime/public-metadata.js +15 -0
  73. package/dist/runtime/public-metadata.js.map +1 -0
  74. package/dist/runtime/repair.d.ts +12 -0
  75. package/dist/runtime/repair.d.ts.map +1 -0
  76. package/dist/runtime/repair.js +34 -0
  77. package/dist/runtime/repair.js.map +1 -0
  78. package/dist/runtime/repository.d.ts +18 -0
  79. package/dist/runtime/repository.d.ts.map +1 -1
  80. package/dist/runtime/repository.js +114 -2
  81. package/dist/runtime/repository.js.map +1 -1
  82. package/dist/runtime/state.d.ts +42 -1
  83. package/dist/runtime/state.d.ts.map +1 -1
  84. package/dist/runtime/state.js +324 -11
  85. package/dist/runtime/state.js.map +1 -1
  86. package/dist/runtime/usage.d.ts +12 -0
  87. package/dist/runtime/usage.d.ts.map +1 -0
  88. package/dist/runtime/usage.js +45 -0
  89. package/dist/runtime/usage.js.map +1 -0
  90. package/dist/runtime/verifier.d.ts.map +1 -1
  91. package/dist/runtime/verifier.js +12 -0
  92. package/dist/runtime/verifier.js.map +1 -1
  93. package/dist/runtime/worker.d.ts +1 -0
  94. package/dist/runtime/worker.d.ts.map +1 -1
  95. package/dist/runtime/worker.js.map +1 -1
  96. package/dist/version.d.ts +1 -1
  97. package/dist/version.js +1 -1
  98. package/dist/workflows/founder.d.ts.map +1 -1
  99. package/dist/workflows/founder.js +5 -0
  100. package/dist/workflows/founder.js.map +1 -1
  101. package/node_modules/typescript/LICENSE.txt +55 -0
  102. package/node_modules/typescript/README.md +50 -0
  103. package/node_modules/typescript/SECURITY.md +39 -0
  104. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  105. package/node_modules/typescript/bin/tsc +2 -0
  106. package/node_modules/typescript/bin/tsserver +2 -0
  107. package/node_modules/typescript/lib/_tsc.js +134465 -0
  108. package/node_modules/typescript/lib/_tsserver.js +659 -0
  109. package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  110. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2129 -0
  111. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2125 -0
  112. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2129 -0
  113. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2129 -0
  114. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2125 -0
  115. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2129 -0
  116. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2129 -0
  117. package/node_modules/typescript/lib/lib.d.ts +20 -0
  118. package/node_modules/typescript/lib/lib.decorators.d.ts +382 -0
  119. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +20 -0
  120. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +18 -0
  121. package/node_modules/typescript/lib/lib.dom.d.ts +45125 -0
  122. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +18 -0
  123. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +150 -0
  124. package/node_modules/typescript/lib/lib.es2015.core.d.ts +595 -0
  125. package/node_modules/typescript/lib/lib.es2015.d.ts +26 -0
  126. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +75 -0
  127. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +603 -0
  128. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +79 -0
  129. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +126 -0
  130. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +142 -0
  131. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +44 -0
  132. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
  133. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +114 -0
  134. package/node_modules/typescript/lib/lib.es2016.d.ts +19 -0
  135. package/node_modules/typescript/lib/lib.es2016.full.d.ts +21 -0
  136. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +29 -0
  137. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +19 -0
  138. package/node_modules/typescript/lib/lib.es2017.d.ts +24 -0
  139. package/node_modules/typescript/lib/lib.es2017.date.d.ts +29 -0
  140. package/node_modules/typescript/lib/lib.es2017.full.d.ts +21 -0
  141. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +42 -0
  142. package/node_modules/typescript/lib/lib.es2017.object.d.ts +47 -0
  143. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +133 -0
  144. package/node_modules/typescript/lib/lib.es2017.string.d.ts +43 -0
  145. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +51 -0
  146. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +75 -0
  147. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +51 -0
  148. package/node_modules/typescript/lib/lib.es2018.d.ts +22 -0
  149. package/node_modules/typescript/lib/lib.es2018.full.d.ts +22 -0
  150. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +81 -0
  151. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +28 -0
  152. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +35 -0
  153. package/node_modules/typescript/lib/lib.es2019.array.d.ts +77 -0
  154. package/node_modules/typescript/lib/lib.es2019.d.ts +22 -0
  155. package/node_modules/typescript/lib/lib.es2019.full.d.ts +22 -0
  156. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +21 -0
  157. package/node_modules/typescript/lib/lib.es2019.object.d.ts +31 -0
  158. package/node_modules/typescript/lib/lib.es2019.string.d.ts +35 -0
  159. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +22 -0
  160. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +763 -0
  161. package/node_modules/typescript/lib/lib.es2020.d.ts +25 -0
  162. package/node_modules/typescript/lib/lib.es2020.date.d.ts +40 -0
  163. package/node_modules/typescript/lib/lib.es2020.full.d.ts +22 -0
  164. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +472 -0
  165. package/node_modules/typescript/lib/lib.es2020.number.d.ts +26 -0
  166. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +45 -0
  167. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +97 -0
  168. package/node_modules/typescript/lib/lib.es2020.string.d.ts +42 -0
  169. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
  170. package/node_modules/typescript/lib/lib.es2021.d.ts +21 -0
  171. package/node_modules/typescript/lib/lib.es2021.full.d.ts +22 -0
  172. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +164 -0
  173. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +46 -0
  174. package/node_modules/typescript/lib/lib.es2021.string.d.ts +31 -0
  175. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +76 -0
  176. package/node_modules/typescript/lib/lib.es2022.array.d.ts +119 -0
  177. package/node_modules/typescript/lib/lib.es2022.d.ts +23 -0
  178. package/node_modules/typescript/lib/lib.es2022.error.d.ts +73 -0
  179. package/node_modules/typescript/lib/lib.es2022.full.d.ts +22 -0
  180. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +143 -0
  181. package/node_modules/typescript/lib/lib.es2022.object.d.ts +24 -0
  182. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +37 -0
  183. package/node_modules/typescript/lib/lib.es2022.string.d.ts +23 -0
  184. package/node_modules/typescript/lib/lib.es2023.array.d.ts +922 -0
  185. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +19 -0
  186. package/node_modules/typescript/lib/lib.es2023.d.ts +20 -0
  187. package/node_modules/typescript/lib/lib.es2023.full.d.ts +22 -0
  188. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +62 -0
  189. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +63 -0
  190. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +27 -0
  191. package/node_modules/typescript/lib/lib.es2024.d.ts +24 -0
  192. package/node_modules/typescript/lib/lib.es2024.full.d.ts +22 -0
  193. package/node_modules/typescript/lib/lib.es2024.object.d.ts +27 -0
  194. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +33 -0
  195. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +23 -0
  196. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +66 -0
  197. package/node_modules/typescript/lib/lib.es2024.string.d.ts +27 -0
  198. package/node_modules/typescript/lib/lib.es2025.collection.d.ts +94 -0
  199. package/node_modules/typescript/lib/lib.es2025.d.ts +23 -0
  200. package/node_modules/typescript/lib/lib.es2025.float16.d.ts +443 -0
  201. package/node_modules/typescript/lib/lib.es2025.full.d.ts +22 -0
  202. package/node_modules/typescript/lib/lib.es2025.intl.d.ts +200 -0
  203. package/node_modules/typescript/lib/lib.es2025.iterator.d.ts +146 -0
  204. package/node_modules/typescript/lib/lib.es2025.promise.d.ts +32 -0
  205. package/node_modules/typescript/lib/lib.es2025.regexp.d.ts +30 -0
  206. package/node_modules/typescript/lib/lib.es5.d.ts +4599 -0
  207. package/node_modules/typescript/lib/lib.es6.d.ts +21 -0
  208. package/node_modules/typescript/lib/lib.esnext.array.d.ts +33 -0
  209. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +47 -0
  210. package/node_modules/typescript/lib/lib.esnext.d.ts +27 -0
  211. package/node_modules/typescript/lib/lib.esnext.date.d.ts +21 -0
  212. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +26 -0
  213. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +191 -0
  214. package/node_modules/typescript/lib/lib.esnext.error.d.ts +22 -0
  215. package/node_modules/typescript/lib/lib.esnext.full.d.ts +22 -0
  216. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +107 -0
  217. package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +23 -0
  218. package/node_modules/typescript/lib/lib.esnext.temporal.d.ts +485 -0
  219. package/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts +90 -0
  220. package/node_modules/typescript/lib/lib.scripthost.d.ts +320 -0
  221. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +18 -0
  222. package/node_modules/typescript/lib/lib.webworker.d.ts +15606 -0
  223. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +21 -0
  224. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +18 -0
  225. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2129 -0
  226. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2129 -0
  227. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2125 -0
  228. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2129 -0
  229. package/node_modules/typescript/lib/tsc.js +8 -0
  230. package/node_modules/typescript/lib/tsserver.js +8 -0
  231. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  232. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  233. package/node_modules/typescript/lib/typesMap.json +497 -0
  234. package/node_modules/typescript/lib/typescript.d.ts +11448 -0
  235. package/node_modules/typescript/lib/typescript.js +201039 -0
  236. package/node_modules/typescript/lib/typingsInstaller.js +8 -0
  237. package/node_modules/typescript/lib/watchGuard.js +53 -0
  238. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2129 -0
  239. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2125 -0
  240. package/node_modules/typescript/package.json +118 -0
  241. package/package.json +7 -4
  242. package/schemas/audit-report.schema.json +1 -0
  243. package/schemas/change-request.schema.json +189 -0
  244. package/schemas/context-manifest.schema.json +50 -0
  245. package/schemas/delivery-record.schema.json +109 -0
  246. package/schemas/mill-config.schema.json +50 -2
  247. package/schemas/repository-intelligence.schema.json +200 -0
  248. package/schemas/review-result.schema.json +21 -0
  249. package/schemas/task-packet.schema.json +12 -0
package/README.md CHANGED
@@ -8,12 +8,16 @@ without handing one agent an open-ended ticket, production credentials, and the
8
8
  power to judge its own work. Product truth stays in the repository. Codex writes
9
9
  inside a disposable worktree. Native tests and scenarios verify the committed
10
10
  candidate. A separate read-only pass reviews that exact commit. Only the
11
- attended shipper can use your GitHub identity, and it stops at a draft PR.
11
+ attended shipper can use your GitHub identity. Draft-only is the default;
12
+ repositories may explicitly enable a separately approved, exact-plan merge.
12
13
 
13
- Mill `0.1.4` is a public-alpha release candidate. The source tree implements the
14
- candidate and genesis release gates, but no npm availability or supported tuple
15
- is claimed until the separately authorized release completes and its registry
16
- and GitHub readback pass.
14
+ Mill `0.1.5` is the first qualified public alpha. It is available from npm and
15
+ as a GitHub prerelease with provenance, an SBOM, exact-artifact qualification,
16
+ and registry and GitHub readback evidence. The source package identity is now
17
+ prepared as `0.2.1`. The `v0.2.0` tag is retained as prepublication evidence:
18
+ publication was held when a missing publish-runner verifier preflight was
19
+ identified. Source changes do not establish release qualification or publication
20
+ for the new version.
17
21
 
18
22
  ## Why Mill
19
23
 
@@ -64,6 +68,8 @@ For its one qualified shape, Mill can:
64
68
  support bundle through explicit commands;
65
69
  9. audit the exact repository candidate and validate a public-alpha
66
70
  qualification record.
71
+ 10. derive bounded, source-revision-bound TypeScript repository evidence from a
72
+ clean Git root without executing its code.
67
73
 
68
74
  Mill does not autonomously research the web or invent a product specification in
69
75
  this alpha. The operator supplies the structured proposal that Mill assesses and
@@ -89,8 +95,15 @@ harnesses are experimental or unsupported until independently qualified.
89
95
 
90
96
  ## Install
91
97
 
92
- Before the first public artifact, develop and evaluate from a clean source
93
- checkout:
98
+ Install the qualified public alpha at its exact version with lifecycle scripts
99
+ disabled:
100
+
101
+ ```sh
102
+ npm install --save-dev --ignore-scripts @davidahmann/mill@0.1.5
103
+ npx --no-install millctl --version
104
+ ```
105
+
106
+ To develop Mill itself from a clean source checkout:
94
107
 
95
108
  ```sh
96
109
  git clone https://github.com/davidahmann/mill.git
@@ -103,16 +116,9 @@ PATH="$node_bin_dir:$PATH" "$node_bin_dir/npm" run build
103
116
  node dist/cli.js --version
104
117
  ```
105
118
 
106
- After the separately verified npm release, downstream repositories will pin the
107
- exact package version rather than `latest`:
108
-
109
- ```sh
110
- npm install --save-dev --ignore-scripts @davidahmann/mill@0.1.4
111
- npx --no-install millctl --version
112
- ```
113
-
114
- Do not treat the npm command as available until the release exists and the
115
- downloaded artifact passes the documented readback canary.
119
+ The `alpha` and `latest` npm tags currently resolve to `0.1.5`. Downstream
120
+ repositories should still pin the exact version so a later release cannot alter
121
+ their delivery machinery implicitly.
116
122
 
117
123
  ## Quick start
118
124
 
@@ -124,6 +130,28 @@ node dist/cli.js inspect --prd product/PRD.md
124
130
  node dist/cli.js adopt --scan-only
125
131
  ```
126
132
 
133
+ ### Discover a TypeScript repository
134
+
135
+ Static discovery is a separate read-only operation. It requires a clean Git
136
+ repository root and rejects sensitive paths, symbolic links, unsafe Git
137
+ configuration, and incomplete source traversal. It parses local TypeScript and
138
+ JavaScript imports only after each regular file's physical bytes match its blob
139
+ in the captured `HEAD` tree. The same check protects parsed package metadata. It
140
+ reports source locations, inventories test files, and gives conservative
141
+ importer leads for named paths. Nonliteral module loads and option-bearing test
142
+ commands remain explicit unknowns. It never installs dependencies, runs the
143
+ target's code, or claims executed coverage or delivery authority.
144
+
145
+ ```sh
146
+ millctl --json discover /absolute/path/to/repository --changed src/service.ts
147
+ ```
148
+
149
+ The first increment is a deterministic TypeScript extractor, not arbitrary-stack
150
+ support, a graph database, a watcher, or an AI-generated knowledge graph. Read
151
+ [`product/brownfield-discovery.md`](product/brownfield-discovery.md) and
152
+ [`docs/canaries/brownfield-discovery.md`](docs/canaries/brownfield-discovery.md)
153
+ for the exact boundary and real-fixture evidence.
154
+
127
155
  For a source-backed specification, supply the PRD, source manifest, and
128
156
  structured proposal:
129
157
 
@@ -210,24 +238,83 @@ millctl --json pr plan --task product/tasks/TASK.yaml --run <run-id>
210
238
  millctl --json pr open --task product/tasks/TASK.yaml --run <run-id> \
211
239
  --approve sha256:<delivery-plan> --attended
212
240
  millctl --json pr observe --task product/tasks/TASK.yaml --run <run-id>
213
- # A human marks ready and merges in GitHub.
241
+ # By default, a human marks ready and merges in GitHub.
214
242
  millctl --json pr finalize --task product/tasks/TASK.yaml --run <run-id>
215
243
  ```
216
244
 
217
245
  Or use `millctl ship --draft` twice: first to return the proposal, then with its
218
- exact digest and `--attended` to perform it. `millctl` never marks ready or
219
- merges.
246
+ exact digest and `--attended` to perform it. Draft delivery never implicitly
247
+ authorizes readiness or merge.
248
+
249
+ ### Approve a merge from your work surface
250
+
251
+ With `propose.attendedMerge: true`, producer-bound required checks, and strict
252
+ up-to-date branch protection, the attending operator can inspect and approve:
253
+
254
+ ```sh
255
+ millctl --json pr merge-plan --task product/tasks/TASK.yaml --run <run-id> --method squash
256
+ millctl --json pr merge --task product/tasks/TASK.yaml --run <run-id> \
257
+ --approve sha256:<merge-plan> --attended
258
+ millctl --json pr finalize --task product/tasks/TASK.yaml --run <run-id>
259
+ ```
260
+
261
+ The plan binds PR/head/base, exact tree, actor, method, policy and expiry. A
262
+ chat host can submit the operator's approval through this CLI; Mill does not
263
+ authenticate arbitrary chat messages or let the builder approve its own work.
264
+ See [attended approvals and recovery](docs/approvals.md).
265
+
266
+ ### Compile follow-up work and adopt native brownfield commands
267
+
268
+ `plan tasks --request product/change.yaml` deterministically compiles an
269
+ operator-supplied PRD/plan/bug/review change request and approved impact
270
+ manifests into version-2 tasks and a dependency-checked outcome plan. Its
271
+ separate `--apply --approve sha256:<plan> --attended` step writes an isolated
272
+ worktree. It does not infer approval or acceptance tests from prose. See
273
+ [planning](docs/planning.md).
274
+
275
+ `adopt-native --config adoption.yaml` offers experimental Node ESM/npm adoption
276
+ that adds only `mill.yaml` and `mill.lock`, preserving existing code and native
277
+ scripts. Apply requires the exact digest and attendance; dependency preparation,
278
+ baseline qualification and task execution remain separate. See
279
+ [brownfield scope and qualification](docs/brownfield.md).
280
+
281
+ ### Pull-request and resulting-main checks
282
+
283
+ The source implementation keeps `propose.requiredChecks` as the complete gate
284
+ for the exact pull-request head. Optional `propose.postMergeRequiredChecks`
285
+ selects a nonempty subset of those names for resulting-main readback only;
286
+ omitting it retains the full `requiredChecks` list for both phases. New delivery
287
+ plans approval-bind and persist both effective lists. Missing or pending
288
+ required checks prevent completion; skipped or failed required checks fail the
289
+ phase that requires them.
290
+
291
+ In this repository, `dependency-review` runs only for pull requests, while
292
+ `validate` and `codeql` also run on pushes to `main`. The maintainer-prepared
293
+ `mill.yaml` requires all three at the exact PR head and explicitly selects
294
+ `[validate, codeql]` for resulting-main readback.
295
+
296
+ New delivery records identify the policy source as `configured` or
297
+ `implicit_default`. A historical record with a full defaulted list and no
298
+ provenance can bind the configured subset once only if its exact reviewed
299
+ candidate proves omission of the optional policy and authoritative merge
300
+ readback establishes every other delivery identity. That compatibility path
301
+ cannot relax a new delivery. See
302
+ [repository settings](docs/repository-settings.md) and the
303
+ [migration record](docs/canaries/post-merge-default-policy-migration.md) for the
304
+ conditions and outstanding live evidence for delivery
305
+ `01801a1b-58f9-480f-8cee-54ea2bbeabb2`. Human readiness, merge authority, and
306
+ exact candidate/tree checks remain required.
220
307
 
221
308
  ## Trust model
222
309
 
223
310
  Mill separates four principals:
224
311
 
225
- | Principal | May do | Cannot do |
226
- | ---------------- | -------------------------------------------------- | -------------------------------------------------- |
227
- | Builder | Edit approved paths in a disposable worktree | Push, merge, deploy, change authority or oracles |
228
- | Verifier | Run declared commands in bounded no-network OCI | Write candidate source or use forge credentials |
229
- | Reviewer | Read the exact committed candidate | Execute or edit code |
230
- | Attended shipper | Push the unchanged candidate and open its draft PR | Change the candidate, mark ready, merge, or deploy |
312
+ | Principal | May do | Cannot do |
313
+ | ---------------- | ------------------------------------------------------------- | ---------------------------------------------------------------- |
314
+ | Builder | Edit approved paths in a disposable worktree | Push, merge, deploy, change authority or oracles |
315
+ | Verifier | Run declared commands in bounded no-network OCI | Write candidate source or use forge credentials |
316
+ | Reviewer | Read the exact committed candidate | Execute or edit code |
317
+ | Attended shipper | Push/open a draft; separately approved opt-in readiness/merge | Change the candidate, self-approve, bypass protection, or deploy |
231
318
 
232
319
  Codex uses your existing Codex CLI session and therefore your own provider
233
320
  billing. GitHub operations use your existing `gh` session. Another maintainer
@@ -248,7 +335,7 @@ interrupted, inspect before acting:
248
335
 
249
336
  ```sh
250
337
  millctl --json status --run <run-id>
251
- millctl --json resume --task product/tasks/TASK.yaml --run <run-id> --attended
338
+ millctl --json resume --task product/tasks/TASK.yaml --run <run-id>
252
339
  millctl --json cancel --run <run-id>
253
340
  millctl --json pr reconcile --task product/tasks/TASK.yaml --run <run-id>
254
341
  ```
@@ -258,13 +345,32 @@ uncertain external effect without authoritative readback. Use explicit local
258
345
  recovery for state and diagnostics:
259
346
 
260
347
  ```sh
261
- millctl --json state backup --output /absolute/path/backup.sqlite
262
- millctl --json state restore --input /absolute/path/backup.sqlite --attended
263
- millctl --json state purge --attended
264
- millctl --json support-bundle --output /absolute/path/support.json
348
+ millctl --json state backup
349
+ millctl --json state restore --from /absolute/path/returned-backup.sqlite3
350
+ millctl --json state purge --confirm <repository-uuid>
351
+ millctl --json support-bundle --run <run-id>
265
352
  millctl --json detach plan
266
353
  ```
267
354
 
355
+ An unresolved push, PR, readiness or merge blocks repair, new delivery and state
356
+ purge/restore even if the enclosing run says `blocked` or `cancelled`.
357
+ Cancellation records intent without discarding the receipt. Use
358
+ `pr merge-reconcile` for readiness/merge; a confirmed merge then requires
359
+ `pr finalize` and green main checks before cleanup. See
360
+ [approval recovery](docs/approvals.md#interruptions).
361
+
362
+ Before any remote attempt, stale review scope can use attended
363
+ `review --refresh --base <exact-provider-commit>`. This preserves the candidate
364
+ and remaining review budget, invalidates the unexecuted delivery plan and does
365
+ not move frozen Git refs. Plan delivery again after the fresh review passes.
366
+
367
+ For generated authority, `state reconcile-plans` verifies the exact committed
368
+ files. A failed plan can instead be explicitly discontinued with
369
+ `state abandon-plan --approve <original-plan-digest> --attended`, after
370
+ preserving partial output in a clean commit on its recorded branch. Abandonment
371
+ retains evidence and does not certify successful apply. See
372
+ [plan recovery](docs/planning.md#recovery).
373
+
268
374
  Restore validates the database before atomic replacement and quarantines newer
269
375
  unreferenced worktrees. Detach is plan-only; the operator performs the reviewed
270
376
  removal. A generated/adopted repo must continue to build and test natively after
@@ -275,7 +381,10 @@ Mill is removed.
275
381
  `millctl audit` is a bounded, read-only milestone check for Mill's selected
276
382
  recipe and release path. It requires a clean exact Git candidate and reports
277
383
  product, code, UX, accessibility, security, dependency, architecture,
278
- operations, and release checks in a schema-valid JSON envelope.
384
+ operations, and release checks in a schema-valid JSON envelope. These checks are
385
+ labelled `assurance: structural`: they inspect contracts and hooks, not executed
386
+ security, accessibility or business behavior. Native command results, realistic
387
+ scenarios and release canaries are separate evidence.
279
388
 
280
389
  ```sh
281
390
  millctl --json --cwd . audit
@@ -1 +1 @@
1
- {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/audit/repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,EACL,iBAAiB,EAIlB,MAAM,yBAAyB,CAAC;AASjC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAkD5D,wBAAsB,eAAe,CAAC,KAAK,EAAE;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,OAAO,CAAC,WAAW,CAAC,CAoOvB"}
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/audit/repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,EACL,iBAAiB,EAIlB,MAAM,yBAAyB,CAAC;AASjC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAoD5D,wBAAsB,eAAe,CAAC,KAAK,EAAE;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,OAAO,CAAC,WAAW,CAAC,CAoOvB"}
@@ -20,6 +20,7 @@ async function runCheck(input) {
20
20
  return {
21
21
  id: input.id,
22
22
  category: input.category,
23
+ assurance: "structural",
23
24
  status: "passed",
24
25
  summary: input.summary,
25
26
  evidence: input.evidence,
@@ -29,6 +30,7 @@ async function runCheck(input) {
29
30
  return {
30
31
  id: input.id,
31
32
  category: input.category,
33
+ assurance: "structural",
32
34
  status: "blocked",
33
35
  summary: `${input.summary}: ${error instanceof Error ? error.message : String(error)}`,
34
36
  evidence: input.evidence,
@@ -1 +1 @@
1
- {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/audit/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAkB,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAaxD,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,IAAY,EAAE,IAAY;IACtD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IAC/D,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACzE,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,KAAsB;IAC5C,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;QACvB,OAAO;YACL,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,QAAQ,EAAE,KAAK,C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CAuFjB"}
1
+ {"version":3,"file":"cli-program.d.ts","sourceRoot":"","sources":["../src/cli-program.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAwC,MAAM,WAAW,CAAC;AAuE1E,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1C,MAAM,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAC3C;AA+ED,wBAAgB,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,UAAQ,GAAG,OAAO,CAuiDpE;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,KAAK,GACR,OAAO,CAAC,MAAM,CAAC,CAuFjB"}
@@ -8,6 +8,7 @@ import { doctor, doctorReady } from "./doctor.js";
8
8
  import { asMillError, ExitCode, MillError } from "./errors.js";
9
9
  import { inspectPrd } from "./intake/prd.js";
10
10
  import { scanRepository } from "./repository/scan.js";
11
+ import { discoverRepository } from "./repository/intelligence.js";
11
12
  import { applyAdoptionIntegration, applyGreenfieldIntegration, planAdoptionIntegration, planDetach, planGreenfieldIntegration, } from "./repository/integration.js";
12
13
  import { assessSpecificationProposal, loadPlanningSources, loadSpecificationProposal, promoteSpecificationProposal, semanticProposalDiff, } from "./planning/specification.js";
13
14
  import { assessImpactManifest, loadImpactPlanningInputs, } from "./planning/impact.js";
@@ -17,6 +18,11 @@ import { cancelRun, codexAuthStatus, qualifyBaseline, resumeRun, reviewRun, runS
17
18
  import { commandResult, formatHuman } from "./result.js";
18
19
  import { safeReadText } from "./security/safe-path.js";
19
20
  import { MILL_VERSION } from "./version.js";
21
+ import { applyMerge, planMerge, reconcileMerge } from "./runtime/merge.js";
22
+ import { abandonAuthorityPlan, reconcileAuthorityPlans, } from "./runtime/authority-plans.js";
23
+ import { planOutcomeClosure } from "./planning/closure.js";
24
+ import { compileChangeTasks, applyChangeTasks } from "./planning/tasks.js";
25
+ import { planNativeAdoption, applyNativeAdoption, } from "./repository/native-adoption.js";
20
26
  import { prepareRepositoryDependencies, startNextReadyOutcome, startFounderDelivery, } from "./workflows/founder.js";
21
27
  function parseMode(value) {
22
28
  if (value === "inspect" || value === "build" || value === "propose") {
@@ -107,6 +113,20 @@ export function createProgram(io, jsonErrors = false) {
107
113
  const inspection = await inspectPrd(root, options.prd);
108
114
  emit(io, global.json === true, commandResult({ command: "inspect", ok: true, data: inspection }));
109
115
  });
116
+ program
117
+ .command("discover <repository>")
118
+ .description("derive bounded, read-only TypeScript repository evidence without executing repository code")
119
+ .option("--changed <path...>", "relative source paths whose importer leads should be reported")
120
+ .action(async (repository, options) => {
121
+ const global = globals(program);
122
+ const report = await discoverRepository({
123
+ root: path.resolve(global.cwd, repository),
124
+ ...(options.changed === undefined
125
+ ? {}
126
+ : { changedPaths: options.changed }),
127
+ });
128
+ emit(io, global.json === true, commandResult({ command: "discover", ok: true, data: report }));
129
+ });
110
130
  program
111
131
  .command("new <directory>")
112
132
  .description("preview or transactionally create the supported web recipe")
@@ -262,6 +282,32 @@ export function createProgram(io, jsonErrors = false) {
262
282
  const dependencies = program
263
283
  .command("dependencies")
264
284
  .description("manage exact local verifier dependency snapshots");
285
+ program
286
+ .command("adopt-native")
287
+ .description("experimentally adopt existing Node ESM/npm native tests without replacing source or oracles")
288
+ .requiredOption("--config <path>", "proposed build-only OCI configuration in the repository")
289
+ .option("--apply", "create new Mill controls in an isolated worktree")
290
+ .option("--approve <digest>", "exact native adoption plan digest")
291
+ .option("--attended", "the operator approves this exact adoption")
292
+ .action(async (options) => {
293
+ const global = globals(program);
294
+ const root = await findRepositoryRoot(global.cwd);
295
+ const data = options.apply === true
296
+ ? await applyNativeAdoption({
297
+ root,
298
+ configPath: options.config,
299
+ approvalDigest: requiredValue(options.approve, "--approve"),
300
+ attended: options.attended === true,
301
+ })
302
+ : await planNativeAdoption({ root, configPath: options.config });
303
+ emit(io, global.json === true, commandResult({
304
+ command: options.apply === true
305
+ ? "adopt-native.apply"
306
+ : "adopt-native.plan",
307
+ ok: true,
308
+ data,
309
+ }));
310
+ });
265
311
  dependencies
266
312
  .command("prepare")
267
313
  .description("prepare one lock-bound snapshot through the exact OCI image")
@@ -327,6 +373,49 @@ export function createProgram(io, jsonErrors = false) {
327
373
  const plan = program
328
374
  .command("plan")
329
375
  .description("compile and assess product-continuity authority without writes");
376
+ plan
377
+ .command("close-outcome")
378
+ .description("propose plan closure from an exact provider-finalized run")
379
+ .requiredOption("--task <path>", "task packet path")
380
+ .requiredOption("--run <id>", "finalized run identity")
381
+ .option("--next <outcome-id>", "one already approved successor")
382
+ .action(async (options) => {
383
+ const global = globals(program);
384
+ const root = await findRepositoryRoot(global.cwd);
385
+ await enforceExactVersion(root);
386
+ const data = await planOutcomeClosure({
387
+ root,
388
+ taskPath: options.task,
389
+ runId: options.run,
390
+ ...(options.next === undefined ? {} : { nextOutcomeId: options.next }),
391
+ });
392
+ emit(io, global.json === true, commandResult({ command: "plan.close-outcome", ok: true, data }));
393
+ });
394
+ plan
395
+ .command("tasks")
396
+ .description("compile a source-backed PRD, follow-up plan, bug or review into version-2 tasks")
397
+ .requiredOption("--request <path>", "change request with approved outcome and impact references")
398
+ .option("--apply", "write the approved files in a new disposable worktree")
399
+ .option("--approve <digest>", "exact compilation approval digest")
400
+ .option("--attended", "the operator approves the compiled authority files")
401
+ .action(async (options) => {
402
+ const global = globals(program);
403
+ const root = await findRepositoryRoot(global.cwd);
404
+ await enforceExactVersion(root);
405
+ const data = options.apply === true
406
+ ? await applyChangeTasks({
407
+ root,
408
+ requestPath: options.request,
409
+ approvalDigest: requiredValue(options.approve, "--approve"),
410
+ attended: options.attended === true,
411
+ })
412
+ : await compileChangeTasks({ root, requestPath: options.request });
413
+ emit(io, global.json === true, commandResult({
414
+ command: options.apply === true ? "plan.tasks.apply" : "plan.tasks",
415
+ ok: true,
416
+ data,
417
+ }));
418
+ });
330
419
  plan
331
420
  .command("specification")
332
421
  .description("assess one source-backed product proposal and approval digest")
@@ -674,6 +763,9 @@ export function createProgram(io, jsonErrors = false) {
674
763
  .description("obtain a fresh read-only review of the exact verified candidate")
675
764
  .requiredOption("--task <path>", "approved task packet path")
676
765
  .requiredOption("--run <id>", "run identifier")
766
+ .option("--refresh", "refresh stale scope before any remote attempt")
767
+ .option("--base <commit>", "exact locally available provider-base commit for refresh")
768
+ .option("--attended", "confirm attended review-scope selection")
677
769
  .action(async (options) => {
678
770
  const global = globals(program);
679
771
  const root = await findRepositoryRoot(global.cwd);
@@ -682,6 +774,13 @@ export function createProgram(io, jsonErrors = false) {
682
774
  root,
683
775
  taskPath: options.task,
684
776
  runId: options.run,
777
+ ...(options.refresh === undefined
778
+ ? {}
779
+ : { refresh: options.refresh }),
780
+ ...(options.base === undefined ? {} : { baseCommit: options.base }),
781
+ ...(options.attended === undefined
782
+ ? {}
783
+ : { attended: options.attended }),
685
784
  });
686
785
  const ok = result.review.findings.length === 0;
687
786
  emit(io, global.json === true, commandResult({
@@ -721,6 +820,64 @@ export function createProgram(io, jsonErrors = false) {
721
820
  const pr = program
722
821
  .command("pr")
723
822
  .description("deliver an exact reviewed candidate through a draft PR");
823
+ pr.command("merge-plan")
824
+ .description("plan a distinct human-approved merge, including readiness when needed")
825
+ .requiredOption("--task <path>", "approved task packet path")
826
+ .requiredOption("--run <id>", "run identifier")
827
+ .option("--method <method>", "squash or merge", "squash")
828
+ .action(async (options) => {
829
+ if (options.method !== "squash" && options.method !== "merge")
830
+ throw new MillError("MERGE_METHOD_INVALID", "Choose squash or merge.", ExitCode.usage);
831
+ const global = globals(program);
832
+ const root = await findRepositoryRoot(global.cwd);
833
+ await enforceExactVersion(root);
834
+ const data = await planMerge({
835
+ root,
836
+ taskPath: options.task,
837
+ runId: options.run,
838
+ method: options.method,
839
+ });
840
+ emit(io, global.json === true, commandResult({ command: "pr.merge-plan", ok: true, data }));
841
+ });
842
+ pr.command("merge")
843
+ .description("apply an exact merge plan at the trusted attended operator boundary")
844
+ .requiredOption("--task <path>", "approved task packet path")
845
+ .requiredOption("--run <id>", "run identifier")
846
+ .requiredOption("--approve <digest>", "exact displayed merge-plan digest")
847
+ .requiredOption("--attended", "operator has approved this exact plan")
848
+ .action(async (options) => {
849
+ const global = globals(program);
850
+ const root = await findRepositoryRoot(global.cwd);
851
+ await enforceExactVersion(root);
852
+ const data = await applyMerge({
853
+ root,
854
+ taskPath: options.task,
855
+ runId: options.run,
856
+ approvalDigest: options.approve,
857
+ attended: options.attended,
858
+ });
859
+ emit(io, global.json === true, commandResult({ command: "pr.merge", ok: true, data }));
860
+ });
861
+ pr.command("merge-reconcile")
862
+ .description("read back a possibly started merge without retrying it")
863
+ .requiredOption("--task <path>", "approved task packet path")
864
+ .requiredOption("--run <id>", "run identifier")
865
+ .action(async (options) => {
866
+ const global = globals(program);
867
+ const root = await findRepositoryRoot(global.cwd);
868
+ await enforceExactVersion(root);
869
+ const data = await reconcileMerge({
870
+ root,
871
+ taskPath: options.task,
872
+ runId: options.run,
873
+ });
874
+ emit(io, global.json === true, commandResult({
875
+ command: "pr.merge-reconcile",
876
+ ok: data.state === "merged",
877
+ status: data.state === "merged" ? "ok" : "blocked",
878
+ data,
879
+ }));
880
+ });
724
881
  pr.command("plan")
725
882
  .description("read live GitHub identity and create a local approval plan")
726
883
  .requiredOption("--task <path>", "approved task packet path")
@@ -890,6 +1047,38 @@ export function createProgram(io, jsonErrors = false) {
890
1047
  const state = program
891
1048
  .command("state")
892
1049
  .description("manage local operational state");
1050
+ state
1051
+ .command("reconcile-plans")
1052
+ .description("read back committed generated authority; never retry apply")
1053
+ .action(async () => {
1054
+ const global = globals(program);
1055
+ const root = await findRepositoryRoot(global.cwd);
1056
+ await enforceExactVersion(root);
1057
+ const data = await reconcileAuthorityPlans({ root });
1058
+ const ok = data.plans.every((plan) => plan.state === "committed" || plan.state === "abandoned");
1059
+ emit(io, global.json === true, commandResult({
1060
+ command: "state.reconcile-plans",
1061
+ ok,
1062
+ status: ok ? "ok" : "blocked",
1063
+ data,
1064
+ }));
1065
+ });
1066
+ state
1067
+ .command("abandon-plan")
1068
+ .description("abandon an exact failed plan while retaining its clean committed branch")
1069
+ .requiredOption("--approve <digest>", "original authority-plan approval digest")
1070
+ .option("--attended", "confirm attended local disposition")
1071
+ .action(async (options) => {
1072
+ const global = globals(program);
1073
+ const root = await findRepositoryRoot(global.cwd);
1074
+ await enforceExactVersion(root);
1075
+ const data = await abandonAuthorityPlan({
1076
+ root,
1077
+ approvalDigest: options.approve,
1078
+ attended: options.attended === true,
1079
+ });
1080
+ emit(io, global.json === true, commandResult({ command: "state.abandon-plan", ok: true, data }));
1081
+ });
893
1082
  state
894
1083
  .command("backup")
895
1084
  .description("create a user-only SQLite backup")