{"record":{"id":"0974d55fcd24ada6","repo":"gastownhall/beads","slug":"applygraph-read-existing-wisp-deps-for-s-w","errorCode":null,"errorMessage":"applyGraph: read existing wisp deps for %s: %w","messagePattern":"applyGraph: read existing wisp deps for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/issue.go","lineNumber":1540,"sourceCode":"\t\t\tif err != nil || found {\n\t\t\t\treturn found, err\n\t\t\t}\n\t\t}\n\t\tdeps, ok := depCache[id]\n\t\tif !ok {\n\t\t\tregular, err := u.depRepo.ListByIssueIDs(ctx, []string{id}, DepListOpts{\n\t\t\t\tDirection:     DepDirectionOut,\n\t\t\t\tUseWispsTable: false,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn false, fmt.Errorf(\"applyGraph: read existing deps for %s: %w\", id, err)\n\t\t\t}\n\t\t\twisp, err := u.depRepo.ListByIssueIDs(ctx, []string{id}, DepListOpts{\n\t\t\t\tDirection:     DepDirectionOut,\n\t\t\t\tUseWispsTable: true,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn false, fmt.Errorf(\"applyGraph: read existing wisp deps for %s: %w\", id, err)\n\t\t\t}\n\t\t\tdeps = append(regular.Outgoing[id], wisp.Outgoing[id]...)\n\t\t\tdepCache[id] = deps\n\t\t}\n\t\tfor _, dep := range deps {\n\t\t\tif !followExistingDep(dep.Type) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfound, err := visit(dep.DependsOnID)\n\t\t\tif err != nil || found {\n\t\t\t\treturn found, err\n\t\t\t}\n\t\t}\n\t\treturn false, nil\n\t}\n\treturn visit(fromID)\n}\n","sourceCodeStart":1522,"sourceCodeEnd":1558,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/issue.go#L1522-L1558","documentation":"Same as the regular-deps variant but for the wisp_dependencies table: the second ListByIssueIDs call (UseWispsTable: true) in graphHasPath failed. Both tables must be readable so a blocking cycle closing through a wisp edge is detected.","triggerScenarios":"ApplyGraph walk reaches an uncached node and the wisp-table ListByIssueIDs query errors — wisp_dependencies table missing/corrupt, driver error, canceled context, or wrong storage mode (wisp table unsupported).","commonSituations":"Older database initialized before wisp_dependencies existed; embedded vs server storage mode mismatch; partial migration leaving wisp table absent.","solutions":["Verify wisp_dependencies table exists in the Dolt DB (migrate/run bd doctor).","Check driver connectivity and retry; read the wrapped error for the storage cause.","Confirm storage mode/config matches the initialized schema version.","If context timeouts recur, raise timeout or batch graph applies."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm wisp table is available before graph applies\nrows, err := db.Query(\"SHOW TABLES LIKE 'wisp_dependencies'\")\nif err != nil || !rows.Next() {\n    return fmt.Errorf(\"wisp_dependencies table missing; run migration\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if errors.Is(err, context.Canceled) {\n        return err // do not retry cancellation\n    }\n    return fmt.Errorf(\"applyGraph: wisp deps unavailable for %s: %w\", id, err)\n}","preventionTips":["Run bd init/doctor after upgrading so the wisp table exists.","Verify storage mode (embedded vs server) matches the initialized schema.","Retry transient network errors with backoff.","Set generous context deadlines for graph walks."],"tags":["storage","wisps","dependency-graph","database"],"backgroundTag":"dependency-list-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}