Skip to content

feat(pty): add platform-neutral session contract - #34

Merged
decode2 merged 1 commit into
masterfrom
feat/pty-session-contract
Jul 18, 2026
Merged

feat(pty): add platform-neutral session contract#34
decode2 merged 1 commit into
masterfrom
feat/pty-session-contract

Conversation

@decode2

@decode2 decode2 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Linked issue

Closes #33

  • The linked issue has the status:approved label.

Pull request type

Select exactly one option and apply the matching type:* label.

  • Bug fix (type:bug)
  • New feature (type:feature)
  • Documentation (type:docs)
  • Refactor (type:refactor)
  • Maintenance or tooling (type:chore)
  • Breaking change (type:breaking-change)

Summary

  • Adds a platform-neutral PTY session contract for identity, I/O, resize, and lifecycle operations.
  • Adapts the existing Windows ConPTY session to the contract without changing its external behavior.
  • Adds contract tests for attribution, backpressure/error boundaries, natural exit, and idempotent close.

Changes

Area or file Change
crates/splice-pty/src/lib.rs Defines the shared session contract and implements it for the existing Windows ConPTY session.
crates/splice-pty/tests/session_contract.rs Exercises the platform-neutral behavioral contract with a deterministic test session.

Test plan

  • Ran the focused automated checks: cargo fmt --all --check; cargo test -p splice-pty (16/16 passed); cargo clippy -p splice-pty --all-targets -- -D warnings (passed).
  • Exercised the affected terminal, AI CLI, or desktop workflow: contract tests cover identity/early output, input error and acknowledgment backpressure, natural exit, and idempotent close (3/3 passed).
  • Verified relevant Windows, Linux, or WSL behavior, or documented why it is not applicable: Windows GNU cross-target/contract and differential Wine evidence passed during SDD verification; Wine cannot validate the native ConPTY runtime, so native Windows CI is required before merge. Unix and WSL backends are outside this PR.

Chained pull request context

  • Previous PR: feat(compat): add finite AI CLI compatibility harness #31, merged into master at 1c02999a
  • Next PR: PR3 (planned Unix PTY backend), depends on this session contract after PR2 merges
  • Review this PR first: the contract semantics in lib.rs, then the contract scenarios in session_contract.rs
  • Intentionally out of scope: Unix backend implementation and all later desktop/platform, WSL, workspace, UI, packaging, and documentation slices

Chain Context

Field Value
Chain Terminal AI platform expansion
Tracker PR Not needed (stacked-to-main)
Position PR2 of 15
Base master at PR1 merge 1c02999a
Depends on #31 (merged)
Follow-up PR3: Unix PTY backend, after this PR merges
Review budget 226 changed lines / 400
Starts at PR1 compatibility foundation merged into master
Ends with Platform-neutral PTY session contract backed by preserved Windows ConPTY behavior

Chain Overview

master
  └── ✅ PR1 #31: AI CLI compatibility harness (merged)
       └── 📍 PR2: platform-neutral PTY session contract
            └── PR3: Unix PTY backend (depends on PR2)

Scope

  • Includes: shared PTY session contract, Windows ConPTY adaptation, and contract tests.
  • Excludes: Unix backend implementation and every later chain slice.

Autonomy

  • CI is expected to pass for this PR branch; native Windows CI remains a required pre-merge check.
  • This PR has one deliverable scope.
  • This PR can be rolled back without unrelated changes.
  • Tests and verification cover this unit.

Rollback

Revert commit cf7306b to remove only the shared session contract, its Windows adaptation, and session_contract.rs; PR1 and unrelated PTY flow-control behavior remain intact.

Contributor checklist

  • I searched for duplicate issues and pull requests before starting.
  • I linked an approved issue using Closes, Fixes, or Resolves.
  • I selected exactly one pull request type and applied exactly one matching type:* label.
  • I completed every relevant template field and included reproducible test evidence.
  • I updated documentation when behavior or compatibility changed (not applicable: this internal contract preserves current user-visible behavior).
  • My commits follow Conventional Commits.
  • My commits contain no AI attribution, including Co-Authored-By trailers.

@decode2 decode2 added the type:feature Adds or improves functionality label Jul 18, 2026
@decode2
decode2 merged commit 23af77a into master Jul 18, 2026
2 checks passed
@decode2 decode2 mentioned this pull request Jul 18, 2026
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature Adds or improves functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(pty): add platform-neutral session contract

1 participant