{"record":{"id":"0368e782586ed02f","repo":"eyaltoledano/claude-task-master","slug":"not-found","errorCode":"NOT_FOUND","errorMessage":"`Brief \"${nameOrId}\" not found in organization`","messagePattern":"`Brief \"(.+?)\" not found in organization`","errorType":"exception","errorClass":"TaskMasterError","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/briefs/services/brief-service.ts","lineNumber":219,"sourceCode":"\t\t\t\tnull\n\t\t\t: null;\n\n\t\treturn {\n\t\t\ttags: sortedTags,\n\t\t\tcurrentTag,\n\t\t\ttotalTags: sortedTags.length\n\t\t};\n\t}\n\n\t/**\n\t * Validate that a brief was found, throw error if not\n\t */\n\tvalidateBriefFound(\n\t\tbrief: Brief | undefined,\n\t\tnameOrId: string\n\t): asserts brief is Brief {\n\t\tif (!brief) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t`Brief \"${nameOrId}\" not found in organization`,\n\t\t\t\tERROR_CODES.NOT_FOUND\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":201,"sourceCodeEnd":226,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/briefs/services/brief-service.ts#L201-L226","documentation":"validateBriefFound is an assertion helper in BriefService: given an undefined brief it throws TaskMasterError with code NOT_FOUND stating the brief name/ID could not be found in the organization. It also narrows the type via `asserts brief is Brief` so callers can use the brief afterwards.","triggerScenarios":"Calling resolveBrief with a brief name or ID that does not exist in the selected organization, causing validateBriefFound to receive undefined from the lookup.","commonSituations":"Typo in brief name; brief belongs to a different organization than the one in context; brief was deleted or renamed; using an ID from another environment (staging vs production).","solutions":["List briefs in the current org (`tm briefs list` or equivalent) and use an exact name/ID","Verify the organization context matches the org the brief belongs to (`tm context org`)","If the brief was renamed/deleted, update the referencing command/script or recreate the brief","If passed as a URL, re-check the URL resolves to a brief in this org"],"exampleFix":"// before\nconst brief = await tmCore.briefs.resolveBrief('My-Brief'); // typo, NOT_FOUND\n// after\nconst briefs = await tmCore.briefs.listBriefs();\nconst match = briefs.find(b => b.name.toLowerCase() === 'my-brief');\nif (!match) throw new Error('Brief does not exist in this org');\nconst brief = await tmCore.briefs.resolveBrief(match.id);","handlingStrategy":"validation","validationCode":"const briefs = await tmCore.briefs.listBriefs();\nconst found = briefs.find(b => b.id === idOrName || b.name === idOrName);\nif (!found) throw new Error(`Brief \"${idOrName}\" not in org ${ctx.orgId} — check spelling/context`);","typeGuard":"function isBrief(b: Brief | undefined): b is Brief {\n  return !!b && typeof b.id === 'string' && b.id.length > 0;\n}","tryCatchPattern":"try {\n  brief = await tmCore.briefs.resolveBrief(nameOrId);\n} catch (e) {\n  if (e instanceof TaskMasterError && e.code === 'NOT_FOUND') {\n    const suggestions = await tmCore.briefs.listBriefs(); // show closest matches\n  } else { throw e; }\n}","preventionTips":["Copy brief IDs from `tm briefs list` output instead of typing names","Confirm the organization context matches where the brief lives","Check for renames/deletions when old scripts start failing with NOT_FOUND","Normalize casing/whitespace of brief names before lookup"],"tags":["not-found","brief","organization"],"backgroundTag":"resource-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}