{"record":{"id":"a2f8375aa3c6bcfd","repo":"paperclipai/paperclip","slug":"invalid-decision-training-query","errorCode":null,"errorMessage":"Invalid decision training query","messagePattern":"Invalid decision training query","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/routes/decision-training.ts","lineNumber":125,"sourceCode":"        cutoffAt: preview.cutoffAt.toISOString(),\n        decisionOutcome: preview.decisionOutcome,\n        snapshot: preview.snapshot,\n      });\n    },\n  );\n\n  router.get(\"/companies/:companyId/decision-training\", async (req, res) => {\n    const companyId = req.params.companyId as string;\n    assertBoard(req);\n    assertCompanyAccess(req, companyId);\n    const parsed = z.object({\n      project: z.string().guid().optional(),\n      kind: sourceKindSchema.optional(),\n      author: z.string().optional(),\n      q: z.string().trim().max(500).optional(),\n    }).safeParse(req.query);\n    if (!parsed.success) {\n      res.status(400).json({ error: \"Invalid decision training query\", details: parsed.error.flatten() });\n      return;\n    }\n    res.json(await svc.list(companyId, {\n      projectId: parsed.data.project,\n      kind: parsed.data.kind,\n      author: parsed.data.author,\n      q: parsed.data.q,\n    }));\n  });\n\n  router.get(\"/companies/:companyId/decision-training/export.jsonl\", async (req, res) => {\n    const companyId = req.params.companyId as string;\n    assertBoard(req);\n    assertCompanyAccess(req, companyId);\n    const rows = await svc.list(companyId);\n    const body = rows\n      .map(({ example }) => JSON.stringify({\n        retentionPolicy: example.retentionPolicy,","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/decision-training.ts#L107-L143","documentation":"Query-schema guard on the decision-training list route: the query string failed the project/kind/author/q Zod schema (bad UUID, overlong q, unknown param), so the list request is rejected with 400 instead of running an unfiltered or malformed query.","triggerScenarios":"Thrown at server/src/routes/decision-training.ts:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the offending parameter to satisfy the constraint stated in the error message (type, range, or allowed values), then retry.","Refer to the route's request validation in the named file and the shared validators for the accepted format."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}