sakura-infinity 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ The test suite covers both tool kits. Real-model runs have also produced an acce
11
11
 
12
12
  ## Quick start
13
13
 
14
- You need Node 24 or newer, and a key of DeepSeek, OpenAI or Anthropic. Math tasks also need Lean 4 (`curl https://elan.lean-lang.org/elan-init.sh -sSf | sh`); code tasks need whatever your evaluator runs (Python for the template).
14
+ You need Node 22.18 or newer, and a key of DeepSeek, OpenAI or Anthropic. Math tasks also need Lean 4 (`curl https://elan.lean-lang.org/elan-init.sh -sSf | sh`); code tasks need whatever your evaluator runs (Python for the template).
15
15
 
16
16
  ```sh
17
17
  npm install -g sakura-infinity
@@ -126,7 +126,7 @@ The sections below work from a clone of the repository (for development, and for
126
126
 
127
127
  ### 1. Install from the repository
128
128
 
129
- You need Node 24 or newer and git. For math tasks you need Lean 4 (`curl https://elan.lean-lang.org/elan-init.sh -sSf | sh`; the program checks `lean --version` and `lake --version` at start and prints this command if they are missing; Mathlib is not needed). For the code task you need Python 3 with numpy, pandas and scikit-learn.
129
+ You need Node 22.18 or newer and git. For math tasks you need Lean 4 (`curl https://elan.lean-lang.org/elan-init.sh -sSf | sh`; the program checks `lean --version` and `lake --version` at start and prints this command if they are missing; Mathlib is not needed). For the code task you need Python 3 with numpy, pandas and scikit-learn.
130
130
 
131
131
  ```sh
132
132
  npm install # sakura-agent comes from npm
@@ -143,7 +143,7 @@ cd infinity-agent
143
143
  npm ci
144
144
  ```
145
145
 
146
- GitHub supplies the source. The lockfile supplies the dependency versions. A GitHub Release is optional. Keep your own task, input data and credentials on the machine that will run the agents. Use Node 24 or later and Git. Use Linux for host monitoring and command limits.
146
+ GitHub supplies the source. The lockfile supplies the dependency versions. A GitHub Release is optional. Keep your own task, input data and credentials on the machine that will run the agents. Use Node 22.18 or later and Git. Use Linux for host monitoring and command limits.
147
147
 
148
148
  With your task and evaluator in `../my-task/`, configure the model as shown below and run:
149
149
 
@@ -266,7 +266,7 @@ const tools = createInfinityTools({ packs: [covertype], model }); // infinity_
266
266
 
267
267
  ## Shell tasks (the code preset)
268
268
 
269
- Every agent has `read`, `write`, `edit`, `bash` and `submit`; the submit is command + listed files + commit, scored by your evaluator on data the agents cannot see. Plans and decisions: `docs/05-general-mode-plan.md`, `docs/10-branch-review-and-first-ml-run-plan.md`, `docs/decisions.md`. A deployment can supply a Sakura tool environment through `INFINITY_WORKER_ENVIRONMENT` or `runTask(..., { createEnvironment })` to control shell access and accelerators (`docs/11-runbook.md`).
269
+ Every agent has `read`, `write`, `edit`, `bash`, `submit` and `handoff`; the submit is command + listed files + commit, scored by your evaluator on data the agents cannot see. `handoff` (from `sakura-agent-tools`) lets agents share checked work packages through one store per machine (`~/.infinity/handoff`, moved by `INFINITY_HANDOFF_DIR`), shared by every agent of every run. Plans and decisions: `docs/05-general-mode-plan.md`, `docs/10-branch-review-and-first-ml-run-plan.md`, `docs/decisions.md`. A deployment can supply a Sakura tool environment through `INFINITY_WORKER_ENVIRONMENT` or `runTask(..., { createEnvironment })` to control shell access and accelerators (`docs/11-runbook.md`).
270
270
 
271
271
  - **Branch review (optional):** every few minutes each agent's conversation is forked; a reviewer with the same model, system text and tools (so the provider's cache applies) may only `read` files in the agent's directory and says `OK` or gives short advice, which is steered into the agent marked as not coming from the user. It is not a gatekeeper and its benefit is not measured. It costs tokens: in the one real run, reviews were about half of the tokens counted.
272
272
  - **Safety review (`review`):** the framework's review plugin judges risky commands; in front of it Infinity's rules refuse pushing, ssh, uploads, killing by name, credential files, the hidden data, other agents' directories and the run's own files. `review: false` switches it off and the report says so.
@@ -2,6 +2,7 @@ import { existsSync, statSync } from "node:fs";
2
2
  import { corePlugins, createAgent } from "sakura-agent";
3
3
  import { commitPlugin } from "./commit-plugin.js";
4
4
  import { afterRun } from "./worker-policy.js";
5
+ import { handoffTool } from "./handoff.js";
5
6
  import { commitAll, createWorkDir, headCommit } from "./work-repo.js";
6
7
  /** Advice for an agent: handed to the active run at once, or kept until the next run starts (a run that is not active drops what is steered into it). */
7
8
  export class AdviceBox {
@@ -76,7 +77,7 @@ export function startWorker(deps) {
76
77
  model: client,
77
78
  cwd: workDir,
78
79
  ...(deps.createEnvironment ? { environment: deps.createEnvironment({ workDir, sharedDir: layout.sharedDir }) } : { confine: deps.setup.confine }),
79
- tools: [...deps.setup.builtinTools, ...tools],
80
+ tools: [...deps.setup.builtinTools, ...tools, handoffTool(layout.root, number, workDir)],
80
81
  ...(deps.setup.bashSoftTimeoutMs === undefined ? {} : { bashSoftTimeoutMs: deps.setup.bashSoftTimeoutMs }),
81
82
  plugins,
82
83
  rules: deps.setup.rules,
@@ -0,0 +1,12 @@
1
+ import { homedir } from "node:os";
2
+ import { basename, join } from "node:path";
3
+ import { createHandoffTool } from "sakura-agent-tools/handoff";
4
+ /**
5
+ * Where agents hand each other checked work: one store per machine, shared by every agent of every run, so what one run proves the next can
6
+ * reuse (INFINITY_HANDOFF_DIR moves it; tests give each worker its own).
7
+ */
8
+ export const handoffStore = () => process.env.INFINITY_HANDOFF_DIR || join(homedir(), ".infinity", "handoff");
9
+ /** The `handoff` tool of one agent: it publishes from and pulls into its own work directory, as `<run>-<number>`. */
10
+ export function handoffTool(runRoot, number, workDir) {
11
+ return createHandoffTool({ storeRoot: handoffStore(), workDir, agentId: `${basename(runRoot)}-${number}` });
12
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "sakura-infinity",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Run many agents in parallel on one task and keep the best result: a code task scored by your evaluator, or a Lean 4 proof. Built on sakura-agent.",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": ">=24"
8
+ "node": ">=22.18"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "vitest run",
@@ -21,7 +21,8 @@
21
21
  "prepack": "npm run build"
22
22
  },
23
23
  "dependencies": {
24
- "sakura-agent": "^0.2.2"
24
+ "sakura-agent": "^0.2.3",
25
+ "sakura-agent-tools": "^0.1.0"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@biomejs/biome": "^2.6.4",