{"record":{"id":"f51b41d21283dcc7","repo":"different-ai/openwork","slug":"cannot-assign-to-constant-name","errorCode":null,"errorMessage":"Cannot assign to constant '${name}'.","messagePattern":"Cannot assign to constant '(.+?)'\\.","errorType":"exception","errorClass":"InterpreterRuntimeError","httpStatus":null,"severity":"error","filePath":"packages/codemode/src/interpreter/runtime.ts","lineNumber":3295,"sourceCode":"    }\n\n    // A parameter default that forward-references a later (not-yet-bound) parameter - JS TDZ.\n    if (binding.initialized === false) {\n      throw new InterpreterRuntimeError(`Cannot access '${name}' before initialization.`, node).as(\"ReferenceError\")\n    }\n\n    return binding.value\n  }\n\n  private setIdentifierValue(name: string, value: unknown, node: AstNode): unknown {\n    const binding = this.resolveBinding(name)\n\n    if (!binding) {\n      throw new InterpreterRuntimeError(`Unknown identifier '${name}'.`, node).as(\"ReferenceError\")\n    }\n\n    if (!binding.mutable) {\n      throw new InterpreterRuntimeError(`Cannot assign to constant '${name}'.`, node).as(\"TypeError\")\n    }\n\n    binding.value = value\n    return value\n  }\n\n  private resolveBinding(name: string): Binding | undefined {\n    for (let index = this.scopes.length - 1; index >= 0; index -= 1) {\n      const scope = this.scopes[index]\n      const binding = scope?.get(name)\n\n      if (binding) {\n        return binding\n      }\n    }\n\n    return undefined\n  }","sourceCodeStart":3277,"sourceCodeEnd":3313,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/packages/codemode/src/interpreter/runtime.ts#L3277-L3313","documentation":"Error \"Cannot assign to constant '${name}'.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at packages/codemode/src/interpreter/runtime.ts:3295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}