Skip to content

feat(flowctl): declarative Changes pattern, bidirectional dep index, --dry-run#13

Merged
z23cc merged 2 commits intomainfrom
fn-57-declarative-changes-pattern-and
Apr 6, 2026
Merged

feat(flowctl): declarative Changes pattern, bidirectional dep index, --dry-run#13
z23cc merged 2 commits intomainfrom
fn-57-declarative-changes-pattern-and

Conversation

@z23cc
Copy link
Copy Markdown
Owner

@z23cc z23cc commented Apr 6, 2026

Summary

  • Changes pattern: All mutation operations return a declarative Changes struct (creates/updates/removes) instead of writing directly. ChangesApplier persists to JSON + libSQL with automatic audit logging to the events table.
  • Bidirectional dependency index: task_reverse_deps table with SQL triggers maintains O(1) reverse lookups, replacing O(N×M) BFS scan. DepRepo gains list_dependents() and list_all_dependents().
  • --dry-run CLI flag: Global flag on all 9 mutation commands. Computes changes and outputs JSON preview without persisting.

Inspired by IWE reference implementation's Changes pattern.

Test plan

  • 255 tests pass (cargo test --all)
  • cargo clippy --all-targets -- -D warnings clean
  • 2 new integration tests verify dry-run produces no side effects
  • Reverse dep triggers tested with chain dependencies
  • Manual: flowctl --dry-run task create --epic <id> --title "test" outputs JSON preview

🤖 Generated with Claude Code

z23cc and others added 2 commits April 6, 2026 23:38
Add codex/ directory with TOML agent definitions and skill markdown
for OpenAI Codex CLI integration. Simplify install-codex.sh to use
~/.flow/bin/ as the canonical flowctl path. Update plugin.json with
full interface metadata and streamlined README instructions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ex, and --dry-run support

Introduce three foundational improvements inspired by IWE reference:

1. Changes pattern: All mutation operations (task/epic create, reset, skip,
   split, dep add/rm) now return a declarative Changes struct instead of
   writing directly. ChangesApplier persists to JSON + libSQL with auto
   audit logging to events table.

2. Bidirectional dependency index: task_reverse_deps table with SQL triggers
   on task_deps INSERT/DELETE. O(1) reverse lookups replace O(N×M) BFS scan.
   DepRepo gains list_dependents() and list_all_dependents() methods.

3. --dry-run CLI flag: Global flag on all mutation commands. Computes changes
   and outputs JSON preview without persisting. 2 integration tests verify
   no side effects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@z23cc z23cc merged commit 3cddba0 into main Apr 6, 2026
1 of 2 checks 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