Skip to content

/track: one live result of a finite command, refreshed in place (#393) - #416

Merged
raiseCatError merged 2 commits into
devfrom
feature/v021-track
Oct 18, 2026
Merged

raiseCatError merged 2 commits into
devfrom
feature/v021-track

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Stacked on #415 (Semantic Output) → #414 → #413 → #412 → #411. Merge in order. This supersedes draft #394: its scheduler and panel code and its tests are carried here (see below).

What

/track df -h or /track --every 5s -- docker system df:

  • Stored once: the command line and one note — what is tracked, where, and that it runs with sh -c and your shell's PATH, not its aliases or functions.
  • Drawn live under them, never stored:
    • a status row that says only what is known: first run pending, live · every 5s · updated 13:49:25 · exit 0 · 12 runs, a failing exit, timed out, could not run, paused, no new result for … (stale), refreshing…, stopped;
    • the latest completed result, with a stable height (the largest seen, at most 12 rows). A shorter refresh never moves what is below it; a longer one says how many lines are hidden.
  • Derived rows (the flag added for Semantic Output, now generic): find, selection and /copy never include them, and nothing accumulates per refresh.
  • Commands: /track copy [N] copies the latest completed result as plain text; refresh (refused while a sample runs, never overlapped), pause, resume, stop [N|all].
  • Stopping writes the last result into the transcript once. A window that closes leaves only the stored lines.
  • /watch keeps its manager and behavior (Ask, palette and Actions paths unchanged). Both names share one scheduler, and the manager shows both.

Reconciling draft #394

Ownership

Window-owned, as /watch always has been. Detach or exit stops trackers and their processes, and they are not restarted on reattach. Service-owned scheduling on the #382 supervisor is deferred and documented.

Tests

  • track.test.ts:
    • Track live commands with /track (initial slice of #393) #394's 8 tests;
    • truthful status states;
    • stable height (pad shorter results, count hidden lines of longer ones), with hostile text made inert and fitted;
    • in-place replacement with stored lines unchanged and not found by search;
    • clear resets the block.
  • trackApp.test.ts (real scheduler and sh):
    • the block and the first result; a refresh replaces the result with no new stored lines;
    • a second refresh is refused while one runs;
    • stop writes the final result exactly once;
    • /watch still opens its manager.
  • trackLive.test.ts (real PTY through the binary):
    • the result updates on screen while the shell runs another command;
    • /track copy puts the latest result on a stand-in clipboard;
    • /track stop leaves it, and the saved journal holds the final result once and no earlier refresh.
  • 129 related files pass. Two live tests (tmux reattach, built-binary picker) failed only under load with a stale dist; they pass after a rebuild when run alone.

Not verified

Physical terminal checks: docs/testing/v021-physical-qa.md, section 5, not run. Docker examples need a host with Docker.

Refs #393, #394, #410

/track <command> (or --every 5s -- <command>) writes the command and a note
once, then draws a status row and the latest completed result under them,
replaced on every refresh with a stable height. Live rows are derived: never
stored, found, selected or copied, so nothing accumulates per refresh.
/track copy, refresh, pause, resume and stop; stopping leaves the last result
in the transcript once. /watch keeps its manager and behavior.

The shared scheduler takes draft PR #394's hardening as written (strict
cadence parsing; refusing substitutions, background jobs and heredocs;
UTF-8-safe bounded capture with a truncation flag; visible timeouts and spawn
errors; completion on stdio close; a stop grace period; at most 8 trackers),
and its tests. Samples now use the live shell's PATH. The derived-row flag
from Semantic Output is generalized for both.
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