Skip to content

docs: document pending placeholder node invariant in graphs AGENTS.md#22311

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
claude/update-agents-md-6849683
Draft

docs: document pending placeholder node invariant in graphs AGENTS.md#22311
github-actions[bot] wants to merge 1 commit into
mainfrom
claude/update-agents-md-6849683

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated AGENTS.md update triggered by commit 6849683.

This PR was generated by Claude Code analyzing the diff from the latest push to main and updating any stale AGENTS.md files.

Why this belongs in AGENTS.md
Path: ui-v2/src/graphs/AGENTS.md
Proposed text: New Pitfalls bullet — "Pending placeholder nodes are not the same as unfinished nodes. A `task-run` with `state_type === 'PENDING'` and `end_time === null` is a downstream task that never ran (e.g., blocked by upstream failure), not an in-progress node. Use `isPendingPlaceholderNode()` (exported from `factories/nodeBar.ts`) to test for this; these nodes must not tick, must render at minimum bar width, and must use the stable cache key `'pending-placeholder'`. The `!end_time` check alone misclassifies them as running."
Non-obvious evidence: The concept "pending placeholder" does not appear in the RunGraphNode type or any model file. A developer editing tick logic, bar width, or cache key generation would naturally reach for `!end_time` as the "not-yet-finished" test — this PR specifically corrects that assumption by splitting the concept into three distinct states: running (tick + grow), pending-flow-run (tick + grow), and pending-placeholder-task-run (no tick, minimum width, stable key). Nothing in the model file documents this three-way distinction.
Cross-cutting scope: `isPendingPlaceholderNode` is already imported and used across `factories/nodeBar.ts` (bar width), `factories/node.ts` (tick start/stop, cache key). Any future change to node animation, sizing, or cache invalidation must handle this case consistently — it is a subsystem-level invariant across the factories layer.
Why not code comment/docstring: The predicate function itself is in `nodeBar.ts`, but callers in `node.ts` import it without any explanation of the model-level semantics. A future agent editing tick behavior in `node.ts` would not know to check `nodeBar.ts` for this guard without AGENTS.md pointing to it. Code comments would need to be duplicated across both files; AGENTS.md surfaces it once at the subsystem level.
Durability: The pending-placeholder distinction is a graph model invariant tied to Prefect's task execution semantics (downstream tasks that never run due to upstream failure). It will persist as long as the graph renders these nodes, independent of the triggering PR.
Counter-evidence checked: Existing AGENTS.md Pitfalls section (6 bullets — culling, linting, teardown, singletons, async layout, z-index); no mention of node state categories or tick behavior. `factories/nodeBar.ts` has no comment explaining why PENDING+null gets minimum width. `factories/node.ts` has no comment explaining why shouldNodeTick excludes isPendingPlaceholderNode.

Changed files in triggering push
ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.stories.tsx
ui-v2/src/components/flow-runs/flow-run-graph/pending-downstream-data.json
ui-v2/src/graphs/factories/node.test.ts
ui-v2/src/graphs/factories/node.ts
ui-v2/src/graphs/factories/nodeBar.test.ts
ui-v2/src/graphs/factories/nodeBar.ts

@github-actions

Copy link
Copy Markdown
Contributor Author

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

0 participants