Save a Session Snapshot
save_sessionSave the current session's analyzed code model as a named DB snapshot so a later session can diff against it before and after bulk changes like rename sweeps or signature migrations.
Instructions
Persist the current session's analyzed model as a named Manual snapshot in an aicb DB, so a later session can diff against it with compare_with_previous.
Use it BEFORE a bulk mechanical change (a rename sweep, a signature migration) and call compare_with_previous afterwards. An ordinary edit needs no snapshot: git diff and the tests cover it.
Returns JSON: snapshotId, sessionId, solutionId, name, lineNumbersAvailable and totalSnapshots (the snapshots that DB now holds for this solution).
It writes to the aicb DB, not to the solution's source or configuration: one new snapshot row, plus the solution's record when the DB does not know the solution yet; a DB file that does not exist is created. Nothing is overwritten: every call adds a snapshot under a fresh id, and name is a label, not a key. The snapshot keeps the line spans, but a session recalled from it reports lineNumbersAvailable false: its lines mean 'as analyzed', not the current working tree.
Parameters: sessionId is a live or recalled session's id or an absolute .sln path. Omit dbPath to use the server's standard config DB (the same one the GUI uses); when the server resolved none, the call fails with 'dbPath is required'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable name for this snapshot (e.g. 'before refactor'). | |
| dbPath | No | Optional absolute path to the aicb SQLite DB to persist into. Omit to use the server's standard config DB. | |
| sessionId | Yes | The session_id whose current state to snapshot. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use. |