Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a68a312
design: mission-control boards, the signed-off visual contract
m4ttheweric Sep 18, 2026
0fb823e
design: commit the mission boards' editable pen source
m4ttheweric Sep 18, 2026
75d73da
plan: mission-control TUI
m4ttheweric Sep 18, 2026
07d8cb1
protocol: mission intents with a payload field, golden fixtures
m4ttheweric Sep 18, 2026
f2d333b
fix: exact-bytes payload check in mission intent round-trip test
m4ttheweric Sep 18, 2026
d1754df
rt-ui: mission view skeleton behind an opt-in mouse session option
m4ttheweric Sep 18, 2026
b395fa7
rt-ui: mission wire model and golden fixture
m4ttheweric Sep 18, 2026
cc343ac
rt-ui: mission top bar with the adaptive action segment
m4ttheweric Sep 18, 2026
1f76b8d
rt-ui: pin action glyph colors and drop a task-id comment
m4ttheweric Sep 18, 2026
7dea41b
rt-ui: mission changes pane, commit box, and keybar
m4ttheweric Sep 18, 2026
4b85049
rt-ui: fix amend banner copy, de-task a comment, name the mixed glyph
m4ttheweric Sep 18, 2026
2a27e4c
rt-ui: mission diff pane with chroma highlighting and stage gutter
m4ttheweric Sep 18, 2026
cfa6458
rt-ui: mission diff keys resolve a valid selIdx before emitting
m4ttheweric Sep 18, 2026
64b95a9
rt-ui: mission modals over a dimmed parent in the picker idiom
m4ttheweric Sep 18, 2026
b9d6961
rt-ui: mission modals drop the raw bell byte and name the lock glyph
m4ttheweric Sep 18, 2026
fd8bfcf
rt-ui: mission mouse routing and hover states
m4ttheweric Sep 18, 2026
b2875db
mission: headless adaptive git action core
m4ttheweric Sep 18, 2026
b047563
mission: wire model builder with the golden fixture handshake
m4ttheweric Sep 18, 2026
b9152a1
mission: de-process a model.ts comment
m4ttheweric Sep 18, 2026
977f30f
mission: the driver intent loop
m4ttheweric Sep 18, 2026
db1230d
mission: driver answers new-row intents, survives handler errors, gua…
m4ttheweric Sep 18, 2026
8068e19
rt mission: command, gate, and registry wiring
m4ttheweric Sep 18, 2026
8a1d5fe
mission: live seed and worktree wiring polish
m4ttheweric Sep 18, 2026
50f4dd4
rt-ui: clip the undo strip and bound wheel routing to the body
m4ttheweric Sep 18, 2026
47c64f7
purity: neutralize a board repo name, rename a gate-colliding param, …
m4ttheweric Sep 18, 2026
44d38dd
docs: generated reference for rt mission
m4ttheweric Sep 18, 2026
6d2337d
rt-ui: mission modal headers, keybars, and amend button label
m4ttheweric Sep 18, 2026
4cbf26b
mission: derive repo modal groups from the repo identity
m4ttheweric Sep 19, 2026
376854d
mission: render wire notices, emit select on cursor moves, un-deadloc…
m4ttheweric Sep 19, 2026
95f777e
mission: real staging semantics seeded from the index state
m4ttheweric Sep 19, 2026
375a051
mission: filter changes, detached sha, discard disarm, badge and repo…
m4ttheweric Sep 19, 2026
871d7c8
mission: compose test over a real repo for the live core loop
m4ttheweric Sep 19, 2026
c99eba4
boards: re-export RepoPicker with the neutral repo name
m4ttheweric Sep 19, 2026
3de0224
mission driver: catch git-status refresh rejections, discard stale ba…
m4ttheweric Sep 19, 2026
775c41e
mission git-actions: scrub git repo-location env vars from spawned git
m4ttheweric Sep 19, 2026
1e550f0
mission fixture: align action meta wording with behind count
m4ttheweric Sep 19, 2026
d23d1ca
mission ui: fix width-budget clipping bugs in clip, hunk headers, and…
m4ttheweric Sep 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions commands/mission.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* rt mission: repos, changes, diff, and commit in one board. The command is the
* gate and the wiring; the loop and state machine live in lib/mission/driver.ts
* and the view paints in the bundled Go rt-ui helper.
*/
import type { CommandContext } from "../lib/command-tree.ts";
import { MissionDriver, type MissionDeps } from "../lib/mission/driver.ts";
import { runAction } from "../lib/mission/git-actions.ts";
import { interactive } from "../lib/ui/gate.ts";
import { exit, openSession } from "../lib/ui/spawn.ts";
import { SessionDied } from "../lib/runner/runner.ts";
import { createGitClient } from "../packages/git-core/src/index.ts";
import { daemonQuery, subscribeToDaemon } from "../lib/daemon-client.ts";
import { checkBranchGuard } from "../lib/branch-guard.ts";
import { commitStaged, amendStaged, stagePath, unstagePath } from "../lib/commit-ops.ts";

export async function missionCommand(_args: string[], ctx: CommandContext): Promise<void> {
if (!interactive()) {
process.stderr.write("rt mission needs an interactive terminal (it drives a live board from the one you are in)\n");
return exit(1);
}

if (!ctx.identity) {
process.stderr.write("not in a registered repo\n");
return exit(1);
}
const currentRepo = ctx.identity;
const currentWorktree = currentRepo.repoRoot;

const deps: MissionDeps = {
openSession,
client: (dir: string) => createGitClient(dir),
daemonQuery,
subscribe: subscribeToDaemon,
runAction,
commit: commitStaged,
amend: amendStaged,
guard: checkBranchGuard,
now: () => new Date(),
stageFile: stagePath,
unstageFile: unstagePath,
};

const driver = new MissionDriver(deps, {
repo: currentRepo.identity,
worktree: currentWorktree,
});

const onSignal = () => {
process.exit(130);
};
process.once("SIGINT", onSignal);
process.once("SIGTERM", onSignal);
process.once("SIGHUP", onSignal);

try {
await driver.run();
} catch (err) {
if (err instanceof SessionDied) {
process.stderr.write(`\n ${err.message}; the workspace was closed\n\n`);
return exit(1);
}
throw err;
} finally {
process.off("SIGINT", onSignal);
process.off("SIGTERM", onSignal);
process.off("SIGHUP", onSignal);
}
}
Binary file added docs/design/mission/ActionStates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/mission/BranchModal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/mission/DiffStates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/mission/InteractionStates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/mission/Main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/mission/Mouse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions docs/design/mission/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Mission-control design boards: the parity reference

These boards (PNG exports plus `mission.pen`, the editable pencil source) are
the signed-off visual contract for the rt mission-control session view
(2026-09-18). They are the standard the built TUI is scrutinized against:
reviews compare real terminal captures against these boards, surface by
surface, and deviations are either fixed in the TUI or ratified by updating
the board in the same change.

The design mirrors GitHub Desktop, verified against its source at the local
clone (app/src/ui: toolbar push-pull-button state machine, changes sidebar,
commit area, diff view, repository and branch foldouts), rendered in rt-ui's
own dialect: every color is a theme.go token role (never inline), picker row
and modal conventions carry over unchanged (HoverBg hover distinct from
SelBg cursor rows, Surface + Panel modal lift over a dimmed parent, no
shadows, no radii).

## Boards

- `Main.png`: the full view. Top bar (repo / worktree / branch segments plus
the adaptive action segment), changes pane, diff pane, commit box, keybar.
The repository segment and the changes sidebar share one locked width; the
divider runs unbroken through bar and body, and is not draggable.
- `ActionStates.png`: the adaptive action segment's complete state machine,
matching GitHub Desktop's exactly: Fetch, Pull (a diverged repo shows both
counts on the one Pull button; there is no combined pull-then-push state),
Push, Publish branch, Publish repository, Force push (recommended after
amend or rebase), in-progress. Wording rules: "Last fetched Xm ago" or
"Never fetched"; "Pull origin with rebase" when pull.rebase is set.
- `RepoPicker.png`: the repository foldout as an rt picker: grouped by host
and owner, fuzzy filter, badges per worktree (dirty count, ahead, behind,
clean check).
- `InteractionStates.png`: rest / hover / cursor / action-row treatments for
rows, segments, buttons, and the diff gutter's rest / hover-preview /
staged ladder.
- `BranchModal.png`: the branch foldout in context over the dimmed parent,
with current-branch marker, ahead/behind pills, guarded rows (branches
checked out in another worktree refuse checkout), section grouping, and a
new-branch action row.
- `WorktreeModal.png`: the worktree foldout (no GitHub Desktop analog): the
current worktree, per-tree badges, on-deck pool rows, provision action.
- `Mouse.png`: every mouse affordance by zone; hover always previews.
- `DiffStates.png`: expand up / down / all handles, binary and oversized
messages.

## Ratified deviations from GitHub Desktop

- `@@` hunk headers stay visible (terminal-native); the header row itself is
the hunk stage toggle. GitHub Desktop hides hunk text behind expand
handles and a hunk-handle gutter.
- Guarded checkout replaces the stash-and-switch dialog: rt's worktree model
refuses checkout of a branch owned by another worktree instead of offering
to move changes.
- Repository rows carry numeric badges where GitHub Desktop shows a dot plus
bare arrows.
- A worktree segment and foldout exist; GitHub Desktop has no worktree
surface.
- The History tab is deferred; the tab renders dimmed.

## Terminal-fidelity deltas (same set the picker ratified)

No drop shadows (modal lift = Surface token + Panel border + parent dim),
rounded corners only as box-drawing glyphs, 1-cell scrollbar thumb, fixed
cell line-height. Everything else on the boards is the contract: exact
tokens, glyphs, spacing rhythm, keybar grammar, and every interaction state.

## Ratified at the build's visual pass (2026-09-18)

Deviations the terminal build keeps deliberately; the boards show the
pre-ratification drawing:

- Top-bar segment icons sit on the value row (a glyph cell before the
value) instead of the boards' icon centered across both rows; the state
glyph family is the circle set (◉ current, ○ unchecked, ◪ mixed) rather
than the boards' squares, matching rt's picker language. The master row
uses the same ◪ for its mixed state.
- The undo strip is one line ("Committed <when> · <summary>" clipped to the
sidebar, Undo chip right) instead of the boards' two-line strip.
- The main keybar lists the built action set (adds "enter diff" and
"u undo", names the adaptive segment key "f action", omits "? help").
- The commit button renders the disabled treatment whenever the wire says
it cannot commit (empty summary); the boards draw the enabled pink for
visual reference.
- The diff gutter's hover-preview bar is the exact 0.5 Pink-to-Bg blend
(#8A3E60) via theme.GutterHoverBar; the boards' #8A4560 was hand-picked.
- Modal keybars list only wired keys: the boards' "ctrl-f fetch all"
(repo), "ctrl-w worktrees" (repo), and "ctrl-d dispose" (worktree) stay
off until those actions exist.
- A diverged current branch shows both count pills in the branch modal;
the board drew only the ahead pill for the current row.
Binary file added docs/design/mission/RepoPicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/mission/WorktreeModal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading