Skip to content

fix: close 9 defects from adversarial bug-hunt sweep - #125

Merged
jkyberneees merged 1 commit into
mainfrom
fix/bug-hunt-20260918
Sep 18, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
fix/bug-hunt-20260918

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

3-wave adversarial bug hunt; 10 validated findings, 9 fixed (RED-test-first where testable):

  • reconnect fd leak: close socket on readLoop exit; close replaced client on swap
  • spawn 403: grace-poll stderr token before legacy probe; real child liveness via Signal(0)
  • tokens: persist under mutex (lost-update); quarantine corrupt store as .corrupt
  • settings: atomic staged tmp+rename save
  • workspace: report failed persists on stderr
  • client: 30s bulk-read client (session detail, export); export >64MiB errors instead of silent truncation
  • cmd: SIGINT/SIGTERM quits the TUI program so terminal restore + srv.Stop() run

Full go test -race ./... green. Known-limitation follow-ups (odek-side) noted in session notes: wrapper nonce-binding, listener inheritance for freePort TOCTOU.

- client: close the socket when readLoop exits, so reconnect swaps stop
  leaking fds and server slots; TUI closes the replaced old client
- server: grace-poll the spawned stderr token before the legacy probe
  (HTTP can answer before the token line flushes and 403-fail a server
  bodek itself spawned) and fail fast if the child exits mid-wait
- tokens: serialize persistence under the store mutex (interleaved
  Set/Delete could resurrect deleted tokens on disk) and quarantine a
  corrupt store as sessions.json.corrupt instead of silently wiping it
- settings: staged tmp+rename save so a crash cannot truncate config.json
- workspace: report failed persists on stderr instead of swallowing them
- client: 30s client for bulk reads (session detail, export); export
  errors instead of silently truncating past the 64 MiB bound
- cmd: SIGINT/SIGTERM quits the Bubble Tea program instead of a side-
  goroutine os.Exit that skipped terminal restore and deferred teardown
- tui: regression tests for untrusted-wrapper folding
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bodek b8c8d7a Commit Preview URL

Branch Preview URL
Sep 18 2026, 10:14 AM

@jkyberneees
jkyberneees merged commit bed110e into main Sep 18, 2026
8 of 9 checks passed
@jkyberneees
jkyberneees deleted the fix/bug-hunt-20260918 branch September 18, 2026 10:18
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