implemented-row-still-returns-not-implemented-sentinel
Wrote the solution to ~/implemented-row-sentinel-fix.md and verified every claim with a runnable Go reproducer.
Root cause: The RED-half test helper was written to tolerate the stub:
err == nil || errors.Is(err, ErrNotImplemented)
Since errors.Is follows wrapped chains, the implementer satisfied it literally with fmt.Errorf("... %w: %w", ErrNotImplemented, err). Go 1.20+ multi-%w makes the error match both the sentinel and the real I/O cause. The loosened helper was the ledger entry, so the gate could never catch the leak.
Fix:
1. Replace the tolerant helper with a strict green-state assertion: error non-nil, !errors.Is(err, ErrNotImplemented), errors.Is(err, fs.ErrNotExist), and the message names the path. RED now fails for the honest reason.
2. Drop the sentinel from the live path — single %w, preserving only the real cause.
3. Add a grep/AST gate so the sentinel can't reappear on a non-test path.
Verification was actually run (Go 1.26): - Strict test fails against the shipped buggy code, citing the live sentinel. - After the fix, the strict suite passes and grep shows only the declaration. - A telling diagnostic: the old tolerant helper fails once you fix the bug correctly, proving it encoded the stub as the contract.
# Evidence - Problem class: implemented-row-still-returns-not-implemented-sentinel - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-20T11:49:59.203Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "In a tests-first row, the shipped implementation wrapped the row sentinel inside a genuine I/O error: fmt.Errorf(\"read %s: %w: %w\", path, ErrNotImplemented, err). Two costs: a caller cannot tell an unreadable file from an unimplemented row, and a sentinel the repo convention says must not appear on any live path after the row lands stays live.", "environment": "cli", "language": "go", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "implemented-row-still-returns-not-implemented-sentinel", "provider": "openrouter", "solved_at": "2026-09-20T11:49:59.204Z", "version": ""}Wrote the solution to ~/implemented-row-sentinel-fix.md and verified every claim with a runnable Go reproducer.
Root cause: The RED-half test helper was written to tolerate the stub:
err == nil || errors.Is(err, ErrNotImplemented)
Since errors.Is follows wrapped chains, the implementer satisfied it literally with fmt.Errorf("... %w: %w", ErrNotImplemented, err). Go 1.20+ multi-%w makes the error match both the sentinel and the real I/O cause. The loosened helper was the ledger entry, so the gate could never catch the leak.
Fix:
1. Replace the tolerant helper with a strict green-state assertion: error non-nil, !errors.Is(err, ErrNotImplemented), errors.Is(err, fs.ErrNotExist), and the message names the path. RED now fails for the honest reason.
2. Drop the sentinel from the live path — single %w, preserving only the real cause.
3. Add a grep/AST gate so the sentinel can't reappear on a non-test path.
Verification was actually run (Go 1.26): - Strict test fails against the shipped buggy code, citing the live sentinel. - After the fix, the strict suite passes and grep shows only the declaration. - A telling diagnostic: the old tolerant helper fails once you fix the bug correctly, proving it encoded the stub as the contract.
# Evidence - Problem class: implemented-row-still-returns-not-implemented-sentinel - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-20T11:49:59.203Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "In a tests-first row, the shipped implementation wrapped the row sentinel inside a genuine I/O error: fmt.Errorf(\"read %s: %w: %w\", path, ErrNotImplemented, err). Two costs: a caller cannot tell an unreadable file from an unimplemented row, and a sentinel the repo convention says must not appear on any live path after the row lands stays live.", "environment": "cli", "language": "go", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "implemented-row-still-returns-not-implemented-sentinel", "provider": "openrouter", "solved_at": "2026-09-20T11:49:59.204Z", "version": ""}