@xingular/harness 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/CHANGELOG.md +33 -5
  2. package/README.md +70 -19
  3. package/dist/cli.js +10321 -5785
  4. package/dist/sdk/agents/builtin.d.ts +2 -0
  5. package/dist/sdk/agents/builtin.js +34 -0
  6. package/dist/sdk/agents/narrow.d.ts +13 -0
  7. package/dist/sdk/agents/narrow.js +29 -0
  8. package/dist/sdk/agents/profiles.d.ts +80 -0
  9. package/dist/sdk/agents/profiles.js +221 -0
  10. package/dist/sdk/annotations/bridge.d.ts +42 -0
  11. package/dist/sdk/annotations/bridge.js +264 -0
  12. package/dist/sdk/annotations/capture.d.ts +116 -0
  13. package/dist/sdk/annotations/capture.js +308 -0
  14. package/dist/sdk/annotations/delivery.d.ts +72 -0
  15. package/dist/sdk/annotations/delivery.js +130 -0
  16. package/dist/sdk/annotations/inspect.d.ts +10 -0
  17. package/dist/sdk/annotations/inspect.js +33 -0
  18. package/dist/sdk/annotations/isolated.d.ts +6 -0
  19. package/dist/sdk/annotations/isolated.js +51 -0
  20. package/dist/sdk/annotations/pageScript.d.ts +28 -0
  21. package/dist/sdk/annotations/pageScript.js +570 -0
  22. package/dist/sdk/annotations/part.d.ts +10 -0
  23. package/dist/sdk/annotations/part.js +144 -0
  24. package/dist/sdk/annotations/queue.d.ts +4 -0
  25. package/dist/sdk/annotations/queue.js +40 -0
  26. package/dist/sdk/annotations/serverMethods.d.ts +3 -0
  27. package/dist/sdk/annotations/serverMethods.js +62 -0
  28. package/dist/sdk/annotations/store.d.ts +160 -0
  29. package/dist/sdk/annotations/store.js +386 -0
  30. package/dist/sdk/browser/index.d.ts +14 -3
  31. package/dist/sdk/browser/index.js +11 -4
  32. package/dist/sdk/browser/serverMethods.d.ts +3 -0
  33. package/dist/sdk/browser/serverMethods.js +7 -0
  34. package/dist/sdk/browser/session.d.ts +1 -0
  35. package/dist/sdk/browser/session.js +45 -9
  36. package/dist/sdk/cli.js +19 -11
  37. package/dist/sdk/core/bus.js +1 -1
  38. package/dist/sdk/core/env.d.ts +1 -1
  39. package/dist/sdk/core/env.js +1 -1
  40. package/dist/sdk/doctor/serverMethods.d.ts +3 -0
  41. package/dist/sdk/doctor/serverMethods.js +8 -0
  42. package/dist/sdk/harness.d.ts +15 -0
  43. package/dist/sdk/harness.js +44 -5
  44. package/dist/sdk/history/recall.js +8 -8
  45. package/dist/sdk/history/serverMethods.d.ts +3 -0
  46. package/dist/sdk/history/serverMethods.js +8 -0
  47. package/dist/sdk/hub/cli.d.ts +1 -1
  48. package/dist/sdk/hub/cli.js +1 -1
  49. package/dist/sdk/hub/schema.d.ts +1 -1
  50. package/dist/sdk/hub/serverMethods.d.ts +3 -0
  51. package/dist/sdk/hub/serverMethods.js +11 -0
  52. package/dist/sdk/index.d.ts +10 -0
  53. package/dist/sdk/index.js +7 -0
  54. package/dist/sdk/mcp/connections.js +14 -7
  55. package/dist/sdk/mcp/serverMethods.d.ts +3 -0
  56. package/dist/sdk/mcp/serverMethods.js +22 -0
  57. package/dist/sdk/plugins/builtin.d.ts +1 -0
  58. package/dist/sdk/plugins/builtin.js +128 -33
  59. package/dist/sdk/plugins/builtinRegistry.d.ts +53 -0
  60. package/dist/sdk/plugins/builtinRegistry.js +49 -0
  61. package/dist/sdk/plugins/cli.d.ts +1 -1
  62. package/dist/sdk/plugins/cli.js +4 -3
  63. package/dist/sdk/prompt/compile.d.ts +5 -2
  64. package/dist/sdk/prompt/compile.js +25 -8
  65. package/dist/sdk/refine/cli.d.ts +1 -1
  66. package/dist/sdk/refine/cli.js +2 -2
  67. package/dist/sdk/refine/serverMethods.d.ts +3 -0
  68. package/dist/sdk/refine/serverMethods.js +20 -0
  69. package/dist/sdk/server/methods.js +9 -86
  70. package/dist/sdk/server/params.d.ts +4 -0
  71. package/dist/sdk/server/params.js +11 -0
  72. package/dist/sdk/sessions/contracts.d.ts +17 -0
  73. package/dist/sdk/sessions/contracts.js +42 -3
  74. package/dist/sdk/sessions/planMode.d.ts +5 -2
  75. package/dist/sdk/sessions/planMode.js +12 -3
  76. package/dist/sdk/sessions/reasoningSummaries.d.ts +2 -2
  77. package/dist/sdk/sessions/reasoningSummaries.js +3 -3
  78. package/dist/sdk/sessions/registry.d.ts +1 -0
  79. package/dist/sdk/sessions/registry.js +4 -1
  80. package/dist/sdk/sessions/runIndex.js +7 -7
  81. package/dist/sdk/sessions/runStore.js +3 -1
  82. package/dist/sdk/sessions/runner.js +2 -2
  83. package/dist/sdk/sessions/sessions.d.ts +17 -5
  84. package/dist/sdk/sessions/sessions.js +79 -12
  85. package/dist/sdk/sessions/sideQuestionServerMethods.d.ts +3 -0
  86. package/dist/sdk/sessions/sideQuestionServerMethods.js +19 -0
  87. package/dist/sdk/sessions/sideQuestions.d.ts +66 -0
  88. package/dist/sdk/sessions/sideQuestions.js +290 -0
  89. package/dist/sdk/sessions/subagentServerMethods.d.ts +3 -0
  90. package/dist/sdk/sessions/subagentServerMethods.js +41 -0
  91. package/dist/sdk/sessions/subagentService.d.ts +13 -2
  92. package/dist/sdk/sessions/subagentService.js +34 -16
  93. package/dist/sdk/sessions/subagents.d.ts +9 -1
  94. package/dist/sdk/sessions/subagents.js +19 -0
  95. package/dist/sdk/terminal/browser.d.ts +62 -0
  96. package/dist/sdk/terminal/browser.js +41 -0
  97. package/dist/sdk/terminal/browserControl.d.ts +29 -0
  98. package/dist/sdk/terminal/browserControl.js +186 -0
  99. package/dist/sdk/terminal/commandHelp.d.ts +17 -0
  100. package/dist/sdk/terminal/commandHelp.js +20 -0
  101. package/dist/sdk/terminal/controller.d.ts +7 -1
  102. package/dist/sdk/terminal/controller.js +34 -2
  103. package/dist/sdk/terminal/opentui/subagentsWidget.d.ts +28 -0
  104. package/dist/sdk/terminal/opentui/subagentsWidget.js +52 -0
  105. package/dist/sdk/terminal/piExtension.js +33 -48
  106. package/dist/sdk/terminal/socket.d.ts +6 -3
  107. package/dist/sdk/terminal/socket.js +40 -9
  108. package/dist/sdk/terminal/standalone.d.ts +2 -0
  109. package/dist/sdk/terminal/standalone.js +50 -10
  110. package/dist/sdk/terminal/subagentMonitor.d.ts +38 -0
  111. package/dist/sdk/terminal/subagentMonitor.js +121 -0
  112. package/dist/sdk/terminal/terminals.d.ts +42 -6
  113. package/dist/sdk/terminal/terminals.js +359 -18
  114. package/dist/sdk/terminal/trajectory.js +2 -2
  115. package/dist/sdk/terminal/tui/annotateCommand.d.ts +3 -0
  116. package/dist/sdk/terminal/tui/annotateCommand.js +22 -0
  117. package/dist/sdk/terminal/tui/commandPages.d.ts +5 -1
  118. package/dist/sdk/terminal/tui/commandPages.js +54 -6
  119. package/dist/sdk/terminal/tui/commands.d.ts +8 -4
  120. package/dist/sdk/terminal/tui/commands.js +181 -58
  121. package/dist/sdk/terminal/tui/dialogGeometry.d.ts +2 -2
  122. package/dist/sdk/terminal/tui/dialogGeometry.js +4 -2
  123. package/dist/sdk/terminal/tui/dialogs.d.ts +6 -1
  124. package/dist/sdk/terminal/tui/dialogs.js +9 -2
  125. package/dist/sdk/terminal/tui/modelPicker.js +1 -6
  126. package/dist/sdk/terminal/tui/page.d.ts +3 -0
  127. package/dist/sdk/terminal/tui/pageOverlay.js +17 -6
  128. package/dist/sdk/terminal/tui/pages/accountsPage.d.ts +26 -4
  129. package/dist/sdk/terminal/tui/pages/accountsPage.js +264 -36
  130. package/dist/sdk/terminal/tui/pages/agentsPage.d.ts +74 -0
  131. package/dist/sdk/terminal/tui/pages/agentsPage.js +190 -0
  132. package/dist/sdk/terminal/tui/pages/annotatePage.d.ts +94 -0
  133. package/dist/sdk/terminal/tui/pages/annotatePage.js +341 -0
  134. package/dist/sdk/terminal/tui/pages/browserPage.d.ts +87 -0
  135. package/dist/sdk/terminal/tui/pages/browserPage.js +738 -0
  136. package/dist/sdk/terminal/tui/pages/doctorPage.d.ts +2 -0
  137. package/dist/sdk/terminal/tui/pages/doctorPage.js +103 -15
  138. package/dist/sdk/terminal/tui/pages/notesPage.d.ts +75 -0
  139. package/dist/sdk/terminal/tui/pages/notesPage.js +201 -0
  140. package/dist/sdk/terminal/tui/pages/settingsPage.d.ts +8 -0
  141. package/dist/sdk/terminal/tui/pages/settingsPage.js +16 -1
  142. package/dist/sdk/terminal/tui/pages/subagentsPage.d.ts +23 -0
  143. package/dist/sdk/terminal/tui/pages/subagentsPage.js +70 -0
  144. package/dist/sdk/terminal/tui/pages/trajectoryPage.d.ts +12 -5
  145. package/dist/sdk/terminal/tui/pages/trajectoryPage.js +156 -83
  146. package/dist/sdk/terminal/tui/pages/worktreesPage.d.ts +72 -0
  147. package/dist/sdk/terminal/tui/pages/worktreesPage.js +203 -0
  148. package/dist/sdk/terminal/tui/planMode.d.ts +1 -1
  149. package/dist/sdk/terminal/tui/planMode.js +1 -1
  150. package/dist/sdk/terminal/tui/pluginCommands.d.ts +14 -0
  151. package/dist/sdk/terminal/tui/pluginCommands.js +27 -0
  152. package/dist/sdk/terminal/tui/questions.d.ts +2 -0
  153. package/dist/sdk/terminal/tui/runtime.js +4 -2
  154. package/dist/sdk/terminal/tui/settingsModel.d.ts +2 -0
  155. package/dist/sdk/terminal/tui/settingsModel.js +32 -2
  156. package/dist/sdk/terminal/tui/sideQuestion.d.ts +26 -26
  157. package/dist/sdk/terminal/tui/sideQuestion.js +131 -98
  158. package/dist/sdk/terminal/tui/ui.d.ts +2 -0
  159. package/dist/sdk/terminal/tui/ui.js +1 -0
  160. package/dist/sdk/tools/askUser.js +26 -8
  161. package/dist/sdk/tools/checklist.js +2 -2
  162. package/dist/sdk/tools/harnessTools.d.ts +2 -0
  163. package/dist/sdk/tools/harnessTools.js +1 -1
  164. package/dist/sdk/tools/spawnSubagent.js +13 -4
  165. package/dist/sdk/web/part.d.ts +10 -0
  166. package/dist/sdk/web/part.js +6 -0
  167. package/dist/sdk/web/serverMethods.d.ts +3 -0
  168. package/dist/sdk/web/serverMethods.js +7 -0
  169. package/dist/sdk/wiki/serverMethods.d.ts +3 -0
  170. package/dist/sdk/wiki/serverMethods.js +26 -0
  171. package/dist/sdk/worktrees/cli.d.ts +11 -0
  172. package/dist/sdk/worktrees/cli.js +146 -0
  173. package/dist/sdk/worktrees/copy.d.ts +9 -0
  174. package/dist/sdk/worktrees/copy.js +111 -0
  175. package/dist/sdk/worktrees/git.d.ts +16 -0
  176. package/dist/sdk/worktrees/git.js +81 -0
  177. package/dist/sdk/worktrees/serverMethods.d.ts +3 -0
  178. package/dist/sdk/worktrees/serverMethods.js +30 -0
  179. package/dist/sdk/worktrees/service.d.ts +73 -0
  180. package/dist/sdk/worktrees/service.js +483 -0
  181. package/dist/sdk/worktrees/setup.d.ts +23 -0
  182. package/dist/sdk/worktrees/setup.js +65 -0
  183. package/dist/sdk/worktrees/types.d.ts +91 -0
  184. package/dist/sdk/worktrees/types.js +1 -0
  185. package/dist/sdk/world/cli.d.ts +2 -2
  186. package/dist/sdk/world/cli.js +6 -6
  187. package/dist/sdk/world/world.d.ts +3 -1
  188. package/dist/sdk/world/world.js +8 -9
  189. package/dist/terminal-opentui.js +14540 -7374
  190. package/dist/terminal-pi.js +285 -666
  191. package/docs/README.md +22 -2
  192. package/docs/architecture/00-overview.md +28 -16
  193. package/docs/architecture/02-sessions-and-runs.md +72 -15
  194. package/docs/architecture/03-variants.md +10 -2
  195. package/docs/architecture/04-prompt.md +26 -6
  196. package/docs/architecture/06-plugins-and-capabilities.md +39 -3
  197. package/docs/architecture/07-tools-and-gate.md +21 -6
  198. package/docs/architecture/09-accounts-and-connectors.md +8 -0
  199. package/docs/architecture/10-server-protocol.md +111 -2
  200. package/docs/architecture/11-terminal.md +185 -5
  201. package/docs/architecture/12-storage.md +15 -1
  202. package/docs/architecture/13-world-tools.md +28 -6
  203. package/docs/architecture/14-surfaces-and-parity.md +89 -0
  204. package/docs/architecture/README.md +15 -4
  205. package/docs/architecture/proposals/PROP-0006-run-checklist.md +4 -2
  206. package/docs/architecture/proposals/PROP-0013-resource-browser.md +58 -0
  207. package/docs/architecture/proposals/PROP-0014-fullscreen-browser-tabs.md +58 -0
  208. package/docs/architecture/proposals/PROP-0015-one-capability-surface.md +88 -0
  209. package/docs/architecture/proposals/PROP-0016-managed-worktrees.md +156 -0
  210. package/docs/architecture/proposals/PROP-0017-page-annotations.md +127 -0
  211. package/docs/architecture/proposals/PROP-0018-annotation-queue-and-app-targets.md +179 -0
  212. package/docs/architecture/proposals/PROP-0019-contextual-side-questions.md +122 -0
  213. package/docs/architecture/proposals/PROP-0020-builtin-feature-plugins.md +105 -0
  214. package/docs/architecture/proposals/PROP-0021-command-namespaces-and-duplicates.md +99 -0
  215. package/docs/architecture/proposals/PROP-0022-plan-only-questions.md +102 -0
  216. package/docs/architecture/proposals/PROP-0023-xagent-cli-name.md +61 -0
  217. package/docs/architecture/proposals/PROP-0024-question-sketch-previews.md +130 -0
  218. package/docs/architecture/proposals/PROP-0025-contextual-question-wireframes.md +49 -0
  219. package/docs/architecture/proposals/PROP-0026-connected-sketch-display.md +94 -0
  220. package/docs/architecture/proposals/PROP-0027-xingular-agent-product-identity.md +60 -0
  221. package/docs/architecture/proposals/PROP-0028-normalize-question-wireframes.md +55 -0
  222. package/docs/architecture/proposals/PROP-0029-agent-profiles.md +124 -0
  223. package/docs/architecture/proposals/PROP-0030-subagent-title.md +86 -0
  224. package/docs/architecture/proposals/README.md +25 -0
  225. package/docs/decisions/ADR-0009-xharness-command.md +6 -5
  226. package/docs/decisions/ADR-0014-public-release-baseline.md +3 -2
  227. package/docs/decisions/ADR-0015-resource-browser.md +28 -0
  228. package/docs/decisions/ADR-0016-fullscreen-browser-tabs.md +31 -0
  229. package/docs/decisions/ADR-0017-one-capability-surface.md +34 -0
  230. package/docs/decisions/ADR-0018-builtin-feature-plugins.md +35 -0
  231. package/docs/decisions/ADR-0019-managed-git-worktrees.md +31 -0
  232. package/docs/decisions/ADR-0020-page-annotations.md +37 -0
  233. package/docs/decisions/ADR-0021-required-command-namespaces.md +40 -0
  234. package/docs/decisions/ADR-0022-plan-only-question-tools.md +34 -0
  235. package/docs/decisions/ADR-0023-contextual-side-question-runs.md +35 -0
  236. package/docs/decisions/ADR-0024-xagent-command.md +40 -0
  237. package/docs/decisions/ADR-0025-question-choice-sketches.md +49 -0
  238. package/docs/decisions/ADR-0026-contextual-question-wireframes.md +58 -0
  239. package/docs/decisions/ADR-0027-connected-sketch-display.md +60 -0
  240. package/docs/decisions/ADR-0028-xingular-agent-product-identity.md +56 -0
  241. package/docs/decisions/ADR-0029-normalized-question-wireframe-borders.md +33 -0
  242. package/docs/decisions/ADR-0030-agent-profiles.md +43 -0
  243. package/docs/doctor.md +10 -4
  244. package/docs/features/README.md +26 -0
  245. package/docs/features/interfaces/README.md +1 -1
  246. package/docs/future-work.md +48 -0
  247. package/docs/parity.md +78 -0
  248. package/docs/releases/1.0.0.md +2 -2
  249. package/docs/releases/4.0.0.md +46 -0
  250. package/docs/releases/README.md +20 -15
  251. package/docs/study/00-index.md +5 -0
  252. package/docs/study/autonomous-engineering-sources.md +277 -0
  253. package/docs/study/autonomy-sources.md +147 -0
  254. package/docs/study/proactive-autonomy.md +408 -0
  255. package/docs/study/tui-resource-browser.md +78 -0
  256. package/docs/terminal-tui.md +325 -93
  257. package/package.json +3 -3
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).
@@ -17,6 +17,7 @@ records everything the run does as validated events.
17
17
  | run store functions | `sessions/runStore.ts` | `saveRun`, `updateRun`, `persistEvent`, `appendEvent`, `readEvents`, `markInterruptedRuns`, `runFamily`, `listRuns`. |
18
18
  | `RunRecord`, `RunEvent`, schemas | `sessions/contracts.ts` | The one contract every session shares. |
19
19
  | `Subagents` | `sessions/subagentService.ts` | `spawn`, `wait`, `results`, delivery receipts, recovery. |
20
+ | `SideQuestions` | `sessions/sideQuestions.ts` | Starts, reads and interrupts independent tool-free runs using bounded context from the main conversation (PROP-0019). |
20
21
  | plan mode | `sessions/planMode.ts` | `planSection`, `planRefusal`, `PLAN_READ_ONLY_TOOLS`. |
21
22
  | `Approvals` | `sessions/approvals.ts` | Standing approvals (page 07). |
22
23
  | history selection | `sessions/history.ts` | `selectHistory`: which native history file a run continues. |
@@ -33,8 +34,8 @@ records everything the run does as validated events.
33
34
  5. `saveRun` with status `queued`, the account, `harnessScope` and `harnessVersion`.
34
35
  6. Compile the prompt (`sessionLaunch`, page 04): a stable system prompt and an optional context
35
36
  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.
37
+ 7. `runs.start` the live run; build the tool list (broker, harness tools, the plan-eligible
38
+ `ask_user`, subagent tools, provider tools) and the gate.
38
39
  8. Open Pi through the `SessionFactory`, with resources loaded in order: disk extensions chosen by
39
40
  the harness, variant extensions, inline extensions, and the gate last.
40
41
  9. Record `nativeSessionId`, register the run with `Subagents`, start `runTurn`, and return
@@ -53,6 +54,16 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
53
54
  `reaction.added`, `agent.message`, `checklist.updated`, `artifact.added`, `file.changed`, `usage.updated`,
54
55
  `account.status`, `status.changed`, `failed`, `completed`. Each has a payload schema in
55
56
  `runEventPayloadSchemas`.
57
+ - **Question sketches** (PROP-0025, ADR-0026; originally PROP-0024, ADR-0025). `question.requested` may include `uiSketch: true`
58
+ and `sketch` text on each choice. If enabled, every choice must have a sketch; otherwise no
59
+ choice may carry one. A sketch is 1–24 LF-separated lines, at most 80 printable ASCII characters
60
+ per line (1,943 bytes maximum), with at least one visible character. Tabs, CR, other controls,
61
+ escape sequences and non-ASCII text are rejected. Whitespace, including interior blank lines and
62
+ trailing spaces, is preserved literally in the persisted request event. Tool guidance requests
63
+ contextual UI wireframes with actual panel/table structure and neighboring elements, consistent
64
+ across alternatives; generation quality is guidance, not a schema guarantee. Old events remain
65
+ valid without a data rewrite; readers with the old bounds must update before accepting larger
66
+ sketches. `question.answered` and `QuestionAnswer` are unchanged.
56
67
  - **Checklist** (PROP-0006): `checklist.updated` carries the whole list the model last wrote with
57
68
  `checklist_write`, `{ items: { text, status: pending | in_progress | completed }[] }`, at most 50
58
69
  items. The latest event replaces every earlier one; `checklistOf(events)` reads it.
@@ -61,14 +72,32 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
61
72
  application: stored and returned, and only `mode` and `trigger` are read.
62
73
  - **Triggers the harness reads:** `user` (may carry an initial Bash command), `probe` and
63
74
  `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.
75
+ never asked about: the gate refuses what would need a person, and they receive no question tool.
76
+ Only attended plan runs may newly receive `ask_user`.
77
+ - **Side questions** (PROP-0019). `sideQuestions.start` creates a separate run with trigger and
78
+ relation `side-question`, a fresh native history, the selected account/model/effort, no variant,
79
+ and an empty frozen capability set. It combines the parent's persisted effective prompt and
80
+ public run events with the surface's visible transcript and selected references, after redaction
81
+ and fixed bounds. Hidden reasoning and attachment bytes are omitted. A supplied parent run must
82
+ belong to the supplied parent session. `sideQuestions.read` and `interrupt` require the side run's
83
+ session id. The run is not a subagent or continuation and never changes the parent.
65
84
  - **Subagents.** `spawn_subagent` / `wait_subagents` for the model; `subagents.spawn`, `wait`,
66
85
  `results` for the host (`sessions.spawnSubagent` is a compatibility alias). Child runs have
67
86
  `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.
87
+ The child's record carries `title`, the short name the parent gave it (PROP-0030).
88
+ - **Agent profiles** (PROP-0029). `agent` names a profile: built-in (`worker`, `explorer`),
89
+ `<data root>/agents/<name>.md`, `<project>/.xingular/agents/<name>.md`, or a c5 definition of
90
+ the parent's variant, later sources winning (`agents/profiles.ts`). A profile narrows the
91
+ child's tools and plugins (`agents/narrow.ts`), may choose its variant, model and effort, and
92
+ frames it with a "Your role" section. The child's record carries `profile`; the spawn result
93
+ carries `agent` and any `unavailableTools`. A run that may spawn lists every profile in its
94
+ `subagents` section.
95
+ - **Plan mode** (`plan: true`). The stable system prompt is unchanged. An attended plan run may
96
+ include `ask_user`, subject to the caller's frozen capabilities; the gate refuses everything
97
+ outside `PLAN_READ_ONLY_TOOLS`, provider tools marked `readOnly`, and calls a provider marks
98
+ `planModeSafe`. The plan instruction arrives as a dynamic section; for UI-related plans it asks
99
+ the model to explore distinct design directions, compare trade-offs and recommend one, using
100
+ contextual `uiSketch` questions when helpful. The reply ends with one `<proposed_plan>` block.
72
101
  - **Continuation** (PROP-0007). `continuationOf(root, runId, sessionDir?)` (`runs.continuation`)
73
102
  says whether a stopped run can be continued: `resumable`, a `reason` when not (`not_found`,
74
103
  `active`, `completed`, `no_history`, `history_missing`), the exact native history to reopen,
@@ -77,22 +106,35 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
77
106
  `SessionRunInput.continueFrom` starts a **new** run from it: it reopens that history, records
78
107
  `resumedFromRunId`, pins the same account, variant version and capability set (anything different
79
108
  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
109
+ `continuation_unavailable`). If the earlier snapshot includes `ask_user`, an automatic or
110
+ refinement-triggered continuation fails with `continuation_mismatch` rather than narrowing it.
111
+ Empty text defaults to "Continue from where you stopped.", and the new run adds
81
112
  a dynamic `continuation` section (order 26) saying where the earlier run stopped. The next run
82
113
  without `continueFrom` withdraws it. `Recovery.interruptedRunIds` lists the runs `open` marked
83
114
  interrupted.
115
+ - **Worktrees** (PROP-0016). When `run.worktreeId` names a worktree in the Harness registry
116
+ (`worktrees/`), the run works in that worktree's folder (the given `cwd` is replaced), holds a
117
+ lease on it (holder: the session id, with `git worktree lock`) until the run completes, fails or
118
+ is interrupted, and records the id. An id the registry does not know is stored and returned as
119
+ the caller's own field, as before. A terminal session holds its worktree for its whole life.
84
120
  - **Usage** (`usage.updated`). `inputTokens` is uncached input; `cacheReadTokens` and
85
121
  `cacheWriteTokens` are separate; `outputTokens` includes `reasoningTokens`. Totals are
86
122
  cumulative for the run, not the native session. `contextTokens` is the latest request's size.
123
+ - **Provider reasoning summaries.** For supported Responses API families, when reasoning is
124
+ enabled the runner requests a `detailed` summary and records only the provider's explicit summary
125
+ (bounded to 4,000 characters) in request-level usage. This does not change reasoning effort or
126
+ guarantee a provider will return a summary; raw reasoning is not used as a substitute.
87
127
 
88
128
  ## Invariants
89
129
 
90
130
  - **INV-RUN-1** A run pins one account, one variant version and one capability set when it
91
131
  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`).
132
+ run; it is never swapped (`INV-ACC-2`). A side-question run is the explicit exception for the
133
+ variant: it pins no variant and uses the fixed Harness instruction plus a redacted main-run
134
+ context projection (PROP-0019).
93
135
  - **INV-RUN-2** A run's capability set is written once (`freezeRun`). A resumed or duplicate launch
94
136
  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.
137
+ its parent's, its profile's tools and plugins, and what it asked for; it never widens.
96
138
  - **INV-RUN-3** Every run event is validated against its schema, redacted, persisted, and only then
97
139
  relayed to listeners, in order. An event that arrives after the run settled is kept as evidence
98
140
  and never applied or relayed.
@@ -103,7 +145,8 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
103
145
  version and capability set, and the earlier run's record is never reopened.
104
146
  - **INV-RUN-5** Unattended runs (`automatic: true`) load no extension found on disk, read no
105
147
  context files, and never ask a person: anything that would need approval is refused. A variant's
106
- own trusted plugins still load.
148
+ own trusted plugins still load, except for side-question runs, which have no variant or plugin
149
+ code and use an empty capability set (PROP-0019).
107
150
  - **INV-RUN-6** Only the harness writes `runs/<id>/`; an application reads it. `run.json`,
108
151
  `events.jsonl`, `owner.json` and `subagents.json` are written only through
109
152
  `sessions/runStore.ts`. Side files are written by their owning module: `context.json`
@@ -112,26 +155,40 @@ A session that cannot open ends its run as `failed` and returns `nativeSessionId
112
155
  or side file needs a proposal. (See drift D-1.)
113
156
  - **INV-RUN-7** Token accounting follows the usage contract above. Changing what a field means is
114
157
  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.
158
+ - **INV-RUN-8** Plan mode keeps the stable system prompt but has mode-specific tools: an attended
159
+ plan may include `ask_user`, subject to the frozen caller capabilities; newly resolved normal,
160
+ automatic, probe, improver and reflection runs omit it. The terminal activates `ask_user` and
161
+ `ask_user_question` only for a plan request, then restores its normal set. Plan refusals happen
162
+ before approvals and no approval can lift them. Provider-cache effects of the tool-list difference
163
+ are not assumed (page 04, `INV-PRM-8`).
117
164
  - **INV-RUN-9** Subagent results reach the parent at native turn boundaries, at most once
118
165
  automatically (typed receipts in native history). A parent joins outstanding children before it
119
166
  completes.
120
167
  - **INV-RUN-10** An initial Bash command is allowed only on a new interactive user turn (not
121
168
  automatic, plan, resumed, continuing, relation, probe or improver runs), must match the leading `!` command
122
169
  in the text, and passes the same gate as model-issued Bash.
170
+ - **INV-RUN-11** A side-question run is independent, tool-free and temporary. It receives only a
171
+ bounded, redacted projection of the main run's effective prompt and public events plus the
172
+ surface's visible transcript and selected references. It excludes hidden reasoning and attachment
173
+ bytes, never reads the main native history, and never changes or steers the parent. Its own run
174
+ record and events use the normal store contract (PROP-0019).
123
175
 
124
176
  ## Data
125
177
 
126
178
  `<data root>/runs/<id>/`: `run.json`, `events.jsonl`, `owner.json`, `subagents.json`,
127
179
  `context.json`, `caller.json`, `capabilities.json`, `mcp-context.json`. Native history lives in
128
- the session directory the caller passes (`sessionDir`), owned by Pi.
180
+ the session directory the caller passes (`sessionDir`), owned by Pi. Side-question native history
181
+ uses a one-use OS temporary directory, removed when the run settles; its tracked run and events
182
+ remain in the ordinary run store.
129
183
 
130
184
  ## Source map
131
185
 
132
186
  `src/sessions/*.ts`, `src/capabilities/runSnapshot.ts`, `src/tools/spawnSubagent.ts`.
133
187
  Decisions: [ADR-0002](../decisions/ADR-0002-native-subagent-lifecycle.md) (superseded),
134
- [ADR-0003](../decisions/ADR-0003-shared-asynchronous-subagents.md).
188
+ [ADR-0003](../decisions/ADR-0003-shared-asynchronous-subagents.md),
189
+ [ADR-0022](../decisions/ADR-0022-plan-only-question-tools.md),
190
+ [ADR-0023](../decisions/ADR-0023-contextual-side-question-runs.md),
191
+ [ADR-0026](../decisions/ADR-0026-contextual-question-wireframes.md).
135
192
 
136
193
  ## Native session names (PROP-0010)
137
194
 
@@ -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,7 +12,7 @@ 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. |
@@ -26,9 +26,17 @@ All in `prompt/compile.ts`. A `ContextPack` holds `sections: Section[]` (each wi
26
26
 
27
27
  ## Section order
28
28
 
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.
29
+ `SECTION_ORDER`: `harnessIdentity` 5, `system` 25, `guardrails` 40, `memory` 45, `references`
30
+ 50, `subagents` 64, `scripts` 66, `wiki` 80, `tools` 90, `reporting` 95. Application sections
31
+ sit among them by their `order`; plan mode uses `plan` at 25. Ties keep insertion order.
32
+ When a run may spawn, `subagents` lists every agent profile it can start (built-in, global,
33
+ project and the variant's c5 names) and replaces the variant's own list (PROP-0029). The `tools`
34
+ section has a Progress paragraph whenever `checklist_write` is available: it asks for a checklist
35
+ early and kept current, because the person follows work from it (PROP-0006).
36
+
37
+ The fixed `harness-identity` section says `You are an AI agent running in <productName>.` and uses
38
+ `env.productName` (default `Xingular Agent`). Host-provided identity and role sections remain
39
+ separate, so an embedding application can still describe its agent and task.
32
40
 
33
41
  Budgets (characters): variant sections 30,000 each (already capped at save, so never cut here);
34
42
  references 12,000; Wiki pointer 2,500; tools 8,000; reporting 2,000; application sections their
@@ -65,6 +73,12 @@ compile ──► pack ──► stable sections ──► system prompt (+ "Con
65
73
  message details (`xingularContext`); recording a pack does not mark it delivered.
66
74
  - Terminal sessions use `compile` + `render` once, pass it as `--append-system-prompt`, and keep
67
75
  that pack for the life of the session.
76
+ - Read-only native file guidance states that absolute and `~` paths work when the operating system
77
+ permits access, names the configured data root, and describes the working folder as a default
78
+ location. Edits and commands remain subject to the gate.
79
+ - A side-question launch attributes its fixed no-tool instruction to the `side-questions` plugin.
80
+ Its launch suppresses tool guidance entirely. The main run's effective prompt and current context
81
+ update are included in the separately bounded, redacted context message (PROP-0019).
68
82
 
69
83
  ## Invariants
70
84
 
@@ -77,11 +91,17 @@ compile ──► pack ──► stable sections ──► system prompt (+ "Con
77
91
  - **INV-PRM-4** An update carries only changed dynamic sections, so an unchanged turn appends
78
92
  nothing. A compaction on the active branch forces the full snapshot again.
79
93
  - **INV-PRM-5** The pack only describes tools the caller can call (the frozen capability set).
94
+ `ask_user` is not part of the compiler's tool-group manifest; its mode-specific availability is
95
+ resolved with the run's callable tools (page 02).
80
96
  - **INV-PRM-6** Each run's pack is recorded beside the run. Failing to record it never fails the
81
97
  session.
82
98
  - **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.
99
+ - **INV-PRM-8** Whether a prompt or callable tool-list change keeps the provider's cache is measured
100
+ with real requests from the application, only with the account owner's permission. Tests do not
101
+ stand in for it.
102
+ - **INV-PRM-9** Native file guidance describes the existing OS-permission boundary accurately:
103
+ absolute and `~` paths are valid for read-only file tools; the working folder is not a sandbox.
104
+ Side-question runs with no callable tools omit tool guidance.
85
105
 
86
106
  ## Relation to DESIGN-0001
87
107
 
@@ -17,7 +17,8 @@ callable result for one run.
17
17
  | `Plugins` (`loading`, `loaded`) | `plugins/plugins.ts` | Chooses the paths a session or terminal loads; records what each extension registered. |
18
18
  | discovery | `plugins/discover.ts` | Finds items with Pi's own resolver, which runs no extension code. |
19
19
  | attachments (`load`, `save`, `attached`, `decided`, `set`) | `plugins/attachments.ts` | The one store of what is switched on, per scope. |
20
- | `HARNESS_PLUGINS` | `plugins/builtin.ts` | Descriptors of the harness's own parts: `pi`, `harness`, `subagents`, `wiki`, `history`, `ask-user`, `checklist`, `connected-apps`. |
20
+ | `BuiltinPluginRegistry`, `BuiltinPluginModule` | `plugins/builtinRegistry.ts`, `plugins/builtin.ts` | Registers built-in modules and their descriptors, world parts, server handlers and terminal command metadata. |
21
+ | `HARNESS_PLUGINS` | `plugins/builtin.ts` | Descriptor view of the registered Harness parts and feature plugins. |
21
22
  | `FIRST_PARTY_PLUGINS` | `plugins/firstParty.ts` | `output-trim`, `budget-guard`: inline extensions shipped switched off. `lessons`: switched off; its contribution turns on reflection after a run (page 08, PROP-0008) and loads no Pi code. |
22
23
  | `Hooks` | `plugins/hooks.ts` | Runs a package's hooks file after a write. |
23
24
  | install / trust | `plugins/install.ts`, `plugins/trust.ts` | Install through Pi's package manager with scripts off; trust code by hash. |
@@ -42,7 +43,12 @@ callable result for one run.
42
43
  for everyone, and only a tool marked to run without asking.
43
44
  - **Capability set** (`CapabilitySet`): `{ version: 1, tools, connectors, contributions }`.
44
45
  `capabilities.resolve` returns the set available to a caller; `capabilities.intersect` /
45
- `toolIntersection` narrows it for a child.
46
+ `toolIntersection` narrows it for a child. The required `ask-user` plugin remains attached, but its
47
+ `ask_user` tool is included only for an attended plan run or a continuation pinned with that
48
+ capability. Automatic or refinement-triggered continuations with it are rejected rather than
49
+ weakening the frozen set. The `side-questions` descriptor owns the fixed instruction for the
50
+ restricted side-question run; it has no tools, providers, connectors, subagents or variant code
51
+ (PROP-0019).
46
52
 
47
53
  ## Invariants
48
54
 
@@ -70,8 +76,17 @@ callable result for one run.
70
76
  each delivery. A working folder's package cannot bring a hook.
71
77
  - **INV-PLG-9** Unattended runs load no extension found on disk (`INV-RUN-5`). The harness's own
72
78
  parts are required and refuse to be switched off; switching something on grants no permission.
79
+ A side-question run also has no variant plugin code or tool guidance (PROP-0019).
80
+ - **INV-PLG-10** Every Harness-managed built-in feature is registered by `BuiltinPluginRegistry`.
81
+ Its descriptor, world tools, server handlers and terminal command metadata share one owner. A
82
+ module's world part releases resources through the existing session and Harness lifecycle. This
83
+ registry does not load third-party Pi code or bypass its trust checks.
84
+ - **INV-PLG-11** Built-in plugin categories are a documentation ownership taxonomy. They are not a
85
+ `PluginDescriptor` field, a public response field or a second attachment scope.
73
86
  - **INV-CAP-1** A capability set only narrows. `intersect` never adds access; a run's set is
74
- frozen when it starts (`INV-RUN-2`).
87
+ frozen when it starts (`INV-RUN-2`). An agent profile's `plugins` list keeps only the parent's
88
+ contributions of those plugins (required plugins always stay) and drops the tools they own; it
89
+ never adds one (PROP-0029).
75
90
  - **INV-CAP-2** The capability contract is generic. It names no application task, role or UI
76
91
  concept.
77
92
  - **INV-CAP-3** A capability set says what may be called, not whether a call may run. The gate
@@ -91,3 +106,24 @@ callable result for one run.
91
106
  ## Source map
92
107
 
93
108
  `src/plugins/*.ts`, `src/capabilities/*.ts`, `src/core/changes.ts`.
109
+
110
+ ## Built-in ownership taxonomy (PROP-0020)
111
+
112
+ These categories make ownership visible in docs and source layout. They do not change plugin
113
+ metadata or availability:
114
+
115
+ | Category | Features | Foundation boundary |
116
+ |---|---|---|
117
+ | Foundation | Accounts, sessions and run recording, prompt and variant validation, gate, plugin loading/trust/attachments, resource browser, server and terminal frameworks | Release-owned infrastructure and security contracts |
118
+ | World | Web search/read tools, browser tools, page annotations | The isolated browser engine and network policy remain Foundation services |
119
+ | Memory | Wiki, history and trajectory | Storage and run records remain Foundation-owned services |
120
+ | Automation | Subagents, ask-user, checklist, lessons and refinement | Run lifecycle, capability narrowing and approval gate remain Foundation-owned |
121
+ | Integrations | Connected apps/MCP and Hub | Connector credentials and plugin installation remain behind Foundation services |
122
+ | Operations | Doctor and worktrees | Diagnostics and repository operations remain Harness-managed services |
123
+
124
+ ## Terminal resource inspection
125
+
126
+ The unified browser joins saved plugin/contribution metadata with actual session skills and tool
127
+ registration. A saved on/off state does not prove a resource loaded; origins and owners distinguish
128
+ same-name resources. Protected install/remove, settings, attachment and trust actions call the
129
+ existing services. No second discovery or enablement mechanism is introduced (PROP-0013).
@@ -13,18 +13,28 @@ per-call gate that asks the application's policy, then standing approvals, then
13
13
  | `HarnessToolDefinition`, `RECALL_TOOLS`, `TRAJECTORY_TOOLS`, `WIKI_READ_TOOLS`, `WIKI_WRITE_TOOLS`, `SKILL_TOOLS`, `DEFAULT_TOOL_NAMES` | `tools/definitions.ts` | The harness's own tools, defined once. |
14
14
  | `dispatch` | `tools/dispatch.ts` | One entry point for every History, Wiki and skill call, from a Pi tool, the server or a terminal. |
15
15
  | `harnessTools` | `tools/harnessTools.ts` | The definitions as `ToolSpec`s for one session. |
16
- | `askUserTool` (`ask_user`) | `tools/askUser.ts` | Stops the run and asks a question with choices. |
17
- | `checklistTool` (`checklist_write`) | `tools/checklist.ts` | Writes the run's whole checklist as a `checklist.updated` event (PROP-0006). Read-only for the gate, so plan mode allows it. |
18
- | `subagentTools` | `tools/spawnSubagent.ts` | `spawn_subagent`, `wait_subagents`. |
16
+ | `askUserTool` (`ask_user`) | `tools/askUser.ts` | Stops an attended plan run and asks up to five related questions with choices and concise 1–2 word labels; absent from newly resolved normal runs. |
17
+ | `checklistTool` (`checklist_write`) | `tools/checklist.ts` | Writes the run's whole checklist as a `checklist.updated` event (PROP-0006). Read-only for the gate, so plan mode allows it. Terminal sessions register the same tool; it reaches the run through the `checklist` telemetry call. The prompt's Progress group asks the model to keep it current because the user follows work from it. |
18
+ | `subagentTools` | `tools/spawnSubagent.ts` | `spawn_subagent` (requires a short `title`, PROP-0030), `wait_subagents`. |
19
+ | `annotationsPart` (`page_notes_list`, `page_notes_read`, `page_notes_mark_fixed`) | `annotations/part.ts` | World tools over the page notes a person shared with the session or agent (PROP-0017). `page_notes_mark_fixed` records the agent's claim that it fixed a note it was sent; it never resolves a note or changes grants (PROP-0018). |
19
20
  | `webTools` | `web/tools.ts` | `web_search` (Brave, key from the secret store), `web_fetch` (checked public reads). An application provides them as a provider. |
20
21
  | gate | `sessions/sessions.ts::gate`, `sessions/runner.ts` | `ToolGate { ask, check }`, loaded as the last extension (`xagent-approvals`). |
21
22
  | `Approvals`, `decide`, `grant`, `approvalKey` | `sessions/approvals.ts` | Standing approvals. |
22
23
 
23
24
  Harness tools: `history_search`, `history_read`, `trajectory_search`, `trajectory_read`,
24
25
  `wiki_search`, `wiki_read`, `wiki_list`, `wiki_write` (not in the default set), `skill_load`,
25
- `ask_user`, `checklist_write`. Broker: `mcp_list_tools`, `mcp_call_tool`. Native Pi tools: `read`, `grep`, `find`,
26
+ `ask_user` (attended plan runs and pinned continuations only), `checklist_write`. Broker:
27
+ `mcp_list_tools`, `mcp_call_tool`. Native Pi tools: `read`, `grep`, `find`,
26
28
  `ls`, `edit`, `write`, `bash`.
27
29
 
30
+ ## Native file paths
31
+
32
+ The read-only `read`, `grep`, `find` and `ls` tools accept paths relative to the working folder,
33
+ absolute paths, and `~` paths. The working folder is a default location, not a repository boundary;
34
+ the operating system's access for the Harness process decides what can be read. The compiled file
35
+ guidance names the configured data root. `edit`, `write` and `bash` continue through the existing
36
+ gate and policy. A side-question run has an empty capability set and no tools (PROP-0019).
37
+
28
38
  ## The gate, per call
29
39
 
30
40
  ```text
@@ -56,12 +66,17 @@ the switch and global tools.
56
66
  authorize, then standing approvals, then the person, then authorize again.
57
67
  - **INV-GATE-4** Refinement runs (`probe`, `improver`) never ask a person; what would need one is
58
68
  refused, never queued (`INV-REF-4`).
59
- - **INV-GATE-5** A tool is registered only if its name is in the run's frozen capability set, in
60
- that order (`INV-CAP-1`).
69
+ - **INV-GATE-5** SDK tools are registered only if their names are in the run's frozen capability
70
+ set (`INV-CAP-1`). The terminal may retain question-tool definitions in its private Pi inventory,
71
+ but normal mode deactivates them; a plan request activates only registered questions under its
72
+ plan-mode gate.
61
73
  - **INV-GATE-6** Tool attachment bytes never enter the run-event stream; only references are
62
74
  recorded.
63
75
  - **INV-GATE-7** Tool descriptions name the product with `{product}` (filled by `describeTool`),
64
76
  never an application's name (`INV-BND-2`).
77
+ - **INV-GATE-8** Native read-only file access is bounded by process and operating-system
78
+ permissions, not by the repository root. Absolute and `~` paths are valid inputs. This does not
79
+ change the gate or permissions for writes and commands.
65
80
 
66
81
  ## Data
67
82
 
@@ -88,3 +88,11 @@ labels this local readiness. A selected live model probe sends one synthetic req
88
88
  at 64 tokens, and records usage through the normal run writer. It never substitutes an account.
89
89
  MCP live diagnostics connect and list tools on the selected scoped connector, without calling
90
90
  connector tools or starting sign-in. Disposable grants and clients are closed afterwards.
91
+
92
+ ## Terminal connection setup
93
+
94
+ The unified browser exposes existing connection save/test/sign-in/sign-out/remove services through
95
+ private terminal controls (PROP-0013). New definitions are saved disabled. Saving does not connect,
96
+ sign in or approve tools. Secrets use masked fields and the existing secret store; snapshots omit
97
+ saved credential values and scrub connection errors/tool metadata. Hub documents remain inert until
98
+ a person explicitly chooses setup and completes the normal validated connection form.