diff --git a/internal/store/store.go b/internal/store/store.go index d8f8d77..74b04fb 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -17,6 +17,8 @@ type Snapshot struct { RuntimeState domain.RuntimeState `json:"runtime_state"` Commitment *domain.Commitment `json:"commitment,omitempty"` DeadlineUnixSecs int64 `json:"deadline_unix_secs,omitempty"` + SessionID string `json:"session_id,omitempty"` + OutcomePending string `json:"outcome_pending,omitempty"` } // DefaultPath returns ~/.antidrift/state.json. diff --git a/internal/store/store_test.go b/internal/store/store_test.go index 53fe597..ed2b359 100644 --- a/internal/store/store_test.go +++ b/internal/store/store_test.go @@ -48,3 +48,22 @@ func TestSaveThenLoadRoundTrips(t *testing.T) { t.Errorf("deadline: got %d want %d", got.DeadlineUnixSecs, want.DeadlineUnixSecs) } } + +func TestSnapshotCarriesSessionFields(t *testing.T) { + path := filepath.Join(t.TempDir(), "state.json") + want := Snapshot{ + RuntimeState: domain.RuntimeActive, + SessionID: "session-abc", + OutcomePending: "completed", + } + if err := Save(path, want); err != nil { + t.Fatalf("save: %v", err) + } + got, err := Load(path) + if err != nil { + t.Fatalf("load: %v", err) + } + if got.SessionID != "session-abc" || got.OutcomePending != "completed" { + t.Fatalf("session fields did not round-trip: %+v", got) + } +}