Commit graph

2 commits

Author SHA1 Message Date
AJ
748f1a0417 fix: red-team QA -- 5 bugs found and fixed
Bug #1 (Critical): get_parent_session_id() doesn't exist on SessionDB.
Replaced with get_session(sid)['parent_session_id']. Also fixed lineage
walk loop that only ever iterated once due to unconditional break.

Bug #2 (Medium): Path traversal via session_id. CheckpointStore._path_for
now validates session_id with regex ^[A-Za-z0-9_-]+$ to reject /, \, ..

Bug #3 (Critical): 'checkpoint' tool never offered to model. Added
'checkpoint' to the 'todo' toolset tools list in TOOLSETS dict.

Bug #4 (Low): flush_checkpoint test didn't call flush_checkpoint. Test now
calls AIAgent.flush_checkpoint() directly via mock agent.

Bug #5 (Medium): Injection fallback grabbed ANY in_progress checkpoint
from unrelated sessions. Removed the broad fallback; caller now walks the
parent lineage chain and passes the specific session_id that has a
checkpoint file.

Added 13 regression tests in test_checkpoint_regression.py covering all
five bug fixes.
2026-04-24 19:33:14 -04:00
AJ
888d241ca2 feat(checkpoint): add pre-compression checkpoint flush hook 2026-04-24 19:33:14 -04:00