From a5075807da8f53521c1e3ab72d7912013111a579 Mon Sep 17 00:00:00 2001 From: santoshkumarradha Date: Thu, 17 Sep 2026 20:53:46 -0400 Subject: [PATCH 1/2] relay: accept the exec and run doors, not only task and do Co-Authored-By: codeaf --- relay/README.md | 4 ++++ relay/src/schema.js | 6 +++--- relay/test/worker.test.js | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/relay/README.md b/relay/README.md index 4e09062baa..8535f58cec 100644 --- a/relay/README.md +++ b/relay/README.md @@ -13,6 +13,10 @@ It serves, all under `/pool/`: `POST /pool/v1/rows` for submissions, its signature, and `GET /pool/healthz`; every other path answers 404 with an empty body. +A submitted row is one NDJSON line per scored seat, and its `door` is the door +the run came in by — one of `task`, `do`, `exec` or `run`. A door the wire does +not know is refused. + ## Priming The first published index was primed once, from the same measured runs the diff --git a/relay/src/schema.js b/relay/src/schema.js index c32b46423e..ddfd2c5c6a 100644 --- a/relay/src/schema.js +++ b/relay/src/schema.js @@ -6,7 +6,7 @@ // {"schema":1,"day":"YYYY-MM-DD","nonce":"<32 lowercase hex>","payload":{...}} // The payload is the record.Row fields: // {"schema":1,"metric":"role_quality","role":...,"model":...,"score":..., -// "judge":...,"door":...,"size":...,"day":"YYYY-MM-DD"} +// "judge":...,"door":"task"|"do"|"exec"|"run","size":...,"day":"YYYY-MM-DD"} // // Everything here is pure: no KV, no fetch, no clock of its own. @@ -14,7 +14,7 @@ const METRIC = 'role_quality'; const ROLES = new Set(['worker', 'high', 'mastermind']); -const DOORS = new Set(['task', 'do']); +const DOORS = new Set(['task', 'do', 'exec', 'run']); const SIZES = new Set(['S', 'M', 'L']); // A model id is "/". The Go side draws both halves from a closed @@ -97,7 +97,7 @@ export function validateRow(line, now = new Date()) { return fail('judge must be /'); } if (!DOORS.has(payload.door)) { - return fail('door must be task or do'); + return fail('door must be task, do, exec or run'); } if (!SIZES.has(payload.size)) { return fail('size must be S, M or L'); diff --git a/relay/test/worker.test.js b/relay/test/worker.test.js index a38b4bb770..e8168706a7 100644 --- a/relay/test/worker.test.js +++ b/relay/test/worker.test.js @@ -149,6 +149,21 @@ test('submit folds a batch into sheets and answers 202', async () => { assert.equal(e.POOL.map.get(`quota/${INSTALL}/2026-09-17`), '2'); }); +test('a row on the exec or run door is accepted and folded, and a row on a door outside the four is refused naming them', async () => { + const e = env(); + const body = line({ door: 'exec' }) + '\n' + line({ door: 'run' }) + '\n'; + const res = await worker.fetch(post(body, { 'X-Codeaf-Install': INSTALL }), e); + assert.equal(res.status, 202); + assert.deepEqual(await res.json(), { accepted: 2 }); + const cell = `sheet/${INSTALL}/2026-09-17/worker|z-ai/glm-5.3-flash|anthropic/claude-opus-5|`; + assert.deepEqual(JSON.parse(e.POOL.map.get(`${cell}exec|M`)), { n: 1, s: 50, s2: 2500 }); + assert.deepEqual(JSON.parse(e.POOL.map.get(`${cell}run|M`)), { n: 1, s: 50, s2: 2500 }); + + const refused = await worker.fetch(post(line({ door: 'shell' }), { 'X-Codeaf-Install': INSTALL }), env()); + assert.equal(refused.status, 400); + assert.match((await refused.json()).error, /door must be task, do, exec or run/); +}); + test('submit refuses a batch past the daily quota and stores nothing', async () => { const e = env({ ROWS_PER_INSTALL_PER_DAY: '1' }); const body = line() + '\n' + line() + '\n'; From 674f45e56946c4f2403f012d4b2b5b120bc6ef0a Mon Sep 17 00:00:00 2001 From: santoshkumarradha Date: Thu, 17 Sep 2026 20:54:35 -0400 Subject: [PATCH 2/2] record: the row comment names the four doors the relay accepts Co-Authored-By: codeaf --- internal/pool/record/record.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pool/record/record.go b/internal/pool/record/record.go index 551233202d..2fda401483 100644 --- a/internal/pool/record/record.go +++ b/internal/pool/record/record.go @@ -99,7 +99,8 @@ const rowSchema = 1 // Row is one judged seat score as it leaves the install: what was scored — // the metric, the seat and the model that held it, the score on the 0-100 // scale — and the facts of the run it was read from, the judge that answered, -// the door the run came in by, the size of the crew, and the day. +// the door the run came in by (task, do, exec or run), the size of the crew, +// and the day. type Row struct { Schema int `json:"schema"` Metric string `json:"metric"`