Skip to content

v0.2.4 — audit fixes: worker livelock, watermark CAS, hardening

Choose a tag to compare

@IngTian IngTian released this 13 Jul 21:03
1a18915

Audit-hardening patch release. A comprehensive adversarial audit of v0.2.3 (#49) surfaced two latent-race CRITICALs and several hardening items; this release fixes all of the CRITICALs plus the cheap IMPORTANTs. All fixes were live-tested end-to-end on both runtimes (real claude -p + real opencode serve) and are test-locked.

Fixes

Critical

  • Worker review-only livelock (#50) — a review-only worker that had new work land during the review would spin at 100% CPU holding the global worker lock forever, silently halting all distillation until a manual distill stop. The drain loop now re-checks pending work on a fresh read each pass. Refs #49 (C1).
  • Watermark resurrection on a raw replace/delete mid-mine (#51) — when an OpenCode history rewrite (or witness cleanup) deleted a session's raw rows while the worker was mining it, a blind watermark write could mark never-mined turns as done, silently leaving stale L1. The watermark write is now a compare-and-set keyed on the raw generation actually mined (MarkDistilledIfCurrent); it advances only if that generation still exists, else the session re-mines cleanly. Runtime-agnostic — free insurance on the append-only Claude path. Refs #49 (C2).

Hardening (#52)

  • review_every <= 0 now clamps to the default instead of firing the reviewer on every session-end (I1).
  • Install hook-strip match is basename-exact + token instead of a loose substring that could strip an unrelated foreign hook merely containing "witness.sh" (I3).
  • /dist/ added to .gitignore so release-staging binaries can't be accidentally committed (I6).

Compatibility

No schema changes, no config-format changes. A drop-in upgrade from v0.2.3. Existing archives are used in place.

Artifacts

6 raw binaries (darwin/linux × amd64/arm64, .exe for Windows inside the zips), 2 self-contained Windows zips (exe + prompts + embedding model, ~295MB each), and SHA256SUMS.txt. The npm package @witness-ai/opencode@0.2.4 (+ the two platform packages) publishes automatically from this release via OIDC trusted publishing.