feat: add session archive state and scoped stats - #77
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a durable session archiving and deletion feature to prevent deleted sessions from being resurrected during synchronization. It adds a new session_user_state table (schema version 20), updates database queries, statistics, and recommendations to respect these states, and provides UI controls for archiving, unarchiving, and deleting sessions. Feedback on the changes highlights a redundant check for deleted session identities in src/ingest.ts that duplicates logic already handled by writeSession.
0b2bee3 to
3dcc795
Compare
3dcc795 to
6684ac9
Compare
|
Validator follow-up complete and rebased at signed tip 6684ac9.
Evidence: focused state/ingest/stats suite 131/131; adversarial re-review clean; combined gate 781/781. A headed browser canary changed a scratch session state under include_archived=true and observed a second scoped summary request after archive_updated before restoring the row to visible. |
6684ac9 to
8de6816
Compare
Summary
Add archive/delete session state with subtree-aware visibility, deterministic re-ingest tombstones, and archive-aware session UI controls. Extend stats APIs and cards so project, tool, text, and archived filters describe the same visible session set.
This is stacked on #73 because it advances that schema baseline from v19 to v20. Retarget to
mainafter #73 lands.Why
This completes WS-A and WS-E from the UX/API hardening plan: users can trust filtered summaries, hide work without losing exact replay, and permanently delete a full session subtree without a later sync resurrecting it.
Validation
just checkpasses: 683 tests, TypeScript, Biome, and darwin-arm64 distribution staging smoke.Archive schema
The baseline is
LATEST_SCHEMA_VERSIONinsrc/db.ts. Check one:session_user_statemigration. Supported TypeScript-cutover archives migrate in place; pre-v8 archives remain rebuild-only.