Consolidation branch for U7, per the new one-branch working mode. **Supersedes #2607, #2635, #2640** — the three of my PRs that were stuck on review threads. My other seven (#2602, #2605, #2606, #2611, #2621, #2628, #2633) are green with **zero unresolved threads** and are deliberately left alone for the merge sweep. ## What is in here, file by file | file | change | guards before → after | |---|---|---| | `plugins/…/glasses/src/agent-actions.ts` | gates, destinations and degraded-resolution refusal all resolve from the task's own workflow | 2 → 0 | | `plugins/…/glasses/src/quick-capture.ts` | accepted capture columns come from the board; default no longer names the deleted column | 1 → 0 | | `plugins/…/glasses/src/settings.ts` | quick-capture default was `triage`, the column #2515 removed | (assignment, uncounted) | | `plugins/…/dependency-graph/src/GraphTaskNode.tsx` | redundant column condition deleted | 1 → 0 | | `packages/engine/src/executor.ts` | 8 rebound guards compare the resolved column; 4 resume-eligibility literals share one resolver | 151 → 143 (+4 off-bar) | | `packages/engine/src/__tests__/` | 4 new suites, 26 cases | — | `plugins/` reaches **zero** column guards with this branch. ## The three threads it closes **#2607 — five findings, all mine, all the same rule.** I kept *qualifying* a legacy-id fallback instead of removing it: | attempt | rule | hole review found | |---|---|---| | 1 | fall back to `todo` when the role is missing | moved cards to phantom columns | | 2 | …only if the workflow **declares** `todo` | aliased **review** lane named `todo` | | 3 | …and only if no other role is assigned to it | **traitless** parking column named `todo` | The qualifications were the mistake. Once `resolveLanes` returns a lane set the workflow *has* a column vocabulary, so "no column carries the hold trait" is a complete answer — refuse. `destination()` is two lines now, with no aliasing surface left to qualify. Plus a sixth, which is a genuinely different state: **degraded resolution is indistinguishable from the default board.** `resolveWorkflowIrForTask` is total by design — a missing definition silently returns the *default* coding IR — so a card on a custom board whose definition could not be read resolved to `todo`/`in-progress`. `undefined` lanes cannot express that (it means "no workflow at all", where the legacy ids *are* the answer). The actions now refuse with 409. #2618 would replace this check with resolver provenance; it is not merged, so this does not depend on it. **#2635 — "seven rebound sites remain untested."** Fair; my "same shape" note was an assertion, not coverage. Seven of the eight need a live graph run to reach, so the *shape* is pinned instead: a static check that no guard in front of a rebound move compares against a column literal, with a vacuity case (the same detection run against the original shape) and a match-count floor (≥8), because a guard reporting success on zero matches is worse than no guard. **#2640 — duplicate workflow resolution.** Framed as I/O; it is also a correctness bug. Eligibility and re-entry are two halves of one decision and resolved the workflow separately, so a workflow edit landing between them has the halves reading *different boards*. Now one caller-owned memo per decision — caller-owned because a process-lifetime cache would have to guess when a mid-flight workflow edit invalidates it. ## Behavioural findings, not tidying - **The last-resort recovery for completed-but-stranded work did not exist off the default lineage.** `promotedFromPlannerColumn` was false on a renamed board, so finished work resting in planning was never promoted; the code fell through to a review handoff that role adjacency rejects, and the card stayed stuck with its work complete. - **Rebound guards could not see the column their own move targeted.** U5b converted the move target; the eight `column !== "todo"` checks in front of it were left literal, so on a renamed board the engine moved a card into the column it was already in — and `moveTaskInternal` runs reset-on-entry on every real move, so at the `preserveProgress: false` site it reset step progress a second time. - **The FN-1404 `task:move` audit row was lying**, recording `to: "todo"` while the move target was resolved. A run-audit trail that disagrees with the move it describes is worse than none. Not a comparison, so no census counts it. - **A task interrupted by an engine pause never resumed on a renamed board** (off-bar, `in-review`/`in-progress` literals): four comparisons decided one question and had to agree; two of them disagreed on a renamed board, so re-entry silently never fired. ## Revert proofs, isolated per site | reverted | result | |---|---| | `destination()` back to attempt 3 | 3 of 38 fail | | degraded-resolution refusals removed | 2 of 42 fail | | capture set back to the legacy five | 2 of 3 fail (renamed-board suite) | | forward exclusions → literals | 1 of 14 fails | | missing-wip refusal removed | 2 of 14 fail | | `promotedFromPlannerColumn` → literals | 3 of 7 fail | | promotion target → `"in-progress"` | 3 of 7 fail | | one rebound guard → `!== "todo"` | 1 of 3 fails (static shape) | | resume lanes → legacy trio | 1 of 5 fails | Every conversion is paired with a negative — a forward move, a not-a-planner-lane card, a default-lineage card, an unresolvable workflow — so neither "always fire" nor "never fire" can pass for "resolve the role". ## Commit discipline Twelve commits, each one thing: the code move (`resolvePlannerLanes` out of `triage.ts`) is separate from every behavior change, and each review fix is its own commit with its own revert proof. ## Verification - `pnpm test:gate` **71/71** - 162/162 across the glasses plugin's 19 files; 26/26 across the four new engine suites - engine + glasses typecheck clean; `pnpm lint` clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Engine recovery and retries now work correctly with renamed or customized workflow columns. * Tasks in manual-intake columns are no longer automatically planned. * Agent actions and quick capture now respect each board’s declared columns and lifecycle stages. * Awaiting-approval tasks are recognized regardless of their current column. * Command Center SDLC funnel stages now accurately reflect customized workflows. * **Documentation** * Added guidance for safely changing workflow-column logic and interpreting lifecycle-column checks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
161 lines
6.0 KiB
TypeScript
161 lines
6.0 KiB
TypeScript
import type { CSSProperties, ComponentProps, HTMLAttributes } from "react";
|
|
import type { GraphPosition } from "./types.js";
|
|
import { useNodeDrag } from "./hooks/useNodeDrag.js";
|
|
import { TaskCard } from "@fusion/dashboard/app/components/TaskCard";
|
|
import { isTaskStuck } from "@fusion/dashboard/app/utils/taskStuck";
|
|
import "./GraphTaskNode.css";
|
|
import "./GraphHighlight.css";
|
|
import "./styles/drag.css";
|
|
|
|
type TaskCardComponentProps = ComponentProps<typeof TaskCard>;
|
|
|
|
type TaskCardBridgeProps = Pick<
|
|
TaskCardComponentProps,
|
|
| "task"
|
|
| "projectId"
|
|
| "onOpenDetail"
|
|
| "addToast"
|
|
| "globalPaused"
|
|
| "onUpdateTask"
|
|
| "onArchiveTask"
|
|
| "onUnarchiveTask"
|
|
| "onDeleteTask"
|
|
| "onRetryTask"
|
|
| "onOpenDetailWithTab"
|
|
| "taskStuckTimeoutMs"
|
|
| "onOpenMission"
|
|
| "onMoveTask"
|
|
| "lastFetchTimeMs"
|
|
| "workflowStepNameLookup"
|
|
>;
|
|
|
|
export interface GraphTaskNodeProps extends TaskCardBridgeProps, Pick<HTMLAttributes<HTMLDivElement>, "onMouseEnter" | "onMouseLeave" | "onClick"> {
|
|
style?: CSSProperties;
|
|
position: GraphPosition;
|
|
scale: number;
|
|
isSelected?: boolean;
|
|
isHighlighted?: boolean;
|
|
isDimmed?: boolean;
|
|
onNodePositionChange: (taskId: string, position: GraphPosition) => void;
|
|
onNodeDragStateChange?: (isDragging: boolean) => void;
|
|
onNodeDragEnd?: () => void;
|
|
}
|
|
|
|
const ACTIVE_STATUSES = new Set(["planning", "researching", "executing", "finalizing", "merging", "merging-fix"]);
|
|
|
|
function getStatusLabel(status?: string): string {
|
|
if (!status) {
|
|
return "Executing";
|
|
}
|
|
|
|
return status.charAt(0).toUpperCase() + status.slice(1);
|
|
}
|
|
|
|
export function GraphTaskNode({
|
|
style,
|
|
position,
|
|
scale,
|
|
isSelected = false,
|
|
isHighlighted = false,
|
|
isDimmed = false,
|
|
onMouseEnter,
|
|
onMouseLeave,
|
|
onClick,
|
|
onNodePositionChange,
|
|
onNodeDragStateChange,
|
|
onNodeDragEnd,
|
|
...taskCardProps
|
|
}: GraphTaskNodeProps) {
|
|
const { task, globalPaused, taskStuckTimeoutMs, lastFetchTimeMs, onOpenDetail } = taskCardProps;
|
|
const isFailed = task.status === "failed";
|
|
const isPaused = task.paused === true;
|
|
const isStuck = isTaskStuck(task, taskStuckTimeoutMs, lastFetchTimeMs);
|
|
/*
|
|
FNXC:PluginLifecycleColumns 2026-07-30-03:40 (U11 #2515 audit):
|
|
Keyed on `column === "triage"`, this went permanently FALSE for default-lineage
|
|
cards once U11 merged Todo into Planning and dropped the `triage` id — an
|
|
awaiting-approval card sits in `todo` now. The node then stopped showing the
|
|
awaiting-approval state AND fell through to `isActive`, rendering a card that is
|
|
blocked on a human as if it were running.
|
|
|
|
The column condition is DELETED rather than converted, because it was always
|
|
redundant: `awaiting-approval` is written only by the plan-approval gate and the
|
|
replan-cap park, both of which act on a card in the planning lane, so the status
|
|
alone is the signal. Deleting it is also the only option that needs no resolution —
|
|
this is a synchronous React render, where an IR lookup is not available.
|
|
*/
|
|
/*
|
|
FNXC:PluginLifecycleColumns 2026-07-31-11:50 (PR #2644 review, greptile P1):
|
|
A STALE APPROVAL STATUS MUST NOT HIDE A RUNNING CARD. Dropping the column condition made the
|
|
awaiting-approval signal status-only, which is right for a planning-lane card — but `awaiting-approval`
|
|
is DURABLE, so a card that carries it into an execution lane was rendered as not-active: no active
|
|
styling, no execution-status indicator, no current-step metadata, while it was plainly running.
|
|
|
|
So the suppression now yields to an execution SIGNAL rather than to a column name. If the card shows
|
|
execution activity, it is active and the stale approval status is residue; if it does not, the approval
|
|
state is the truth. That ordering needs no IR lookup, which matters here — this is a synchronous React
|
|
render.
|
|
|
|
The `in-progress` literal is pre-existing and NOT on the triage bar; converting it needs the board's
|
|
column traits, which this component is not given. Left with this note rather than half-converted.
|
|
*/
|
|
const hasExecutionSignal = task.column === "in-progress" || ACTIVE_STATUSES.has(task.status as string);
|
|
const isAwaitingApproval = task.status === "awaiting-approval" && !hasExecutionSignal;
|
|
const isActive =
|
|
!globalPaused &&
|
|
!isFailed &&
|
|
!isPaused &&
|
|
!isStuck &&
|
|
!isAwaitingApproval &&
|
|
hasExecutionSignal;
|
|
|
|
const hasValidCurrentStep =
|
|
typeof task.currentStep === "number" &&
|
|
task.currentStep >= 0 &&
|
|
Array.isArray(task.steps) &&
|
|
task.currentStep < task.steps.length;
|
|
const isInReview = task.column === "in-review";
|
|
|
|
const drag = useNodeDrag({
|
|
taskId: task.id,
|
|
position,
|
|
scale,
|
|
canDrag: isSelected,
|
|
onPositionChange: onNodePositionChange,
|
|
onDragStateChange: onNodeDragStateChange,
|
|
onDragEnd: onNodeDragEnd,
|
|
onDoubleTap: () => onOpenDetail(task),
|
|
});
|
|
|
|
return (
|
|
<div
|
|
className={`graph-task-node${isSelected ? " graph-node--draggable graph-task-node--selected" : ""}${drag.isDragging ? " graph-node--dragging" : ""}${isHighlighted ? " graph-task-node--highlighted graph-node--highlighted" : ""}${isDimmed ? " graph-task-node--dimmed graph-node--dimmed" : ""}${isActive ? " graph-task-node--active" : ""}${isInReview ? " graph-task-node--in-review" : ""}`}
|
|
style={style}
|
|
draggable={false}
|
|
data-testid={`graph-task-node-${task.id}`}
|
|
data-current-step={isActive && hasValidCurrentStep ? String(task.currentStep) : undefined}
|
|
onMouseEnter={onMouseEnter}
|
|
onMouseLeave={onMouseLeave}
|
|
onClick={onClick}
|
|
onDoubleClick={(event) => {
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
onOpenDetail(task);
|
|
}}
|
|
onClickCapture={drag.onClickCapture}
|
|
onPointerDown={drag.onPointerDown}
|
|
onPointerMove={drag.onPointerMove}
|
|
onPointerUp={drag.onPointerUp}
|
|
onPointerCancel={drag.onPointerCancel}
|
|
>
|
|
{isActive ? (
|
|
<div className="graph-task-active-indicator">
|
|
<span className="graph-task-active-indicator-text">{getStatusLabel(task.status)}</span>
|
|
</div>
|
|
) : null}
|
|
<TaskCard {...taskCardProps} onOpenDetail={() => {}} disableDrag={true} />
|
|
</div>
|
|
);
|
|
}
|