openai / gpt-6.1-sol / low / low effort preferred over openai / gpt-6-luna / none / none effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Qualify whether a safe, bounded whole-revision cohort batch can replace the per-ancestor cohort SELECT inside readActiveCombinedSeason, or whether the honest result is no source change. Planning qualification only. Do not propose the rejected exact-key/index-page design. Do not claim a production or remote latency win.
## Current reader (src/combined-season-store.js readActiveCombinedSeason)
- One fresh pointer read: SELECT season_id,revision FROM combined_season_active WHERE id=1. Null pointer returns null. No cross-request cache.
- Active version: SELECT * WHERE season_id=? AND revision=?. Missing throws 'Missing active combined version'.
- Active cohorts: SELECT public_id,cohort_id,cohort_sha256,public_json WHERE season_id=? AND revision=? ORDER BY public_id. Validate board.season id/revision, rows.length===cohort_count, board.waves===rows.length, digest({board,battles:parsed public_json in that order})===manifest_sha256. Else 'Invalid active combined snapshot'. Active battles are retained in the return value.
- Ancestry walk from the active version, not from all season rows. seen revision or seen.size>=10000 throws 'Invalid combined history chain'. Missing parent row throws 'Missing combined history ancestor'. For each ancestor revision ≠ active: SELECT public_json WHERE season_id=? AND revision=? ORDER BY public_id; validate season id/revision, length===cohort_count, digest===manifest_sha256; else 'Invalid combined history snapshot'. Historical battles are used only for digest and then dropped. History retains only {revision,sourceRevision,recordedAt,board}. Returned history is reversed (root first).
- Queries for N versions (1 active + N-1 ancestors): 2N+1. Fixture N=25 → 51 reads.
- Staged/abandoned/rollback descendants are excluded because they are not on the parent_revision chain from the fresh pointer. Season scoping is the bound season_id. Tenant isolation is that season_id plus board.season.id check.
- Corrupt JSON.parse throws SyntaxError today (not remapped). Manifest/count mismatch uses the Error strings above. Preserve those fail-closed outcomes. Do not skip proofs.
- Schema (migrations/0008_combined_seasons.sql): cohorts PK (season_id,revision,public_id). No CHECK on cohort_count or public_json length. Triggers block UPDATE/DELETE of versions and cohorts, not INSERT of an additional cohort row. D1 max bound parameters = 100. D1 max row = 2,000,000 bytes. D1 has no published max response-byte limit; query execution and result serialization run inside Workers CPU/memory limits. Workers isolate memory is 128 MB per isolate, shared across concurrent requests, not a per-query budget. events.js already chunks IN lists at 100 bindings and that pattern is not a byte bound.
## Evidence (do not treat fixture sizes as maxima)
- Clean base 2f91cf6997ae45284f7049251f94651f42d34e8f. Fixture SHA256 88e5ebd008f06153f53e57c6b85e811d72778d1d27a1b78fc79296d1e44c7a90. 25 versions, 1017 cohort rows, max public_json 14204 bytes, max revision public_json sum 467929 bytes / 52 rows, sum of all public_json 8392192, sum of board_json 524262.
- Integrity-viable prototype batches ancestor cohorts with revision IN (≤99) plus season_id, ORDER BY revision, public_id, then groups and validates count/digest. It does not use exact public_id keys. Local results: exact fixture output, 28 reads vs 51, max 25 bindings, and 8 integrity cases passed including extra-row-before-batch (error 'Invalid combined history snapshot'). It is distinct from the rejected exact-key proposal (67 reads, slower, and an isolated-copy extra-row insert was omitted so the candidate accepted a snapshot the baseline rejected).
- Prototype defects that must not be copied: fixed 99-revision batch with no byte/row budget; parsed ancestor battles accumulated in a Map until return; no prompt release. Sampled process heapUsed peak was 55690136 prototype vs 23530272 baseline. Those samples are not a platform guarantee.
- Local median 72.88 ms vs 73.47 ms (~0.8%). Not a meaningful latency improvement. Remote D1 round-trip value is unmeasured. Do not claim a speedup. Query-count reduction is the only established mechanism.
- Binding boundaries already shown on empty synthetic cohorts: 0/1/98/99/100/198/199 ancestors split 99+remainder, max 100 bindings. That does not validate response bytes or heap.
## Candidate under test (attack this; do not rubber-stamp)
Only batch whole ancestor revisions, never the active revision's retained payload (different columns; battles must remain in the return value). Keep the version walk one row at a time so board_json (up to the 2 MB row cap) is not itself batched. After a window of at most 99 ancestor revisions:
1. Size probe: SELECT revision, COUNT(*) n, COALESCE(SUM(LENGTH(public_json)),0) bytes FROM combined_season_cohorts WHERE season_id=? AND revision IN (...) GROUP BY revision. Absent revision means 0 rows. Response is integers only.
2. Pack whole revisions into payload groups whose sum(bytes) + n*per-row allowance ≤ a raw budget. A revision over budget is fetched alone, same shape as today's one-revision SELECT, and is not failed solely for size (that would change currently successful reads). Never LIMIT/truncate rows. Never look up exact public_ids.
3. Payload: SELECT revision, public_json WHERE season_id=? AND revision IN (group) ORDER BY revision, public_id. Group by revision preserving public_id order. Validate season, count, digest. On mismatch throw the existing error. Then drop that revision's strings and parsed battles before the next revision. Do not retain historical battles.
4. History order remains ancestry order, not SQL revision sort. Only walked revisions are queried, so staged/rollback siblings stay excluded. Pointer is read once per call, not cached.
5. Extra same-revision INSERT between probe and payload must be visible to the payload IN query and fail closed on count/digest. A size/count mismatch between probe and payload also fails closed. Deletes cannot happen (trigger). Other seasons cannot match the bound season_id.
Worst case to bound explicitly: 99 revisions × one ~2 MB public_json already exceeds 128 MB before parse, so a fixed 99 cap is unsafe. Also bound row-object overhead, D1 JSON escaping of the result (quotes in stored JSON), Worker-side JSON.parse + stable()/TextEncoder copies during digest, and the fact that sibling revisions' raw strings stay live until the result array is released.
## Decide
1. Is this strategy integrity-safe if implemented exactly, or is there a remaining omission/order/tenant/staged/rollback/pointer/fail-open hole?
2. Is the windowed SUM(LENGTH()) probe safe on SQLite/D1 (row-at-a-time, blobs not accumulated), or can the probe itself exceed isolate memory? If the probe is unsafe, is any multi-revision batch provably safe? If not, the result is no-change.
3. Give an exact raw-byte budget, per-row allowance, and max revisions (≤99) with arithmetic showing peak D1 serialization and Worker heap stay strictly inside 128 MB with shared-isolate margin, including parse and canonical copies. State what is pre-existing single-revision risk versus new batch risk.
4. Say whether a genuine source candidate is warranted. If yes, list the minimum code/test/doc delta. Tests must exercise 0/1/24/99/100/198+ revisions, binding cap 100, insertion race, public_id order, tenant/season, missing/corrupt/count/hash, cycle/depth, rollback/staged exclusion, pointer refresh, and batch boundaries. If no, state the exact limiting evidence for no-change.
5. Do not recommend cross-request cache, skipped proofs, scoring/UI/ingestion/schema/runtime changes, or production calls.
Return a concise verdict: IMPLEMENT with exact constants and non-negotiable constraints, or NO-CHANGE with the limiting evidence. Flag uncertainty instead of guessing platform behavior.openai / gpt-6.1-sol / low / low effort answer
## NO-CHANGE
Independent assessment of the supplied snapshot only. **Integrity qualification is plausible; the required memory qualification is not established.**
1. **Integrity:** Whole-revision queries avoid the rejected omission flaw. Bound season, walked revisions only, `ORDER BY revision, public_id`, ancestry-ordered validation/history, and unchanged count/digest proofs preserve selection and public output. Extra rows visible to the payload query must fail with `Invalid combined history snapshot`. Preserve `SyntaxError` for corrupt JSON and all existing missing/cycle/depth errors (`src/combined-season-store.js:19–28`).
Validation must follow ancestry order—not SQL revision order—and probe mismatch checks must not replace an otherwise encountered JSON parse error. Walking an entire window before validating its earlier ancestors can also change which error surfaces first.
2. **Probe:** SQLite aggregation need not accumulate all `public_json` values; indexed grouping can plausibly process rows incrementally. **That is not a demonstrated D1 execution-memory guarantee.** Query-plan buffering, storage decoding, and placement/accounting of execution memory are unspecified here. The probe returns revision strings as well as integers, and the schema does not bound revision-string lengths.
More importantly, SQLite `LENGTH(TEXT)` counts characters, not UTF-8 bytes, and stops at an embedded NUL. Thus the proposed `bytes` expression is not a trustworthy raw-byte measurement for all schema-permitted data. A byte-correct measurement would still not solve the remaining qualification gaps.
3. **No defensible exact constants:** Neither an exact raw budget nor a per-row allowance can prove the requested shared-isolate bound from this evidence.
- `99 × 2,000,000 = 198,000,000` bytes already exceeds even 128 MiB, before wrappers, serialization, or parsing.
- Inserts between probe and payload can increase response size **without a bound**. Detecting mismatch after `.all()` materializes the response protects integrity, not memory.
- D1 escaping/copy behavior, JavaScript row/object overhead, parsed-object expansion, canonical object reconstruction, string encoding, and garbage-collection timing lack established upper bounds. `canonical()` explicitly reconstructs arrays/objects before stringification and encoding (`src/combined-season-profile.js:13–15`).
- Active payloads and accumulated historical boards already remain live; concurrent requests share the isolate. No bound on that existing live set or concurrency is supplied.
**Pre-existing risk:** arbitrarily many cohorts in one revision, retained active battles, and growing board history. **New batch risk:** sibling revisions’ raw results coexist with one revision’s parsing/canonicalization, plus window metadata and potential probe-to-payload growth. Fetching oversized revisions alone preserves existing behavior but cannot establish total safety.
4. **Recommendation:** No source candidate is warranted under the requested proof standard; minimum authorized source/test/doc delta is **none**. Missing platform bounds are uncertainty, not proof that every multi-revision batch is unsafe—but they prevent declaring this candidate provably safe.
The prototype establishes query-count reduction only. Its local latency difference does not establish a speedup. The next useful action is to record these qualification blockers, without implementation or production calls.
openai / gpt-6-luna / none / none effort answer
**NO-CHANGE.** The query-count reduction is real evidence, but the candidate cannot be qualified as safely bounded from the supplied evidence.
1. **Integrity:** Whole-revision batching can preserve the current proof if it fetches every row for only the walked ancestor revisions, orders by `(revision, public_id)`, validates each revision’s season, count, and digest, and releases historical payloads before continuing. The extra-row race is caught when the payload query sees the inserted row and count/digest validation fails. This preserves active payload retention, ancestry order, fresh-pointer semantics, and exclusion of staged or rollback siblings. No integrity hole is evident under those constraints; JSON parse errors must remain fail-closed as they are today.
2. **Probe and memory:** `SUM(LENGTH(public_json))` aggregates integer lengths, not blobs, so the probe’s result is small; the packet provides no evidence that it accumulates payload values in isolate memory. That does **not** establish a bound for the payload query’s result serialization or Worker heap. D1 publishes no response-byte cap, and the 2 MB row cap plus 128 MB shared isolate limit do not bound total rows per revision or concurrent memory use.
3. **No defensible constants:** No raw-byte budget, per-row allowance, or revision count can be proven strictly within 128 MB from these facts. A payload group’s raw stored bytes do not bound D1 JSON escaping, row-object overhead, simultaneous sibling strings, parsed objects, or `stable()`/`TextEncoder` digest copies. Choosing constants would require unprovided bounds for those representations and shared-isolate headroom. A one-revision oversized fallback preserves existing successful reads but retains the baseline’s unbounded single-revision risk; grouping revisions adds a new aggregate risk. A fixed 99-revision cap is not a byte bound.
4. **Source candidate:** Not warranted without those bounds or platform measurements/contracts. The fixture’s 25 revisions and 467,929-byte largest revision are observations, not maxima. Local medians (72.88 vs 73.47 ms) do not establish a latency win; only the query-count mechanism is supported. The prototype’s ~55.7 MB sampled heap versus ~23.5 MB baseline reinforces that heap cost is material, not that either is safe.
**Next useful action:** Establish enforceable limits for result serialization and Worker peak memory—including concurrency, escaping, parse and digest copies—or retain the current per-ancestor reads. Do not claim a production or remote latency improvement. Confidence: high on the no-change qualification given the stated evidence; platform-specific peak-memory behavior remains unmeasured.
Primary judge's stated reason
A offers a slight, forced preference because its race analysis explains why even a byte-correct probe would not enforce the payload budget before allocation. That makes the limiting evidence more actionable for this particular candidate. This is not an established material quality gap: B already rejects implementation for supported memory-assurance reasons, and an independent review could reasonably reject the preference.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 83b6dfa9-59af-4543-9e30-bcd15553ccf9. Pair: brp1_06ebac9345d0562131f2036d379302e559544664cf685924cf0d6de6c24d6611. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.