# Activity Log — 2026-04-18

`[rust-developer]` -> `[Refactored WIP Guard based on code-analyzer review]` -> `Findings #1–#8 addressed`

## Changes

### Finding #2 + #3: Unified snapshot model
- **Removed** `record_sync_snapshot` (overwrote `last_sync_snapshot` on each call — data loss risk).
- **Added** `record_safety_snapshot` which delegates to `add_note_with_snapshot`, storing every sync/undo snapshot as a regular note with its own timestamp.
- Multiple syncs now accumulate; timestamps are always correct.
- `last_sync_snapshot` field kept in schema for backward compat (serde `skip_serializing_if`), read only by `collect_snapshots` as legacy fallback.

### Finding #1: Double intent-log read
- `collect_snapshots` now returns `(Option<IntentLog>, Vec<SnapshotEntry>)`.
- `handle_recover_list` reuses the loaded log for the stale-branch check — no second filesystem read.

### Finding #5: Wildcard import
- `recover.rs`: `use colored::*` → `use colored::Colorize`.

### Finding #6: Unused `branch` field
- Removed `branch` from `SnapshotEntry` — it was populated but never displayed or used.

### Finding #7: Missing confirmation prompt
- `handle_recover_apply` now uses `dialoguer::Confirm` before applying, consistent with `sync` and `undo`.

### Finding #8: Silent error swallowing in radar_snapshot
- Errors are now logged to stderr in verbose mode instead of silently discarded.
- Staleness check now looks at last note *with a snapshot hash*, not just any note (fixes follow-up #5).

### Finding #4: Missing `# Errors` doc sections
- Added `# Errors` docs to all WIP Guard public functions in `git.rs`, `intent.rs`, `recover.rs`.

### Tests added
- `intent::tests::add_note_with_snapshot_stores_hash`
- `intent::tests::add_note_without_snapshot_stores_none`
- `intent::tests::record_safety_snapshot_accumulates`
- `intent::tests::record_safety_snapshot_creates_log_when_none_exists`
- `intent::tests::snapshot_hash_roundtrips_through_json`
- `recover::tests::collect_snapshots_returns_empty_when_no_log`
- `recover::tests::collect_snapshots_skips_notes_without_hashes`
- `recover::tests::collect_snapshots_includes_notes_with_hashes`
- `recover::tests::collect_snapshots_includes_safety_snapshots`
- `recover::tests::collect_snapshots_returns_log_for_reuse`

