Task 2: Retire the stale documentation
Summary
Sweep docs/ and AGENTS.md so they describe the Herdr client-mode tip on task-1-verify-gaps, as required by parent plan #458 Task 2. This is documentation hygiene. No production behavior change. No interaction change.
Herdr is the profile authority. sqlite profiles is not source of truth (the table is DROPped). projects / project_groups / checkout_notes stay in 2code sqlite. Local PTY, TWOCODE_RUNTIME, mapping tables, and pty_sessions are already gone on this stack — do not re-add them in docs as current architecture. Do not start Task 3 (line-count tracking).
Task 1 (#459) already closed named doc gaps (#454 KEY PATTERNS, #407 contract rows, #431 deletion-flow paragraph). Do not revert those. This task retires the rest of the deleted-world text: sqlite profiles as authority, profiles.worktree_path, profile_runtime_mappings / session_runtime_mappings, pty_sessions as the session store, the Local PTY runtime and its orphan-log GC, RuntimeRouter defaulting to Local, and phase-1 "keep Local default" statements.
This is #458 Task 2, not #394 Task 2 (#402) and not #436 Task 2 (#439). Do not implement or close those task tickets here.
Dependencies: Parent plan #458. Prerequisite: #459 (Task 1). Stack on task-1-verify-gaps. Open leftover gaps (#396, #397, #398, #399, #401) and every exceeds the ... line estimate (tracking) issue are out of scope — Task 3 owns the trackers.
Work to complete
-
Enumerate current-state stale text Search
docs/andAGENTS.md(includingsrc-tauri/AGENTS.md, rootAGENTS.md/CLAUDE.mdcopies, and crate copies that still describe the deleted world) for current-state claims of:- sqlite
profilesas a live catalog / authority profiles.worktree_pathas the Git / file-tree pathprofile_runtime_mappings/session_runtime_mappingsas live tablespty_sessions/pty_output_chunksas the session store- Local PTY /
portable-ptyspawn,pty_logs,gc_orphan_logs/ orphan-log GC RuntimeRouterdefaulting to Local,TWOCODE_RUNTIME, phase-1 "keep Local default"2code-helperas the production sidecar (replaced by pinned Herdr v0.9.0)
Historical contrast in
docs/herdr-integration.md("#394 treated Local as default", "DROPped", "Local deleted in Task 9") is current-state-correct and must stay. Do not flatten that file into a Local-era doc. Do not bump the v0.9.0 pin. Do not inflate live-probe claims. - sqlite
-
Update or delete each stale section Starting-point hints (must be re-checked against this tip, not copied as the reply):
docs/data-flow.md: PTY Session Lifecycle (Creation / Output Streaming / Session Restoration) still INSERTpty_sessions, persistpty_logs,gc_orphan_logs, and sqlite history restore. Replace with Herdrsession.snapshot/ livepane_id,stream_herdr_output, restore-by-reattach. Git stillresolve_context_folder→profile.worktree_path— replace withreconcile_profile_checkout/ live Herdr cwd. Profile Creation Flow stillgit worktree add+ INSERTprofiles— replace with Herdrworktree.create/workspace.create; returned id isworkspace_id. Deletion Flow was already corrected in Task 1 (#431) — do not regress it to git-only teardown.docs/architecture.md: diagram stillportable-pty; handlers stillPtySessionMap; servicepty.rsorphan-log GC; repoprofile.rs/pty.rsas sqlite CRUD; infrapty.rs/pty_log.rs; terminal "rebuilt from DB". Describe Herdr-onlyRuntimeRouter, crates as they exist, sqlite tables asprojects/project_groups/checkout_notes.docs/configuration.md: schema still documentsprofiles(worktree_path),pty_sessions,pty_output_chunks. Replace with the live schema insrc-tauri/crates/model/src/schema.rs. PTY env-from-infra/pty.rsis Local-era; document Herdr sidecar / session env only if it still exists on this tip.docs/api-reference.md:delete_projectstill "cascade to profiles/sessions"; PTY commands described as Local spawn + DB mark-closed +get_pty_session_historylog files;Profiletype still hasworktree_path. Keep the existing command names (do not rename IPC). Describe current Herdr-backed behavior: session id ispane_id,profile_idisworkspace_id, list is live snapshot, restore is reattach, project delete is forget/retain.2code-helperHTTP section: delete or retarget if that sidecar is gone.docs/README.md: still names2code-helperand an oldsrc-tauri/src/{service,repo,infra,model}layout. Point at the Herdr sidecar andsrc-tauri/crates/.docs/notification-behavior.md: unread-dot interaction stays. Update the backend event-source paths if they still name2code-helper/ Local PTY helper. Do not redesign sidebar/tab click rules.src-tauri/AGENTS.md(keepsrc-tauri/CLAUDE.mdin sync): still lists repoprofile, pty, testspty_db, and PTY commands as if Local history restore exists. Describe Herdr-only runtime, livepane_idsessions, and the tables that remain.- Root
AGENTS.md/CLAUDE.md: still claim sqlite tablesprojects, profiles, pty_sessionsand the Local PTY streaming / orphan-log pipeline. Phase acceptance requiresAGENTS.mdnot to describe that deleted world. Keep the two copies in sync. src-tauri/crates/service/AGENTS.md(and CLAUDE.md copy): FILES already say Herdr create/delete; KEY PATTERNS still describegit worktree add+ local teardown. Align KEY PATTERNS withworktree.create/worktree.remove. Do not re-sweep crate files that are already client-mode (repo, model, terminal KEY PATTERNS).
Point architecture/data-flow readers at
docs/herdr-integration.mdinstead of duplicating the probe contract. Quote live code (schema.rs,RuntimeRouter,reconcile_profile_checkout) rather than inventing a new architecture. -
Cite each changed file in the reply The parent plan requires the reply to name every file this task changed. Source-string tests are welcome (Task 1 imported terminal KEY PATTERNS as a fixture); do not add production code to "prove" a doc change. Do not push. Do not open a PR.
Likely files and directories
- Must update if still stale:
docs/data-flow.md,docs/architecture.md,docs/configuration.md,docs/api-reference.md,docs/README.md,docs/notification-behavior.md,src-tauri/AGENTS.md(+ CLAUDE.md copy), rootAGENTS.md/CLAUDE.md,src-tauri/crates/service/AGENTS.mdKEY PATTERNS (+ CLAUDE.md copy). - Keep, do not regress:
docs/herdr-integration.md(client-mode contract; historical DROPped / inversion rows stay),docs/data-flow.mdDeletion Flow (Task 1 / #431),src/features/terminal/AGENTS.mdKEY PATTERNS (Task 1 / #454). - Authority for the replacement text:
src-tauri/crates/model/src/schema.rs(projects,project_groups,checkout_notes),src-tauri/crates/service/src/runtime.rs(Herdr-only; no Local / portable-pty),docs/herdr-integration.mdcurrent-state mapping. - Tests (optional): colocated source-string assertions that
docs/+AGENTS.mdno longer present those phrases as current architecture. Do not editsrc/generated/or Dieselschema.rs. - Do not change: production Rust/TS, IPC signatures, sidecar pin, GUI clicks/labels, Diesel migrations,
website/blog posts,lib.rsnamingHerdrRuntimeSync.
Estimated changes: 200–500 lines total, additions plus deletions, including tests; excluding generated files, lockfile churn and binary artifacts. Material scope growth (rewriting the Herdr probe contract, inventing new IPC, sweeping website/) should become a separate issue.
Acceptance criteria
- [ ] No doc in
docs/orAGENTS.mdstill describes the deleted sqlite/PTY/Local-default world as current behavior. Historical "DROPped" / "#394 treated Local as default" contrast indocs/herdr-integration.mdmay remain. - [ ]
docs/configuration.md(and any schema section) matches live sqlite:projects,project_groups,checkout_notes. It does not documentprofiles,profiles.worktree_path,pty_sessions,pty_output_chunks, or mapping tables as live. - [ ]
docs/data-flow.mdno longer documents Local PTY spawn,pty_sessionsINSERT,pty_logs/gc_orphan_logs, or sqlite history restore. Session restore is reattach of a live Herdrpane_id. Git paths come from live Herdr cwd, notprofiles.worktree_path. Profile create goes through Herdr. Task 1's Deletion Flow remains forget/retain + Herdrworktree.remove/workspace.close. - [ ]
docs/architecture.mdanddocs/api-reference.mddescribe Herdr-onlyRuntimeRouterand livepane_idsessions. Existing IPC names stay.delete_projectis catalog-forget + retain, not cascade-destroy of sqlite profiles/sessions.Profileis a derived GUI DTO (id=workspace_id), not a sqlite row withworktree_path. - [ ]
src-tauri/AGENTS.md(and its CLAUDE.md copy) and rootAGENTS.md/CLAUDE.mdno longer list sqliteprofiles/pty_sessionsas the data model or Local PTY orphan-log GC as current. - [ ] v0.9.0 pin unchanged. No production behavior change. No Local /
TWOCODE_RUNTIME/ sqliteprofilesauthority.projectsstill round-trip in sqlite. No secondevents.subscribe.lib.rsstill does not nameHerdrRuntimeSync. - [ ] Tests: none required if only markdown changes. If a source-string test is added,
cargo test --workspacefromsrc-tauri(orcargo test --workspace --exclude codewhere GTK is unavailable) and/or frontend tests for that fixture.bun run typegenonly if IPC signatures change (none expected). - [ ] The reply cites every changed file. No push. No pull request.
Out of scope
- Parent-plan Task 1 (gap audit; already done on this stack) and Task 3 (line-count tracking issues).
- Closing or implementing #394 / #436 task tickets. Re-commenting leftover gaps #396 / #397 / #398 / #399 / #401.
- Reintroducing Local PTY,
TWOCODE_RUNTIME, sqliteprofiles, or mapping tables. - Changing the Herdr-only runtime decision, the v0.9.0 pin, IPC command names, or GUI clicks/labels (New Profile / Delete Profile / New Tab / Delete Project).
- Rewriting the verified Herdr probe / frame / checksum sections of
docs/herdr-integration.md. - Reconstructing split layout, adding a Settings runtime toggle, or sweeping
website/historical blog posts. - Remote Herdr machines. Windows/macOS live probes on this Linux builder.
- Opening a pull request.
Standing constraints
- No production behavior change unless a real defect is proven on this tip. This task is docs.
- Do not treat sqlite
profilesas source of truth.projectsstay in 2code sqlite. - Never let Local and Herdr own the same worktree (Local is already removed; do not bring it back in docs or code).
- Default-runtime switch and deleting Local/PTY/
profilesrows already shipped in #436; this task only documents that reality. Do not re-litigate those decisions. - Do not change interaction unless the old UX cannot be backed by Herdr. This task has no named interaction exception — keep existing clicks/labels; only correct false descriptions of those clicks (as Task 1 did for Delete confirm copy).
- One task; stack on
task-1-verify-gaps. Do not push. Do not open a PR.
Why this is next
#458 has three tasks. Task 1 (#459) is done on task-1-verify-gaps. Task 2 is the remaining docs sweep; the leftover open gaps (#396/#397/#398/#399/#401) are Linux-unverifiable or upstream-capability leftovers, not in-flight replacements for this work. Task 3 owns the line-count trackers.