# dsflow-tui ## Goal Give designers one screen for the `dsflow` check-in flow: see local changes, locks and checked-out copies; run sanity on chosen files with those files locked for the duration; then check in, tag, or just unlock. This replaces typing `dsflow precheckin` / `checkin` / `claim` / `release` by hand and makes "I forgot to release the lock" impossible. ## Assumptions - `ds_lock` = `dssc lock` takes the vault lock without touching the local copy. **Unverified**: TODO §1. - `dssc ls -rec -report N .` lists managed files, one relative path each. **Unverified**. - DesignSync fetches read-only copies unless a file is checked out, so "writable and unlocked" means "checked out without a lock". **Unverified**. - `dssc tag -replace` moves an existing tag. **Unverified**. - `dssc ci` releases the lock. The runner does not rely on it: it checks the holder and unlocks what the run took either way. - Sanity runs on the whole workspace, so unmarked local changes are tested too. The run dialog warns; it does not stop the run. - The runner and TUI may be on different hosts sharing the workspace over NFS, so liveness is a heartbeat in the job file, not a pid check. ## Handshakes Consumes from `dsflow.conf`: `TRUNK_SEL`, `WORKING_TAG`, `SANITY_CONFIGS`, `MAX_STAMP_AGE`, `HOT_FILES`, `CHECKIN_LOG`, `run_sanity`, and the `ds_list_modified` / `ds_base_version` / `ds_latest_version` / `ds_lock_holder` / `ds_unlock` helpers. Optional: `DSFLOW_TAGS`, `SANITY_SCRIPT`, and overrides of every `BASH_DEFAULTS` helper. Promises to bash `dsflow`: `.dsflow/new_files` stays a sorted path list; `.dsflow/sanity.stamp` is written only by a run that covered exactly `all_changes` on exactly `SANITY_CONFIGS`, with `dsflow`'s `content_hash`; `CHECKIN_LOG` lines are `timeuserhashfiles`. Promises to `dsflow_ci`: never moves `WORKING_TAG`. Job file (`.dsflow/tui_job.json`): written by the runner, read by the TUI and `status`. A terminal `status` (`passed`, `failed`, `cancelled`, `error`) means lock release has finished. `heartbeat` is refreshed every 5 s; 60 s without one means the runner is gone. ## Status / TODO - [x] Changes, Locks (with hot-file board), Checked-out, Sanity run, Logs tabs - [x] detached runner: validate, lock, refresh, sanity per config, verify, check in, tag, unlock - [x] cancel, lost-runner cleanup, later check-in with `c`, batch tag, add new, rebase - [x] `status` / `status --json`, `--sanity-cmd`, `SANITY_SCRIPT` - [x] `--demo` sandbox with a fake `dssc`; `tests/test_runner.py` - [ ] real-DesignSync verification: TODO §1 ## Work log - 2026-09-23: first version built on the `dsflow` plan in `files.zip`. Choices: curses over Textual (no pip on EDA hosts); the runner is a separate detached process so a closed terminal can't strand locks; cancel is a file (`tui_job.cancel`) rather than a signal so it works across hosts. Tested in the demo through a pty with pass, fail, cancel, unlock-only then `c`, kill -9 of the runner, stale guard, ASCII locale. - 2026-09-23: writing the test suite found two bugs, both fixed. The fake `dssc` computed wrong paths when the demo lived under a symlinked directory (macOS `/var`), which broke the default `--demo` on a Mac. The runner saved the terminal status before releasing locks (CLAUDE.md invariant 7). ## QA log ## Review