Repository navigation
V0-02: Complete Thinking Workspace lifecycle and recovery - #21
Merged
Merged
Conversation
Add select, rename, and confirm-delete to the Thinking Workspace interface alongside create, and enforce the invariant that one valid Workspace always exists and is selected. - Names are trimmed, required, and bounded at 120 Unicode scalar values; duplicate names stay distinct because identity is never the name. - Active Workspace identity persists as an application preference in a new app_preferences table, not as domain content, so the selection reopens when the Workspace still exists and falls back safely when it does not. - Deleting the active Workspace among several selects the most recently updated survivor; deleting the only Workspace empties its Notes and resets it to the default name instead of leaving none. - Every lifecycle intent commits in a single SQLite transaction, so a rejected delete leaves the Workspace, its Notes, and the selection untouched. - Database open and migration failures now render a recovery screen with the error category plus retry and quit actions, and never reset or overwrite an existing database. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses findings from the two-axis review of this branch. - A failed open on a path that held no database now removes the stub SQLite created before the failure, so the next launch cannot mistake an empty stub for a legitimate fresh database. Preparation is injected into open so this path is covered by a test. - Locating the app data folder no longer aborts startup. Both the app_data_dir lookup and the folder creation become Initialization recovery states, so the thinker always reaches the recovery screen. Retry re-resolves the path, so a fixed folder recovers without a restart. - Timestamps are fixed-width UTC, so lexicographic order is chronological order in SQL ordering, survivor selection, and tests. - The survivor test now picks a Workspace that is neither the newest, the oldest, the first, nor the last, so no weaker rule passes it. Verified by mutation: replacing the rule with most-recently-created fails both adapters. - Added a rejected-rename rollback case, and the dangling-selection test now tampers through a separate connection instead of reaching into the adapter's private state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.
What changed
Lifecycle is now complete on the durable foundation: create, list, select, rename, and confirm-delete Thinking Workspaces, plus a safe recovery state when the database cannot be opened.
Thinking Workspace intents (
src-tauri/src/workspace.rs)select_workspace,rename_workspace, anddelete_workspacejoincreate_workspaceandcreate_noteonThinkingWorkspaceInterface. Every intent commits in a single SQLite transaction.app_preferencestable (migration0002), not as domain content. On open, a selection that no longer exists falls back to a valid Workspace.create_workspaceselects the Workspace it creates.Safe open failure (
src-tauri/src/lib.rs,src/App.tsx)WorkspaceStore::opennow returns a categorizedStorageOpenFailure(unreadable,migration,initialization) instead of aborting startup. Nothing is reset, deleted, or overwritten on failure.unavailableoutcome and the UI renders a recovery screen naming the category, withretry_storage_openandquit_applicationactions.UI
src/workspace-lifecycle.tsas pure logic so the cancel path is unit-tested.Testing
npm run checkpasses: typecheck, lint, vitest (4), cargo test (8), and the Tauri smoke build.Notes for review
src-tauri/gen/(Tauri-generated ACL schemas) is now gitignored; it was untracked build output.prd-simplicity-audit,code-review, andfallowskill passes were not run in this session.🤖 Generated with Claude Code