Skip to content

Embedded mode: wisp tables not auto-created (createIgnoredTables not called) #2979

@sussdorff

Description

@sussdorff

Bug

bd dep add and bd delete fail with table not found: wisp_dependencies in embedded mode (v1.0.0). The createIgnoredTables() function that creates the dolt_ignore'd wisp tables (wisps, wisp_dependencies, wisp_labels, wisp_events, wisp_comments) is never called during embedded Dolt initialization.

Reproduction

bd init   # or any existing embedded-mode repo
bd create --title="A" --type=task --priority=2
bd create --title="B" --type=task --priority=2
bd dep add <B-id> <A-id>
# Error: failed to check for dependency cycle: Error 1146: table not found: wisp_dependencies

Same for bd delete:

Error: getting dependencies: get dependencies from wisp_dependencies: Error 1146: table not found: wisp_dependencies

Environment

  • bd version 1.0.0 (Homebrew)
  • macOS, embedded Dolt mode (metadata.json: dolt_mode: "embedded")
  • dolt_ignore patterns are correctly set (wisps, wisp_%)
  • All 23 schema migrations ran successfully
  • The dependencies table exists, but wisp_dependencies does not

Root Cause

createIgnoredTables() in internal/storage/dolt/migrations.go is called during server-mode schema init (initSchemaOnDB) but appears to not be called in the embedded Dolt code path. Since wisp tables are dolt_ignore'd, they only exist in the working set and must be recreated on every new Dolt session.

The cycle detection CTE in internal/storage/issueops/dependencies.go queries both dependencies and wisp_dependencies in a UNION. Unlike blocked.go which gracefully skips missing tables (isTableNotExistErrorcontinue), the cycle detection query fails hard.

Workaround

Manually create the tables via dolt CLI:

dolt --data-dir=.beads/embeddeddolt sql -q "
CREATE TABLE IF NOT EXISTS wisps LIKE issues;
CREATE TABLE IF NOT EXISTS wisp_dependencies LIKE dependencies;
CREATE TABLE IF NOT EXISTS wisp_labels LIKE labels;
CREATE TABLE IF NOT EXISTS wisp_events LIKE events;
CREATE TABLE IF NOT EXISTS wisp_comments LIKE comments;
"

Tables persist in the working set after creation.

Suggested Fix

  1. Call createIgnoredTables() during embedded Dolt initialization (same as server mode)
  2. Additionally: make the cycle detection CTE in dependencies.go gracefully handle missing wisp_dependencies (like blocked.go already does)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions