Skip to content

Fix BUG-012: re-project plan-DAG on status change so rail and DAG stay in sync#810

Merged
anutron merged 1 commit into
masterfrom
argus/fix-rail-dag-sync
Jun 25, 2026
Merged

Fix BUG-012: re-project plan-DAG on status change so rail and DAG stay in sync#810
anutron merged 1 commit into
masterfrom
argus/fix-rail-dag-sync

Conversation

@anutron

@anutron anutron commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

What

After a status change (Shift+S step / ready_to_close clear), the rail updated but the plan-DAG node rendered the stale state — e.g. a worker showed review-✓ in the DAG while the rail (correctly) showed it back to working.

Root cause

planview.UpdateData short-circuits to a no-op when projectionSig is unchanged. The sig folded in each node's ID + State.Glyph() + Drillable + edges — but not the resolved status icon. A status step changes a node's icon (rail-parity review ✓ / role-status glyph) while its task-derived State stays "working", so the sig didn't change, UpdateData no-op'd, and the DAG kept the stale icon while the rail moved on.

Fix

Fold the node icon (Glyph + Animated) into projectionSig, so an icon-only change re-installs the layout and the DAG updates in lock-step with the rail. failed/cancelled (from #795) sync via the same projection. No goroutine, no screen.Sync() — follows the existing debounced Refresher/doRefresh pattern. (Chose this over forcing SetData every step, which would reset the operator's plan cursor / fanned groups — the regression UpdateData exists to prevent.)

Tests / verification

  • planview.TestUpdateData_IconChangeReinstalls + hera.TestRefresh_StatusStepReprojectsPlanNode (both red→green).
  • go test -race ./internal/tui/hera/... ./internal/tui/planview/... pass; golangci-lint v2.11.4 --new-from-rev → 0 issues; build + gofmt clean.
  • Code drift (the hera-view base spec already requires the plan node icon to mirror the rail 1:1) — no new spec.

🤖 Generated with Claude Code

…in sync

planview.UpdateData short-circuited on an unchanged projectionSig, which folded
in only each node's State.Glyph()/Drillable/edges — never the resolved status
ICON. A hera status step / ready_to_close clear changes a node's icon (the
rail-parity review checkmark / role-status glyph) while its task-derived State is
unchanged (e.g. still working), so the signature didn't change, UpdateData
no-op'd, and the DAG node kept rendering the stale checkmark while the rail moved on.

Fold the node icon (Glyph + Animated) into projectionSig so an icon-only change
re-installs the layout and the DAG node updates in lock-step with the rail.
failed/cancelled states sync via the same projection. No goroutine, no Sync.

Drift fix toward the existing hera-view plan-node parity contract; no new spec.
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/drn/argus/internal/tui/hera 92.15% (ø)
github.com/drn/argus/internal/tui/planview 93.74% (+0.04%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/drn/argus/internal/tui/planview/planview.go 93.74% (+0.04%) 943 (+6) 884 (+6) 59 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/drn/argus/internal/tui/hera/plan_test.go
  • github.com/drn/argus/internal/tui/planview/planview_test.go

@anutron anutron merged commit fa93759 into master Jun 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant