@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
package/AGENTS.md CHANGED
@@ -1,16 +1,31 @@
1
1
  # AnySwarm — Coding Agent Instructions
2
2
 
3
- These instructions apply to **Coding Agents developing AnySwarm**, not research Agents running inside it. They define the human/Agent decision boundary and the project-specific rules for using the installed **Matt Pocock engineering skills**.
3
+ These instructions apply to **Coding Agents developing AnySwarm**, not research Agents running inside it. They define the development and release workflow, the human/Agent decision boundary, and project-specific engineering requirements.
4
+
5
+ ## Development and release workflow
6
+
7
+ Follow this complete loop for authorized work. The [development workflow](docs/workflows/development.md) provides commands; the [release guide](docs/workflows/release-and-docs-versioning.md) defines publication and recovery.
8
+
9
+ 1. **Agree on the change.** Read the applicable Issue and later owner decisions. Small documentation corrections can go directly to a focused PR. For behavior, API, architecture or research changes, establish scope and acceptance in an Issue or an explicit owner instruction before implementation. Use one Issue per complete implementation PR unless the owner requests another split.
10
+ 2. **Work on an isolated branch.** Keep the implementation, affected tests, public guides, examples and architecture explanation together. Follow the worktree placement rules below. Ordinary PRs leave the formal package version unchanged; user-visible changes belong in the root `CHANGELOG.md` `Unreleased` section, the canonical pending-change record. The release PR consolidates it into the bilingual release notes.
11
+ 3. **Verify while developing.** Run the relevant `npm run test:focus -- ...` selections and `git diff --check`; run type, documentation and website checks for affected paths. Fix failures within scope. Full local tests are needed for a suite-wide failure, an explicit acceptance requirement, or when CI cannot provide the required evidence.
12
+ 4. **Review the candidate.** Required Core and Website CI establish the merge gate. When Core CI selects the full suite, it builds and preserves a package candidate and runs installed-package checks against that archive with its recorded SHA-256. A version string alone does not identify a candidate. Do not replace a required archive check with a source-only check or count a skipped check as passing.
13
+ 5. **Merge and accumulate.** After authorized review and merge, `main` may continue receiving changes. A main push updates development documentation and runs CI; it does not publish a stable package. Keep ordinary bug fixes and features independent of a formal release.
14
+ 6. **Preview when requested.** With publication authorization, dispatch `release.yml` from `main` with `publish_next=true`. The workflow verifies an immutable candidate and assigns a unique prerelease version in staging, then publishes it to npm `next`. It does not change source package versions, create a stable tag or move npm `latest`. A preview is opt-in; publishing it is a separate action from creating or merging a PR.
15
+ 7. **Prepare a stable release.** A release PR updates the package and lockfile versions, consolidates the root pending-change record into the English and Chinese release notes, and updates migration and compatibility information together. Verify the candidate through the manual Release workflow with both publication inputs off. After approval and merge, the release owner creates the matching `vX.Y.Z` tag at the approved revision. The tag workflow verifies and distributes the same archive through GitHub and npm, then checks the public npm bytes and installed SDK/CLI.
16
+ 8. **Promote documentation and record evidence.** Once the exact stable package is publicly verified, review `website/docs-release.json` to bind the stable guides to that package and a compatible immutable documentation revision. Development guides follow `main` under `/docs/next/` and `/zh/docs/next/`. Documentation corrections can update the tracked documentation inputs without publishing another package. Record source commit, archive SHA-256, npm version/channel, checks and remaining gaps in the Issue/PR.
17
+
18
+ Implementation permission does not imply permission to merge, publish npm packages, create release tags, or expand experiment budgets. Continue all authorized preparation and verification before requesting any missing final approval.
4
19
 
5
20
  ## Current architecture and work requirements
6
21
 
7
22
  The [architecture manual](docs/architecture/INDEX.md) is the maintained description of the current implementation. The [SDK and user guides](docs/INDEX.md) describe its supported public surface and are also the website's content source. Current code and schemas establish exact behavior; tests and experiments establish what has been verified. Keep these sources aligned in the same PR.
8
23
 
9
- The [Core / Harness design](docs/designs/core-harness/README.md) and its linked extensions record reviewed product requirements and acceptance. Read them together with the relevant Issue and the owner's later explicit decisions; a later explicit decision supersedes an older conflicting clause without changing unrelated acceptance or resource limits. When an authorized change updates the design, include the design, implementation, migration, tests and documentation in the same PR. The design index links the [dynamic Lead-Worker extension](docs/designs/dynamic-lead-worker.md) and the open CLI/TUI work; current implemented behavior belongs in Architecture.
24
+ The [Core / Harness design](docs/designs/core-harness/README.md) and its linked extensions record reviewed product requirements and acceptance. Read them together with the relevant Issue and the owner's later explicit decisions; a later explicit decision supersedes an older conflicting clause without changing unrelated acceptance or resource limits. When an authorized change updates the design, include the design, implementation, migration, tests and documentation in the same PR. The design index links the [dynamic Lead-Worker extension](docs/designs/dynamic-lead-worker.md) and the scoped CLI work in [#351](https://github.com/AnySwarm/anyswarm/issues/351); current implemented behavior belongs in Architecture.
10
25
 
11
26
  Human-approved GitHub Issues and explicit user instructions define work requirements, scope, acceptance and resources. Read the full relevant Issue, linked tickets, comments and accepted Agent Brief. Cite the exact revision of any reviewed design and preserve its acceptance. Superseded phase plans remain in Git history and linked Issues. Resource, research, merge and publication permissions follow the project rules below.
12
27
 
13
- Use one Issue per complete implementation PR unless the owner explicitly requests a different split. Keep approvals, progress, dependencies and handoffs on GitHub. When source, the current manual and the approved change disagree, identify the discrepancy and resolve it within the authorized scope. Start from [docs/INDEX.md](docs/INDEX.md), [GLOSSARY.md](GLOSSARY.md), then the relevant source and tests; do not load every document by default.
28
+ Use one Issue per complete implementation PR unless the owner explicitly requests a different split; a small documentation correction does not need its own Issue. Keep approvals, progress, dependencies and handoffs on the applicable GitHub Issue/PR. When source, the current manual and the approved change disagree, identify the discrepancy and resolve it within the authorized scope. Start from [docs/INDEX.md](docs/INDEX.md), [GLOSSARY.md](GLOSSARY.md), then the relevant source and tests; do not load every document by default.
14
29
 
15
30
  ## Human decisions and delegated autonomy
16
31
 
@@ -20,9 +35,9 @@ Within an approved Issue, an Agent may select implementation details and autonom
20
35
 
21
36
  For a change not already authorized by an explicit owner instruction or the applicable Issue, return to the Issue for human review before changing intended behavior, acceptance criteria, architecture scope, research hypotheses, benchmark/checker/fixture, provider/model, or resource budget. Paid/external experiments require explicit authorization or a previously approved allowance. Technical difficulty does not confer permission to widen the Issue.
22
37
 
23
- ## Default engineering workflow — Matt skills
38
+ ## Engineering skills for coding agents
24
39
 
25
- Follow the **installed skills** when applicable; do not claim a skill ran if it is unavailable. These skills govern the engineering *procedure*, not product requirements or research approval.
40
+ Use the **installed Matt Pocock engineering skills** when applicable; do not claim a skill ran if it is unavailable. The development loop above also applies without those skills. Human contributors do not need to install agent skills. Skills govern the engineering *procedure*, not product requirements or research approval.
26
41
 
27
42
  - **`/to-spec`**: turn the agreed scope into a GitHub spec Issue using the current architecture, glossary, applicable reviewed design and later explicit owner decisions. Link the exact design revision and distinguish confirmed direction from proposals awaiting review.
28
43
  - **`/to-tickets`** (optional): propose complete vertical slices with blocking edges; obtain human agreement before publishing GitHub sub-Issues and dependencies. Keep the agreed one-Issue/one-PR boundary unless the owner requests another split.
package/README.md CHANGED
@@ -10,21 +10,21 @@
10
10
 
11
11
  <p><strong>Build your own multi-agent Harness.</strong></p>
12
12
 
13
- <p>A local-first TypeScript SDK and CLI for running isolated Agents, connecting them to shared Services, and observing checkable multi-agent Runs.</p>
13
+ <p>Build teams of isolated Agents that share findings, use host Services, and leave inspectable results. Define the workflow in TypeScript or adapt it with your Coding Agent.</p>
14
14
 
15
15
  <p>
16
- <a href="https://github.com/AnySwarm/anyswarm/releases"><img alt="Releases" src="https://img.shields.io/github/v/release/AnySwarm/anyswarm?style=flat-square&color=111318" /></a>
17
- <a href="https://github.com/AnySwarm/anyswarm/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/AnySwarm/anyswarm/ci.yml?branch=main&style=flat-square&label=CI" /></a>
16
+ <a href="https://github.com/AnySwarm/anyswarm/releases">GitHub Releases</a>
17
+ <a href="https://github.com/AnySwarm/anyswarm/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/AnySwarm/anyswarm/actions/workflows/ci.yml/badge.svg?branch=main" /></a>
18
18
  <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" /></a>
19
19
  <img alt="Node.js 22.19+" src="https://img.shields.io/badge/node.js-22.19%2B-16a34a?style=flat-square" />
20
20
  </p>
21
21
 
22
22
  <p>
23
+ <a href="https://anyswarm.github.io/anyswarm/trace-demo/index.html?run=p-limit-handoff">Replay a Real Run (No Install)</a> ·
23
24
  <a href="https://anyswarm.github.io/anyswarm/">Website</a> ·
25
+ <a href="docs/en/blog/100b-tokens.md">100B-Token Essay</a> ·
24
26
  <a href="docs/en/quickstart.md">Quickstart</a> ·
25
27
  <a href="docs/en/latest.md">Releases</a> ·
26
- <a href="docs/en/changelog.md">Changelog</a> ·
27
- <a href="docs/en/build-your-harness.md">Build a Swarm Harness</a> ·
28
28
  <a href="docs/zh/overview.md">中文文档</a>
29
29
  </p>
30
30
 
@@ -32,79 +32,91 @@
32
32
 
33
33
  ---
34
34
 
35
- AnySwarm separates **how Agents collaborate** from **how Agents are isolated and supervised**. You write the **Harness** — who starts work, what shared state and Services Agents can call, and what evidence establishes completion. The **Runtime** owns isolated OpenSandbox execution with a configured executor, host-gated model access, authenticated Service bridging, live observation, artifact collection, and verified cleanup.
35
+ AnySwarm separates **how Agents collaborate (the Harness)** from **how Agents are isolated, supervised, and observed (the Runtime)**. You write a lightweight TypeScript Harness — roles, host-governed Services, and stopping conditions. The Runtime owns isolated OpenSandbox execution, host-gated model & credential access, authenticated Service bridging, dual-layer observability for Coding Agents and humans, artifact collection, and verified `Stop → Export → Delete` cleanup.
36
+
37
+ > Read the architecture essay: **[What Burning 100B Tokens on Agent Swarms Taught Us](docs/en/blog/100b-tokens.md)** · **[中文版文章](docs/zh/blog/100b-tokens.md)**
36
38
 
37
39
  ## Why AnySwarm
38
40
 
39
- - **One Runtime, any topology** — Swap between recursive Subagents, leased TaskPool, PeerMesh, Substrate, or Lead-Worker without modifying the Runtime.
40
- - **Sandbox Provider interface** — Run `anyswarm setup --mode local`, or save an existing OpenSandbox endpoint and one Runtime callback with `anyswarm setup --mode existing`. Supply a custom Provider through the root SDK when you need a different Sandbox integration. Model API keys and external Service tokens stay on the trusted Controller.
41
- - **Configurable executors, models and file budgets** — Use an installed Pi or Codex, optionally pin its exact version, or select an image-installed adapter. Use Responses with Pi or Codex, Chat Completions with Pi, or a trusted Host transport. Configure import, live file operations and export separately.
42
- - **Single unified package** — `@anyswarm/core` bundles the TypeScript SDK, `anyswarm` CLI, `swarm` container CLI, built-in Harnesses, and the zero-dependency browser Trace Viewer (`anyswarm trace`).
41
+ - **Host-governed Services over raw A2A** — Natural-language chatter cannot enforce atomic leases or verify tests ran. Every shared state mechanism is a typed host Service with JSON Schema validation, per-profile ACLs, and an unforgeable `caller` identity.
42
+ - **OpenSandbox isolation, host-only keys** — Run `anyswarm setup` to prepare local Docker OpenSandbox (and scale to Kubernetes / MicroVMs via `SandboxProvider`). Model API keys stay on the host Controller; each integration explicitly controls any credentials granted to an Agent.
43
+ - **Observability built for Coding Agents & humans** — Partitioned per-agent archives plus replayable Service state let Coding Agents diagnose stalls without blowing context, and open directly in the zero-dependency browser Trace Viewer (`anyswarm trace`).
44
+ - **One Runtime, any coordination contract** — Swap between hierarchical Subagents, leased TaskPool, ScaleMAS-style Substrate, or leaderless AutoResearch in user-space TypeScript without changing the Runtime.
43
45
 
44
- ## Quick start
46
+ ## Real tasks, inspectable results
45
47
 
46
- Install the current stable CLI with Node.js 22.19+ and npm on Linux or macOS. Local OpenSandbox is separate: the current release requires a Linux Controller, Docker Engine and a supported npm-installed Pi or Codex. For native macOS local setup ([#339](https://github.com/AnySwarm/anyswarm/issues/339)), [install and start Docker Desktop for Mac](docs/en/quickstart.md#docker-on-macos) or start your existing local Linux container engine. The npm command does not install the engine.
48
+ **Repository handoff.** Give `subagents` a real project directory. Root delegates entry points and run instructions to one child, modules and tests to another, then combines their file-backed findings into `report.md`. Inspect the member messages, source reads and exported report in the same Run. The browser replay below shows this workflow on the p-limit repository.
47
49
 
48
- ```sh
49
- # 1. Install the released CLI
50
- npm install -g @anyswarm/core
51
- anyswarm --version
50
+ **AutoResearch.** Equal peers develop and review patches in separate Sandboxes. A host-controlled evaluator receives frozen candidates and records training and final results. The current [AutoResearch guide](docs/en/autoresearch.md) explains the FrontierCS-2 setup, candidate identities and evaluation boundary. The [recorded AutoResearch runs](https://github.com/AnySwarm/anyswarm/pull/359) preserve the real model, review, training and final evaluation evidence.
51
+
52
+ ## Quick start: hand off a real repository
52
53
 
53
- # 2. Prepare OpenSandbox and save its connection
54
- anyswarm setup --backend pi
54
+ [Open the p-limit replay](https://anyswarm.github.io/anyswarm/trace-demo/index.html?run=p-limit-handoff) and choose **Files & Results** to read the original `report.md`.
55
55
 
56
- # 3. Point AnySwarm at any streaming OpenAI Responses-compatible endpoint
57
- export ANYSWARM_MODEL_URL="https://api.openai.com/v1/responses"
58
- export ANYSWARM_MODEL_TOKEN="sk-..."
59
- export ANYSWARM_MODEL_ID="gpt-5-mini"
56
+ Use Node.js 22.19+ with npm. Install [AnySwarm 0.6.0](docs/en/latest.md#v060) for the Subagents export, or use [a matching source build](docs/en/quickstart.md#build-and-install-from-source-main). With an older installation, check the [guide for the current published package](https://anyswarm.github.io/anyswarm/docs/quickstart/).
60
57
 
61
- # 4. Run a built-in Harness against your project
62
- mkdir -p anyswarm-first-example
63
- cd anyswarm-first-example
64
- printf '# Hello from AnySwarm\n' > README.md
65
- anyswarm --harness subagents --prompt 'Read README.md and report its heading.' --output-dir ./runs
58
+ Start your local Docker engine and install a supported Pi or Codex backend. Use a streaming, tool-capable model you have access to. Setup checks infrastructure. Your model is exercised by the handoff itself.
66
59
 
67
- # 5. Inspect timelines, model exchanges, and artifacts in the built-in Trace Viewer
60
+ ```sh
61
+ anyswarm setup
62
+
63
+ export ANYSWARM_MODEL_URL='https://api.openai.com/v1/responses'
64
+ export ANYSWARM_MODEL_ID='gpt-5-mini'
65
+ export ANYSWARM_MODEL_TOKEN='<your-api-key>'
66
+
67
+ git clone https://github.com/sindresorhus/p-limit.git ./handoff-input
68
+ git -C ./handoff-input checkout --detach a8a6fbec4e0e866d6d779b10889bb4f5567e70eb
69
+ anyswarm eject subagents --dir ./handoff
70
+ (
71
+ cd ./handoff
72
+ npm install
73
+ npm start -- --config ./handoff-config.ts --cwd ../handoff-input \
74
+ --prompt 'Prepare an engineering handoff for this repository. Assign two different children: ask one to find its public entry points, exported types and how to run the repository checks, and ask the other to identify scheduling flow, core state and test coverage. Have both return independent concrete findings to Root with file paths and line numbers. Wait for both; cross-check their citations. Write a useful report.md with the architecture, verified commands, risks and open questions. Only create report.md; do not modify source, install dependencies or claim to have run checks you only read about.' \
75
+ --output-dir ../runs
76
+ )
68
77
  anyswarm trace --root ./runs --port 8787
69
78
  ```
70
79
 
71
- The [shell installer](docs/en/quickstart.md#1-install-anyswarm) also installs the CLI and enables `anyswarm update`. For an npm global install, update with `npm install -g @anyswarm/core@latest`.
80
+ The [independent VM runs](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753) used these time budgets with GPT-6.1 Sol. The exported configuration allows 360 seconds of work, 70 seconds per model request and 60 seconds for cleanup. It requires `report.md` as the sole collected file. Change the model settings to match your provider. To investigate your own project, replace `../handoff-input` with its path. Agents receive private copies. Look for the archived report in the printed artifact paths under `./runs`.
81
+
82
+ Check that the two delegated checks actually occurred, that `report.md` cites the captured files, and that export and cleanup completed. Generic Subagents records `acceptance: not-run`: Agent completion and exported bytes do not prove the report's conclusions. Repository size, model behavior and environment affect runtime. The [Quickstart](docs/en/quickstart.md) covers setup, timeouts and inspection.
72
83
 
73
- The installed SDK builds the local Worker using its bundled materials and the selected host executor. Set `ANYSWARM_WORKER_IMAGE` when using a custom Worker image. Use `--harness` to select any built-in (`subagents`, `taskpool`, `peermesh`, `substrate`, `lead-worker`, `notes`, `messages`), a local ESM module, or an installed package. In `--mode rpc`, tasks arrive over JSONL with live `status` and `stop` control.
84
+ To opt into a published preview, install `@anyswarm/core@next` explicitly and
85
+ record `anyswarm --version`. Next documentation follows `main` and may be newer
86
+ than the last preview package. For exact reproduction, use the installed
87
+ package's examples or a candidate archive with its recorded commit and SHA-256.
74
88
 
75
- ## Build with the TypeScript SDK
89
+ ## Build with the SDK or your Coding Agent
76
90
 
77
- Install the TypeScript SDK in your Node.js project.
91
+ Use the SDK tutorials in order: [First Harness](docs/en/first-harness.md) teaches a two-Agent Service handoff and exact exported-byte checks; [Parallel Swarm](docs/en/build-your-harness.md) adds three researchers, peer review and synthesis. Both use the same public Harness interface and one Runtime for the team.
92
+
93
+ Use AnySwarm 0.6.0 or a [matching source build](docs/en/quickstart.md#build-and-install-from-source-main) for these tutorials. When testing a candidate, retain its source commit and archive hash. The two eject targets first ship in 0.6.0.
78
94
 
79
95
  ```sh
80
- npm install @anyswarm/core
96
+ anyswarm eject parallel-swarm --dir ./my-harness
97
+ cd ./my-harness
98
+ npm install
81
99
  ```
82
100
 
83
- [v0.5.0](docs/en/latest.md#v050) is the first supported release of `@anyswarm/core`. Import Runtime, Service and Sandbox Provider APIs from this package. The [SDK reference](docs/en/reference/api.md#install-the-sdk) also covers verified source archives. The [First Harness tutorial](docs/en/first-harness.md) copies examples from the installed SDK.
101
+ ### Copy Prompt for Claude Code / Codex / Cursor
84
102
 
85
- - Core building blocks & Swarm tutorial: [Sandboxes](docs/en/sandbox.md) · [Runtime](docs/en/runtime.md) · [Agents](docs/en/agents.md) · [Host Gateway](docs/en/gateway.md) · [Services](docs/en/services.md) · [Build a Swarm Harness](docs/en/build-your-harness.md)
86
- - Minimal runnable two-Agent script: [`examples/messages/handoff.ts`](examples/messages/handoff.ts)
87
- - Exact signatures, CLI flags, and types: [API Reference](docs/en/reference/api.md) · [CLI Reference](docs/en/reference/cli.md) · [Types & Source Map](docs/en/reference/types.md)
103
+ The exported `AGENTS.md` is written for authors of their own Harness. The repository's [AGENTS.md](AGENTS.md) governs maintenance of AnySwarm itself.
88
104
 
89
- ## Built-in Harnesses
105
+ ```text
106
+ Help me adapt AnySwarm to my workflow. First confirm that the installed AnySwarm CLI supports `anyswarm eject parallel-swarm --dir ./my-harness`. Export it if ./my-harness does not already exist. Read ./my-harness/AGENTS.md and README.md, then the installed @anyswarm/core types. Ask me for the business objective, input directory, and acceptance criteria if they are missing. Modify the exported Harness using public SDK APIs, one Runtime for the team, private Agent workspaces, and host Services for shared state. Keep report export, evidence checks, timeouts, and cleanup explicit. Run the available local checks, then explain how to run it and what those checks do and do not verify. Do not overwrite my source project or start a paid model run without my approval.
107
+ ```
90
108
 
91
- The repository includes five substantial Harnesses sharing the same Runtime with different collaboration policies:
109
+ ## Three paths through the examples
92
110
 
93
- | Harness | How Agents coordinate | Start here |
94
- | --- | --- | --- |
95
- | **Subagents** | A parent creates and directs children through a scoped Service; Pi can fork conversation context. | [Guide](docs/en/harnesses/subagents.md) · [Example](examples/subagents/README.md) |
96
- | **TaskPool** | Agents exclusively claim leased Tasks and publish Materials and Workspace revisions toward a shared Mission. | [Guide](docs/en/harnesses/taskpool.md) · [Example](examples/taskpool/README.md) |
97
- | **PeerMesh** | Peers coordinate with Git, Mattermost messages, and a shared Board, each with its own identity and branch. | [Guide](docs/en/harnesses/peermesh.md) · [Example](examples/peermesh/README.md) |
98
- | **Substrate** | A fixed peer pool publishes, searches, reads, and cites immutable contributions (with optional Lean/FATE checking). | [Guide](docs/en/harnesses/substrate.md) · [Example](examples/substrate/README.md) |
99
- | **Lead-Worker** | A lead and fixed or dynamic helpers coordinate through a Board and retain deliveries in Git. | [Guide](docs/en/harnesses/lead-worker.md) · [Example](examples/lead-worker/README.md) |
111
+ All live examples need the common Runtime setup and model access. “No extra services” means their host creates the business Services locally; it does not remove Docker/OpenSandbox or model requirements.
100
112
 
101
- Use the [first SDK Harness](docs/en/first-harness.md) to write one two-Agent
102
- definition for `createHarnessSession`, explicit foreground and RPC. The Run
103
- handle manages input, questions, observations and completion.
104
-
105
- See [example dependencies and ownership](examples/README.md) and [common deployment](deploy/README.md) for the services each mechanism needs.
113
+ | Tier | Purpose | Entry points and requirements |
114
+ | --- | --- | --- |
115
+ | **1 · Start and learn** | One useful CLI task, then two SDK lessons | [Subagents repository handoff](docs/en/quickstart.md); [First Harness](docs/en/first-harness.md) → [Parallel Swarm](docs/en/build-your-harness.md). |
116
+ | **2 · Applications and topology references** | Understand an application, or adapt a collaboration policy | [AutoResearch](docs/en/autoresearch.md), with its current FrontierCS-2 requirements; [Subagents](docs/en/harnesses/subagents.md), [TaskPool](docs/en/harnesses/taskpool.md) and [Substrate](docs/en/harnesses/substrate.md), with local business Services. |
117
+ | **3 · Advanced source and integrations** | Study routing, protocols, or external collaboration systems | `super`, `code`, `harness-session`, and focused Service examples. [PeerMesh](docs/en/harnesses/peermesh.md) needs Gitea, Mattermost, MySQL and its Board process; [Lead-Worker](docs/en/harnesses/lead-worker.md) needs Gitea. Code development is paused. |
106
118
 
107
- Compare mechanisms in [Choose a Harness](docs/en/harnesses/index.md) or write your own in [Build Your Own Harness](docs/en/build-your-harness.md).
119
+ See the [complete example index](examples/README.md) for implementation ownership, input/output contracts and status, or [choose a Harness](docs/en/harnesses/index.md) by collaboration mechanism.
108
120
 
109
121
  ## Built-in Trace Viewer
110
122
 
@@ -128,11 +140,13 @@ When started inside an SSH session, `anyswarm trace` prints the matching `ssh -N
128
140
  git clone https://github.com/AnySwarm/anyswarm.git
129
141
  cd anyswarm
130
142
  npm ci --ignore-scripts
131
- npm run build
132
- npm test
143
+ npm run typecheck
144
+ npm run test:focus -- test/core-thinking-levels.test.ts
133
145
  ```
134
146
 
135
- See [CONTRIBUTING.md](CONTRIBUTING.md), [Development Workflow](docs/workflows/development.md), and [SECURITY.md](SECURITY.md).
147
+ These deterministic checks do not need a model account or running Sandbox.
148
+ Ordinary PRs merge into `main` without a version bump or npm publication; a
149
+ release PR prepares the stable version. See [CONTRIBUTING.md](CONTRIBUTING.md), [Development Workflow](docs/workflows/development.md), and [SECURITY.md](SECURITY.md).
136
150
 
137
151
  ## License
138
152
 
@@ -1,31 +1,68 @@
1
1
  # Examples and Service integrations
2
2
 
3
- The five collaboration examples demonstrate different policies built on the
4
- public `@anyswarm/core` Runtime, Sandbox and Service APIs. Choose one mechanism,
5
- prepare its listed dependencies, and give it a **project directory and prompt**.
6
- A Task/Mission database, Board, chat service or Git workflow belongs to the
7
- example that uses it.
3
+ Choose an example by the task and the collaboration policy you need. A normal
4
+ Harness uses one Runtime to own its Agents, private Sandboxes and authenticated
5
+ Services. The examples also retain direct Runtime scripts, Service adapters and
6
+ zero-Runtime protocol fixtures where those teach a specific API more clearly.
8
7
 
9
- Start with the [first SDK Harness](../docs/en/first-harness.md) for one real
10
- Publisher and Writer, their Service handoff, a user answer and verified
11
- artifact export. Its same default definition is used by SDK, foreground and
12
- RPC. [HarnessSession clients](harness-session/README.md) exercise the public
13
- protocol with a zero-Runtime fixture.
8
+ ## Start with a real repository question
14
9
 
15
- ## Choose a collaboration example
10
+ [Subagents](subagents/README.md) can prepare an engineering handoff for a real
11
+ local repository: Root delegates entry/configuration and modules/tests reading,
12
+ receives child findings, then writes a source-backed `report.md`. Replace the
13
+ question or directory to investigate your own work. There is no planted defect
14
+ or predetermined report.
16
15
 
17
- | Directory | Coordination | Services created by the example | Facilities you supply |
18
- | --- | --- | --- | --- |
19
- | [subagents](subagents/README.md) · [Host](subagents/business.ts) | A root delegates to children and integrates their replies. | In-process collaboration Service. | OpenSandbox, Worker image and model endpoint. |
20
- | [taskpool](taskpool/README.md) · [Host](taskpool/harness/harness.ts) | Agents discover and exclusively claim Tasks against a Mission Workspace. | Task/Context stores and Workspace coordination in the run directory. | Common infrastructure; optional checker/search dependencies only when explicitly configured. |
21
- | [peermesh](peermesh/README.md) · [Host](peermesh/harness/team.ts) | Peers coordinate through Board, chat and Git. | Per-run identities, repository/channel, Board process and Service adapters. | Gitea, Mattermost, pinned Board source/Python dependencies and initialized MySQL. |
22
- | [lead-worker](lead-worker/README.md) · [Host](lead-worker/harness/index.ts) | A Lead assigns work and integrates Worker output. | SQLite Board, scoped Git identities and adapters; optional dynamic checker service. | Gitea; Docker checker image for dynamic mode. |
23
- | [substrate](substrate/README.md) · [Host](substrate/harness/index.ts) | Peers publish, retrieve and cite contributions. | SQLite publication Service. | Common infrastructure. The explicit FATE benchmark also needs Lean/Mathlib/checker dependencies. |
16
+ ```sh
17
+ anyswarm --harness subagents --cwd /absolute/path/to/project \
18
+ --prompt 'Prepare an engineering handoff. Delegate entry points and configuration to one child, and modules and tests to another. Check their findings and write report.md with relative source paths and line ranges. Separate facts, inferences and checks not performed. Do not modify project source.' \
19
+ --output-dir /absolute/path/to/runs
20
+ anyswarm trace --root /absolute/path/to/runs --open
21
+ ```
24
22
 
25
- PeerMesh and Lead-Worker require an enforced network allowlist for native Git.
26
- Use an OpenSandbox deployment configured for `dns+nft`, and verify that the
27
- Workers can reach the configured Git origin under its platform policy. See the
28
- [deployment requirements](../docs/architecture/16-pi-opensandbox-backend.md).
23
+ Complete `anyswarm setup` and configure a tool-capable model first. The host
24
+ captures one input snapshot; members work in separate copies, and exported
25
+ results do not overwrite the local source. Generic Subagents reports business
26
+ acceptance as `not-run`. Inspect the contributions, citations, exported report
27
+ and original cleanup receipt. A finished model turn is not a quality verdict.
28
+
29
+ ## Three levels
30
+
31
+ | Level | Examples | Purpose and facilities |
32
+ | --- | --- | --- |
33
+ | 1: first use and SDK learning | [subagents](subagents/README.md), then [first-harness](first-harness/README.md) and [parallel-swarm](parallel-swarm/README.md) | A useful repository task; authenticated Service handoff and exact bytes; fixed parallel investigation and peer review. Saved Sandbox/executor plus a model endpoint, with no additional business services. |
34
+ | 2: applications and built-in coordination | [autoresearch](autoresearch/README.md); [subagents](subagents/README.md), [taskpool](taskpool/README.md), [substrate](substrate/README.md) | AutoResearch's research/evaluator application; dynamic delegation, exclusive Task leases and Workspace integration, or an immutable citation DAG. FrontierCS-2 has substantial judge/build resources; see #337 for the configurable example and real-model evidence. |
35
+ | 3: advanced source and integrations | [super](super/README.md), [code](code/README.md), [harness-session](harness-session/README.md), [peermesh](peermesh/README.md), [lead-worker](lead-worker/README.md) | Background routing, candidate patches and SDK/RPC questions; heavy Git/chat/database integrations. These are not equivalent first-run choices. Code core development is paused. |
36
+
37
+ AutoResearch's complete application and new real-model acceptance are owned by
38
+ [#337](https://github.com/AnySwarm/anyswarm/issues/337). This examples update does
39
+ not change its evaluator, provider, resources or acceptance criteria.
40
+
41
+ ## Source and verification inventory
42
+
43
+ The table records what was changed or deliberately retained in #335. Follow the
44
+ local README for full commands and evidence. “Controlled tests” describe API and
45
+ failure-path coverage, not an assertion that a new real-model run succeeded.
46
+
47
+ | Example / treatment | Input and output | Main editable source | Objective checks and limits |
48
+ | --- | --- | --- | --- |
49
+ | [subagents](subagents/README.md): retain controller; add real task recipe and full eject | Captured directory + prompt → Root's collected files and collaboration state. | `project.ts`, `business.ts`, `config.ts`, `harness/controller.ts`, `services/`, `prompts/` | Existing caller, delivery, collection and pending-cleanup tests; source/export tests. Generic acceptance remains `not-run`; [Two real repository handoffs verified](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753). |
50
+ | [first-harness](first-harness/README.md): simplify lifecycle/configuration; default no questions; add eject | Prompt + preset/explicit channel → Publisher/Service/Writer handoff and `delivery.txt`. | `harness.ts`, `config.ts`, `handoff.ts`, `session.ts` | Authenticated publication/retrieval and exact sandbox/exported bytes. Explicit SDK/RPC questions remain. Controlled regression and installed-client gates are separate from native/model evidence. |
51
+ | [parallel-swarm](parallel-swarm/README.md): configure, verify evidence, preserve receipts; add eject | Captured repository + question → three investigators, two rounds, Board findings, synthesized `report.md`. | `harness.ts`, `config.ts`, `board.ts`, `board-service.ts`, `report.ts` | Each member contributes and cross-reviews; source path/line/excerpt checks; required report export. Does not prove semantic correctness or completeness. [Two real-model runs verified collaboration and export](https://github.com/AnySwarm/anyswarm/issues/335#issuecomment-7399586208). |
52
+ | [taskpool](taskpool/README.md): retain normal Harness | Directory + Mission prompt → Tasks, exclusive Execution leases, Workspace revisions and integrated files. | `project.ts`, `config.ts`, `harness/`, `services/` | Existing lease, fencing, publication and collection tests. No independent domain checker by default: acceptance `not-run`. Stores are created locally by the Harness. |
53
+ | [substrate](substrate/README.md): retain normal Harness | Directory + question → immutable publications and references in a citation DAG. | `project.ts`, `project-config.ts`, `harness/`, `services/` | Existing publication identity/reference/idempotency and cleanup tests. Local SQLite; generic acceptance `not-run`. The FATE benchmark has its own dependencies and checker. |
54
+ | [lead-worker](lead-worker/README.md): retain heavy integration | Captured project + assignments → scoped Git branches, read feedback and Lead submission. | `project.ts`, `project-config.ts`, `harness/`, `services/` | Existing Board/Git delivery checks and package tests. Requires Gitea; dynamic checker requires its Docker image. Fixture acceptance does not establish arbitrary task correctness. |
55
+ | [peermesh](peermesh/README.md): retain heavy integration | Captured project + work window → Board/chat/Git coordination and pinned main export. | `project.ts`, `project-config.ts`, `harness/`, `services/` | Existing identity, routed input, merge and cleanup tests. Requires Gitea, Mattermost, pinned Board/Python dependencies and initialized MySQL. |
56
+ | [notes](notes/README.md): retain both entries; correct stale helper description | Project observation, or explicit fixed fact → Service handoff and reader/follow-up files. | `project.ts`, `main.ts`, `config.ts`, `notes.ts` | Actual author/read records and exact exported bytes. Shared input/report helpers come from the public SDK, not removed adjacent files. |
57
+ | [messages](messages/README.md): retain adapter and direct host | Project observation, or random handoff text → exact received file. | `project.ts`, `handoff.ts`, `handoff-config.ts`, `messages.ts` | In-process or attached HTTP Service, per-role grants and bytes. An attached service keeps its original owner; close does not stop it. |
58
+ | [agent-session.ts](agent-session.ts): retain direct Runtime script | Explicit Runtime configuration, Profile and prompt → session observations and raw stop/close receipts. | `agent-session.ts` | Demonstrates configuration, context delivery, message/stat reads and bounded waits. It is not a business acceptance Harness. |
59
+ | [services](services/README.md): retain individual adapters | Operation-specific input → Service responses/state or controlled process lifecycle. | Each directory's `host.ts`, `run.ts`, adapters and manifests | Persistent Board, Agent Control and MCP have distinct lifecycle/authorization checks. GitHub Issues needs authenticated `gh`; Mathlib Search needs its explicit provider. |
60
+ | [harness-session](harness-session/README.md), [authoring](authoring/README.md): retain fixtures | Questions/input or simple configuration → deterministic local result. | `harness.ts` and SDK/RPC clients; authoring `business.ts` | Zero Runtime: protocol and source-authoring examples, not evidence of multi-Agent execution. |
61
+ | [super](super/README.md), [code](code/README.md): retain advanced applications | GitHub routing or bounded patch work with application-specific facilities. | Local README and source manifests | Core product changes are outside this ticket; no interactive Code first-run promotion. |
62
+
63
+ PeerMesh and Lead-Worker need the documented native-Git network policy in
64
+ addition to their services. They are heavy integration references, not
65
+ “zero-dependency” alternatives.
29
66
 
30
67
  ## Run an example from its directory
31
68
 
@@ -34,26 +71,38 @@ Prepare OpenSandbox, the Worker and a model route using
34
71
  checkout. Install either the published SDK or a verified candidate archive,
35
72
  then copy that installed SDK's example sources into your project. This keeps
36
73
  the source and API together even when a candidate and release share a version
37
- number.
74
+ number. The stable example below pins `0.5.2` and uses its supported `run`
75
+ command. Examples checked out from `main` must use a matching source candidate
76
+ rather than an older installed SDK.
38
77
 
39
78
  ```sh
40
79
  npm init -y
41
- npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
80
+ npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.2}"
42
81
  sdk=node_modules/@anyswarm/core
43
82
  cp -R "$sdk"/examples/subagents demo
44
83
  cd demo
45
- ../node_modules/.bin/anys run ./project.ts --cwd /absolute/path/to/project --prompt 'Implement and verify the requested change'
84
+ ../node_modules/.bin/anyswarm run ./project.ts --cwd /absolute/path/to/project --prompt 'Implement and verify the requested change'
46
85
  ```
47
86
 
87
+ To test a published preview instead, install `@anyswarm/core@next` with
88
+ `--save-exact` in the empty project, then copy the examples from that installed
89
+ package as above. Record the resolved prerelease version and preserve the lockfile.
90
+ The website's Next channel follows `main` and can be ahead of that package; its
91
+ bundled documentation and examples describe the installed revision.
92
+
48
93
  For another collaboration mechanism, replace `subagents` in the copy command
49
94
  with `taskpool`, `peermesh`, `lead-worker` or `substrate`. The copied project
50
95
  resolves the SDK from its parent installation. The CLI loads TS directly, including multi-file imports and TS configuration.
51
96
 
52
- For current repository sources, build the matching SDK archive from that
53
- checkout's root first. Record its commit and SHA-256, and set the absolute
54
- archive path before running the commands above.
97
+ ### Build and eject this checkout’s source
98
+
99
+ For a released built-in, use the normal CLI alias. For editable examples, install
100
+ a matching SDK candidate outside the checkout. The new `first-harness`,
101
+ `parallel-swarm` and `subagents` eject manifests are **not included in 0.5.2**.
102
+ Until a release includes them, build or obtain a candidate from this source:
55
103
 
56
104
  ```sh
105
+ # From the candidate source checkout:
57
106
  npm ci --ignore-scripts
58
107
  pack_dir=$(mktemp -d)
59
108
  archive=$(npm run --silent pack:release -- "$pack_dir")
@@ -61,60 +110,72 @@ sha256sum "$archive"
61
110
  export ANYSWARM_SDK_ARCHIVE="$archive"
62
111
  ```
63
112
 
64
- When editing an existing example directly in this checkout, install this
65
- archive with `npm install --no-save "$ANYSWARM_SDK_ARCHIVE"` in that example's
66
- directory before running its TypeScript entry.
113
+ Record the source commit and archive digest. In an empty directory outside that
114
+ checkout, install those exact bytes:
67
115
 
68
- Use the example's README for its configuration and external facilities.
69
- Run `anys run /absolute/path/to/example/project.ts --prompt '…'` from
70
- the input project to use the same editable example from elsewhere. The
71
- CLI also includes each example's built-in name as a convenience. The host
72
- captures the initial directory and writes outputs outside it by default.
73
- Use `--config ./config.ts` for trusted TypeScript run configuration.
116
+ ```sh
117
+ npm init -y
118
+ npm install --ignore-scripts "$ANYSWARM_SDK_ARCHIVE"
119
+ npm exec -- anyswarm eject parallel-swarm --dir ./my-swarm
120
+ cd my-swarm
121
+ npm install
122
+ npm start -- --cwd /absolute/path/to/project \
123
+ --prompt 'Explain the execution path, configuration and test coverage for the behavior we plan to change.' \
124
+ --output-dir /absolute/path/to/runs
125
+ ```
74
126
 
75
- The model, executor and Sandbox environment variables are documented in
76
- [Quickstart](../docs/en/quickstart.md). Existing scoped variables remain
77
- fallbacks. Separate benchmarks take explicit configuration and fixtures.
78
- See [FATE](../benchmarks/fate/README.md) and [Lead–Worker Orders](../benchmarks/lead-worker-orders/README.md).
127
+ Common model/executor environment settings take precedence over scoped
128
+ fallbacks; setup supplies the saved Sandbox connection and executor. Explicit
129
+ `--config ./config.ts` selects the complete trusted configuration. Input files,
130
+ model credentials and output directories have separate roles: keep credentials
131
+ on the host and put Run output outside the investigated repository.
79
132
 
80
- ## Export an editable Harness
133
+ For other collaboration examples, copy the complete directory from the same
134
+ installed SDK and run its local `project.ts` with `anyswarm run`. The existing
135
+ per-example package/build route remains supported:
81
136
 
82
137
  ```sh
83
- anys eject example --dir ./my-harness
84
- cd my-harness
85
- anys run ./harness.ts
138
+ sdk=node_modules/@anyswarm/core
139
+ cp -R "$sdk"/examples/taskpool demo
140
+ cd demo
141
+ ../node_modules/.bin/anyswarm run ./project.ts \
142
+ --cwd /absolute/path/to/project --prompt 'Your actual task'
86
143
  ```
87
144
 
88
- Edit `business.ts` and run it again to see your own result. Export includes the
89
- complete source and an SDK archive dependency bound to that package's contents.
90
- Run `npm install` to install that local archive when moving the export to another
91
- machine. `anyswarm-source.json` records source revision, SDK source, content and
92
- archive digests. Application teams register the same source manifest for
93
- `anys eject code`, `anys eject autoresearch` and `anys eject super`.
94
-
95
- ## Smaller SDK tutorials
145
+ ## Export an editable Harness
96
146
 
97
- | Example | Host entry | What to verify |
98
- | --- | --- | --- |
99
- | [First Harness](../docs/en/first-harness.md) | [harness.ts](first-harness/harness.ts) | Publisher and Writer handoff, answer, and exact exported bytes. |
100
- | [Parallel Swarm](../docs/en/build-your-harness.md) | [harness.ts](parallel-swarm/harness.ts) | Parallel research, peer review and synthesis through a shared Board. |
101
- | [Notes](notes/README.md) | [main.ts](notes/main.ts) | Writer and reader share a custom Service and verify the result. |
102
- | [Messages](messages/README.md) | [handoff.ts](messages/handoff.ts) | Two-Agent handoff and file verification with an in-process or attached HTTP Service. |
103
- | [Persistent Board](services/persistent-board/README.md) | [run.ts](services/persistent-board/run.ts) | A replacement reader sees the original committed entry. The local adapter exports state for the Viewer. |
104
- | [Agent Control](services/agent-control/README.md) | [main.ts](services/agent-control/main.ts) and [run.ts](services/agent-control/run.ts) | The lead creates, reads, sends to and stops its child. The Host reports the close receipt. |
105
- | [Managed MCP and process](services/mcp-managed/README.md) | [host.ts](services/mcp-managed/host.ts) and [run.ts](services/mcp-managed/run.ts) | MCP results, owned and attached lifecycles, and original-process cleanup after Controller loss. |
106
-
107
- The [Service examples index](services/README.md) also links the optional
108
- [GitHub Issues](services/github-issues/README.md) and
109
- [Mathlib Search](services/mathlib-search/README.md) providers.
110
-
111
- Read the Host entry for Worker settings, the named registrations and each
112
- Profile’s grants. Follow the runner for Agent input, business checks and the
113
- close receipt. Each example's README gives its launch and evidence paths.
114
-
115
- ## Repository boundaries
116
-
117
- Each project owns its collaboration and Services. Its TypeScript imports the
118
- package root and uses a local ESM project entry. The CLI built-in aliases load
119
- the bundled copies of those same entries. See the [Harness author contract](../docs/architecture/23-project-harness.md#authoring-an-example)
120
- and the [repository migration](../docs/designs/repository-layout.md).
147
+ Use **`parallel-swarm`** to start from readable fixed collaboration, `subagents`
148
+ for dynamic delegation, or `first-harness` to learn Service handoff. Their source
149
+ manifests include the actual configuration, business/controller code, Services
150
+ and an application-author `AGENTS.md`. No export depends on a sibling example.
151
+
152
+ `anyswarm-source.json` records source and SDK content/archive identity;
153
+ `.anyswarm-sdk/core.tgz` is the local SDK dependency. Run `npm install` and use
154
+ the exported project's `npm start` to preserve that identity. Edit the visible
155
+ business source and test the changed behavior with a real question. The root
156
+ repository's maintainer `AGENTS.md` is not the downstream author guide.
157
+
158
+ `anyswarm eject example --dir ./protocol-example` continues to export the
159
+ zero-Runtime authoring fixture. Code, Super and AutoResearch retain their own
160
+ application manifests and dependency requirements.
161
+
162
+ ## Evidence handoff and remaining real runs
163
+
164
+ The new source-export/configuration/Board tests are deterministic API checks.
165
+ Installed-package checks execute copied source outside repository ancestry and
166
+ verify matching SDK bytes. Record their exact command and candidate identity in
167
+ the implementation PR. They do not substitute for native Sandbox execution.
168
+
169
+ Before publishing a new real-use Trace, run the Subagents handoff on a real
170
+ repository and a second question or directory; inspect child contributions,
171
+ Root's citations and report. Run the exported Parallel Swarm with a real model,
172
+ then change its question or visible business code and inspect the new findings.
173
+ Keep the model/executor, source snapshot, duration, artifacts and cleanup with
174
+ each Run. The owner has deferred these real-model acceptance runs; do not relabel
175
+ the website's current controlled Trace fixture as that evidence.
176
+
177
+ The [public guides](../docs/INDEX.md) and website consume these contracts under
178
+ [#358](https://github.com/AnySwarm/anyswarm/issues/358). Source code, configurations
179
+ and checks remain owned by the examples. See the
180
+ [Harness author contract](../docs/architecture/23-project-harness.md#authoring-an-example)
181
+ for the public SDK and lifecycle boundaries.
@@ -3,17 +3,17 @@
3
3
  Run this complete example with the installed AnySwarm CLI.
4
4
 
5
5
  ```sh
6
- anys run ./harness.ts
7
- anys run ./harness.ts --config ./config.ts --prompt 'Create a greeting'
6
+ anyswarm run ./harness.ts
7
+ anyswarm run ./harness.ts --config ./config.ts --prompt 'Create a greeting'
8
8
  ```
9
9
 
10
10
  Edit `business.ts` and run the command again to change the result. `harness.ts`
11
11
  defines the Harness lifecycle, `business.ts` contains its rule, and `config.ts`
12
12
  provides its default public configuration. This example uses no model or Sandbox.
13
13
 
14
- `anys eject example --dir ./my-harness` exports these sources and a local SDK
14
+ `anyswarm eject example --dir ./my-harness` exports these sources and a local SDK
15
15
  archive. The generated package depends on that archive, so `npm install` retains
16
- the exact candidate SDK. Direct `anys run` can also resolve the invoking CLI's SDK.
16
+ the exact candidate SDK. Direct `anyswarm run` can also resolve the invoking CLI's SDK.
17
17
  Use the same candidate CLI recorded in `anyswarm-source.json`.
18
18
 
19
19
  Application authors use the same export mechanism by providing `eject.json` in