Files
buzz/desktop/src-tauri
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 3710265823 fix(agent-config): make regression tests mutation-sensitive via production seams
IMPORTANT#1: extract force_claim_and_resolve() helper in config_sync_readiness.rs
- Both apply_workspace and import_identity route through force_claim_and_resolve()
  rather than calling force_claim_in_progress() + active_retention_scope() inline.
- On resolver failure the helper drops the claim (RAII -> Unready); no stale
  Ready(old_path) survives.
- Test drives force_claim_and_resolve() with a failing resolver; reordering the
  helper (resolve before claim) leaves Ready(A) intact and fails the assertion.

IMPORTANT#2: factor run_event_sync through run_event_sync_impl with injectable resolver
- run_event_sync_impl<F: FnOnce() -> Result<PathBuf, String>>(...) is the shared
  non-test core; the single base_dir_fn()? is the mutation-sensitive propagation
  point that replaced the three per-wrapper let-Ok-else-return-Ok swallows.
- run_event_sync() passes managed_agents_base_dir(app) as the resolver.
- reconcile_agents_to_events() removed (dead; reconcile_agents_in_dir_at promoted
  to pub(crate) for direct use by the impl core).
- Test injects Err via run_event_sync_impl(|| Err(...)); swapping ? to swallow
  returns Ok(()) and fails result.is_err().

MINOR: rewrite enforce_decision_pass() function-level contract doc
- Replaces false store-lock-prevents-generation-change claim with the real
  invariant: store lock serializes observation/writes; post-check force-claim sets
  InProgress on the new generation and its own barrier supplies authoritative writes.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-01 14:09:31 -04:00
..