feat(agent-team): cleaner retry-loop display + human-readable task history #59

Merged
amoussa1229 merged 1 commit from feature/agent-team-dashboard-polish into main 2026-06-24 16:50:12 +00:00
amoussa1229 commented 2026-06-24 01:15:24 +00:00 (Migrated from github.com)

What

Two dashboard-SPA refinements raised after first use of the WebUI (stacked on feat/agent-team-plan-gate). Frontend-only — no Python / coordinator / ledger / migration change.

1. Cleaner retry-loop display (no more "circular arrows")

The pipeline's two real retry loops (plan⇄review revise, build⇄verify retry) were drawing a backward edge on top of the forward edge → read as ugly circles. Now:

  • Loop-back edges are excluded from the default render and from the dagre layout (clean forward flow).
  • The source node (Review/Verify) shows a small ↺ chip with a tooltip (“can send work back to …”).
  • The actual return arc is drawn only when a selected task actually looped it — detected from the task's task_transitions timeline (a back-step where dst appears after src) — and highlighted along that task's path.

2. Human-readable Q&A / Review Verdicts / Plan

Replaced the <pre>{JSON.stringify(...)}</pre> blobs with structured, rendered sections via react-markdown:

  • Plan → summary (markdown) + phase list with nested steps (+ any extra scalar keys).
  • Review verdicts → one card each: verdict badge + round + outcome, then findings rendered (bold, numbered lists).
  • Q&A → per-turn cards; handles both string and {turn, answer} dict shapes.

Security

react-markdown is used without rehype-raw, so raw HTML embedded in (semi-trusted) agent text is escaped to text, never executed — no dangerouslySetInnerHTML. A test asserts an <img onerror> in findings renders as text (no element). Consistent with the dashboard's existing XSS-safe posture. No new untrusted-input/auth/IaC surface → mandatory /sh-security-review does not apply.

Tests

16 frontend tests pass (Vitest + RTL): loopback default-off / on-when-looped / loopBackTo populated; markdown bold rendering; plan phase/step lists; string+dict Q&A; the no-raw-HTML XSS guard. Typecheck + vite build clean.

Notes

  • Base = feat/agent-team-plan-gate (stacked); it already contains the WebUI makeover files this builds on.
  • Pre-push deterministic scanner blocked on a pre-existing finding in sea-haven-claude-plugin/ (unrelated to this diff, which is entirely agent-team/web/); overridden with --no-verify per operator authorization.
  • Deploy is frontend-only: rebuild web/dist on the Mac → rsync to the box (StaticFiles serves the new bundle); no service restart required.
## What Two dashboard-SPA refinements raised after first use of the WebUI (stacked on `feat/agent-team-plan-gate`). **Frontend-only** — no Python / coordinator / ledger / migration change. ### 1. Cleaner retry-loop display (no more "circular arrows") The pipeline's two real retry loops (`plan⇄review` revise, `build⇄verify` retry) were drawing a backward edge on top of the forward edge → read as ugly circles. Now: - Loop-back edges are **excluded from the default render and from the dagre layout** (clean forward flow). - The source node (Review/Verify) shows a small **`↺` chip** with a tooltip (“can send work back to …”). - The actual return arc is drawn **only when a selected task actually looped it** — detected from the task's `task_transitions` timeline (a back-step where `dst` appears after `src`) — and highlighted along that task's path. ### 2. Human-readable Q&A / Review Verdicts / Plan Replaced the `<pre>{JSON.stringify(...)}</pre>` blobs with structured, rendered sections via **`react-markdown`**: - **Plan** → summary (markdown) + phase list with nested steps (+ any extra scalar keys). - **Review verdicts** → one card each: verdict badge + round + outcome, then findings rendered (bold, numbered lists). - **Q&A** → per-turn cards; handles both string and `{turn, answer}` dict shapes. ## Security `react-markdown` is used **without `rehype-raw`**, so raw HTML embedded in (semi-trusted) agent text is escaped to text, never executed — no `dangerouslySetInnerHTML`. A test asserts an `<img onerror>` in findings renders as text (no element). Consistent with the dashboard's existing XSS-safe posture. No new untrusted-input/auth/IaC surface → mandatory `/sh-security-review` does not apply. ## Tests 16 frontend tests pass (Vitest + RTL): loopback default-off / on-when-looped / `loopBackTo` populated; markdown bold rendering; plan phase/step lists; string+dict Q&A; the no-raw-HTML XSS guard. Typecheck + `vite build` clean. ## Notes - Base = `feat/agent-team-plan-gate` (stacked); it already contains the WebUI makeover files this builds on. - Pre-push deterministic scanner blocked on a **pre-existing** finding in `sea-haven-claude-plugin/` (unrelated to this diff, which is entirely `agent-team/web/`); overridden with `--no-verify` per operator authorization. - Deploy is frontend-only: rebuild `web/dist` on the Mac → rsync to the box (StaticFiles serves the new bundle); no service restart required.
This repo is archived. You cannot comment on pull requests.
No description provided.