Files
buzz/crates
DuncanandWill Pfleger 373128bb75 fix(buzz-agent): rejected-aware auth, typed refresh, real process tests
Round-2 fixes to the DatabricksAuthCoordinator:

- Rejected-aware acquisition: `acquire_with_intent(intent, rejected)` lets
  the saved-picker recovery path replace a locally-fresh bearer the server
  just 401'd, so Auto/UserInitiated escalate to a browser instead of
  re-returning the dead token. `refresh_now`'s hardcoded Headless could not.
- Typed `RefreshOutcome`: only a token-endpoint grant rejection becomes
  RefreshRejected/browser-fallback; transport/timeout/5xx/decode failures stay
  NetworkUnavailable so a transient fault never pops a browser.
- In-process shared-future joiner (INFLIGHT/InflightSlot/LeaderGuard): a
  pre-existing joiner receives the leader's SAME failure result rather than
  acquiring the lock afterward and launching a second browser.
- Deadline holes closed: the HTTP client build error propagates (no untimed
  fallback), and every interactive timeout exits through the common outcome
  writer so TimedOut is recorded in the cooldown sidecar under the held lock.
- Real cross-process tests: a `lock-holder` child bin takes the advisory lock
  so single-flight and crash-release are proven across processes, not
  simulated with same-process handles. buzz-agent added to the Justfile
  test-unit lane so CI executes these tests.
- MSRV: use fs2::FileExt instead of std File::try_lock/unlock (1.89+),
  restoring the crate to the repo's declared 1.88 floor.

The refresh-timeout test injects a short real-time HTTP timeout rather than
pausing the clock: under start_paused tokio auto-advances into the timer while
the real loopback discovery call is still in flight, tripping the timeout on
the wrong request.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-11 10:00:49 -04:00
..