refactor(fleet-data): extract shared toposort::waves from binaries#154
Merged
Conversation
The Kahn topological-level grouping for plan subtasks was byte-identical in fleet-plan-tree::waves and fleet-waves::waves. Promote it to fleet_data::toposort::waves and have both binaries depend on the shared copy. Behaviour is preserved verbatim — covered by the existing fleet-waves render snapshot plus new unit tests for empty / single / linear / parallel-chain / multi-dep / missing-dep inputs.
6 tasks
NagyVikt
added a commit
that referenced
this pull request
May 16, 2026
scripts/codex-fleet/demo/ — bring up the production tmux layout
populated by fake plan / pane / counter / quality-score files so the
real fleet-state / fleet-plan-tree / fleet-waves binaries render against
synthetic data. No real codex sessions, no API spend.
For design iteration: change a renderer, kill + restart the demo, see
the result.
Structure:
- up.sh seeds /tmp/claude-viz/, spawns tmux session
codex-fleet-demo with overview (8 worker panes) +
fleet/plan/waves/watcher dashboard windows, starts
tick simulator
- down.sh tears tmux down, removes synthetic state, deletes
runtime plan copy so working tree stays clean
- tick.sh mutates the runtime plan every 3s (configurable
via CODEX_FLEET_DEMO_TICK_INTERVAL): assign idle
agents, advance claimed → in_progress → completed,
refresh pane scrollback. Loops when all 12 tasks
complete (set CODEX_FLEET_DEMO_LOOP=0 to stop)
- agent-auth PATH shim so fleet-data::accounts::load_via_agent_auth()
reads 8 synthetic accounts instead of the real binary
- scenarios/refactor-wave/plan.json committed template; up.sh copies
to openspec/plans/<slug>/ at runtime
8 agents named after herbs; clover is scripted to be "capped" so the
PaneState::Capped branch is exercised. Plan has 12 tasks across 3
dependency waves modelled after the recent refactor PRs (#154-159).
Usage: bash scripts/codex-fleet/demo/up.sh
Prereqs: tmux, jq, release builds of fleet-state, fleet-plan-tree,
fleet-waves (+ optionally fleet-watcher) under rust/target/release/.
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
waves()Kahn topological sort out offleet-waves/src/main.rsandfleet-plan-tree/src/main.rsinto a newfleet-data::toposortmodulefleet_data::toposort::wavesinstead of carrying byte-identical inlined copiesBehavior
Byte-identical to the previous inlined copies. Verified by
fleet-waves' existinginstarender snapshot (passes unchanged).Two pre-existing quirks documented but preserved (no behavior change):
vec![vec![]](one empty wave), notvec![]Test plan
cargo check -p fleet-data -p fleet-waves -p fleet-plan-tree— cleancargo test -p fleet-data -p fleet-waves -p fleet-plan-tree— 60/60 pass incl. insta snapshot🤖 Generated with Claude Code