@scotthuang/agent-knock-knock 0.13.17 → 0.14.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 (291) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/CONTRIBUTING.md +212 -0
  3. package/README.md +105 -166
  4. package/connectors/deepseek-harness/LICENSE +21 -0
  5. package/connectors/deepseek-harness/README.md +406 -0
  6. package/connectors/pi/LICENSE +21 -0
  7. package/connectors/pi/README.md +446 -0
  8. package/dist/src/backend-recovery-semantic.d.ts +16 -0
  9. package/dist/src/backend-recovery-semantic.js +113 -0
  10. package/dist/src/backend-recovery-semantic.js.map +1 -0
  11. package/dist/src/backend-task-recovery.d.ts +103 -0
  12. package/dist/src/backend-task-recovery.js +142 -0
  13. package/dist/src/backend-task-recovery.js.map +1 -0
  14. package/dist/src/callback-transport.d.ts +8 -0
  15. package/dist/src/callback-transport.js +14 -0
  16. package/dist/src/callback-transport.js.map +1 -1
  17. package/dist/src/cli-core.js +18 -8
  18. package/dist/src/cli-core.js.map +1 -1
  19. package/dist/src/cli-runtime-context.d.ts +5 -0
  20. package/dist/src/cli-runtime-context.js.map +1 -1
  21. package/dist/src/codex-async-question-adapter.js +14 -4
  22. package/dist/src/codex-async-question-adapter.js.map +1 -1
  23. package/dist/src/codex-lifecycle-compatibility.d.ts +1 -1
  24. package/dist/src/codex-lifecycle-compatibility.js +9 -3
  25. package/dist/src/codex-lifecycle-compatibility.js.map +1 -1
  26. package/dist/src/codex-native-cli-adapter.d.ts +6 -0
  27. package/dist/src/codex-native-cli-adapter.js +273 -0
  28. package/dist/src/codex-native-cli-adapter.js.map +1 -0
  29. package/dist/src/codex-native-client-interactions.d.ts +6 -0
  30. package/dist/src/codex-native-client-interactions.js +124 -0
  31. package/dist/src/codex-native-client-interactions.js.map +1 -0
  32. package/dist/src/codex-native-client-rpc.d.ts +21 -0
  33. package/dist/src/codex-native-client-rpc.js +137 -0
  34. package/dist/src/codex-native-client-rpc.js.map +1 -0
  35. package/dist/src/codex-native-client.d.ts +42 -0
  36. package/dist/src/codex-native-client.js +326 -0
  37. package/dist/src/codex-native-client.js.map +1 -0
  38. package/dist/src/codex-native-identity.d.ts +6 -0
  39. package/dist/src/codex-native-identity.js +42 -0
  40. package/dist/src/codex-native-identity.js.map +1 -0
  41. package/dist/src/codex-native-monitor.d.ts +4 -0
  42. package/dist/src/codex-native-monitor.js +92 -0
  43. package/dist/src/codex-native-monitor.js.map +1 -0
  44. package/dist/src/codex-native-outbox.d.ts +16 -0
  45. package/dist/src/codex-native-outbox.js +120 -0
  46. package/dist/src/codex-native-outbox.js.map +1 -0
  47. package/dist/src/codex-native-public-projection.d.ts +545 -0
  48. package/dist/src/codex-native-public-projection.js +182 -0
  49. package/dist/src/codex-native-public-projection.js.map +1 -0
  50. package/dist/src/codex-native-record-store.d.ts +27 -0
  51. package/dist/src/codex-native-record-store.js +111 -0
  52. package/dist/src/codex-native-record-store.js.map +1 -0
  53. package/dist/src/codex-native-response-service.d.ts +69 -0
  54. package/dist/src/codex-native-response-service.js +244 -0
  55. package/dist/src/codex-native-response-service.js.map +1 -0
  56. package/dist/src/codex-native-runtime.d.ts +46 -0
  57. package/dist/src/codex-native-runtime.js +112 -0
  58. package/dist/src/codex-native-runtime.js.map +1 -0
  59. package/dist/src/codex-native-semantic.d.ts +17 -0
  60. package/dist/src/codex-native-semantic.js +175 -0
  61. package/dist/src/codex-native-semantic.js.map +1 -0
  62. package/dist/src/codex-native-snapshot.d.ts +19 -0
  63. package/dist/src/codex-native-snapshot.js +160 -0
  64. package/dist/src/codex-native-snapshot.js.map +1 -0
  65. package/dist/src/codex-native-state-store.d.ts +61 -0
  66. package/dist/src/codex-native-state-store.js +132 -0
  67. package/dist/src/codex-native-state-store.js.map +1 -0
  68. package/dist/src/codex-native-task-service.d.ts +71 -0
  69. package/dist/src/codex-native-task-service.js +502 -0
  70. package/dist/src/codex-native-task-service.js.map +1 -0
  71. package/dist/src/codex-native-types.d.ts +92 -0
  72. package/dist/src/codex-native-types.js +15 -0
  73. package/dist/src/codex-native-types.js.map +1 -0
  74. package/dist/src/codex-permission-surface.d.ts +1 -1
  75. package/dist/src/codex-permission-surface.js +1 -1
  76. package/dist/src/codex-permission-surface.js.map +1 -1
  77. package/dist/src/codex-terminal-agent-adapter.js +3 -1
  78. package/dist/src/codex-terminal-agent-adapter.js.map +1 -1
  79. package/dist/src/conversation-list.d.ts +12 -0
  80. package/dist/src/conversation-list.js +30 -0
  81. package/dist/src/conversation-list.js.map +1 -0
  82. package/dist/src/conversation-route-dispatch.d.ts +13 -0
  83. package/dist/src/conversation-route-dispatch.js +66 -0
  84. package/dist/src/conversation-route-dispatch.js.map +1 -0
  85. package/dist/src/conversation-route-legacy.d.ts +18 -0
  86. package/dist/src/conversation-route-legacy.js +54 -0
  87. package/dist/src/conversation-route-legacy.js.map +1 -0
  88. package/dist/src/conversation-route-store.d.ts +51 -0
  89. package/dist/src/conversation-route-store.js +126 -0
  90. package/dist/src/conversation-route-store.js.map +1 -0
  91. package/dist/src/conversation-routing-cli-adapter.d.ts +12 -0
  92. package/dist/src/conversation-routing-cli-adapter.js +211 -0
  93. package/dist/src/conversation-routing-cli-adapter.js.map +1 -0
  94. package/dist/src/conversation-routing-commands.d.ts +11 -0
  95. package/dist/src/conversation-routing-commands.js +85 -0
  96. package/dist/src/conversation-routing-commands.js.map +1 -0
  97. package/dist/src/conversation-routing-home.d.ts +26 -0
  98. package/dist/src/conversation-routing-home.js +105 -0
  99. package/dist/src/conversation-routing-home.js.map +1 -0
  100. package/dist/src/conversation-routing-identity.d.ts +40 -0
  101. package/dist/src/conversation-routing-identity.js +174 -0
  102. package/dist/src/conversation-routing-identity.js.map +1 -0
  103. package/dist/src/conversation-runtime-route-store.d.ts +11 -0
  104. package/dist/src/conversation-runtime-route-store.js +118 -0
  105. package/dist/src/conversation-runtime-route-store.js.map +1 -0
  106. package/dist/src/desktop-async-interactions.d.ts +15 -0
  107. package/dist/src/desktop-async-interactions.js +88 -0
  108. package/dist/src/desktop-async-interactions.js.map +1 -0
  109. package/dist/src/desktop-async-state.d.ts +5 -0
  110. package/dist/src/desktop-async-state.js +53 -0
  111. package/dist/src/desktop-async-state.js.map +1 -0
  112. package/dist/src/desktop-cli-adapter.d.ts +7 -0
  113. package/dist/src/desktop-cli-adapter.js +322 -0
  114. package/dist/src/desktop-cli-adapter.js.map +1 -0
  115. package/dist/src/desktop-cli-controls.d.ts +9 -0
  116. package/dist/src/desktop-cli-controls.js +45 -0
  117. package/dist/src/desktop-cli-controls.js.map +1 -0
  118. package/dist/src/desktop-command-presentation.d.ts +2 -0
  119. package/dist/src/desktop-command-presentation.js +31 -0
  120. package/dist/src/desktop-command-presentation.js.map +1 -0
  121. package/dist/src/desktop-control-semantic.d.ts +8 -0
  122. package/dist/src/desktop-control-semantic.js +68 -0
  123. package/dist/src/desktop-control-semantic.js.map +1 -0
  124. package/dist/src/desktop-identity.d.ts +5 -0
  125. package/dist/src/desktop-identity.js +40 -0
  126. package/dist/src/desktop-identity.js.map +1 -0
  127. package/dist/src/desktop-interaction-projection.d.ts +57 -0
  128. package/dist/src/desktop-interaction-projection.js +196 -0
  129. package/dist/src/desktop-interaction-projection.js.map +1 -0
  130. package/dist/src/desktop-interaction-state.d.ts +3 -0
  131. package/dist/src/desktop-interaction-state.js +48 -0
  132. package/dist/src/desktop-interaction-state.js.map +1 -0
  133. package/dist/src/desktop-ipc-async-answer.d.ts +9 -0
  134. package/dist/src/desktop-ipc-async-answer.js +71 -0
  135. package/dist/src/desktop-ipc-async-answer.js.map +1 -0
  136. package/dist/src/desktop-ipc-client.d.ts +47 -0
  137. package/dist/src/desktop-ipc-client.js +400 -0
  138. package/dist/src/desktop-ipc-client.js.map +1 -0
  139. package/dist/src/desktop-ipc-native-operations.d.ts +11 -0
  140. package/dist/src/desktop-ipc-native-operations.js +126 -0
  141. package/dist/src/desktop-ipc-native-operations.js.map +1 -0
  142. package/dist/src/desktop-ipc-transport.d.ts +13 -0
  143. package/dist/src/desktop-ipc-transport.js +123 -0
  144. package/dist/src/desktop-ipc-transport.js.map +1 -0
  145. package/dist/src/desktop-list.d.ts +25 -0
  146. package/dist/src/desktop-list.js +55 -0
  147. package/dist/src/desktop-list.js.map +1 -0
  148. package/dist/src/desktop-metadata-reader.d.ts +30 -0
  149. package/dist/src/desktop-metadata-reader.js +182 -0
  150. package/dist/src/desktop-metadata-reader.js.map +1 -0
  151. package/dist/src/desktop-monitor.d.ts +4 -0
  152. package/dist/src/desktop-monitor.js +101 -0
  153. package/dist/src/desktop-monitor.js.map +1 -0
  154. package/dist/src/desktop-public-projection.d.ts +6 -0
  155. package/dist/src/desktop-public-projection.js +134 -0
  156. package/dist/src/desktop-public-projection.js.map +1 -0
  157. package/dist/src/desktop-request-interactions.d.ts +14 -0
  158. package/dist/src/desktop-request-interactions.js +144 -0
  159. package/dist/src/desktop-request-interactions.js.map +1 -0
  160. package/dist/src/desktop-response-dispatch.d.ts +14 -0
  161. package/dist/src/desktop-response-dispatch.js +19 -0
  162. package/dist/src/desktop-response-dispatch.js.map +1 -0
  163. package/dist/src/desktop-response-evidence.d.ts +4 -0
  164. package/dist/src/desktop-response-evidence.js +19 -0
  165. package/dist/src/desktop-response-evidence.js.map +1 -0
  166. package/dist/src/desktop-response-service.d.ts +11 -0
  167. package/dist/src/desktop-response-service.js +188 -0
  168. package/dist/src/desktop-response-service.js.map +1 -0
  169. package/dist/src/desktop-response-store.d.ts +35 -0
  170. package/dist/src/desktop-response-store.js +58 -0
  171. package/dist/src/desktop-response-store.js.map +1 -0
  172. package/dist/src/desktop-response-types.d.ts +20 -0
  173. package/dist/src/desktop-response-types.js +2 -0
  174. package/dist/src/desktop-response-types.js.map +1 -0
  175. package/dist/src/desktop-response-value.d.ts +6 -0
  176. package/dist/src/desktop-response-value.js +31 -0
  177. package/dist/src/desktop-response-value.js.map +1 -0
  178. package/dist/src/desktop-runtime.d.ts +153 -0
  179. package/dist/src/desktop-runtime.js +88 -0
  180. package/dist/src/desktop-runtime.js.map +1 -0
  181. package/dist/src/desktop-semantic.d.ts +21 -0
  182. package/dist/src/desktop-semantic.js +140 -0
  183. package/dist/src/desktop-semantic.js.map +1 -0
  184. package/dist/src/desktop-session-catalog.d.ts +68 -0
  185. package/dist/src/desktop-session-catalog.js +225 -0
  186. package/dist/src/desktop-session-catalog.js.map +1 -0
  187. package/dist/src/desktop-session-controls.d.ts +145 -0
  188. package/dist/src/desktop-session-controls.js +176 -0
  189. package/dist/src/desktop-session-controls.js.map +1 -0
  190. package/dist/src/desktop-sidebar-metadata.d.ts +27 -0
  191. package/dist/src/desktop-sidebar-metadata.js +83 -0
  192. package/dist/src/desktop-sidebar-metadata.js.map +1 -0
  193. package/dist/src/desktop-sidebar-projects.d.ts +10 -0
  194. package/dist/src/desktop-sidebar-projects.js +31 -0
  195. package/dist/src/desktop-sidebar-projects.js.map +1 -0
  196. package/dist/src/desktop-sidebar-selection.d.ts +28 -0
  197. package/dist/src/desktop-sidebar-selection.js +85 -0
  198. package/dist/src/desktop-sidebar-selection.js.map +1 -0
  199. package/dist/src/desktop-snapshot-details.d.ts +4 -0
  200. package/dist/src/desktop-snapshot-details.js +116 -0
  201. package/dist/src/desktop-snapshot-details.js.map +1 -0
  202. package/dist/src/desktop-snapshot.d.ts +11 -0
  203. package/dist/src/desktop-snapshot.js +276 -0
  204. package/dist/src/desktop-snapshot.js.map +1 -0
  205. package/dist/src/desktop-state-store.d.ts +72 -0
  206. package/dist/src/desktop-state-store.js +269 -0
  207. package/dist/src/desktop-state-store.js.map +1 -0
  208. package/dist/src/desktop-task-interactions.d.ts +10 -0
  209. package/dist/src/desktop-task-interactions.js +93 -0
  210. package/dist/src/desktop-task-interactions.js.map +1 -0
  211. package/dist/src/desktop-task-recovery.d.ts +38 -0
  212. package/dist/src/desktop-task-recovery.js +171 -0
  213. package/dist/src/desktop-task-recovery.js.map +1 -0
  214. package/dist/src/desktop-task-service.d.ts +54 -0
  215. package/dist/src/desktop-task-service.js +441 -0
  216. package/dist/src/desktop-task-service.js.map +1 -0
  217. package/dist/src/desktop-types.d.ts +281 -0
  218. package/dist/src/desktop-types.js +13 -0
  219. package/dist/src/desktop-types.js.map +1 -0
  220. package/dist/src/host-monitor-reconciliation.js +36 -4
  221. package/dist/src/host-monitor-reconciliation.js.map +1 -1
  222. package/dist/src/host-profile-runtime.js +7 -3
  223. package/dist/src/host-profile-runtime.js.map +1 -1
  224. package/dist/src/local-codex-cli-adapter.d.ts +7 -0
  225. package/dist/src/local-codex-cli-adapter.js +13 -0
  226. package/dist/src/local-codex-cli-adapter.js.map +1 -0
  227. package/dist/src/openclaw-callback-transport.js +2 -1
  228. package/dist/src/openclaw-callback-transport.js.map +1 -1
  229. package/dist/src/semantic-conversation-target.d.ts +4 -0
  230. package/dist/src/semantic-conversation-target.js +20 -0
  231. package/dist/src/semantic-conversation-target.js.map +1 -0
  232. package/dist/src/semantic-permission-control.js +47 -9
  233. package/dist/src/semantic-permission-control.js.map +1 -1
  234. package/dist/src/semantic-private-authority-offers.d.ts +1 -1
  235. package/dist/src/semantic-private-authority-offers.js +3 -1
  236. package/dist/src/semantic-private-authority-offers.js.map +1 -1
  237. package/dist/src/semantic-tool-command-helpers.d.ts +6 -0
  238. package/dist/src/semantic-tool-command-helpers.js +199 -78
  239. package/dist/src/semantic-tool-command-helpers.js.map +1 -1
  240. package/dist/src/semantic-tool-descriptions.d.ts +2 -1
  241. package/dist/src/semantic-tool-descriptions.js +81 -35
  242. package/dist/src/semantic-tool-descriptions.js.map +1 -1
  243. package/dist/src/semantic-tool-list-projection.js +66 -2
  244. package/dist/src/semantic-tool-list-projection.js.map +1 -1
  245. package/dist/src/semantic-tool-presentation.js +76 -7
  246. package/dist/src/semantic-tool-presentation.js.map +1 -1
  247. package/dist/src/semantic-tool-runtime.js +129 -29
  248. package/dist/src/semantic-tool-runtime.js.map +1 -1
  249. package/dist/src/semantic-tool-schemas.d.ts +410 -27
  250. package/dist/src/semantic-tool-schemas.js +176 -88
  251. package/dist/src/semantic-tool-schemas.js.map +1 -1
  252. package/dist/src/terminal-action-contracts.js +10 -6
  253. package/dist/src/terminal-action-contracts.js.map +1 -1
  254. package/dist/src/terminal-list-cli-adapter.d.ts +1 -0
  255. package/dist/src/terminal-list-cli-adapter.js +6 -3
  256. package/dist/src/terminal-list-cli-adapter.js.map +1 -1
  257. package/dist/src/terminal-model-control-profile.d.ts +3 -1
  258. package/dist/src/terminal-model-control-profile.js +15 -7
  259. package/dist/src/terminal-model-control-profile.js.map +1 -1
  260. package/dist/src/terminal-monitor-decision-policy.d.ts +1 -1
  261. package/dist/src/terminal-native-inspection-profile.js +4 -0
  262. package/dist/src/terminal-native-inspection-profile.js.map +1 -1
  263. package/dist/src/terminal-permission-control-list-projection.d.ts +1 -1
  264. package/dist/src/terminal-permission-control.js +5 -1
  265. package/dist/src/terminal-permission-control.js.map +1 -1
  266. package/dist/src/terminal-questionnaire-adapter.js +5 -2
  267. package/dist/src/terminal-questionnaire-adapter.js.map +1 -1
  268. package/dist/src/terminal-user-send-intent.d.ts +2 -0
  269. package/dist/src/terminal-user-send-intent.js +11 -3
  270. package/dist/src/terminal-user-send-intent.js.map +1 -1
  271. package/docs/architecture/current-architecture.md +313 -0
  272. package/docs/architecture/interactive-terminal-response.md +276 -0
  273. package/docs/architecture/issue-126-final-report.md +248 -0
  274. package/docs/architecture/orchestration-refactor-history.md +2987 -0
  275. package/docs/architecture/orchestration-refactor.md +21 -0
  276. package/docs/backend-task-recovery.md +89 -0
  277. package/docs/bidirectional-agent-protocol.md +260 -0
  278. package/docs/codex-0.160.0-compatibility.md +126 -0
  279. package/docs/codex-cli-native-compatibility.md +246 -0
  280. package/docs/codex-desktop-compatibility.md +414 -0
  281. package/docs/codex-permissions.md +12 -1
  282. package/docs/openclaw-operations.md +281 -0
  283. package/docs/openclaw-session-turn-delivery-requirement.md +45 -0
  284. package/docs/operator-guide.md +543 -0
  285. package/docs/storage-and-logging.md +91 -0
  286. package/docs/test-performance-issue-108.md +80 -0
  287. package/docs/test-performance-issue-120.md +226 -0
  288. package/docs/testing.md +628 -0
  289. package/openclaw.plugin.json +7 -3
  290. package/package.json +6 -12
  291. package/templates/openclaw-skills/agent-knock-knock/SKILL.md +69 -18
@@ -0,0 +1,276 @@
1
+ # Interactive terminal response design
2
+
3
+ Status: implemented public package contract
4
+
5
+ ## Problem
6
+
7
+ AKK's terminal approval boundary historically exposes one operation: approve
8
+ the adapter-proven first, one-time `Yes` choice. `cancel` interrupts the Turn;
9
+ it is not a semantic `No` selection. Modern Claude Code and Codex TUI surfaces
10
+ also ask ordinary questions with choices, optional free-form input, multiple
11
+ steps, and a final confirmation. Treating every such surface as approval would
12
+ conflate permission authority with task input and would make safe replay and
13
+ auditing impossible.
14
+
15
+ This design therefore keeps two boundaries:
16
+
17
+ - **Permission decision**: a closed adapter-owned decision such as
18
+ `approve_once` or `reject`. Persistent authorization choices are never
19
+ offered. The caller never supplies terminal keys, menu indexes, or labels.
20
+ - **Questionnaire response**: a versioned public projection containing opaque
21
+ question and option ids, plus typed answers. The terminal key plan and all
22
+ mutation authority remain owner-private.
23
+
24
+ ## Public model-facing contract
25
+
26
+ AKK projects one currently visible interaction:
27
+
28
+ ```json
29
+ {
30
+ "schema": "agent-knock-knock/terminal-interaction",
31
+ "version": 1,
32
+ "interaction_id": "opaque-id",
33
+ "turn_id": "turn-...",
34
+ "agent": "claude",
35
+ "kind": "questionnaire",
36
+ "state": "pending",
37
+ "step": { "index": 1, "total": 2 },
38
+ "questions": [
39
+ {
40
+ "question_id": "opaque-question-id",
41
+ "header": "Color",
42
+ "prompt": "Which color do you prefer?",
43
+ "required": true,
44
+ "response_kind": "single_select",
45
+ "options": [
46
+ { "option_id": "opaque-red-id", "label": "Red" },
47
+ { "option_id": "opaque-blue-id", "label": "Blue" }
48
+ ]
49
+ }
50
+ ],
51
+ "capabilities": {
52
+ "batch_response": false,
53
+ "free_text": false,
54
+ "multi_select": false
55
+ }
56
+ }
57
+ ```
58
+
59
+ The corresponding mutation accepts only the advertised semantic ids and typed
60
+ answer shape:
61
+
62
+ ```json
63
+ {
64
+ "interaction_id": "opaque-id",
65
+ "turn_id": "turn-...",
66
+ "answers": [
67
+ {
68
+ "question_id": "opaque-question-id",
69
+ "response_kind": "single_select",
70
+ "selected_option_ids": ["opaque-blue-id"]
71
+ }
72
+ ]
73
+ }
74
+ ```
75
+
76
+ The OpenClaw tool should be named
77
+ `agent_knock_knock_respond_interaction`. It is deliberately separate from
78
+ ordinary `respond({turn_id, request})`, which injects a new composer message,
79
+ and from `approve({turn_id, decision})`, which resolves a permission prompt.
80
+
81
+ The public implementation is step-oriented: one response call resolves only
82
+ the currently projected step. The managed monitor recaptures the next native
83
+ question, publishes a new `interaction_id`, and emits a new
84
+ `interaction_required` callback for each supported actionable step. This makes
85
+ multi-question and final-confirm flows explicit and avoids a blind batch of
86
+ terminal input.
87
+
88
+ The callback is a durable wake-up signal, not response authority. It contains
89
+ only the public interaction projection and never the private prompt
90
+ fingerprint or key plan. The owning OpenClaw conversation must call Status for
91
+ the exact `turn_id`; displaying that fresh result creates the short-lived,
92
+ conversation-bound private offer required by `respond_interaction`. A delayed
93
+ or replayed callback therefore cannot authorize input by itself.
94
+
95
+ ## Private authority
96
+
97
+ The Store may retain a private authority record binding all of the following:
98
+
99
+ - exact Turn and owning OpenClaw session;
100
+ - terminal endpoint, process incarnation, native thread, and binding
101
+ generation;
102
+ - transcript/rollout source identity and bounded observation point when
103
+ available;
104
+ - an exact unredacted prompt-region fingerprint;
105
+ - the current native step and the adapter-owned semantic-id-to-input plan;
106
+ - expiry, reservation, last proven stage, and uncertain-outcome state.
107
+
108
+ None of those mutation fields are copied into the public projection. Labels
109
+ and redacted excerpts are presentation only and never mutation authority.
110
+
111
+ ## Recognition and dispatch
112
+
113
+ Every supported surface has a closed adapter/version profile. Detection must
114
+ isolate one bottom-most complete prompt, prove its footer and frame, reject
115
+ duplicate/out-of-order choices, and produce a digest before redaction.
116
+
117
+ For each response AKK:
118
+
119
+ 1. acquires terminal, Store-writer, and Turn-state locks in canonical order;
120
+ 2. revalidates owner, Turn status, binding generation, process/native identity,
121
+ and the current private interaction offer; an elapsed displayed expiry
122
+ forces this live revalidation but does not claim the native prompt died;
123
+ 3. recaptures the screen and requires the same exact prompt fingerprint;
124
+ 4. resolves opaque semantic ids to an adapter-owned input plan;
125
+ 5. reserves the response durably before possible terminal input;
126
+ 6. dispatches one bounded native step;
127
+ 7. records an audit receipt without raw answer content and resumes the monitor;
128
+ and
129
+ 8. resumes the managed monitor, which recaptures the next native state, rotates
130
+ the interaction id when the exact prompt changes, and emits the next
131
+ supported-step callback. Status can always refresh the same projection
132
+ explicitly.
133
+
134
+ If a failure occurs before terminal input, the response is safely rejected.
135
+ If input may have occurred, the Turn becomes `response_uncertain`; AKK sends no
136
+ automatic retry. Unknown versions, secret-input questions, ambiguous screens,
137
+ unsupported option counts, changed prompts, or unprovable postconditions are
138
+ `manual_required` and send zero input.
139
+
140
+ ## Native behavior profiles
141
+
142
+ ### Claude Code 2.1.263, 2.1.266, and 2.1.267
143
+
144
+ Claude Code 2.1.263 was observed locally in an isolated tmux session; the
145
+ versioned profiles retain this exact behavior contract:
146
+
147
+ - single-select: digit selects and advances/submits;
148
+ - multi-select: digits toggle checkboxes, then `Tab` advances to review;
149
+ - Other/free text: select `Type something`, enter a single-line response below
150
+ Claude's 800-character paste-collapse threshold, then Enter;
151
+ - multi-question: a tab header shows checked/unanswered sections;
152
+ - final review: `Submit answers` / `Cancel` is a distinct confirmation step;
153
+ - Bash permission prompt: the exact four-row form has one-time Yes as the
154
+ current row and `4. No`; `Escape` cancels the dialog and is not modeled as
155
+ semantic reject.
156
+
157
+ The installed 2.1.266 binary and Anthropic's official 2.1.267 Darwin arm64
158
+ artifact retain the same bounded questionnaire, collapsed-paste, and Status
159
+ anchors. Each version has a distinct interaction profile so a durable offer
160
+ cannot cross a client-version change. Claude Code 2.1.261 also introduced an
161
+ optional `Organization policy` Status row when managed policy loading fails;
162
+ the 2.1.263/2.1.266/2.1.267 profiles allow that exact field and redact its
163
+ value.
164
+
165
+ The initial public implementation executes exact single-select rows (including the transition into
166
+ `Type something`), the recaptured single-line custom-text editor, and the
167
+ separate final Submit/Cancel review. Custom text is capped at 799 characters;
168
+ larger answers fail before dispatch reservation until the editor gains the
169
+ same collapsed-paste proof as managed Send. It detects multi-select screens
170
+ but keeps them `manual_required`: safely toggling several checkboxes requires
171
+ a recapture after every toggle and is intentionally deferred. `Tab to amend`,
172
+ persistent Yes, auto mode, resized/wrapped variants, and any changed menu shape
173
+ also remain manual.
174
+
175
+ ### Codex 0.153.4, 0.154.0, and 0.155.1
176
+
177
+ The installed client matches the current official TUI protocol:
178
+
179
+ - `RequestUserInput` contains 1-3 questions with 2-3 options and automatic
180
+ Other;
181
+ - numeric selection advances an ordinary choice question, but would bypass
182
+ Notes and submit the literal label for the native Other row;
183
+ - the client-generated `None of the above` row is Codex's canonical Notes
184
+ carrier; when the model did not supply a `Type something.` alias, AKK derives
185
+ that separate semantic free-text choice beside the proven native row;
186
+ - choosing the guarded or derived free-text choice moves to native Other with
187
+ bounded cursor movement and invokes Codex's native Accept action, which
188
+ opens Notes without submitting a literal label; choosing native Other itself
189
+ retains its distinct numeric direct-submit behavior;
190
+ - the recaptured empty `Add notes` composer becomes a separate free-text
191
+ interaction step;
192
+ - Codex submits that text as `user_note: ...` alongside `None of the above`;
193
+ it does not expose a Claude-style bare custom-answer value;
194
+ - semantic free-text dispatch crosses the verified 121ms paste-suppression
195
+ window before its sole Enter;
196
+ - the exact multi-question free-form footer is handled one current step at a
197
+ time;
198
+ - unanswered-question confirmation is its own `Proceed` / `Go back` step.
199
+
200
+ Codex does not currently expose a native multi-select question in this
201
+ protocol. Any future or unrecognized shape remains manual until a new profile
202
+ and tests are added.
203
+
204
+ Codex 0.154.0 and 0.155.1 preserve those blocking `request_user_input` frames
205
+ under separate version-bound profiles. Codex 0.154.0 also adds
206
+ `request_user_input_async`; unlike a blocking `questionnaire`, its question is
207
+ projected as `kind="async_question"` while the agent Turn remains `working`.
208
+ The projection advertises semantic `delivery_modes`. A typed response defaults
209
+ to advertised `steer_current_turn` or explicitly selects advertised `queue_next_turn`: `steer_current_turn` delivers the answer to
210
+ the running turn, while `queue_next_turn` queues it for the next turn. Blocking
211
+ questionnaires do not advertise and must reject that field.
212
+
213
+ For async questions, the advertised native Other option opens a separate
214
+ `free_text` step; it is not the blocking questionnaire's Notes workflow.
215
+ An answer queued for the next turn uses the same exact question editor and
216
+ must verify the injected answer before the final submit/queue key. If that
217
+ editor closes or changes, input stops with an uncertain result and no retry.
218
+
219
+ Collapsed async countdown redraws are not question changes: dispatch compares
220
+ the independently parsed question, pending count, opening binding, subject and
221
+ terminal identity, while retaining the rendered digest for evidence. A different
222
+ question, count, input mode or binding still rejects before input.
223
+
224
+ For managed user Send on profiled Codex 0.154.0/0.155.1 using Astra, animated
225
+ empty Composer proof requires the full dim placeholder, styled marker and shared painted
226
+ background, only the known decorated cells, and a complete supported footer.
227
+ Activity, approval and input-owner checks run first. This proof does not grant
228
+ native lifecycle or model-control authority. After the managed pre-text proof,
229
+ user-explicit Send retains its one-paste/one-Enter contract without a post-text
230
+ Composer veto.
231
+
232
+ AKK still treats input ownership independently: an exact collapsed question
233
+ summary leaves the main Composer sendable, while an expanded, clipped, or
234
+ ambiguous async editor is a zero-input boundary so an explicit task cannot
235
+ become a question answer. Response execution uses only semantic question and
236
+ option identities; raw shortcut keys and menu indexes never cross the public
237
+ contract. Codex 0.154.0 and 0.155.1 rely on exact version-bound TUI and durable
238
+ task evidence. Notification and stable-question-identity response wrappers
239
+ added on Codex main after 0.155.1 must not be assumed to exist in either
240
+ release. The 0.154/0.155 active-writer `/resume` viewer is likewise read-only
241
+ and receives no AKK terminal input.
242
+
243
+ Codex 0.155.1 can also display native user-verification prompts for MCP
244
+ requests. AKK classifies the exact prompt and waiting surfaces as blocked but
245
+ never exposes them as approvable: completing platform user verification
246
+ requires direct user presence and is outside terminal approval automation.
247
+
248
+ ## Delivery stages
249
+
250
+ 1. **Permission parity (implemented)**: expose `reject` only when an
251
+ adapter proves an exact safe native reject action; retain `approve_once`
252
+ compatibility.
253
+ 2. **Read-only projection (implemented)**: detect and report supported
254
+ questionnaire steps while changed or unsupported shapes remain manual.
255
+ 3. **Initial public response contract (implemented)**: enable one current
256
+ single-select, free-text, or confirmation step with pre-input fencing,
257
+ durable one-shot reservation, and uncertain-result audit.
258
+ 4. **Managed interaction callback (implemented)**: durably notify the owning
259
+ controller about each actionable current step, require a fresh Status call
260
+ before response, permanently fence a consumed prompt fingerprint from
261
+ replay, and notify the next distinct questionnaire step independently.
262
+ 5. **Expanded native coverage (not implemented)**: multi-select (tracked in
263
+ [#292](https://github.com/scotthuang/agent-knock-knock/issues/292)),
264
+ arbitrary per-option Notes, broader navigation, and more version profiles
265
+ only with captured fixtures and live regression evidence.
266
+ 6. **Host-native UX**: OpenClaw may render the projection using a future public
267
+ session-bound `requestUserInput` API. Until then, the structured AKK tool is
268
+ the authority boundary; a plugin must not use private Gateway methods.
269
+
270
+ ## Non-goals
271
+
272
+ - no raw tmux keys, numeric menu indexes, or arbitrary labels in public tools;
273
+ - no automatic permission decisions or persistent authorization grants;
274
+ - no secret/password response relay;
275
+ - no blind retry after possible input;
276
+ - no attempt to emulate an arbitrary terminal UI.
@@ -0,0 +1,248 @@
1
+ # Issue #126 architecture closeout report
2
+
3
+ Status: the product architecture and production-source freeze are complete.
4
+ Issue [#126](https://github.com/scotthuang/agent-knock-knock/issues/126)
5
+ was closed as completed on 2026-08-20. Exact-head operational evidence is the
6
+ remaining closeout step; four longitudinal measurements remain uncollected
7
+ follow-up observations and are not claimed as completed by this report.
8
+
9
+ This report is written against `main@61da2a6e482f96fb2b8d552fe4909d6e3ab09e64`.
10
+ The production freeze is
11
+ `49d351e8501efdb8814ba4d6646b8f7a81856cbc`: PRs #198 through #200 changed
12
+ tests, test infrastructure, configuration, and documentation only, so the
13
+ `src/**` tree at the report revision is byte-identical to that freeze.
14
+
15
+ This document does **not** claim that the final full-suite median is at or below
16
+ 180 seconds, that the final dynamic subprocess comparison has passed, or that
17
+ the final local OpenClaw build has been installed. Those are separate
18
+ exact-SHA evidence steps described below.
19
+
20
+ ## Product problem and outcome
21
+
22
+ At the v0.12.11 baseline, `src/cli-core.ts` owned 51.5 percent of production
23
+ TypeScript. It mixed parsing and presentation with terminal authority,
24
+ dispatch, lifecycle, callback, monitor, recovery, locks, and persistence. A
25
+ normal change therefore touched a shared 38,005-line integration point and
26
+ made ownership and durable-effect ordering difficult to review.
27
+
28
+ Issue #126 applied a strangler refactor, moving characterized behavior behind
29
+ typed policies, services, repositories, and adapters while preserving
30
+ `parseCliCommand` and `executeCliCommand`. Each vertical now has a named owner
31
+ and focused witnesses. Public CLI, OpenClaw, Session/Turn, Store, terminal, and
32
+ callback contracts remain compatible; the 1,556-line core is composition and
33
+ compatibility routing, not a second state-machine implementation.
34
+
35
+ ## Before and after
36
+
37
+ The baseline is `ea592a88d7af4a709e7a7a1b989dd29e61932935`
38
+ (`v0.12.11`, measured 2026-08-14). The after column is the production freeze
39
+ carried unchanged by the report revision.
40
+
41
+ | Metric | Baseline | Production freeze | Result |
42
+ | --- | ---: | ---: | ---: |
43
+ | Production TypeScript LOC | 73,792 | 93,322 | +19,530 (+26.5%) typed ownership and adapters |
44
+ | Production modules | 38 | 125 | responsibilities split into reviewable owners |
45
+ | `cli-core.ts` LOC | 38,005 | 1,556 | -36,449 (-95.9%) |
46
+ | `cli-core.ts` share of production | 51.5% | 1.7% | -49.8 percentage points |
47
+ | Production functions at or above 500 LOC | 9 | 0 | strict `<500` hard gate |
48
+ | Maximum production function LOC / approximate complexity | 1,886 / c302 | separate maxima of 484 LOC and c49 at hard-gate closeout | strict `<500` / `<50`, no allowlist |
49
+ | Production import cycles | 0 | 0 | acyclic throughout |
50
+ | `openclaw-plugin.ts` entry LOC | 2,830 before its split | 67 | -2,763 (-97.6%) |
51
+ | Included product-test subprocess sites | 48 | 19 | -60.42% static closeout |
52
+ | Frozen affected-selector replay | — | 8 targeted / 2 full | 80% avoid full fallback; point evidence only |
53
+
54
+ The production LOC increase is visible typed ownership, not generated code or
55
+ generic bags. Exact manifest ratchets prevent the core or total from silently
56
+ growing.
57
+
58
+ ## Canonical vertical ownership
59
+
60
+ A CLI adapter may translate options, acquire its shell capabilities, call one
61
+ use case, and present the result; it may not recreate the use case's decisions.
62
+
63
+ | Vertical | Unique canonical authority | I/O and durable boundary | CLI/OpenClaw role |
64
+ | --- | --- | --- | --- |
65
+ | Terminal identity, binding, and actions | terminal binding/identity authority, terminal authority policy, and terminal action projection | terminal/process observations plus authoritative Session reads | list, status, send, approve, cancel, and lifecycle adapters consume the same decision facts |
66
+ | Dispatch and acceptance | terminal dispatch policy/application, submission acceptance, receipt, ledger codec, repository, and recovery | exact terminal input, prepared/accepted receipt writes, ledger CAS and recovery | terminal command facade maps command options and presents the canonical result |
67
+ | Native lifecycle | native-thread transition policy, application, settlement, verification, lifecycle query, and lifecycle CLI adapter | transition records, terminal observation/input, Session CAS, and recovery | New/Clear/Resume/inspect commands route to one lifecycle composition |
68
+ | Deferred foreground handoff | deferred-foreground policy, preparation/application services, capability repositories, and authority adapter | append-only transfer/receipt history and terminal -> writer -> state transactions | ordinary send and recovery call the same handoff authority instead of copying it |
69
+ | Callback and outbox | callback outbox policy, service, settlement, OpenClaw callback transport, and callback facade | immutable message/attempt state, Gateway process transport, retry ownership, and settlement events | callback/retry commands and monitors share one outbox implementation |
70
+ | Monitor and reconciliation | monitor decision policy/application, state reconciliation, and supervision facade | polling observations, singleton process ownership, state/event writes, and callback preparation | monitor commands and OpenClaw supervision schedule the same services |
71
+ | List, status, delegate, and maintenance | dedicated list, status-facts/status, delegate, and maintenance facades | bounded Store/terminal reads and explicit reconciliation-only mutations | default reads remain read-only; formatting does not grant mutation authority |
72
+ | Persistence and locking | Store and Session repositories/codecs, durable JSON and dispatch-ledger I/O, mutation capabilities, and file-lock adapter | no-follow/atomic write, fsync/rename, revision/CAS, writer and state locks | services receive typed capabilities rather than raw paths or `*LockHeld` booleans |
73
+ | Runtime and external adapters | async-local CLI runtime, tmux/Herdr providers, Codex/Claude adapters, OpenClaw Gateway adapter | process argv/env/cwd/timeout/exit, terminal screen/input, clocks and sleeps | entrypoints bind ports; policies do not import process or filesystem APIs |
74
+
75
+ Six formerly duplicated status decisions are also frozen to a single source.
76
+ Conversation release, Session-send blocking, and callback supersession belong
77
+ to `protocol.ts`; deferred-transfer finality belongs to
78
+ `deferred-foreground-transfer-policy.ts`; ordinary dispatch activity and
79
+ recoverability belong to `terminal-dispatch-policy.ts`. Compiler-AST guards
80
+ reject duplicate function definitions, copied exact tables, and bypass tables
81
+ in other owners.
82
+
83
+ ## Service, CLI, and dependency boundaries
84
+
85
+ Dependencies flow from CLI/OpenClaw entrypoints through typed composition,
86
+ use cases, pure policies, and domain ports. Filesystem, Store, tmux, Herdr,
87
+ Codex, Claude, and Gateway adapters implement those inward-facing ports.
88
+
89
+ `src/cli.ts` is the sole production importer of `cli-core.ts`. The core keeps
90
+ stable parser/executor exports, routing, composition, shared scopes, and
91
+ compatibility presentation; it contains no send, lifecycle, monitor, or
92
+ callback state machine. Its options are `Record<string, unknown>`, guarded in
93
+ source and declarations against a returning raw-`any` bridge.
94
+
95
+ Pure decisions import no filesystem, process, environment, clock, or sleep
96
+ APIs. Services use typed ports; CLI adapters own option/path translation and
97
+ transaction shells; infrastructure owns external semantics. Validation reports
98
+ 57 domains, 125 modules, 809 edges, zero cycles, and one core importer. Known
99
+ domains select at most five focused integration witnesses; shared authorities
100
+ still fail closed to the full tier.
101
+
102
+ ## OpenClaw boundary
103
+
104
+ The OpenClaw entry is no longer a second orchestration monolith. Schemas owns
105
+ the exact 14 tools; command adapter owns `/akk`, tool mapping and CLI process
106
+ projection; callback adapter owns identity, approval, injection and delivery;
107
+ supervisor owns non-overlapping monitor scheduling; helpers remains the shared
108
+ parser/formatter owner; the 67-line entry owns metadata and ordered composition.
109
+
110
+ The plugin family grew by 76 lines while its entry lost 2,763. The split added
111
+ or removed no lock, durable write, process, timer, Gateway method, restart, or
112
+ public tool contract. Exact schemas, tool order, callback identity, registration
113
+ order, instance isolation, and supervision remain contract witnesses.
114
+
115
+ ## Compatibility, locking, and persistence invariants
116
+
117
+ The refactor retains Store format 1, writer protocol 5, Session-authority
118
+ protocol 3, managed Session schema/version 1, native-transition schema/version
119
+ 1, and readable deferred-foreground v1/v2. It also retains package/executable/
120
+ plugin identities, `/akk`, 14 tools, CLI/public JSON/redaction/legacy decoding,
121
+ and Codex/Claude plus tmux/Herdr identity, cwd, incarnation, and composer fences.
122
+
123
+ The canonical mutation order remains:
124
+
125
+ ```text
126
+ terminal dispatch lock -> Store writer lease -> conversation state lock
127
+ ```
128
+
129
+ Capabilities are invocation-local, resource-bound, and invalidated before
130
+ reverse-order lock release. A valid capability cannot be paired with another
131
+ terminal, Store, state path, or transaction. Durable effects retain their
132
+ original order: prepare before terminal input, text before exactly one Enter,
133
+ Enter before native acceptance, and state before append-only event where the
134
+ existing protocol requires it. Possible input, uncertain dispatch, uncertain
135
+ approval, and uncertain lifecycle outcomes are never blindly retried.
136
+
137
+ Callback preparation and state claiming remain inside their required writer
138
+ and state boundaries; Gateway delivery occurs after the outer locks release.
139
+ Callback progress, success, failure, retry scheduling, and accepted-transport
140
+ recovery remain the responsibility of the canonical outbox settlement path.
141
+ Lifecycle and deferred-transfer recovery retain their CAS and crash boundaries.
142
+ Ledger and durable-file adapters retain no-follow opens, temporary writes,
143
+ fsync, rename, directory fsync, and cleanup behavior.
144
+
145
+ ## Enforceable evidence at the production freeze
146
+
147
+ The architecture closeout is guarded by checked-in machine-readable evidence,
148
+ not only by this narrative:
149
+
150
+ - exact ownership ratchets: 1,556 `cli-core.ts` lines and 93,322 production
151
+ lines;
152
+ - a separate hard ceiling of 8,000 core lines that cannot be bypassed by
153
+ editing the ratchet to 8,001;
154
+ - zero production functions reaching 500 LOC or c50, with no exception or
155
+ allowlist;
156
+ - 57 domains, 125 modules, 809 edges, zero cycles, and the sole permitted core
157
+ importer;
158
+ - 19 of the immutable 48 included product-test subprocess sites, a 60.42%
159
+ static reduction, while crash, lock, PID/SIGKILL, Gateway, terminal adapter,
160
+ and argv/exit witnesses remain process-backed;
161
+ - a frozen ten-change affected-selector replay with eight targeted and two
162
+ full results; unknown/shared authority still selects full;
163
+ - four public contracts, 65 witnesses, 11 migration mappings, the exact 14
164
+ OpenClaw tools, and five Store protocol witnesses;
165
+ - compiler-AST guards for canonical status ownership, top-level core inventory,
166
+ forbidden owner returns, declarations, and dependency direction.
167
+
168
+ The post-freeze test work preserves rather than weakens those contracts. PR
169
+ #198 batches repeated Git metadata reads and replaces selected wall waits with
170
+ real completion gates. PR #199 expands the canonical 97-test no-rollout file
171
+ into eight worker-isolated shards while preserving the canonical manifest
172
+ entry, test names, assertions, affected selection, and dynamic-evidence source
173
+ identity. PR #200 adds explicitly scoped virtual clocks and direct recording
174
+ terminal/process ports only for sequential deterministic fixtures; real timing,
175
+ process death, concurrency, Gateway, SIGKILL, and terminal-input canaries remain.
176
+ These facts describe test architecture, not final exact-head performance.
177
+
178
+ ## Merged delivery stages
179
+
180
+ Issue #126 was merged incrementally so each authority and durable boundary
181
+ could be reviewed independently:
182
+
183
+ | PR stage | Merged PRs | Main result |
184
+ | --- | --- | --- |
185
+ | Baseline, safety characterization, and transaction foundations | #134-#148 | architecture/evidence baseline, action and binding authority, verified-dead policy, capability repositories, durable JSON/ledger codecs, approval and zero-input safety |
186
+ | Test-loop seams and bounded infrastructure extraction | #149-#162 | in-process command seam with retained real boundaries, installer/doctor adapters, atomic ledger I/O, lifecycle reconciliation, acceptance and runtime evidence |
187
+ | Vertical application services | #163-#174 | callback preparation, monitor decisions/application/reconciliation, dispatch application, lifecycle query/mutation/recovery, authority projection, deferred foreground recovery, dynamic subprocess evidence |
188
+ | Typed CLI and repository facades | #175-#186 | list/file-lock/terminal-command facades, dispatch repository/recovery, runtime providers, acceptance, identity, prerequisites, lifecycle, deferred handoff, callback, and native transition composition |
189
+ | Secondary facade and OpenClaw closeout | #187-#192 | delegate, monitor state, maintenance, monitor supervision, status facts/facade, and OpenClaw plugin split |
190
+ | Enforceable architecture closure | #193-#197 | affected-selector gate, 60% static subprocess gate, zero-allowlist function gate, 1,556-line final core, typed-boundary/docs freeze |
191
+ | Merged test-only performance remediation | #198-#200 | fast fixture cleanup, canonical no-rollout sharding, and scoped integration virtual-clock/direct-provider fixtures |
192
+
193
+ The production source freeze is the result of #197. The last row is deliberately
194
+ outside production ownership: the diff from #197 through #200 contains no
195
+ `src/**` path.
196
+
197
+ Two additional performance experiments are **not merged** and are not part of
198
+ the production freeze or acceptance evidence:
199
+
200
+ - `refactor/126-control-stale-direct@3ffa179312888ad7db97fdb74bb1001bd53beaef`;
201
+ - the `refactor/126-callback-transport-profile` callback experiment.
202
+
203
+ Results or local edits from either branch must not be quoted as main-branch
204
+ behavior, included in final metrics, or installed into OpenClaw.
205
+
206
+ ## Pending exact-SHA validation and installation evidence
207
+
208
+ The final point-in-time evidence will be recorded in an Issue #126 comment tied
209
+ to one exact clean SHA. That comment, rather than this architecture report,
210
+ will carry:
211
+
212
+ - fast, integration, and full profiles each run three times from the same final
213
+ clean SHA on the same host with Node 24.18.0, concurrency four, and one shared
214
+ warm cache, together with their raw reports;
215
+ - the final full-suite median comparison, without changing production timing
216
+ windows or default concurrency;
217
+ - the dynamic subprocess attestation from one clean baseline full run and one
218
+ clean current full run, together with its retained real-process boundaries;
219
+ - the exactly-once local OpenClaw install command and installer verification;
220
+ - installed source, runtime, manifest, and skill hashes matched to the exact
221
+ repository SHA;
222
+ - exactly one Gateway restart, readiness and smoke results, plus confirmation
223
+ that the protected user development process was not touched.
224
+
225
+ Until that comment exists and its reports pass, this report makes no statement
226
+ that the full tier is at or below 180 seconds and no statement that installation
227
+ has completed.
228
+
229
+ ## Longitudinal measurements remain uncollected
230
+
231
+ Issue #126 is already closed for the implementation refactor and will not be
232
+ reopened by this closeout. Real post-refactor history has not yet established
233
+ the four longitudinal measurements originally listed in the issue:
234
+
235
+ 1. at least 70% of normal product changes avoid `cli-core.ts`;
236
+ 2. at least 80% of normal affected-test loops finish within 60 seconds;
237
+ 3. five post-refactor product changes reduce median ready-to-release lead time
238
+ by at least 40%; and
239
+ 4. repeated full-suite flaky failures remain below 1%.
240
+
241
+ The ten-change selector replay and any one exact-head profile are useful point
242
+ evidence, but neither substitutes for these samples. The final closeout freezes
243
+ the implementation and records these measurements as follow-up observations;
244
+ it does not claim that they have been achieved.
245
+
246
+ For the detailed extraction chronology and measurement definitions, see
247
+ [orchestration-refactor.md](./orchestration-refactor.md) and
248
+ [orchestration-baseline.json](./orchestration-baseline.json).