Skip to content

Domain model alignment: D-13, D-15, test plans#289

Open
kirich1409 wants to merge 8 commits intomainfrom
fix/remote-session-stopped-at
Open

Domain model alignment: D-13, D-15, test plans#289
kirich1409 wants to merge 8 commits intomainfrom
fix/remote-session-stopped-at

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

@kirich1409 kirich1409 commented Apr 24, 2026

Summary

Domain model alignment pass based on acceptance check against docs/architecture/domain-model.md v1.0.

Code fixes

  • D-13 — Add stoppedAt: Date? to RemoteSession (CodingKey "stopped_at"). Server was already sending this field; Swift client silently discarded it.
  • D-15 — Add TerminalState enum (starting/running/stopped) with safe fallback decoder. Replaces untyped state: String in RemoteTerminal, following the SessionState/ProjectState pattern.

Spec updates

  • docs/architecture/domain-model.md §7 — D-13 and D-15 marked closed; D-14 (Profile.id) documented as MVP-acceptable (name-based identity until server-side profile persistence is introduced).

Test plans (new files)

  • docs/testplans/domain-model-compliance-test-plan.md — 15 TCs covering gaps in CloudEntitiesTests: RemoteTerminal decode, TerminalState enum, RemoteSession.stoppedAt, ServerCredential.defaultImage, image resolution chain §5, FK regression.
  • docs/testplans/terminal-tab-switching-test-plan.md — 22 TCs + 5 edge cases covering terminal navigation not in 11-client-ui.md: worktree→session directory, PTY isolation, session-switch tab activation, VT state persistence on switch, auto-reconnect restore.

Not changed

RemoteSession.profile: SessionProfile? — flagged as spec drift (profile belongs to Terminal per §2), but actively used by SessionListFeature for display name. Removing requires Terminal-based profile resolution first.

Test plan

  • xcodebuild build passes (verified locally, all commits)
  • stoppedAt is additive optional — backward-compatible decoder
  • TerminalState unknown value falls back to .stopped, no throw
  • No call-sites pass state: String to RemoteTerminal directly — REST decoding only

🤖 Generated with Claude Code

kirich1409 and others added 7 commits April 24, 2026 21:55
Server was already sending stopped_at in SessionResponse but Swift
client silently discarded it. Adds stoppedAt: Date? with CodingKey
"stopped_at" and updates domain-model.md §7 to mark D-13 closed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RemoteTerminal.state was an untyped String while the domain model
defines TerminalState with starting/running/stopped values. Adds
TerminalState enum following the SessionState/ProjectState pattern
with safe fallback decoder (.stopped on unknown value).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
D-14: Profile.id — mark as MVP acceptable (name-based identity)
D-15: TerminalState enum — mark as closed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers gaps in CloudEntitiesTests: RemoteTerminal, TerminalState,
RemoteSession.stoppedAt, ServerCredential.defaultImage, image
resolution chain §5, and FK regression cases (15 TCs total).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers gaps in existing 11-client-ui.md: worktree selection →
session directory, PTY isolation between worktrees, Open Terminal
availability by session state, and tab persistence across project
navigation. Spec source: domain-model.md §2-4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TC-12: session with open terminal → active tab switches
TC-13: session without terminal → no auto-open (explicit action required)
TC-14: tab switch → sidebar selection syncs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers client-side VT state preservation on session switch:
- Remote scrollback/snapshot on tab switch (TC-16, TC-18)
- Accumulated output while tab was inactive (TC-17)
- VT state isolation between sessions (TC-19)
- Local PTY process continuity across tab switches (TC-20, TC-21)
- Auto-reconnect VT restore after network loss (TC-22)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kirich1409 kirich1409 changed the title Add stoppedAt to RemoteSession (domain model D-13) Domain model alignment: D-13, D-15, test plans Apr 24, 2026
Tests run in Relay scheme (RelayTests host):
- stoppedAt decodes from JSON, nil when absent, roundtrip (D-13)
- TerminalState all values + unknown fallback (D-15)
- RemoteTerminal full decode, sessionId FK, roundtrip (D-2/D-15)

9 tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant