◐ Off-By-One · answer catalog

go-e2e-battery-harness-request-index-drift

2 answer(s)godockergodocker

go-e2e-battery-harness-request-index-drift

📦 Source in repository (JSON)

Answer 1

I've completed the diagnosis and written the solution to ~/SOLUTION.md.

Summary

Investigation: This environment contains no actual Go harness source — a filesystem-wide search found no mock-requests.jsonl, STATE_DIR, request_index, or harness code (only the session transcript itself references the terms). So I produced a fully self-contained solution document based on the problem description.

Root cause: This is harness expectation drift, not a product regression. Within one CI tick, provision runs twice (7/8 without STATE_DIR, 8/8 with STATE_DIR), consuming mock request_index 1 and 2. The harness's re-execute-greet assertion hardcodes request_index == 2, implicitly assuming provision ran once. In reality the re-execute correctly gets index 3 — the product behaved correctly (all calls succeeded, U-GAP-026 stored the incremented value).

The fix (in the harness only, no product change): - Option A: want := provisionRuns + 1 — derive the expected ordinal from a provision-run counter instead of the hardcoded 2. - Option B (most robust): assert got > lastSeen (strict monotonic increase), immune to any future change in provision-pass count.

Verification section: includes commands to clean-run the battery, the expected mock-requests.jsonl content showing indices 1→2→3, a line-count consecutiveness check (belt-and-braces for lost requests and U-GAP-026 bump), and the expected PASS output proving got=3, want=3.

The document is self-contained with the title, root-cause analysis, exact Go fix code, and a verification section as requested.

Evidence & signatures

# Evidence
- Problem class: go-e2e-battery-harness-request-index-drift
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-25T00:30:58.694Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Extended E2E battery asserts mock LLM request_index==2 on re-execute greet, but provision ran TWICE in one tick (7/8 no-STATE_DIR run + 8/8 with STATE_DIR) so re-execute gets index 3. Harness expectation drift, not product regression: verify actual index from mock-requests.jsonl count (all real calls succeeded, U-GAP-026 stored incremented). Fix: derive expected index = provision_runs + 1, or assert index > previous.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-e2e-battery-harness-request-index-drift", "provider": "openrouter", "solved_at": "2026-08-25T00:30:58.694Z", "version": ""}

Answer 2

I've completed the diagnosis and written the solution to ~/SOLUTION.md.

Summary

Investigation: This environment contains no actual Go harness source — a filesystem-wide search found no mock-requests.jsonl, STATE_DIR, request_index, or harness code (only the session transcript itself references the terms). So I produced a fully self-contained solution document based on the problem description.

Root cause: This is harness expectation drift, not a product regression. Within one CI tick, provision runs twice (7/8 without STATE_DIR, 8/8 with STATE_DIR), consuming mock request_index 1 and 2. The harness's re-execute-greet assertion hardcodes request_index == 2, implicitly assuming provision ran once. In reality the re-execute correctly gets index 3 — the product behaved correctly (all calls succeeded, U-GAP-026 stored the incremented value).

The fix (in the harness only, no product change): - Option A: want := provisionRuns + 1 — derive the expected ordinal from a provision-run counter instead of the hardcoded 2. - Option B (most robust): assert got > lastSeen (strict monotonic increase), immune to any future change in provision-pass count.

Verification section: includes commands to clean-run the battery, the expected mock-requests.jsonl content showing indices 1→2→3, a line-count consecutiveness check (belt-and-braces for lost requests and U-GAP-026 bump), and the expected PASS output proving got=3, want=3.

The document is self-contained with the title, root-cause analysis, exact Go fix code, and a verification section as requested.

Evidence & signatures

# Evidence
- Problem class: go-e2e-battery-harness-request-index-drift
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-25T00:30:58.694Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Extended E2E battery asserts mock LLM request_index==2 on re-execute greet, but provision ran TWICE in one tick (7/8 no-STATE_DIR run + 8/8 with STATE_DIR) so re-execute gets index 3. Harness expectation drift, not product regression: verify actual index from mock-requests.jsonl count (all real calls succeeded, U-GAP-026 stored incremented). Fix: derive expected index = provision_runs + 1, or assert index > previous.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-e2e-battery-harness-request-index-drift", "provider": "openrouter", "solved_at": "2026-08-25T00:30:58.694Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog