go-cli-duration-suffix-parsing
Done. The solution is written to ~/solution.md (full repro in ~/repro/).
Root cause: cmd/rabbit-hole/helpers.go's parseDuration whitelisted only h/d suffixes; every other suffix (including m/s) fell into the default error branch, so compact --before 10m failed with exit 1 and a misleading use h or d error.
Fix (in helpers.go):
- Added case 's': time.Duration(n) * time.Second and case 'm': time.Duration(n) * time.Minute
- Updated all error messages to invalid duration %q: use s, m, h or d so the error enumerates the actual whitelist
Verification (Go 1.26, live):
- Before fix: TestParseDuration failed on 10m/90s/-5m, TestParseDurationErrMsg failed on the substring, and compact --before 10m exited 1
- After fix: go vet clean, both table tests pass (10m→10·Minute, 90s→90·Second, -5m→−5·Minute, plus 2h/1d), and the built binary exits 0 for 10m, 90s, -5m, 2h, 1d while 10x still exits 1 with the enumerating error
# Evidence - Problem class: go-cli-duration-suffix-parsing - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-18T14:54:10.438Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "rabbit-hole compact --before rejected m/s suffixes: parseDuration whitelist was h/d only (cmd/rabbit-hole/helpers.go). Fix: add s/m cases (time.Second/time.Minute) and error now lists use s, m, h or d; table tests cover 10m/90s/-5m and errMsg substring. compact --before 10m exit 0 verified live. Lesson: CLI duration parsers should accept s/m/h/d and the error should enumerate the whitelist.", "environment": "", "language": "go", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-cli-duration-suffix-parsing", "provider": "openrouter", "solved_at": "2026-08-18T14:54:10.439Z", "version": ""}Done. The solution is written to ~/solution.md (full repro in ~/repro/).
Root cause: cmd/rabbit-hole/helpers.go's parseDuration whitelisted only h/d suffixes; every other suffix (including m/s) fell into the default error branch, so compact --before 10m failed with exit 1 and a misleading use h or d error.
Fix (in helpers.go):
- Added case 's': time.Duration(n) * time.Second and case 'm': time.Duration(n) * time.Minute
- Updated all error messages to invalid duration %q: use s, m, h or d so the error enumerates the actual whitelist
Verification (Go 1.26, live):
- Before fix: TestParseDuration failed on 10m/90s/-5m, TestParseDurationErrMsg failed on the substring, and compact --before 10m exited 1
- After fix: go vet clean, both table tests pass (10m→10·Minute, 90s→90·Second, -5m→−5·Minute, plus 2h/1d), and the built binary exits 0 for 10m, 90s, -5m, 2h, 1d while 10x still exits 1 with the enumerating error
# Evidence - Problem class: go-cli-duration-suffix-parsing - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-18T14:54:10.438Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "rabbit-hole compact --before rejected m/s suffixes: parseDuration whitelist was h/d only (cmd/rabbit-hole/helpers.go). Fix: add s/m cases (time.Second/time.Minute) and error now lists use s, m, h or d; table tests cover 10m/90s/-5m and errMsg substring. compact --before 10m exit 0 verified live. Lesson: CLI duration parsers should accept s/m/h/d and the error should enumerate the whitelist.", "environment": "", "language": "go", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-cli-duration-suffix-parsing", "provider": "openrouter", "solved_at": "2026-08-18T14:54:10.439Z", "version": ""}