Skip to content

feat: 智能编排引擎升级 — 服务层统一 + 自适应调度 + DAG可视化 + 自省 + 跨模型审查#6

Merged
z23cc merged 3 commits intomainfrom
fn-10-dag-delight
Apr 4, 2026
Merged

feat: 智能编排引擎升级 — 服务层统一 + 自适应调度 + DAG可视化 + 自省 + 跨模型审查#6
z23cc merged 3 commits intomainfrom
fn-10-dag-delight

Conversation

@z23cc
Copy link
Copy Markdown
Owner

@z23cc z23cc commented Apr 4, 2026

Summary

6-phase intelligent orchestration engine upgrade:

  • Phase 1: flowctl-service crate — unified CLI/daemon/MCP execution paths (service layer extraction)
  • Phase 2: CPM critical path scheduling + domain-based adaptive parallelism
  • Phase 3: Real-time SVG DAG visualization + interactive drag-to-edit with optimistic locking
  • Phase 4: Token tracking + execution replay timeline in web dashboard
  • Phase 5: Cross-model adversarial review protocol (consensus/conflict detection)
  • Phase 6: 7 Delight items (ASCII DAG, estimates, sound, webhook, replay, diff, smart recovery)

Key metrics

  • 38 files changed, +5000/-1035 lines
  • 250 tests pass, clippy clean
  • 7 crates (new: flowctl-service)
  • MCP latency: fork process → direct service call

Test plan

  • cargo build --release && cargo test --all
  • bash scripts/smoke_test.sh
  • Verify flowctl status --dag prints ASCII DAG
  • Verify web dashboard at localhost:17319 shows DAG visualization
  • Verify MCP tools respond without process fork delay

🤖 Generated with Claude Code

z23cc and others added 3 commits April 4, 2026 22:34
…r and connection management

- New flowctl-service crate added as 7th workspace member
- ServiceError enum with 9 variants: TaskNotFound, EpicNotFound, InvalidTransition, DependencyUnsatisfied, CrossActorViolation, DbError, IoError, ValidationError, CoreError
- From<DbError> and From<CoreError> impls via thiserror derive
- ConnectionProvider trait for sync/async connection abstraction
- FileConnectionProvider wraps flowctl_db::open() for file-backed DBs
- open_sync() convenience function for CLI callers
- Tests for file-backed, in-memory, and sync connection paths

Task: fn-10-dag-delight.1
…detection

- Add review_protocol.rs in flowctl-core: ReviewFinding, ReviewVerdict, ModelReview, ConsensusResult types and compute_consensus() with conservative algorithm
- Add `flowctl codex cross-model` CLI command that runs Codex + Claude reviews in parallel and computes consensus
- Add `flowctl_review` MCP tool exposing cross-model review capability
- Add agents/cross-model-reviewer.md with protocol documentation
- 15 unit tests covering consensus logic, serialization, edge cases

Task: fn-10-dag-delight.9
…duler, DAG viz, introspection, cross-model review

6-phase upgrade implementing CEO-reviewed plan:

Phase 1: flowctl-service crate — extracted lifecycle business logic from CLI,
unified CLI/daemon/MCP execution paths. ServiceError enum, connection management.

Phase 2: CPM critical path scheduling + domain-based adaptive parallelism.
Cold start falls back to fixed parallelism until 5+ completions per domain.

Phase 3: Real-time DAG visualization — SVG rendering with Sugiyama layout,
WebSocket-driven status updates, interactive drag-to-edit dependencies with
optimistic locking (409 on conflict).

Phase 4: AI introspection engine — token tracking queries, execution replay
timeline page, token consumption bar charts in web dashboard.

Phase 5: Cross-model adversarial review protocol — ReviewProtocol types,
consensus/conflict detection, flowctl codex cross-model command, MCP tool.

Phase 6: Delight pack — ASCII DAG (flowctl status --dag), task time estimates,
sound notifications, webhook integration, replay/diff commands, smart recovery.

250 tests pass, clippy clean, zero warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@z23cc z23cc merged commit 2b93d78 into main Apr 4, 2026
1 check failed
z23cc added a commit that referenced this pull request Apr 9, 2026
P0 fixes (state loss — root cause of 5 issues):
- get_flow_dir() now walks up directory tree (FLOW_STATE_DIR env → walk-up → CWD)
  Fixes: #1 state loss, #3 state not persistent, #5 worker parallel fail,
  #9 .flow symlink issues. Same pattern as git finding .git.
- flowctl recover --epic <id> [--dry-run]: rebuilds task completion status
  from git log. Fixes #11 no recovery after state loss.

P1 fixes (guard + review):
- Guard graceful fallback: missing tools → "skipped" (not "failed").
  Only actual failures block pipeline. Fixes #8.
- Review-backend availability check: if rp-cli/codex not in PATH,
  auto-fallback to "none" with warning. Fixes #7.

P2 fixes (UX):
- Slug max length 40→20 chars. "Django+React platform with account
  management" → "fn-3-django-react-plat" not 40-char monster. Fixes #2 #12.
- Brainstorm auto-skip: trivial tasks (≤10 words, contains "fix"/"typo"/etc)
  skip brainstorm entirely. Fixes #6.
- --interactive flag: pause at key decisions. Fixes #10.

370 tests pass. Zero new dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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