Skip to content

Preregister the ask replay eval: does an ask ledger cut needless asks without holding back needed ones (GST-2771) - #348

Merged
capy-ai[bot] merged 14 commits into
mainfrom
ask-replay-prereg
Nov 15, 2026
Merged

capy-ai[bot] merged 14 commits into
mainfrom
ask-replay-prereg

Conversation

@garrytan

@garrytan garrytan commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

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
  • Each item is the moment a coordinating agent was about to send a real ask. The agent sees what it could see then (the owner conversation, the standing rules in force, a fixed list of what it could check, the draft) and picks SEND, FOLD into the waiting line, or DROP.
  • Four arms on the same items and models: no gstack prose, gstack v1.99.5.0 as it is today, gstack plus the ledger, and the ledger without gstack's prose. Claude Opus 5.5 and GPT-6.1 Sol on all four, particle-1 on three when its route denies data collection.
  • Scoring is deterministic from the chosen action: needless sends, and needed asks held back, with a 5-point non-inferiority guard. Intervals are paired bootstraps over chains of repeated asks. The decision table and its operational reading are frozen in the post.
  • The real asks stay sealed outside the repo; the post commits counts and digests only. The repo gets the harness and a 60-item synthetic set of the same shape.
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.
  • Shared registries: the ask-replay row in src/cli.ts, E_ASK_* codes in src/errors/codes.ts, docs/errors.md regenerated.
Checks
  • CI on the final head: green (tests, typecheck, error codes, wiki).
  • 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
  • Plan: lean /autoplan run autoplan-20261115054010, gate 1 ruled "do it" by the Captain on every recommendation, plus rulings on the ledger's spec, arm (d), the processors and the custody choice. A later ruling kept the margins when the chain-level detectable difference came out at 11.0 points.
  • Spend items (central; caps go in the Captain's approvals file at 1.35 times): I1 $8, I2 $23, I2r $24 if needed, I3 $52, I4 $130 if needed, I5 $18, I6 $308, I7 $154, I8 $7. About $570 central, $724 with both contingencies, inside the approved $400 to $800.
  • Review history: four full reviews on gstack's full plan (d4f5d3a, the 5da9618 range, 81a47bf, 9af0bea), past the usual limit by the Captain's rulings. The last one read the final head with no fix round.
  • The Captain accepted fixes A to C for the first review's three blockers (5da9618). The pairing check, decision D (run refuses a spend item not paired with --model), landed in 81a47bf on the Captain's ruling. 9af0bea fixed six of the third review's seven blockers.
  • Blocker 6 (p3/outside-voice#3, run.ts:265; raised again as p4/outside-voice#3 at run.ts:322) is not fixed: an interrupted end-of-run upstream redraw rebuys its draw-3 call on restart. The spend item's cap bounds it. Operating rule: check the ledger after any interrupted resume.
  • Blocker 3 choice: the output-cap raise was removed from frozen.json rather than adding an operator step. It is the smaller change and keeps one cap for every arm (frozen.json sha256 0540d5c1473c).
  • k rule reading: the post sets k = 3 when MDD(2) is above 12 points but does not say how to combine models. The harness takes k = 3 when either model's projected MDD at k = 2 is above 12 points, and both models run at that k.
  • SIGKILL coverage: the /dev/shm directory is removed on normal exit, error, cap stop, deadline, SIGTERM, SIGINT and SIGHUP. A SIGKILL cannot be trapped, so the next opening's dead-owner sweep removes it, and the operator checks /dev/shm on every wake.
  • Deferred to the results branch: p4/red-team#1 (pilot refuses incomplete replies; p4/adversarial-native#1 is the same), p4/red-team#2 (a resumed attempt keeps its used retries; p4/adversarial-native#3 is the same), and from the voices p4/targeted#1 with p4/outside-voice#1 (label gate: a null kappa, the 40-pair floor, an empty contingency), p4/outside-voice#2 (an incomplete link run), p4/adversarial-native#2 (any other error stops every cell) and p4/targeted#2 (score checks the main run's k against the pilot). These fixes, plus a guard that stops an overridden score --draws from printing decision rows, land with tests in the first commit of the results branch before any paid call.
  • The p4/red-team#2 fix also covers the draw-3 resume in upstreamRedraw.
  • The results-branch fix leaves five passages of this post incomplete (section 7's rule bullet, section 10's admission bullet, section 13's E_ASK_INCOMPLETE row and absent-samples paragraph, and Agent notes item 6). The results post lists them as deviations. No digest or frozen number changes, and dryrun.txt regenerates byte-identical.

Notes from the last review (9af0bea):

  • p4/specialist-batched#1, tests/ask-replay/ledger.test.ts:60: the open-row FOLD case is never asserted (also p3/specialist-batched#3).
  • p4/specialist-batched#2, run.ts:324: a resumed upstreamRedraw ignores calls.ndjson and reuses the draw-3 key (the deferred p4/red-team#2 fix covers it).
  • p4/red-team#3, cli.ts:347: --recipient is checked only after paid calls; scored MISSING needs two operator mistakes in a row.
  • p4/red-team#4, frozen.ts:58: the lane's frozen.json is not checked against the prereg's sha256 pin; the two copies are identical today.
  • p4/red-team#5, cli.ts:185: score --draws overrides the frozen 10,000 draws; the guard lands with the deferred fixes.
  • p4/adversarial-native#4, run.ts:465: the particle provider check is unverified; confirm OpenRouter's provider string in the I1 smoke.
  • p4/adversarial-native#5, run.ts:318: upstreamRedraw parses index.ndjson with no try (blocker 6 family).
  • p4/adversarial-native#6, label.ts:100: the same defect as p4/targeted#1 (deferred).
  • p4/adversarial-native#7, src/errors/codes.ts: the new E_ASK codes carry owner U20 rather than GEVA-539.

Notes from earlier reviews:

  • p3/specialist-batched#2, run.ts:251: after one cell's refusal or crash, cells in flight finish their replicates (the deferred p4/adversarial-native#2 fix covers it).
  • p3/red-team#2, run.ts:214: the 55-minute limit was unenforced; 9af0bea added E_ASK_SHARD_LIMIT.
  • p3/red-team#3, label.ts:103: labeller completeness was unchecked; 9af0bea added the label gate, and the last review's holes in it are deferred above.
  • p3/red-team#4, custody.ts:106, and p3/adversarial-native#3, custody.ts:52: the /dev/shm sweep removed live shards' directories; 9af0bea sweeps only dead owners.
  • p3/red-team#5, cli.ts:174: score reads labeller records if label and run share an --out.
  • p3/targeted#1, score.ts:120: run --k took any count; 9af0bea accepts only the frozen counts.
  • p3/targeted#2, run.ts:227, and p3/adversarial-native#1, run.ts:171: proxy refusals could seal MISSING; 9af0bea journals them unsent and retries the same draw.
  • p3/adversarial-native#2, label.ts:110: the contingency labelled the whole bundle; 9af0bea requires --audit-draw.
  • p3/adversarial-native#4, cli.ts:281: no replicate check against the pilot's k (deferred as p4/targeted#2).
  • p3/adversarial-native#5, cli.ts:171: score reads decrypted files from any path, with no /dev/shm check.
  • p2/specialist-batched#2, run.ts:353: a ledger that fails to open leaves shard.lock behind.
  • p2/specialist-batched#3, run.ts:334: taking over a stale lock is an overwrite, not an atomic claim.
  • p2/specialist-batched#4, cli.ts:322: no test covers score's E_ASK_INCOMPLETE exit or the cap-stop exit.
  • p2/red-team#2, run.ts:227: a local proxy refusal could be scored MISSING; fixed in 9af0bea.
  • p2/red-team#3, score.ts:113: particle-1 gaps blocked score; 81a47bf marks particle-1 untested instead.
  • p2/red-team#4, run.ts:324: a crashed shard's own-pid lock reads as live.
  • p1/specialist-batched#1, cli.ts:318: a cap stop exited 0; the shard now returns E_ASK_CAP.
  • p1/specialist-batched#2, run.ts:350: the data-collection check ran after the lease opened; it now runs first.

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:

  • lanes/ask-replay/README.md: current. All 15 documented commands match cli.ts, and every E_ASK_ code it names exists.
  • lanes/ask-replay/codebook.md: current. Its cited paths exist.
  • docs/errors.md: current. It is generated, and errors:check reports it fresh (299 codes).
  • wiki/plans/2026-11-15-geva-539-ask-replay-prereg/README.md and its attachments: current. wiki:check passes, cited paths and commands exist, and the frozen.json attachment is byte-identical to the lane copy.
  • README.md: unchanged and still accurate.

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.

Open in Capy

Agent notes
{
  "schema_version": 1,
  "pr": 348,
  "head": "9af0beab3650d0dd8efd9dea5c1d5b44209f2b5a",
  "version": "0.0.1",
  "base": "main",
  "gate": {
    "test": {
      "pass": 460,
      "fail": 0,
      "skip": 0
    },
    "typecheck": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    },
    "errors": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    },
    "wiki": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 43704357928,
      "attempt": 1,
      "tree": "dac72fb113fc2d234dbd54fa89cd6aab0fe6a8ca"
    },
    {
      "lane": "typecheck",
      "run": 43704357928,
      "attempt": 1,
      "tree": "dac72fb113fc2d234dbd54fa89cd6aab0fe6a8ca"
    },
    {
      "lane": "errors",
      "run": 43704357928,
      "attempt": 1,
      "tree": "dac72fb113fc2d234dbd54fa89cd6aab0fe6a8ca"
    },
    {
      "lane": "wiki",
      "run": 43704357928,
      "attempt": 1,
      "tree": "dac72fb113fc2d234dbd54fa89cd6aab0fe6a8ca"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "dac72fb113fc2d234dbd54fa89cd6aab0fe6a8ca",
  "product_patch_id": "e10e6cc6cc91bd16e539bac5d0f36bb45d182436",
  "gstack_version": "1.99.5.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 4758,
    "rules": "66e5174161eecc2c",
    "base": "3dd1ffb35e82a4c7f2a7dc3080faf6fb64ec30df",
    "registry": "3dd1ffb35e82a4c7f2a7dc3080faf6fb64ec30df",
    "gate_scan": {
      "tagged": 3,
      "head": "9af0beab3650d0dd8efd9dea5c1d5b44209f2b5a"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "risk:security",
      "risk:data",
      "runtime=4758"
    ],
    "risk": [
      "money",
      "security",
      "data"
    ],
    "mode": "panel"
  },
  "pregate": "warn @dac72fb113fc (8 checks, current for 9af0beab3650)",
  "docs": {
    "status": "current",
    "scope": "lanes/ask-replay/README.md, lanes/ask-replay/codebook.md, docs/errors.md, README.md and the prereg post with its attachments (read-only audit, 47 committed files from 3dd1ffb to 9af0bea)"
  },
  "review_loop": {
    "passes": 4,
    "blocking_found": 18,
    "deferred": 11,
    "noted": 18,
    "fixed": 14,
    "scope": "frozen",
    "rounds": 4,
    "ledgers_read": 5,
    "dispatches": {
      "specialist": 12,
      "red-team": 4
    }
  },
  "review_loop_exception": {
    "accepted_by": "GEVA-2",
    "date": "2026-11-15",
    "via": "gstack-approvals a-d2ffc8fbec23",
    "reason": "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_pass": {
      "head": "9af0beab3650d0dd8efd9dea5c1d5b44209f2b5a",
      "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"
      ]
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "money",
      "gate"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "e10e6cc6cc91bd16e539bac5d0f36bb45d182436",
    "status": "done",
    "findings": 2,
    "raised_by": "targeted"
  }
}

garrytan and others added 10 commits November 15, 2026 06:21
…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>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 6 potential issues (6 medium).

Open in Capy

Comment thread lanes/ask-replay/score.ts Resolved
Comment thread lanes/ask-replay/label.ts Resolved
Comment thread lanes/ask-replay/run.ts
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) });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Capy

Comment thread lanes/ask-replay/run.ts Resolved
Comment thread lanes/ask-replay/run.ts Outdated
Comment on lines +265 to +269
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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Capy

Comment thread lanes/ask-replay/cli.ts Resolved
… 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>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

… 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>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

View 2 other findings in Capy.

Open in Capy

Comment thread lanes/ask-replay/cli.ts Resolved
…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>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

Open in Capy

Comment thread lanes/ask-replay/score.ts Resolved
…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>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 2 potential issues (2 medium).

View 1 other finding in Capy.

Open in Capy

Comment thread lanes/ask-replay/run.ts
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 };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Capy

Comment thread lanes/ask-replay/score.ts
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) };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Capy

@capy-ai
capy-ai Bot merged commit b5eb82f into main Nov 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant