Skip to content

fix(plain): record and verify spawned windows - #1207

Merged
fujibee merged 4 commits into
integration/terminal-driver-v1from
fix/1149-owner-witness
Sep 14, 2026
Merged

fujibee merged 4 commits into
integration/terminal-driver-v1from
fix/1149-owner-witness

Conversation

@fujibee

@fujibee fujibee commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Resubmission of #1186 (automatically closed when its base branch was deleted).

Plain spawns now use a one-shot child-to-parent handshake because the new window is the first process that can observe its emulator, controlling tty, and owner. A successful launch returns plain:<emulator>:<tty> and writes a four-column placement record with a boot/boot_start process witness; a missing, malformed, or timed-out handshake is a named failure and never falls back to the legacy - sentinel. terminal_detect likewise produces an emulator-qualified tty when the current measured macOS emulator and controlling tty are observable.

Forced despawn reads the record fence, checks that its emulator and tty match the locator, and revalidates every known complete process pair before asking the emulator adapter to close exactly that session. Spawn-time boot keys remain distinct from the self-write pid keys for the CLI process. A stale or incomplete witness fails loudly and keeps the placement record for retry. Unknown future anchor keys are ignored, while known keys are the only accepted evidence.

Tests: bats tests/test_terminal_registry.bats (169/169); bats tests/test_despawn.bats (21/21); bats tests/test_spawn.bats (108/108); bash -n scripts/drivers/terminals/plain/ops.sh; bash -n scripts/spawn.sh; bash -n scripts/despawn.sh.

@fujibee fujibee closed this Sep 13, 2026
@fujibee fujibee reopened this Sep 13, 2026
@fujibee
fujibee force-pushed the fix/1149-owner-witness branch 2 times, most recently from 696bf2a to 5e1bf28 Compare September 13, 2026 20:05
@fujibee
fujibee force-pushed the fix/1149-owner-witness branch from 5e1bf28 to 599d9e3 Compare September 14, 2026 02:27
@fujibee
fujibee merged commit 17f6d2d into integration/terminal-driver-v1 Sep 14, 2026
27 checks passed
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