Skip to content

fix: wire watch/triage CLI command + add wiring regression test#238

Closed
tamirdresher wants to merge 10 commits intobradygaster:devfrom
tamirdresher:fix/persistent-ralph-watch
Closed

fix: wire watch/triage CLI command + add wiring regression test#238
tamirdresher wants to merge 10 commits intobradygaster:devfrom
tamirdresher:fix/persistent-ralph-watch

Conversation

@tamirdresher
Copy link
Copy Markdown
Collaborator

Summary

Wire the watch/triage CLI command to its actual implementation (watch.ts) instead of printing a placeholder message. Also adds a regression test to prevent this class of bug from recurring.

Changes

  • cli-entry.ts: Replace placeholder console.log('pending') for triage/watch with real import('./cli/commands/watch.js') call
  • cli-entry.ts: Fix syntax error in upstream help text (doubled backticks causing TS compile failure)
  • test/cli-command-wiring.test.ts: New regression test (3 assertions):
    1. Every .ts file in commands/ has a corresponding import in cli-entry.ts (excluding known-unwired bug: 6 CLI commands implemented but not wired into cli-entry.ts #237)
    2. No new placeholder "pending" routing blocks
    3. Known-unwired allowlist only contains commands that are actually unwired (shrinks over time)

Context

This is the third instance of the "implemented but not wired" pattern:

The regression test ensures no new commands can be added without wiring.

Testing

  • vitest run test/cli-command-wiring.test.ts — 3/3 pass
  • vitest run test/ralph-*.test.ts — 59/59 pass
  • npm run build — clean

Fixes #236

jsturtevant and others added 10 commits March 4, 2026 20:03
- Register consult and extract commands in cli-entry.ts with help text
- Add docs/features/consult-mode.md with full command reference
- Update docs/guide/personal-squad.md to reference consult mode
- Add happy-path E2E tests (init global → consult → status → extract)
- Add acceptance test features for consult and extract commands

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ster#196)

runShell() hardcoded teamRoot to process.cwd(), ignoring the global
(personal) squad path. Now uses a fallback chain:
1. Walk up from cwd for local .squad/
2. Check global squad path (resolveGlobalSquadPath)
3. Fall back to cwd (triggers init mode)

Closes bradygaster#196

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Feature files referenced old output strings ("Getting Started",
"Here:", "Scaffold ready") that no longer exist in the CLI help,
status, and init output. Updated to match actual output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix runtime crash by declaring @opentelemetry/api as required dependency
feat: wire up consult mode CLI + fix global squad resolution (bradygaster#196)
The upstream command (add/remove/list/sync) was fully implemented in
upstream.ts but never registered in cli-entry.ts. Running 'squad upstream'
returned 'Unknown command'.

Closes bradygaster#224

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-wiring

fix: wire upstream command into CLI entry point
- Replace placeholder 'pending' message for triage/watch with real
  import of watch.ts runWatch() function
- Fix syntax error in upstream help text (doubled backticks)
- Add regression test (cli-command-wiring.test.ts) that verifies all
  command files in commands/ have corresponding cli-entry.ts routing
- Test tracks known-unwired commands (bradygaster#237) separately and will catch
  any NEW unwired commands immediately

Fixes bradygaster#236

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
)

- Wire aspire command: squad aspire [--port N]
- Wire rc/remote-control command: squad rc [--tunnel] [--port N]
- Wire link command: squad link <team-repo-path>
- Add help text for all three commands
- Update regression test: move aspire/rc/link out of KNOWN_UNWIRED set
- Remaining KNOWN_UNWIRED are helper modules (copilot-bridge, init-remote,
  rc-tunnel) that are used internally, not direct CLI commands

Tests: 199/199 unit tests pass (3 wiring + 196 related tests)

Fixes bradygaster#237

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster changed the base branch from main to dev March 7, 2026 14:45
@bradygaster
Copy link
Copy Markdown
Owner

Hi @tamirdresher — thanks for this PR! Great work identifying the unwired-command pattern and building the regression test.

However, this PR is now superseded by work already on \dev.

Our PR #244 (\ ix: wire missing CLI commands into cli-entry.ts) landed on \dev\ and covers nearly all the same ground:

  • aspire, rc, link command wiring — all wired in fix: wire missing CLI commands into cli-entry.ts #244
  • Doubled-backtick syntax fix — resolved (the upstream help line was refactored)
  • cli-command-wiring.test.ts — our version already exists on \dev\ (different implementation, same concept — your idea inspired ours)
  • Help text for watch, rc, link, aspire — all added in fix: wire missing CLI commands into cli-entry.ts #244
  • ⚠️ watch/triage actual wiring (replacing the stub with
    unWatch) — this is the one piece not yet on \dev. We'll track this as a follow-up.

After retargeting to \dev, this PR has 5 merge conflicts (cli-entry.ts, cli-command-wiring.test.ts, plus 3 files from main/dev branch divergence). Given the heavy overlap, resolving those conflicts would essentially rewrite the PR.

Closing this as superseded. The watch/triage wiring gap will be addressed separately. Thank you for the contribution — your regression test approach directly influenced our implementation! 🙏

@bradygaster bradygaster closed this Mar 7, 2026
tamirdresher added a commit to tamirdresher/squad that referenced this pull request Mar 8, 2026
Both commands had full implementations (upstream.ts, watch.ts) but were
not routed in cli-entry.ts — the recurring 'unwired command' bug class
(issues bradygaster#224, bradygaster#236, bradygaster#237).

- upstream: add import + routing block for upstreamCommand()
- triage/watch: replace placeholder stub with actual runWatch() call
- help text: add upstream command description
- test: clear KNOWN_UNWIRED set (all commands now wired)

Root cause: Brady's cli-entry.ts rewrite (v0.8.21-0.8.23) overwrote
the wiring added in PRs bradygaster#225 and bradygaster#238.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher added a commit to tamirdresher/squad that referenced this pull request Mar 8, 2026
Both commands had full implementations (upstream.ts, watch.ts) but were
not routed in cli-entry.ts — the recurring 'unwired command' bug class
(issues bradygaster#224, bradygaster#236, bradygaster#237).

- upstream: add import + routing block for upstreamCommand()
- triage/watch: replace placeholder stub with actual runWatch() call
- help text: add upstream command description
- test: clear KNOWN_UNWIRED set (all commands now wired)

Root cause: Brady's cli-entry.ts rewrite (v0.8.21-0.8.23) overwrote
the wiring added in PRs bradygaster#225 and bradygaster#238.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher added a commit to tamirdresher/squad that referenced this pull request Mar 8, 2026
Both commands had full implementations (upstream.ts, watch.ts) but were
not routed in cli-entry.ts — the recurring 'unwired command' bug class
(issues bradygaster#224, bradygaster#236, bradygaster#237).

- upstream: add import + routing block for upstreamCommand()
- triage/watch: replace placeholder stub with actual runWatch() call
- help text: add upstream command description
- test: clear KNOWN_UNWIRED set (all commands now wired)

Root cause: Brady's cli-entry.ts rewrite (v0.8.21-0.8.23) overwrote
the wiring added in PRs bradygaster#225 and bradygaster#238.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher added a commit to tamirdresher/squad that referenced this pull request Mar 8, 2026
Both commands had full implementations (upstream.ts, watch.ts) but were
not routed in cli-entry.ts — the recurring 'unwired command' bug class
(issues bradygaster#224, bradygaster#236, bradygaster#237).

- upstream: add import + routing block for upstreamCommand()
- triage/watch: replace placeholder stub with actual runWatch() call
- help text: add upstream command description
- test: clear KNOWN_UNWIRED set (all commands now wired)

Root cause: Brady's cli-entry.ts rewrite (v0.8.21-0.8.23) overwrote
the wiring added in PRs bradygaster#225 and bradygaster#238.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster pushed a commit that referenced this pull request Mar 8, 2026
* fix: wire upstream and watch/triage commands in cli-entry.ts

Both commands had full implementations (upstream.ts, watch.ts) but were
not routed in cli-entry.ts — the recurring 'unwired command' bug class
(issues #224, #236, #237).

- upstream: add import + routing block for upstreamCommand()
- triage/watch: replace placeholder stub with actual runWatch() call
- help text: add upstream command description
- test: clear KNOWN_UNWIRED set (all commands now wired)

Root cause: Brady's cli-entry.ts rewrite (v0.8.21-0.8.23) overwrote
the wiring added in PRs #225 and #238.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: make tests resilient to team rebirths (name-agnostic assertions)

Tests that read live .squad/team.md and .squad/routing.md were hardcoding
agent names (Fenster, Keaton, Hockney). Every time Brady renames the squad
(e.g., Usual Suspects → Apollo 13), these tests break.

Fixed by making live-file tests assert structure and behavior, not names:
- parseRoster(): verify properties exist, not specific member names
- parseRoutingRules(): verify structure, emoji presence, not agent strings
- parseModuleOwnership(): verify shape, not which agent owns which module
- triageIssue(): verify source/confidence, not which agent was selected

Tests with inline fixtures (hardcoded test data) still assert specific
names — those are self-contained and don't break on rebirths.

Also bumps speed-gates line count budget for upstream help text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jongio pushed a commit to jongio/squad that referenced this pull request Mar 9, 2026
* feat: SDK-based agent spawning infrastructure (bradygaster#238)

Adds src/cli/shell/spawn.ts with:
- loadAgentCharter(): loads charter from .squad/agents/{name}/charter.md
- buildAgentPrompt(): constructs system prompt from charter + optional context
- spawnAgent(): spawn lifecycle (load charter, register session, build prompt)
- Types: SpawnOptions, SpawnResult, ToolDefinition

All exported from src/cli/shell/index.ts barrel.

SDK session creation is stubbed — CopilotClient session API wiring comes in
a follow-up. This provides the spawn infrastructure for bradygaster#239, bradygaster#241.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update fenster history and spawn infra decision

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

feat: persistent Ralph — wire squad watch + enable heartbeat cron

4 participants