Plan: purge the Local runtime vocabulary (pty naming, TWOCODE_RUNTIME) from 2code
Plan: purge the Local runtime vocabulary from 2code
Phase 4 on top of PR #462 (task-3-line-count-trackers).
The Local runtime is already deleted — phase 2 #436 Task 9 (#452) removed the Local adapter, the portable-pty spawn path, TWOCODE_RUNTIME / --twocode-runtime=local, and the sqlite pty_sessions store; there is no env-, flag-, or fallback-selected backend left. What survives is its vocabulary: the codebase still calls Herdr-backed terminal sessions "pty", and the removed flag is still named in tests and docs.
This phase deletes that vocabulary so nothing in the tree suggests a Local terminal implementation still exists.
Goal
The word pty and the name TWOCODE_RUNTIME no longer appear in the live codebase (historical Diesel migration filenames may keep their original names — they are applied history, not current state).
Standing constraints (every sub-issue)
- No behavior change. This is a rename and a documentation/test cleanup. Same IPC surface semantics, same clicks and labels.
- No Local anything. Do not reintroduce an adapter, env flag, CLI flag, dependency, or fallback path, not even behind a cfg or a comment.
- Migrations are history. Do not rename or edit files under
src-tauri/migrations/; adding a new migration is allowed only if a rename requires a schema change (it should not). - Frontend callers move with the commands. If an IPC command is renamed, update
src/generated/commands.tsand every caller in the same commit so the app still builds and behaves identically. - Do not push and do not open a PR. One task at a time, stacked on the previous accepted branch.
Tasks
- Rename the terminal session layer off
ptyRename the Rust modules, DTOs, traits, IPC commands, and frontend callers that still use the Local-implementation names (src-tauri/src/handler/pty.rs,src-tauri/crates/model/src/pty.rs,create_pty_session/write_to_pty/resize_pty/scroll_pty/close_pty_session/attach_pty_output/detach_pty_output/flush_pty_output/clear_pty_output, and their types) to terminal/session names that match the Herdr-backed reality. Updatesrc/generated/commands.ts, all frontend callers, docs, and tests in the same task. Keep the exact same behavior and UI. - Delete every
TWOCODE_RUNTIMEtrace Remove the flag name from code comments, tests, and documentation. Where a test only asserted that the removed flag's literal string is absent, replace it with a durable invariant that does not name a deleted flag: no environment variable or CLI flag selects a runtime backend, and the GUI backend is always Herdr. Keep the invariant enforced by a test. - Prove and lock Herdr-only
Add an audit test (Rust and/or a repo check) that fails if any of these reappear: a Local adapter or
RuntimeBackend::Localvariant, aportable-pty/ ConPTY spawn dependency, an env- or flag-selected backend, a sqlite session/profile store used as authority, orptyvocabulary in the live tree. State the invariant indocs/architecture.mdandAGENTS.md. Report the exact command and its output.
Acceptance for this phase
grep -rn "pty"over the live tree (excludingsrc-tauri/migrations/, lockfiles,target/) returns nothing.TWOCODE_RUNTIMEappears nowhere in the repository.- The app builds and the existing test suites pass, unchanged in behavior.
- A test enforces both invariants so the vocabulary cannot creep back.
Base
Branch task-3-line-count-trackers (PR #462). Do not reset that stack.