@anyswarm/core 0.5.1 → 0.6.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 (301) hide show
  1. package/AGENTS.md +20 -5
  2. package/README.md +69 -55
  3. package/dist/examples/README.md +138 -77
  4. package/dist/examples/authoring/README.md +4 -4
  5. package/dist/examples/autoresearch/README.md +108 -16
  6. package/dist/examples/autoresearch/REQUIREMENTS.zh.md +13 -12
  7. package/dist/examples/autoresearch/config.d.ts +48 -5
  8. package/dist/examples/autoresearch/config.js +57 -23
  9. package/dist/examples/autoresearch/demo.d.ts +12 -4
  10. package/dist/examples/autoresearch/demo.js +65 -22
  11. package/dist/examples/autoresearch/eject.json +2 -0
  12. package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
  13. package/dist/examples/autoresearch/frontiercs2-config.js +14 -0
  14. package/dist/examples/autoresearch/frontiercs2.d.ts +18 -1
  15. package/dist/examples/autoresearch/frontiercs2.js +71 -14
  16. package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
  17. package/dist/examples/autoresearch/prepare-demo.js +46 -0
  18. package/dist/examples/autoresearch/prepare.d.ts +105 -53
  19. package/dist/examples/autoresearch/prepare.js +126 -57
  20. package/dist/examples/autoresearch/project.d.ts +6 -95
  21. package/dist/examples/autoresearch/project.js +131 -45
  22. package/dist/examples/autoresearch/research-service.d.ts +16 -1
  23. package/dist/examples/autoresearch/research-service.js +84 -44
  24. package/dist/examples/code/README.md +25 -17
  25. package/dist/examples/code/REQUIREMENTS.zh.md +3 -3
  26. package/dist/examples/code/config.d.ts +1 -0
  27. package/dist/examples/first-harness/AGENTS.md +25 -0
  28. package/dist/examples/first-harness/README.md +136 -0
  29. package/dist/examples/first-harness/config.d.ts +9 -8
  30. package/dist/examples/first-harness/config.js +33 -26
  31. package/dist/examples/first-harness/eject.json +14 -0
  32. package/dist/examples/first-harness/handoff.js +3 -3
  33. package/dist/examples/first-harness/harness.d.ts +14 -18
  34. package/dist/examples/first-harness/harness.js +102 -77
  35. package/dist/examples/first-harness/input/README.md +7 -0
  36. package/dist/examples/first-harness/session.js +2 -1
  37. package/dist/examples/first-harness/tsconfig.json +2 -1
  38. package/dist/examples/harness-session/README.md +4 -4
  39. package/dist/examples/lead-worker/README.md +1 -1
  40. package/dist/examples/lead-worker/project-config.d.ts +1 -0
  41. package/dist/examples/messages/README.md +2 -2
  42. package/dist/examples/notes/README.md +5 -5
  43. package/dist/examples/notes/config.d.ts +1 -0
  44. package/dist/examples/parallel-swarm/AGENTS.md +32 -0
  45. package/dist/examples/parallel-swarm/README.md +136 -0
  46. package/dist/examples/parallel-swarm/board-service.js +25 -8
  47. package/dist/examples/parallel-swarm/board.d.ts +31 -1
  48. package/dist/examples/parallel-swarm/board.js +98 -13
  49. package/dist/examples/parallel-swarm/config.d.ts +11 -0
  50. package/dist/examples/parallel-swarm/config.js +39 -0
  51. package/dist/examples/parallel-swarm/eject.json +5 -0
  52. package/dist/examples/parallel-swarm/harness.d.ts +26 -20
  53. package/dist/examples/parallel-swarm/harness.js +77 -76
  54. package/dist/examples/parallel-swarm/report.d.ts +12 -0
  55. package/dist/examples/parallel-swarm/report.js +30 -0
  56. package/dist/examples/peermesh/README.md +1 -1
  57. package/dist/examples/peermesh/project-config.d.ts +1 -0
  58. package/dist/examples/services/agent-control/README.md +1 -1
  59. package/dist/examples/services/mathlib-search/README.md +1 -1
  60. package/dist/examples/services/mcp-managed/README.md +1 -1
  61. package/dist/examples/services/persistent-board/README.md +6 -3
  62. package/dist/examples/subagents/AGENTS.md +35 -0
  63. package/dist/examples/subagents/README.md +129 -93
  64. package/dist/examples/subagents/config.d.ts +2 -10
  65. package/dist/examples/subagents/config.js +9 -16
  66. package/dist/examples/subagents/eject.json +17 -0
  67. package/dist/examples/subagents/handoff-config.d.ts +41 -0
  68. package/dist/examples/subagents/handoff-config.js +13 -0
  69. package/dist/examples/subagents/model.d.ts +3 -0
  70. package/dist/examples/subagents/model.js +19 -0
  71. package/dist/examples/substrate/README.md +12 -6
  72. package/dist/examples/substrate/config.d.ts +1 -0
  73. package/dist/examples/substrate/project-config.d.ts +1 -0
  74. package/dist/examples/super/README.md +34 -22
  75. package/dist/examples/super/actions.d.ts +1 -1
  76. package/dist/examples/super/actions.js +11 -11
  77. package/dist/examples/super/config.js +3 -3
  78. package/dist/examples/super/eject.json +1 -1
  79. package/dist/examples/super/location.js +1 -1
  80. package/dist/examples/super/operator.d.ts +1 -0
  81. package/dist/examples/super/operator.js +31 -0
  82. package/dist/examples/super/project.d.ts +0 -107
  83. package/dist/examples/super/project.js +1 -3
  84. package/dist/examples/taskpool/README.md +1 -1
  85. package/dist/examples/taskpool/config.d.ts +1 -0
  86. package/dist/examples/taskpool/deploy/service-hosts/service-authority-snapshot.d.ts +4 -4
  87. package/dist/scripts/anyswarm-arguments.d.ts +7 -25
  88. package/dist/scripts/anyswarm-arguments.js +69 -97
  89. package/dist/scripts/anyswarm-eject.js +1 -1
  90. package/dist/scripts/anyswarm-harnesses.d.ts +0 -1
  91. package/dist/scripts/anyswarm-harnesses.js +1 -22
  92. package/dist/scripts/anyswarm-installation.d.ts +7 -40
  93. package/dist/scripts/anyswarm-installation.js +17 -291
  94. package/dist/scripts/anyswarm-launch.d.ts +6 -36
  95. package/dist/scripts/anyswarm-launch.js +32 -81
  96. package/dist/scripts/anyswarm-progress.d.ts +6 -0
  97. package/dist/scripts/anyswarm-progress.js +133 -0
  98. package/dist/scripts/anyswarm-project.d.ts +1 -9
  99. package/dist/scripts/anyswarm-project.js +40 -127
  100. package/dist/scripts/anyswarm-source-runner.js +9 -41
  101. package/dist/scripts/anyswarm.js +6 -26
  102. package/dist/scripts/build-provenance.json +1 -1
  103. package/dist/scripts/generate-architecture-coverage.js +1 -1
  104. package/dist/scripts/generate-architecture-prompts.js +18 -10
  105. package/dist/scripts/local-environment.d.ts +13 -7
  106. package/dist/scripts/local-environment.js +73 -21
  107. package/dist/scripts/local-setup.d.ts +3 -0
  108. package/dist/scripts/local-setup.js +153 -118
  109. package/dist/scripts/pack-release.js +31 -4
  110. package/dist/src/core/index.js +1 -1
  111. package/dist/src/core/sandbox/opensandbox-backend.js +10 -4
  112. package/dist/src/core/sandbox/sandbox-connection.d.ts +9 -2
  113. package/dist/src/core/sandbox/sandbox-connection.js +22 -7
  114. package/dist/src/core/worker-image.js +1 -1
  115. package/dist/src/harness/project-harness.d.ts +1 -0
  116. package/dist/src/harness/project-harness.js +5 -4
  117. package/dist/src/harness/project-rpc-client.js +19 -0
  118. package/dist/src/harness/project-runtime.js +3 -1
  119. package/dist/src/harness/typescript-loader.d.ts +2 -0
  120. package/dist/src/harness/typescript-loader.js +26 -8
  121. package/dist/src/trace-viewer/command.mjs +6 -3
  122. package/dist/src/trace-viewer/public/app.js +239 -59
  123. package/dist/src/trace-viewer/public/index.html +5 -0
  124. package/dist/src/trace-viewer/public/style.css +22 -0
  125. package/dist/src/trace-viewer/reader.mjs +242 -26
  126. package/dist/src/trace-viewer/run-root.d.mts +1 -0
  127. package/dist/src/trace-viewer/run-root.mjs +7 -0
  128. package/dist/src/trace-viewer/server.mjs +3 -1
  129. package/docs/INDEX.md +11 -9
  130. package/docs/architecture/04-services.md +1 -1
  131. package/docs/architecture/06-observability-experiments.md +21 -7
  132. package/docs/architecture/07-run-configuration.md +118 -19
  133. package/docs/architecture/08-prompts.md +21 -2
  134. package/docs/architecture/10-service-api-reference.md +12 -5
  135. package/docs/architecture/12-code-coverage.md +157 -115
  136. package/docs/architecture/15-core-runtime.md +1 -1
  137. package/docs/architecture/16-pi-opensandbox-backend.md +2 -0
  138. package/docs/architecture/17-harness-reporting.md +79 -1
  139. package/docs/architecture/22-website.md +52 -20
  140. package/docs/architecture/23-project-harness.md +109 -37
  141. package/docs/architecture/26-code.md +20 -5
  142. package/docs/architecture/27-personal.md +23 -8
  143. package/docs/architecture/28-autoresearch.md +18 -12
  144. package/docs/architecture/INDEX.md +1 -2
  145. package/docs/architecture/prompts/11-first-sdk-harness.md +9 -9
  146. package/docs/architecture/prompts/16-parallel-swarm.md +46 -13
  147. package/docs/architecture/prompts/22-autoresearch.md +9 -2
  148. package/docs/architecture/prompts/source-manifest.json +76 -52
  149. package/docs/architecture/source-map.json +445 -105
  150. package/docs/designs/core-harness/01-core.md +2 -2
  151. package/docs/designs/core-harness/06-project-harness.md +3 -3
  152. package/docs/designs/core-harness/README.md +2 -2
  153. package/docs/en/agents.md +1 -1
  154. package/docs/en/autoresearch.md +41 -0
  155. package/docs/en/blog/100b-tokens.md +157 -0
  156. package/docs/en/build-your-harness.md +47 -22
  157. package/docs/en/changelog.md +29 -1
  158. package/docs/en/first-harness.md +40 -32
  159. package/docs/en/harnesses/index.md +23 -23
  160. package/docs/en/harnesses/lead-worker.md +1 -1
  161. package/docs/en/harnesses/peermesh.md +2 -2
  162. package/docs/en/harnesses/subagents.md +10 -31
  163. package/docs/en/harnesses/substrate.md +4 -4
  164. package/docs/en/harnesses/taskpool.md +2 -2
  165. package/docs/en/latest.md +30 -5
  166. package/docs/en/overview.md +22 -22
  167. package/docs/en/quickstart.md +69 -56
  168. package/docs/en/reference/api.md +1 -1
  169. package/docs/en/reference/cli.md +47 -85
  170. package/docs/en/sandbox.md +3 -3
  171. package/docs/en/trace-viewer.md +32 -12
  172. package/docs/operations/trace-viewer.md +26 -11
  173. package/docs/third-party-notices.md +0 -1
  174. package/docs/workflows/development.md +160 -118
  175. package/docs/workflows/release-and-docs-versioning.md +207 -54
  176. package/docs/workflows/release-cli-acceptance.md +162 -0
  177. package/docs/zh/agents.md +1 -1
  178. package/docs/zh/autoresearch.md +41 -0
  179. package/docs/zh/blog/100b-tokens.md +102 -0
  180. package/docs/zh/build-your-harness.md +48 -23
  181. package/docs/zh/changelog.md +29 -1
  182. package/docs/zh/first-harness.md +43 -35
  183. package/docs/zh/harnesses/index.md +23 -23
  184. package/docs/zh/harnesses/lead-worker.md +1 -1
  185. package/docs/zh/harnesses/peermesh.md +2 -2
  186. package/docs/zh/harnesses/subagents.md +10 -31
  187. package/docs/zh/harnesses/substrate.md +4 -4
  188. package/docs/zh/harnesses/taskpool.md +2 -2
  189. package/docs/zh/latest.md +30 -5
  190. package/docs/zh/overview.md +23 -23
  191. package/docs/zh/quickstart.md +66 -57
  192. package/docs/zh/reference/api.md +1 -1
  193. package/docs/zh/reference/cli.md +19 -79
  194. package/docs/zh/sandbox.md +3 -3
  195. package/docs/zh/trace-viewer.md +32 -12
  196. package/examples/README.md +138 -77
  197. package/examples/authoring/README.md +4 -4
  198. package/examples/autoresearch/README.md +108 -16
  199. package/examples/autoresearch/REQUIREMENTS.zh.md +13 -12
  200. package/examples/autoresearch/config.ts +64 -25
  201. package/examples/autoresearch/demo.ts +75 -22
  202. package/examples/autoresearch/eject.json +2 -0
  203. package/examples/autoresearch/frontiercs2-config.ts +15 -0
  204. package/examples/autoresearch/frontiercs2.ts +64 -11
  205. package/examples/autoresearch/prepare-demo.ts +44 -0
  206. package/examples/autoresearch/prepare.ts +134 -60
  207. package/examples/autoresearch/project.ts +120 -44
  208. package/examples/autoresearch/research-service.ts +91 -41
  209. package/examples/code/README.md +25 -17
  210. package/examples/code/REQUIREMENTS.zh.md +3 -3
  211. package/examples/first-harness/AGENTS.md +25 -0
  212. package/examples/first-harness/README.md +136 -0
  213. package/examples/first-harness/config.ts +41 -27
  214. package/examples/first-harness/eject.json +14 -0
  215. package/examples/first-harness/handoff.ts +3 -3
  216. package/examples/first-harness/harness.ts +104 -72
  217. package/examples/first-harness/input/README.md +7 -0
  218. package/examples/first-harness/session.ts +2 -1
  219. package/examples/first-harness/tsconfig.json +2 -1
  220. package/examples/harness-session/README.md +4 -4
  221. package/examples/lead-worker/README.md +1 -1
  222. package/examples/messages/README.md +2 -2
  223. package/examples/notes/README.md +5 -5
  224. package/examples/parallel-swarm/AGENTS.md +32 -0
  225. package/examples/parallel-swarm/README.md +136 -0
  226. package/examples/parallel-swarm/board-service.ts +28 -9
  227. package/examples/parallel-swarm/board.ts +107 -13
  228. package/examples/parallel-swarm/config.ts +47 -0
  229. package/examples/parallel-swarm/eject.json +5 -0
  230. package/examples/parallel-swarm/harness.ts +83 -71
  231. package/examples/parallel-swarm/report.ts +33 -0
  232. package/examples/peermesh/README.md +1 -1
  233. package/examples/services/agent-control/README.md +1 -1
  234. package/examples/services/mathlib-search/README.md +1 -1
  235. package/examples/services/mcp-managed/README.md +1 -1
  236. package/examples/services/persistent-board/README.md +6 -3
  237. package/examples/subagents/AGENTS.md +35 -0
  238. package/examples/subagents/README.md +129 -93
  239. package/examples/subagents/config.ts +9 -15
  240. package/examples/subagents/eject.json +17 -0
  241. package/examples/subagents/handoff-config.ts +14 -0
  242. package/examples/subagents/model.ts +20 -0
  243. package/examples/substrate/README.md +12 -6
  244. package/examples/super/README.md +34 -22
  245. package/examples/super/actions.ts +11 -11
  246. package/examples/super/config.ts +3 -3
  247. package/examples/super/eject.json +1 -1
  248. package/examples/super/location.ts +1 -1
  249. package/examples/super/operator.ts +28 -0
  250. package/examples/super/project.ts +1 -3
  251. package/examples/taskpool/README.md +1 -1
  252. package/npm-shrinkwrap.development.json +46 -1538
  253. package/npm-shrinkwrap.json +10 -43
  254. package/package.development.json +3 -6
  255. package/package.json +3 -5
  256. package/scripts/anyswarm-arguments.ts +67 -96
  257. package/scripts/anyswarm-eject.ts +1 -1
  258. package/scripts/anyswarm-harnesses.ts +1 -18
  259. package/scripts/anyswarm-installation.ts +18 -294
  260. package/scripts/anyswarm-launch.ts +30 -102
  261. package/scripts/anyswarm-progress.ts +125 -0
  262. package/scripts/anyswarm-project.ts +31 -123
  263. package/scripts/anyswarm-source-runner.ts +9 -36
  264. package/scripts/anyswarm.ts +4 -24
  265. package/scripts/generate-architecture-coverage.ts +1 -1
  266. package/scripts/generate-architecture-prompts.ts +21 -10
  267. package/scripts/local-environment.ts +79 -21
  268. package/scripts/local-setup.ts +150 -105
  269. package/scripts/pack-release.ts +28 -4
  270. package/src/core/index.ts +1 -1
  271. package/src/core/sandbox/opensandbox-backend.ts +10 -4
  272. package/src/core/sandbox/sandbox-connection.ts +22 -7
  273. package/src/core/worker-image.ts +1 -1
  274. package/src/harness/project-harness.ts +5 -4
  275. package/src/harness/project-rpc-client.ts +23 -0
  276. package/src/harness/project-runtime.ts +2 -1
  277. package/src/harness/typescript-loader.ts +28 -8
  278. package/src/trace-viewer/command.mjs +6 -3
  279. package/src/trace-viewer/public/app.js +239 -59
  280. package/src/trace-viewer/public/index.html +5 -0
  281. package/src/trace-viewer/public/style.css +22 -0
  282. package/src/trace-viewer/reader.mjs +242 -26
  283. package/src/trace-viewer/run-root.d.mts +1 -0
  284. package/src/trace-viewer/run-root.mjs +7 -0
  285. package/src/trace-viewer/server.mjs +3 -1
  286. package/dist/scripts/anyswarm-applications.d.ts +0 -19
  287. package/dist/scripts/anyswarm-applications.js +0 -19
  288. package/dist/scripts/anyswarm-tui-config.d.ts +0 -36
  289. package/dist/scripts/anyswarm-tui-config.js +0 -189
  290. package/dist/scripts/anyswarm-tui-session.d.ts +0 -66
  291. package/dist/scripts/anyswarm-tui-session.js +0 -304
  292. package/dist/scripts/anyswarm-tui-terminal.d.ts +0 -41
  293. package/dist/scripts/anyswarm-tui-terminal.js +0 -154
  294. package/dist/scripts/anyswarm-tui.d.ts +0 -2
  295. package/dist/scripts/anyswarm-tui.js +0 -1012
  296. package/docs/architecture/25-foreground-tui.md +0 -51
  297. package/scripts/anyswarm-applications.ts +0 -39
  298. package/scripts/anyswarm-tui-config.ts +0 -174
  299. package/scripts/anyswarm-tui-session.ts +0 -295
  300. package/scripts/anyswarm-tui-terminal.ts +0 -147
  301. package/scripts/anyswarm-tui.ts +0 -912
@@ -6,7 +6,7 @@ The Runtime owns Agent resources and execution for one Run; `runtime.id` identif
6
6
 
7
7
  The JavaScript and TypeScript entry is `@anyswarm/core`. Its values are `createSandbox`, `createRuntime`, `resolveSandboxConnection`, `createPiExecutor`, `createCodexExecutor`, `createExecutorAdapter`, `getExecutorCapabilities`, `EXECUTOR_ADAPTER_PROTOCOL`, `DEFAULT_WORKER_IMAGE`, `workerImageFor`, `ServiceRegistry`, `createInProcessAdapter` and `createHttpJsonAdapter`. The image constant selects local Worker preparation for the Runtime’s executor. A Profile can also use `workerImageFor(executor)` or supply an explicit prepared image. File, event, Runtime, Profile, result and Service author types are named exports from the same entry. The package declares public npm publication settings and can be installed from a packed tarball. The [SDK & API Reference](../en/reference/api.md) and [Services guide](../en/services.md) document the public interface alongside the independent Messages application. The package exports the Sandbox Provider contract from the root. Bundled Harness helpers and the provider and executor implementation modules are internal.
8
8
 
9
- The host calls `createSandbox()` to read the shared connection resolver or supplies explicit OpenSandbox settings or `{ provider }`. The opaque handle freezes those settings and performs no allocation. The default creation lifetime is 3,600 seconds with automatic renewal while Runtime owns the resource. The built-in path rejects removed exact Workspace byte/inode limits, `local-docker` and endpoint host rewriting with migration errors. Trusted custom Providers keep their own capability contract.
9
+ The host calls `createSandbox()` to read the shared connection resolver or supplies explicit OpenSandbox settings or `{ provider }`. The opaque handle freezes the endpoint and configured, environment or saved connection settings and performs no allocation or interface enumeration. Runtime claims the handle after receiving its own `connection` options. Only when neither those explicit options nor the frozen settings supply a callback does a local OpenSandbox claim inspect `docker0`; it does not reread the environment or saved configuration. Unavailable inspection raises the internal `HOST_NETWORK_DISCOVERY_FAILED`; public `createRuntime()` retains its `INVALID_CONTRACT` resource error with the safe explanation and configuration remedy. A successful inspection without `docker0` retains the local fallback. Explicit callback URLs and hosts therefore work on hosts that cannot enumerate interfaces. The default creation lifetime is 3,600 seconds with automatic renewal while Runtime owns the resource. The built-in path rejects removed exact Workspace byte/inode limits, `local-docker` and endpoint host rewriting with migration errors. Trusted custom Providers keep their own capability contract.
10
10
 
11
11
  An external `SandboxProvider` is trusted application code. Its preflight verifies the deployment before Core can allocate. Its per-image `SandboxManager` supplies creation, reconciliation and deletion, authenticated Worker calls and bounded file and Session transfer. `prepareSandbox` can verify or provision the deployed isolation before Worker startup. A provider advertising shared workspaces implements backing creation and deletion and applies the specified read-only or read-write attachment in preparation. The backend keeps the original manager and resource identity across uncertain operations. [Provider and Worker call order](16-pi-opensandbox-backend.md#startup-and-ownership)
12
12
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  The public `createSandbox()` factory snapshots one connection without allocating resources. Runtime owns Agent admission, resource responsibility, renewal, stop, export and deletion. `@alibaba-group/opensandbox@1.2.1` supplies the Lifecycle and Execd protocols through `opensandbox-sdk.ts`. `opensandbox-manager.ts` coordinates these SDK calls and holds known or uncertain allocations. `worker-client.ts` owns authenticated AnySwarm startup, input, event, project, file and session requests. The executor driver owns the selected executable version, catalog, credentials and capabilities.
4
4
 
5
+ The Sandbox snapshot omits host interface discovery. At Runtime claim, a consistent explicit `connection.publicUrl` or supported Bridge/Gateway URL takes precedence over the saved URL. Explicit advertise-host settings take precedence over the frozen host. A local OpenSandbox connection with neither fact calls the guarded `docker0` discovery helper, then uses `172.17.0.1` only if inspection succeeded without an address. An inspection failure reports its own code and a callback configuration remedy before any listeners or Sandboxes are allocated. Custom Providers keep their existing host fallback and do not enter this OpenSandbox discovery branch. [Connection precedence and setup diagnostics](07-run-configuration.md)
6
+
5
7
  ```text
6
8
  Runtime.spawn
7
9
  provider.beforeAllocation → SDK authenticated listing + authentication check
@@ -4,6 +4,82 @@ The installed project command runs with a captured directory and the initial pro
4
4
 
5
5
  This chapter describes the private Core evidence files, the Service observation hook and the shared host report helper. [Core Runtime](15-core-runtime.md) and [Pi/OpenSandbox](16-pi-opensandbox-backend.md) describe execution and resource ownership.
6
6
 
7
+ ## SDK tutorial business checks
8
+
9
+ First Harness and Parallel Swarm use `context.runWithRuntime` for the original
10
+ Runtime/factory, business, close and cleanup evidence. They register Agent
11
+ observations after Runtime construction and unregister in `finally`. Exclusive
12
+ turns use public `runInput`; all work receives the Run signal, while close has
13
+ its own bounded allowance. A thrown business error fails the job, cancellation
14
+ keeps the cancelled classification, and unconfirmed factory/close ownership
15
+ keeps its resource IDs and pending receipts. No example retries an unknown write
16
+ with a replacement identity. These result projections do not replace or edit
17
+ the Runtime's close receipt.
18
+
19
+ **First Harness.** The Publisher alone receives a fresh random reference in
20
+ `release-data.txt`. Its authenticated publication records author and request ID.
21
+ The host verifies that author and reference before choosing the foreground
22
+ channel (default `preview`) or awaiting an explicitly enabled SDK/RPC question.
23
+ Writer has only the read operation; its authenticated read must match the
24
+ expected Writer and reference. A sandbox snapshot must equal the expected two
25
+ newline-terminated lines in `delivery.txt`. After close, the host reads the
26
+ Writer artifact path from that same receipt and compares exported bytes again.
27
+ Only exact delivery gets `acceptance.status: verified`, a byte count and hash.
28
+ This verifies a Service handoff, not a real release operation.
29
+
30
+ The First Harness `afterClose` callback only captures the receipt. Export byte
31
+ validation runs separately after `runWithRuntime` returns: mismatched/missing
32
+ confirmed output appears as `result.verificationFailure` and a failed outcome,
33
+ without fabricating `cleanupFailure`. Pending required collection is unverified
34
+ and `export.status: pending`, with the original Writer receipt. A business
35
+ failure before Writer creation does not invent a required export. Resource
36
+ cleanup and file delivery remain separate, including after cancellation.
37
+
38
+ **Parallel Swarm.** Host-owned phases are waiting → research → review → closed.
39
+ After all three researchers spawn, `FindingsBoard.beginResearch` records their
40
+ actual Agent IDs. Every successful publication is attributed by the authenticated
41
+ Service caller and assigned the current phase; input cannot override either.
42
+ Before advancing each phase, the host requires a contribution from every
43
+ researcher, rather than only growth in a global count. A second-round review
44
+ must be a newly published record citing at least one existing first-round
45
+ finding by another author. A self-only or unknown citation is rejected before
46
+ publication. The write operation advertises `idempotent: false`; it does not
47
+ claim business deduplication that its append-only records do not provide.
48
+
49
+ Every finding has 1–8 source references to the captured initial FileTree. Each
50
+ must use a canonical relative path belonging to that snapshot, a positive
51
+ 1-based inclusive range of at most 40 lines, and an exact nonblank excerpt of at
52
+ most 4,096 bytes. The host decodes UTF-8 strictly and normalizes CRLF to LF for
53
+ the comparison; path traversal, nonexistent files, invalid line ranges,
54
+ non-text input and changed excerpts fail. Only successfully checked findings
55
+ enter the Board. Its exported Service state and `result.detail.board` retain
56
+ rounds, authenticated authors, per-member contribution counts and references.
57
+
58
+ After research and review pass, the host stops the researchers and runs one
59
+ synthesizer with search-only Board access. It requires collection of `report.md`
60
+ within 1 MiB. `report.ts` checks the synthesizer's recorded artifact location,
61
+ readable UTF-8 and nonblank bytes, and rejects an exact unchanged copy of an
62
+ input `report.md`. It records size and SHA-256. That check returns structured
63
+ evidence inside `afterClose`, rather than throwing a business validation error
64
+ into the helper's cleanup channel. Missing or unreadable confirmed output fails
65
+ the business result; unconfirmed collection stays pending. A late read after the
66
+ bounded close wait cannot upgrade the frozen Run result.
67
+
68
+ Parallel acceptance names its scope: participant contributions, cross-author
69
+ reviews, Board source references and report export. Individual checks remain
70
+ visible, with `semanticCorrectness: not-run` even when that limited scope passes.
71
+ The host does not establish that an excerpt supports a claim, that a review is
72
+ useful, that the Markdown cites the Board correctly, or that project tests pass.
73
+ Likewise the recommended Subagents repository-handoff task keeps the generic
74
+ `acceptance: not-run`; its source citations and conclusions need human inspection.
75
+ No fixed report text or injected defect defines business success.
76
+
77
+ The focused tests exercise real Session/Runtime/Bridge behavior through
78
+ controlled Worker transports and targeted failure injection. Package tests
79
+ check the same source dependency graph, edits and SDK archive identity outside
80
+ the checkout. These establish software contracts; new real-model repository
81
+ handoff and exported Parallel Swarm runs remain explicitly deferred acceptance.
82
+
7
83
  ## Runtime summary and ordered observations
8
84
 
9
85
  `createRuntime` allocates a fresh `runtimeId` and a private directory under the supplied `outputDir`. `runtime.json` is replaced atomically as assembly enters starting, open or initialization-failed, and after each close attempt. It records the output schema and Core/Pi versions, the backend resource settings, effective wait limits, provider/model for each alias, gateway output and request limits, frozen Profile settings, the Profile prompt hash, and registered Service transports and known adapter timeouts. The final summary includes per-Agent Sandbox observations with provider identity, selected image and verified startup constraints. Failed or incomplete startup remains visible through allocation and cleanup evidence. Profile environment keys appear without their values. The summary also lists the available model ledgers by alias and host path. `runtime_model_attempts` in each SQLite file carries the model request's Agent ID, permit phase, status, limits and available usage. Join it by Runtime, model alias and Agent when checking a model error.
@@ -153,6 +229,8 @@ The [PeerMesh peer team](18-peermesh-harness.md) exposes `runPeerMeshTeam(option
153
229
 
154
230
  ## Subagents Harness
155
231
 
232
+ The exported repository handoff example includes `handoff-config.ts`. Pass it explicitly with `--config` to use the same time limits as the recorded p-limit handoff. It keeps the default connection, executor and environment-selected model and applies a 360-second work window, a 70-second model request limit and a 60-second close window. The topology allows Root and two direct children. Collection requires `report.md` with a 1 MiB limit and excludes Git data. The work limit starts before Runtime creation. A missing or oversized required report surfaces through the normal collection result, and cleanup remains visible in the run report. Input comes from the supplied directory snapshot and the report exports under the configured run output directory.
233
+
156
234
  The normal [Subagents example](../../examples/subagents/README.md) exposes `createSubagentsHarness(config)` with `input`, `status`, reply observation and close, plus `runSubagentsHarness(config, signal, interact?)` for reports. The CLI reads a host config and accepts a task string or interactive input. The default cap is four Agents including Root and three child edges in a path. The default work deadline is 120 seconds and the close allowance is 30 seconds. An interactive reply leaves the team available for another input. EOF, `/exit`, timeout or host cancellation enters close. `/status` takes a live Core snapshot independently of a waiting model or pending input.
157
235
 
158
236
  The host registers the collaboration Service before creating Root. It attaches the listener before the first input and uses the same Child Profile for every descendant. Both Profiles have all six Service grants. A spawn reserves a validated name before awaiting Core, uses the actual authenticated caller as parent, and binds the Agent before submitting the first task. The manifest allows up to 60 seconds for this Service operation within the Run's overall work limit. Default `all` sets `forkFrom` to that parent; `none` creates fresh history. The host alone chooses the model, image, root seed files, required collection and private or shared workspace. Child paths are collaborative addresses, separate from work directory paths. The caller can target a visible same-tree Agent ID, absolute path or relative child path. List filters by path segments and current Core status. Follow-up rejects Root, whose work comes from the host. Interrupt rejects Root and the caller itself and leaves an already idle target idle.
@@ -302,7 +380,7 @@ The installed-package case uses the same archive installation helper and SHA-256
302
380
 
303
381
  ### Installed native PeerMesh foreground acceptance
304
382
 
305
- The package currently declares the `swarm` tool binary. The installed foreground host is invoked explicitly as `node node_modules/@anyswarm/core/dist/scripts/run-harness.js --config ./host-config.mjs`; there is no `swarm-environment` binary alias. `test/peermesh-installed-native.test.ts` adds an opt-in archive-backed acceptance at that entry. Enable only after independent source/archive/image/fixture reviews with `ANYSWARM_PEERMESH_INSTALLED_REAL_TEST=1 ANYSWARM_CORE_TEST_IMAGE=sha256:<reviewed-image> node --test dist/test/peermesh-installed-native.test.js`. The shared installer accepts `ANYSWARM_TEST_PACKAGE_ARCHIVE` and `ANYSWARM_TEST_PACKAGE_SHA256` together, snapshots and verifies those bytes before offline npm installation, and otherwise builds the clean source checkout with the release packer before native acceptance. Ordinary package regressions call the same packer with `--skip-build` and reuse the build created by npm test. The installer removes inherited Node loader overrides. Deterministic package checks normally install in OS temporary storage and remove their installations. Native gates prefer `/var/tmp`, falling back to the configured temporary root and `/tmp` only when those roots have no real checkout ancestry. The installer resolves symlinks and rejects roots beneath either a `.git` directory or linked-worktree `.git` file; a caller-provided private parent inside a checkout fails with `INSTALL_PARENT_IN_CHECKOUT`. A checkout-owned HOME is rejected with `INSTALL_HOME_IN_CHECKOUT`, rather than enabling Node's home-based module fallback. Explicit parents must be existing non-symlink host-owned directories with mode 0700; consumer directories are also mode 0700. Offline npm uses the existing host cache, while npm and runtime subprocesses execute from the external consumer; no source checkout supplies module resolution.
383
+ The package declares `anyswarm` as its host command. The Worker image provides its internal `swarm` command. The installed native PeerMesh acceptance invokes the foreground host explicitly as `node node_modules/@anyswarm/core/dist/scripts/run-harness.js --config ./host-config.mjs`. `test/peermesh-installed-native.test.ts` adds an opt-in archive-backed acceptance at that entry. Enable only after independent source/archive/image/fixture reviews with `ANYSWARM_PEERMESH_INSTALLED_REAL_TEST=1 ANYSWARM_CORE_TEST_IMAGE=sha256:<reviewed-image> node --test dist/test/peermesh-installed-native.test.js`. The shared installer accepts `ANYSWARM_TEST_PACKAGE_ARCHIVE` and `ANYSWARM_TEST_PACKAGE_SHA256` together, snapshots and verifies those bytes before offline npm installation, and otherwise builds the clean source checkout with the release packer before native acceptance. Ordinary package regressions call the same packer with `--skip-build` and reuse the build created by npm test. The installer removes inherited Node loader overrides. Deterministic package checks normally install in OS temporary storage and remove their installations. Native gates prefer `/var/tmp`, falling back to the configured temporary root and `/tmp` only when those roots have no real checkout ancestry. The installer resolves symlinks and rejects roots beneath either a `.git` directory or linked-worktree `.git` file; a caller-provided private parent inside a checkout fails with `INSTALL_PARENT_IN_CHECKOUT`. A checkout-owned HOME is rejected with `INSTALL_HOME_IN_CHECKOUT`, rather than enabling Node's home-based module fallback. Explicit parents must be existing non-symlink host-owned directories with mode 0700; consumer directories are also mode 0700. Offline npm uses the existing host cache, while npm and runtime subprocesses execute from the external consumer; no source checkout supplies module resolution.
306
384
 
307
385
  The installed Notes and Subagents examples select the Runtime's executor from their trusted `backend.executor` configuration, which defaults to Pi. On Codex, the Notes writer and reader each continue on their own App Server thread. The Subagents assembly disables Context Fork for Codex and the registered collaboration manifest requires `fork_turns: "none"` when spawning a child. Both examples use the same Service manifests, input admission, workDir collection and report reader for either driver. The spawn-ready record identifies each Codex thread and the guest executor version. The [OpenSandbox backend](16-pi-opensandbox-backend.md#codex-app-server) explains startup and evidence scope.
308
386
 
@@ -1,43 +1,75 @@
1
1
  # 22. Public documentation website
2
2
 
3
- The Astro application in [website/](../../website/) publishes the AnySwarm landing page, documentation overview, SDK and architecture guides, five Harness guides, a Quickstart, and API, TypeScript, and deployment references. Its npm package has a separate lockfile. It does not start a Runtime or connect to a Service, model provider, or private Run.
3
+ The Astro application in [website/](../../website/) publishes bilingual landing pages, SDK tutorials, collaboration guides, Blog, Changelog and the Quickstart. Its npm package has a separate lockfile. It renders a pinned stable documentation snapshot alongside development documentation from the checkout. It does not start a Runtime or connect to a model provider or private Run.
4
4
 
5
5
  ## Build and render
6
6
 
7
- Use Node.js 22.23.4 or later. Run `npm ci` and `npm run dev` in `website/` for a local preview. `npm run build` writes the static output to `website/dist/`. `BASE_PATH` defaults to `/` and selects the URL prefix. For the repository site it is `/anyswarm`. `SITE_URL` defaults to the owner’s GitHub Pages origin. These values are build inputs. Update them and rebuild when deploying under a different host or prefix.
7
+ Use Node.js 24 for the supported development and CI commands; the website package requires at least 22.23.4. Run `npm ci` and `npm run dev` in `website/` for a local preview. Both development and build commands first prepare the documentation inputs. `npm run build` also runs the website's deterministic tests, produces `website/dist/`, and checks the rendered routes and content. `BASE_PATH` defaults to `/` and selects the URL prefix; the repository site uses `/anyswarm`. `SITE_URL` selects the site's origin. Both are build inputs, so changing the host or prefix requires a rebuild.
8
8
 
9
- Website CI runs for the site, bilingual guides, documentation images, and changes that require full Core verification. It installs the site's locked dependencies and builds with `/anyswarm` and `https://anyswarm.github.io`. Its build checks local page and asset destinations, heading anchors, matching English/Chinese documentation routes, and both locale landing pages. It reports a build check without uploading or deploying the output. [CI triggers and permissions](07-run-configuration.md#ci-build-and-verification)
9
+ Website CI runs for the site, bilingual guides, documentation images and changes that require full Core verification. Checkout includes Git history for the pinned snapshots. CI installs the locked site dependencies and builds with `/anyswarm` and `https://anyswarm.github.io`. It does not upload or deploy the output. [CI triggers and permissions](07-run-configuration.md#ci-build-and-verification)
10
10
 
11
- The content loader reads the repository's `docs/en/` (English) and `docs/zh/` (Chinese), validating each page's title, description, section, and order. Astro prerenders the English and Chinese landing pages (`/` and `/zh/`) plus one documentation route per content slug under `/docs/` and `/zh/docs/`. The shared layouts use those fields for page metadata, navigation, the current page marker, a top-right language switcher linking each page to its counterpart locale, and active table-of-contents tracking. Copy page writes the title, description, and rendered article text to the clipboard. It excludes the code-copy controls and displays success or failure on the button. The site uses Astro’s Sätteri Markdown processor with a local link plugin. The Markdown files are the shared source for GitHub readers and the site. Authors write relative file links such as `../runtime.md` or `harnesses/index.md`. `markdown-doc-links.mjs` resolves each link from its source file, checks that the destination exists inside the repository, and converts guide links to the matching locale route with `BASE_PATH`. Links to implementation files or manuals become GitHub source links. The transform preserves query strings and fragments. Absolute external URLs and same-page fragments retain their meaning. A missing file fails the build instead of publishing a broken route. The URL helper adds the configured base to generated navigation, search destinations, and the favicon. Astro bundles local font assets and inline SVG landing schematics. The public directory supplies the favicon and verbatim font license notices. Departure Mono’s notice and font come from the [upstream font assets](https://github.com/rektdeckard/departure-mono/tree/75152a3f1e6dacdd248a6c397c97dbf27e33eea0/public/assets). The other notices come from the locked Fontsource packages. Update the included notices when changing the corresponding fonts.
11
+ ### Stable inputs and development inputs
12
12
 
13
- The shared top navigation displays the documented release, currently `v0.5.0`, and links to the release page in the active language. The version label is set in `TopNav.astro` when the stable guides advance. The website navigation and both landing pages render the same six-bird mark at different sizes with the active site foreground color. The browser icon uses the same geometry and follows the browser’s color scheme. The repository README selects the light or dark SVG through its picture element. The Trace Viewer and static replay use the same six silhouettes in their headers. Astro copies the transparent PNG export to `/anyswarm-logo.png` under the configured base path for direct download.
13
+ [docs-release.json](../../website/docs-release.json) is the explicit stable-version selection. It records a stable npm version, the full immutable `packageRevision`, a compatible immutable `docsRevision`, and an ordered list of tracked documentation correction patches. `scripts/docs-release.mjs` rejects moving refs, prerelease versions, duplicate corrections and correction paths outside the allowed directory. Both revisions must exist locally and identify `@anyswarm/core` with the selected version. Missing history fails with an exact `git fetch --no-tags origin <revision>` instruction; it never falls back to main.
14
14
 
15
- The browser handles the landing page diagrams, Harness selector, theme, and site navigation. Search indexes documentation titles, descriptions and sections for the current locale at build time and uses sidebar labels and order for pages in the navigation. Other pages use their frontmatter section and order. The Tutorials group contains the first SDK Harness and Swarm Harness guides. Opening search shows up to eight pages. Typing filters the index locally. Search renders results and empty-query feedback as DOM text, uses only built documentation destinations, and sends no queries to a server. Escape or backdrop click closes it and returns focus to the navigation button. The theme preference stays in browser storage. The site writes no server-side session state.
15
+ `scripts/prepare-docs.mjs` creates a temporary snapshot under the ignored `website/.generated/` directory. `git archive` extracts the package revision, preserving its implementation and example sources. Only `docs/en/` and `docs/zh/` are then replaced by the selected documentation revision. Reviewed correction patches may update public Markdown guides only. Each patch must apply cleanly and its SHA-256 becomes part of the build metadata. The script compares the English and Chinese route lists, reserves `next` as a channel prefix, and replaces the previous stable snapshot so deleted pages cannot survive a rebuild. Temporary staging is removed even on failure.
16
16
 
17
- The Quickstart Markdown links to the published Trace Viewer replay on GitHub Pages. Astro rewrites this link to the current site's base and serves the tracked static replay bundle from `website/public/trace-demo/`. The browser replays the bundled release-notes fixture without contacting a model or a Runtime.
17
+ This separates a documentation correction from an API change. The manifest does not prove semantic compatibility: review must establish that the selected guide revision and patches describe the package revision. For the initial `0.5.2` selection, the package revision is the published `070b0253` tree and the guide revision is the compatible documentation update in `2aa972ed`. Corrections pin npm commands to `0.5.2`, direct main-source builds to Next, and document the released source-RPC and Trace limitations. The Next guides describe the repaired paths. Source links and downloadable examples always use the package revision, even when a later compatible documentation correction is selected.
18
18
 
19
- Regenerate that bundle with `node website/scripts/build-trace-demo.mjs`. `--root <directory>` selects a different Run root and enables sanitization by default; `--sanitize` also enables it explicitly. Static export requires each Run's complete timeline to fit within 1,000 intervals and points. After metadata indexing, the generator checks the summary before bundling that Run's raw details and file bodies. It rejects a truncated timeline with an error, leaving the existing bundle untouched. This keeps window queries and start/end focus links complete in the static replay instead of exporting an incomplete index or all bodies of a long Run. Use `anyswarm trace --root <directory>` for larger Runs; its server loads bounded windows and selected bodies on demand. Accepted small demos still bundle record details and at most 256 KiB of each referenced file, so this export is for selected replay fixtures rather than a complete raw-file archive.
19
+ The generated metadata contains the stable version, both stable revisions, patch hashes and available slugs. Next metadata contains the checkout's commit, dirty-tree indicator and guide slugs. `src/lib/docs.ts` exposes these inputs to the renderer; `/docs-metadata.json` publishes their provenance for readers and verification. None of the extracted historical source or generated metadata is committed.
20
20
 
21
- ## Publish and recover
21
+ ### Routes, navigation and downloads
22
22
 
23
- During the v0.4.1 scope transition, Pages deployed the updated installer before GitHub Latest advanced. Both releases retain the same GitHub asset naming scheme. The published installer supports one-time migration from the archived v0.4.0 npm scope to the managed CLI. [Release procedure](../workflows/development.md#release-verification)
23
+ The content loader validates title, description, section and order in four collections. Stable English and Chinese guides render at `/docs/` and `/zh/docs/`; development guides render at `/docs/next/` and `/zh/docs/next/`. Each root serves the corresponding overview, and the explicit `/overview/` routes remain available. Only the current selected stable version and next are built; this is not an archive of every historical release.
24
24
 
25
- Astro copies [the CLI installer](../../website/public/install.sh) verbatim into the Pages artifact at `/anyswarm/install.sh`. It checks Node.js and npm, chooses a writable prefix, and stages the verified stable archive before activating the two CLI entries. The installer reports the active binary, actual package root, source and SHA-256. Its `--archive` input takes an explicit absolute local tarball for release verification. Host setup and CLI update are separate commands. [Managed installation and update](07-run-configuration.md#managed-cli-installation-and-update) describes the on-disk generations and activation.
26
- The homepage offers two CLI installation tabs. Global npm is selected on first render and shows `npm install -g @anyswarm/core`. The shell installer tab shows the same curl-to-sh command as the Quickstart and tells users how to update a managed install. Selecting either tab changes the displayed command, copy text and explanatory note. Both locales link to their CLI Quickstart and to the SDK installation section of the API reference. That section shows the project dependency command and explains how to run the local CLI through `npm exec`.
25
+ Shared layouts preserve the channel through the sidebar, previous/next navigation, language switch and local search. The version menu preserves the language and slug when switching channels, falling back to overview when that page does not exist in the destination. The stable label comes from the manifest. The next banner identifies unreleased checkout documentation and its source revision; it explains that these guides can be newer than the last npm `next` publication. It does not claim that main and the current registry preview are identical.
27
26
 
28
- curl prints download errors to stderr. A shell with `pipefail` enabled also propagates a curl failure through the pipeline exit status. The installer looks for the managed activation entry in `@anyswarm/core` first, then in `@anyswarm/anyswarm` for v0.4.1. If the staged npm bin directory has an executable `anyswarm` and no `anys` entry, the shell script adds an `anys` symlink to `anyswarm` inside the stage. This keeps existing prefixes with a managed short link usable when rolling back through the shell installer to an archive that predates that alias. The activated archive runs its own version and executable ownership checks, and supplies its own activation lock implementation. On Darwin, the installer supplies a temporary lock compatibility command for the checksum-verified v0.5.0 archive. That archive's CLI still carries its original updater. Upgrade a managed v0.5.0 Mac installation by rerunning the current site installer in the same prefix. The GitHub Release asset name stays stable. The release page starts at v0.5.0 and links to GitHub release history for earlier packages. Website CI verifies that the built installer matches the source. The focused install-command and installer tests also run when the installer script, the install command component, or either Quickstart changes. The full Core suite includes those tests.
27
+ The site uses Astro's Sätteri Markdown processor with `markdown-doc-links.mjs`. Authors keep repository-relative links such as `../runtime.md` in the Markdown shared with GitHub. The transformer resolves stable links against the prepared snapshot and next links against the checkout, rejects missing or out-of-root destinations, converts relative guide links to the corresponding language/channel route, honors explicit public stable and Next URLs, and pins implementation links to the relevant source commit. Query strings and fragments are preserved. External links and same-page fragments retain their meaning. The URL helper applies `BASE_PATH` to navigation, search, downloads and assets.
29
28
 
30
- The [Pages workflow](../../.github/workflows/deploy-website.yml) starts after a push to `main` that changes `website/`, `docs/en/`, `docs/zh/` or its workflow, from manual dispatch for a selected ref, or after a successful tag-triggered Release run. The workflow requires `AnySwarm/anyswarm` and the `main` ref. It builds only after GitHub marks a release containing `luna-shi-anyswarm.tgz` as Latest. The installer can serve the historical v0.4.0 archive before a managed-install release is available. GitHub Pages uses the GitHub Actions source. The `github-pages` environment allows deployment from `main`. The workflow reads the site origin and base path from Pages, runs a locked Node 24 build, then uploads `website/dist/` as a Pages artifact. The deploy job runs only after the build succeeds and publishes that artifact using the repository Pages permission and an OIDC token. Each successful deployment replaces the entire published site under the configured base path. The public site is at `https://anyswarm.github.io/anyswarm/`. The organization transfer changed the origin, and GitHub Pages does not redirect requests from the previous origin. A deployed artifact must include both locale trees to serve both locales. Deployments share a concurrency group. No npm package publish or sandbox setup runs in this workflow.
29
+ `src/pages/downloads/[...path].ts` serves sources from the channel's source tree. Stable 0.5.2 provides five First Harness and three Parallel Swarm files through `/downloads/stable/v0.5.2/` and the existing stable aliases. Next serves the complete checked-in eject manifests at `/downloads/next/`. First Harness has eight files, including the nested `input/README.md` and the consumer `AGENTS.md`. Parallel Swarm has seven, including its own configuration, report checks and consumer `AGENTS.md`. The Markdown transformer maps these sources to channel downloads and preserves nested paths. The build compares each download with its selected source bytes. Eject also creates an installable project manifest, provenance and a matching SDK archive. Historical tutorials use their matching fixed release source.
31
30
 
32
- Installation, build or environment errors surface in the corresponding Actions job. A successful deploy job records the public URL. A failed build leaves the previously published site available. After fixing a failed deployment, dispatch the workflow on `main` and verify both landing pages, a nested documentation route in each locale, and a static asset under the configured base. The package and local build output are independent of the live deployment history.
31
+ Both landing pages render a copyable global npm command pinned to the manifest's stable version, with clipboard success or failure feedback. They link to the same stable Quickstart and SDK reference. The root CLI documentation test checks the installation contract; the built-output check verifies the actual homepage command. The retired shell installer is absent. [npm installation and update](07-run-configuration.md#npm-cli-installation-and-update)
33
32
 
34
- ## Content maintenance and rendered-link checks
33
+ The locale-specific introduction film and static Trace replay are available from the landing page. The three-pattern Harness selector and its zoom dialog share Subagents, TaskPool and Substrate. Arrow keys cycle through these patterns, and Escape closes zoom. Search indexes only the active language and channel's titles, descriptions and sections at build time. Sidebar labels and order organize navigation pages; other pages use frontmatter. Opening search shows up to eight pages, and typing filters locally. Results and empty-query feedback use DOM text and only built destinations; no query is sent to a server. Escape or backdrop click closes search and returns focus. Copy page writes the title, description and article text without code-copy controls. The theme preference stays in browser storage; there is no server-side session state.
34
+
35
+ ### Blog and changelog
36
+
37
+ Blog pages read the editorial Markdown from the checkout under `docs/{en,zh}/blog/`. Editorial content renders on the standalone `/blog/` and `/zh/blog/` routes and is excluded from both channels' guide inventories and search. Markdown links to a post lead to its standalone route. Essay illustrations in `website/public/blog/` resolve under the site base. The standalone changelog in each language renders the pinned stable release guide and changelog. The Next navigation links to the checkout changelog under the Next documentation routes. Missing required article or release content fails the build.
38
+
39
+ ### Visual assets and static replay
40
+
41
+ Navigation and landing pages render the shared six-bird mark with the active foreground color. The favicon uses the same geometry and follows the browser color scheme. The README selects light or dark SVG through its picture element, and the Trace Viewer uses the same silhouettes. `/anyswarm-logo.png` provides the transparent export under the configured base path. Astro bundles local fonts and SVG diagrams; `public/licenses/` supplies the font notices. Departure Mono's notice and font come from the [upstream assets](https://github.com/rektdeckard/departure-mono/tree/75152a3f1e6dacdd248a6c397c97dbf27e33eea0/public/assets); other notices come from the locked Fontsource packages. Update notices when changing the corresponding fonts.
42
+
43
+ Stable Quickstart links to the published Trace Viewer replay are rewritten to the current site's base. Next Quickstart links to its historical handoff embed. The tracked `website/public/trace-demo/` bundle serves both the labeled release-notes fixture and the recorded p-limit Run without contacting a model or Runtime. Regenerate it with `node website/scripts/build-trace-demo.mjs`. `--root <directory>` selects another Run root and enables sanitization; `--sanitize` also enables it explicitly. The generator rejects a Run whose complete timeline exceeds 1,000 intervals and points, leaving the existing bundle untouched. This preserves complete static window and focus links. Accepted demos include record details and at most 256 KiB of each referenced file. A static file response pages the cached prefix by UTF-8 byte offsets and signals a preview limit separately from the next-page flag. For sanitized exports the generator redacts named credential fields in complete JSON, JSONL and model response events and omits structured previews it cannot parse completely. If sanitization changes a Research patch preview, the static record marks that patch unavailable for verified inspection and removes its file identity. The original candidate hash remains part of the historical Research record. Use `anyswarm trace --root <directory>` for larger Runs and on-demand bounded queries.
44
+
45
+ ## Use cases, tutorials and evidence boundaries
46
+
47
+ The landing page retains the existing six-bird identity, introduction films, Blog and Changelog routes, Trace preview and three illustrated collaboration patterns. `UseCases.astro` adds two application explanations using the existing visual styles: engineering handoff from a local repository, and AutoResearch candidates evaluated by a host-controlled Evaluator. Each card states the input, collaboration, outputs and current limitation. These descriptions are usage contracts, not claims that a new live-model Run was executed during website development. The film and conceptual schematics are introductory material, not Run evidence.
48
+
49
+ The repository handoff uses the existing `subagents` name and flags. Its prompt asks Root to delegate independent source reading and export `report.md`; the generic Harness does not enforce exactly two children or certify the report. The Quickstart explains initial capture, private Sandbox copies, no automatic local overwrite, configured time/collection limits, and separate business, acceptance, export and cleanup results. `acceptance: not-run` is kept explicit. The first SDK tutorial defaults to a preset channel without questions; SDK/RPC question handling is an opt-in section. Parallel Swarm teaches three researchers, two rounds and one synthesizer. It describes the host's contribution, source-reference and export checks separately from semantic correctness.
35
50
 
36
- The [documentation index](../INDEX.md) is the repository reading map. Public guide Markdown lives only under `docs/en/` and `docs/zh/`; `website/` owns navigation, layouts, landing components and rendering. The [Runtime](../en/runtime.md), [Services](../en/services.md), and [Swarm Harness](../en/build-your-harness.md) guides document the public interface alongside [SDK & API Reference](../en/reference/api.md), while architecture remains the deeper implementation manual. Add a corresponding page in both languages and update `website/src/lib/nav.ts` when adding a guide. Keep SDK signatures tied to the package exports and executable examples.
51
+ Next sidebar and overview use three tiers. Stable navigation includes the sections available in its pinned snapshot. Tier 1 is the repository CLI task and First Harness → Parallel Swarm SDK path. Tier 2 contains AutoResearch and local Subagents, TaskPool and Substrate collaboration references. Tier 3 contains advanced source and heavy integrations; PeerMesh and Lead-Worker are grouped separately with visible facility badges. Their detailed requirements remain in the example catalog and guides. The AutoResearch page describes the FrontierCS-2 evaluator setup, the configurable model and Worker, and the linked real-model records from #337.
37
52
 
38
- After Astro generates the site, `scripts/check-links.mjs` walks every HTML page, resolves same-origin `href` and `src` values under the configured base, checks destination files and HTML anchors, and compares documentation route sets across locales. Both landing pages must exist. A missing base prefix, output file, anchor or counterpart page fails the build and therefore both Website CI and the Pages build. External link reachability and browser interaction are outside this offline check.
53
+ The source-candidate tutorials clearly state that their new eject targets and consumer author guides are absent from stable 0.5.2. They link to the matching source-package instructions. The shared Copy Prompt in the root README and English Swarm guide tells Coding Agents to export `parallel-swarm`, read its own `AGENTS.md` and installed SDK types, and preserve explicit evidence, export and cleanup checks. The Chinese guide provides the same requirements in Chinese. The homepage points to the Next repository handoff and AutoResearch guides and links directly to the Next customization prompt. The repository maintainer `AGENTS.md` is not presented as the consumer guide.
54
+
55
+ The landing page and Next Trace guide open the recorded p-limit Run. The illustrated landing-page timeline and stable guide still identify the release-notes fixture. The default build exports the fixture through Trace Reader, labels it in the Run list and adds the checked-in [p-limit replay data](../../website/trace-replays/p-limit-handoff.json) before writing the combined bundle. Explicit `--root` and `TRACE_DEMO_ROOT` exports only read the selected Run root. The browser shim gives the Viewer the saved Run, summary, timeline, events, record details and byte-paged report through its usual requests. It disables live following. The embedded Events panel scrolls its ledger inside the frame so the last recorded event remains reachable when the parent caps the frame height.
56
+
57
+ The public p-limit data was selected from one VM Run after checking its input revision, Agent identities, Service call metadata and archived report. It includes three Agent lanes, recorded model, input and Service events, allowlisted Service targets and the original `report.md` with its SHA-256. Whole-Run counts reflect the original Run even when the viewer shows only a selected window. It includes neither message bodies nor model payloads, tool arguments, private file paths or raw proof/candidate source. The export keeps the recorded cleanup and generic acceptance fields. Verifying the report bytes does not certify the report's conclusions.
58
+
59
+ ## Publish and recover
60
+
61
+ The [Pages workflow](../../.github/workflows/deploy-website.yml) starts after relevant main pushes, manual dispatch, or a successful tag-triggered Release run. Relevant paths include `website/`, public guides, both downloadable example directories and the workflow. Deployment requires the public `AnySwarm/anyswarm` repository and `main`. Main changes can update next documentation while stable remains selected by the manifest.
62
+
63
+ Before building, `scripts/verify-public-release.mjs` resolves the selected `v<version>` tag and requires it to equal `packageRevision`. It fetches that exact npm version, validates the package identity and registry tarball origin, downloads the bytes, verifies npm SHA-512 integrity, and compares their SHA-256 with the canonical versioned archive in that GitHub Release's `SHA256SUMS`. It also reads the archive's package manifest. A missing package, wrong tag, inconsistent bytes or unavailable public endpoint fails the build. The check uses thirty-second request deadlines and deletes its temporary archive directory in `finally`. It does not consult or move npm `latest` or GitHub Latest, so a newer release cannot silently advance stable documentation.
64
+
65
+ After verification, Pages supplies the site origin and base path. A locked Node 24 build produces the static artifact. The deploy job runs only after that build succeeds, uses the `github-pages` environment and publishes via Pages permission and an OIDC token. Each deployment replaces the entire site, so every artifact includes stable and next in both languages. Deployments share the Pages concurrency group. No package publication or sandbox setup occurs here.
66
+
67
+ The public site is `https://anyswarm.github.io/anyswarm/`. A failed build leaves the existing deployment available; a successful deploy records the URL. Correct the manifest, missing history, public distribution or build failure, then dispatch Pages on main and check both channels and locales. Stable promotion is an explicit reviewed manifest change after the exact package is publicly verified. [Release and documentation workflow](../workflows/release-and-docs-versioning.md)
68
+
69
+ ## Content maintenance and rendered-link checks
39
70
 
40
- For a repository-prefix build, use `BASE_PATH=/anyswarm SITE_URL=https://anyswarm.github.io npm --prefix website run build`. For a root-path preview, build without a base override. Editing user guide content also participates in `npm run docs:check`, which validates repository-relative file links and anchors before publication.
71
+ The [documentation index](../INDEX.md) is the repository reading map. Current guides live under `docs/en/` and `docs/zh/` and feed next; stable guides are reproducibly derived from the manifest. `website/` owns rendering, navigation, stable input selection and compatibility corrections. Add both language pages and update `src/lib/nav.ts` together. Keep SDK examples aligned with public exports. The [website README](../../website/README.md) explains local preparation and stable promotion.
41
72
 
73
+ After Astro generation, `scripts/check-links.mjs` walks the HTML output, resolves same-origin links and assets under the configured base, checks files and heading anchors, and compares language routes. `scripts/check-doc-channels.mjs` checks the stable and next identifiers, version links, language links, sidebar and search boundaries, homepage version, metadata and example download bytes. Deterministic website tests also exercise manifest rejection, missing or wrong-version history, stale patch failures and snapshot cleanup. Any failure blocks Website CI and Pages. External link reachability and browser interaction remain separate checks.
42
74
 
43
- All five current first Harness sources are served at `downloads/first-harness/v2/`. The parallel Swarm uses the sources under `downloads/parallel-swarm/v1/` and the shared first Harness TypeScript configuration. The Markdown link transformer rewrites both locales to these exact shipped files. Historical single-process examples are linked to fixed release tags.
75
+ For the repository-prefix build, use `BASE_PATH=/anyswarm SITE_URL=https://anyswarm.github.io npm --prefix website run build`; build without a base override for root-path preview. `npm run docs:check` separately validates current repository-relative Markdown links, anchors and generated architecture references.
@@ -1,6 +1,6 @@
1
1
  # Harness entry and lifecycle
2
2
 
3
- The installed `anyswarm --harness` command runs one project. Its task input is a host directory and one nonblank prompt. Run configuration can choose resources, services, and limits. [Launch and configuration](07-run-configuration.md) covers host preparation and the editable SDK template.
3
+ The installed `anyswarm --harness` command runs one project. Its task input is a host directory and one nonblank prompt. Bare `anyswarm` prints Quickstart and exits 0. Run configuration can choose resources, services, and limits. [Launch and configuration](07-run-configuration.md) covers host preparation and the editable SDK template.
4
4
 
5
5
  ## Authoring an example
6
6
 
@@ -27,13 +27,16 @@ and reuse it across the Run's roles. Scheduling still validates Service results,
27
27
  exported files and the original close receipt before accepting the Run.
28
28
 
29
29
  Public installation instructions first install the published SDK or an explicitly
30
- selected, checksum-verified source archive, then copy the example source and
31
- compiler configuration from that installation. The copied standalone project
32
- uses its parent installation's SDK and compiler. The Parallel Swarm tutorial
33
- uses the compiler configuration included with the installed First Harness. Its
34
- Host resolves model and Sandbox settings from the configured environment. An
35
- edited repository example must use a package built from the same source revision. Matching package version numbers alone cannot establish
36
- that source/API pairing.
30
+ selected, checksum-verified source archive. Editable collaboration starts with
31
+ `eject parallel-swarm`, `eject subagents` or `eject first-harness` when the package
32
+ contains those manifests; these are new after 0.5.2. Each export contains its own
33
+ complete configuration and collaboration sources, an application-author
34
+ `AGENTS.md`, and a bound local SDK archive. Parallel Swarm does not import a
35
+ sibling example's configuration or require its compiler files. Each normal
36
+ Harness consumes complete `context.configuration` or loads its local default
37
+ through `projectConfiguration`. The older copy/build route remains supported.
38
+ An edited repository example must use a package built from the same source
39
+ revision. Matching package version numbers alone cannot establish that pairing.
37
40
 
38
41
  Each of the five mechanism directories contains a `package.json`, `tsconfig.json`
39
42
  and `project.ts`. `npm run build` emits `dist/project.js` in that directory.
@@ -65,6 +68,8 @@ The definition declares `inputDescriptor`, the optional lifetime and question su
65
68
 
66
69
  ## HarnessSession admission and lifetime
67
70
 
71
+ The standard output root is `${XDG_STATE_HOME:-$HOME/.local/state}/anyswarm/runs`, shared with the Trace command through `src/trace-viewer/run-root.mjs`. A nonempty explicit `outputRoot` (CLI `--output-dir`) resolves against the launch directory and takes precedence. The Session reserves `<root>/<runId>/` and saves `project-run.json` there. If the default state location cannot be used or is inside the captured workspace, preparation can choose a private temporary root; the final report path and terminal replay command identify that actual location. Direct `createRuntime()` has a separate required `outputDir` and writes its Runtime directory below it. A report-only Harness can be replayed even when no Runtime was created; the Viewer discovery and association rules are described in [Trace Viewer](06-observability-experiments.md).
72
+
68
73
  `createHarnessSession(definition, options)` runs one `Harness.run(context)`. It resolves configuration from an object or a config module, captures the project at `start`, and assigns a Run ID. It exposes `describe`, `start`, `input`, `respond`, `getState`, `onEvent`, `agents`, `stop`, and `completion` from the package root. Construction allocates no Sandbox. The default `task` lifetime finishes according to the Harness's existing business policy. Subagents additionally supports `interactive`, where Root can settle repeatedly while the Run remains open. The configured work deadline still applies.
69
74
 
70
75
  A mutation carries one `requestId`. The Session stores the operation and normalized arguments under that ID before dispatch. A repeat reads the saved receipt or joins the in-flight operation. Changing operation, target or arguments conflicts. Session callbacks receive both the external `requestId` and a bounded `operationId` derived from the Run ID, operation and original request ID. Native dispatch and receipt lookup reuse the same operation ID. Business controllers retain their own child, Task execution and batch identities. A bounded wait may report unknown while the original request is pending. A late receipt or a registered read-only reconciliation can update it. Admission keeps up to 4,096 ordinary mutation identities for the lifetime of the process. Ordinary input queues up to 64 entries and 256 KiB by default. The callback can capture a business binding when input is admitted and recheck it during dispatch. Handlers have a 10-second default observation deadline. A conditional or unknown child receipt stays visible in the input result.
@@ -73,7 +78,42 @@ A mutation carries one `requestId`. The Session stores the operation and normali
73
78
 
74
79
  The Session owns the only input handler and captures operation identities before dispatch. The preparation and storage code owns project capture, the Run directory and the stop deadline. Normal return, exceptions, preflight failure, stop and timeout all use the same terminal path. That path seals new Session mutations and questions before cancelling unresolved questions and capturing the operation dispositions. Callbacks released by cancellation cannot admit new work while the report is being saved. Original mutation receipts can still be reconciled. Late evidence does not change the final record.
75
80
 
76
- The Host writes `project-run.json` atomically with private permissions. The report retains the full JSON result and sanitizes known credentials in business evidence and terminal failure messages before saving. `completion`, the final event, the final RPC record and foreground output share a result of at most 256 KiB. A large result marks `snapshotTruncated` and preserves the outcome, export and cleanup statuses, save status and a report path when saving succeeded. A save failure omits the report path. If its stop deadline expires before the Harness confirms cleanup, it reports pending resources. Required export failure can retain the Sandbox and its Slot. Exit 0 requires completed business and confirmed required export, cleanup and report save. Exit 1 records cancellation, business failure or unresolved results. Launch validation uses exit 2, SIGINT uses 130, and SIGTERM uses 143. EOF and input or output failure enter the same foreground stop path.
81
+ The Host writes `project-run.json` atomically with private permissions. The report retains the full JSON result and sanitizes known credentials in business evidence and terminal failure messages before saving. `completion`, the final event, the final RPC record and piped one-shot output share a result of at most 256 KiB. A large result marks `snapshotTruncated` and preserves the outcome, export and cleanup statuses, save status and a report path when saving succeeded. A save failure omits the report path. If its stop deadline expires before the Harness confirms cleanup, it reports pending resources. Required export failure can retain the Sandbox and its Slot. Exit 0 requires completed business and confirmed required export, cleanup and report save. Exit 1 records cancellation, business failure or unresolved results. Launch validation uses exit 2, SIGINT uses 130, and SIGTERM uses 143. RPC EOF or input failure and an output failure enter the same stop path.
82
+
83
+ ## One-shot terminal output
84
+
85
+ The CLI loads and validates the selected module, then constructs a HarnessSession.
86
+ For a module with a workspace resolver, the CLI resolves any explicit trusted
87
+ configuration early to choose the default workspace and allow time for configured
88
+ cleanup. Explicit `--cwd` wins. The early load uses the same configuration validation and stable error messages as admission. A rejected configuration or resolver exits before the Session starts and before any Run directory is created. Other configuration loads occur during admission.
89
+ RPC takes its workspace from the client's run request.
90
+
91
+ With terminal stdout, the CLI prints the Harness name and a copyable Trace
92
+ command for the selected or default state directory before admission. It
93
+ subscribes before starting the Session and writes compact phase transitions,
94
+ Agent startup, Sandbox readiness when an Agent reaches idle or running, turn
95
+ settlement, Agent closure and Service lifecycle changes. Static Service names
96
+ come from Session observation handles when the Harness reaches running. Progress
97
+ uses only the redacted Session projection and escapes terminal control characters.
98
+ Arbitrary business events, messages, and question contents stay out of progress.
99
+ On completion it prints the outcome and one `Result` block. That block uses a
100
+ string `result.business` or `result.business.output` when present, otherwise the
101
+ result string or formatted JSON, including an explicit `null`. It preserves
102
+ newlines and tabs, normalizes CRLF, and escapes other Unicode control and format
103
+ characters so recorded output cannot execute terminal controls. The block is
104
+ limited to 64 KiB of UTF-8 at a character boundary. A truncation notice points to
105
+ the complete saved report only when saving succeeded; a failed save is reported
106
+ as unavailable. The finish guard prevents duplicate final blocks. Completion
107
+ also prints separately observed export and cleanup statuses,
108
+ up to five artifact paths, the saved report path when available, and a Trace
109
+ command for the actual Run root. The final path accounts for the Host's fallback
110
+ when the default state directory cannot be used. Trace is started explicitly in
111
+ a separate process and can read records as they are written.
112
+
113
+ Piped stdout keeps the single machine-readable result. Both one-shot modes wait
114
+ for Session completion and final stdout flush before returning the exit status.
115
+ Output failure enters the existing cleanup path. Lifecycle observation has the
116
+ same bounded subscription semantics as other Session observers.
77
117
 
78
118
  ## Agent controls and live state
79
119
 
@@ -117,7 +157,7 @@ Register an owned Runtime through `context.registerAgentControls({ runtime, ...
117
157
 
118
158
  Harness authors can call `context.askUser` for text, choice or confirmation. Questions bind a stable question and request ID to a source and cancellation signal. For a Service the source comes from the authenticated caller and Service invocation, and authorization is checked again before accepting an answer and before the Service resumes. Subagents conditionally exposes the `user-interaction ask` Service to its Profiles when the client has enabled questions. The request schema accepts the question text. The service reply contains the answer. A question and its source exist in the projection before any event is emitted. A response specifies `questionId`; competing answers, timeout, loss of authorization and stop resolve to a single terminal state. Question stop and source cancellation prevent old work from consuming a late answer.
119
159
 
120
- Clients enable the answer channel with `clientCapabilities.questions`, or with `--interaction questions` on the CLI. It defaults to false and is independent of lifetime. A Run allows up to 64 question identities by default, with an aggregate budget limited by 256 KiB and one third of the snapshot budget. It reserves space for the question identity, source, timestamps, options, terminal fields and largest legal answer before admission. A confirm reserves a boolean, a choice reserves its longest declared option ID, and a text question exposes `maxAnswerBytes` (16 KiB of JSON-encoded string, including quotes). The Session rechecks the source and authorization after asynchronous target lookup and checks for abort again after installing the listener. The default timeout is 60 seconds and the maximum is one hour. The final report retains the question dispositions. Without an answer channel the SDK reports unsupported before publishing a question.
160
+ Clients enable the answer channel with `clientCapabilities.questions`, or with `--interaction questions` in CLI RPC mode. It defaults to false and is independent of lifetime. A Run allows up to 64 question identities by default, with an aggregate budget limited by 256 KiB and one third of the snapshot budget. It reserves space for the question identity, source, timestamps, options, terminal fields and largest legal answer before admission. A confirm reserves a boolean, a choice reserves its longest declared option ID, and a text question exposes `maxAnswerBytes` (16 KiB of JSON-encoded string, including quotes). The Session rechecks the source and authorization after asynchronous target lookup and checks for abort again after installing the listener. The default timeout is 60 seconds and the maximum is one hour. The final report retains the question dispositions. Without an answer channel the SDK reports unsupported before publishing a question.
121
161
 
122
162
  ## JSONL RPC
123
163
 
@@ -125,11 +165,19 @@ An application can call SDK `runProjectRpc(session, input, write, launchDirector
125
165
 
126
166
  The project RPC server consumes the same Session as the process-local SDK. It reads strict UTF-8 lines separated by LF, with a command bound of 64 KiB. The wire record has `id`, `operation`, optional `input` and an optional mutation `requestId`. Existing clients use `id` as the mutation identity. Typed clients can choose a fresh transport ID while reusing the business request ID after an uncertain reply. `run`, `status`, `input` and `stop` retain their operation names. `describe`, `answer` and the fixed `agent.*` operations delegate to the corresponding Session methods. Status queries capture and write the current state synchronously. Other queries share an in-flight reply for matching IDs, reject changed arguments while that ID is pending, and release one of the 128 slots when the reply arrives or after 30 seconds. A reused read ID after release starts a fresh query. Answer, stop and mutation replay use independent admission. Dependencies, queues and mutation reconciliation belong to HarnessSession.
127
167
 
128
- The server writes `ready` with v1, Harness identity, descriptor and initial state, then writes separate reply, error, event and result records. A fresh status reply is queued synchronously with its captured state. `HarnessRpcClient` installs its read side before sending requests, correlates replies by ID, and gives a new subscriber that status snapshot before subsequent events. It exposes `ready` and the same methods as a direct Session. Its transport declaration describes the pipe and event methods it uses, so other package-root SDK consumers can still typecheck with a standard-library-only configuration. Transport disconnect rejects any unresolved final result. The caller manages its streams and subprocess. Unsubscribing leaves the Run open.
168
+ The server writes `ready` with v1, Harness identity, descriptor and initial state, then writes separate reply, error, event and result records. A fresh status reply is queued synchronously with its captured state. `HarnessRpcClient` installs its read side before sending requests, correlates replies by ID, and gives a new subscriber that status snapshot before subsequent events. It exposes `ready` and the same methods as a direct Session. Its transport declaration describes the pipe and event methods it uses, so other package-root SDK consumers can still typecheck with a standard-library-only configuration. Before `ready`, an error without a request ID is a terminal launch failure: it rejects readiness and waiting calls with the Host code, preserving bounded public messages for recognized module, configuration, Session and request errors. Unicode control and format characters (`Cc`/`Cf`), including line breaks and bidirectional controls, are escaped; arbitrary exception stacks/details and messages from unknown codes are not copied. A later EOF cannot replace that launch failure with `RPC_DISCONNECTED`. After readiness, unrelated reply/error IDs retain their existing ignore behavior. Transport disconnect rejects any unresolved final result. The caller manages its streams and subprocess. Unsubscribing leaves the Run open.
129
169
 
130
170
  The CLI flushes one output record at a time, with a five-second deadline per write. A new state event can replace the last unsent state event. Replies, errors, questions, operation changes, business events and the terminal result keep their place in the same queue. Queued data can total 1 MiB, with a single queued record allowed up to 8 MiB for a large reply or result. A full queue, oversized record or failing pipe stops the foreground Run with `output-failed`, discards unsent records and lets Run cleanup and reporting finish.
131
171
 
132
- Foreground task invocations continue to print one final result. Explicit interactive or question-enabled foreground invocations accept additional JSONL commands after automatic start. The ordinary explicit RPC entry requires a `run` command. The legacy `run-harness` TaskPool and PeerMesh frontends translate their input arguments to the same business handlers, retaining the inner request ID on that wire. Their old PeerMesh kickoff, wait, and project EOF exception keep their existing behavior. Harness RPC stops on EOF and supports one Run per process.
172
+ Foreground task invocations print one final result and do not accept questions
173
+ or interactive lifetimes. Use an explicit SDK client or `--mode rpc` for those
174
+ capabilities; the RPC entry requires a `run` command. First Harness defaults to
175
+ its preset channel and only asks when the client declares question support.
176
+ Its advanced `session.ts` demonstrates both direct SDK and JSONL question clients.
177
+ The legacy `run-harness` TaskPool and PeerMesh frontends translate their input
178
+ arguments to the same business handlers, retaining the inner request ID on that
179
+ wire. Their old PeerMesh kickoff, wait, and project EOF exception keep their
180
+ existing behavior. Harness RPC stops on EOF and supports one Run per process.
133
181
 
134
182
  ## Built-in owners and handoffs
135
183
 
@@ -149,7 +197,7 @@ For the ordinary TaskPool entry, Workspace reads and publication accept the same
149
197
 
150
198
  ## Compatible launch surfaces
151
199
 
152
- Previously generated Subagents hosts are still directly runnable through their own entry point. The installed aliases open the [streaming terminal](25-foreground-tui.md) with no arguments in an interactive terminal. Setup and doctor remain explicit commands. The previous explicit Notes and Messages fixtures exercise the fixed observation and undeclared random string scripts. The explicit PeerMesh JSON fixture and prior Lead–Worker staged or Orders paths retain their benchmark roles. FATE preparation, single run, matrix and rescoring use explicit flags. Each uses its own fixtures rather than the ordinary project command.
200
+ Previously generated Subagents hosts are still directly runnable through their own entry point. The previous explicit Notes and Messages fixtures exercise the fixed observation and undeclared random string scripts. The explicit PeerMesh JSON fixture and prior Lead–Worker staged or Orders paths retain their benchmark roles. FATE preparation, single run, matrix and rescoring use explicit flags. Each uses its own fixtures rather than the ordinary project command.
153
201
 
154
202
  [Prompt composition and exact texts](08-prompts.md) · [Workspace handoff](05-workspace-continuity.md) · [Report semantics](17-harness-reporting.md)
155
203
 
@@ -173,32 +221,46 @@ RPC query or mutation rejection carries the same recognized framework fields bes
173
221
 
174
222
  ## TypeScript author entry and source export
175
223
 
176
- `anyswarm run ./harness.ts` and `anys run ./harness.ts` start a child Node process
177
- with source maps enabled and forward the remaining arguments and standard streams.
224
+ `anyswarm run ./harness.ts` starts a child Node process
225
+ with source maps enabled and forwards the remaining arguments and standard streams.
178
226
  The parent forwards SIGINT and SIGTERM and returns the child's exit code. The
179
227
  child installs synchronous module hooks before loading the trusted author entry.
180
- These hooks transform `.ts` and `.mts` to ESM with inline source maps using Node's
181
- `stripTypeScriptTypes` transform mode, including enum syntax. They override the
228
+ These hooks lazily load the packaged SWC WebAssembly transformer for `.ts` and
229
+ `.mts` files. It compiles TypeScript constructs such as enums, erases explicit
230
+ type-only imports and exports, retains value imports and exports, and returns
231
+ ESM with inline source maps. The transformer preserves modern JavaScript syntax
232
+ and runs independently of Node's native type-stripping modes. Source read and
233
+ transform errors stop module loading before the Harness starts. The hooks override the
182
234
  surrounding package's CommonJS interpretation for these source files. A relative
183
- `.js` or `.mjs` import first resolves normally, then falls back to the corresponding
184
- `.ts` or `.mts` source when the JavaScript file is missing. Ordinary installed
235
+ `.js` or `.mjs` import, absolute path or `file:` URL first resolves normally, then
236
+ falls back to the corresponding `.ts` or `.mts` source when the JavaScript file is
237
+ missing. This also covers a CLI Harness path converted to a file URL, such as the
238
+ First Harness RPC client's `new URL('./harness.js', import.meta.url)`. The fallback
239
+ changes only the URL pathname extension, preserving encoded filenames and URL
240
+ identity. An existing JavaScript file remains preferred. Ordinary installed
185
241
  package resolution runs first. A missing `@anyswarm/core` dependency falls back to
186
242
  the invoking CLI's public SDK entry. No hook is installed merely by importing the
187
243
  SDK. The trusted Harness and configuration loading paths enable these same hooks,
188
244
  so explicit foreground/RPC and the legacy repository foreground runner can
189
245
  load TypeScript configuration modules as well.
190
246
 
191
- An entry without a default Harness executes as a normal TypeScript program with
247
+ The installed source-entry regression copies the package's four First Harness
248
+ TypeScript files into a directory without JavaScript or `dist`, invokes the local
249
+ CLI with the documented RPC command, and verifies admission and report creation
250
+ using an intentionally rejected configuration before Runtime allocation. The
251
+ release acceptance additionally runs that unchanged source client against the
252
+ same installed candidate and real Worker, checking the question, handoff, exported
253
+ bytes and cleanup alongside the compiled SDK/RPC paths.
254
+
255
+ An entry without a default Harness executes as an ordinary source program with
192
256
  its original argv. A default Harness with `apiVersion: 1` and `run` is dispatched
193
- through the same TUI, foreground or RPC host used by explicit `--harness`.
194
- With no arguments, a Harness supporting task lifetime receives a default prompt.
195
- An interactive-only Harness opens the TUI, which requires stdin and stdout to be
196
- terminals. Authors can pass `--mode tui`, `--prompt`, `--cwd`,
197
- `--config ./config.ts`, lifetime, output and RPC options. Explicit RPC and
198
- foreground invocations send top-level source and configuration logs to stderr.
199
- With no arguments, the loader inspects the effective TypeScript module source
200
- before evaluation. A TypeScript module without a default export and a legacy
201
- JavaScript entry stream stdout immediately, so they can prompt while evaluating.
257
+ through the same one-shot or RPC host used by explicit `--harness`. A source
258
+ entry accepts `--cwd`, `--config`, `--prompt` and `--output-dir`. Omitted prompt
259
+ uses `Run this Harness.` in one-shot mode. One-shot execution requests task
260
+ lifetime and provides no question channel. An interactive-only Harness needs an
261
+ explicit RPC or SDK client. RPC admits the first input over stdin.
262
+ The loader inspects the effective source before an implicit import. Modules
263
+ without a default export can stream stdout immediately.
202
264
  When a TypeScript entry could export a Harness,
203
265
  the first stdout write opens a private temporary file and unlinks its path.
204
266
  The loader starts replaying to stdout before input arrives when the module adds
@@ -210,18 +272,18 @@ import produced stdout and exports a task Harness, the implicit foreground comma
210
272
  exits 1 and requests an explicit `--prompt` before it admits a Run.
211
273
  For other imports, replay starts when evaluation returns or fails. The loader uses
212
274
  stderr for an implicit foreground Harness or a failed import, and stdout for a
213
- plain script or an interactive-only Harness. It restores the output writer,
275
+ plain script. It restores the output writer,
214
276
  removes its stdin listeners, restores its temporary `stdin.read` override and
215
277
  closes the temporary file. A script that exits
216
278
  directly during import writes pending output to stdout up to the stream's
217
279
  backpressure limit, or leaves an active replay's queued writes in order.
218
- Foreground results and RPC records retain their existing stdout protocol.
219
- Source entry, configuration import and Harness exceptions retain original source
220
- locations on stderr for the author command's foreground and RPC paths.
221
- In an ordinary non-Git author directory, generated
222
- Untracked top-level `node_modules`, `.anyswarm-sdk` and Code recovery directories named `.anyswarm-code-recovery-` plus a six-character suffix are excluded from project capture. Explicit Git-tracked files at those paths keep the tracked-file capture behavior.
280
+ A piped one-shot Run emits a single JSON result or launch error. RPC preserves
281
+ its JSONL protocol and bounded write queue regardless of terminal detection.
282
+ Source diagnostics and Harness console output go to stderr. Configuration
283
+ loading inside the Host records a stable configuration failure in the Run report.
284
+ In a non-Git author directory, untracked top-level `node_modules`, `.anyswarm-sdk` and Code recovery directories named `.anyswarm-code-recovery-` plus a six-character suffix are excluded from project capture. Explicit Git-tracked files at those paths keep the tracked-file capture behavior.
223
285
 
224
- `anys eject <code|autoresearch|super|example> --dir <target>` selects a packaged
286
+ `anyswarm eject <name> --dir <target>` selects a packaged
225
287
  application's `examples/<id>/eject.json`; `example` selects `examples/authoring`.
226
288
  The version-1 manifest names its TypeScript entry, an explicit file list and optional additional npm dependencies. The engine
227
289
  rejects absolute/traversal paths, private/runtime/build directories, secret-file
@@ -231,6 +293,16 @@ files, and renames the complete export into place. A nonempty target fails befor
231
293
  writes. Failures remove the temporary export. Applications without a source
232
294
  manifest return a reason identifying the missing application source.
233
295
 
296
+ The `subagents` manifest lists its project entry, business assembly, config,
297
+ controller, Service adapter, prompts and direct host demonstration. The
298
+ `parallel-swarm` manifest includes the actual phases, Board, evidence/export
299
+ validators and config. The `first-harness` manifest includes the handoff Service,
300
+ config, explicit SDK/RPC client and input directory. Each includes a local README
301
+ and downstream author `AGENTS.md`; the root repository's maintainer instructions
302
+ are not substituted for that guide. No new export wraps another bundled Harness
303
+ or imports a sibling example. Code, Super, AutoResearch and the zero-Runtime
304
+ authoring fixture retain their existing manifests.
305
+
234
306
  The exported package depends on `file:./.anyswarm-sdk/core.tgz`. That archive is
235
307
  repacked from the actual invoking SDK with lifecycle scripts disabled. The
236
308
  provenance file records the SDK name/version, npm installation source/integrity
@@ -240,7 +312,7 @@ under `sdk.content`. The current command also reads version 1 exports from the
240
312
  previous candidate. New exports omit the old fields so an older CLI rejects them
241
313
  before loading source. Build provenance is generated into the package by
242
314
  `scripts/build.ts`; it remains unknown when Git revision information was
243
- unavailable. Before evaluating the entry, `anys run` hashes the recorded inventory
315
+ unavailable. Before evaluating the entry, `anyswarm run` hashes the recorded inventory
244
316
  of its own executable package. It resolves `@anyswarm/core` from the author entry
245
317
  with Node's ESM conditions and the same CLI fallback used for imports. It checks
246
318
  that the resolved file belongs to the inventory and that all listed package files