Repository navigation
Preregister the ask replay eval: does an ask ledger cut needless asks without holding back needed ones (GST-2771) - #348
Conversation
…pts, parser and reason codes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…inker Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… synthetic set Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…pin loading Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e README Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…dit draws, and reword the synthetic ask closer Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… preregistration's custody values Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…pre-push scan, and reword one fixture line Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
| let status = 0; | ||
| let text = ""; | ||
| try { | ||
| const res = await fetch("http://127.0.0.1:" + p.port + "/" + b.slot + "/" + m.provider + route, { method: "POST", headers: { authorization: "Bearer " + b.token, "content-type": "application/json" }, body: JSON.stringify(body), signal: AbortSignal.timeout(FROZEN.shards.request_timeout_ms) }); |
There was a problem hiding this comment.
Local timeouts retry requests that are still running upstream
Medium Severity
A provider response taking more than five minutes triggers this local abort, but the proxy's upstream fetch uses its separate fifteen-minute deadline and does not consume the incoming request's abort signal. finalize() waits only thirty seconds and can return undrained, which this client ignores; runSample() then sends another paid attempt while the original continues. Successful slow responses are discarded and can become UPSTREAM MISSING after repeated charges. Align the upstream and client deadlines and drain or cancel the upstream request before allowing a retry or closing its lease.
| const todo = o.samples.filter((s) => last.get(s.id) === "upstream" && !o.store.has(s.id + "~u")); | ||
| let still = 0; | ||
| await pool(o.concurrency ?? FROZEN.shards.concurrency, cells(todo).map((cell) => async () => { | ||
| for (const s of cell) { | ||
| const r = await runSample(o, s, UPSTREAM_DRAW, true); |
There was a problem hiding this comment.
Interrupted upstream redraws can be sent repeatedly on resume
Medium Severity
If a shard dies after starting draw 3 but before sealing <id>~u, the next --redraw-upstream invocation selects the sample again and restarts draw 3 at attempt 1. Unlike runShard(), this path never reads calls.ndjson or checks whether its permitted redraw was already started. The real proxy reconciles the old charge but creates a fresh reservation for the resend, allowing repeated paid draws after repeated interruptions despite the frozen one-pass limit. Reconcile journaled redraw attempts and enforce their bounded recovery before sending again.
… scrubber fixture The pre-merge check found no test for lanes/ask-replay/frozen.json and read the fixture's fake Anthropic key as a real one. The fixture string is unchanged at runtime, and the dry run output is byte-identical. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… item one at a time, and refuse to score a partial run A metering proxy refusal (missing key, closed lease, ledger, allowance, tripwire) now stops the shard with the sample unsealed instead of sealing it as an upstream MISSING. Each run directory holds one live shard and settles only a stale lease it opened itself, so a second shard on the same spend item is refused while the first holds its lease. score refuses a run whose replies lack scheduled samples and prints the absent counts instead of decision rows. A cap stop now exits 2 with E_ASK_CAP, and particle-1's routing check runs before any lease opens. The dry run drives the new scoring rule, and the prereg post records it. Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team Review-Finding: p1/specialist-batched#1 reader=specialist-batched Review-Finding: p1/specialist-batched#2 reader=specialist-batched Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…eduled score now counts absent samples against the replicate count each shard recorded (3 after the pilot rule, per arm for the pilot), and a frontier model with no replies blocks the decision rows. particle-1 gaps mark its readout untested instead of blocking. run refuses a spend item the prereg does not pair with the model, before any lease opens. Review-Finding: p2/red-team#1 reader=red-team Review-Finding: p2/specialist-batched#1 reader=testing Review-Finding: p1/red-team#4 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…applies the pilot rule score prints no decision rows unless the label audit is complete and stands, or the contingency labels are complete. A new pilot command applies the frozen admission and replicate rules, and run accepts only the replicate counts those rules allow. A metering-proxy refusal now stops the shard and retries as the same draw. Shards enforce the 55-minute limit and clean their RAM-disk directory on exit and on TERM, INT and HUP. A custody opening removes only directories whose owner process is dead. The output cap stays at 4,000 tokens for every model and arm. Review-Finding: p3/outside-voice#1 reader=outside-voice Review-Finding: p3/red-team#1 reader=red-team Review-Finding: p3/outside-voice#5 reader=outside-voice Review-Finding: p3/specialist-batched#1 reader=state-machines Review-Finding: p3/outside-voice#2 reader=outside-voice Review-Finding: p3/outside-voice#4 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
| const provider = FROZEN.models[s.model].provider; | ||
| const sleep = o.sleep ?? realSleep; | ||
| const calls = join(o.out, "calls.ndjson"); | ||
| const rec = { ...blank(s, draw, x.redraw ?? false), attempts: (x.first ?? 1) - 1 }; |
There was a problem hiding this comment.
Resumed unsent attempts reset the retry counters
Medium Severity
runSample starts its upstream and unparsable counters at zero on every call (run.ts:185-186), and an unsent attempt resumes at its journaled attempt number (run.ts:289, first = j.unsent) without restoring those counters. The frozen rule allows one unparsable retry and three upstream retries (frozen.json retries; prereg section 6). Trace: attempt 1 returns upstream, attempt 2 returns upstream, and the 55-minute limit passes during the backoff, so the loop-top past() check at run.ts:190-196 journals attempt 3 as unsent and the shard stops. On resume, runSample restarts with upstream=0, so attempts 3 to 6 run and the sample reads UPSTREAM after six upstream attempts instead of four. Likewise, an unparsable retry at attempt 2 that a proxy refusal stops gets a fresh unparsable=0 on resume and runs a second retry at attempt 3. The extra attempts are paid calls and change the MISSING counts the decision rows read. No test covers a resumed unsent attempt: the limit tests at tests/ask-replay/run.test.ts:256-331 never resume a sample with a retry in progress. Fix: write the upstream and unparsable counts on each unsent journal line, restore them in journaled() and runSample, and add a test that stops a sample mid-retry and resumes it.
| if (v !== null) per.get(o.item)!.push(v); | ||
| } | ||
| const of = (needless: boolean) => items.filter((i) => isNeedless(i.label) === needless).map((i) => per.get(i.item)!); | ||
| cells[m] = { needless: of(true), must: of(false) }; |
There was a problem hiding this comment.
Pilot readout admits and sets k from partial replies
Medium Severity
pilotReadout has no completeness check, so ask-replay pilot (cli.ts:208) prints admission, W, V, B2 and k from whatever replies are on disk, with exit 0. Two gaps. A model with no replies is skipped (score.ts:320 continue), so an unrun or unfinished Sol pilot is dropped silently and admission rests on Opus alone (admit is some over models, stats.ts:108). An item with no sealed reply enters of() as an empty list (score.ts:328), and meanOf([]) returns 0 (stats.ts:88), so a missing must-ask item adds zero misses and a missing needless item adds zero sends; spreadProjection also drops empty items from V (stats.ts:115). Trace: the pilot shard stops at the limit with half of Opus arm (b)'s 16 must-ask items sealed, so misses are undercounted, Opus can clear the misses <= 8 bar, and k is set from fewer items. The score command refuses any partial run with E_ASK_INCOMPLETE (cli.ts:174-178); the pilot path does not apply that rule, though the admission it prints is the gate for the main run. Fix: count absent samples per pilot model and arm as score does, refuse with E_ASK_INCOMPLETE before pilotAdmit, and report a model with no replies as absent rather than skipping it. The complete-pilot test (tests/ask-replay/score.test.ts:195-212) does not cover this.
Adds the preregistration and keyless harness for an eval that replays 346 real owner asks, to test whether an ask ledger in gstack cuts needless asks without holding back needed ones.
The result decides whether gstack builds the ledger and trims its asking prose, drops the ledger, or treats its asking rules as a cut candidate.
Nothing to do here: no paid call runs until this merges and each spend item has a cap.
What the eval does
Files
lanes/ask-replay/: builder, ledger, prompts, parser, scorer, stats, chains, draws, labeller, paid driver (built, never run here), custody wrapper, privacy scanners, codebook, frozen.json, synthetic set, README.tests/ask-replay/: keyless tests.wiki/plans/2026-11-15-geva-539-ask-replay-prereg/: the preregistration, with frozen.json, the dry run output and the plan review record attached.ask-replayrow insrc/cli.ts,E_ASK_*codes insrc/errors/codes.ts,docs/errors.mdregenerated.Checks
gstack-evals ask-replay dryrun: every check passes and none fails; the output is byte-identical to the attached dryrun.txt.gstack-evals ask-replay synth: the committed set matches the generator. The synthetic overlap check against the sealed text passed (0 six-word hits).gstack-pregate sealed: clear before every push.Agent notes
score --drawsfrom printing decision rows, land with tests in the first commit of the results branch before any paid call.upstreamRedraw.Notes from the last review (9af0bea):
score --drawsoverrides the frozen 10,000 draws; the guard lands with the deferred fixes.Notes from earlier reviews:
Approvals
Approved: yes (record r-7d25b5909120). The full approval record stays private.
Plan: approved (record r-65fef78e879f)
Plan check: approved (record r-65fef78e879f)
Review loop
Review-loop exception: accepted by GEVA-2 2026-11-15 via gstack-approvals a-d2ffc8fbec23: GEVA-2 accepts a second review past the R51 limit on #348: fix six of the seven open p3 blockers in one commit (blocker 6 ships as a listed note), then one read-only full review of the final head with no fix round; any finding that can make a published number or decision wrong or leak sealed material comes to the Captain, and findings that cannot ship as listed notes. (second full pass at 9af0bea, deferred p3/outside-voice#3, p4/red-team#1, p4/adversarial-native#1, p4/targeted#1, p4/outside-voice#1, p4/outside-voice#2, p4/outside-voice#3, p4/red-team#2, p4/adversarial-native#3, p4/adversarial-native#2, p4/targeted#2)
Approved by GEVA-2 2026-11-15 via gstack-approvals a-240f5bea4781
GEVA-2 accepts a further review on #348 past the R51 limit: fix p2/red-team#1 and p2/specialist-batched#1 in one commit, then one read-only full review of the final head with no fix round; any blocker comes to the Captain.
Approved by GEVA-2 2026-11-15 via gstack-approvals a-9fd168458f66
GEVA-2 defers p4/red-team#1 and p4/red-team#2 from the last review of #348: both are fixed with tests in the first commit of the results branch before any paid call, and the results PR's review covers them.
Approved by GEVA-2 2026-11-15 via gstack-approvals a-77264c0d1049
If the Step 11 voices raise another finding of the B1 kind, you may defer it the same way, but only if its fix only makes the code refuse or check more, runs under about 20 lines with a two-way test, and touches no prereg digest.
Documentation
Status: current. The docs match the change, and nothing was edited (read-only audit).
Scope: 47 committed files from base 3dd1ffb to head 9af0bea on ask-replay-prereg, with nothing staged, unstaged or new. The change adds the ask-replay lane, its tests, E_ASK_ reason codes, a CLI row and the preregistration post.
Documentation health:
Coverage debt: The ask-replay command is documented in the lane README (reference and how-to) but is not linked from the root README. That is acceptable until results land. There are no critical gaps.
Diagram drift: none. No diagrams reference the changed code.
Agent notes