Migrate 12 TestMain files to use EnsureDoltContainerForTestMain/TerminateDoltContainer
instead of the removed StartTestDoltServer/TestDoltServer API.
Replace testServer.IsCrashed()/CrashError() crash detection with standalone
testutil.DoltContainerCrashed()/DoltContainerCrashError() in 6 test files.
(bd-m7sy)
Set BEADS_TEST_MODE=1 unconditionally in all 9 TestMain functions that
interact with Dolt, before the test server nil check. Previously, test
mode was only set when the test Dolt server started successfully — if it
failed, tests silently connected to production on port 3307 and created
testdb_/beads_* databases that were never cleaned up.
Also:
- Fix doctorTestServerPort() fallback from 3307 (production) to 0
- Add dolt_purge_dropped_databases() to both cleanup functions
- Add isolated test Dolt server to integration test TestMain which had
no server at all, causing bd init subprocess to hit production
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: beads/crew/lydia <steve.yegge@gmail.com>
Replace database-per-test with Dolt branch-per-test using COW snapshots
for three internal packages. Each TestMain creates one shared database
with committed schema; each test branches from main via DOLT_CHECKOUT
with MaxOpenConns=1 for session-level isolation.
New infrastructure:
- testutil.StartTestBranch / CleanTestBranches / SetupSharedTestDB
- dolt.Config.MaxOpenConns field wired into openServerConnection
- dolt.CreateIgnoredTables for wisps tables (not in commits)
cmd/bd and doctor packages stay on database-per-test because they
reopen stores from metadata.json via NewFromConfig, which creates new
connections on main branch.
Closes: bd--6tf4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
- Add TestMain wrappers for molecules and tracker packages to spin up
isolated test Dolt servers instead of hitting prod on port 3307
- Harden applyConfigDefaults: in test mode, BEADS_DOLT_PORT always
overrides cfg.ServerPort (even if set from metadata.json)
- Add hard panic guard in dolt.New() if test mode tries to use prod port
- Clear GT_ROOT in TestDoltServerIsRunning to avoid finding daemon PID
- Set BEADS_DOLT_PORT in cmd/bd test server setup for bd init path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix gofmt alignment in cmd/bd/repo.go
- Replace panic with sentinel port (port 1) in applyConfigDefaults when
BEADS_TEST_MODE=1 without BEADS_DOLT_PORT, preventing CI crashes while
still guarding against accidental production connections
- Add dolt availability skip in protocol_test.go newWorkspace
- Remove stale //go:build cgo tag from molecules_test.go
- Change Fatalf to Skipf for Dolt connection failures in molecule loader tests
- Update store_unit_test.go to match sentinel port behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strip out the multi-backend storage layer: factory pattern, memory/in-memory
provider, connection string parsing, local provider, and associated tests.
Inline Dolt as the sole storage backend. Part of Dolt-Native Beads v2 epic.
WIP - SQLite removal in progress, more cleanup phases to follow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Remove the entire internal/storage/sqlite/ package (~43K lines) and update
all 80+ files that imported it to use either the Dolt backend directly
(test files) or the storage factory (production files).
Key changes:
- Delete internal/storage/sqlite/ directory (150+ files)
- Update factory to make Dolt the sole backend, treating "sqlite" as alias for "dolt"
- Replace sqlite.New() calls with dolt.New() in tests, factory.New() in production
- Replace *sqlite.SQLiteStorage with storage.Storage interface throughout
- Replace :memory: SQLite URIs with t.TempDir() for Dolt compatibility
- Inline sqlite.GenerateIssueID() as SHA-256 content hashing where needed
- Fix import cycle in routing/routes.go (routing→factory→dolt→routing)
- Preserve backward-compatible beads.NewSQLiteStorage() wrapper in public API
228 files changed, 605 insertions, 43,821 deletions.
go vet ./... passes clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes the leaky abstraction where molecules and importer packages directly used
sqlite.BatchCreateOptions and type-asserted to *sqlite.SQLiteStorage.
Changes:
- Add storage.BatchCreateOptions and storage.OrphanHandling as backend-agnostic types
- Add CreateIssuesWithFullOptions to Storage interface
- Implement for SQLite, Dolt, and Memory backends
- Update molecules.go to use Storage interface method instead of sqlite type assertion
- Update importer.go to use storage types instead of sqlite-specific interface
- Update cook.go to use storage interface method
- Add deprecated aliases in sqlite package for backward compatibility
This enables batch create optimizations for all backends including Dolt.
Closes: bd-nrcp
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/jasper
Rig: beads
Role: polecat
Remove Gas Town-specific type constants (TypeMolecule, TypeGate, TypeConvoy,
TypeMergeRequest, TypeSlot, TypeAgent, TypeRole, TypeRig, TypeEvent, TypeMessage)
from internal/types/types.go.
Beads now only has core work types built-in:
- bug, feature, task, epic, chore
All Gas Town types are now purely custom types with no special handling in beads.
Use string literals like "gate" or "molecule" when needed, and configure
types.custom in config.yaml for validation.
Changes:
- Remove Gas Town type constants from types.go
- Remove mr/mol aliases from Normalize()
- Update bd types command to only show core types
- Replace all constant usages with string literals throughout codebase
- Update tests to use string literals
This decouples beads from Gas Town, making it a generic issue tracker.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Core beads built-in types now only include work types:
- bug, feature, task, epic, chore
Gas Town types (molecule, gate, convoy, merge-request, slot, agent,
role, rig, event, message) are now "well-known custom types":
- Constants still exist for code convenience
- Require types.custom configuration for validation
- bd types command shows core types and configured custom types
Changes:
- types.go: Separate core work types from well-known custom types
- IsValid(): Only accepts core work types
- bd types: Updated to show core types and custom types from config
- memory.go: Use ValidateWithCustom for custom type support
- multirepo.go: Only check core types as built-in
- Updated all tests to configure custom types
This allows Gas Town (and other projects) to define their own types
via config while keeping beads core focused on work tracking.
Closes: bd-find4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements gt-0ei3: Template molecules now live in a separate molecules.jsonl
file, distinct from work items in issues.jsonl.
Key changes:
- Add internal/molecules package for loading molecule catalogs
- Implement hierarchical loading: built-in → town → user → project
- Molecules use their own ID namespace (mol-*) with prefix validation skipped
- Templates are marked with is_template: true and are read-only
- bd list excludes templates by default (existing functionality)
The hierarchical loading allows:
- Built-in molecules shipped with bd binary (placeholder for future)
- Town-level: ~/gt/.beads/molecules.jsonl (Gas Town)
- User-level: ~/.beads/molecules.jsonl
- Project-level: .beads/molecules.jsonl
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>