{"record":{"id":"d8dde0a51f7f9f66","repo":"koala73/worldmonitor","slug":"clearkillgate-no-ramp-configured","errorCode":null,"errorMessage":"[clearKillGate] no ramp configured","messagePattern":"\\[clearKillGate\\] no ramp configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/rampRunner.ts","lineNumber":248,"sourceCode":"  args: {},\n  handler: async (ctx) => {\n    const row = await loadConfig(ctx);\n    if (!row) throw new Error(\"[resumeRamp] no ramp configured\");\n    if (row.killGateTripped) {\n      throw new Error(\n        \"[resumeRamp] kill-gate is tripped; clearKillGate first after investigating.\",\n      );\n    }\n    await ctx.db.patch(row._id, { active: true });\n    return { ok: true };\n  },\n});\n\nexport const clearKillGate = internalMutation({\n  args: { reason: v.string() },\n  handler: async (ctx, { reason }) => {\n    const row = await loadConfig(ctx);\n    if (!row) throw new Error(\"[clearKillGate] no ramp configured\");\n    if (!row.killGateTripped) {\n      return { ok: true, noop: true };\n    }\n    await ctx.db.patch(row._id, {\n      killGateTripped: false,\n      killGateReason: undefined,\n      lastRunStatus: `kill-gate-cleared: ${reason.slice(0, 200)}`,\n    });\n    return { ok: true };\n  },\n});\n\n/**\n * Last-resort soft-clear of a `partial-failure` status. STRONGLY DISPREFERRED;\n * use `recoverFromPartialFailure` instead in nearly every case.\n *\n * Naive clear is RISKY when the export already succeeded. Concrete failure\n * shape: `assignAndExportWave` stamped contacts with `waveLabel` AND created","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/convex/broadcast/rampRunner.ts#L230-L266","documentation":"An internal error thrown by the clearKillGate internalMutation when loadConfig returns no ramp configuration row. It fires when an operator or automated flow calls clearKillGate before any ramp config document has ever been created, so there is no kill gate to clear. It is a sentinel guard on missing state; the input at fault is the absence of the singleton ramp config record. Callers must create/configure a ramp first; clearing the gate is meaningless without one.","triggerScenarios":"Thrown at convex/broadcast/rampRunner.ts:248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run configureRamp to create the ramp configuration before using kill-gate controls","Confirm the target Convex deployment actually has a ramp set up"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d06c8633d256c18e38133030bc3613976a96ec9","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}