Skip to content

Fix session dir collision and whitespace-line handling#17

Merged
REPPL merged 1 commit into
mainfrom
bughunt-2
Jul 20, 2026
Merged

Fix session dir collision and whitespace-line handling#17
REPPL merged 1 commit into
mainfrom
bughunt-2

Conversation

@REPPL

@REPPL REPPL commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Burst 2 of the autonomous correctness hunt (same 6-lens loop-until-dry + majority-refute setup): 2 low-severity bugs, both genuine (not nitpicks), each with a watched-to-fail regression test.

  • session.Create silently reused a same-second directory. os.MkdirAll returns nil when the directory exists, so two captures started within one wall-clock second (two terminals, or scripted back-to-back demo/record) resolved to the same directory — clobbering the first session's manifest t0 anchor and conflating the two sessions' append-only streams and capture files, all with no error. Now MkdirAll(outRoot) then os.Mkdir(dir), which fails cleanly on collision instead of corrupting.
  • ReadJSONL crashed on a whitespace-only line. Its doc says blank lines are skipped, but the guard was len(raw)==0, so a whitespace-only line in a hand-edited/exchanged session aborted merge/report with an unexpected-end-of-JSON error. Now skips len(bytes.TrimSpace(raw))==0, matching analyze.Load so the two JSONL readers agree. Verified live.

Both fixes make the code match its own doc comments — no schema/docs changes. gofmt/vet/go test -race/build/sample-pipeline/abcd audit/abcd docs lint all green.

Convergence: burst 1 found 5 distinct bugs (one HIGH); burst 2 found 2 LOW. The hunt continues until a full pass yields only nitpicks.

Assisted-by: Claude:claude-fable-5

Burst 2 of the autonomous correctness hunt — 2 low-severity bugs, each
with a watched-to-fail regression test.

- session.Create silently reused a same-second directory: MkdirAll
  returns nil when the dir exists, so two captures started within one
  wall-clock second resolved to the same directory — clobbering the
  first session's manifest t0 anchor and conflating the two sessions'
  append-only streams and capture files. Now MkdirAll(outRoot) then
  os.Mkdir(dir), which fails on collision instead of corrupting.
- ReadJSONL documented that blank lines are skipped but guarded only
  len(raw)==0, so a whitespace-only line in a hand-edited or exchanged
  session crashed merge/report with an unexpected-end-of-JSON error.
  Now skips len(bytes.TrimSpace(raw))==0, matching analyze.Load so the
  two JSONL readers agree.

Both fixes make the code match its own doc comments; no schema/docs
changes needed. Gates green; both fixes verified live.

Assisted-by: Claude:claude-fable-5
@REPPL
REPPL merged commit 8e5474e into main Jul 20, 2026
6 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