Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 152 --json
JSON
/christopher/abso-core/versions/152?format=json

Scale harness for the open server, and its first ramp on abso-open

of shared·speed··Not checked

Version 151 · Files at version 152

9 files, 1559 lines added, 0 removed.

--- /dev/null
+++ b/server/scale/README.md
@@ -0,0 +1,53 @@
1+# Scale harness
2+
3+`scale.mjs` plays many agents across many projects against an abso open server (`server/`). It talks HTTP directly, as
4+the client does, so one machine can stand in for thousands of agents. Each project is its own Durable Object and its
5+own Artifacts repo, so total pushes a second should grow with the number of projects while each project's own latency
6+stays flat.
7+
8+## Run it
9+
10+```sh
11+# The token: ABSO_TOKEN, or a file. It is never printed.
12+ABSO_TOKEN=... node server/scale/scale.mjs --server https://abso.<you>.workers.dev --projects 10 --agents 5
13+node server/scale/scale.mjs --server https://abso.<you>.workers.dev --token-file ~/.abso-open/token --ramp
14+```
16+Locally: `cd server && npm run dev` (`wrangler dev --local`, with `ABSO_TOKEN` in `.dev.vars`), then
17+`--server http://127.0.0.1:8787`.
19+| Option | Default | What it does |
20+|---|---|---|
21+| `--server` | (required) | The server's URL. |
22+| `--projects` | 10 | Projects in the stage. |
23+| `--agents` | 5 | Agents per project. |
24+| `--rounds` | 3 | Edit, record and push rounds per agent. |
25+| `--overlap` | 0.2 | The share of rounds that edit one of the first lines of a shared file, `hot.txt`, instead of the agent's own file, so some pushes are held. |
26+| `--prefix` | `scale-<run id>` | Project names: `<prefix>-<stage>-p<n>`. |
27+| `--ramp` | off | Runs 1×1, 10×5, 50×10, 100×10 and 200×20 in order, one results file per stage, and stops early when errors pass 2%. |
28+| `--concurrency` | 256 | Requests in flight at once, across every agent. When requests a second come near this divided by the latency, the harness is the limit, not the server: raise it (the first ramp used 800). |
29+| `--max-seconds` | 240 | No new rounds start after this many seconds in a stage. |
30+| `--artifacts-sample` | 5 | Projects whose push out to Artifacts is timed. |
31+| `--artifacts-wait` | 180 | Seconds to wait for that push out. |
32+| `--token-file` | | Read the token from this file instead of `ABSO_TOKEN`. |
33+| `--out` | `server/scale/results` | Where the results files go. |
35+## What each agent does
37+1. Joins (`POST a/<agent>/sync`) and says what it is starting on (`a/<agent>/starting`).
38+2. Each round, edits its own file `agents/<agent>.txt`. With the overlap chance, it pulls and changes a line of `hot.txt`
39+ instead. It records the file (`a/<agent>/record`), pushes (`a/<agent>/publish`) and reads its news (`a/<agent>/news`).
40+3. A held push pulls and pushes again once with both sides kept, as `abso push --as-is` does after a pull.
42+Each project starts with `init` and one binary file uploaded to `blobs/<sha256>`.
44+## What it measures
46+- Each operation's latency: p50, p95, p99 and max, in milliseconds.
47+- Pushes a second, overall and per project.
48+- Held pushes, and how many were still held after the retry.
49+- Errors by operation and status code.
50+- Time to Artifacts: for a sample of projects, it polls `GET /p/<project>/out` until `pushed.version` reaches shared's
51+ version. The server pushes out at most once a minute per project, so expect up to about a minute.
53+The results are JSON in `results/` (summaries, not per-request logs), and a Markdown summary is printed.
--- /dev/null
+++ b/server/scale/results/scale-mv6vy4y3-10x5.json
@@ -0,0 +1,129 @@
1+{
2+ "stage": "10x5",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "at": "2026-10-13T16:18:42.011Z",
5+ "projects": 10,
6+ "projectsMade": 10,
7+ "agentsPerProject": 5,
8+ "agents": 50,
9+ "rounds": 3,
10+ "overlap": 0.2,
11+ "initSeconds": 1.6,
12+ "seconds": 4.3,
13+ "cutShort": false,
14+ "pushes": 148,
15+ "pushesPerSecond": 34.73,
16+ "pushesPerSecondPerProject": {
17+ "p50": 3.52,
18+ "min": 3.286,
19+ "max": 3.52
20+ },
21+ "held": 8,
22+ "settledOnRetry": 6,
23+ "heldAfterRetry": 2,
24+ "requests": 726,
25+ "requestsPerSecond": 170.4,
26+ "errors": 0,
27+ "errorRate": 0,
28+ "errorsByStatus": {},
29+ "statuses": {
30+ "200": 726
31+ },
32+ "latencyMs": {
33+ "blob": {
34+ "count": 10,
35+ "p50": 670.8,
36+ "p95": 997.3,
37+ "p99": 997.3,
38+ "max": 997.3
39+ },
40+ "init": {
41+ "count": 10,
42+ "p50": 182,
43+ "p95": 666.3,
44+ "p99": 666.3,
45+ "max": 666.3
46+ },
47+ "news": {
48+ "count": 150,
49+ "p50": 168.6,
50+ "p95": 280.4,
51+ "p99": 500.9,
52+ "max": 560.3
53+ },
54+ "out": {
55+ "count": 106,
56+ "p50": 147.9,
57+ "p95": 243.4,
58+ "p99": 440.6,
59+ "max": 506.5
60+ },
61+ "publish": {
62+ "count": 158,
63+ "p50": 190.4,
64+ "p95": 326.6,
65+ "p99": 510.1,
66+ "max": 551.5
67+ },
68+ "record": {
69+ "count": 150,
70+ "p50": 188.3,
71+ "p95": 479,
72+ "p99": 658,
73+ "max": 699.1
74+ },
75+ "starting": {
76+ "count": 50,
77+ "p50": 216.7,
78+ "p95": 468,
79+ "p99": 555.5,
80+ "max": 555.5
81+ },
82+ "sync": {
83+ "count": 92,
84+ "p50": 284.3,
85+ "p95": 911.2,
86+ "p99": 1036.9,
87+ "max": 1036.9
88+ }
89+ },
90+ "artifacts": {
91+ "sampled": 5,
92+ "pushedOut": 5,
93+ "p50Seconds": 65,
94+ "maxSeconds": 68.2,
95+ "projects": [
96+ {
97+ "project": "scale-mv6vy4y3-10x5-p1",
98+ "version": 15,
99+ "seconds": 68.2,
100+ "error": null
101+ },
102+ {
103+ "project": "scale-mv6vy4y3-10x5-p2",
104+ "version": 15,
105+ "seconds": 67.9,
106+ "error": null
107+ },
108+ {
109+ "project": "scale-mv6vy4y3-10x5-p3",
110+ "version": 14,
111+ "seconds": 63.9,
112+ "error": null
113+ },
114+ {
115+ "project": "scale-mv6vy4y3-10x5-p4",
116+ "version": 14,
117+ "seconds": 61.3,
118+ "error": null
119+ },
120+ {
121+ "project": "scale-mv6vy4y3-10x5-p5",
122+ "version": 15,
123+ "seconds": 65,
124+ "error": null
125+ }
126+ ]
127+ },
128+ "failedProjects": []
129+}
--- /dev/null
+++ b/server/scale/results/scale-mv6vzxzj-100x10.json
@@ -0,0 +1,129 @@
1+{
2+ "stage": "100x10",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "at": "2026-10-13T16:23:39.895Z",
5+ "projects": 100,
6+ "projectsMade": 100,
7+ "agentsPerProject": 10,
8+ "agents": 1000,
9+ "rounds": 3,
10+ "overlap": 0.2,
11+ "initSeconds": 4.7,
12+ "seconds": 10.5,
13+ "cutShort": false,
14+ "pushes": 2921,
15+ "pushesPerSecond": 278.77,
16+ "pushesPerSecondPerProject": {
17+ "p50": 2.863,
18+ "min": 2.195,
19+ "max": 2.863
20+ },
21+ "held": 258,
22+ "settledOnRetry": 179,
23+ "heldAfterRetry": 79,
24+ "requests": 12376,
25+ "requestsPerSecond": 1181.1,
26+ "errors": 0,
27+ "errorRate": 0,
28+ "errorsByStatus": {},
29+ "statuses": {
30+ "200": 12376
31+ },
32+ "latencyMs": {
33+ "blob": {
34+ "count": 100,
35+ "p50": 900.2,
36+ "p95": 1195,
37+ "p99": 1309.2,
38+ "max": 1586.3
39+ },
40+ "init": {
41+ "count": 100,
42+ "p50": 291.1,
43+ "p95": 693.6,
44+ "p99": 792.3,
45+ "max": 3641.1
46+ },
47+ "news": {
48+ "count": 3000,
49+ "p50": 233,
50+ "p95": 379.7,
51+ "p99": 649,
52+ "max": 1401.7
53+ },
54+ "out": {
55+ "count": 91,
56+ "p50": 117.9,
57+ "p95": 222.5,
58+ "p99": 534.7,
59+ "max": 534.7
60+ },
61+ "publish": {
62+ "count": 3258,
63+ "p50": 374.8,
64+ "p95": 547.5,
65+ "p99": 790.8,
66+ "max": 1453
67+ },
68+ "record": {
69+ "count": 3000,
70+ "p50": 399.4,
71+ "p95": 570.1,
72+ "p99": 802,
73+ "max": 1159.3
74+ },
75+ "starting": {
76+ "count": 1000,
77+ "p50": 459.4,
78+ "p95": 1101.4,
79+ "p99": 1133,
80+ "max": 1353.7
81+ },
82+ "sync": {
83+ "count": 1827,
84+ "p50": 1333.2,
85+ "p95": 4069.4,
86+ "p99": 4486.2,
87+ "max": 5817.1
88+ }
89+ },
90+ "artifacts": {
91+ "sampled": 5,
92+ "pushedOut": 5,
93+ "p50Seconds": 54.5,
94+ "maxSeconds": 62.4,
95+ "projects": [
96+ {
97+ "project": "scale-mv6vzxzj-100x10-p1",
98+ "version": 29,
99+ "seconds": 50.3,
100+ "error": null
101+ },
102+ {
103+ "project": "scale-mv6vzxzj-100x10-p2",
104+ "version": 29,
105+ "seconds": 54.5,
106+ "error": null
107+ },
108+ {
109+ "project": "scale-mv6vzxzj-100x10-p3",
110+ "version": 30,
111+ "seconds": 57.1,
112+ "error": null
113+ },
114+ {
115+ "project": "scale-mv6vzxzj-100x10-p4",
116+ "version": 30,
117+ "seconds": 62.4,
118+ "error": null
119+ },
120+ {
121+ "project": "scale-mv6vzxzj-100x10-p5",
122+ "version": 29,
123+ "seconds": 51.5,
124+ "error": null
125+ }
126+ ]
127+ },
128+ "failedProjects": []
129+}
--- /dev/null
+++ b/server/scale/results/scale-mv6vzxzj-10x5.json
@@ -0,0 +1,129 @@
1+{
2+ "stage": "10x5",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "at": "2026-10-13T16:21:15.122Z",
5+ "projects": 10,
6+ "projectsMade": 10,
7+ "agentsPerProject": 5,
8+ "agents": 50,
9+ "rounds": 3,
10+ "overlap": 0.2,
11+ "initSeconds": 1.7,
12+ "seconds": 3.8,
13+ "cutShort": false,
14+ "pushes": 150,
15+ "pushesPerSecond": 39.9,
16+ "pushesPerSecondPerProject": {
17+ "p50": 3.99,
18+ "min": 3.99,
19+ "max": 3.99
20+ },
21+ "held": 4,
22+ "settledOnRetry": 4,
23+ "heldAfterRetry": 0,
24+ "requests": 717,
25+ "requestsPerSecond": 190.7,
26+ "errors": 0,
27+ "errorRate": 0,
28+ "errorsByStatus": {},
29+ "statuses": {
30+ "200": 717
31+ },
32+ "latencyMs": {
33+ "blob": {
34+ "count": 10,
35+ "p50": 945.9,
36+ "p95": 1148.5,
37+ "p99": 1148.5,
38+ "max": 1148.5
39+ },
40+ "init": {
41+ "count": 10,
42+ "p50": 212.5,
43+ "p95": 796,
44+ "p99": 796,
45+ "max": 796
46+ },
47+ "news": {
48+ "count": 150,
49+ "p50": 164.1,
50+ "p95": 286.6,
51+ "p99": 593.1,
52+ "max": 626.3
53+ },
54+ "out": {
55+ "count": 108,
56+ "p50": 133.7,
57+ "p95": 228.7,
58+ "p99": 268.5,
59+ "max": 315.2
60+ },
61+ "publish": {
62+ "count": 154,
63+ "p50": 204.9,
64+ "p95": 389,
65+ "p99": 676.4,
66+ "max": 802.6
67+ },
68+ "record": {
69+ "count": 150,
70+ "p50": 208.2,
71+ "p95": 460.3,
72+ "p99": 653.9,
73+ "max": 960
74+ },
75+ "starting": {
76+ "count": 50,
77+ "p50": 215.4,
78+ "p95": 556.9,
79+ "p99": 631.4,
80+ "max": 631.4
81+ },
82+ "sync": {
83+ "count": 85,
84+ "p50": 483.8,
85+ "p95": 952.3,
86+ "p99": 1026.1,
87+ "max": 1026.1
88+ }
89+ },
90+ "artifacts": {
91+ "sampled": 5,
92+ "pushedOut": 5,
93+ "p50Seconds": 65,
94+ "maxSeconds": 66.8,
95+ "projects": [
96+ {
97+ "project": "scale-mv6vzxzj-10x5-p1",
98+ "version": 15,
99+ "seconds": 65,
100+ "error": null
101+ },
102+ {
103+ "project": "scale-mv6vzxzj-10x5-p2",
104+ "version": 15,
105+ "seconds": 63.6,
106+ "error": null
107+ },
108+ {
109+ "project": "scale-mv6vzxzj-10x5-p3",
110+ "version": 15,
111+ "seconds": 66.8,
112+ "error": null
113+ },
114+ {
115+ "project": "scale-mv6vzxzj-10x5-p4",
116+ "version": 15,
117+ "seconds": 61.7,
118+ "error": null
119+ },
120+ {
121+ "project": "scale-mv6vzxzj-10x5-p5",
122+ "version": 15,
123+ "seconds": 66.4,
124+ "error": null
125+ }
126+ ]
127+ },
128+ "failedProjects": []
129+}
--- /dev/null
+++ b/server/scale/results/scale-mv6vzxzj-1x1.json
@@ -0,0 +1,105 @@
1+{
2+ "stage": "1x1",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "at": "2026-10-13T16:20:05.418Z",
5+ "projects": 1,
6+ "projectsMade": 1,
7+ "agentsPerProject": 1,
8+ "agents": 1,
9+ "rounds": 3,
10+ "overlap": 0.2,
11+ "initSeconds": 0.7,
12+ "seconds": 2.9,
13+ "cutShort": false,
14+ "pushes": 3,
15+ "pushesPerSecond": 1.05,
16+ "pushesPerSecondPerProject": {
17+ "p50": 1.05,
18+ "min": 1.05,
19+ "max": 1.05
20+ },
21+ "held": 0,
22+ "settledOnRetry": 0,
23+ "heldAfterRetry": 0,
24+ "requests": 36,
25+ "requestsPerSecond": 12.6,
26+ "errors": 0,
27+ "errorRate": 0,
28+ "errorsByStatus": {},
29+ "statuses": {
30+ "200": 36
31+ },
32+ "latencyMs": {
33+ "blob": {
34+ "count": 1,
35+ "p50": 583.8,
36+ "p95": 583.8,
37+ "p99": 583.8,
38+ "max": 583.8
39+ },
40+ "init": {
41+ "count": 1,
42+ "p50": 143.4,
43+ "p95": 143.4,
44+ "p99": 143.4,
45+ "max": 143.4
46+ },
47+ "news": {
48+ "count": 3,
49+ "p50": 263.2,
50+ "p95": 273.2,
51+ "p99": 273.2,
52+ "max": 273.2
53+ },
54+ "out": {
55+ "count": 22,
56+ "p50": 63.1,
57+ "p95": 140.1,
58+ "p99": 148.6,
59+ "max": 148.6
60+ },
61+ "publish": {
62+ "count": 3,
63+ "p50": 136.5,
64+ "p95": 176.7,
65+ "p99": 176.7,
66+ "max": 176.7
67+ },
68+ "record": {
69+ "count": 3,
70+ "p50": 147.1,
71+ "p95": 342.7,
72+ "p99": 342.7,
73+ "max": 342.7
74+ },
75+ "starting": {
76+ "count": 1,
77+ "p50": 186.9,
78+ "p95": 186.9,
79+ "p99": 186.9,
80+ "max": 186.9
81+ },
82+ "sync": {
83+ "count": 2,
84+ "p50": 88.4,
85+ "p95": 807.2,
86+ "p99": 807.2,
87+ "max": 807.2
88+ }
89+ },
90+ "artifacts": {
91+ "sampled": 1,
92+ "pushedOut": 1,
93+ "p50Seconds": 65.4,
94+ "maxSeconds": 65.4,
95+ "projects": [
96+ {
97+ "project": "scale-mv6vzxzj-1x1-p1",
98+ "version": 3,
99+ "seconds": 65.4,
100+ "error": null
101+ }
102+ ]
103+ },
104+ "failedProjects": []
105+}
--- /dev/null
+++ b/server/scale/results/scale-mv6vzxzj-200x20.json
@@ -0,0 +1,132 @@
1+{
2+ "stage": "200x20",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "at": "2026-10-13T16:24:53.526Z",
5+ "projects": 200,
6+ "projectsMade": 200,
7+ "agentsPerProject": 20,
8+ "agents": 4000,
9+ "rounds": 3,
10+ "overlap": 0.2,
11+ "initSeconds": 2.9,
12+ "seconds": 26.4,
13+ "cutShort": false,
14+ "pushes": 11073,
15+ "pushesPerSecond": 419.13,
16+ "pushesPerSecondPerProject": {
17+ "p50": 2.12,
18+ "min": 1.59,
19+ "max": 2.271
20+ },
21+ "held": 1983,
22+ "settledOnRetry": 1057,
23+ "heldAfterRetry": 926,
24+ "requests": 50881,
25+ "requestsPerSecond": 1925.9,
26+ "errors": 1,
27+ "errorRate": 0,
28+ "errorsByStatus": {
29+ "publish 502": 1
30+ },
31+ "statuses": {
32+ "200": 50880,
33+ "502": 1
34+ },
35+ "latencyMs": {
36+ "blob": {
37+ "count": 200,
38+ "p50": 1159.3,
39+ "p95": 1551.2,
40+ "p99": 1660.5,
41+ "max": 1788.5
42+ },
43+ "init": {
44+ "count": 200,
45+ "p50": 302.1,
46+ "p95": 661.5,
47+ "p99": 833.9,
48+ "max": 1121.7
49+ },
50+ "news": {
51+ "count": 12000,
52+ "p50": 267.6,
53+ "p95": 466,
54+ "p99": 699.8,
55+ "max": 5567.9
56+ },
57+ "out": {
58+ "count": 75,
59+ "p50": 129.1,
60+ "p95": 223.4,
61+ "p99": 230.7,
62+ "max": 230.7
63+ },
64+ "publish": {
65+ "count": 13983,
66+ "p50": 371.5,
67+ "p95": 578.9,
68+ "p99": 761.6,
69+ "max": 5579.8
70+ },
71+ "record": {
72+ "count": 12000,
73+ "p50": 369.1,
74+ "p95": 545.4,
75+ "p99": 731.5,
76+ "max": 7481.3
77+ },
78+ "starting": {
79+ "count": 4000,
80+ "p50": 319.8,
81+ "p95": 570.6,
82+ "p99": 739,
83+ "max": 1152.2
84+ },
85+ "sync": {
86+ "count": 8423,
87+ "p50": 412.2,
88+ "p95": 2257,
89+ "p99": 3161.1,
90+ "max": 5662.2
91+ }
92+ },
93+ "artifacts": {
94+ "sampled": 5,
95+ "pushedOut": 5,
96+ "p50Seconds": 41.2,
97+ "maxSeconds": 65.4,
98+ "projects": [
99+ {
100+ "project": "scale-mv6vzxzj-200x20-p1",
101+ "version": 57,
102+ "seconds": 41.2,
103+ "error": null
104+ },
105+ {
106+ "project": "scale-mv6vzxzj-200x20-p2",
107+ "version": 60,
108+ "seconds": 65.4,
109+ "error": null
110+ },
111+ {
112+ "project": "scale-mv6vzxzj-200x20-p3",
113+ "version": 54,
114+ "seconds": 38.7,
115+ "error": null
116+ },
117+ {
118+ "project": "scale-mv6vzxzj-200x20-p4",
119+ "version": 59,
120+ "seconds": 43.6,
121+ "error": null
122+ },
123+ {
124+ "project": "scale-mv6vzxzj-200x20-p5",
125+ "version": 57,
126+ "seconds": 39.4,
127+ "error": null
128+ }
129+ ]
130+ },
131+ "failedProjects": []
132+}
--- /dev/null
+++ b/server/scale/results/scale-mv6vzxzj-50x10.json
@@ -0,0 +1,129 @@
1+{
2+ "stage": "50x10",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "at": "2026-10-13T16:22:27.686Z",
5+ "projects": 50,
6+ "projectsMade": 50,
7+ "agentsPerProject": 10,
8+ "agents": 500,
9+ "rounds": 3,
10+ "overlap": 0.2,
11+ "initSeconds": 2.2,
12+ "seconds": 7.7,
13+ "cutShort": false,
14+ "pushes": 1456,
15+ "pushesPerSecond": 190.05,
16+ "pushesPerSecondPerProject": {
17+ "p50": 3.785,
18+ "min": 3.263,
19+ "max": 3.916
20+ },
21+ "held": 113,
22+ "settledOnRetry": 69,
23+ "heldAfterRetry": 44,
24+ "requests": 6216,
25+ "requestsPerSecond": 811.4,
26+ "errors": 0,
27+ "errorRate": 0,
28+ "errorsByStatus": {},
29+ "statuses": {
30+ "200": 6216
31+ },
32+ "latencyMs": {
33+ "blob": {
34+ "count": 50,
35+ "p50": 887.6,
36+ "p95": 1228,
37+ "p99": 1471.7,
38+ "max": 1471.7
39+ },
40+ "init": {
41+ "count": 50,
42+ "p50": 260.8,
43+ "p95": 722.2,
44+ "p99": 809.7,
45+ "max": 809.7
46+ },
47+ "news": {
48+ "count": 1500,
49+ "p50": 178.4,
50+ "p95": 309.8,
51+ "p99": 539.8,
52+ "max": 1431.1
53+ },
54+ "out": {
55+ "count": 98,
56+ "p50": 129.6,
57+ "p95": 229.5,
58+ "p99": 598.5,
59+ "max": 598.5
60+ },
61+ "publish": {
62+ "count": 1613,
63+ "p50": 231.1,
64+ "p95": 405.2,
65+ "p99": 631.6,
66+ "max": 921.6
67+ },
68+ "record": {
69+ "count": 1500,
70+ "p50": 238.9,
71+ "p95": 499.9,
72+ "p99": 655.1,
73+ "max": 1621.6
74+ },
75+ "starting": {
76+ "count": 500,
77+ "p50": 416.4,
78+ "p95": 997.5,
79+ "p99": 1173.8,
80+ "max": 1278
81+ },
82+ "sync": {
83+ "count": 905,
84+ "p50": 1425.8,
85+ "p95": 2667.1,
86+ "p99": 3033.1,
87+ "max": 4522
88+ }
89+ },
90+ "artifacts": {
91+ "sampled": 5,
92+ "pushedOut": 5,
93+ "p50Seconds": 62.2,
94+ "maxSeconds": 62.7,
95+ "projects": [
96+ {
97+ "project": "scale-mv6vzxzj-50x10-p1",
98+ "version": 30,
99+ "seconds": 59.5,
100+ "error": null
101+ },
102+ {
103+ "project": "scale-mv6vzxzj-50x10-p2",
104+ "version": 29,
105+ "seconds": 62.7,
106+ "error": null
107+ },
108+ {
109+ "project": "scale-mv6vzxzj-50x10-p3",
110+ "version": 30,
111+ "seconds": 62.2,
112+ "error": null
113+ },
114+ {
115+ "project": "scale-mv6vzxzj-50x10-p4",
116+ "version": 29,
117+ "seconds": 58.6,
118+ "error": null
119+ },
120+ {
121+ "project": "scale-mv6vzxzj-50x10-p5",
122+ "version": 30,
123+ "seconds": 62.5,
124+ "error": null
125+ }
126+ ]
127+ },
128+ "failedProjects": []
129+}
--- /dev/null
+++ b/server/scale/results/scale-mv6vzxzj-ramp.json
@@ -0,0 +1,305 @@
1+{
2+ "prefix": "scale-mv6vzxzj",
3+ "server": "https://abso-open.chrisazy.workers.dev",
4+ "rounds": 3,
5+ "overlap": 0.2,
6+ "stages": [
7+ {
8+ "stage": "1x1",
9+ "server": "https://abso-open.chrisazy.workers.dev",
10+ "at": "2026-10-13T16:20:05.418Z",
11+ "projects": 1,
12+ "projectsMade": 1,
13+ "agentsPerProject": 1,
14+ "agents": 1,
15+ "rounds": 3,
16+ "overlap": 0.2,
17+ "initSeconds": 0.7,
18+ "seconds": 2.9,
19+ "cutShort": false,
20+ "pushes": 3,
21+ "pushesPerSecond": 1.05,
22+ "pushesPerSecondPerProject": {
23+ "p50": 1.05,
24+ "min": 1.05,
25+ "max": 1.05
26+ },
27+ "held": 0,
28+ "settledOnRetry": 0,
29+ "heldAfterRetry": 0,
30+ "requests": 36,
31+ "requestsPerSecond": 12.6,
32+ "errors": 0,
33+ "errorRate": 0,
34+ "errorsByStatus": {},
35+ "latencyMs": {
36+ "publish": {
37+ "count": 3,
38+ "p50": 136.5,
39+ "p95": 176.7,
40+ "p99": 176.7,
41+ "max": 176.7
42+ },
43+ "record": {
44+ "count": 3,
45+ "p50": 147.1,
46+ "p95": 342.7,
47+ "p99": 342.7,
48+ "max": 342.7
49+ },
50+ "sync": {
51+ "count": 2,
52+ "p50": 88.4,
53+ "p95": 807.2,
54+ "p99": 807.2,
55+ "max": 807.2
56+ }
57+ },
58+ "failedProjects": [],
59+ "artifacts": {
60+ "sampled": 1,
61+ "pushedOut": 1,
62+ "p50Seconds": 65.4,
63+ "maxSeconds": 65.4
64+ }
65+ },
66+ {
67+ "stage": "10x5",
68+ "server": "https://abso-open.chrisazy.workers.dev",
69+ "at": "2026-10-13T16:21:15.122Z",
70+ "projects": 10,
71+ "projectsMade": 10,
72+ "agentsPerProject": 5,
73+ "agents": 50,
74+ "rounds": 3,
75+ "overlap": 0.2,
76+ "initSeconds": 1.7,
77+ "seconds": 3.8,
78+ "cutShort": false,
79+ "pushes": 150,
80+ "pushesPerSecond": 39.9,
81+ "pushesPerSecondPerProject": {
82+ "p50": 3.99,
83+ "min": 3.99,
84+ "max": 3.99
85+ },
86+ "held": 4,
87+ "settledOnRetry": 4,
88+ "heldAfterRetry": 0,
89+ "requests": 717,
90+ "requestsPerSecond": 190.7,
91+ "errors": 0,
92+ "errorRate": 0,
93+ "errorsByStatus": {},
94+ "latencyMs": {
95+ "publish": {
96+ "count": 154,
97+ "p50": 204.9,
98+ "p95": 389,
99+ "p99": 676.4,
100+ "max": 802.6
101+ },
102+ "record": {
103+ "count": 150,
104+ "p50": 208.2,
105+ "p95": 460.3,
106+ "p99": 653.9,
107+ "max": 960
108+ },
109+ "sync": {
110+ "count": 85,
111+ "p50": 483.8,
112+ "p95": 952.3,
113+ "p99": 1026.1,
114+ "max": 1026.1
115+ }
116+ },
117+ "failedProjects": [],
118+ "artifacts": {
119+ "sampled": 5,
120+ "pushedOut": 5,
121+ "p50Seconds": 65,
122+ "maxSeconds": 66.8
123+ }
124+ },
125+ {
126+ "stage": "50x10",
127+ "server": "https://abso-open.chrisazy.workers.dev",
128+ "at": "2026-10-13T16:22:27.686Z",
129+ "projects": 50,
130+ "projectsMade": 50,
131+ "agentsPerProject": 10,
132+ "agents": 500,
133+ "rounds": 3,
134+ "overlap": 0.2,
135+ "initSeconds": 2.2,
136+ "seconds": 7.7,
137+ "cutShort": false,
138+ "pushes": 1456,
139+ "pushesPerSecond": 190.05,
140+ "pushesPerSecondPerProject": {
141+ "p50": 3.785,
142+ "min": 3.263,
143+ "max": 3.916
144+ },
145+ "held": 113,
146+ "settledOnRetry": 69,
147+ "heldAfterRetry": 44,
148+ "requests": 6216,
149+ "requestsPerSecond": 811.4,
150+ "errors": 0,
151+ "errorRate": 0,
152+ "errorsByStatus": {},
153+ "latencyMs": {
154+ "publish": {
155+ "count": 1613,
156+ "p50": 231.1,
157+ "p95": 405.2,
158+ "p99": 631.6,
159+ "max": 921.6
160+ },
161+ "record": {
162+ "count": 1500,
163+ "p50": 238.9,
164+ "p95": 499.9,
165+ "p99": 655.1,
166+ "max": 1621.6
167+ },
168+ "sync": {
169+ "count": 905,
170+ "p50": 1425.8,
171+ "p95": 2667.1,
172+ "p99": 3033.1,
173+ "max": 4522
174+ }
175+ },
176+ "failedProjects": [],
177+ "artifacts": {
178+ "sampled": 5,
179+ "pushedOut": 5,
180+ "p50Seconds": 62.2,
181+ "maxSeconds": 62.7
182+ }
183+ },
184+ {
185+ "stage": "100x10",
186+ "server": "https://abso-open.chrisazy.workers.dev",
187+ "at": "2026-10-13T16:23:39.895Z",
188+ "projects": 100,
189+ "projectsMade": 100,
190+ "agentsPerProject": 10,
191+ "agents": 1000,
192+ "rounds": 3,
193+ "overlap": 0.2,
194+ "initSeconds": 4.7,
195+ "seconds": 10.5,
196+ "cutShort": false,
197+ "pushes": 2921,
198+ "pushesPerSecond": 278.77,
199+ "pushesPerSecondPerProject": {
200+ "p50": 2.863,
201+ "min": 2.195,
202+ "max": 2.863
203+ },
204+ "held": 258,
205+ "settledOnRetry": 179,
206+ "heldAfterRetry": 79,
207+ "requests": 12376,
208+ "requestsPerSecond": 1181.1,
209+ "errors": 0,
210+ "errorRate": 0,
211+ "errorsByStatus": {},
212+ "latencyMs": {
213+ "publish": {
214+ "count": 3258,
215+ "p50": 374.8,
216+ "p95": 547.5,
217+ "p99": 790.8,
218+ "max": 1453
219+ },
220+ "record": {
221+ "count": 3000,
222+ "p50": 399.4,
223+ "p95": 570.1,
224+ "p99": 802,
225+ "max": 1159.3
226+ },
227+ "sync": {
228+ "count": 1827,
229+ "p50": 1333.2,
230+ "p95": 4069.4,
231+ "p99": 4486.2,
232+ "max": 5817.1
233+ }
234+ },
235+ "failedProjects": [],
236+ "artifacts": {
237+ "sampled": 5,
238+ "pushedOut": 5,
239+ "p50Seconds": 54.5,
240+ "maxSeconds": 62.4
241+ }
242+ },
243+ {
244+ "stage": "200x20",
245+ "server": "https://abso-open.chrisazy.workers.dev",
246+ "at": "2026-10-13T16:24:53.526Z",
247+ "projects": 200,
248+ "projectsMade": 200,
249+ "agentsPerProject": 20,
250+ "agents": 4000,
251+ "rounds": 3,
252+ "overlap": 0.2,
253+ "initSeconds": 2.9,
254+ "seconds": 26.4,
255+ "cutShort": false,
256+ "pushes": 11073,
257+ "pushesPerSecond": 419.13,
258+ "pushesPerSecondPerProject": {
259+ "p50": 2.12,
260+ "min": 1.59,
261+ "max": 2.271
262+ },
263+ "held": 1983,
264+ "settledOnRetry": 1057,
265+ "heldAfterRetry": 926,
266+ "requests": 50881,
267+ "requestsPerSecond": 1925.9,
268+ "errors": 1,
269+ "errorRate": 0,
270+ "errorsByStatus": {
271+ "publish 502": 1
272+ },
273+ "latencyMs": {
274+ "publish": {
275+ "count": 13983,
276+ "p50": 371.5,
277+ "p95": 578.9,
278+ "p99": 761.6,
279+ "max": 5579.8
280+ },
281+ "record": {
282+ "count": 12000,
283+ "p50": 369.1,
284+ "p95": 545.4,
285+ "p99": 731.5,
286+ "max": 7481.3
287+ },
288+ "sync": {
289+ "count": 8423,
290+ "p50": 412.2,
291+ "p95": 2257,
292+ "p99": 3161.1,
293+ "max": 5662.2
294+ }
295+ },
296+ "failedProjects": [],
297+ "artifacts": {
298+ "sampled": 5,
299+ "pushedOut": 5,
300+ "p50Seconds": 41.2,
301+ "maxSeconds": 65.4
302+ }
303+ }
304+ ]
305+}
--- /dev/null
+++ b/server/scale/scale.mjs
@@ -0,0 +1,448 @@
1+#!/usr/bin/env node
2+// A scale harness for abso's open server (server/). It talks HTTP directly, as the client does, so one machine can
3+// play thousands of agents across many projects. Each project is its own Durable Object and Artifacts repo, so total
4+// pushes a second should grow with the number of projects while each project's own latency stays flat.
5+//
6+// node server/scale/scale.mjs --server <url> [--projects 10] [--agents 5] [--rounds 3] [--overlap 0.2]
7+// node server/scale/scale.mjs --server <url> --ramp
8+//
9+// The token comes from ABSO_TOKEN, or from the file --token-file names. It is never printed. README.md says more.
11+import { createHash, randomBytes } from "node:crypto";
12+import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
13+import { dirname, join, resolve } from "node:path";
14+import { fileURLToPath } from "node:url";
16+const HERE = dirname(fileURLToPath(import.meta.url));
17+const HOT_LINES = 40;
18+/** The ramp's stages: projects × agents per project. */
19+export const RAMP = [
20+ [1, 1],
21+ [10, 5],
22+ [50, 10],
23+ [100, 10],
24+ [200, 20],
25+];
27+function parseArgs(argv) {
28+ const o = {
29+ server: "",
30+ projects: 10,
31+ agents: 5,
32+ rounds: 3,
33+ overlap: 0.2,
34+ prefix: "",
35+ concurrency: 256,
36+ maxSeconds: 240,
37+ artifactsSample: 5,
38+ artifactsWait: 180,
39+ tokenFile: "",
40+ ramp: false,
41+ stopErrorRate: 0.02,
42+ out: join(HERE, "results"),
43+ };
44+ for (let i = 0; i < argv.length; i++) {
45+ const a = argv[i];
46+ const next = () => {
47+ const v = argv[++i];
48+ if (v === undefined) throw new Error(`${a} needs a value`);
49+ return v;
50+ };
51+ if (a === "--server") o.server = next().replace(/\/+$/, "");
52+ else if (a === "--projects") o.projects = Number(next());
53+ else if (a === "--agents") o.agents = Number(next());
54+ else if (a === "--rounds") o.rounds = Number(next());
55+ else if (a === "--overlap") o.overlap = Number(next());
56+ else if (a === "--prefix") o.prefix = next();
57+ else if (a === "--concurrency") o.concurrency = Number(next());
58+ else if (a === "--max-seconds") o.maxSeconds = Number(next());
59+ else if (a === "--artifacts-sample") o.artifactsSample = Number(next());
60+ else if (a === "--artifacts-wait") o.artifactsWait = Number(next());
61+ else if (a === "--token-file") o.tokenFile = next();
62+ else if (a === "--out") o.out = next();
63+ else if (a === "--ramp") o.ramp = true;
64+ else if (a === "--help" || a === "-h") o.help = true;
65+ else throw new Error(`unknown argument ${a}`);
66+ }
67+ return o;
68+}
70+/** The value at fraction q of sorted numbers (nearest rank), or null when there are none. */
71+export function percentile(sorted, q) {
72+ if (sorted.length === 0) return null;
73+ return sorted[Math.min(sorted.length - 1, Math.max(0, Math.ceil(q * sorted.length) - 1))];
74+}
76+const round = (n, places = 1) => (n === null || n === undefined ? null : Math.round(n * 10 ** places) / 10 ** places);
78+/** At most `limit` calls in flight at once. */
79+function limiter(limit) {
80+ let active = 0;
81+ const queue = [];
82+ const release = () => {
83+ active--;
84+ const next = queue.shift();
85+ if (next) next();
86+ };
87+ return async (work) => {
88+ if (active >= limit) await new Promise((ok) => queue.push(ok));
89+ active++;
90+ try {
91+ return await work();
92+ } finally {
93+ release();
94+ }
95+ };
96+}
98+/** Latencies by operation, statuses, and the counts the summary reports. */
99+class Stats {
100+ ops = new Map();
101+ statuses = new Map();
102+ errors = new Map();
103+ requests = 0;
104+ pushes = 0;
105+ held = 0;
106+ settled = 0;
107+ heldAfterRetry = 0;
108+ perProject = new Map();
109+ time(op, ms, status) {
110+ if (!this.ops.has(op)) this.ops.set(op, []);
111+ this.ops.get(op).push(ms);
112+ this.requests++;
113+ this.statuses.set(status, (this.statuses.get(status) ?? 0) + 1);
114+ if (status === "network" || Number(status) >= 400) {
115+ const key = `${op} ${status}`;
116+ this.errors.set(key, (this.errors.get(key) ?? 0) + 1);
117+ }
118+ }
119+ pushed(project) {
120+ this.pushes++;
121+ this.perProject.set(project, (this.perProject.get(project) ?? 0) + 1);
122+ }
123+ errorCount() {
124+ let n = 0;
125+ for (const v of this.errors.values()) n += v;
126+ return n;
127+ }
128+ latency() {
129+ const out = {};
130+ for (const [op, list] of [...this.ops].sort()) {
131+ const s = [...list].sort((a, b) => a - b);
132+ out[op] = {
133+ count: s.length,
134+ p50: round(percentile(s, 0.5)),
135+ p95: round(percentile(s, 0.95)),
136+ p99: round(percentile(s, 0.99)),
137+ max: round(s.at(-1)),
138+ };
139+ }
140+ return out;
141+ }
142+}
144+class Client {
145+ constructor(server, token, stats, limit) {
146+ this.server = server;
147+ this.token = token;
148+ this.stats = stats;
149+ this.limit = limit;
150+ }
151+ /** One request, timed. Answers {status, body}; a network failure is status "network". */
152+ async call(method, path, body, op, raw) {
153+ return this.limit(async () => {
154+ const t0 = performance.now();
155+ let status = "network";
156+ try {
157+ const res = await fetch(`${this.server}${path}`, {
158+ method,
159+ headers: {
160+ authorization: `Bearer ${this.token}`,
161+ "x-abso-client": "abso-scale/1",
162+ ...(raw
163+ ? { "content-type": "application/octet-stream" }
164+ : body !== undefined
165+ ? { "content-type": "application/json" }
166+ : {}),
167+ },
168+ ...(raw ? { body: raw } : body !== undefined ? { body: JSON.stringify(body) } : {}),
169+ signal: AbortSignal.timeout(120_000),
170+ });
171+ status = String(res.status);
172+ const text = await res.text();
173+ let parsed;
174+ try {
175+ parsed = JSON.parse(text);
176+ } catch {
177+ parsed = text;
178+ }
179+ return { status: res.status, body: parsed };
180+ } catch (e) {
181+ return { status: 0, body: { error: e instanceof Error ? e.message : String(e) } };
182+ } finally {
183+ this.stats.time(op, performance.now() - t0, status);
184+ }
185+ });
186+ }
187+}
189+const sleep = (ms) => new Promise((ok) => setTimeout(ok, ms));
190+const hotText = () => Array.from({ length: HOT_LINES }, (_, i) => `hot line ${i + 1}`).join("\n") + "\n";
192+/** Makes a project: one starting file per agent is left to the agents; init holds the hot file, a readme and a blob. */
193+async function initProject(client, project) {
194+ const bytes = randomBytes(256);
195+ const sha = createHash("sha256").update(bytes).digest("hex");
196+ const put = await client.call("PUT", `/p/${project}/blobs/${sha}`, undefined, "blob", bytes);
197+ if (put.status !== 200) return { ok: false, why: `blob ${put.status}` };
198+ const init = await client.call(
199+ "POST",
200+ `/p/${project}/init`,
201+ { files: { "README.md": `# ${project}\n\nA scale run.\n`, "hot.txt": hotText() }, blobs: { "logo.bin": sha } },
202+ "init",
203+ );
204+ return init.status === 200 ? { ok: true } : { ok: false, why: `init ${init.status}` };
205+}
207+/** One agent: join, say what it starts on, then rounds of edit, record and publish. A held push pulls and retries once. */
208+async function runAgent(client, stats, project, agent, o, deadline) {
209+ const base = `/p/${project}/a/${agent}`;
210+ const view = new Map();
211+ const take = (files) => {
212+ for (const [path, text] of Object.entries(files ?? {})) {
213+ if (text === null) view.delete(path);
214+ else view.set(path, text);
215+ }
216+ };
217+ const join = await client.call("POST", `${base}/sync`, {}, "sync");
218+ if (join.status !== 200) return;
219+ take(join.body.files);
220+ await client.call("POST", `${base}/starting`, { text: `Scale run: ${agent} edits its own file` }, "starting");
221+ const own = `agents/${agent}.txt`;
222+ let mine = "";
223+ for (let r = 1; r <= o.rounds && Date.now() < deadline; r++) {
224+ const hot = Math.random() < o.overlap;
225+ let files;
226+ if (hot) {
227+ // Pull first, as an agent does before it touches a file others work on.
228+ const pulled = await client.call("POST", `${base}/sync`, {}, "sync");
229+ if (pulled.status !== 200) continue;
230+ take(pulled.body.files);
231+ const lines = (view.get("hot.txt") ?? hotText()).split("\n");
232+ const at = Math.floor(Math.random() * Math.min(3, lines.length - 1));
233+ lines[at] = `hot line ${at + 1}, as ${agent} wants it in round ${r}`;
234+ files = { "hot.txt": lines.join("\n") };
235+ } else {
236+ mine += `${agent} round ${r}\n`;
237+ files = { [own]: mine };
238+ }
239+ const rec = await client.call("POST", `${base}/record`, { files }, "record");
240+ if (rec.status !== 200) continue;
241+ for (const [p, t] of Object.entries(files)) view.set(p, t);
242+ let pub = await client.call("POST", `${base}/publish`, { message: `${agent} round ${r}` }, "publish");
243+ if (pub.status === 200 && pub.body.ok === false) {
244+ stats.held++;
245+ // Settle: pull (both sides' lines come back), then push with both sides kept, as abso push --as-is does.
246+ const pulled = await client.call("POST", `${base}/sync`, {}, "sync");
247+ if (pulled.status === 200) take(pulled.body.files);
248+ pub = await client.call(
249+ "POST",
250+ `${base}/publish`,
251+ { message: `${agent} round ${r}, settled`, asIs: true },
252+ "publish",
253+ );
254+ if (pub.status === 200 && pub.body.ok === true) stats.settled++;
255+ else if (pub.status === 200) stats.heldAfterRetry++;
256+ }
257+ if (pub.status === 200 && pub.body.ok === true) {
258+ stats.pushed(project);
259+ stats.lastPush.set(project, Date.now());
260+ }
261+ await client.call("POST", `${base}/news`, {}, "news");
262+ }
263+}
265+/** For a sample of projects: how long after its last push until /out says Artifacts holds shared's newest version. */
266+async function artifactsLag(client, projects, stats, o) {
267+ const sample = projects.slice(0, o.artifactsSample);
268+ const until = Date.now() + o.artifactsWait * 1000;
269+ const results = await Promise.all(
270+ sample.map(async (project) => {
271+ for (;;) {
272+ const out = await client.call("GET", `/p/${project}/out`, undefined, "out");
273+ const b = out.body ?? {};
274+ if (out.status === 200 && b.version !== null && b.pushed && b.pushed.version >= b.version) {
275+ const last = stats.lastPush.get(project) ?? stats.started;
276+ return { project, version: b.version, seconds: round((Date.now() - last) / 1000), error: null };
277+ }
278+ if (out.status === 200 && b.artifacts === "unbound")
279+ return { project, version: b.version, seconds: null, error: "artifacts unbound" };
280+ if (Date.now() > until)
281+ return {
282+ project,
283+ version: b.version ?? null,
284+ seconds: null,
285+ error: b.error ? `not pushed: ${JSON.stringify(b.error).slice(0, 160)}` : "not pushed in time",
286+ };
287+ await sleep(3000);
288+ }
289+ }),
290+ );
291+ const done = results
292+ .map((r) => r.seconds)
293+ .filter((s) => s !== null)
294+ .sort((a, b) => a - b);
295+ return {
296+ sampled: sample.length,
297+ pushedOut: done.length,
298+ p50Seconds: percentile(done, 0.5),
299+ maxSeconds: done.at(-1) ?? null,
300+ projects: results,
301+ };
302+}
304+/** One stage: P projects × A agents × R rounds. */
305+export async function runStage(o, token, name) {
306+ const stats = new Stats();
307+ stats.lastPush = new Map();
308+ const client = new Client(o.server, token, stats, limiter(o.concurrency));
309+ const projects = Array.from({ length: o.projects }, (_, i) => `${o.prefix}-${name}-p${i + 1}`.toLowerCase());
310+ stats.started = Date.now();
311+ const made = await Promise.all(projects.map((p) => initProject(client, p)));
312+ const live = projects.filter((_, i) => made[i].ok);
313+ const initSeconds = (Date.now() - stats.started) / 1000;
314+ const t0 = Date.now();
315+ const deadline = t0 + o.maxSeconds * 1000;
316+ await Promise.all(
317+ live.flatMap((p) =>
318+ Array.from({ length: o.agents }, (_, a) => runAgent(client, stats, p, `agent-${a + 1}`, o, deadline)),
319+ ),
320+ );
321+ const seconds = (Date.now() - t0) / 1000;
322+ const lag = await artifactsLag(client, live, stats, o);
323+ const perProject = [...stats.perProject.values()].map((n) => n / seconds).sort((a, b) => a - b);
324+ return {
325+ stage: name,
326+ server: o.server,
327+ at: new Date(t0).toISOString(),
328+ projects: o.projects,
329+ projectsMade: live.length,
330+ agentsPerProject: o.agents,
331+ agents: live.length * o.agents,
332+ rounds: o.rounds,
333+ overlap: o.overlap,
334+ initSeconds: round(initSeconds),
335+ seconds: round(seconds),
336+ cutShort: Date.now() > deadline,
337+ pushes: stats.pushes,
338+ pushesPerSecond: round(stats.pushes / seconds, 2),
339+ pushesPerSecondPerProject: {
340+ p50: round(percentile(perProject, 0.5), 3),
341+ min: round(perProject[0] ?? null, 3),
342+ max: round(perProject.at(-1) ?? null, 3),
343+ },
344+ held: stats.held,
345+ settledOnRetry: stats.settled,
346+ heldAfterRetry: stats.heldAfterRetry,
347+ requests: stats.requests,
348+ requestsPerSecond: round(stats.requests / seconds, 1),
349+ errors: stats.errorCount(),
350+ errorRate: round(stats.errorCount() / Math.max(1, stats.requests), 4),
351+ errorsByStatus: Object.fromEntries(stats.errors),
352+ statuses: Object.fromEntries(stats.statuses),
353+ latencyMs: stats.latency(),
354+ artifacts: lag,
355+ failedProjects: projects.filter((_, i) => !made[i].ok).map((p, i) => ({ project: p, why: made[i]?.why })),
356+ };
357+}
359+export function summaryRow(r) {
360+ const pub = r.latencyMs.publish ?? {};
361+ const lag = r.artifacts.p50Seconds === null ? "n/a" : `${r.artifacts.p50Seconds} s (max ${r.artifacts.maxSeconds} s)`;
362+ return `| ${r.projectsMade}×${r.agentsPerProject} | ${r.agents} | ${r.pushes} | ${r.pushesPerSecond} | ${pub.p50 ?? "n/a"} | ${pub.p95 ?? "n/a"} | ${r.held} (${r.heldAfterRetry} still held) | ${r.errors} (${(r.errorRate * 100).toFixed(2)}%) | ${lag} (${r.artifacts.pushedOut}/${r.artifacts.sampled}) |`;
363+}
365+export const SUMMARY_HEAD = [
366+ "| Stage (projects×agents) | Agents | Pushes | Pushes/s | Push p50 ms | Push p95 ms | Held | Errors | Artifacts lag p50 (pushed/sampled) |",
367+ "|---|---|---|---|---|---|---|---|---|",
368+];
370+function latencyTable(r) {
371+ const lines = ["| Operation | Count | p50 ms | p95 ms | p99 ms | max ms |", "|---|---|---|---|---|---|"];
372+ for (const [op, l] of Object.entries(r.latencyMs))
373+ lines.push(`| ${op} | ${l.count} | ${l.p50} | ${l.p95} | ${l.p99} | ${l.max} |`);
374+ return lines.join("\n");
375+}
377+function readToken(o) {
378+ if (o.tokenFile)
379+ return readFileSync(
380+ o.tokenFile.replace(/^~(?=$|[\\/])/, process.env.USERPROFILE ?? process.env.HOME ?? "~"),
381+ "utf8",
382+ ).trim();
383+ return (process.env.ABSO_TOKEN ?? "").trim();
384+}
386+async function main() {
387+ const o = parseArgs(process.argv.slice(2));
388+ if (o.help || !o.server) {
389+ console.log(readFileSync(join(HERE, "README.md"), "utf8"));
390+ return;
391+ }
392+ const token = readToken(o);
393+ if (!token) throw new Error("no token: set ABSO_TOKEN or pass --token-file <file>");
394+ const runId = Date.now().toString(36);
395+ o.prefix ||= `scale-${runId}`;
396+ mkdirSync(o.out, { recursive: true });
397+ const stages = o.ramp ? RAMP : [[o.projects, o.agents]];
398+ const rows = [];
399+ const files = [];
400+ for (const [projects, agents] of stages) {
401+ const name = `${projects}x${agents}`;
402+ console.error(`stage ${name}: ${projects} projects × ${agents} agents × ${o.rounds} rounds on ${o.server}`);
403+ const r = await runStage({ ...o, projects, agents }, token, name);
404+ const file = join(o.out, `${o.prefix}-${name}.json`);
405+ writeFileSync(file, `${JSON.stringify(r, null, "\t")}\n`);
406+ files.push(file);
407+ rows.push(r);
408+ console.log(`\n### Stage ${name}\n\n${SUMMARY_HEAD.join("\n")}\n${summaryRow(r)}\n\n${latencyTable(r)}\n`);
409+ if (r.errorRate > o.stopErrorRate || r.projectsMade < r.projects) {
410+ console.log(
411+ `Stopped after stage ${name}: errors ${(r.errorRate * 100).toFixed(2)}%, projects made ${r.projectsMade} of ${r.projects}.`,
412+ );
413+ break;
414+ }
415+ }
416+ if (rows.length > 1) {
417+ const summary = {
418+ prefix: o.prefix,
419+ server: o.server,
420+ rounds: o.rounds,
421+ overlap: o.overlap,
422+ stages: rows
423+ .map((r) => ({
424+ ...r,
425+ latencyMs: { publish: r.latencyMs.publish, record: r.latencyMs.record, sync: r.latencyMs.sync },
426+ }))
427+ .map(({ artifacts, statuses, ...r }) => ({
428+ ...r,
429+ artifacts: {
430+ sampled: artifacts.sampled,
431+ pushedOut: artifacts.pushedOut,
432+ p50Seconds: artifacts.p50Seconds,
433+ maxSeconds: artifacts.maxSeconds,
434+ },
435+ })),
436+ };
437+ writeFileSync(join(o.out, `${o.prefix}-ramp.json`), `${JSON.stringify(summary, null, "\t")}\n`);
438+ console.log(`\n## Ramp ${o.prefix}\n\n${SUMMARY_HEAD.join("\n")}\n${rows.map(summaryRow).join("\n")}\n`);
439+ }
440+ console.error(`results: ${files.join(", ")}`);
441+}
443+if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
444+ main().catch((e) => {
445+ console.error(e instanceof Error ? e.message : String(e));
446+ process.exit(1);
447+ });
448+}