feat: add cross-store wisp→digest squash (bd-kwjh.4)
- Add wisp detection in mol squash: checks wisp storage if not in main - squashWispToPermanent: creates digest in permanent, deletes from wisp - Fix directory naming: .beads-wisps → .beads-wisp (singular, matches doc) - Add comprehensive tests for wisp squash scenarios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -625,7 +625,7 @@ func FindAllDatabases() []DatabaseInfo {
|
||||
// WispDirName is the default name for the wisp storage directory.
|
||||
// This directory is a sibling to .beads/ and should be gitignored.
|
||||
// Wisps are ephemeral molecules - the "steam" in Gas Town's engine metaphor.
|
||||
const WispDirName = ".beads-wisps"
|
||||
const WispDirName = ".beads-wisp"
|
||||
|
||||
// FindWispDir locates or determines the wisp storage directory.
|
||||
// The wisp directory is a sibling to the .beads directory.
|
||||
@@ -639,7 +639,7 @@ func FindWispDir() string {
|
||||
}
|
||||
|
||||
// Wisp dir is a sibling to .beads
|
||||
// e.g., /project/.beads -> /project/.beads-wisps
|
||||
// e.g., /project/.beads -> /project/.beads-wisp
|
||||
projectRoot := filepath.Dir(beadsDir)
|
||||
return filepath.Join(projectRoot, WispDirName)
|
||||
}
|
||||
@@ -720,7 +720,7 @@ func EnsureWispGitignore() error {
|
||||
}
|
||||
|
||||
// IsWispDatabase checks if a database path is a wisp database.
|
||||
// Returns true if the database is in a .beads-wisps directory.
|
||||
// Returns true if the database is in a .beads-wisp directory.
|
||||
func IsWispDatabase(dbPath string) bool {
|
||||
if dbPath == "" {
|
||||
return false
|
||||
|
||||
@@ -1402,17 +1402,17 @@ func TestIsWispDatabase(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "wisp database",
|
||||
dbPath: "/project/.beads-wisps/beads.db",
|
||||
dbPath: "/project/.beads-wisp/beads.db",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "nested wisp",
|
||||
dbPath: "/some/deep/path/.beads-wisps/beads.db",
|
||||
dbPath: "/some/deep/path/.beads-wisp/beads.db",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "similar but not wisp",
|
||||
dbPath: "/project/.beads-wisps-backup/beads.db",
|
||||
dbPath: "/project/.beads-wisp-backup/beads.db",
|
||||
expected: false,
|
||||
},
|
||||
}
|
||||
@@ -1452,12 +1452,12 @@ func TestEnsureWispGitignore(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "already gitignored",
|
||||
existingContent: ".beads-wisps/\n",
|
||||
existingContent: ".beads-wisp/\n",
|
||||
expectAppend: false,
|
||||
},
|
||||
{
|
||||
name: "already gitignored without slash",
|
||||
existingContent: ".beads-wisps\n",
|
||||
existingContent: ".beads-wisp\n",
|
||||
expectAppend: false,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user