@xingular/harness 1.0.0 → 1.2.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 (397) hide show
  1. package/CHANGELOG.md +46 -5
  2. package/README.md +75 -21
  3. package/dist/cli.js +17421 -8711
  4. package/dist/sdk/accounts/accounts.d.ts +27 -3
  5. package/dist/sdk/accounts/accounts.js +78 -24
  6. package/dist/sdk/accounts/secrets.d.ts +12 -0
  7. package/dist/sdk/accounts/secrets.js +114 -7
  8. package/dist/sdk/accounts/store.d.ts +26 -1
  9. package/dist/sdk/accounts/store.js +1 -1
  10. package/dist/sdk/agents/builtin.d.ts +2 -0
  11. package/dist/sdk/agents/builtin.js +48 -0
  12. package/dist/sdk/agents/narrow.d.ts +13 -0
  13. package/dist/sdk/agents/narrow.js +29 -0
  14. package/dist/sdk/agents/planResearch.d.ts +5 -0
  15. package/dist/sdk/agents/planResearch.js +19 -0
  16. package/dist/sdk/agents/profiles.d.ts +81 -0
  17. package/dist/sdk/agents/profiles.js +226 -0
  18. package/dist/sdk/annotations/bridge.d.ts +42 -0
  19. package/dist/sdk/annotations/bridge.js +264 -0
  20. package/dist/sdk/annotations/capture.d.ts +116 -0
  21. package/dist/sdk/annotations/capture.js +308 -0
  22. package/dist/sdk/annotations/delivery.d.ts +72 -0
  23. package/dist/sdk/annotations/delivery.js +130 -0
  24. package/dist/sdk/annotations/inspect.d.ts +10 -0
  25. package/dist/sdk/annotations/inspect.js +33 -0
  26. package/dist/sdk/annotations/isolated.d.ts +6 -0
  27. package/dist/sdk/annotations/isolated.js +51 -0
  28. package/dist/sdk/annotations/pageScript.d.ts +28 -0
  29. package/dist/sdk/annotations/pageScript.js +871 -0
  30. package/dist/sdk/annotations/part.d.ts +10 -0
  31. package/dist/sdk/annotations/part.js +155 -0
  32. package/dist/sdk/annotations/queue.d.ts +4 -0
  33. package/dist/sdk/annotations/queue.js +40 -0
  34. package/dist/sdk/annotations/serverMethods.d.ts +3 -0
  35. package/dist/sdk/annotations/serverMethods.js +62 -0
  36. package/dist/sdk/annotations/store.d.ts +167 -0
  37. package/dist/sdk/annotations/store.js +394 -0
  38. package/dist/sdk/browser/backend.d.ts +16 -0
  39. package/dist/sdk/browser/backend.js +17 -0
  40. package/dist/sdk/browser/contracts.d.ts +19 -0
  41. package/dist/sdk/browser/contracts.js +116 -0
  42. package/dist/sdk/browser/index.d.ts +14 -3
  43. package/dist/sdk/browser/index.js +11 -4
  44. package/dist/sdk/browser/serverMethods.d.ts +3 -0
  45. package/dist/sdk/browser/serverMethods.js +7 -0
  46. package/dist/sdk/browser/session.d.ts +1 -0
  47. package/dist/sdk/browser/session.js +45 -9
  48. package/dist/sdk/browser/tools.d.ts +1 -4
  49. package/dist/sdk/browser/tools.js +14 -91
  50. package/dist/sdk/cli.js +24 -15
  51. package/dist/sdk/commands/list.d.ts +3 -0
  52. package/dist/sdk/commands/list.js +75 -0
  53. package/dist/sdk/commands/registry.d.ts +250 -0
  54. package/dist/sdk/commands/registry.js +47 -0
  55. package/dist/sdk/commands/routes.d.ts +16 -0
  56. package/dist/sdk/commands/routes.js +33 -0
  57. package/dist/sdk/core/bus.js +1 -1
  58. package/dist/sdk/core/commandBudget.d.ts +23 -0
  59. package/dist/sdk/core/commandBudget.js +57 -0
  60. package/dist/sdk/core/env.d.ts +1 -1
  61. package/dist/sdk/core/env.js +1 -1
  62. package/dist/sdk/core/index.js +17 -1
  63. package/dist/sdk/core/interactiveProfile.d.ts +46 -0
  64. package/dist/sdk/core/interactiveProfile.js +143 -0
  65. package/dist/sdk/core/workspace.d.ts +13 -0
  66. package/dist/sdk/core/workspace.js +88 -0
  67. package/dist/sdk/core/workspaceBashTool.d.ts +4 -0
  68. package/dist/sdk/core/workspaceBashTool.js +36 -0
  69. package/dist/sdk/core/workspaceSandbox.d.ts +31 -0
  70. package/dist/sdk/core/workspaceSandbox.js +320 -0
  71. package/dist/sdk/core/workspaceWriteOperations.d.ts +22 -0
  72. package/dist/sdk/core/workspaceWriteOperations.js +206 -0
  73. package/dist/sdk/doctor/serverMethods.d.ts +3 -0
  74. package/dist/sdk/doctor/serverMethods.js +8 -0
  75. package/dist/sdk/doctor/types.d.ts +2 -2
  76. package/dist/sdk/harness.d.ts +22 -0
  77. package/dist/sdk/harness.js +84 -5
  78. package/dist/sdk/history/recall.js +8 -8
  79. package/dist/sdk/history/serverMethods.d.ts +3 -0
  80. package/dist/sdk/history/serverMethods.js +8 -0
  81. package/dist/sdk/hub/cli.d.ts +1 -1
  82. package/dist/sdk/hub/cli.js +1 -1
  83. package/dist/sdk/hub/schema.d.ts +1 -1
  84. package/dist/sdk/hub/serverMethods.d.ts +3 -0
  85. package/dist/sdk/hub/serverMethods.js +11 -0
  86. package/dist/sdk/index.d.ts +16 -1
  87. package/dist/sdk/index.js +10 -0
  88. package/dist/sdk/mcp/connections.js +14 -7
  89. package/dist/sdk/mcp/serverMethods.d.ts +3 -0
  90. package/dist/sdk/mcp/serverMethods.js +22 -0
  91. package/dist/sdk/pi/runtime.d.ts +2 -1
  92. package/dist/sdk/pi/runtime.js +2 -2
  93. package/dist/sdk/plugins/builtin.d.ts +1 -0
  94. package/dist/sdk/plugins/builtin.js +145 -33
  95. package/dist/sdk/plugins/builtinRegistry.d.ts +60 -0
  96. package/dist/sdk/plugins/builtinRegistry.js +71 -0
  97. package/dist/sdk/plugins/catalogue.js +2 -1
  98. package/dist/sdk/plugins/cli.d.ts +1 -1
  99. package/dist/sdk/plugins/cli.js +4 -3
  100. package/dist/sdk/plugins/commandPrefix.d.ts +8 -0
  101. package/dist/sdk/plugins/commandPrefix.js +21 -0
  102. package/dist/sdk/plugins/firstParty.d.ts +1 -1
  103. package/dist/sdk/plugins/firstParty.js +8 -2
  104. package/dist/sdk/plugins/inventory.js +4 -3
  105. package/dist/sdk/plugins/manifest.d.ts +2 -0
  106. package/dist/sdk/plugins/manifest.js +2 -1
  107. package/dist/sdk/plugins/surfaces.d.ts +5 -0
  108. package/dist/sdk/plugins/surfaces.js +11 -0
  109. package/dist/sdk/plugins/types.d.ts +15 -0
  110. package/dist/sdk/prompt/compile.d.ts +19 -2
  111. package/dist/sdk/prompt/compile.js +79 -26
  112. package/dist/sdk/prompt/standard.d.ts +17 -0
  113. package/dist/sdk/prompt/standard.js +21 -0
  114. package/dist/sdk/refine/cli.d.ts +1 -1
  115. package/dist/sdk/refine/cli.js +2 -2
  116. package/dist/sdk/refine/serverMethods.d.ts +3 -0
  117. package/dist/sdk/refine/serverMethods.js +20 -0
  118. package/dist/sdk/server/methods.js +27 -86
  119. package/dist/sdk/server/params.d.ts +4 -0
  120. package/dist/sdk/server/params.js +11 -0
  121. package/dist/sdk/server/remote.js +36 -11
  122. package/dist/sdk/sessions/compactionCheckpoint.d.ts +11 -0
  123. package/dist/sdk/sessions/compactionCheckpoint.js +79 -0
  124. package/dist/sdk/sessions/continuation.d.ts +3 -0
  125. package/dist/sdk/sessions/continuation.js +5 -1
  126. package/dist/sdk/sessions/contracts.d.ts +185 -0
  127. package/dist/sdk/sessions/contracts.js +101 -4
  128. package/dist/sdk/sessions/control.d.ts +72 -0
  129. package/dist/sdk/sessions/control.js +158 -0
  130. package/dist/sdk/sessions/initialBash.d.ts +7 -0
  131. package/dist/sdk/sessions/initialBash.js +7 -0
  132. package/dist/sdk/sessions/planMode.d.ts +18 -4
  133. package/dist/sdk/sessions/planMode.js +82 -16
  134. package/dist/sdk/sessions/reasoningSummaries.d.ts +2 -2
  135. package/dist/sdk/sessions/reasoningSummaries.js +3 -3
  136. package/dist/sdk/sessions/registry.d.ts +2 -1
  137. package/dist/sdk/sessions/registry.js +6 -3
  138. package/dist/sdk/sessions/runIndex.js +7 -7
  139. package/dist/sdk/sessions/runStore.d.ts +14 -0
  140. package/dist/sdk/sessions/runStore.js +38 -1
  141. package/dist/sdk/sessions/runner.d.ts +40 -2
  142. package/dist/sdk/sessions/runner.js +163 -15
  143. package/dist/sdk/sessions/sessions.d.ts +40 -8
  144. package/dist/sdk/sessions/sessions.js +279 -27
  145. package/dist/sdk/sessions/sideQuestionServerMethods.d.ts +3 -0
  146. package/dist/sdk/sessions/sideQuestionServerMethods.js +19 -0
  147. package/dist/sdk/sessions/sideQuestions.d.ts +66 -0
  148. package/dist/sdk/sessions/sideQuestions.js +290 -0
  149. package/dist/sdk/sessions/subagentServerMethods.d.ts +3 -0
  150. package/dist/sdk/sessions/subagentServerMethods.js +41 -0
  151. package/dist/sdk/sessions/subagentService.d.ts +22 -2
  152. package/dist/sdk/sessions/subagentService.js +93 -16
  153. package/dist/sdk/sessions/subagents.d.ts +9 -1
  154. package/dist/sdk/sessions/subagents.js +19 -0
  155. package/dist/sdk/sessions/workSlice.d.ts +103 -0
  156. package/dist/sdk/sessions/workSlice.js +297 -0
  157. package/dist/sdk/sessions/workspaceBoundary.d.ts +15 -0
  158. package/dist/sdk/sessions/workspaceBoundary.js +46 -0
  159. package/dist/sdk/terminal/browser.d.ts +62 -0
  160. package/dist/sdk/terminal/browser.js +41 -0
  161. package/dist/sdk/terminal/browserControl.d.ts +29 -0
  162. package/dist/sdk/terminal/browserControl.js +187 -0
  163. package/dist/sdk/terminal/commandHelp.d.ts +17 -0
  164. package/dist/sdk/terminal/commandHelp.js +20 -0
  165. package/dist/sdk/terminal/controller.d.ts +15 -1
  166. package/dist/sdk/terminal/controller.js +67 -8
  167. package/dist/sdk/terminal/opentui/subagentsWidget.d.ts +28 -0
  168. package/dist/sdk/terminal/opentui/subagentsWidget.js +52 -0
  169. package/dist/sdk/terminal/opentui/theme.d.ts +43 -0
  170. package/dist/sdk/terminal/opentui/theme.js +87 -0
  171. package/dist/sdk/terminal/piExtension.d.ts +6 -1
  172. package/dist/sdk/terminal/piExtension.js +169 -84
  173. package/dist/sdk/terminal/socket.d.ts +6 -3
  174. package/dist/sdk/terminal/socket.js +40 -9
  175. package/dist/sdk/terminal/standalone.d.ts +9 -0
  176. package/dist/sdk/terminal/standalone.js +118 -19
  177. package/dist/sdk/terminal/subagentMonitor.d.ts +47 -0
  178. package/dist/sdk/terminal/subagentMonitor.js +152 -0
  179. package/dist/sdk/terminal/terminals.d.ts +60 -7
  180. package/dist/sdk/terminal/terminals.js +598 -47
  181. package/dist/sdk/terminal/trajectory.js +2 -2
  182. package/dist/sdk/terminal/tui/annotateCommand.d.ts +3 -0
  183. package/dist/sdk/terminal/tui/annotateCommand.js +22 -0
  184. package/dist/sdk/terminal/tui/commandPages.d.ts +7 -1
  185. package/dist/sdk/terminal/tui/commandPages.js +57 -6
  186. package/dist/sdk/terminal/tui/commands.d.ts +10 -4
  187. package/dist/sdk/terminal/tui/commands.js +269 -65
  188. package/dist/sdk/terminal/tui/dialogGeometry.d.ts +2 -2
  189. package/dist/sdk/terminal/tui/dialogGeometry.js +4 -2
  190. package/dist/sdk/terminal/tui/dialogs.d.ts +6 -1
  191. package/dist/sdk/terminal/tui/dialogs.js +9 -2
  192. package/dist/sdk/terminal/tui/list.d.ts +14 -1
  193. package/dist/sdk/terminal/tui/list.js +96 -14
  194. package/dist/sdk/terminal/tui/modelPicker.js +1 -6
  195. package/dist/sdk/terminal/tui/page.d.ts +3 -0
  196. package/dist/sdk/terminal/tui/pageOverlay.js +27 -7
  197. package/dist/sdk/terminal/tui/pages/accountsPage.d.ts +26 -4
  198. package/dist/sdk/terminal/tui/pages/accountsPage.js +264 -36
  199. package/dist/sdk/terminal/tui/pages/agentsPage.d.ts +74 -0
  200. package/dist/sdk/terminal/tui/pages/agentsPage.js +190 -0
  201. package/dist/sdk/terminal/tui/pages/annotatePage.d.ts +94 -0
  202. package/dist/sdk/terminal/tui/pages/annotatePage.js +341 -0
  203. package/dist/sdk/terminal/tui/pages/browserPage.d.ts +87 -0
  204. package/dist/sdk/terminal/tui/pages/browserPage.js +738 -0
  205. package/dist/sdk/terminal/tui/pages/doctorPage.d.ts +2 -0
  206. package/dist/sdk/terminal/tui/pages/doctorPage.js +103 -15
  207. package/dist/sdk/terminal/tui/pages/notesPage.d.ts +75 -0
  208. package/dist/sdk/terminal/tui/pages/notesPage.js +201 -0
  209. package/dist/sdk/terminal/tui/pages/pluginsPage.d.ts +0 -5
  210. package/dist/sdk/terminal/tui/pages/pluginsPage.js +9 -3
  211. package/dist/sdk/terminal/tui/pages/settingsPage.d.ts +8 -0
  212. package/dist/sdk/terminal/tui/pages/settingsPage.js +16 -1
  213. package/dist/sdk/terminal/tui/pages/subagentsPage.d.ts +24 -0
  214. package/dist/sdk/terminal/tui/pages/subagentsPage.js +152 -0
  215. package/dist/sdk/terminal/tui/pages/trajectoryPage.d.ts +12 -5
  216. package/dist/sdk/terminal/tui/pages/trajectoryPage.js +156 -83
  217. package/dist/sdk/terminal/tui/pages/usagePage.d.ts +43 -0
  218. package/dist/sdk/terminal/tui/pages/usagePage.js +370 -0
  219. package/dist/sdk/terminal/tui/pages/worktreesPage.d.ts +72 -0
  220. package/dist/sdk/terminal/tui/pages/worktreesPage.js +203 -0
  221. package/dist/sdk/terminal/tui/piAdapter.d.ts +1 -2
  222. package/dist/sdk/terminal/tui/piAdapter.js +3 -5
  223. package/dist/sdk/terminal/tui/planMode.d.ts +1 -1
  224. package/dist/sdk/terminal/tui/planMode.js +1 -1
  225. package/dist/sdk/terminal/tui/pluginCommands.d.ts +16 -0
  226. package/dist/sdk/terminal/tui/pluginCommands.js +31 -0
  227. package/dist/sdk/terminal/tui/questions.d.ts +2 -0
  228. package/dist/sdk/terminal/tui/runtime.js +27 -5
  229. package/dist/sdk/terminal/tui/sessionPicker.d.ts +40 -0
  230. package/dist/sdk/terminal/tui/sessionPicker.js +141 -0
  231. package/dist/sdk/terminal/tui/settingsModel.d.ts +2 -0
  232. package/dist/sdk/terminal/tui/settingsModel.js +32 -2
  233. package/dist/sdk/terminal/tui/sideQuestion.d.ts +26 -26
  234. package/dist/sdk/terminal/tui/sideQuestion.js +131 -98
  235. package/dist/sdk/terminal/tui/ui.d.ts +2 -0
  236. package/dist/sdk/terminal/tui/ui.js +1 -0
  237. package/dist/sdk/tools/askUser.js +26 -8
  238. package/dist/sdk/tools/checklist.js +3 -2
  239. package/dist/sdk/tools/checkpoint.d.ts +27 -0
  240. package/dist/sdk/tools/checkpoint.js +154 -0
  241. package/dist/sdk/tools/getCapabilities.d.ts +31 -0
  242. package/dist/sdk/tools/getCapabilities.js +34 -0
  243. package/dist/sdk/tools/harnessTools.d.ts +2 -0
  244. package/dist/sdk/tools/harnessTools.js +1 -1
  245. package/dist/sdk/tools/spawnSubagent.js +14 -4
  246. package/dist/sdk/usage/analytics.d.ts +20 -0
  247. package/dist/sdk/usage/analytics.js +151 -0
  248. package/dist/sdk/usage/ledger.d.ts +38 -0
  249. package/dist/sdk/usage/ledger.js +142 -0
  250. package/dist/sdk/usage/limits/adapters.d.ts +11 -0
  251. package/dist/sdk/usage/limits/adapters.js +349 -0
  252. package/dist/sdk/usage/limits/capture.d.ts +8 -0
  253. package/dist/sdk/usage/limits/capture.js +47 -0
  254. package/dist/sdk/usage/limits/http.d.ts +12 -0
  255. package/dist/sdk/usage/limits/http.js +51 -0
  256. package/dist/sdk/usage/limits/normalize.d.ts +15 -0
  257. package/dist/sdk/usage/limits/normalize.js +211 -0
  258. package/dist/sdk/usage/limits/service.d.ts +30 -0
  259. package/dist/sdk/usage/limits/service.js +176 -0
  260. package/dist/sdk/usage/limits/types.d.ts +65 -0
  261. package/dist/sdk/usage/limits/types.js +1 -0
  262. package/dist/sdk/usage/serverMethods.d.ts +3 -0
  263. package/dist/sdk/usage/serverMethods.js +22 -0
  264. package/dist/sdk/usage/service.d.ts +32 -0
  265. package/dist/sdk/usage/service.js +66 -0
  266. package/dist/sdk/usage/settings.d.ts +7 -0
  267. package/dist/sdk/usage/settings.js +28 -0
  268. package/dist/sdk/usage/types.d.ts +60 -0
  269. package/dist/sdk/usage/types.js +4 -0
  270. package/dist/sdk/web/part.d.ts +10 -0
  271. package/dist/sdk/web/part.js +6 -0
  272. package/dist/sdk/web/serverMethods.d.ts +3 -0
  273. package/dist/sdk/web/serverMethods.js +7 -0
  274. package/dist/sdk/wiki/serverMethods.d.ts +3 -0
  275. package/dist/sdk/wiki/serverMethods.js +26 -0
  276. package/dist/sdk/worktrees/cli.d.ts +11 -0
  277. package/dist/sdk/worktrees/cli.js +146 -0
  278. package/dist/sdk/worktrees/copy.d.ts +9 -0
  279. package/dist/sdk/worktrees/copy.js +111 -0
  280. package/dist/sdk/worktrees/git.d.ts +16 -0
  281. package/dist/sdk/worktrees/git.js +81 -0
  282. package/dist/sdk/worktrees/serverMethods.d.ts +3 -0
  283. package/dist/sdk/worktrees/serverMethods.js +30 -0
  284. package/dist/sdk/worktrees/service.d.ts +73 -0
  285. package/dist/sdk/worktrees/service.js +483 -0
  286. package/dist/sdk/worktrees/setup.d.ts +23 -0
  287. package/dist/sdk/worktrees/setup.js +65 -0
  288. package/dist/sdk/worktrees/types.d.ts +91 -0
  289. package/dist/sdk/worktrees/types.js +1 -0
  290. package/dist/sdk/world/cli.d.ts +2 -2
  291. package/dist/sdk/world/cli.js +6 -6
  292. package/dist/sdk/world/world.d.ts +3 -1
  293. package/dist/sdk/world/world.js +8 -9
  294. package/dist/terminal-opentui.js +16456 -5966
  295. package/dist/terminal-pi.js +1579 -573
  296. package/docs/README.md +22 -2
  297. package/docs/architecture/00-overview.md +28 -16
  298. package/docs/architecture/02-sessions-and-runs.md +184 -25
  299. package/docs/architecture/03-variants.md +10 -2
  300. package/docs/architecture/04-prompt.md +65 -7
  301. package/docs/architecture/06-plugins-and-capabilities.md +57 -4
  302. package/docs/architecture/07-tools-and-gate.md +112 -17
  303. package/docs/architecture/08-memory-and-history.md +4 -2
  304. package/docs/architecture/09-accounts-and-connectors.md +39 -1
  305. package/docs/architecture/10-server-protocol.md +168 -4
  306. package/docs/architecture/11-terminal.md +251 -8
  307. package/docs/architecture/12-storage.md +45 -3
  308. package/docs/architecture/13-world-tools.md +49 -6
  309. package/docs/architecture/14-surfaces-and-parity.md +136 -0
  310. package/docs/architecture/README.md +17 -4
  311. package/docs/architecture/proposals/PROP-0006-run-checklist.md +4 -2
  312. package/docs/architecture/proposals/PROP-0013-resource-browser.md +58 -0
  313. package/docs/architecture/proposals/PROP-0014-fullscreen-browser-tabs.md +58 -0
  314. package/docs/architecture/proposals/PROP-0015-one-capability-surface.md +88 -0
  315. package/docs/architecture/proposals/PROP-0016-managed-worktrees.md +156 -0
  316. package/docs/architecture/proposals/PROP-0017-page-annotations.md +131 -0
  317. package/docs/architecture/proposals/PROP-0018-annotation-queue-and-app-targets.md +179 -0
  318. package/docs/architecture/proposals/PROP-0019-contextual-side-questions.md +122 -0
  319. package/docs/architecture/proposals/PROP-0020-builtin-feature-plugins.md +105 -0
  320. package/docs/architecture/proposals/PROP-0021-command-namespaces-and-duplicates.md +99 -0
  321. package/docs/architecture/proposals/PROP-0022-plan-only-questions.md +102 -0
  322. package/docs/architecture/proposals/PROP-0023-xagent-cli-name.md +61 -0
  323. package/docs/architecture/proposals/PROP-0024-question-sketch-previews.md +130 -0
  324. package/docs/architecture/proposals/PROP-0025-contextual-question-wireframes.md +49 -0
  325. package/docs/architecture/proposals/PROP-0026-connected-sketch-display.md +94 -0
  326. package/docs/architecture/proposals/PROP-0027-xingular-agent-product-identity.md +60 -0
  327. package/docs/architecture/proposals/PROP-0028-normalize-question-wireframes.md +55 -0
  328. package/docs/architecture/proposals/PROP-0029-agent-profiles.md +124 -0
  329. package/docs/architecture/proposals/PROP-0030-subagent-title.md +86 -0
  330. package/docs/architecture/proposals/PROP-0031-plugin-command-owner-namespaces.md +54 -0
  331. package/docs/architecture/proposals/PROP-0032-planning-quality.md +196 -0
  332. package/docs/architecture/proposals/PROP-0033-compaction-plan-checkpoints.md +75 -0
  333. package/docs/architecture/proposals/PROP-0034-conversation-fast-mode.md +120 -0
  334. package/docs/architecture/proposals/PROP-0035-retain-subagent-status.md +47 -0
  335. package/docs/architecture/proposals/PROP-0036-first-class-harness-commands.md +59 -0
  336. package/docs/architecture/proposals/PROP-0037-workspace-write-boundary.md +63 -0
  337. package/docs/architecture/proposals/PROP-0038-annotate-open-shadow-roots.md +73 -0
  338. package/docs/architecture/proposals/PROP-0039-workspace-boundary-hardening.md +139 -0
  339. package/docs/architecture/proposals/PROP-0040-one-launch-path.md +87 -0
  340. package/docs/architecture/proposals/PROP-0041-bounded-work-slices.md +247 -0
  341. package/docs/architecture/proposals/PROP-0042-usage-and-provider-limits.md +127 -0
  342. package/docs/architecture/proposals/PROP-0043-read-only-plan-bash.md +74 -0
  343. package/docs/architecture/proposals/README.md +39 -0
  344. package/docs/decisions/ADR-0001-owned-terminal.md +1 -1
  345. package/docs/decisions/ADR-0009-xharness-command.md +6 -5
  346. package/docs/decisions/ADR-0014-public-release-baseline.md +3 -2
  347. package/docs/decisions/ADR-0015-resource-browser.md +28 -0
  348. package/docs/decisions/ADR-0016-fullscreen-browser-tabs.md +31 -0
  349. package/docs/decisions/ADR-0017-one-capability-surface.md +34 -0
  350. package/docs/decisions/ADR-0018-builtin-feature-plugins.md +35 -0
  351. package/docs/decisions/ADR-0019-managed-git-worktrees.md +31 -0
  352. package/docs/decisions/ADR-0020-page-annotations.md +37 -0
  353. package/docs/decisions/ADR-0021-required-command-namespaces.md +40 -0
  354. package/docs/decisions/ADR-0022-plan-only-question-tools.md +34 -0
  355. package/docs/decisions/ADR-0023-contextual-side-question-runs.md +35 -0
  356. package/docs/decisions/ADR-0024-xagent-command.md +40 -0
  357. package/docs/decisions/ADR-0025-question-choice-sketches.md +49 -0
  358. package/docs/decisions/ADR-0026-contextual-question-wireframes.md +58 -0
  359. package/docs/decisions/ADR-0027-connected-sketch-display.md +60 -0
  360. package/docs/decisions/ADR-0028-xingular-agent-product-identity.md +56 -0
  361. package/docs/decisions/ADR-0029-normalized-question-wireframe-borders.md +33 -0
  362. package/docs/decisions/ADR-0030-agent-profiles.md +43 -0
  363. package/docs/decisions/ADR-0031-plugin-command-owner-namespaces.md +37 -0
  364. package/docs/decisions/ADR-0032-compaction-run-checkpoints.md +33 -0
  365. package/docs/decisions/ADR-0033-plan-mode-research-delegation.md +47 -0
  366. package/docs/decisions/ADR-0034-first-class-harness-terminal-commands.md +25 -0
  367. package/docs/decisions/ADR-0035-one-launch-path.md +40 -0
  368. package/docs/decisions/ADR-0036-workspace-write-operation-boundary.md +54 -0
  369. package/docs/decisions/ADR-0037-usage-ledger-and-provider-limits.md +44 -0
  370. package/docs/decisions/ADR-0038-plan-bash-os-read-only.md +29 -0
  371. package/docs/doctor.md +10 -4
  372. package/docs/experiments/EXP-0003-performance-audit/data/session-runtime-replication.json +420 -0
  373. package/docs/experiments/EXP-0003-performance-audit/data/session-runtime.json +420 -0
  374. package/docs/experiments/EXP-0003-performance-audit/data/terminal-compact.json +376 -0
  375. package/docs/experiments/EXP-0003-performance-audit/data/terminal-history.json +422 -0
  376. package/docs/experiments/EXP-0003-performance-audit/data/terminal-question.json +95 -0
  377. package/docs/experiments/EXP-0003-performance-audit/data/terminal-wide.json +1036 -0
  378. package/docs/experiments/EXP-0003-performance-audit/plan.md +109 -0
  379. package/docs/experiments/EXP-0003-performance-audit/results.md +151 -0
  380. package/docs/features/README.md +26 -0
  381. package/docs/features/interfaces/README.md +1 -1
  382. package/docs/future-work.md +48 -0
  383. package/docs/handoff-2026-10-25-app-parity-and-solo-tabs.md +202 -0
  384. package/docs/parity.md +134 -0
  385. package/docs/releases/1.0.0.md +2 -2
  386. package/docs/releases/1.1.1.md +28 -0
  387. package/docs/releases/1.2.0.md +49 -0
  388. package/docs/releases/4.0.0.md +47 -0
  389. package/docs/releases/README.md +37 -27
  390. package/docs/study/00-index.md +8 -0
  391. package/docs/study/STUDY-0003-long-horizon-runs.md +210 -0
  392. package/docs/study/autonomous-engineering-sources.md +277 -0
  393. package/docs/study/autonomy-sources.md +147 -0
  394. package/docs/study/proactive-autonomy.md +408 -0
  395. package/docs/study/tui-resource-browser.md +78 -0
  396. package/docs/terminal-tui.md +386 -113
  397. package/package.json +6 -5
package/docs/README.md CHANGED
@@ -9,18 +9,38 @@ its pages are descriptive, while the architecture specification remains binding.
9
9
  Current implementation: [Harness terminal frontend](terminal-tui.md). The package-level
10
10
  [README](../README.md) describes the embedding API, accounts, plugins, memory and storage.
11
11
 
12
+ **Parity:** [Capability parity register](parity.md) lists every capability, its terminal surface
13
+ and its host surface ([14 Surfaces and parity](architecture/14-surfaces-and-parity.md) is binding).
14
+
15
+ **Future work:** [Feature backlog](future-work.md) records planned concepts. Backlog entries do not
16
+ change the binding architecture or describe implemented capabilities.
17
+
12
18
  | ID | Record | Type | Status | Related |
13
19
  |---|---|---|---|---|
14
- | ADR-0014 | [Public release baseline](decisions/ADR-0014-public-release-baseline.md) | Decision | Accepted; candidate preparation | [Release procedure](releases/README.md), [PROP-0012](architecture/proposals/PROP-0012-release-baseline.md) |
20
+ | PROP-0026 | [Connect structural sketch lines in the terminal display](architecture/proposals/PROP-0026-connected-sketch-display.md) | Proposal | Implemented; working tree and isolated fixtures verified | [ADR-0027](decisions/ADR-0027-connected-sketch-display.md), [11 Terminal](architecture/11-terminal.md), [parity register](parity.md) |
21
+ | ADR-0027 | [Project structural ASCII sketch lines into connected terminal borders](decisions/ADR-0027-connected-sketch-display.md) | Decision | Accepted; working tree and isolated fixtures verified | [PROP-0026](architecture/proposals/PROP-0026-connected-sketch-display.md), [14 Surfaces and parity](architecture/14-surfaces-and-parity.md) |
22
+ | FW-0001 | [Agent Modes, starting with Router Agent Mode](future-work.md#fw-0001-agent-modes-starting-with-router-agent-mode) | Future work | Candidate; requires architecture proposal before implementation | [Architecture glossary](architecture/README.md#glossary), [Feature guide](features/README.md#planned-agent-modes) |
23
+ | PROP-0025 | [Strict question columns and contextual ASCII wireframes](architecture/proposals/PROP-0025-contextual-question-wireframes.md) | Proposal | Implemented; working tree and isolated fixtures verified | [ADR-0026](decisions/ADR-0026-contextual-question-wireframes.md), [11 Terminal](architecture/11-terminal.md), [parity register](parity.md) |
24
+ | ADR-0026 | [Align question columns and preserve contextual ASCII wireframes](decisions/ADR-0026-contextual-question-wireframes.md) | Decision | Accepted; working tree and isolated fixtures verified | [PROP-0025](architecture/proposals/PROP-0025-contextual-question-wireframes.md), [02 Sessions and runs](architecture/02-sessions-and-runs.md), [11 Terminal](architecture/11-terminal.md) |
25
+ | ADR-0025 | [Store bounded ASCII sketches with question requests](decisions/ADR-0025-question-choice-sketches.md) | Decision | Accepted; working tree implementation verified | [PROP-0024](architecture/proposals/PROP-0024-question-sketch-previews.md) |
26
+ | ADR-0024 | [Publish the Harness CLI as xagent](decisions/ADR-0024-xagent-command.md) | Decision | Accepted; implemented in the 4.0.0 candidate | [PROP-0023](architecture/proposals/PROP-0023-xagent-cli-name.md) |
27
+ | ADR-0020 | [Page annotations and delivery are Harness-owned](decisions/ADR-0020-page-annotations.md) | Decision | Accepted; 4.0.0 candidate | [PROP-0017](architecture/proposals/PROP-0017-page-annotations.md), [PROP-0018](architecture/proposals/PROP-0018-annotation-queue-and-app-targets.md), [parity register](parity.md) |
28
+ | ADR-0019 | [Managed Git worktrees are a Harness capability](decisions/ADR-0019-managed-git-worktrees.md) | Decision | Accepted; 4.0.0 candidate | [PROP-0016](architecture/proposals/PROP-0016-managed-worktrees.md), [parity register](parity.md) |
29
+ | ADR-0018 | [Built-in feature modules and namespaced commands](decisions/ADR-0018-builtin-feature-plugins.md) | Decision | Accepted; 4.0.0 candidate | [PROP-0020](architecture/proposals/PROP-0020-builtin-feature-plugins.md) |
30
+ | ADR-0017 | [One capability surface for the terminal and every host](decisions/ADR-0017-one-capability-surface.md) | Decision | Accepted; implementation in 4.0.0 candidate, App parity gaps tracked | [PROP-0015](architecture/proposals/PROP-0015-one-capability-surface.md), [PROP-0016](architecture/proposals/PROP-0016-managed-worktrees.md), [PROP-0017](architecture/proposals/PROP-0017-page-annotations.md), [parity register](parity.md) |
31
+ | ADR-0016 | [Full-screen browser tabs](decisions/ADR-0016-fullscreen-browser-tabs.md) | Decision | Accepted; working tree verified | [PROP-0014](architecture/proposals/PROP-0014-fullscreen-browser-tabs.md) |
32
+ | ADR-0015 | [Unified resource browser](decisions/ADR-0015-resource-browser.md) | Decision | Accepted; working tree verified | [PROP-0013](architecture/proposals/PROP-0013-resource-browser.md), [source study](study/tui-resource-browser.md) |
33
+ | ADR-0014 | [Public release baseline](decisions/ADR-0014-public-release-baseline.md) | Decision | Accepted; 1.0.0 published; 4.0.0 candidate in preparation | [Release procedure](releases/README.md), [PROP-0012](architecture/proposals/PROP-0012-release-baseline.md) |
15
34
  | ADR-0013 | [Evidence-based diagnostics with opt-in live probes](decisions/ADR-0013-doctor.md) | Decision | Accepted; working tree implementation | [PROP-0011](architecture/proposals/PROP-0011-doctor.md), [Doctor guide](doctor.md) |
16
35
  | SPEC | [Harness architecture specification](architecture/README.md) | Specification | Binding; as of 2026-10-21 | [Proposals](architecture/proposals/README.md), [Known drift](architecture/README.md#known-drift) |
36
+ | STUDY-0002 | [Proactive autonomy: a harness with its own readable agenda](study/proactive-autonomy.md) | Study | Research and three feature hypotheses; not implemented | [Proactive-system sources](study/autonomy-sources.md), [engineering sources](study/autonomous-engineering-sources.md), [known drift D-11](architecture/README.md#known-drift) |
17
37
  | STUDY-0001 | [Agent-harness arm study](study/00-index.md) | Study | Arms 01–10 audited (core sources); matrix + roadmap done; remaining-source fills pending | [insights.md](study/insights.md), [roadmap.md](study/roadmap.md), [`/btw` comparison](study/btw-comparison.md) |
18
38
  | DESIGN-0001 | [System-prompt design: fixed foundation + adapting harness](system-prompt-design.md) | Design | Draft — not yet accepted; refs current `compile.ts`/tree contracts | STUDY-0001 (arms 01, 10), [roadmap.md](study/roadmap.md) T1-1/9 |
19
39
  | EXP-0001 | [Terminal input latency profile](experiments/EXP-0001-terminal-input-latency/plan.md) | Experiment | Completed on one local machine; slow-machine validation pending | ADR-0001, [Profile instructions](terminal-tui.md#input-performance-profile) |
20
40
  | ADR-0012 | [Agents name their own native Pi sessions](decisions/ADR-0012-native-session-names.md) | Decision | Accepted; working tree implementation verified | [PROP-0010](architecture/proposals/PROP-0010-session-names.md) |
21
41
  | ADR-0011 | [The harness is a fixed foundation running a mutating variant](decisions/ADR-0011-foundation-and-variants.md) | Decision | Accepted; implemented in 5.0.0 | [PROP-0009](architecture/proposals/PROP-0009-foundation-and-variants.md), [Foundation and variants](architecture/00-overview.md#foundation-and-variants) |
22
42
  | ADR-0010 | [Lessons from ordinary runs live in the Wiki](decisions/ADR-0010-lessons-in-the-wiki.md) | Decision | Accepted; working tree implementation | [PROP-0008](architecture/proposals/PROP-0008-lessons-from-runs.md), [08 Memory and history](architecture/08-memory-and-history.md), [feature-gap review](study/feature-gap-review.md) |
23
- | ADR-0009 | [Publish the Harness CLI as xharness](decisions/ADR-0009-xharness-command.md) | Decision | Accepted; implementation verified, npm publication pending authorization | [PROP-0005](architecture/proposals/PROP-0005-xharness-cli-name.md), [11 Terminal](architecture/11-terminal.md) |
43
+ | ADR-0009 | [Publish the Harness CLI as xharness](decisions/ADR-0009-xharness-command.md) | Decision | Superseded by ADR-0024 | [PROP-0005](architecture/proposals/PROP-0005-xharness-cli-name.md), [11 Terminal](architecture/11-terminal.md) |
24
44
  | ADR-0007 | [A fixed Reporting section shapes the final reply](decisions/ADR-0007-reporting-section.md) | Decision | Accepted; working tree implementation | [PROP-0001](architecture/proposals/PROP-0001-reporting-section.md), [04 Prompt](architecture/04-prompt.md) |
25
45
  | EXP-0002 | [OpenTUI typing latency against Pi and opencode](experiments/EXP-0002-opentui-typing-latency/plan.md) | Experiment | Completed on one local machine (Apple M2) | ADR-0006, EXP-0001, [Profile instructions](terminal-tui.md#input-performance-profile) |
26
46
  | ADR-0006 | [OpenTUI is the only terminal frontend](decisions/ADR-0006-opentui-only-terminal.md) | Decision | Accepted; working tree implementation | ADR-0001, [Terminal architecture and evidence](terminal-tui.md) |
@@ -11,9 +11,11 @@ of the harness is improved from evidence (refinement). It knows a *caller*, a *s
11
11
  ## Layers
12
12
 
13
13
  ```text
14
- Application (for example the App repo) agents, groups, tasks, projects, worktrees, UI, PTY, keychain
14
+ Host (for example the App repo) presentation, windows, PTY, keychain, native OS bridges, host-only surfaces
15
15
  │ seven extension points (01) and the server protocol (10)
16
- Harness (this package) variants, prompt, sessions, runs, gate, Wiki, history, plugins, MCP, refinement, terminal
16
+ Harness (this package) every capability: variants, prompt, sessions, runs, gate, Wiki, history,
17
+ plugins, MCP, refinement, world tools, worktrees, annotations,
18
+ and the reference terminal frontend
17
19
  │ Pi SDK: createAgentSession, ModelRuntime, SessionManager, DefaultResourceLoader
18
20
  Pi model calls, native JSONL history, tool execution, extensions
19
21
  ```
@@ -21,17 +23,23 @@ Pi model calls, native JSONL history, t
21
23
  - **Pi** supplies the model runtime, native history, tool execution and the extension API.
22
24
  - **The harness** decides everything Pi is given: the account folder, the prompt, the tools, the
23
25
  extensions, skills and prompts it may load, and the gate in front of each tool call. It records
24
- every run.
25
- - **The application** supplies what only it knows, through the extension points, and reads what
26
- the harness records.
26
+ every run. It owns every capability a person uses, and its standalone terminal surfaces each one
27
+ (page 14, `INV-PAR-1`).
28
+ - **A host** presents the same capabilities with its own UI, supplies what only it knows through
29
+ the extension points, and reads what the harness records. The terminal and a host offer the same
30
+ capabilities; a host may add registered host-only surfaces (`INV-PAR-4`).
27
31
 
28
32
  **Belongs in the harness:** Pi sessions and accounts, variants and refinement
29
33
  (Propose–Probe–Compose, selection, the experience library), the prompt compiler and its delivery,
30
34
  project notes (the Wiki), recall, the tool gate and standing approvals, connectors (MCP), terminal
31
- sessions and their owned standalone frontend, generic web/isolated-browser tools, and the server protocol.
35
+ sessions and their owned standalone frontend, generic web/isolated-browser tools, managed git
36
+ worktrees (PROP-0016), page annotations (PROP-0017), and the server protocol.
32
37
 
33
- **Stays in the application:** agents, groups, conversations, tasks and coordination, projects and
34
- worktrees, App browser UI and tab sharing, computer use, windows, the PTY, the keychain, and application UI.
38
+ **Stays in the host:** windows, the PTY, the keychain, native operating-system bridges (a WebKit
39
+ tab, computer control) behind Harness contracts (`INV-PAR-3`), presentation, and registered
40
+ host-only surfaces (`INV-PAR-4`). Orchestration across agents (organizations, routed chats, group
41
+ chats, delegated work queues) is not a Harness capability; a host that wants it must first bring it
42
+ here through a proposal, with a terminal surface.
35
43
 
36
44
  This package is consumed as source by the App's sidecar and is meant to be embedded by other
37
45
  applications, so a change here changes every application built on it.
@@ -102,6 +110,7 @@ opens the data root.
102
110
  | `apps` | `ConnectedApps` | `mcp/service.ts` | 09 |
103
111
  | `hub` | `Hub` | `hub/hub.ts` | 09 |
104
112
  | `terminals` | `Terminals` | `terminal/terminals.ts` | 11 |
113
+ | `worktrees` | `Worktrees` | `worktrees/service.ts` | 02, 14 |
105
114
  | `bus` | `Bus` (state-changed notices) | `core/bus.ts` | 10 |
106
115
 
107
116
  Modules with no member of their own: `variant/` (functions over the variant store), `prompt/compile.ts`,
@@ -132,18 +141,20 @@ Modules with no member of their own: `variant/` (functions over the variant stor
132
141
  | **V** Verification | Isolated refinement probes and answer-free selection |
133
142
  | **G** Governance | The per-call gate, standing approvals, account pinning, redaction |
134
143
 
135
- The application's column (PTY, worktrees, roles, tasks, review, schedules, UI) is in the parent
136
- `AGENTS.md` and the App's architecture pages.
144
+ The host's column (PTY, windows, native bridges, presentation) is in the parent `AGENTS.md` and
145
+ the App's architecture pages. Page 14 states how the terminal and a host share capabilities.
137
146
 
138
147
  ## Invariants
139
148
 
140
149
  - **INV-BND-1** The harness imports nothing from an application. Application data reaches it only
141
150
  through the extension points (page 01) or the server protocol (page 10).
142
- - **INV-BND-2** The harness names no application and no application concept (agent role, group,
143
- task, pane, worktree, handoff, App browser workspace, computer use) in code paths it reads or text a model or
144
- person sees. Text names the product through `env.productName` (default `Xingular Harness`;
145
- `{product}` in a tool description). Ids such as `agentId`, `projectId` and a variant `scope` are
146
- opaque; names come from `Directory` or `CallerContext.agentName`.
151
+ - **INV-BND-2** The harness names no application or application concept (agent role, group, task,
152
+ pane, handoff, App browser workspace, computer use) in code paths it reads or text a model or
153
+ person sees, except for its canonical product name `Xingular Agent`. Text names the product through
154
+ `env.productName` (default `Xingular Agent`; `{product}` in a tool description); an embedding host
155
+ may supply another product name. Ids such as `agentId`, `projectId` and a variant `scope` are opaque;
156
+ names come from `Directory` or `CallerContext.agentName`. A managed git worktree is a Harness
157
+ object since PROP-0016.
147
158
  - **INV-BND-3** A new need of one application is met by a generic extension point or option,
148
159
  never by a branch on an application's name or concept.
149
160
  - **INV-BND-4** Variants, the prompt compiler and Wiki notes are synchronous (`variant/`, `prompt/`,
@@ -156,4 +167,5 @@ The application's column (PTY, worktrees, roles, tasks, review, schedules, UI) i
156
167
  ## Source map
157
168
 
158
169
  `src/harness.ts`, `src/index.ts` (public exports), `src/core/` (env, caller, bus, errors, fs,
159
- text, index), `src/cli.ts` (command line).
170
+ text, index), `src/cli.ts` (command line). Boundary decisions: [PROP-0015](proposals/PROP-0015-one-capability-surface.md),
171
+ [ADR-0017](../decisions/ADR-0017-one-capability-surface.md).
@@ -13,10 +13,12 @@ records everything the run does as validated events.
13
13
  |---|---|---|
14
14
  | `Sessions` | `sessions/sessions.ts` | Starts a turn: `run(input: SessionRunInput)`, `provide(provider)`. Builds the gate. |
15
15
  | `runTurn`, `piSessionFactory`, `loadResources` | `sessions/runner.ts` | Opens the Pi session, loads resources in a fixed order, streams events, settles the run. |
16
+ | compaction checkpoint | `sessions/compactionCheckpoint.ts` | Restores the active request's bounded goal, checklist and plan instructions to model context after compaction. |
16
17
  | `RunRegistry`, `ActiveRun` | `sessions/registry.ts` | Live runs: `emit`, `requestApproval`, `requestAnswer(s)`, `onInterrupt`, `onSteer`, `finish`; `listen` for observers. |
17
18
  | run store functions | `sessions/runStore.ts` | `saveRun`, `updateRun`, `persistEvent`, `appendEvent`, `readEvents`, `markInterruptedRuns`, `runFamily`, `listRuns`. |
18
19
  | `RunRecord`, `RunEvent`, schemas | `sessions/contracts.ts` | The one contract every session shares. |
19
20
  | `Subagents` | `sessions/subagentService.ts` | `spawn`, `wait`, `results`, delivery receipts, recovery. |
21
+ | `SideQuestions` | `sessions/sideQuestions.ts` | Starts, reads and interrupts independent tool-free runs using bounded context from the main conversation (PROP-0019). |
20
22
  | plan mode | `sessions/planMode.ts` | `planSection`, `planRefusal`, `PLAN_READ_ONLY_TOOLS`. |
21
23
  | `Approvals` | `sessions/approvals.ts` | Standing approvals (page 07). |
22
24
  | history selection | `sessions/history.ts` | `selectHistory`: which native history file a run continues. |
@@ -26,15 +28,18 @@ records everything the run does as validated events.
26
28
 
27
29
  1. Validate the input (`run.id`, `sessionId`, `text`; an `initialBashCommand` only on a new
28
30
  interactive user turn).
29
- 2. Select the native history (`selectHistory`) and resolve the account (`accounts.resolve`).
31
+ 2. Resolve a continuation when requested; reuse its pinned root or derive one from its recorded
32
+ working directory. For a new run, resolve and pin the root from the effective `cwd` (after
33
+ worktree selection). Select the native history (`selectHistory`) and resolve the account
34
+ (`accounts.resolve`).
30
35
  3. Resolve the caller's capabilities, intersect with any narrower requested set, and **freeze**
31
36
  them for the run (`capabilities/runSnapshot.ts::freezeRun`).
32
37
  4. **Pin** the variant once (`variant/materialise.ts::materialise`).
33
38
  5. `saveRun` with status `queued`, the account, `harnessScope` and `harnessVersion`.
34
39
  6. Compile the prompt (`sessionLaunch`, page 04): a stable system prompt and an optional context
35
40
  update.
36
- 7. `runs.start` the live run; build the tool list (broker, harness tools, `ask_user`, subagent
37
- tools, provider tools) and the gate.
41
+ 7. `runs.start` the live run; build the tool list (broker, Harness tools including read-only
42
+ `get_capabilities`, the plan-eligible `ask_user`, subagent tools, provider tools) and the gate.
38
43
  8. Open Pi through the `SessionFactory`, with resources loaded in order: disk extensions chosen by
39
44
  the harness, variant extensions, inline extensions, and the gate last.
40
45
  9. Record `nativeSessionId`, register the run with `Subagents`, start `runTurn`, and return
@@ -53,6 +58,24 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
53
58
  `reaction.added`, `agent.message`, `checklist.updated`, `artifact.added`, `file.changed`, `usage.updated`,
54
59
  `account.status`, `status.changed`, `failed`, `completed`. Each has a payload schema in
55
60
  `runEventPayloadSchemas`.
61
+ - **Workspace root** (`RunRecord.workspaceRoot`) is the canonical root whose filesystem effects
62
+ native writes and default-scope Bash may modify: the nearest Git repository or worktree above its
63
+ effective working directory, otherwise that canonical directory. New runs pin it; continuations
64
+ reuse it. Older records may omit it, in which case a continuation derives it from the recorded
65
+ `workingDirectory`. The filesystem root itself cannot be selected as a workspace, because it
66
+ would collapse the write boundary. Native writes revalidate the target and atomically replace it
67
+ inside an OS write scope; Bash scans for external hard-link aliases and runs in the same pinned
68
+ boundary (page 07).
69
+ - **Question sketches** (PROP-0025, ADR-0026; originally PROP-0024, ADR-0025). `question.requested` may include `uiSketch: true`
70
+ and `sketch` text on each choice. If enabled, every choice must have a sketch; otherwise no
71
+ choice may carry one. A sketch is 1–24 LF-separated lines, at most 80 printable ASCII characters
72
+ per line (1,943 bytes maximum), with at least one visible character. Tabs, CR, other controls,
73
+ escape sequences and non-ASCII text are rejected. Whitespace, including interior blank lines and
74
+ trailing spaces, is preserved literally in the persisted request event. Tool guidance requests
75
+ contextual UI wireframes with actual panel/table structure and neighboring elements, consistent
76
+ across alternatives; generation quality is guidance, not a schema guarantee. Old events remain
77
+ valid without a data rewrite; readers with the old bounds must update before accepting larger
78
+ sketches. `question.answered` and `QuestionAnswer` are unchanged.
56
79
  - **Checklist** (PROP-0006): `checklist.updated` carries the whole list the model last wrote with
57
80
  `checklist_write`, `{ items: { text, status: pending | in_progress | completed }[] }`, at most 50
58
81
  items. The latest event replaces every earlier one; `checklistOf(events)` reads it.
@@ -61,14 +84,49 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
61
84
  application: stored and returned, and only `mode` and `trigger` are read.
62
85
  - **Triggers the harness reads:** `user` (may carry an initial Bash command), `probe` and
63
86
  `improver` (refinement, page 05), `reflection` (lessons, page 08). Runs with the last three are
64
- never asked about: the gate refuses what would need a person.
87
+ never asked about: the gate refuses what would need a person, and they receive no question tool.
88
+ Only attended plan runs may newly receive `ask_user`.
89
+ - **Side questions** (PROP-0019). `sideQuestions.start` creates a separate run with trigger and
90
+ relation `side-question`, a fresh native history, the selected account/model/effort, no variant,
91
+ and an empty frozen capability set. It combines the parent's persisted effective prompt and
92
+ public run events with the surface's visible transcript and selected references, after redaction
93
+ and fixed bounds. Hidden reasoning and attachment bytes are omitted. A supplied parent run must
94
+ belong to the supplied parent session. `sideQuestions.read` and `interrupt` require the side run's
95
+ session id. The run is not a subagent or continuation and never changes the parent.
65
96
  - **Subagents.** `spawn_subagent` / `wait_subagents` for the model; `subagents.spawn`, `wait`,
66
97
  `results` for the host (`sessions.spawnSubagent` is a compatibility alias). Child runs have
67
98
  `relation: 'subagent'` and `parentRunId`. Nesting defaults to 1, at most 3 (`subagentDepth`).
68
- - **Plan mode** (`plan: true`). The tool list is unchanged; the gate refuses everything outside
69
- `PLAN_READ_ONLY_TOOLS`, provider tools marked `readOnly`, and calls a provider marks
70
- `planModeSafe`. The plan instruction arrives as a dynamic section; the reply ends with one
71
- `<proposed_plan>` block.
99
+ The child's record carries `title`, the short name the parent gave it (PROP-0030).
100
+ - **Agent profiles** (PROP-0029). `agent` names a profile: built-in (`worker`, `explorer`),
101
+ `<data root>/agents/<name>.md`, `<project>/.xingular/agents/<name>.md`, or a c5 definition of
102
+ the parent's variant, later sources winning (`agents/profiles.ts`). A profile narrows the
103
+ child's tools and plugins (`agents/narrow.ts`), may choose its variant, model and effort, and
104
+ frames it with a "Your role" section. The child's record carries `profile`; the spawn result
105
+ carries `agent` and any `unavailableTools`. A run that may spawn lists every profile in its
106
+ `subagents` section.
107
+ - **Plan mode** (`plan: true`). The stable system prompt is unchanged. An attended plan run may
108
+ include `ask_user` and `spawn_subagent` / `wait_subagents`, subject to the caller's frozen
109
+ capabilities. Delegation is limited to named profiles whose effective tool and plugin allowlists
110
+ qualify for read-only research; the child inherits plan mode and cannot write, run commands, ask
111
+ the user, use connectors or spawn children. The gate refuses unsafe calls before approvals and the
112
+ subagent service rechecks profile eligibility before launch. Other calls must be in
113
+ `PLAN_READ_ONLY_TOOLS` (including `get_capabilities` when frozen for the run), be provider tools
114
+ marked `readOnly`, or be explicitly classified by `planModeSafe`. Model-issued `bash` is allowed
115
+ and runs in the sandbox's read-only scope: no writes except a discarded temp folder, no network,
116
+ nothing that widens the scope; the gate refuses `outside` requests and `PLAN_BASH_DENIED` commands
117
+ (PROP-0043). The dynamic plan instruction
118
+ requires an opening `Goal` or `Summary`, evidence-grounded findings when useful, and task-scaled
119
+ steps and verification. A small fix stays concise without omitting its
120
+ outcome or check; cross-cutting work uses ordered steps. It uses alternatives only when requested
121
+ or materially useful; contextual `uiSketch` questions clarify real choices.
122
+ The reply ends with one `<proposed_plan>` block.
123
+ - **Compaction checkpoint** (PROP-0033, ADR-0032). After compaction, an active run's model context
124
+ receives a bounded, ephemeral checkpoint with the current user request and the latest validated
125
+ checklist or applicable plan instructions, when either is available to restore. It is re-added to
126
+ each request while that run continues;
127
+ its state is cleared when the run settles or the session branch changes. The message changes no
128
+ tools, permissions, run events or native history. An interrupted run still uses the durable
129
+ checklist and normal continuation path.
72
130
  - **Continuation** (PROP-0007). `continuationOf(root, runId, sessionDir?)` (`runs.continuation`)
73
131
  says whether a stopped run can be continued: `resumable`, a `reason` when not (`not_found`,
74
132
  `active`, `completed`, `no_history`, `history_missing`), the exact native history to reopen,
@@ -77,33 +135,84 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
77
135
  `SessionRunInput.continueFrom` starts a **new** run from it: it reopens that history, records
78
136
  `resumedFromRunId`, pins the same account, variant version and capability set (anything different
79
137
  fails with `continuation_mismatch`; a run that cannot be continued fails with
80
- `continuation_unavailable`), defaults empty text to "Continue from where you stopped.", and adds
138
+ `continuation_unavailable`). If the earlier snapshot includes `ask_user`, an automatic or
139
+ refinement-triggered continuation fails with `continuation_mismatch` rather than narrowing it.
140
+ Empty text defaults to "Continue from where you stopped.", and the new run adds
81
141
  a dynamic `continuation` section (order 26) saying where the earlier run stopped. The next run
82
142
  without `continueFrom` withdraws it. `Recovery.interruptedRunIds` lists the runs `open` marked
83
143
  interrupted.
144
+ - **Worktrees** (PROP-0016). When `run.worktreeId` names a worktree in the Harness registry
145
+ (`worktrees/`), the run works in that worktree's folder (the given `cwd` is replaced), holds a
146
+ lease on it (holder: the session id, with `git worktree lock`) until the run completes, fails or
147
+ is interrupted, and records the id. An id the registry does not know is stored and returned as
148
+ the caller's own field, as before. A terminal session holds its worktree for its whole life.
84
149
  - **Usage** (`usage.updated`). `inputTokens` is uncached input; `cacheReadTokens` and
85
150
  `cacheWriteTokens` are separate; `outputTokens` includes `reasoningTokens`. Totals are
86
151
  cumulative for the run, not the native session. `contextTokens` is the latest request's size.
152
+ The derived usage ledger (`usage_requests`, page 08) copies these requests for
153
+ `/usage:analysis`; run events remain the only source of truth.
154
+ - **Limit snapshots** (`account.status.limits`). A provider reading carries a window or balance,
155
+ its reset, and its source. It is produced by the usage limits service from provider response
156
+ headers or a documented provider endpoint (page 09), stored in the account's state, and never
157
+ inferred from a made-up cap.
158
+ - **Provider reasoning summaries.** For supported Responses API families, when reasoning is
159
+ enabled the runner requests a `detailed` summary and records only the provider's explicit summary
160
+ (bounded to 4,000 characters) in request-level usage. This does not change reasoning effort or
161
+ guarantee a provider will return a summary; raw reasoning is not used as a substitute.
162
+
163
+ ## Session controls and command runs (PROP-0040)
164
+
165
+ `commands/registry.ts` is the browser-safe core command catalogue, shared by front ends.
166
+ `commands.list` combines it with effective plugin, extension, prompt and skill routes (page 10).
167
+ A listed route is not proof that its surface passes acceptance.
168
+
169
+ `sessions/control.ts` owns saved-history operations: tree, navigation without a summary, fork,
170
+ clone, rename, last reply and JSONL export. A `SessionRef` names `sessionDir`, optional
171
+ `sessionFile` and optional `cwd`; the resolved JSONL must be inside that directory. Navigation
172
+ records a `xingular-navigation` entry; choosing a user message returns its text for editing and
173
+ moves before it. Fork and clone create history in an absolute `targetDir`.
174
+
175
+ `SessionRunInput.command` (also `TurnParams.command`) is one of:
176
+
177
+ - `{ name: 'compact', instructions? }`
178
+ - `{ name: 'navigate', entryId, summarize: boolean, instructions? }`
179
+ - `{ name: 'export', path }` (absolute `.html` path)
180
+
181
+ It replaces prompt submission and skips the normal context update. It requires saved history and
182
+ cannot combine with plan mode, continuation, automatic execution, initial Bash or images. It uses
183
+ normal account/variant/capability pins, events and cancellation. Front ends must fence history
184
+ mutations against active work; the current raw saved-history helpers do not themselves establish
185
+ that fence. Stable native entry IDs must connect host transcript projection to navigation/fork,
186
+ not positional message counts. A host can route `/history` to Harness `sessions.navigate` and
187
+ navigate the same saved session; it must not substitute a fork. Shared session catalog registration
188
+ is approved but remains in progress; no completed cross-surface catalog is implied (PAR-008).
87
189
 
88
190
  ## Invariants
89
191
 
90
- - **INV-RUN-1** A run pins one account, one variant version and one capability set when it
91
- starts. None of them changes during the run. A pinned account that cannot be used fails the
92
- run; it is never swapped (`INV-ACC-2`).
192
+ - **INV-RUN-1** A run pins one account, one variant version, one capability set and one canonical
193
+ `workspaceRoot` when it starts. None changes during the run. A continuation reuses the prior
194
+ root, deriving one from `workingDirectory` only for a legacy record without the field. A pinned
195
+ account that cannot be used fails the run; it is never swapped (`INV-ACC-2`). A side-question
196
+ run is the explicit exception for the variant: it pins no variant and uses the fixed Harness
197
+ instruction plus a redacted main-run context projection (PROP-0019).
93
198
  - **INV-RUN-2** A run's capability set is written once (`freezeRun`). A resumed or duplicate launch
94
199
  with a different set fails with `capabilities_frozen`. A child run's set is the intersection of
95
- its parent's and what it asked for; it never widens.
200
+ its parent's, its profile's tools and plugins, and what it asked for; it never widens.
96
201
  - **INV-RUN-3** Every run event is validated against its schema, redacted, persisted, and only then
97
202
  relayed to listeners, in order. An event that arrives after the run settled is kept as evidence
98
203
  and never applied or relayed.
99
204
  - **INV-RUN-4** A restarted harness never restarts model work. On `open`, runs left active are
100
205
  marked `interrupted` unless another live process owns them (`owner.json`). Recovery of a
101
206
  subagent needs the same account, caller, working folder and history branch. Continuing is always
102
- a new run the application asks for with `continueFrom`; it pins the earlier run's account, variant
103
- version and capability set, and the earlier run's record is never reopened.
207
+ a new run with `continueFrom`; it pins the earlier run's account, variant version and capability
208
+ set, and the earlier run's record is never reopened. The application asks for it, or the earlier
209
+ run's work-slice policy does when the reply stopped at its budget (PROP-0041); a run started
210
+ without a person (`automatic`), a plan, a subagent, a session command or a worktree never
211
+ continues itself.
104
212
  - **INV-RUN-5** Unattended runs (`automatic: true`) load no extension found on disk, read no
105
213
  context files, and never ask a person: anything that would need approval is refused. A variant's
106
- own trusted plugins still load.
214
+ own trusted plugins still load, except for side-question runs, which have no variant or plugin
215
+ code and use an empty capability set (PROP-0019).
107
216
  - **INV-RUN-6** Only the harness writes `runs/<id>/`; an application reads it. `run.json`,
108
217
  `events.jsonl`, `owner.json` and `subagents.json` are written only through
109
218
  `sessions/runStore.ts`. Side files are written by their owning module: `context.json`
@@ -112,26 +221,76 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
112
221
  or side file needs a proposal. (See drift D-1.)
113
222
  - **INV-RUN-7** Token accounting follows the usage contract above. Changing what a field means is
114
223
  an architecture change.
115
- - **INV-RUN-8** Plan mode never changes the tool list or the system prompt, so switching it keeps
116
- the cached prefix. Its refusals happen before approvals and no approval can lift them.
224
+ - **INV-RUN-8** Plan mode keeps the stable system prompt but has mode-specific tools: an attended
225
+ plan may include `ask_user`, `spawn_subagent` and `wait_subagents`, subject to the frozen caller
226
+ capabilities; newly resolved normal, automatic, probe, improver and reflection runs omit
227
+ `ask_user`. Plan-mode spawning requires a named profile whose effective explicit tool and plugin
228
+ allowlists qualify for read-only research. The child inherits plan mode and is narrowed to the
229
+ intersection of the parent's frozen capabilities, the profile and the plan research set; it has no
230
+ connectors, user questions, writes, commands or nested subagents. The plan run itself may run
231
+ Bash only in the OS-enforced read-only scope (PROP-0043, ADR-0038). The gate refuses unsafe calls
232
+ before approvals, and the service rechecks before launch. The terminal activates plan-eligible
233
+ tools only for a plan request, then restores its normal set. Provider-cache effects of the tool-list
234
+ difference are not assumed (page 04, `INV-PRM-8`).
117
235
  - **INV-RUN-9** Subagent results reach the parent at native turn boundaries, at most once
118
236
  automatically (typed receipts in native history). A parent joins outstanding children before it
119
237
  completes.
120
238
  - **INV-RUN-10** An initial Bash command is allowed only on a new interactive user turn (not
121
- automatic, plan, resumed, continuing, relation, probe or improver runs), must match the leading `!` command
122
- in the text, and passes the same gate as model-issued Bash.
239
+ automatic, plan, resumed, continuing, relation, probe or improver runs), must match the leading `!`
240
+ command in the text, and passes the same gate as model-issued Bash. It is workspace-scoped by
241
+ default; the explicit terminal syntax `!outside <command>` requests the same human-only,
242
+ pre-execution outside-scope approval as the Bash tool and runs the command at most once.
243
+ - **INV-RUN-11** A side-question run is independent, tool-free and temporary. It receives only a
244
+ bounded, redacted projection of the main run's effective prompt and public events plus the
245
+ surface's visible transcript and selected references. It excludes hidden reasoning and attachment
246
+ bytes, never reads the main native history, and never changes or steers the parent. Its own run
247
+ record and events use the normal store contract (PROP-0019).
248
+ - **INV-RUN-13** A reply is a bounded work slice (PROP-0041). The foundation defaults are 160 tool
249
+ calls, 40 minutes and 320 000 new tokens, whichever comes first. The token count covers new input,
250
+ cache writes and output, never the cached prefix: a few large reads pass any small cap before
251
+ useful work, so the cap is a safety net, not the bound. At the limit the guard ends the slice and
252
+ refuses the next tool call with a request for `checkpoint_write`; a handoff call is never refused,
253
+ including when it is the first call past the limit, and another tool ends the reply. A reply that ends this way is `interrupted` with terminal reason `slice_complete`, and one
254
+ the stall guard ends is `stalled`. The stall guard identifies a call by its name and every
255
+ argument, names a repeated call once and ends the reply on the next repeat, and counts afresh in
256
+ each reply, so a checklist a reply rewrites as its steps complete is not a repeat. A new run
257
+ continues it only up to the policy's slice cap, only
258
+ after a slice that changed a file, passed a check or recorded a finished item, and never after a
259
+ checkpoint that is `blocked`. A run may turn the guard off with `workSlice.enabled: false`, and a
260
+ launch may set `XINGULAR_WORK_SLICE=off` for every run in that process; with it off a reply has no
261
+ boundary — no checkpoint, no continuation, no stall notes — and ends only when the model stops or a
262
+ person interrupts.
263
+ - **INV-RUN-14** A run event stream carries `checkpoint` (the handoff `checkpoint_write` records or
264
+ the harness derives from the run's own evidence when the model wrote none) and `heartbeat`
265
+ (steps, elapsed time, last tool, compactions, slice, and the call budget). A heartbeat older than
266
+ five minutes while the owner process lives marks the run `interrupted` with reason `stalled`; a
267
+ run that never emitted one keeps the 30-minute silence rule. The watchdog never restarts work.
268
+ - **INV-RUN-12** A post-compaction checkpoint is a bounded context projection of the active request,
269
+ the latest validated checklist and applicable plan instructions. It is compiled by
270
+ `prompt/compile.ts`, supplied only to model requests in the active run, and never persists hidden
271
+ reasoning or changes permissions, stable prompt text, native history or run-event schemas. Its
272
+ in-memory state is cleared when the run settles or the active session branch changes
273
+ (PROP-0033, ADR-0032).
123
274
 
124
275
  ## Data
125
276
 
126
- `<data root>/runs/<id>/`: `run.json`, `events.jsonl`, `owner.json`, `subagents.json`,
127
- `context.json`, `caller.json`, `capabilities.json`, `mcp-context.json`. Native history lives in
128
- the session directory the caller passes (`sessionDir`), owned by Pi.
277
+ `<data root>/runs/<id>/`: `run.json` (including the optional, legacy-compatible `workspaceRoot`),
278
+ `events.jsonl`, `owner.json`, `subagents.json`, `context.json`, `caller.json`, `capabilities.json`,
279
+ `mcp-context.json`. Native history lives in
280
+ the session directory the caller passes (`sessionDir`), owned by Pi. Side-question native history
281
+ uses a one-use OS temporary directory, removed when the run settles; its tracked run and events
282
+ remain in the ordinary run store.
129
283
 
130
284
  ## Source map
131
285
 
132
- `src/sessions/*.ts`, `src/capabilities/runSnapshot.ts`, `src/tools/spawnSubagent.ts`.
286
+ `src/sessions/*.ts`, `src/capabilities/runSnapshot.ts`, `src/core/workspaceBashTool.ts`,
287
+ `src/core/workspaceSandbox.ts`, `src/core/workspaceWriteOperations.ts`, `src/tools/spawnSubagent.ts`.
133
288
  Decisions: [ADR-0002](../decisions/ADR-0002-native-subagent-lifecycle.md) (superseded),
134
- [ADR-0003](../decisions/ADR-0003-shared-asynchronous-subagents.md).
289
+ [ADR-0003](../decisions/ADR-0003-shared-asynchronous-subagents.md),
290
+ [ADR-0022](../decisions/ADR-0022-plan-only-question-tools.md),
291
+ [ADR-0023](../decisions/ADR-0023-contextual-side-question-runs.md),
292
+ [ADR-0026](../decisions/ADR-0026-contextual-question-wireframes.md),
293
+ [ADR-0033](../decisions/ADR-0033-plan-mode-research-delegation.md).
135
294
 
136
295
  ## Native session names (PROP-0010)
137
296
 
@@ -26,7 +26,7 @@ The surface is `PI_SURFACE` (`variant/surface.ts`), the one surface this harness
26
26
  | c2 | Guardrails | `guardrails.md` | always (`guardrails`, 40) | context |
27
27
  | c3 | Memory | `memory.md` | always (`memory`, 45) | context |
28
28
  | c4 | Tool guidance | `tool_guidance.md` | always (appended to the `tools` section) | tool interface |
29
- | c5 | Subagents | `sub_agents/<name>/AGENT.md` | own context, listed in `subagents` (64) | orchestration |
29
+ | c5 | Subagents | `sub_agents/<name>/AGENT.md` | own context; instruction-only agent profiles, listed with the other profiles in `subagents` (64, PROP-0029) | orchestration |
30
30
  | c6 | Skills | `skills/<name>/SKILL.md` (+ `scripts/`) | on demand, loaded by Pi as skills | context |
31
31
  | c7 | Scripts | `scripts/<name>.py` or `.mjs` | on demand, listed in `scripts` (66) | tool interface |
32
32
  | c8 | Plugins | `plugins/<name>.ts` | inside the tool loop, as Pi extensions | middleware |
@@ -68,7 +68,8 @@ The surface is `PI_SURFACE` (`variant/surface.ts`), the one surface this harness
68
68
  - **INV-VAR-3** A version is never edited. A change is a new version; `restore` moves the head
69
69
  and appends to `restores.jsonl`.
70
70
  - **INV-VAR-4** A run resolves its variant once and pins it; a child run or later turn uses the same
71
- files even if the head moves.
71
+ files even if the head moves. A child whose agent profile names another variant resolves and
72
+ pins that one when it starts (PROP-0029).
72
73
  - **INV-VAR-5** c8 plugin code loads only when its exact text is trusted (SHA-256 in
73
74
  `variant-plugin-trust.json`). A changed file asks again. The one exception: a refinement probe may
74
75
  run improver-written code for a scope whose person allowed it (`probeCode`), and adopting that
@@ -93,3 +94,10 @@ The surface is `PI_SURFACE` (`variant/surface.ts`), the one surface this harness
93
94
  ## Source map
94
95
 
95
96
  `src/variant/*.ts` (`migrate.ts` renames state written before PROP-0009 on `open`). Method origin: Harness² (`harness2/core/tree.py`, Apache-2.0).
97
+
98
+ ## Terminal inspection
99
+
100
+ The resource browser retains the materialised preparation snapshot and labels it pinned. The
101
+ current scope head is separately labelled latest saved; browsing and comparison never rematerialise
102
+ the head as the running variant. Directory-backed variants remain browse-only. Library additions
103
+ use the existing validated commit door and affect future terminals.
@@ -12,23 +12,41 @@ keeps provider caching effective across turns.
12
12
 
13
13
  | Type / function | Role |
14
14
  |---|---|
15
- | `compile(env, caller, launch, variant)` → `ContextPack` | Builds the ordered, budgeted sections. |
15
+ | `compile(env, caller, launch, variant)` → `ContextPack` | Builds the ordered, budgeted sections, including the configured data-root path in native file guidance. |
16
16
  | `render(env, pack)` → `string` | One string for a session that takes a single prompt. |
17
17
  | `sessionLaunch(env, caller, launch, historyFile, variant)` → `{ system, update, pack }` | SDK sessions: stable prefix plus an update with only the dynamic sections that changed since the last delivered snapshot. |
18
18
  | `deliveredSnapshot(sessionFile)` | Reads the last delivered snapshot on the active history branch; a compaction forces a fresh one. |
19
+ | `renderCompactionCheckpoint` | Compiles a bounded current-request, checklist and plan-state message for post-compaction model requests. |
19
20
  | `saveForSession`, `copyToRun` | Terminal sessions keep the pack they started with and copy it to each run. |
20
21
  | `record`, `load`, `packPath` | The pack each run was given, at `runs/<id>/context.json`. |
21
22
  | `toolGroups`, `fit`, `clip` | The tool manifest by group; cutting text to a budget at a paragraph boundary. |
22
23
 
23
- All in `prompt/compile.ts`. A `ContextPack` holds `sections: Section[]` (each with `id`, `title`,
24
+ Assembly is in `prompt/compile.ts`; shared standard-section data is in `prompt/standard.ts`.
25
+ A `ContextPack` holds `sections: Section[]` (each with `id`, `title`,
24
26
  `body`, `sources`, `budget`, `size`, `cut`), `toolGroups`, `harness` (scope and fingerprint),
25
27
  `profile`, `compiledAt` and `delivery` (`systemSectionIds`, `updatedSectionIds`).
26
28
 
27
29
  ## Section order
28
30
 
29
- `SECTION_ORDER`: `system` 25, `guardrails` 40, `memory` 45, `references` 50, `subagents` 64,
30
- `scripts` 66, `wiki` 80, `tools` 90, `reporting` 95. Application sections sit among them by their `order`; plan
31
- mode uses `plan` at 25. Ties keep insertion order.
31
+ `SECTION_ORDER`: `harnessIdentity` 5, `system` 25, `guardrails` 40, `memory` 45, `references`
32
+ 50, `subagents` 64, `scripts` 66, `wiki` 80, `tools` 90, `reporting` 95. Application sections
33
+ sit among them by their `order`; plan mode uses `plan` at 25. Ties keep insertion order.
34
+ When a run may spawn, the dynamic `subagents` section lists every profile it can start (built-in,
35
+ global, project and variant c5 names) and replaces the variant's own list (PROP-0029). Normal-mode
36
+ guidance in that section explains when delegation is worth its overhead, profile selection,
37
+ self-contained briefs, independent parallel work, and parent ownership of integration. Plan mode
38
+ lists only effective profiles eligible for read-only research and requires a named profile; keeping
39
+ this section dynamic leaves the stable system prompt unchanged across modes. The `tools`
40
+ section has a Progress paragraph whenever `checklist_write` is available: it asks for a checklist
41
+ early and kept current, then requests a final update before the reply. Only fully completed work is
42
+ marked completed; unfinished or blocked steps remain accurate (PROP-0006).
43
+
44
+ The fixed `harness-identity` section says `You are an AI agent running in <productName>.` and uses
45
+ `env.productName` (default `Xingular Agent`). `Launch.standard: { cwd, project?: { name } | null }` requests shared role and working-folder
46
+ sections from `prompt/standard.ts`; the compiler supplies common connections, file and annotation
47
+ guidance for the effective tools. Terminal preparation defaults to standard sections (explicit
48
+ `standard: null` opts out); the host interactive path requests the same sections. Hosts may add
49
+ attributed add-on and task context, not a duplicate standard role or connection policy (PROP-0040).
32
50
 
33
51
  Budgets (characters): variant sections 30,000 each (already capped at save, so never cut here);
34
52
  references 12,000; Wiki pointer 2,500; tools 8,000; reporting 2,000; application sections their
@@ -61,10 +79,33 @@ compile ──► pack ──► stable sections ──► system prompt (+ "Con
61
79
  `dynamic: true`.
62
80
  - An update lists only the dynamic sections that changed, and announces a withdrawn one.
63
81
  `references` is always resent when present, because it belongs to the current request.
82
+ - After successful compaction, the foundation checkpoint extension detects the compacted context and
83
+ uses `renderCompactionCheckpoint` to append one hidden, ephemeral context message to each model
84
+ request while the active run continues, when a checklist or applicable plan instructions exist.
85
+ It contains only the current request and available state. It is not written to native history, and its state is
86
+ discarded when the run settles or the branch changes.
64
87
  - The session appends the update as a hidden custom message and saves its snapshot in the
65
88
  message details (`xingularContext`); recording a pack does not mark it delivered.
66
89
  - Terminal sessions use `compile` + `render` once, pass it as `--append-system-prompt`, and keep
67
90
  that pack for the life of the session.
91
+ - Native file guidance states that absolute and `~` paths work for reads when the operating
92
+ system permits access, names the configured data root, and describes the working folder as a
93
+ default location. Native writes and Bash filesystem effects default to the run's pinned project
94
+ or worktree root; outside file targets require one-call approval, and Bash is sandboxed unless
95
+ the eligible user explicitly enables Full Permission. Edits and commands remain subject to the
96
+ gate.
97
+ - A side-question launch attributes its fixed no-tool instruction to the `side-questions` plugin.
98
+ Its launch suppresses tool guidance entirely. The main run's effective prompt and current context
99
+ update are included in the separately bounded, redacted context message (PROP-0019).
100
+
101
+ ## Launch parity status (2026-11-19)
102
+
103
+ Shared section generation is present in source; `surfaceParity.test.ts` checks compiler equality.
104
+ That does not verify actual prepared launches, registered schemas, credentials, variant pins or
105
+ provider-cache reuse. PROP-0040 also requires one Harness-owned interactive default for roots,
106
+ variant scope and credential backend. Adoption and runtime acceptance remain in progress; explicit
107
+ roots/scopes and continuation pins take precedence. Matching `--data` alone cannot reconcile a
108
+ file SecretStore with a host Keychain. See [parity](../parity.md).
68
109
 
69
110
  ## Invariants
70
111
 
@@ -77,11 +118,28 @@ compile ──► pack ──► stable sections ──► system prompt (+ "Con
77
118
  - **INV-PRM-4** An update carries only changed dynamic sections, so an unchanged turn appends
78
119
  nothing. A compaction on the active branch forces the full snapshot again.
79
120
  - **INV-PRM-5** The pack only describes tools the caller can call (the frozen capability set).
121
+ `ask_user` is not part of the compiler's tool-group manifest; its mode-specific availability is
122
+ resolved with the run's callable tools (page 02).
80
123
  - **INV-PRM-6** Each run's pack is recorded beside the run. Failing to record it never fails the
81
124
  session.
82
125
  - **INV-PRM-7** The compiler is synchronous (`INV-BND-4`).
83
- - **INV-PRM-8** Whether a prompt change keeps the provider's cache is measured with real requests
84
- from the application, only with the account owner's permission. Tests do not stand in for it.
126
+ - **INV-PRM-8** Whether a prompt or callable tool-list change keeps the provider's cache is measured
127
+ with real requests from the application, only with the account owner's permission. Tests do not
128
+ stand in for it.
129
+ - **INV-PRM-9** Native file guidance describes the boundary accurately: absolute and `~` paths
130
+ are valid for read-only file tools, which remain bounded by OS permissions rather than the
131
+ workspace root. Native file writes and Bash filesystem effects are workspace-scoped by default;
132
+ the working folder itself is not the boundary. Side-question runs with no callable tools omit
133
+ tool guidance.
134
+ - **INV-PRM-10** Compaction checkpoints are assembled by this compiler, bounded, and delivered only
135
+ as ephemeral context while their active run continues. They do not change the stable system prompt
136
+ or native history, and do not carry hidden reasoning (PROP-0033, ADR-0032). A work-slice handoff is
137
+ the same kind of bounded projection: the `checkpoint` event is rendered into the continuation
138
+ section by `continuationBody`, never into the system prompt (PROP-0041).
139
+ - **INV-PRM-11** The Progress group names `checkpoint_write` when it is in the frozen capability
140
+ set, with the same budget as the other tool guidance, and says only that a bounded reply records a
141
+ handoff when its budget is reached. It does not describe the limits themselves, which the guard
142
+ states at the boundary.
85
143
 
86
144
  ## Relation to DESIGN-0001
87
145