feat(worktree-panel): wire panel to real wtcraft status --json#2
Open
zywkloo wants to merge 1 commit into
Open
feat(worktree-panel): wire panel to real wtcraft status --json#2zywkloo wants to merge 1 commit into
zywkloo wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 indocs/debts.md(D1–D3, D5).Changes
WtcraftCliWorktree— wire DTO for the real bare-array, snake_casestatus --jsonshape (D2/D3). Registered for source-gen JSON.CliWtcraftClient— async shell-out; maps the array intoWtcraftWorktreeState. Degrades tonull(→ git-native fallback) when wtcraft is missing, too old to support--json(prints a human table), exits non-zero, or returns non-JSON (D5).IWtcraftClientis now async (GetSnapshotAsync); the fetch runs off the UI thread inRefreshWorktrees, and the snapshot is applied on the UI thread — a subprocess call must not block the UI.FixtureWtcraftClientkept as a test/demo fallback.Deferred (debts D4)
AlarmsandSessionStaterender empty:status --jsoncarries neither. They awaitobserve --json(core-computed alarms) and a.worktree-session.jsonwriter.Verification
dotnet build SourceGit.slnx— 0 warnings, 0 errorsdotnet format --verify-no-changes— cleanstatus --jsonoutput (all 16 keys covered)wtcrafton the active PATH (D6, environment).🤖 Generated with Claude Code