Skip to content

chore(flowctl): rename flowctl-db-lsql → flowctl-db#10

Merged
z23cc merged 1 commit intomainfrom
chore/rename-flowctl-db
Apr 5, 2026
Merged

chore(flowctl): rename flowctl-db-lsql → flowctl-db#10
z23cc merged 1 commit intomainfrom
chore/rename-flowctl-db

Conversation

@z23cc
Copy link
Copy Markdown
Owner

@z23cc z23cc commented Apr 5, 2026

Summary

Now that the rusqlite stack is fully removed (fn-19), the -lsql suffix on the sole storage crate is redundant. Renames everything back to plain flowctl-db.

Changes

  • crates/flowctl-db-lsql/crates/flowctl-db/ (directory)
  • package.name: flowctl-db-lsqlflowctl-db
  • Workspace deps + 5 Cargo.toml files updated
  • All flowctl_db_lsqlflowctl_db (14 Rust files)
  • try_open_lsql_conntry_open_conn helper
  • Doc comments cleaned up (no more "Successor to flowctl-db" language)
  • CLAUDE.md storage runtime note updated

Verification

  • cargo check --all --release → green
  • cargo test --all --release → 269 passed, 2 ignored (same as fn-19, fastembed model-download gated)

Pure mechanical rename. No logic changes.

Now that the rusqlite stack is fully removed, the -lsql suffix is
redundant. Renames crate + package + all references.

- crates/flowctl-db-lsql/ → crates/flowctl-db/
- package name: flowctl-db-lsql → flowctl-db
- workspace deps, all Cargo.toml references updated
- All flowctl_db_lsql identifiers → flowctl_db (14 files)
- try_open_lsql_conn → try_open_conn helper
- Doc comments cleaned up (libsql is now just 'the storage layer')
- CLAUDE.md storage runtime note updated

Verified: cargo check --all --release green, cargo test --all --release
all green (same 269 passed, 2 ignored as fn-19).
Copilot AI review requested due to automatic review settings April 5, 2026 09:43
@z23cc z23cc merged commit 1308b4b into main Apr 5, 2026
1 check failed
@z23cc z23cc deleted the chore/rename-flowctl-db branch April 5, 2026 09:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the libSQL storage crate from flowctl-db-lsql to flowctl-db now that the rusqlite implementation has been removed, and updates downstream crates to use the new crate name/module path.

Changes:

  • Renamed the storage crate/package to flowctl-db and updated workspace membership/dependencies.
  • Updated Rust imports/usages from flowctl_db_lsql to flowctl_db across service, daemon, and CLI.
  • Re-homed the async libSQL implementation files under crates/flowctl-db/ (including schema + repo/query modules) and refreshed docs.

Reviewed changes

Copilot reviewed 21 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
flowctl/crates/flowctl-service/src/lifecycle.rs Switched DB repo usages to flowctl_db::*Repo
flowctl/crates/flowctl-service/src/error.rs Updated DbError source type to flowctl_db::DbError
flowctl/crates/flowctl-service/src/connection.rs Updated connection helpers to call flowctl_db::open_async()
flowctl/crates/flowctl-service/Cargo.toml Dependency rename to flowctl-db
flowctl/crates/flowctl-db/** New crate location/name; async libSQL schema, repos, metrics, memory, indexer, events, errors
flowctl/crates/flowctl-daemon/src/server.rs Updated daemon DB open to flowctl_db::open_async()
flowctl/crates/flowctl-daemon/src/handlers/*.rs Updated repo/error conversions to flowctl_db
flowctl/crates/flowctl-daemon/Cargo.toml Dependency rename to flowctl-db
flowctl/crates/flowctl-cli/src/commands/workflow/mod.rs Updated libSQL connection helper to use flowctl_db
flowctl/crates/flowctl-cli/src/commands/db_shim.rs Sync shim updated to wrap flowctl_db
flowctl/crates/flowctl-cli/tests/*.rs Tests updated to use flowctl_db
flowctl/crates/flowctl-cli/Cargo.toml Dependency rename to flowctl-db
flowctl/Cargo.toml Workspace member/dependency path rename to crates/flowctl-db
flowctl/Cargo.lock Lockfile updated for new package name
CLAUDE.md Updated storage runtime note to reflect final crate naming
Comments suppressed due to low confidence (2)

flowctl/crates/flowctl-cli/src/commands/db_shim.rs:61

  • open() intentionally leaks the Database handle via std::mem::forget(db) with a comment that dropping Database closes the file. Elsewhere (e.g. service/daemon helpers) a Database is created and then immediately dropped after calling connect(). Please clarify the actual lifetime requirement for libsql::Database in this codebase and make all call sites consistent (either remove the leak if unnecessary, or ensure the Database is retained wherever a Connection is used).
pub fn open(working_dir: &Path) -> Result<Connection, DbError> {
    block_on(async {
        let db = flowctl_db::open_async(working_dir).await?;
        let conn = db.connect()?;
        // Leak the Database handle to keep it alive for the process lifetime.
        // (libsql Database drop closes the file.)
        std::mem::forget(db);
        Ok(Connection { conn })
    })

flowctl/crates/flowctl-db/Cargo.toml:5

  • Package metadata still says "successor to flowctl-db" in the crate description, but the PR description notes that the "Successor to flowctl-db" language was removed/cleaned up. Either update the description to match the new wording, or adjust the PR description to reflect that this text remains in Cargo metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 47 to 58
/// Try to open a libSQL async DB connection (for service-layer calls).
pub(crate) fn try_open_lsql_conn() -> Option<libsql::Connection> {
let cwd = env::current_dir().ok()?;
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.ok()?;
rt.block_on(async {
let db = flowctl_db_lsql::open_async(&cwd).await.ok()?;
let db = flowctl_db::open_async(&cwd).await.ok()?;
db.connect().ok()
})
}
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says the helper was renamed try_open_lsql_conntry_open_conn, but this module still defines and re-exports try_open_lsql_conn. If the rename is no longer desired, consider updating the PR description; otherwise, rename the helper (and update imports in workflow/lifecycle.rs) to keep the API consistent with the description.

Copilot uses AI. Check for mistakes.
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.

2 participants