Skip to content

[CTX-1342] fix(session): refuse pin-only empty tiled base with a typed error (#2230) - #2235

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-1342/fix-pin-only-session-capture
Oct 19, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-1342/fix-pin-only-session-capture

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Priority: P2 | Area: area:runtime | Labels: fix,P2,area:runtime | Milestone: v0.1.0 | RFC: session storage | Task: CTX-1342

Closes #2230

What

After #2222, a pin-only empty tiled base is a valid live state. Session capture reported session file corrupt (empty workspace) and saved nothing. It now refuses with a typed PinOnlyEmptyBase error and leaves the existing session file untouched.

Why refusal, not persistence

The v3 codec and a duplicate validate_snapshot live in the external bitty-storage crate (pinned 5e720b4); encode_session rejects every empty-layout workspace. Persisting needs a codec change plus a dependency bump, tracked as bitty-storage#15.

Changes

Verification

  • fmt, clippy -D warnings (runtime+terminal all targets), Windows workspace all-targets: pass
  • terminal nextest 1212; runtime lib 1049
  • Mutation: removing the branch fails both refusal tests with Corrupt("empty workspace")

Non-goals

Persisting pin-only state; never-empty invariant unchanged.

After CTX-1337 (#2222), a pin-only empty tiled base is a valid live state. Validation no longer reports it as file corruption: capture refuses it with the typed SessionError::PinOnlyEmptyBase diagnostic. Persisting it needs a v3 codec change in bitty-storage (it rejects every empty workspace), so the in-repo change is the explicit refusal allowed by #2230. Pinless empty workspaces remain Corrupt, preserving the never-empty invariant.

Add a deterministic runtime-to-file test for the refusal (no file write, existing session untouched) and a normal-workspace-with-pins round-trip regression test.
@Xuepoo Xuepoo added this to the v0.1.0 milestone Oct 19, 2026
@Xuepoo Xuepoo added fix Bug fix area:runtime Area: runtime orchestration P2 Priority: medium labels Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa676668-997e-4c80-b896-a4fe8271bed7
📥 Commits

Reviewing files that changed from the base of the PR and between f424321 and fe88ed5.

📒 Files selected for processing: 2
  • crates/bitty-runtime/src/runtime/session.rs
  • crates/bitty-terminal/src/session_storage_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Xuepoo
Xuepoo merged commit b665f26 into main Oct 19, 2026
17 checks passed
@Xuepoo
Xuepoo deleted the ctx-1342/fix-pin-only-session-capture branch October 19, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime Area: runtime orchestration fix Bug fix P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(session): pin-only empty tiled base fails session capture validation and is not saved

1 participant