{"record":{"id":"71190eebcc3bb73d","repo":"gastownhall/beads","slug":"issue-s-not-found-71190e","errorCode":null,"errorMessage":"issue %s not found","messagePattern":"issue (.+?) not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_port.go","lineNumber":127,"sourceCode":"\t\tif current.Status != types.StatusOpen {\n\t\t\treturn fmt.Errorf(\"step %s already claimed (status: %s)\", id, current.Status)\n\t\t}\n\t\treturn tx.UpdateIssue(ctx, id, map[string]interface{}{\"status\": types.StatusInProgress}, actor)\n\t})\n}\n\nfunc newStandaloneStoreMolWriter(store storage.DoltStorage) storeMolWriter {\n\treturn storeMolWriter{DoltStorage: store}\n}\n\ntype uowMolReader struct {\n\tuw uow.UnitOfWork\n}\n\nfunc (r uowMolReader) GetIssue(ctx context.Context, id string) (*types.Issue, error) {\n\tissue, isWisp, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(r.uw), id)\n\tif errors.Is(rerr, storage.ErrNotFound) {\n\t\treturn nil, fmt.Errorf(\"issue %s not found\", id)\n\t}\n\tif rerr != nil {\n\t\treturn nil, fmt.Errorf(\"resolving %s: %w\", id, rerr)\n\t}\n\t// READS, ALL OF THEM, and they stay for the reason the writes did not.\n\t// uowMolReader is a PORT: it adapts a caller's open unit of work to the\n\t// molecule commands' reader interface, and every method here must answer\n\t// from inside that transaction. issueops.Reader opens one of its own, so a\n\t// role-routed port would show the molecule the last committed state while\n\t// the command that owns the transaction is midway through changing it.\n\t// A reader role bound to a caller's transaction is the follow-up\n\t// (ga-2ltro.12). The wisp branch here is a read that follows the row\n\t// GetIssueOrWisp already found, not a front door choosing where to write.\n\tvar labels []string\n\tvar err error\n\tif isWisp {\n\t\tlabels, err = r.uw.LabelUseCase().GetWispLabels(ctx, id) //nolint:forbidigo // in-transaction port read; issueops.Reader would open its own\n\t} else {","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_port.go#L109-L145","documentation":"`uowMolReader.GetIssue` resolves an ID as either an issue or a wisp via `workapi.GetIssueOrWisp`. When the resolver reports `storage.ErrNotFound`, the port translates it into a plain `issue %s not found` error. This is the port's canonical 'this ID does not exist' signal for all molecule read commands.","triggerScenarios":"`GetMoleculeProgress`, `GetMoleculeLastActivity`, `runMolBurnProxiedServer`, or `runWispCreateProxiedServer` pass an ID to `GetIssue` that matches neither an issue nor a wisp — `errors.Is(rerr, storage.ErrNotFound)` fires and the formatted error is returned.","commonSituations":"Typo'd molecule/issue IDs; IDs belonging to a different database or before a sync; wisps that were flushed/compacted away; scripts referencing issues deleted after a `bd mol burn`.","solutions":["Verify the ID exists: `bd show <id>` or `bd list | grep <id>`.","Re-list the molecule's children (`bd mol progress <molecule>`) to get valid current IDs.","Sync first (`bd dolt pull`) if the issue may exist on another machine but not locally."],"exampleFix":"// before\nstats, err := reader.GetMoleculeProgress(ctx, \"bd-mol-42\") // wrong id\n// after\nstats, err := reader.GetMoleculeProgress(ctx, \"bd-100\")   // verified molecule id","handlingStrategy":"type-guard","validationCode":"// shell: verify the ID resolves before molecule reads\nbd show \"$ID\" --json >/dev/null 2>&1 || { echo \"$ID not found locally; run bd dolt pull?\"; exit 1; }","typeGuard":"func issueExists(ctx context.Context, r MolReader, id string) bool {\n\tiss, err := r.GetIssue(ctx, id)\n\treturn err == nil && iss != nil\n}","tryCatchPattern":"if iss, err := reader.GetIssue(ctx, id); err != nil {\n\tif strings.Contains(err.Error(), \"not found\") {\n\t\treturn nil // expected absence; handle idempotently\n\t}\n\treturn err\n}","preventionTips":["Sync (`bd dolt pull`) before reading IDs produced on other machines.","Copy IDs from command output instead of retyping them.","Remember wisps may be flushed/compacted — don't cache wisp IDs long-term."],"tags":["cli","not-found","issue-lookup"],"backgroundTag":"issue-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}