Files
amethyst/nestsClient
Claude 2d56b43672 fix(nests-interop): audit-driven cleanup of trace harness + hot-swap kdoc
Self-audit of commits `d7f87971` (trace capture) and `f8dc9c59`
(hot-swap soft-pass revert) caught four issues; this commit
addresses them.

`NativeMoqRelayHarness.kt`:
- `ProcessOutputDrainer.start`: tolerate `bufferedWriter()`
  failures so a misconfigured trace-log dir (parent gone, disk
  full, etc.) doesn't kill the drain thread and deadlock the
  relay subprocess on a full stdout pipe (~64 KB Linux pipe
  buffer). Fall back to ring-only capture and System.err-warn,
  matching the pattern the relay-startup error handler already
  uses.
- Hoist `Regex("[^A-Za-z0-9._-]")` to `tagSanitiser` so we don't
  recompile per relay boot.
- Rename `LOG_TIMESTAMP_FMT` → `logTimestampFmt` (it's a runtime
  `val`, not a `const val`; existing convention is camelCase for
  runtime, SCREAMING_SNAKE for compile-time constants like
  `PORT_READY_TIMEOUT_MS`).

`BrowserInteropTest.kt`:
- `chromium_listener_speaker_hot_swap_does_not_crash`: prune the
  `pcm.size <= warmupSamples` early-return + the trailing comment
  about the skipped FFT. After the soft-pass revert the
  post-warmup branch had no assertions, so the early-return was
  dead code. Reduce to a single decoderErrors assertion + kdoc
  spelling out the soft-pass and pointing at the hang-tier T12
  counterpart.
- Update the kdoc to reflect what the test ACTUALLY asserts (it
  used to claim FFT-peak coverage that no longer applies).

Other audit findings deferred (not real bugs, low priority):
- `ConcurrentLinkedQueue.size()` O(n) per line in the drainer.
- Per-line `writer.flush()` syscall — kept intentionally for
  hung-test post-mortem; documented inline.
- BrowserInteropTest at 1140+ lines could split helpers — pre-
  existing situation, not a regression.
2026-05-07 23:07:46 +00:00
..