{"record":{"id":"3ad934e9eaef5ca2","repo":"gastownhall/beads","slug":"creating-compound-w","errorCode":null,"errorMessage":"creating compound: %w","messagePattern":"creating compound: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_bond.go","lineNumber":339,"sourceCode":"\t// rather than in a write of its own: a create decides which table the row\n\t// goes to, and carrying the labels with it means one decision places both.\n\t// The separate write this replaces was made through molWriter.AddLabel,\n\t// whose two implementations each resolved the plane again by a different\n\t// predicate, so the row and its label were free to disagree.\n\tcompound := &types.Issue{\n\t\tTitle:       compoundTitle,\n\t\tDescription: fmt.Sprintf(\"Compound proto bonding %s and %s\", protoA.ID, protoB.ID),\n\t\tStatus:      types.StatusOpen,\n\t\tPriority:    minPriority(protoA.Priority, protoB.Priority),\n\t\tIssueType:   types.TypeEpic,\n\t\tLabels:      []string{MoleculeLabel},\n\t\tBondedFrom: []types.BondRef{\n\t\t\t{SourceID: protoA.ID, BondType: bondType, BondPoint: \"\"},\n\t\t\t{SourceID: protoB.ID, BondType: bondType, BondPoint: \"\"},\n\t\t},\n\t}\n\tif err := w.CreateIssue(ctx, compound, actorName); err != nil {\n\t\treturn nil, fmt.Errorf(\"creating compound: %w\", err)\n\t}\n\tcompoundID := compound.ID\n\n\t// Add parent-child dependencies from compound to both proto roots\n\tdepA := &types.Dependency{\n\t\tIssueID:     protoA.ID,\n\t\tDependsOnID: compoundID,\n\t\tType:        types.DepParentChild,\n\t}\n\tif err := w.AddDependency(ctx, depA, actorName); err != nil {\n\t\treturn nil, fmt.Errorf(\"linking proto A: %w\", err)\n\t}\n\n\tdepB := &types.Dependency{\n\t\tIssueID:     protoB.ID,\n\t\tDependsOnID: compoundID,\n\t\tType:        types.DepParentChild,\n\t}","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_bond.go#L321-L357","documentation":"bondProtoProtoInto creates the compound issue via w.CreateIssue; if the write fails the bonding operation aborts with this wrapped error, before any dependencies are linked.","triggerScenarios":"w.CreateIssue(ctx, compound, actorName) errors during `bd mol bond` of two protos — destination DB lock, ID collision, or driver write failure.","commonSituations":"Another bd process holds the database lock, or storage is read-only/full while a bond automation runs.","solutions":["Read the wrapped inner error for the driver-level cause.","Ensure no other bd process holds the DB lock; retry the bond command.","Check disk space/permissions on the .beads storage, then re-run."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check storage writable/lock-free\nif err := w.CreateIssue(ctx, probe, actorName); err != nil && !errors.Is(err, someExpected) { /* fail fast */ }","typeGuard":null,"tryCatchPattern":"compound, err := bondProtoProtoInto(ctx, w, protoA, protoB, bt, actor)\nif err != nil {\n    if strings.Contains(err.Error(), \"creating compound:\") {\n        // storage write failed; check locks/disk and retry\n    }\n    return err\n}","preventionTips":["Run bonds when no other bd process holds the DB lock.","Ensure sufficient disk space and write permissions on .beads storage.","Retry after fixing storage; check for a partially created compound first."],"tags":["mol-bond","storage","dolt","create-issue"],"backgroundTag":"storage-write-failure","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}