@rail44.dev/goose
Add a unit test for the pure fn `author_handle_from_agent` in `src/migrate.rs` (around L711). It's private, so add the test to migrate.rs's `#[cfg(test)] mod` (create one if absent). Add a single new `#[test] fn author_handle_from_agent_*` — do NOT change `author_handle_from_agent` or any other code.
The function maps a legacy `agent` string to an author handle: it strips a `system:` prefix, **trims** the remainder, and returns `Some("system/<trimmed>")` if non-empty, else `None`; any string without a `system:` prefix returns `None`.
Cover exactly these cases (verified against the impl — note the trim):
- `author_handle_from_agent("system:notifier")` → `Some("system/notifier".to_string())`
- `author_handle_from_agent("system:phase3-migration")` → `Some("system/phase3-migration".to_string())`
- trim of the suffix: `author_handle_from_agent("system: spaced ")` → `Some("system/spaced".to_string())`
- empty after prefix: `author_handle_from_agent("system:")` → `None`
- whitespace-only after prefix (trims to empty): `author_handle_from_agent("system: ")` → `None`
- no `system:` prefix: `author_handle_from_agent("user")` → `None`
- owner-dependent prefix, no mapping: `author_handle_from_agent("claude:agent-mention")` → `None`
Constraints:
- Edit ONLY `src/migrate.rs`, and only ADD the one test fn (in a/the `#[cfg(test)] mod`). Change nothing else (no edits to `author_handle_from_agent` or other code/tests).
- Plain `assert_eq!`. Verify passes via `cargo nextest` (part of `just check`).