Skip to content

(MOT-3893) chore(harness): tmux-based local dev stack in Makefile - #437

Merged
ytallo merged 1 commit into
mainfrom
chore/harness-dev-makefile
Jul 7, 2026
Merged

(MOT-3893) chore(harness): tmux-based local dev stack in Makefile#437
ytallo merged 1 commit into
mainfrom
chore/harness-dev-makefile

Conversation

@ytallo

@ytallo ytallo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Rewrites harness/Makefile from a build-and-symlink script into a tmux-based local dev workflow for the full worker stack.

What changed

  • make dev-up starts the engine (iii -c harness/engine.config.yaml) plus the full stack (iii-directory, llm-router, session-manager, context-manager, providers, shell, web, harness, approval-gate, console), each in its own tmux window, waits for engine readiness, and prints status.
  • make restart <worker...> rebuilds and respawns selected workers via cargo run; WORKTREE_ROOT=.worktrees/<branch> runs a worker from a feature worktree while the rest stay on the main tree.
  • make stop <worker...> / stop-work / stop-engine / dev-down for teardown; status, smoke, where, logs for inspection; make help is the new default goal.
  • Guards: refuses to start the engine if the port already has a listener (protects a live stack), validates worker names against the stack list, and require-engine verifies reachability before restarts.
  • build / install-local keep the old build-and-symlink flow, now scoped to selected workers and worktree-aware.

Test plan

  • make dev-up boots engine + stack in tmux, wait-engine gates on readiness
  • make restart harness WORKTREE_ROOT=.worktrees/<branch> respawns from the worktree
  • engine-port guard exits with a clear message when another engine is listening
  • make smoke probes engine/harness/router triggers

Fixes MOT-3893

Summary by CodeRabbit

  • New Features

    • Added a more complete local development workflow with commands to start, stop, restart, inspect, and attach to the environment.
    • Added a help menu and clearer setup/status checks for running components.
  • Bug Fixes

    • Improved build and install behavior so only selected components are prepared and linked.
    • Added validation to catch missing or unknown components earlier.

Replaces the build-and-symlink script with a tmux dev workflow:
dev-up brings up engine + full worker stack, restart <worker...>
rebuilds selected workers (worktree-aware via WORKTREE_ROOT),
plus stop/status/smoke/where helpers and an engine-port guard.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 7, 2026 2:45am
workers-tech-spec Ready Ready Preview, Comment Jul 7, 2026 2:45am

Request Review

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 35 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The harness/Makefile is rewritten from a minimal worker build/link/restart helper into a full tmux-driven local development harness controller. It introduces configurable stack/port/profile defaults, engine lifecycle management, worker restart/stop targets, and diagnostic commands (status, smoke, logs, where).

Changes

Harness Makefile Orchestration

Layer / File(s) Summary
Stack configuration and help menu
harness/Makefile
New configurable defaults for ports/URLs/profile/tmux session, computed selected/unknown worker stack from make goals, updated .DEFAULT_GOAL/.PHONY, new help target, and a pattern rule for stack goals.
Build, install, and clean
harness/Makefile
install-iii-next, build, and install-local targets validate manifests, cargo-build the selected stack, and symlink binaries into ~/.iii/workers; clean now removes symlinks stack-wide.
tmux session and engine startup
harness/Makefile
ensure-session, engine, wait-engine, and require-engine manage tmux session creation, engine window startup with port checks, readiness polling, and reachability verification.
Worker restart and stop lifecycle
harness/Makefile
restart/restart-worker build cargo-run commands and manage worker tmux windows; dev-up/dev-down/dev-restart wrap stack operations; stop/stop-worker/stop-work/stop-engine selectively kill tmux windows.
Status, smoke test, logs, and inspection
harness/Makefile
status and smoke probe engine/functions/providers via iii trigger; logs/attach attach to the tmux session; where prints repo/worker roots, git refs, and tmux window inventory.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Make as Makefile
    participant Tmux
    participant Engine as iii Engine

    Developer->>Make: make dev-up
    Make->>Make: ensure-session
    Make->>Tmux: create session (if missing)
    Make->>Tmux: start/respawn engine window
    Make->>Engine: iii trigger engine::workers::list (poll)
    Engine-->>Make: readiness response
    Make->>Tmux: respawn worker windows (restart-worker)
    Tmux-->>Engine: cargo run worker processes
    Make->>Make: status
    Make->>Engine: iii trigger engine::workers::list
    Engine-->>Make: worker status
    Make-->>Developer: print console URL and attach command
Loading

Poem

A rabbit taps make with a hop and a cheer,
Tmux windows bloom, the engine draws near,
Workers awake from their cargo-built sleep,
Status and smoke tests, promises to keep,
One burrow, one Makefile, orchestration complete! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a tmux-based local dev harness implemented in harness/Makefile.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/harness-dev-makefile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
harness/Makefile (1)

80-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

status may report a partial/empty worker list right after restart.

restart $(STACK) only creates/respawns the tmux windows; the cargo run builds compile and workers register asynchronously. Running status immediately afterward can print an incomplete list, which is misleading for a readiness summary. Consider polling for the expected worker count (similar to wait-engine) before printing, or note that status reflects a point-in-time snapshot.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/Makefile` around lines 80 - 84, The readiness summary in dev-up is
calling status immediately after restart, so it can print a partial worker list
before the tmux windows and cargo run workers finish registering. Update dev-up
to wait for the expected workers to appear before invoking status, ideally by
reusing or extending the wait logic in wait-engine, or otherwise make the status
output explicitly a point-in-time snapshot. Keep the change centered on dev-up,
restart, status, and wait-engine so the readiness output is accurate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@harness/Makefile`:
- Around line 80-84: The readiness summary in dev-up is calling status
immediately after restart, so it can print a partial worker list before the tmux
windows and cargo run workers finish registering. Update dev-up to wait for the
expected workers to appear before invoking status, ideally by reusing or
extending the wait logic in wait-engine, or otherwise make the status output
explicitly a point-in-time snapshot. Keep the change centered on dev-up,
restart, status, and wait-engine so the readiness output is accurate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7a1ea49-01c4-4f9e-b639-3f6543aeabef

📥 Commits

Reviewing files that changed from the base of the PR and between 3a826b5 and 49798f3.

📒 Files selected for processing (1)
  • harness/Makefile

@ytallo
ytallo merged commit 9a1d8a8 into main Jul 7, 2026
39 checks passed
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