- );
-}
-
-/**
- * Tooltip is rendered into `document.body` via a portal so the parent
- * ScoreCard's `overflow-hidden` (and hover-transform that would otherwise
- * become its containing block) cannot clip it. Coordinates are computed
- * from the hovered bar's bounding rect and clamped to the viewport with an
- * 8 px margin, so the tooltip can never be cut off on any day of the week.
- */
-function SparklineTooltip({
- rect,
- label,
- value,
- color,
-}: {
- rect: DOMRect;
- label: string;
- value: number;
- color: string;
-}) {
- const { t } = useTranslation("workflows");
- const ref = useRef(null);
- const [pos, setPos] = useState<{ left: number; top: number }>({
- left: rect.left,
- top: rect.top,
- });
-
- useLayoutEffect(() => {
- const el = ref.current;
- if (!el) return;
- const w = el.offsetWidth;
- const h = el.offsetHeight;
- const margin = 8;
-
- // Center horizontally over the bar, then clamp to viewport.
- let left = rect.left + rect.width / 2 - w / 2;
- if (left < margin) left = margin;
- if (left + w > window.innerWidth - margin) left = window.innerWidth - w - margin;
-
- // Default above the bar; flip below if there isn't room.
- let top = rect.top - h - 8;
- if (top < margin) top = rect.bottom + 8;
-
- setPos({ left, top });
- }, [rect]);
-
- if (typeof document === "undefined") return null;
-
- return createPortal(
-
- );
-}
diff --git a/client/src/components/workflows/__tests__/LanePipelinePanel.test.tsx b/client/src/components/workflows/__tests__/LanePipelinePanel.test.tsx
new file mode 100644
index 00000000..a2684ab4
--- /dev/null
+++ b/client/src/components/workflows/__tests__/LanePipelinePanel.test.tsx
@@ -0,0 +1,115 @@
+/**
+ * @file Tests for the Workflows page's lane pipeline panel: it lists every lane
+ * as a tile, shows the first lane's pipeline before anything is clicked, and
+ * swaps the map when another lane is selected. A wrong selection would show one
+ * lane's stage under another lane's name.
+ * @author Nguyễn Ngọc Trí Vĩ
+ */
+
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { MemoryRouter } from "react-router-dom";
+import { LanePipelinePanel } from "../LanePipelinePanel";
+
+const { LANES } = vi.hoisted(() => {
+ const laneStub = (id: number, stageId: string) => ({
+ id,
+ title: `lane-${id}`,
+ cwd: `/workspace/lane-${id}`,
+ branch: null,
+ kind: "adopted",
+ source_repo: null,
+ pipeline: "default",
+ session_id: null,
+ run_id: null,
+ stage: stageId,
+ stage_since: null,
+ status: "idle",
+ gate_decision: null,
+ ci_status: null,
+ needs_action: null,
+ links: {},
+ stages: {},
+ notes: null,
+ pipeline_name: "Default",
+ pipeline_nodes: [
+ {
+ id: stageId,
+ label: stageId,
+ icon: "🧭",
+ gate: false,
+ state: "current",
+ },
+ ],
+ progress: 25,
+ stage_seconds: null,
+ last_event_seconds: null,
+ liveness: "idle",
+ detected_stage: null,
+ detected_signal: null,
+ slot: null,
+ ports: {},
+ active_feature_id: null,
+ });
+ return { LANES: [laneStub(1, "plan"), laneStub(2, "tests")] };
+});
+
+const listMock = vi.fn();
+
+vi.mock("../../../lib/api", async (importOriginal) => {
+ const actual = await importOriginal>();
+ return { ...actual, api: { lanes: { list: () => listMock() } } };
+});
+
+function renderPanel() {
+ return render(
+
+
+
+ );
+}
+
+describe("LanePipelinePanel", () => {
+ it("shows the first lane's pipeline before any tile is clicked", async () => {
+ listMock.mockResolvedValue({
+ lanes: LANES,
+ counts: { total: 2, running: 0, needs_you: 0, dead: 0 },
+ });
+ renderPanel();
+
+ expect(await screen.findByTestId("lane-tile-1")).toHaveAttribute("data-selected", "true");
+ expect(screen.getByTestId("pipeline-node-plan")).toBeInTheDocument();
+ expect(screen.queryByTestId("pipeline-node-tests")).not.toBeInTheDocument();
+ });
+
+ it("swaps the pipeline map when another lane is selected", async () => {
+ listMock.mockResolvedValue({
+ lanes: LANES,
+ counts: { total: 2, running: 0, needs_you: 0, dead: 0 },
+ });
+ renderPanel();
+
+ fireEvent.click(await screen.findByTestId("lane-tile-2"));
+
+ expect(screen.getByTestId("pipeline-node-tests")).toBeInTheDocument();
+ expect(screen.queryByTestId("pipeline-node-plan")).not.toBeInTheDocument();
+ });
+
+ it("renders the CLI hint when no lane exists", async () => {
+ listMock.mockResolvedValue({
+ lanes: [],
+ counts: { total: 0, running: 0, needs_you: 0, dead: 0 },
+ });
+ renderPanel();
+
+ expect(await screen.findByText(/ccam lanes add/)).toBeInTheDocument();
+ expect(screen.queryByTestId("workflows-lane-strip")).not.toBeInTheDocument();
+ });
+
+ it("surfaces a failed fetch instead of an empty strip", async () => {
+ listMock.mockRejectedValue(new Error("lanes unreachable"));
+ renderPanel();
+
+ expect(await screen.findByText("lanes unreachable")).toBeInTheDocument();
+ });
+});
diff --git a/client/src/i18n/locales/en/workflows.json b/client/src/i18n/locales/en/workflows.json
index c3b17403..b809a46c 100644
--- a/client/src/i18n/locales/en/workflows.json
+++ b/client/src/i18n/locales/en/workflows.json
@@ -63,50 +63,15 @@
"howToRead": "Tools appear as colored bars on the left and right. Bands connect them: thickness = number of times the source ran immediately before the target. Hover a band for share-of-source and share-of-target percentages; hover a node for its total usage and share of all tool calls.",
"why": "Surfaces habitual tool chains (e.g. Read → Edit → Bash). Useful for spotting loops, wasted hops, and missing tool variety in agent behavior."
},
- "pipeline": {
- "what": "A directed graph of agent-type co-occurrence: which agent types tend to run sequentially after which, and how often.",
- "howToRead": "Circles are agent types; size encodes total spawns. Arrows go A → B when B was observed running shortly after A in the same session, with the label = count. Hover an arrow for share of source/target; hover a circle for spawns, sessions, and success rate. Drag nodes to rearrange.",
- "why": "Surfaces real delegation pipelines you may not have intentionally designed - e.g. a code-review agent that nearly always follows a build agent - so you can codify or simplify them."
- },
- "effectiveness": {
- "what": "One card per subagent type with a success-rate ring, total sessions, average duration, and a 7-day activity sparkline.",
- "howToRead": "Ring fill is success rate; the percentage in the center is the same. The two boxes give counts and average wall-clock duration. The sparkline is sessions per day for the last week - hover a bar for the daily count.",
- "why": "Quick health check per agent: which agents are reliable, which are slow, and which are trending up or down in usage."
- },
- "patterns": {
- "what": "A ranked list of recurring agent-orchestration sequences detected from session traces, plus a callout for solo sessions that ran without subagents.",
- "howToRead": "Each row is a step sequence (main → sub → sub …). The right side shows how many sessions matched it and what percentage of all sessions that represents. Click a pattern to highlight it.",
- "why": "Reveals the standard 'shapes' of work in your project. Frequent patterns are good candidates to formalize as named workflows or skills."
- },
- "modelDelegation": {
- "what": "A two-column flow showing which main models delegate to which subagent models, plus per-node agent counts and total tokens.",
- "howToRead": "Left column = main models for sessions; right column = models used inside subagents. Lines indicate observed main → subagent pairings. Hover a node for share-of-all-agents, sessions, total tokens, and a description of the model family (Opus / Sonnet / Haiku).",
- "why": "Helps you confirm cost/latency tiering - e.g. main on Sonnet, subagents on Haiku - and catch unintended escalations to Opus."
- },
- "errorPropagation": {
- "what": "Where errors cluster across the agent hierarchy: by depth (session/main vs direct subagent vs nested), by agent type, and by API/session-level error category.",
- "howToRead": "The top banner gives the session-level error rate. The depth bars show how many errors occurred at each nesting level. The error-prone types list ranks subagent types by error count. The bottom block surfaces API/session error summaries.",
- "why": "Pinpoints whether failures live in the orchestration spine (main agent), in specific subagents, or in deep nested chains - guiding where to invest in retries, validation, or rewrites."
- },
- "concurrency": {
- "what": "Aggregate timing of when each agent type is active relative to the session timeline, plus how many sessions feature it.",
- "howToRead": "Each row is one agent type. Bar length is proportional to session count. The right-hand percentages show the average start and end position within a session (0% = session start, 100% = session end). Hover for a description of the timing pattern (front-loaded, mid-session, back-loaded, etc.).",
- "why": "Reveals the rhythm of your sessions - e.g. linting up front, code-review near the end - and surfaces agents that monopolize the entire session."
- },
- "complexity": {
- "what": "A scatter plot of every session: x = wall-clock duration, y = total agents involved, bubble size = total tokens, color = final status.",
- "howToRead": "Top-right bubbles are long, agent-heavy sessions. Big bubbles burned the most tokens. Reds/yellows = error/abandoned outcomes. Hover any bubble for full session stats; click to drill into it below.",
- "why": "Gives a single view of the cost/complexity distribution. Outliers are the sessions worth investigating for runaway behavior or cost spikes."
- },
- "compaction": {
- "what": "How often Claude triggered context compaction across sessions: total events, tokens recovered, and a per-session distribution.",
- "howToRead": "The two stat boxes show total compaction events and the cumulative tokens reclaimed. The bar chart lists sessions with at least one compaction, sorted descending by count.",
- "why": "Compactions indicate context pressure. A long tail of high-compaction sessions usually means workflows that should be split, summarized, or migrated to a longer-context model."
- },
"drillIn": {
"what": "Per-session detail view: full agent tree, tool-call timeline, and raw event sequence for whichever session you select.",
"howToRead": "Pick a session from the dropdown above or click a bubble in the scatter plot. The tabs let you switch between hierarchical (Agent Tree), temporal (Tool Timeline), and chronological (Event Sequence) views of the same session.",
"why": "When an aggregate chart flags a suspicious session, this is where you go to read exactly what happened, in order."
+ },
+ "lanes": {
+ "what": "The lanes this dashboard tracks — one durable unit of parallel agent work per working directory — and the pipeline stages each one has reached.",
+ "howToRead": "Pick a lane tile to see its pipeline below. A node is green when it is done with evidence, solid blue for the current stage, amber when claimed without evidence, dashed amber when only detected from tool events, red when rejected.",
+ "why": "This is your own delivery pipeline, not Claude Code internals: it answers where each parallel workstream stands right now. Lane actions live on the Workspace page."
}
},
"stats": {
@@ -244,201 +209,6 @@
"linkDescFmt": "Across every session, this counts how often {{source}} ran immediately before {{target}}. Thicker bands = more common transitions; the percentages show how dominant this hop is among each tool's outgoing / incoming flow."
}
},
- "pipeline": {
- "title": "Agent Pipeline Graph",
- "subtitle": "Directed workflow - which agent types run after which, with frequency labels",
- "noData": "No pipeline data yet",
- "noDataDesc": "Directed workflow edges appear once agent types run sequentially across multiple sessions.",
- "legend": "Legend",
- "legendDesc": "A runs before B (labeled count)",
- "frequency": "Frequency",
- "meaning": "Meaning",
- "times": " times",
- "ranAfter": " ran after ",
- "spawns": " spawns",
- "spawned": "Spawned",
- "inSessions": "In sessions",
- "ariaLabel": "Agent pipeline graph",
- "tooltip": {
- "agentType": "Agent type",
- "edge": "Sequential edge",
- "shareOfAllSpawns": "Share of all spawns",
- "sequentialPairs": "Sequential pairs",
- "totalSpawnsFmt": "{{id}} total spawns",
- "shareOfSrcFmt": "Share of {{source}} → next",
- "shareOfTgtFmt": "Share of prev → {{target}}",
- "edgeDescFmt": "{{target}} ran immediately after {{source}} {{count}} time(s) across all sessions. The thicker the arrow, the more often this hand-off occurred. Use this to spot habitual delegation chains in your workflows.",
- "nodeDescFmt": "{{id}} ran {{total}} time(s) across {{sessions}} session(s); its success rate is {{rate}}% ({{health}}). Circle size encodes total spawns; arrows show which agent types tend to run before or after it.",
- "health": {
- "perfect": "near-perfect",
- "healthy": "healthy",
- "shaky": "shaky",
- "failing": "failing often"
- }
- }
- },
- "effectiveness": {
- "title": "Subagent Effectiveness",
- "subtitle": "Performance metrics per agent type",
- "success": "Success",
- "sessions": "Sessions",
- "avgDuration": "Avg Duration",
- "weeklyActivity": "Weekly activity",
- "noData": "No subagent data available",
- "successRateAria": "Success rate: {{rate}}%",
- "weeklyActivityAria": "Weekly activity sparkline",
- "sessionCount_one": "{{count}} session",
- "sessionCount_other": "{{count}} sessions"
- },
- "patterns": {
- "title": "Detected Workflow Patterns",
- "subtitle": "Common agent orchestration sequences",
- "noData": "No patterns detected yet",
- "noDataDesc": "Patterns appear once multiple sessions share the same agent sequence.",
- "solo": "solo (no subagents)",
- "label": "Workflow Patterns",
- "detail": {
- "clickHint": "Click for details",
- "stepsHeading": "Full step sequence",
- "statsHeading": "Stats",
- "stepsCount_one": "{{count}} step",
- "stepsCount_other": "{{count}} steps",
- "uniqueAgents": "Unique agent types",
- "occurrences": "Sessions matching this pattern",
- "shareOfSessions": "Share of all sessions",
- "narrativeHeading": "What this means",
- "suggestionHeading": "Suggestion",
- "narrative": {
- "soloFmt": "Sessions that ran with only {{first}} - no delegation to other agent types.",
- "twoStepFmt": "A two-step hand-off: {{first}} delegates straight to {{last}}, with no further branching.",
- "shortFmt": "A {{count}}-step chain that starts at {{first}} and ends at {{last}}.",
- "longFmt": "A long {{count}}-step chain - begins at {{first}}, threads through several agents, and lands at {{last}}.",
- "loopHintFmt": " {{agent}} appears more than once in this sequence - typical of a verification or revision loop.",
- "dominant": " This is the dominant workflow in your project - more than half of sessions follow it.",
- "common": " This is a common workflow, accounting for roughly a quarter of sessions.",
- "regular": " A recognised workflow, but not the majority pattern.",
- "niche": " A niche pattern that only surfaces occasionally."
- },
- "suggestion": {
- "solo": "Solo run - would a code-reviewer or test-runner subagent raise the quality of these sessions?",
- "shortChain": "Short chain. If it keeps recurring, name it as a slash command, skill, or named workflow so it's easy to reproduce.",
- "mediumChain": "Frequent enough to formalise. A named workflow or template would make this pattern reusable.",
- "longChain": "Long chain - review whether every hop is necessary, or whether some agents could be merged or skipped.",
- "loop": "Loop detected. Confirm the repeated step is intentional verification rather than a silent retry of a failing call."
- }
- }
- },
- "modelDelegation": {
- "title": "Model Delegation Flow",
- "subtitle": "How models route through agent hierarchies",
- "mainModels": "MAIN MODELS",
- "subagentModels": "SUBAGENT MODELS",
- "noData": "No model delegation data available",
- "agentsCount_one": "{{count}} agent",
- "agentsCount_other": "{{count}} agents",
- "tokensCount": "{{tokens}} tokens",
- "sessionsCount_one": "{{count}} session",
- "sessionsCount_other": "{{count}} sessions",
- "ariaLabel": "Model delegation flow diagram",
- "tooltip": {
- "mainModel": "Main model",
- "subagentModel": "Subagent model",
- "agentRuns": "Agent runs",
- "shareOfAll": "Share of all agents",
- "sessionsOnModel": "Sessions on this model",
- "totalTokens": "Total tokens",
- "family": {
- "opus": "Opus - highest-capability tier; best for complex reasoning, longest context, costliest per token.",
- "sonnet": "Sonnet - balanced tier; good default for most coding and tool-use workflows.",
- "haiku": "Haiku - fastest, cheapest tier; ideal for short, latency-sensitive subagents.",
- "other": "Non-Anthropic or unrecognized model - falls outside the standard Opus/Sonnet/Haiku families."
- },
- "lines": {
- "main": "Lines on the right show subagent models this main model delegated work to.",
- "sub": "Lines on the left show main models that delegated work to this subagent model."
- }
- }
- },
- "errorPropagation": {
- "title": "Error Propagation Map",
- "subtitle": "Where errors cluster in agent hierarchy depth",
- "noErrors": "No errors recorded",
- "allSuccess": "All sessions completed successfully",
- "sessionsHadErrors": " sessions had errors",
- "sessionsErrorSummary": "{{errorSessions}} of {{totalSessions}} sessions had errors",
- "agentErrors": " agent-level error(s) across hierarchy",
- "sessionErrorsOnly": "Session-level errors only",
- "errorsByDepth": "Errors by hierarchy depth",
- "errorProneTypes": "Error-prone agent types",
- "apiSessionErrors": "API & session errors",
- "depthLabels": {
- "sessionMain": "Session / Main",
- "directSubagent": "Direct Subagent",
- "nested": "Nested (depth 2)",
- "deep": "Deep (depth 3+)"
- }
- },
- "concurrency": {
- "title": "Agent Concurrency Timeline",
- "subtitle": "Parallel agent execution patterns - Shows how agents overlap in time",
- "noData": "No concurrency data",
- "noDataDesc": "Concurrency data appears once sessions with subagents have been recorded.",
- "sessions": "Sessions",
- "timing": "Timing",
- "max": " max",
- "sessionInfo_one": "{{count}} session - active {{from}}%-{{to}}% of session",
- "sessionInfo_other": "{{count}} sessions - active {{from}}%-{{to}}% of session",
- "tooltip": {
- "lane": "Concurrency lane",
- "sessionsWith": "Sessions with this agent",
- "avgStart": "Avg start in session",
- "avgEnd": "Avg end in session",
- "barHint": "Bar length is proportional to how many sessions feature this agent type. Timing percentages are averages across those sessions.",
- "timing": {
- "wholeSession": "Active across nearly the entire session - runs from the start through to the end.",
- "frontLoadedFmt": "Front-loaded: typically active from session start until ~{{end}}% of the way through.",
- "backLoadedFmt": "Back-loaded: typically kicks in around {{start}}% of the session and stays until the end.",
- "tightFmt": "Tightly scoped: runs in a narrow band between {{start}}% and {{end}}% of the session timeline.",
- "midSessionFmt": "Mid-session work: runs roughly from {{start}}% to {{end}}% of the session timeline."
- }
- }
- },
- "complexity": {
- "title": "Session Complexity Scatter",
- "subtitle": "Duration vs agent count vs tokens - Bubble size = token usage",
- "noData": "No session complexity data",
- "noDataDesc": "Sessions will appear here once they complete with agent activity.",
- "duration": "Duration",
- "agentCount": "Agent Count",
- "ariaLabel": "Session complexity scatter plot",
- "tooltip": {
- "duration": "Duration:",
- "agents": "Agents:",
- "subagents": "Subagents:",
- "tokens": "Tokens:",
- "model": "Model:"
- }
- },
- "compaction": {
- "title": "Compaction Impact Analysis",
- "subtitle": "How context compression is spread across your sessions",
- "help": "When a session's context window fills up, Claude Code compresses older history into a summary. Each compaction is one such event.",
- "noData": "No compactions recorded",
- "totalCompactions": "Total compactions",
- "sessionsAffected": "Sessions affected",
- "ofTotal": "of {{total}}",
- "avgPerSession": "Avg / affected session",
- "peakSession": "Most in one session",
- "tokensRecovered": "Tokens Recovered",
- "distribution": "Sessions by compaction count",
- "xAxis": "Compactions per session",
- "yAxis": "Sessions",
- "summary": "{{affected}} of {{total}} sessions ({{pct}}%) used context compaction.",
- "tokensFreed": "Compaction freed ~{{tokens}} tokens of context.",
- "ariaLabel": "Number of sessions by compaction count",
- "tipTitle": "Compacted {{count}}x",
- "tipDetail": "{{sessions}} sessions · {{pct}}% of affected"
- },
"drillIn": {
"title": "Session Drill-In",
"subtitle": "Select a session from the scatter plot or use the dropdown to explore",
@@ -464,5 +234,10 @@
"showingOf": "Showing 100 of {{total}} events",
"sessionInfo": " session(s) - active {{from}}%-{{to}}% of session",
"sortedByCompaction": " session(s) (sorted by compaction count)"
+ },
+ "lanes": {
+ "title": "Lane Pipelines",
+ "subtitle": "Your own lanes and the stage each one has reached",
+ "openWorkspace": "Open in Workspace"
}
}
diff --git a/client/src/i18n/locales/vi/workflows.json b/client/src/i18n/locales/vi/workflows.json
index 4af1c251..876a5777 100644
--- a/client/src/i18n/locales/vi/workflows.json
+++ b/client/src/i18n/locales/vi/workflows.json
@@ -63,50 +63,15 @@
"howToRead": "Tool xuất hiện thành các thanh màu ở hai bên. Băng nối chúng: độ dày = số lần nguồn chạy ngay trước đích. Hover một băng để xem tỷ trọng-trong-nguồn và tỷ trọng-trong-đích; hover một node để xem tổng lượt dùng và tỷ trọng trên tổng tool.",
"why": "Phơi bày những chuỗi tool quen thuộc (ví dụ Read → Edit → Bash). Hữu ích để phát hiện vòng lặp, bước thừa, và sự đơn điệu trong cách Agent dùng tool."
},
- "pipeline": {
- "what": "Đồ thị có hướng về sự đồng xuất hiện của loại Agent: loại nào hay chạy ngay sau loại nào, và bao nhiêu lần.",
- "howToRead": "Hình tròn là loại Agent; kích thước mã hóa tổng số spawn. Mũi tên A → B nghĩa là B đã chạy ngay sau A trong cùng phiên, nhãn = số lần. Hover mũi tên để xem tỷ trọng nguồn/đích; hover hình tròn để xem số spawn, số phiên và tỷ lệ thành công. Có thể kéo các node để sắp xếp lại.",
- "why": "Phơi bày các pipeline ủy quyền có thực mà bạn có thể chưa cố ý thiết kế - ví dụ một code-review agent gần như luôn chạy sau build agent - để bạn chuẩn hóa hoặc đơn giản hóa."
- },
- "effectiveness": {
- "what": "Mỗi loại Subagent có một thẻ với vòng tròn tỷ lệ thành công, tổng số phiên, thời lượng trung bình và sparkline 7 ngày.",
- "howToRead": "Phần tô của vòng tròn là tỷ lệ thành công; số phần trăm ở giữa cũng vậy. Hai ô cho biết số lượng và thời gian thực trung bình. Sparkline là số phiên mỗi ngày của tuần qua - hover một thanh để xem số liệu ngày đó.",
- "why": "Kiểm tra sức khỏe nhanh theo Agent: Agent nào đáng tin, Agent nào chậm, và Agent nào đang tăng/giảm sử dụng."
- },
- "patterns": {
- "what": "Danh sách xếp hạng các chuỗi điều phối Agent lặp lại được phát hiện từ trace phiên, kèm thẻ riêng cho phiên đơn lẻ không có Subagent.",
- "howToRead": "Mỗi dòng là một chuỗi bước (main → sub → sub …). Bên phải hiển thị số phiên khớp và tỷ lệ trên tổng phiên. Bấm vào một mẫu để làm nổi bật.",
- "why": "Cho thấy các 'hình dáng' công việc tiêu chuẩn trong dự án. Mẫu phổ biến là ứng viên tốt để chuẩn hóa thành workflow hoặc skill có tên gọi."
- },
- "modelDelegation": {
- "what": "Sơ đồ luồng hai cột cho thấy mô hình chính nào ủy quyền cho mô hình Subagent nào, kèm số Agent và tổng token theo node.",
- "howToRead": "Cột trái = mô hình chính của phiên; cột phải = mô hình dùng bên trong Subagent. Đường nối chỉ các cặp main → Subagent quan sát được. Hover một node để xem tỷ trọng trên tổng Agent, số phiên, tổng token và mô tả họ mô hình (Opus / Sonnet / Haiku).",
- "why": "Giúp xác nhận phân tầng chi phí/độ trễ - ví dụ main trên Sonnet, Subagent trên Haiku - và phát hiện các trường hợp bị đẩy lên Opus ngoài ý muốn."
- },
- "errorPropagation": {
- "what": "Lỗi tập trung ở đâu trong phân cấp Agent: theo độ sâu (phiên/main vs Subagent trực tiếp vs lồng nhau), theo loại Agent, và theo nhóm lỗi API / phiên.",
- "howToRead": "Banner trên đầu cho biết tỷ lệ lỗi cấp phiên. Các thanh độ sâu cho biết bao nhiêu lỗi xảy ra ở từng cấp lồng. Danh sách 'loại dễ lỗi' xếp Subagent theo số lỗi. Khối dưới hiển thị tóm tắt lỗi API/phiên.",
- "why": "Xác định lỗi nằm ở trục điều phối (main agent), ở Subagent cụ thể, hay ở chuỗi lồng sâu - giúp định hướng nơi nên đầu tư retry, kiểm chứng hay viết lại."
- },
- "concurrency": {
- "what": "Thời điểm tổng hợp mà mỗi loại Agent hoạt động so với timeline phiên, kèm số phiên có Agent đó.",
- "howToRead": "Mỗi dòng là một loại Agent. Chiều dài thanh tỉ lệ với số phiên. Phần trăm bên phải cho biết vị trí bắt đầu và kết thúc trung bình trong một phiên (0% = đầu phiên, 100% = cuối phiên). Hover để xem mô tả mẫu thời gian (đầu phiên, giữa, cuối, ...).",
- "why": "Cho thấy nhịp của phiên - ví dụ lint ở đầu, code-review ở cuối - và phát hiện Agent chiếm trọn cả phiên."
- },
- "complexity": {
- "what": "Biểu đồ phân tán mỗi phiên: x = thời lượng thực, y = tổng số Agent, kích thước bong bóng = tổng token, màu = trạng thái cuối.",
- "howToRead": "Bong bóng phía trên-bên phải là phiên dài và nặng Agent. Bong bóng to dùng nhiều token nhất. Đỏ/vàng = kết quả lỗi/bỏ dở. Hover để xem đầy đủ thống kê phiên; bấm để xem chi tiết bên dưới.",
- "why": "Cho cái nhìn tổng thể về phân bố chi phí/độ phức tạp. Outlier chính là những phiên đáng điều tra vì hành vi bất thường hoặc đột biến chi phí."
- },
- "compaction": {
- "what": "Tần suất Claude kích hoạt nén ngữ cảnh: tổng số sự kiện, token thu hồi và phân bố theo từng phiên.",
- "howToRead": "Hai ô số liệu cho biết tổng số lần nén và tổng token đã thu hồi. Biểu đồ cột liệt kê các phiên có ít nhất một lần nén, sắp xếp giảm dần theo số lần.",
- "why": "Nén ngữ cảnh là dấu hiệu áp lực bộ nhớ. Nhiều phiên có số lần nén cao thường có nghĩa workflow nên được chia nhỏ, tóm tắt, hoặc chuyển sang model có ngữ cảnh dài hơn."
- },
"drillIn": {
"what": "Khung chi tiết theo phiên: cây Agent đầy đủ, dòng thời gian tool gọi và chuỗi sự kiện thô của phiên bạn chọn.",
"howToRead": "Chọn phiên từ dropdown phía trên hoặc bấm một bong bóng trong biểu đồ phân tán. Các tab cho phép chuyển giữa góc nhìn phân cấp (Agent Tree), thời gian (Tool Timeline) và theo trình tự (Event Sequence) của cùng một phiên.",
"why": "Khi biểu đồ tổng hợp đánh dấu một phiên đáng ngờ, đây là nơi bạn đọc chính xác chuyện gì đã xảy ra, theo đúng thứ tự."
+ },
+ "lanes": {
+ "what": "Các lane mà dashboard theo dõi — mỗi thư mục làm việc là một đơn vị công việc song song bền vững — cùng giai đoạn pipeline mỗi lane đã đạt tới.",
+ "howToRead": "Chọn một thẻ lane để xem pipeline bên dưới. Node xanh lá là đã xong kèm bằng chứng, xanh dương đặc là giai đoạn hiện tại, vàng là khai báo nhưng không có bằng chứng, vàng nét đứt là chỉ suy ra từ tool event, đỏ là bị từ chối.",
+ "why": "Đây là pipeline giao việc của chính bạn, không phải nội bộ Claude Code: nó trả lời từng luồng việc song song đang ở đâu. Các thao tác trên lane nằm ở trang Workspace."
}
},
"stats": {
@@ -244,201 +209,6 @@
"linkDescFmt": "Trên mọi phiên, đây là số lần {{source}} chạy ngay trước {{target}}. Băng càng dày = lượt chuyển càng phổ biến; phần trăm cho biết bước này chiếm tỷ trọng bao nhiêu trong luồng ra/vào của mỗi tool."
}
},
- "pipeline": {
- "title": "Đồ thị pipeline Agent",
- "subtitle": "Quy trình có hướng - loại Agent nào chạy sau loại nào, kèm tần suất",
- "noData": "Chưa có dữ liệu pipeline",
- "noDataDesc": "Các cạnh quy trình sẽ xuất hiện khi loại Agent chạy tuần tự qua nhiều phiên.",
- "legend": "Chú giải",
- "legendDesc": "A chạy trước B (kèm số lần)",
- "frequency": "Tần suất",
- "meaning": "Ý nghĩa",
- "times": " lần",
- "ranAfter": " chạy sau ",
- "spawns": " lần spawn",
- "spawned": "Đã spawn",
- "inSessions": "Trong các phiên",
- "ariaLabel": "Đồ thị pipeline Agent",
- "tooltip": {
- "agentType": "Loại Agent",
- "edge": "Cạnh tuần tự",
- "shareOfAllSpawns": "Tỷ trọng trên tổng spawn",
- "sequentialPairs": "Cặp tuần tự",
- "totalSpawnsFmt": "Tổng spawn {{id}}",
- "shareOfSrcFmt": "Tỷ trọng {{source}} → kế tiếp",
- "shareOfTgtFmt": "Tỷ trọng trước → {{target}}",
- "edgeDescFmt": "{{target}} chạy ngay sau {{source}} {{count}} lần trên toàn bộ phiên. Mũi tên càng dày, hand-off càng thường xuyên. Dùng để phát hiện chuỗi ủy quyền quen thuộc trong quy trình của bạn.",
- "nodeDescFmt": "{{id}} đã chạy {{total}} lần trên {{sessions}} phiên; tỷ lệ thành công {{rate}}% ({{health}}). Kích thước hình tròn mã hóa tổng số spawn; mũi tên cho biết loại Agent nào hay chạy trước/sau nó.",
- "health": {
- "perfect": "gần như hoàn hảo",
- "healthy": "khỏe mạnh",
- "shaky": "hơi lung lay",
- "failing": "thường xuyên thất bại"
- }
- }
- },
- "effectiveness": {
- "title": "Hiệu quả Subagent",
- "subtitle": "Chỉ số hiệu năng theo từng loại Agent",
- "success": "Thành công",
- "sessions": "Phiên",
- "avgDuration": "Thời lượng TB",
- "weeklyActivity": "Hoạt động theo tuần",
- "noData": "Chưa có dữ liệu Subagent",
- "successRateAria": "Tỷ lệ thành công: {{rate}}%",
- "weeklyActivityAria": "Biểu đồ tia hoạt động theo tuần",
- "sessionCount_one": "{{count}} phiên",
- "sessionCount_other": "{{count}} phiên"
- },
- "patterns": {
- "title": "Mẫu quy trình phát hiện được",
- "subtitle": "Chuỗi điều phối Agent thường gặp",
- "noData": "Chưa phát hiện mẫu nào",
- "noDataDesc": "Mẫu sẽ xuất hiện khi nhiều phiên có cùng chuỗi Agent.",
- "solo": "đơn lẻ (không có Subagent)",
- "label": "Mẫu quy trình",
- "detail": {
- "clickHint": "Bấm để xem chi tiết",
- "stepsHeading": "Chuỗi bước đầy đủ",
- "statsHeading": "Thống kê",
- "stepsCount_one": "{{count}} bước",
- "stepsCount_other": "{{count}} bước",
- "uniqueAgents": "Số loại Agent khác nhau",
- "occurrences": "Số phiên khớp mẫu này",
- "shareOfSessions": "Tỷ trọng trên tổng phiên",
- "narrativeHeading": "Ý nghĩa của mẫu này",
- "suggestionHeading": "Gợi ý",
- "narrative": {
- "soloFmt": "Phiên chỉ chạy {{first}} - không ủy quyền cho loại Agent nào khác.",
- "twoStepFmt": "Hand-off hai bước: {{first}} ủy quyền thẳng cho {{last}}, không có nhánh nào khác.",
- "shortFmt": "Chuỗi {{count}} bước, bắt đầu ở {{first}} và kết thúc ở {{last}}.",
- "longFmt": "Chuỗi dài {{count}} bước - bắt đầu ở {{first}}, đi qua nhiều Agent, rồi dừng ở {{last}}.",
- "loopHintFmt": " {{agent}} xuất hiện nhiều lần trong chuỗi này - điển hình cho vòng lặp kiểm tra hoặc sửa lại.",
- "dominant": " Đây là quy trình chủ đạo trong dự án - hơn một nửa số phiên đi theo.",
- "common": " Là quy trình phổ biến, chiếm khoảng một phần tư số phiên.",
- "regular": " Là quy trình được nhận diện, nhưng chưa phải đa số.",
- "niche": " Là mẫu hiếm, chỉ thi thoảng mới xuất hiện."
- },
- "suggestion": {
- "solo": "Phiên đơn lẻ - liệu thêm code-reviewer hay test-runner Subagent có cải thiện chất lượng không?",
- "shortChain": "Chuỗi ngắn. Nếu lặp lại nhiều, hãy đặt tên thành slash command, skill hoặc workflow để dễ tái sử dụng.",
- "mediumChain": "Đủ phổ biến để chuẩn hóa. Một workflow/template có tên sẽ giúp tái sử dụng dễ dàng.",
- "longChain": "Chuỗi dài - xem xét liệu mọi bước có thực sự cần thiết, hay có thể gộp/bỏ bớt một số Agent.",
- "loop": "Phát hiện vòng lặp. Hãy xác nhận bước lặp là kiểm tra có chủ đích, không phải retry âm thầm một lệnh đang lỗi."
- }
- }
- },
- "modelDelegation": {
- "title": "Luồng ủy quyền mô hình",
- "subtitle": "Cách các mô hình đi qua phân cấp Agent",
- "mainModels": "MÔ HÌNH CHÍNH",
- "subagentModels": "MÔ HÌNH TÁC TỬ PHỤ",
- "noData": "Chưa có dữ liệu ủy quyền mô hình",
- "agentsCount_one": "{{count}} Agent",
- "agentsCount_other": "{{count}} Agent",
- "tokensCount": "{{tokens}} token",
- "sessionsCount_one": "{{count}} phiên",
- "sessionsCount_other": "{{count}} phiên",
- "ariaLabel": "Sơ đồ luồng ủy quyền mô hình",
- "tooltip": {
- "mainModel": "Mô hình chính",
- "subagentModel": "Mô hình Subagent",
- "agentRuns": "Lượt chạy Agent",
- "shareOfAll": "Tỷ trọng trên tổng Agent",
- "sessionsOnModel": "Phiên dùng mô hình này",
- "totalTokens": "Tổng token",
- "family": {
- "opus": "Opus - bậc khả năng cao nhất; tốt cho lý luận phức tạp, ngữ cảnh dài nhất, đắt nhất theo token.",
- "sonnet": "Sonnet - bậc cân bằng; mặc định tốt cho hầu hết quy trình code và dùng tool.",
- "haiku": "Haiku - bậc nhanh nhất, rẻ nhất; phù hợp cho Subagent ngắn, nhạy cảm độ trễ.",
- "other": "Mô hình ngoài Anthropic hoặc không nhận dạng được - không thuộc bộ Opus/Sonnet/Haiku tiêu chuẩn."
- },
- "lines": {
- "main": "Các đường bên phải cho thấy mô hình Subagent mà mô hình chính này đã ủy quyền.",
- "sub": "Các đường bên trái cho thấy mô hình chính nào đã ủy quyền cho mô hình Subagent này."
- }
- }
- },
- "errorPropagation": {
- "title": "Bản đồ lan truyền lỗi",
- "subtitle": "Điểm tập trung lỗi theo độ sâu phân cấp Agent",
- "noErrors": "Không ghi nhận lỗi",
- "allSuccess": "Tất cả phiên đã hoàn tất thành công",
- "sessionsHadErrors": " phiên gặp lỗi",
- "sessionsErrorSummary": "{{errorSessions}} trên {{totalSessions}} phiên gặp lỗi",
- "agentErrors": " lỗi cấp Agent trong toàn bộ phân cấp",
- "sessionErrorsOnly": "Chỉ có lỗi ở cấp phiên",
- "errorsByDepth": "Lỗi theo độ sâu phân cấp",
- "errorProneTypes": "Loại Agent dễ lỗi",
- "apiSessionErrors": "Lỗi API & phiên",
- "depthLabels": {
- "sessionMain": "Phiên / Agent chính",
- "directSubagent": "Subagent trực tiếp",
- "nested": "Lồng nhau (độ sâu 2)",
- "deep": "Sâu (độ sâu 3+)"
- }
- },
- "concurrency": {
- "title": "Dòng thời gian đồng thời Agent",
- "subtitle": "Mẫu thực thi song song - thể hiện mức chồng lấp theo thời gian",
- "noData": "Chưa có dữ liệu đồng thời",
- "noDataDesc": "Dữ liệu đồng thời sẽ xuất hiện khi đã ghi nhận phiên có Subagent.",
- "sessions": "Phiên",
- "timing": "Thời gian",
- "max": " tối đa",
- "sessionInfo_one": "{{count}} phiên - hoạt động từ {{from}}%-{{to}}% thời lượng phiên",
- "sessionInfo_other": "{{count}} phiên - hoạt động từ {{from}}%-{{to}}% thời lượng phiên",
- "tooltip": {
- "lane": "Làn đồng thời",
- "sessionsWith": "Phiên có Agent này",
- "avgStart": "Bắt đầu TB trong phiên",
- "avgEnd": "Kết thúc TB trong phiên",
- "barHint": "Chiều dài thanh tỉ lệ với số phiên có loại Agent này. Phần trăm thời gian là trung bình trên các phiên đó.",
- "timing": {
- "wholeSession": "Hoạt động xuyên gần như cả phiên - chạy từ đầu tới cuối.",
- "frontLoadedFmt": "Dồn về đầu: thường hoạt động từ đầu phiên tới khoảng ~{{end}}% chặng đường.",
- "backLoadedFmt": "Dồn về cuối: thường khởi động quanh {{start}}% phiên và duy trì tới hết.",
- "tightFmt": "Phạm vi hẹp: chạy trong dải hẹp từ {{start}}% đến {{end}}% timeline phiên.",
- "midSessionFmt": "Công việc giữa phiên: chạy khoảng từ {{start}}% đến {{end}}% timeline phiên."
- }
- }
- },
- "complexity": {
- "title": "Biểu đồ phân tán độ phức tạp phiên",
- "subtitle": "Thời lượng vs số Agent vs token - kích thước bong bóng = lượng token",
- "noData": "Chưa có dữ liệu độ phức tạp phiên",
- "noDataDesc": "Phiên sẽ xuất hiện ở đây sau khi hoàn tất với hoạt động Agent.",
- "duration": "Thời lượng",
- "agentCount": "Số Agent",
- "ariaLabel": "Biểu đồ phân tán độ phức tạp phiên",
- "tooltip": {
- "duration": "Thời lượng:",
- "agents": "Agent:",
- "subagents": "Subagent:",
- "tokens": "Token:",
- "model": "Mô hình:"
- }
- },
- "compaction": {
- "title": "Phân tích tác động nén ngữ cảnh",
- "subtitle": "Cách nén ngữ cảnh phân bố trên các phiên của bạn",
- "help": "Khi cửa sổ ngữ cảnh của một phiên đầy, Claude Code nén phần lịch sử cũ thành bản tóm tắt. Mỗi lần nén dưới đây là một sự kiện như vậy.",
- "noData": "Chưa ghi nhận nén ngữ cảnh",
- "totalCompactions": "Tổng số lần nén",
- "sessionsAffected": "Phiên bị ảnh hưởng",
- "ofTotal": "trên {{total}}",
- "avgPerSession": "TB / phiên bị ảnh hưởng",
- "peakSession": "Nhiều nhất trong một phiên",
- "tokensRecovered": "Token thu hồi",
- "distribution": "Số phiên theo số lần nén",
- "xAxis": "Số lần nén mỗi phiên",
- "yAxis": "Số phiên",
- "summary": "{{affected}} trên {{total}} phiên ({{pct}}%) đã dùng nén ngữ cảnh.",
- "tokensFreed": "Nén đã giải phóng ~{{tokens}} token ngữ cảnh.",
- "ariaLabel": "Số phiên theo số lần nén",
- "tipTitle": "Nén {{count}} lần",
- "tipDetail": "{{sessions}} phiên · {{pct}}% số phiên bị ảnh hưởng"
- },
"drillIn": {
"title": "Phân tích chi tiết phiên",
"subtitle": "Chọn phiên từ biểu đồ phân tán hoặc dùng danh sách để khám phá",
@@ -464,5 +234,10 @@
"showingOf": "Đang hiển thị 100 / {{total}} sự kiện",
"sessionInfo": " phiên - hoạt động {{from}}%-{{to}} thời lượng phiên",
"sortedByCompaction": " phiên (sắp theo số lần nén ngữ cảnh)"
+ },
+ "lanes": {
+ "title": "Pipeline của lane",
+ "subtitle": "Các lane của bạn và giai đoạn mỗi lane đã đạt tới",
+ "openWorkspace": "Mở trong Workspace"
}
}
diff --git a/client/src/pages/Workflows.tsx b/client/src/pages/Workflows.tsx
index 07f4b6ef..9341e184 100644
--- a/client/src/pages/Workflows.tsx
+++ b/client/src/pages/Workflows.tsx
@@ -1,6 +1,11 @@
/**
* @file Workflows.tsx
- * @description Displays comprehensive analytics on agent orchestration patterns, including DAGs of agent spawning, tool usage flows, collaboration networks, and session complexity metrics, with real-time updates and interactive filtering.
+ * @description Workflows page: this dashboard's own lane pipelines first, then the
+ * few Claude Code orchestration views that stay readable and interactive — headline
+ * stats, Workflow-tool runs, the spawning DAG, the tool flow, and the per-session
+ * drill-in. The deeper analytics (collaboration network, subagent effectiveness,
+ * patterns, model delegation, error propagation, concurrency, complexity,
+ * compaction) were dropped in issue #6 as too specialized to act on.
* @author Nguyễn Ngọc Trí Vĩ
*/
/* =============================================================================
@@ -25,14 +30,11 @@
* - `../lib/eventBus`
* - `../lib/types`
* - `../components/workflows/WorkflowStats`
+ * - `../components/workflows/LanePipelinePanel`
+ * - `../components/workflows/WorkflowRunsPanel`
* - `../components/workflows/OrchestrationDAG`
* - `../components/workflows/ToolExecutionFlow`
- * - `../components/workflows/AgentCollaborationNetwork`
- * - `../components/workflows/SubagentEffectiveness`
- * - `../components/workflows/WorkflowPatterns`
- * - `../components/workflows/ModelDelegationFlow`
- * - `../components/workflows/ErrorPropagationMap`
- * - `../components/workflows/ConcurrencyTimeline`
+ * - `../components/workflows/SessionDrillIn`
*
* ## Public surface
* - `Workflows` — exported API; see TSDoc on the symbol for behavior.
@@ -74,16 +76,9 @@ import type { WorkflowData, WSMessage } from "../lib/types";
import { WorkflowStats } from "../components/workflows/WorkflowStats";
import { OrchestrationDAG } from "../components/workflows/OrchestrationDAG";
import { ToolExecutionFlow } from "../components/workflows/ToolExecutionFlow";
-import { AgentCollaborationNetwork } from "../components/workflows/AgentCollaborationNetwork";
-import { SubagentEffectiveness } from "../components/workflows/SubagentEffectiveness";
-import { WorkflowPatterns } from "../components/workflows/WorkflowPatterns";
-import { ModelDelegationFlow } from "../components/workflows/ModelDelegationFlow";
-import { ErrorPropagationMap } from "../components/workflows/ErrorPropagationMap";
-import { ConcurrencyTimeline } from "../components/workflows/ConcurrencyTimeline";
-import { SessionComplexityScatter } from "../components/workflows/SessionComplexityScatter";
-import { CompactionImpact } from "../components/workflows/CompactionImpact";
import { SessionDrillIn } from "../components/workflows/SessionDrillIn";
import { WorkflowRunsPanel } from "../components/workflows/WorkflowRunsPanel";
+import { LanePipelinePanel } from "../components/workflows/LanePipelinePanel";
type StatusFilter = "all" | "active" | "completed";
@@ -203,6 +198,11 @@ export function Workflows() {
{/* Stats Row */}
+ {/* This dashboard's own pipelines - lane strip + the selected lane's map */}
+
+
+
+
{/* Workflow-tool runs (issue #167) - fleets ingested from on-disk journals */}