|
todo: give plans their own table and recover them after a crash
Todo already survived restarts inside the generic session_store KV row, but the plan there was opaque JSON with no timestamp: after a server crash the agent resumed a step marked in_progress with no way to tell whether it had ever been done. session_todos (user_id, session_id, tasks JSONB, revision, updated_at) now holds the plan. Existing rows are migrated on first use and the KV source is deleted in the same step, so clearing a plan is not undone by the next process start. Each step gains provenance fields (source, step_id, protocol_run_id) for the protocol work, and insert_steps() splices a block after the step the agent has already reached instead of making it re-issue the whole plan. get_progress_message() now flags a plan whose in_progress step predates this process once per (session, revision): re-check the real result before marking it done. The todo op "clear" now uses the same user scope as load/save; it used to prefer ctx.user_id and could delete a different row than the one written. |
|---|
|
|
| docs/index.md |
|---|
| docs/store.md |
|---|
| docs/todo-store.md 0 → 100644 |
|---|
| manuals/todo.md |
|---|
| navi/api/deps.py |
|---|
| navi/api/routes/sessions.py |
|---|
| navi/core/container.py |
|---|
| navi/core/registry.py |
|---|
| navi/todo_store.py 0 → 100644 |
|---|
| navi/tools/todo.py |
|---|
| tests/unit/store/test_todo_store.py 0 → 100644 |
|---|
| tests/unit/tools/test_todo.py |
|---|