Skip to content

Add Repo Watch snapshot backend and web surface#185

Open
arach wants to merge 6 commits into
mainfrom
codex/repo-watch-snapshot
Open

Add Repo Watch snapshot backend and web surface#185
arach wants to merge 6 commits into
mainfrom
codex/repo-watch-snapshot

Conversation

@arach
Copy link
Copy Markdown
Owner

@arach arach commented Jun 3, 2026

Summary

  • add the SCO-061 Repo Watch backend contract and runtime snapshot scanner
  • expose /v1/repo-watch/snapshot through the broker and /api/repo-watch through the web server
  • add the Repos web surface — a Fleet Table operator console — plus a design-studio study and lightweight appearance settings controls

Web surface

The web view is one canonical design (not the earlier Ledger/Triage pair):

  • Fleet Table — every repo + worktree, grouped with an indented worktree tree, churn / drift / agents per row, sorted so unfinished work floats to the top; a clean-&-idle tray folds away quiet worktrees
  • Branch Drift — a fixed ±8-commit ruler plotting each worktree's distance from origin (behind ← origin → ahead)
  • Context pane — per-worktree drill-down: status, churn split-bar, changed files, last commit, attached agents
  • warm / cool / mono tone toggle, shared across all three via one .rw-scope ancestor

The surface is built for reuse: churn parsing, agent dedupe, worktree-state, and branch splitting are consolidated in scout/repo-watch/ui.ts (previously copy-pasted across all three components), a shared <BranchLabel> lives in parts.tsx, and one console.css styles every view. The /repos route + nav entry are wired in.

Verification

  • bun test packages/runtime/src/repo-watch.test.ts
  • npm --prefix packages/runtime run check
  • npm --prefix packages/web run build:client — passes (2,756 modules, ~23s)
  • tsc --noEmit — no errors in scout/repo-watch/ or ReposScreen (remaining repo-wide errors are pre-existing and unrelated)
  • live broker smoke: /v1/repo-watch/snapshot returned 8 projects / 12 worktrees in ~2.23s

Known Follow-Up

  • npm --prefix design/studio run build currently fails on an existing unrelated type error in app/studies/assistant/page.tsx comparing msg.who to "operator" when its type is "scout" | "you"
  • the design-studio Repo Watch study (design/studio/...) has further uncommitted edits on the working tree; intentionally left out of the web-surface commit

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

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

Project Deployment Actions Updated (UTC)
openscout Ready Ready Preview, Comment Jun 5, 2026 1:16am

Replace the Ledger/Triage components with one canonical design — a Fleet
Table, a Branch Drift ruler, and a Context pane — sharing a single
operator-console stylesheet and one set of derivations.

- Consolidate churn parsing, agent dedupe, worktree-state, and branch
  splitting into scout/repo-watch/ui.ts (was copy-pasted across all three
  components); add a shared <BranchLabel> in parts.tsx
- Flatten the components out of the designs/table/ staging path; rename
  table.css -> console.css and ContextPanel -> RepoWatchContext
- Drop the orphaned RepoWatchLedger + RepoWatchTriage and ~80 lines of
  dead inline-drilldown CSS
- Extract usePersistedState for the tone/view toggles in ReposScreen
- Wire the /repos route + nav entry; add the Play 500 font weight
Addresses the Codex review on PR #185.

- fix inverted default sort: attention column scored critical highest but
  defaulted to ascending, sinking critical worktrees to the bottom; default
  to descending and couple the initial sortDir to the key
- count "needs attention" as the backend's critical OR attention levels
  (was conflicts/errors/critical only, missing dirty-main / diverged)
- stop rendering the detached short SHA twice in the table
- context pane: say "no line changes" (not "working tree clean") for dirty
  trees with no +/- churn (untracked-only, rename/mode, binary)
- guard the usePersistedState localStorage read against throwing engines
- flag diverged branches as DIVERGED in the Drift view (ahead no longer
  wins over a needed rebase)
- drop dead ui.ts exports left from the removed Ledger/Triage surface
  (ATTENTION_ORDER, agentLabel, aheadBehind, isConflict)
@arach arach marked this pull request as ready for review June 5, 2026 01:06
Studio-only (design/studio) — the SCO-061 design exploration, not the
shipping web surface.

- rebuild the Ledger study from the dense "ssh ledger" into a calm card
  inventory in the app's own vocabulary: repo sections over lifted
  surfaces, no dividers, plain-English rows; clean checkouts fold away,
  idle repos drop to a quiet tray, per-machine ignore
- retune the mock snapshot to resemble the real machine (~8 mostly
  single-worktree, calm repos) instead of an artificially busy fixture;
  add live/idle/tail agent factories
- soften the "attention" level tone (ink on neutral, not warn)
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