{"record":{"id":"0e7c9b75345d49df","repo":"paperclipai/paperclip","slug":"no-realizeworkspace-event-found-for-environment","errorCode":null,"errorMessage":"No realizeWorkspace event found for environment ${environmentId}","messagePattern":"No realizeWorkspace event found for environment (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sdk/src/testing.ts","lineNumber":289,"sourceCode":"  const release = events.find((e) => (e.type === \"releaseLease\" || e.type === \"destroyLease\") && e.environmentId === environmentId);\n  if (!acquire) throw new Error(`No acquireLease event found for environment ${environmentId}`);\n  if (!release) throw new Error(`No releaseLease/destroyLease event found for environment ${environmentId}`);\n  if (acquire.timestamp > release.timestamp) {\n    throw new Error(`acquireLease occurred after release for environment ${environmentId}`);\n  }\n  return { acquire, release };\n}\n\n/** Assert that workspace realization occurred between lease acquire and release. */\nexport function assertWorkspaceRealizationLifecycle(\n  events: EnvironmentEventRecord[],\n  environmentId: string,\n): EnvironmentEventRecord {\n  const lifecycle = assertLeaseLifecycle(events, environmentId);\n  const realize = events.find(\n    (e) => e.type === \"realizeWorkspace\" && e.environmentId === environmentId,\n  );\n  if (!realize) throw new Error(`No realizeWorkspace event found for environment ${environmentId}`);\n  if (realize.timestamp < lifecycle.acquire.timestamp) {\n    throw new Error(`realizeWorkspace occurred before acquireLease for environment ${environmentId}`);\n  }\n  if (realize.timestamp > lifecycle.release.timestamp) {\n    throw new Error(`realizeWorkspace occurred after release for environment ${environmentId}`);\n  }\n  return realize;\n}\n\n/** Assert that an execute call occurred within the lease lifecycle. */\nexport function assertExecutionLifecycle(\n  events: EnvironmentEventRecord[],\n  environmentId: string,\n): EnvironmentEventRecord[] {\n  const lifecycle = assertLeaseLifecycle(events, environmentId);\n  const execEvents = events.filter(\n    (e) => e.type === \"execute\" && e.environmentId === environmentId,\n  );","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/plugins/sdk/src/testing.ts#L271-L307","documentation":"Test-helper assertion in assertWorkspaceRealizationLifecycle: after assertLeaseLifecycle validated the lease, no 'realizeWorkspace' event was found for the environmentId. The plugin under test acquired a lease but never realized a workspace inside it, so workspace realization is missing from the recorded lifecycle.","triggerScenarios":"Thrown at packages/plugins/sdk/src/testing.ts:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure realizeWorkspace is called for the environment during setup."],"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"}