Skip to content

feat(worktree-panel): wire panel to real wtcraft status --json#2

Open
zywkloo wants to merge 1 commit into
developfrom
feat/panel-real-data
Open

feat(worktree-panel): wire panel to real wtcraft status --json#2
zywkloo wants to merge 1 commit into
developfrom
feat/panel-real-data

Conversation

@zywkloo

@zywkloo zywkloo commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Replaces the fixture data source in the Worktrees panel with a real client that shells out to wtcraft status --json --repo <path> (machine protocol v1, shipped in wtcraft 0.4.2) and renders live stage/role/agent/verify per worktree. Closes the headline debt in docs/debts.md (D1–D3, D5).

Changes

  • WtcraftCliWorktree — wire DTO for the real bare-array, snake_case status --json shape (D2/D3). Registered for source-gen JSON.
  • CliWtcraftClient — async shell-out; maps the array into WtcraftWorktreeState. Degrades to null (→ git-native fallback) when wtcraft is missing, too old to support --json (prints a human table), exits non-zero, or returns non-JSON (D5).
  • IWtcraftClient is now async (GetSnapshotAsync); the fetch runs off the UI thread in RefreshWorktrees, and the snapshot is applied on the UI thread — a subprocess call must not block the UI.
  • FixtureWtcraftClient kept as a test/demo fallback.

Deferred (debts D4)

Alarms and SessionState render empty: status --json carries neither. They await observe --json (core-computed alarms) and a .worktree-session.json writer.

Verification

  • dotnet build SourceGit.slnx — 0 warnings, 0 errors
  • dotnet format --verify-no-changes — clean
  • DTO field names verified against real 0.4.2 status --json output (all 16 keys covered)
  • ⚠️ Live GUI check pending a 0.4.2 wtcraft on the active PATH (D6, environment).

🤖 Generated with Claude Code

Replace the fixture data source with CliWtcraftClient, which shells out to
`wtcraft status --json --repo <path>` (machine protocol v1) and maps the
bare-array output into the panel's WtcraftWorktreeState.

- WtcraftCliWorktree: wire DTO for the real snake_case bare-array shape
- CliWtcraftClient: async shell-out; degrades to null (git-native fallback) on
  missing/old wtcraft, non-zero exit, or non-JSON output (old builds print a
  human table)
- IWtcraftClient is now async (GetSnapshotAsync); the fetch runs off the UI
  thread in RefreshWorktrees and the snapshot is applied on the UI thread
- FixtureWtcraftClient kept as a test/demo fallback

Alarms and SessionState are deferred (debts D4): status --json carries neither;
they await observe --json and a .worktree-session.json writer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.

1 participant