Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Done

- **Branch / head SHA**: `alanvardy-var-1179-make-an-rd-fish-function` @
`75b392ac` (`chore: record implement artifacts for VAR-1179`); in sync with
`origin` (`git rev-list --left-right --count HEAD...origin/...` → `0 0`).
HEAD is rebased on `main` (`46844600`); no conflicts were present.
Phase 2 (`rd.fish`) is on dotfiles `main` @ `1ba21e5` — not on this branch.

- **Mechanical checks** (all pass, shell-only diff):
- `bash -n scripts/run-devices.sh` — OK
- `bash -n scripts/test-run-devices.sh` — OK
- `shellcheck -S warning --exclude=SC1111 scripts/run-devices.sh` — OK
- `shellcheck -S warning --exclude=SC1111 scripts/test-run-devices.sh` — OK
- `bash scripts/test-run-devices.sh` — all pass, including the two new duo
filter assertions and the happy/sad duo flow cases.
- No warnings flagged. The full iOS gate was not re-run here: the diff is
shell-only and `scripts/test-run-devices.sh` is not wired into
`scripts/test.sh`; the plan's post-plan gate remains the regression check.

- **Review outcome**: one bounded `reviewer` pass over the full diff + dotfiles
wrapper. **No blockers, no fixes worth doing now.** Verified independently:
env-parse ordering/opt-back-in is sound under `set -euo pipefail`; duo reuses
the Duo-only discovery filter and the `!= "sim"` zero-device fail-fast;
sim/watch/macOS legs are skipped; summary and toast never mislabel the leg or
print `0 simulator(s)`; the new negative assertions are non-vacuous (their
grepped strings exist in `run-devices.sh`).
- Optional improvements applied at the user's request:
(1) duo-mode no-device errors now read "No reachable iPhone Duo found."
and the `RUN_MAC=1` hint says "no reachable iPhone Duo found" — the shared
`iPhone/iPad` wording was actively misleading in duo mode, which filters
out a paired regular iPhone (`run-devices.sh:286-298`); the sad-path flow
test asserts the new string. (2) added `duo toast omits the simulator
count`, closing the regression gap where `and 0 simulator(s)` could return
unnoticed. Both validated with `bash -n`, `shellcheck -S warning
--exclude=SC1111`, and `bash scripts/test-run-devices.sh` (EXIT=0, 0
failures).
- Optional items left as-is (intentional per plan): the "no physical iPhone
Duo found" notice remains `== "sim"` only; `IOS_TARGET=duo RUN_MAC=1` with
no Duo still runs macOS (now with the Duo-specific hint from #1).

- **Remaining manual items**: the plan's on-device checks were not exercised
(no physical Duo in this session) — with the Duo paired/reachable,
`IOS_TARGET=duo ./scripts/run-devices.sh` should build/install/launch only
the Duo and print `iPhone Duo (device): 1/1 launched, 0 unreachable`; with no
Duo it should exit non-zero without touching sim/watch/macOS; and
`IOS_TARGET=duo RUN_WATCH=1 RUN_MAC=1` should re-enable those legs
(plan.md Verification → Manual). Post-plan gate (`./scripts/test.sh` via the
`run-gate` skill) is still outstanding if a regression check is wanted.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Implementation Summary

## Commits
| Phase | Commit | Description |
|-------|--------|-------------|
| — | `2c3a908c` | chore: remove DELETEME marker (bootstrap cleanup) |
| 1 | `c7e47030` | Phase 1: IOS_TARGET=duo end-to-end in run-devices.sh |

Phase 1 is on the ticket branch `alanvardy-var-1179-make-an-rd-fish-function`
(`SingleThread` repo, pushed to origin).

Phase 2 is a separate repo/commit (dotfiles allows direct commits to `main`):

| Phase | Commit | Description |
|-------|--------|-------------|
| 2 | `1ba21e5` | feat(fish): add rd for the Duo-only run-devices mode |

Phase 2 is on `~/dev/dotfiles` `main` (pushed `98b4dc2..1ba21e5`), not the
ticket branch.

## Automated Checks
- [x] `bash -n scripts/run-devices.sh` passed
- [x] `shellcheck -S warning --exclude=SC1111 scripts/run-devices.sh` passed
- [x] `bash scripts/test-run-devices.sh` passed, including the new
`duo mode emits only the physical Duo`, `duo mode excludes the regular
physical iPhone`, `flow: IOS_TARGET=duo installs only the iPhone Duo`
(+ sub-checks: no sim boot, no watch build, no macOS build, skipped
watch/macOS legs both reported) and `flow: IOS_TARGET=duo with no Duo
fails fast`
- [x] `rg -n 'test-run-devices' Makefile scripts/test.sh` still returns nothing
(no gate wiring needed)
- [x] `fish --no-execute ~/dev/dotfiles/fish/functions/rd.fish` reported no
syntax error
- [x] No dotfiles test targets exist (`ls ~/dev/dotfiles` shows no
`scripts/test.sh`)

Scope note: the `duo` filter reuses the existing `mode != "device"` branch
unchanged — no Python edit was needed (Phase 1 changed only
`scripts/run-devices.sh` + `scripts/test-run-devices.sh`; Phase 2 created only
`fish/functions/rd.fish`).

## Manual Verification Items (from the plan)
- [ ] With the physical Duo paired and reachable:
`IOS_TARGET=duo ./scripts/run-devices.sh` builds/installs/launches only the
Duo, prints `iPhone Duo (device): 1/1 launched, 0 unreachable`, and shows no
simulator boot, no watch build, no macOS build.
- [ ] With the Duo unpaired/unreachable, `IOS_TARGET=duo ./scripts/run-devices.sh`
exits non-zero with `No reachable iPhone/iPad found.` (or the unreachable
message) without touching sim/watch/macOS.
- [ ] `IOS_TARGET=duo RUN_WATCH=1 RUN_MAC=1 ./scripts/run-devices.sh` still
allows the watch/macOS legs (the opt-back-in path).
- [ ] From a SingleThread worktree, `rd` builds/installs/launches only the Duo
and prints the duo summary (same result as
`IOS_TARGET=duo ./scripts/run-devices.sh`).
- [ ] `functions rd` shows the function loaded from
`~/.config/fish/functions/rd.fish`.

## Post-plan gate (parent / review step)
- [ ] Run the full CI-identical gate via the `run-gate` skill
(`./scripts/test.sh`: build + lint + Periphery + unit + UI) once after the
phases commit. The change is shell-only, so this is a regression check.
- [ ] `./scripts/test-run-devices.sh` is not part of `scripts/test.sh`; run it
directly in the gate worktree as well.
- [ ] Confirm the ticket branch has no `DELETEME` before merge (it is already
removed by `2c3a908c`) and that the dotfiles commit is on `main` (not the
ticket branch) — verified: dotfiles `1ba21e5` is on `main`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Task

Add an `rd` fish function that builds, installs, and launches SingleThread **on
the physical iPhone Duo only** — skipping the regular iPhone/iPad simulator
legs, the Apple Watch leg, and the macOS leg. `r` is the current full-run
wrapper (`r.fish` → `./scripts/run-devices.sh`); `rd` is the narrow Duo-only
sibling.

Concretely:

1. **`rd` fish function.** Fish functions live in
`~/dev/dotfiles/fish/functions/*.fish` (that directory is symlinked to
`~/.config/fish/functions`), so add `rd.fish` there, following `r.fish`:
`function rd --wraps=./scripts/run-devices.sh --description '…'` then invoke
`./scripts/run-devices.sh` with whatever env selects the Duo-only mode below.
2. **A Duo-only mode on `scripts/run-devices.sh`.** Today there is no way to do
this:
* `IOS_TARGET=sim` (default) runs the sim iPhone/iPad legs **and** the
physical Duo **and** the watch **and** macOS.
* `IOS_TARGET=device` sweeps **every** paired physical iPhone/iPad and
ignores `DUO_DEVICE_ID` (the embedded Python only honours it when
`mode != "device"`, run-devices.sh ~line 239).
* `RUN_WATCH=0` / `RUN_MAC=0` exist, but nothing skips the sim legs.
Add the smallest flag that yields Duo-only (e.g. an `IOS_TARGET=duo` value,
or make `DUO_DEVICE_ID` filter in `device` mode), document it in the header
override block, and fix the summary so it reports the Duo leg honestly
instead of printing a 0/0 sim line.
3. **Update `scripts/test-run-devices.sh`** (the existing `run_flow` / fixture
harness): cover the new mode — a happy path that installs only the Duo and a
sad path (no/unreachable Duo), without regressing the `sim` / `device`
flows. Reuse `DEVICES_JSON_IN` and `scripts/fixtures/devicectl-devices.json`.

Why: the user wants a one-command "push this build to my phone" loop without
paying the sim + watch + macOS build/launch cost on every run.

## Why MEDIUM

M1 holds: approach known (wrap `run-devices.sh` exactly like `r.fish`, extend
the existing `IOS_TARGET` env pattern), 0–2 unknowns, no new technology — no
schema/migration, no new subsystem, no product trade-off. M2 holds: no
data-model/API/UI change; the only choices (flag shape, whether `rd` builds from
scratch or reuses `DerivedData`) are scoped and precedented by VAR-1175's
`IOS_TARGET` work. M3 holds: **MULTI_MODULE** (`scripts/run-devices.sh` +
`scripts/test-run-devices.sh` + the dotfiles `rd.fish`, i.e. two repositories)
and **BROAD_TEST_SURFACE** (the flow harness must gain a mode variant and a
sad-path case).

## Key files

* `scripts/run-devices.sh` (~540 lines) — the change surface: header override
block (~lines 12–28), `IOS_TARGET`/`DUO_DEVICE_ID` env parsing (~72–76), the
embedded Python discovery filter where `device` mode ignores `DUO_DEVICE_ID`
(~211–263), the sim leg gated on `IOS_TARGET == "sim"` (~319–374), the Duo
device loop (~390–434), the watch/macOS legs, and the summary (~510+).
* `scripts/test-run-devices.sh` (~310 lines) — `extract_filter()`, `run_flow()`,
and the `IOS_TARGET=sim` / `IOS_TARGET=device` flow assertions to extend.
* `scripts/fixtures/devicectl-devices.json` — inventory fixture (contains the
physical `Fixture iPhone Duo` plus sim entries).
* `~/dev/dotfiles/fish/functions/r.fish` — the wrapper pattern to copy.
* `~/dev/dotfiles/fish/functions/` — where `rd.fish` must be created (symlinked
as `~/.config/fish/functions`).
* `.pi/orksorksorks/alanvardy-var-1175-run-the-regular-iphone-and-ipad-legs-in/`
— the prior `IOS_TARGET` ticket's plan/medium artifacts: the naming and
toggle conventions this change should mirror.
* `Makefile` / `scripts/test.sh` — check whether the new mode needs a
`-only-testing` / gate entry (the flow tests live outside the Xcode gate).
Loading