feat(lanes): give every pipeline node its own driver command
A pipeline template named ONE command for the whole run (`skill`), so the only way to know what actually moves a given node was to read that node's `detect` regexes. Each node now carries its own `command`: a slash command (`/superpowers:writing-plans`) or a shell one (`ccam lanes hook ci-gate`), whichever its detect rules already watch for. The values are derived from each node's own detect rules, not invented — every `ccam …` string was checked against bin/ccam.js and every `/superpowers:*` against the installed plugin. Nodes reaching which is a declaration rather than an action (`done`, `merged`, `reported`, `e2e-feature-passed`, `qc-plan`) are deliberately left empty. `pipelines.js` normalizes a missing or non-string value to "", so a custom template written before this field keeps loading rather than rendering "undefined". `nodeStates()` and GET /api/lanes/pipeline-stats pass it through. Never executed by the dashboard — display text, the same contract `skill` already had. Surfaced where each view has room for it: the Workflows pass-rate panel shows it under the node label and copies it on click; PipelineMap folds it into the node tooltip, because a 16-node pipeline has to fit across one card and there is no width for a second line. `command?: string` is optional in the client type only to spare four unrelated test fixtures — the server always sends the key, and the UI has to branch on the empty string regardless. Verified: npm run test:server (1373, +3), npm run test:client (459, +2), tsc --noEmit, prettier and check-headers clean. docs/LANES.md § Custom template format documents the field. openapi.yaml needs no change: the lane payload and pipeline-stats were never schematized there.
This commit is contained in:
@@ -49,11 +49,17 @@ export default function PipelineMap({
|
||||
data-testid={`pipeline-node-${n.id}`}
|
||||
data-state={n.state}
|
||||
data-detected={n.detected ? "true" : undefined}
|
||||
title={
|
||||
// The node's driver command rides along in the tooltip rather than
|
||||
// on the pill: the map has to fit a 16-node pipeline across one
|
||||
// card, so there is no width for a second line of text.
|
||||
title={[
|
||||
n.detected && detectedSignal
|
||||
? `${n.label} ← ${detectedSignal}`
|
||||
: `${n.label} — ${n.state}`
|
||||
}
|
||||
: `${n.label} — ${n.state}`,
|
||||
n.command ? `→ ${n.command}` : null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n")}
|
||||
className={`flex min-w-0 flex-1 items-center justify-center gap-1.5 rounded-full border px-2 py-1.5 text-[11px] ${n.detected ? DETECTED_CLASS : STATE_CLASS[n.state]}`}
|
||||
>
|
||||
<span className="shrink-0 text-[13px] leading-none">{n.icon}</span>
|
||||
|
||||
Reference in New Issue
Block a user