Skip to content

Plan: purge the Local runtime vocabulary (pty naming, TWOCODE_RUNTIME) from 2code #463

Description

@AkaraChen

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)

  1. No behavior change. This is a rename and a documentation/test cleanup. Same IPC surface semantics, same clicks and labels.
  2. No Local anything. Do not reintroduce an adapter, env flag, CLI flag, dependency, or fallback path, not even behind a cfg or a comment.
  3. 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).
  4. Frontend callers move with the commands. If an IPC command is renamed, update src/generated/commands.ts and every caller in the same commit so the app still builds and behaves identically.
  5. Do not push and do not open a PR. One task at a time, stacked on the previous accepted branch.

Tasks

  1. Rename the terminal session layer off pty
    Rename 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. Update src/generated/commands.ts, all frontend callers, docs, and tests in the same task. Keep the exact same behavior and UI.
  2. Delete every TWOCODE_RUNTIME trace
    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.
  3. 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::Local variant, a portable-pty / ConPTY spawn dependency, an env- or flag-selected backend, a sqlite session/profile store used as authority, or pty vocabulary in the live tree. State the invariant in docs/architecture.md and AGENTS.md. Report the exact command and its output.

Acceptance for this phase

  • grep -rn "pty" over the live tree (excluding src-tauri/migrations/, lockfiles, target/) returns nothing.
  • TWOCODE_RUNTIME appears 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions