bd sync: 2025-12-27 15:56:42

This commit is contained in:
Steve Yegge
2025-12-27 15:56:42 -08:00
parent 87f535a65e
commit c8b912cbe6
179 changed files with 3051 additions and 10283 deletions

View File

@@ -18,17 +18,17 @@ import (
var molSquashCmd = &cobra.Command{
Use: "squash <molecule-id>",
Short: "Compress molecule execution into a digest",
Long: `Squash a molecule's ephemeral children into a single digest issue.
Long: `Squash a molecule's wisp children into a single digest issue.
This command collects all ephemeral child issues of a molecule (Ephemeral=true),
This command collects all wisp child issues of a molecule (Wisp=true),
generates a summary digest, and promotes the wisps to persistent by
clearing their Wisp flag (or optionally deletes them).
The squash operation:
1. Loads the molecule and all its children
2. Filters to only wisps (ephemeral issues with Ephemeral=true)
2. Filters to only wisps (ephemeral issues with Wisp=true)
3. Generates a digest (summary of work done)
4. Creates a permanent digest issue (Ephemeral=false)
4. Creates a permanent digest issue (Wisp=false)
5. Clears Wisp flag on children (promotes to persistent)
OR deletes them with --delete-children
@@ -95,13 +95,13 @@ func runMolSquash(cmd *cobra.Command, args []string) {
os.Exit(1)
}
// Filter to only ephemeral children (exclude root)
// Filter to only wisp children (exclude root)
var wispChildren []*types.Issue
for _, issue := range subgraph.Issues {
if issue.ID == subgraph.Root.ID {
continue // Skip root
}
if issue.Ephemeral {
if issue.Wisp {
wispChildren = append(wispChildren, issue)
}
}
@@ -113,13 +113,13 @@ func runMolSquash(cmd *cobra.Command, args []string) {
SquashedCount: 0,
})
} else {
fmt.Printf("No ephemeral children found for molecule %s\n", moleculeID)
fmt.Printf("No wisp children found for molecule %s\n", moleculeID)
}
return
}
if dryRun {
fmt.Printf("\nDry run: would squash %d ephemeral children of %s\n\n", len(wispChildren), moleculeID)
fmt.Printf("\nDry run: would squash %d wisp children of %s\n\n", len(wispChildren), moleculeID)
fmt.Printf("Root: %s\n", subgraph.Root.Title)
fmt.Printf("\nWisp children to squash:\n")
for _, issue := range wispChildren {
@@ -247,7 +247,7 @@ func squashMolecule(ctx context.Context, s storage.Storage, root *types.Issue, c
CloseReason: fmt.Sprintf("Squashed from %d wisps", len(children)),
Priority: root.Priority,
IssueType: types.TypeTask,
Ephemeral: false, // Digest is permanent, not a wisp
Wisp: false, // Digest is permanent, not a wisp
ClosedAt: &now,
}
@@ -283,7 +283,7 @@ func squashMolecule(ctx context.Context, s storage.Storage, root *types.Issue, c
return nil, err
}
// Delete ephemeral children (outside transaction for better error handling)
// Delete wisp children (outside transaction for better error handling)
if !keepChildren {
deleted, err := deleteWispChildren(ctx, s, childIDs)
if err != nil {
@@ -319,7 +319,7 @@ func deleteWispChildren(ctx context.Context, s storage.Storage, ids []string) (i
func init() {
molSquashCmd.Flags().Bool("dry-run", false, "Preview what would be squashed")
molSquashCmd.Flags().Bool("keep-children", false, "Don't delete ephemeral children after squash")
molSquashCmd.Flags().Bool("keep-children", false, "Don't delete wisp children after squash")
molSquashCmd.Flags().String("summary", "", "Agent-provided summary (bypasses auto-generation)")
molCmd.AddCommand(molSquashCmd)