{"record":{"id":"b956e7e7e640f1f2","repo":"paperclipai/paperclip","slug":"only-task-watchdog-runs-can-create-watchdog-discov","errorCode":null,"errorMessage":"Only task-watchdog runs can create watchdog-discovered product bug follow-ups","messagePattern":"Only task-watchdog runs can create watchdog-discovered product bug follow-ups","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":4953,"sourceCode":"    blockerIssueId: string | null | undefined,\n  ) {\n    const current = Array.isArray(existing)\n      ? existing.filter((value): value is string => typeof value === \"string\" && value.trim().length > 0)\n      : [];\n    return blockerIssueId ? [...new Set([...current, blockerIssueId])] : [...new Set(current)];\n  }\n\n  async function findCurrentSerializedWatchdogChild(parent: { id: string; companyId: string }) {\n    const children = await db\n      .select({\n        id: issueRows.id,\n        status: issueRows.status,\n      })\n      .from(issueRows)\n      .where(and(\n        eq(issueRows.companyId, parent.companyId),\n        eq(issueRows.parentId, parent.id),\n        inArray(issueRows.status, [\"todo\", \"in_progress\", \"in_review\", \"blocked\"]),\n        isNull(issueRows.hiddenAt),\n      ))\n      .orderBy(asc(issueRows.issueNumber), asc(issueRows.createdAt), asc(issueRows.id));\n    return children[0] ?? null;\n  }\n\n  async function blockWatchdogParentOnCurrentChild(input: {\n    actor: ReturnType<typeof getActorInfo>;\n    watchdogParentIssueId: string | null | undefined;\n    currentChildIssueId: string | null | undefined;\n  }) {\n    if (!input.watchdogParentIssueId || !input.currentChildIssueId) return;\n    const watchdogParent = await svc.getById(input.watchdogParentIssueId);\n    if (!watchdogParent || watchdogParent.originKind !== TASK_WATCHDOG_ORIGIN_KIND) return;\n    if (watchdogParent.status !== \"in_progress\" && watchdogParent.status !== \"blocked\") return;\n\n    const relations = await svc.getRelationSummaries(watchdogParent.id);\n    const nextBlockedByIssueIds = mergeIssueBlockerIds(","sourceCodeStart":4935,"sourceCodeEnd":4971,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L4935-L4971","documentation":"A watchdog product-bug discovery payload was supplied but resolveTaskWatchdogMutationScope found the run has no watchdog scope at all, so a non-watchdog agent run tried to file a watchdog-discovered follow-up.","triggerScenarios":"Thrown at server/src/routes/issues.ts:4789 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an authorization rule, not a bug: perform the action with an actor that satisfies the stated constraint (board user, the owning agent, or an in-scope resource).","If access should be allowed, verify the actor's credentials/company scope and the resource's ownership before retrying."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}