Implement fj work resume + local session model #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/work-resume-session"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a local-only work session and wires up
fj work resume(item #1 of the agreed order).Session model (
<git-dir>/fj/session.json)New
cli/work_session.rs:Session{ saved_at, host, repo, remote, branch, dirty, changed_files, pull_request, next_steps, cursor }. Never committed, never sent to the server.derive_next_stepsproduces advisory, non-destructive suggestions (commit/push/open-PR/track-review) from the context. Stable JSON for future mobile/web consumers.Behavior
work contextnow persists the session (best-effort — a cache-write failure never sinks the inspect command).work resumeloads the session, re-gathers the live context, and prints the saved snapshot plus a diff of what moved (branch / working tree / PR state). Supports--jsonand--dry-run; errors clearly when no session exists.git_dir()/remote_url().work continuestays a placeholder (next PR advances the cursor).Tests
Pure logic is unit-tested without git/network:
derive_next_steps(5 cases), session JSON round-trip,session_path,to_session,render_session, anddiff_session_vs_context(changed + unchanged). +10 tests → 295. clippy-D warningsclean;coverage-strictholds (~76%).