@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
@@ -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
@@ -1,33 +1,125 @@
1
- # AutoResearch
1
+ # AutoResearch with FrontierCS-2
2
2
 
3
- An AutoResearch Run starts equal peers in separate AnySwarm Sandboxes. Each peer chooses a direction, writes a patch, and can read, review and build on another peer's patch. The Harness provides the shared research Service and enforces the team's budget. A trusted evaluator decides whether a candidate is valid and returns the score used for selection.
3
+ Run a team of independent research peers on the official `binary_fuse_filter` task. The peers write patches, inspect each other's work and share train feedback. At the end, the trusted evaluator runs the official final on the selected patch. Open Trace Viewer during the run or replay it afterward.
4
4
 
5
- ## FrontierCS-2 quickstart
5
+ ## 1. Install and choose your backend
6
6
 
7
- Use a Linux x86-64 machine with Git LFS, Python 3, a local Docker daemon and an existing authenticated OpenSandbox deployment with `dns+nft` egress. Prepare a supported Pi Worker using the normal AnySwarm setup flow. Configure the existing Kimi K3 Responses route using `ANYSWARM_MODEL_URL`, `ANYSWARM_MODEL_TOKEN`, `ANYSWARM_MODEL_PROVIDER=kimi_proxy` and `ANYSWARM_MODEL_ID=k3`. Keep the token in trusted host configuration if your proxy requires one.
7
+ Use a Linux x86-64 controller. The CLI supports Node.js 22.19 or newer. The exported TypeScript example is tested with Node.js 24 LTS. Install Git, Git LFS, Python 3, Docker Engine and Docker Buildx. For a new Debian 13 VM, install Docker Engine 29 and its Buildx plugin from Docker's apt repository. Debian 13's stock Docker 26 can pass the image-store check and still fail when Pumpkin tags a just-built image. [Install Docker Engine on Debian](https://docs.docker.com/engine/install/debian/)
8
8
 
9
9
  ```sh
10
- anys -u autoresearch --cmd /prepare
11
- anys -u autoresearch
10
+ sudo apt-get update
11
+ sudo apt-get install git git-lfs python3 ca-certificates curl xz-utils util-linux
12
+ sudo systemctl enable --now docker
13
+ docker version --format '{{ .Server.Version }}'
14
+ docker buildx version
15
+ docker info --format '{{ .DriverStatus }}'
12
16
  ```
13
17
 
14
- Preparation prints prerequisite checks and the resource plan. It reports K3 configuration and HTTP route reachability separately, and reports inference as not attempted. It fetches only the pinned task and shared dependencies, checks the Pumpkin release hash, builds images, completes an independent no-model reference run and checks the authorized submission role. Initial image builds can take several minutes. Rerunning preparation reuses verified materials and images. Reference records are environment evidence. The model receives a clean starter and only public train feedback.
18
+ If those Docker commands report permission denied on your own Linux VM, add your account to the Docker group with `sudo usermod -aG docker "$USER"` and open a fresh login session before retrying. Keep Docker management access on the controller. [AnySwarm setup guide](https://anyswarm.github.io/anyswarm/docs/quickstart/)
15
19
 
16
- Type `/demo frontiercs2` in the composer. The stream shows peer claims, submitted candidates, patch reads, reviews and train scores. When a candidate becomes available, eligible peers receive a prompt to read and review its exact version. The live Trace shows detailed research, peer messages and reviews. Use `@peer-2 <suggestion>`, `/interrupt peer-2` or `/stop peer-2` to control one peer. The Trace link serves the current Run on loopback. For a remote controller, forward its port over SSH. After the CLI exits, use the printed replay command.
20
+ Before running AnySwarm setup, verify that the Docker output contains `io.containerd.snapshotter.v1`. Pumpkin needs the containerd image store to resolve pinned images by digest. On a fresh Linux VM where the marker is absent, add `"containerd-snapshotter": true` under `"features"` in `/etc/docker/daemon.json`, run `sudo systemctl restart docker`, and check again. Existing images and containers from the previous store become hidden when switching stores. On a shared host, choose or provision a suitable Docker context first. [Docker image store setup](https://docs.docker.com/engine/storage/containerd/)
17
21
 
18
- For a script or pipe, use `anys -u autoresearch --cmd '/demo frontiercs2'`. The live Trace URL goes to stderr. Session events and the final result go to stdout as JSONL.
22
+ Install the CLI from a release that includes this example using `npm install -g @anyswarm/core`, or use `npm install -g /path/to/anyswarm-core.tgz` for a supplied candidate archive. A user-owned Node installation lets you install these packages without `sudo`. If you choose Pi, install the executable before setup:
19
23
 
20
- The default smoke budget is four Kimi K3 peers, a shared twelve-minute work window and eight train admissions. The demo records actual model usage without capping the request count. The application reserves additional time for final and cleanup. The result includes every frozen candidate, its hash and author, best candidate, Pumpkin record, final result and cleanup receipt. A valid candidate with a low score is a completed evaluation. A run without a valid candidate returns failure, even when it records an official zero for a selected invalid candidate.
24
+ ```sh
25
+ npm install -g @earendil-works/pi-coding-agent
26
+ anyswarm setup --backend pi
27
+ anyswarm doctor --smoke
28
+ ```
29
+
30
+ If you choose Codex, install its executable, choose a Responses model, then use `anyswarm setup --backend codex` and `anyswarm doctor --smoke`. Use `--backend-path` if your executable is outside your shell path. For an existing deployment, set its Lifecycle URL and API key and use `anyswarm setup --mode existing`. Make the matching Worker image available on that deployment, configure `dns+nft` egress and a callback URL reachable from the Workers, then repeat `anyswarm doctor --mode existing --smoke`. Pumpkin and its judges still run on the controller's selected Docker daemon.
21
31
 
22
- ## Run your own project
32
+ ## 2. Export the example and configure your model and budget
23
33
 
24
34
  ```sh
25
- anys -u autoresearch --config ./research.ts "Your objective"
26
- anys eject autoresearch --dir ./my-research
35
+ anyswarm eject autoresearch --dir ./research-demo
36
+ cd ./research-demo
37
+ npm install
27
38
  ```
28
39
 
29
- The trusted TypeScript configuration exports a `ResearchConfiguration` object. Set `targetPath` relative to the invocation directory, `goal`, `direction` (`max` or `min`), optional `targetScore`, shared `budget` with an optional `maxModelRequests`, `model`, `executor`, `image`, `sandbox` and `connection`. The evaluator receives an immutable copy of the patch. Its `train(patch, signal, admitted)` returns `{valid, score, feedback}`. Call `admitted` with the trusted job identifier when one exists. `final(patch, signal)` returns the result of the independent final evaluation. The optional `start` and `close` own evaluator resources. All callbacks run as trusted host code. Run candidate code only inside an evaluator-owned isolated environment. Apply the patch to a fresh copy of the baseline, keep evaluator rules inaccessible to it and honor each supplied abort signal.
40
+ Edit `frontiercs2-config.ts`. Its default export is the shared configuration for prepare and run. The supplied template reads these values from the current shell. Use the provider’s full HTTP request URL. Load the token from your own credential store.
41
+
42
+ | Setting | What to supply |
43
+ | --- | --- |
44
+ | `ANYSWARM_MODEL_PROVIDER` | Your provider label |
45
+ | `ANYSWARM_MODEL_ID` | Exact model ID at the upstream |
46
+ | `ANYSWARM_MODEL_URL` | Full HTTP(S) request endpoint ending in `/v1/responses` or `/v1/chat/completions` for the built-in transports |
47
+ | `ANYSWARM_MODEL_PROTOCOL` | `responses` by default. For Pi with Chat Completions, set `chat-completions` |
48
+ | `ANYSWARM_MODEL_TOKEN` | Bearer token if the endpoint requires one. Load it into your shell from private storage |
49
+ | `ANYSWARM_AUTORESEARCH_STATE_DIR` | Optional path for prepared material and reference records |
50
+
51
+ For a Responses endpoint, replace the placeholders in this shell snippet. Keep the same shell or load the same settings before prepare and run.
52
+
53
+ ```bash
54
+ export ANYSWARM_MODEL_PROVIDER='my-provider'
55
+ export ANYSWARM_MODEL_ID='model-id-from-my-provider'
56
+ export ANYSWARM_MODEL_URL='https://my-provider.example/v1/responses'
57
+ # Skip these two lines if your endpoint needs no bearer token.
58
+ read -rsp 'Model token: ' ANYSWARM_MODEL_TOKEN && printf '\n'
59
+ export ANYSWARM_MODEL_TOKEN
60
+ ```
61
+
62
+ You can supply an ordinary `ModelConfig` in the TypeScript file instead. For a reasoning model outside the executor catalog, set its catalog-backed `capabilities` with `contextWindow`, `maxOutputTokens`, `tools: true` and `reasoning`. Use `model.upstream.headers` for custom authentication. Supply `executor`, `image`, `sandbox` and `connection` to override your saved setup.
63
+
64
+ The template reserves two peers, a shared 12-minute search window, four train admissions and 128 new model requests across the team. You can edit `goal` and `budget`. An omitted `maxModelRequests` leaves the Gateway's request count uncapped. Set `continueAfterTrainBudget: true` if peers should keep reviewing and testing locally until another stop condition. The app budget and Pumpkin's official grant are reported independently.
65
+
66
+ ## 3. Check and prepare
67
+
68
+ ```sh
69
+ npm exec -- anyswarm run ./prepare-demo.ts --config ./frontiercs2-config.ts --check
70
+ npm exec -- anyswarm run ./prepare-demo.ts --config ./frontiercs2-config.ts
71
+ ```
72
+
73
+ Read the `ACTION` lines to see which command or configuration field to fix. `--check` reports configuration, authentication, endpoint reachability, placement and available capacity. It makes a bounded HTTP HEAD probe to the model route and reports inference as unattempted. A successful real tool turn and continuation during the run establish actual inference.
74
+
75
+ | If a check reports an action | Where to start |
76
+ | --- | --- |
77
+ | `model-config` | Check the exact model ID and request endpoint. Codex uses Responses. Pi can also use Chat Completions. |
78
+ | `model-http` | Check controller DNS and outbound access. For HTTP 401/403, check the model token and provider access. |
79
+ | `opensandbox`, `callback` or `worker-image` | Repeat `anyswarm setup` and `anyswarm doctor --smoke` for the selected backend. Existing deployments also need a Worker-reachable callback and the matching image. |
80
+ | `run-capacity` or `storage` | Compare the plan below with the reported controller resources. Check both the state directory and `TMPDIR`. |
81
+ | `task-materials` | Run prepare. Use a different state directory when switching Docker contexts. |
82
+ | Pumpkin reports `can't be tagged` and `No such image` after a build | Check the server version and Buildx on the selected context. Try Docker Engine 29 with Docker's Buildx plugin and the containerd image store, then rerun prepare. |
83
+
84
+ | Phase | Controller plan when Workers are local |
85
+ | --- | --- |
86
+ | Prepare | 8 vCPU, 14 GiB RAM for the reference or bridge check, controller and build headroom |
87
+ | Run, two Workers | 10 vCPU, 18 GiB RAM |
88
+ | Run, four Workers | 14 vCPU, 26 GiB RAM |
89
+
90
+ Each Worker, the submission bridge and the active judge have a 2 vCPU / 4 GiB allowance. For remote Workers, check their capacity and image separately. The controller still needs its own Docker capacity. Allow 12 GiB on the state mount, 1 GiB for temporary files and at least 25,000 free inodes on both mounts. No GPU is required.
91
+
92
+ Preparation fetches the pinned task and dependencies, checks Pumpkin, completes a no-model reference train and final and validates the submission bridge. The first prepare can take several minutes. Repeat the same command to reuse verified material and keep existing records.
93
+
94
+ ## 4. Run and verify the result
95
+
96
+ ```sh
97
+ npm exec -- anyswarm run ./project.ts --config ./frontiercs2-config.ts --prompt 'Run the FrontierCS-2 task.' --output-dir ./runs
98
+ npm exec -- anyswarm trace --root ./runs
99
+ ```
100
+
101
+ Run the Trace command in another terminal to watch live. For a remote controller, use `ssh -N -L 8787:127.0.0.1:8787 user@controller` with your connection options. Open `http://127.0.0.1:8787` in your browser. Select the matching Run and use the **Research** track. Search by candidate ID or patch SHA-256, open the candidate and follow the related full-read, review, train and final records. **Related evidence** opens the saved patch with SHA-256 verification. The **Model** track shows the actual request intervals and saved upstream responses for each peer. Reopen the same Run after it finishes to replay it.
102
+
103
+ The Run directory contains:
104
+
105
+ - `research-result.json` with goal, model, budget, actual use, candidate list, best, selected, typed final result and separate cleanup receipts.
106
+ - `<runtime-id>/candidates/*.patch` with the immutable candidate files and `research-events.jsonl` with their research events.
107
+ - The `pumpkin/<run-id>/` record with the official admission and final verdict. Match the candidate's patch hash and the official payload digest in the research journal. Final metrics stay on the controller.
108
+
109
+ To inspect the selected patch against the clean baseline, copy the prepared state's `reference/tasks/binary_fuse_filter/repo` directory to scratch, then run `git apply --check /absolute/path/to/candidate.patch` and `git apply /absolute/path/to/candidate.patch` from the copy. The original official final is in the Run's Pumpkin record. Leave the prepared starter intact for the next run.
110
+
111
+ The final result distinguishes a valid score, objective attainment, rejection and an unconfirmed result. Set `targetScore` to add a numeric objective. The official comparison with the reference is recorded separately. The research timer starts when all peers are ready. Prepare, train settlement, final and cleanup take their own time. If cleanup is pending, use the recorded Runtime receipt and Pumpkin run/container IDs to check those specific resources. Keep those records until reconciliation.
112
+
113
+ ## Use your own project and evaluator
114
+
115
+ ```sh
116
+ anyswarm --harness autoresearch --config ./research.ts --prompt 'Your research objective' --output-dir ./runs
117
+ ```
118
+
119
+ Default-export a `ResearchConfiguration` from trusted TypeScript. Choose `targetPath` relative to the launch directory, or pass `--cwd`. Set `goal`, `direction` (`max` or `min`), optional `targetScore`, `budget`, `model`, `executor`, `image`, `sandbox` and `connection`. Use the exported `frontiercs2-config.ts` as the model and backend example.
120
+
121
+ Implement `evaluator.train(patch, signal, admitted)` and return `{ valid, score, feedback }`. Set `valid: true` for a legal zero score. Call `admitted(jobId)` when a trusted external job is accepted. Implement `evaluator.final(patch, signal)` returning `{ status, score, meetsObjective, evidence }`. Use `status: 'valid' | 'rejected' | 'unknown'`, `score: null` if unknown, and `meetsObjective: null` when no application objective was evaluated. Legacy JSON output remains visible as unconfirmed evidence. `start` and `close` own evaluator resources. Report pending resources through `evidence()`.
30
122
 
31
- The exported `project.ts` is the editable Harness. Install its pinned SDK archive with `npm install` in the export directory, then run `anys -u ./project.ts --cwd /path/to/project --config ./research.ts "Your objective"`. The export includes the FrontierCS-2 adapter and preparation source. The installed CLI hosts the terminal and live Trace.
123
+ Keep model credentials, judges and Docker management on the host. Run candidate code only in evaluator-owned isolation, apply each patch to a clean baseline, bound every callback and honor its abort signal. Evaluate the selected patch independently and keep final feedback out of the search loop.
32
124
 
33
- See [the requirements](REQUIREMENTS.zh.md).
125
+ See the [中文需求和配置提示](REQUIREMENTS.zh.md).
@@ -1,18 +1,19 @@
1
- # AutoResearch 需求
1
+ # AutoResearch 需求与配置提示
2
2
 
3
- 用户配置目标、可信评测和总预算后,团队自动研究、评测、选择候选并收尾。流式终端显示认领方向、提交候选和 train 反馈,支持向单个成员发送建议、中断当前轮次和停止成员。实时 Trace 提供消息、复核、候选沿用和回执,结束后可回放。
3
+ 用户选择 backend、模型、人数和预算后,同一份配置用于预检、准备和运行。成员平级,各自在独立 Sandbox 研究,可以分享候选、完整读取并互评。官方 train 反馈可用于搜索,final 只进入宿主结果。
4
4
 
5
- FrontierCS-2 demo 固定 `7e48965c7cef2a567c2669c8e2f10b06386289c9` 的 `binary_fuse_filter` 和该版本的 Pumpkin。团队至少四名平级 AnySwarm Worker,同一次 Run 使用真实 `kimi_proxy/k3`,没有统一 Lead。成员自行认领研究方向、交流和选择沿用的成果。Harness 管理资源、共享预算与可信评测。demo 的研究窗口为 12 分钟,官方 train 额度为 8 次,记录模型请求数但不限制次数。官方 train 公开反馈进入看板,final 结果只写入用户记录。
5
+ ## 首次设置
6
6
 
7
- ```sh
8
- anys -u autoresearch --cmd /prepare
9
- anys -u autoresearch --cmd "/demo frontiercs2"
10
- anys -u autoresearch --config ./research.ts "研究目标"
11
- anys eject autoresearch --dir ./my-research
12
- ```
7
+ 1. 准备 Linux x86-64 控制端、Node.js 24 LTS、Git、Git LFS、Python 3、Docker 和 Buildx。新 Debian 13 VM 请从 Docker 官方 apt 仓库安装 Docker Engine 29 和 Buildx 插件。Debian 自带的 Docker 26 即使通过镜像存储检查,Pumpkin 给新构建的镜像打标签时仍可能报 `No such image`。`docker info --format '{{ .DriverStatus }}'` 必须显示 `io.containerd.snapshotter.v1`,Pumpkin 才能按 digest 找到镜像。请在 AnySwarm setup 之前打开这个镜像存储。切换会隐藏旧存储中的容器和镜像,共享主机请先选择合适的 Docker context。其他依赖和命令见 [README](README.md#1-install-and-choose-your-backend)、[Docker 安装文档](https://docs.docker.com/engine/install/debian/) 和 [镜像存储文档](https://docs.docker.com/engine/storage/containerd/)。
8
+ 2. 先安装所选执行器。Pi 可用 `npm install -g @earendil-works/pi-coding-agent` 安装。安装 AnySwarm 后运行 `anyswarm setup --backend pi` 或 `anyswarm setup --backend codex`。已有 OpenSandbox 时使用 `--mode existing`,配置 Lifecycle 地址、鉴权、匹配的 Worker 镜像、`dns+nft` 和可达的回调。用 `anyswarm doctor --smoke` 检查连接及 Worker。
9
+ 3. `anyswarm eject autoresearch --dir ./research-demo`,进入导出目录执行 `npm install`。编辑 `frontiercs2-config.ts`。模板所需的模型设置是 `ANYSWARM_MODEL_PROVIDER`、`ANYSWARM_MODEL_ID` 和请求 URL `ANYSWARM_MODEL_URL`。路由需要凭证时设置 `ANYSWARM_MODEL_TOKEN`。Pi 的 Chat Completions 路由需要另设 `ANYSWARM_MODEL_PROTOCOL=chat-completions`。也可直接传入普通 `ModelConfig`,并按模型目录填写推理与工具能力。
10
+ 4. `npm exec -- anyswarm run ./prepare-demo.ts --config ./frontiercs2-config.ts --check`。先处理 `ACTION` 行,再去掉 `--check` 准备固定材料。首次准备执行独立的官方无模型 reference。重复准备复用已验证材料和镜像。四 Peer、GPT-6.1 Sol、60 分钟是本机验收配置,导出的模板由用户选择模型和预算。
11
+ 5. `npm exec -- anyswarm run ./project.ts --config ./frontiercs2-config.ts --prompt '运行 FrontierCS-2 任务' --output-dir ./runs`。模板默认 2 Peer、12 分钟、4 次 train 和 128 次团队新模型请求。修改 `budget` 会同时影响准备计划和实际运行。完整命令、资源表和自定义评测入口见 [README](README.md)。
13
12
 
14
- 验收从候选包开始。独立 reference 完成无模型 train/final。实际 demo 从干净 starter 开始,保存四路真实 K3 活动重叠的证据、至少一次可关联到具体候选的同行复核或采用,以及 Worker 候选、官方 train、最终保存、final 和资源回收的关联记录。记录全队的资源、模型用量与费用。未知回执和待清理资源保留可核对的标识。官方零分作为求解结果记录。
13
+ ## 结果与验收
15
14
 
16
- 在交互入口 `anys -u autoresearch` 也可输入 `/prepare` 和 `/demo frontiercs2`。
15
+ 固定使用 FrontierCS-2 `7e48965c7cef2a567c2669c8e2f10b06386289c9` 的 `binary_fuse_filter` 和原有 Pumpkin 评测。Worker 只获得干净 starter 和公开 train 反馈。应用侧 train 上限、官方 grant 和团队模型预算分别记录。
17
16
 
18
- 范围以 [#337](https://github.com/AnySwarm/anyswarm/issues/337) 和随后确认的四成员、Agensh 式扁平协作、实时 Trace 为准。终端交互遵循 [#344](https://github.com/AnySwarm/anyswarm/issues/344)。
17
+ 在运行中或结束后执行 `npm exec -- anyswarm trace --root ./runs`。用候选 ID 或 patch SHA-256 找到同一次 Run 的候选、完整读取、具体 review、train 回执、最终选择和 final。若声称采用另一 Peer 的贡献,用实际 patch 差异核实改动。按 Model 泳道中的请求区间核对真实并行。合法低分、无效候选、终验未达业务目标和未确认结果独立记录。清理保留 Runtime 和评测器各自的状态与待核对资源。
18
+
19
+ 验收从仓库外固定候选包开始。记录任务版本、候选包及 hash、真实 backend 和模型、用量、耗时、候选关系和两类清理。正式评测以 Pumpkin 原始回执为准。应用范围见 [#337](https://github.com/AnySwarm/anyswarm/issues/337),宿主入口见 [#351](https://github.com/AnySwarm/anyswarm/issues/351)。