{"record":{"id":"8f28a8f04a691379","repo":"affaan-m/ECC","slug":"createplancanvasserver-requires-a-session-store","errorCode":null,"errorMessage":"createPlanCanvasServer requires a session store","messagePattern":"createPlanCanvasServer requires a session store","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/plan-canvas/server.js","lineNumber":126,"sourceCode":"      \"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-src 'self'\";\n  }\n  res.writeHead(statusCode, headers);\n  res.end(html);\n}\n\nfunction createPlanCanvasServer({\n  store,\n  host = DEFAULT_HOST,\n  version = '0.0.0',\n  idleTimeoutMs = DEFAULT_IDLE_TIMEOUT_MS,\n  heartbeatMs = 15000,\n  thinkingStaleMs = DEFAULT_THINKING_STALE_MS,\n  typingExpiryMs = DEFAULT_TYPING_EXPIRY_MS,\n  presenceSweepMs = DEFAULT_PRESENCE_SWEEP_MS,\n  onIdleShutdown = null,\n  log = () => {}\n} = {}) {\n  if (!store) throw new Error('createPlanCanvasServer requires a session store');\n\n  const allowedHostnames = buildAllowedHostnames(host);\n  const wake = new EventEmitter();\n  wake.setMaxListeners(0);\n  const sseClients = new Map(); // key -> Set<res>\n  const awaitCounts = new Map(); // key -> active long-poll count\n  const workingKeys = new Map(); // key -> ms timestamp the agent took feedback\n  const typingKeys = new Map(); // key -> ms timestamp the agent signalled composing\n  const watchers = new Map(); // key -> fs.FSWatcher\n  const lastPresence = new Map(); // key -> last broadcast state, for sweep diffing\n  let idleTimer = null;\n  let presenceSweep = null;\n  let closed = false;\n\n  // --- presence + SSE ---------------------------------------------------\n\n  /**\n   * Presence never claims more than the server actually knows:","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/lib/plan-canvas/server.js#L108-L144","documentation":"Constructor guard in createPlanCanvasServer: the options object omitted the required store that backs the canvas session state. Without it the server would crash on first request, so the error fires at startup instead.","triggerScenarios":"Thrown at scripts/lib/plan-canvas/server.js:126 when the library encounters an invalid state.","commonSituations":"Raised when input validation fails because: createPlanCanvasServer requires a session store. Typically caused by a missing, malformed, or out-of-range argument or configuration value.","solutions":["Provide a value that satisfies the validation: createPlanCanvasServer requires a session store","Check the calling command or configuration for the reported field and correct it, then retry.","Run the command with --help to review the expected input shape and allowed values."],"exampleFix":"Correct the invalid input so that the following holds: createPlanCanvasServer requires a session store","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}