{"record":{"id":"08baccff9ace3338","repo":"paperclipai/paperclip","slug":"status-must-be-succeeded-failed-or-review-requir","errorCode":null,"errorMessage":"status must be succeeded, failed, or review_required","messagePattern":"status must be succeeded, failed, or review_required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/worker.ts","lineNumber":552,"sourceCode":"        spaceSlug: stringField(params.spaceSlug),\n        projectId: stringField(params.projectId),\n        rootIssueId: stringField(params.rootIssueId),\n        maxCharacters: typeof params.maxCharacters === \"number\" ? params.maxCharacters : null,\n        maxCharactersPerSource: typeof params.maxCharactersPerSource === \"number\" ? params.maxCharactersPerSource : null,\n        backfillStartAt: stringField(params.backfillStartAt),\n        backfillEndAt: stringField(params.backfillEndAt),\n        routineRun: params.routineRun === true,\n        includeComments: params.includeComments !== false,\n        includeDocuments: params.includeDocuments !== false,\n        workItemId: stringField(params.workItemId),\n        operationIssueId: stringField(params.operationIssueId),\n      });\n    });\n\n    ctx.actions.register(\"record-paperclip-distillation-outcome\", async (params) => {\n      const status = stringField(params.status);\n      if (status !== \"succeeded\" && status !== \"failed\" && status !== \"review_required\") {\n        throw new Error(\"status must be succeeded, failed, or review_required\");\n      }\n      const runId = stringField(params.runId);\n      if (!runId) throw new Error(\"runId is required\");\n      return recordPaperclipDistillationOutcome(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        wikiId: stringField(params.wikiId),\n        spaceSlug: stringField(params.spaceSlug),\n        runId,\n        cursorId: stringField(params.cursorId),\n        status,\n        sourceHash: stringField(params.sourceHash),\n        sourceWindowEnd: stringField(params.sourceWindowEnd),\n        warning: stringField(params.warning),\n        costCents: typeof params.costCents === \"number\" ? params.costCents : null,\n        retryCount: typeof params.retryCount === \"number\" ? params.retryCount : null,\n      });\n    });\n","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/worker.ts#L534-L570","documentation":"Thrown by the record-paperclip-distillation-outcome worker action when params.status is not one of succeeded|failed|review_required. Status drives cursor advancement (only 'succeeded' with cursor/source/window advances the cursor) so an unknown value would leave the cursor in an ambiguous state.","triggerScenarios":"Calling the record-paperclip-distillation-outcome action with status missing, blank, or a value like 'success', 'error', 'pending', 'review'.","commonSituations":"Caller maps an upstream result enum onto Paperclip status and uses the wrong vocabulary ('success' instead of 'succeeded'); typo; partial params from a retry handler.","solutions":["Map outcomes to exactly: 'succeeded', 'failed', or 'review_required'.","Normalise upstream enums (e.g. 'success'->'succeeded') before calling the action.","If a run needs human eyes, use 'review_required', not 'pending'."],"exampleFix":"// before\nrecord(..., { status: 'success', runId });\n// after\nrecord(..., { status: 'succeeded', runId });","handlingStrategy":"type-guard","validationCode":"const STATUSES = ['succeeded','failed','review_required'] as const;\nfunction assertOutcomeStatus(value: unknown) {\n  if (typeof value !== 'string' || !(STATUSES as readonly string[]).includes(value)) {\n    throw new Error(`status must be one of ${STATUSES.join(', ')}`);\n  }\n}","typeGuard":"const OUTCOME_STATUSES = ['succeeded','failed','review_required'] as const;\ntype DistillationOutcomeStatus = typeof OUTCOME_STATUSES[number];\nfunction isOutcomeStatus(value: unknown): value is DistillationOutcomeStatus {\n  return typeof value === 'string' && (OUTCOME_STATUSES as readonly string[]).includes(value);\n}","tryCatchPattern":null,"preventionTips":["Map upstream enums ('success'->'succeeded') before calling.","Use 'review_required' (not 'pending') when a human must look."],"tags":["paperclip","distillation","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}