aboutsummaryrefslogtreecommitdiff
path: root/mcp/README.org
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-19 20:47:44 -0500
committerCraig Jennings <c@cjennings.net>2026-07-19 20:47:44 -0500
commit2b619f1769cae4a96202ca521a9ed4a9db65bc8f (patch)
tree069e35cd322e6b99a18b3b0ceea81edf09ba2959 /mcp/README.org
parent113e8d868fdd95b269c0cc2ce4ec265aa76b539c (diff)
downloadrulesets-2b619f1769cae4a96202ca521a9ed4a9db65bc8f.tar.gz
rulesets-2b619f1769cae4a96202ca521a9ed4a9db65bc8f.zip
refactor(ai-launcher): extract pure decision cores from the git/tmux paths
I moved the decision logic out of the launcher's I/O-coupled functions so it's unit-testable on plain inputs, the hardening the audit called for. Three pure cores now carry logic that was buried in git and tmux calls: _git_prep_action classifies a repo's state into none/pull/report, _order_windows sorts the window listing, and _match_window_id resolves a name to a window id. _git_is_dirty replaces the staged/unstaged/untracked check that was copy-pasted across three functions. prep_git_single and auto_pull_if_clean both route their pull-or-report choice through _git_prep_action, so the "never auto-pull a dirty repo" rule lives in one place with its own test instead of two parallel branches. sort_windows keeps its two-pass move (park high, then reassign) but hands the ordering to _order_windows, and find_window_id is now a thin tmux wrapper over _match_window_id. Each core gets a Normal/Boundary/Error set: the git-prep truth table including diverged and behind-while-dirty, the window ordering including whole-line-not-substring matching. The 42 launcher tests stay green and a live black-box run still prints the right launch command for claude and codex, so the extraction is behavior-neutral. I also ran shfmt (-i 2 -ci) to match the house style the other bin/ scripts follow.
Diffstat (limited to 'mcp/README.org')
0 files changed, 0 insertions, 0 deletions