Skip to content

feat: add winTerm v0.4 workspace restore foundations#3

Open
HelloThisWorld wants to merge 25 commits into
mainfrom
codex/winterm-v0.4-workspace-restore
Open

feat: add winTerm v0.4 workspace restore foundations#3
HelloThisWorld wants to merge 25 commits into
mainfrom
codex/winterm-v0.4-workspace-restore

Conversation

@HelloThisWorld

Copy link
Copy Markdown
Owner

Summary of the Pull Request

  • Add Workspace schema v1, strict validation, deterministic serialization, migration, atomic storage, backups, snapshots, and quarantine.
  • Add capture/restore planning, profile/directory/theme/font/monitor resolvers, crash recovery, named workspaces, import/export, settings, and diagnostics foundations.
  • Add workspace fixtures, C++ unit coverage, PowerShell validation/benchmark scripts, CI wiring, documentation, and the 0.4 version update.

References and Relevant Issues

winTerm v0.4 Workspace Restore development task.

Detailed Description of the Pull Request / Additional comments

The implementation persists restore descriptions rather than process state. Imports cannot execute commands or choose arbitrary executables. Process state, terminal output, command history, clipboard content, credentials, and environment dumps are not persisted.

Full runtime acceptance remains intentionally open until the project is compiled and exercised in a built winTerm application. See docs/v0.4-acceptance.md for exact evidence and open gates.

Validation Steps Performed

  • scripts/winterm/test.ps1 -Suite Smoke — passed
  • Workspace model, restore, recovery, and import/security scripts — passed
  • Bundled workspace fixtures — passed
  • git diff --check — passed
  • Debug/Release compiled tests — unavailable locally because PowerShell 7 and Visual Studio/MSBuild are not installed

PR Checklist

  • Tests added/passed
  • Documentation updated
  • Schema updated
  • Full compiled and runtime acceptance complete

Comment thread docs/crash-recovery.md Outdated

Snapshots are written on the periodic policy and before destructive or migration operations. The default retention is the newest three valid files. Snapshot names contain a fixed-width generation so selection is deterministic. If the newest snapshot is corrupted, recovery examines older snapshots. Loading a damaged Last Session tries the last validated backup; damaged managed files can be moved to quarantine with sanitized reason metadata.

Recovery inspection recommends the latest valid snapshot after an abnormal shutdown, otherwise Last Session, otherwise a new session. It never overwrites normal state without a later explicit recovery choice. A recovered pane can report that a command was running, but no command is stored or replayed and no process is reattached.
Comment thread docs/crash-recovery.md Outdated

Snapshots are written on the periodic policy and before destructive or migration operations. The default retention is the newest three valid files. Snapshot names contain a fixed-width generation so selection is deterministic. If the newest snapshot is corrupted, recovery examines older snapshots. Loading a damaged Last Session tries the last validated backup; damaged managed files can be moved to quarantine with sanitized reason metadata.

Recovery inspection recommends the latest valid snapshot after an abnormal shutdown, otherwise Last Session, otherwise a new session. It never overwrites normal state without a later explicit recovery choice. A recovered pane can report that a command was running, but no command is stored or replayed and no process is reattached.
Comment thread docs/v0.4-acceptance.md Outdated
- [ ] Last Session and periodic snapshots are written and loaded by the running application.
- [ ] Startup and exit settings, workspace gallery/editor, import summary/confirmation, recovery prompt, restore report, and diagnostics views are present and manually exercised.
- [ ] Actual windows, positions, sizes, maximized/fullscreen policy, active window, and mixed-DPI monitor changes restore.
- [ ] Actual tab order, pane layout/ratio, focused and zoomed panes, profiles, CWDs, themes, and fonts restore for PowerShell, CMD, and available WSL profiles.
Comment thread docs/workspace-architecture.md Outdated

The storage layout is a winTerm-only `workspaces` directory under the application state root. It contains `last-session.json`, its backup, `snapshots`, `named`, `imported`, `quarantine`, and a rebuildable `index.json`. This storage never uses Microsoft Terminal package identity or LocalState.

Visual docking, corner docking, `GridNode`, `EmptySlotNode`, cross-window live pane transfer, terminal brokering, ConPTY reattachment, command replay, and SSH reconnection remain outside this architecture.
bool IsForbiddenKey(const std::string_view key)
{
static const std::set<std::string, std::less<>> forbidden{
"autorun",
"environmentvariables",
"executable",
"executablepath",
"externalfile",
"plugin",
"plugins",
"privatekey",
"privatekeypath",
"privatekeypath",
"registry",
"script",
"shellarguments",
"registry",
"script",
"shellarguments",
"sshprivatekey",
"script",
"shellarguments",
"sshprivatekey",
"startupcommand",
Comment thread scripts/winterm/build.ps1 Fixed
@github-actions

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants