{"record":{"id":"35ff82a5ad24c088","repo":"stablyai/orca","slug":"recovery-persistence-implementation-changed-updat","errorCode":null,"errorMessage":"recovery persistence implementation changed; update this benchmark","messagePattern":"recovery persistence implementation changed; update this benchmark","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/legacy-worker-recovery-persistence-benchmark.mjs","lineNumber":38,"sourceCode":"  throw new Error('fixture-mib and trials must be positive integers')\n}\n\nconst runtimeSource = await readFile(runtimePath, 'utf8')\nconst recoveryStart = runtimeSource.indexOf(\n  'private async persistLegacyWorkerTerminalRecoveryBatch'\n)\nconst recoveryEnd = runtimeSource.indexOf(\n  'private reconcileMissingLegacyWorkerTerminal',\n  recoveryStart\n)\nconst recoverySource = runtimeSource.slice(recoveryStart, recoveryEnd)\nif (\n  recoveryStart === -1 ||\n  recoveryEnd === -1 ||\n  !recoverySource.includes('await this.flushWorkspaceSessionOrThrowAsync()') ||\n  recoverySource.includes('flushOrThrow()')\n) {\n  throw new Error('recovery persistence implementation changed; update this benchmark')\n}\n\nconst root = await mkdtemp(join(tmpdir(), 'orca-legacy-recovery-benchmark-'))\nconst filler = 'x'.repeat(fixtureMiB * 1024 * 1024)\n\nfunction payload(state) {\n  return JSON.stringify({ state, filler })\n}\n\nfunction writeDurableSync(path, body) {\n  const tempPath = `${path}.sync.tmp`\n  writeFileSync(tempPath, body)\n  const fd = openSync(tempPath, 'r')\n  try {\n    fsyncSync(fd)\n  } finally {\n    closeSync(fd)\n  }","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/legacy-worker-recovery-persistence-benchmark.mjs#L20-L56","documentation":"The benchmark fingerprints the persistLegacyWorkerTerminalRecoveryBatch method in src/main/runtime/orca-runtime.ts by slicing between two marker strings and asserting the slice still calls flushWorkspaceSessionOrThrowAsync and no longer calls flushOrThrow(). It throws when that fingerprint no longer matches, forcing the benchmark to be reconciled with the new implementation rather than silently timing the wrong code.","triggerScenarios":"The method was renamed, moved, or removed; the flush call changed from flushWorkspaceSessionOrThrowAsync to another API; the end marker 'private reconcileMissingLegacyWorkerTerminal' shifted or was renamed.","commonSituations":"Refactoring the runtime recovery path; renaming the flush helper; reorganizing orca-runtime.ts methods.","solutions":["Update the indexOf marker strings and the includes()/excludes() assertions to match the new recovery implementation.","Confirm the benchmark still times the same durable-write pattern it claims to compare.","If the method was intentionally removed, delete or rewrite the benchmark rather than loosening the guard."],"exampleFix":"// before\nconst recoveryStart = runtimeSource.indexOf('private async persistLegacyWorkerTerminalRecoveryBatch')\nif (!recoverySource.includes('await this.flushWorkspaceSessionOrThrowAsync()')) {\n  throw new Error('recovery persistence implementation changed; update this benchmark')\n}\n\n// after — point the fingerprint at the new method and flush call\nconst recoveryStart = runtimeSource.indexOf('private async persistLegacyWorkerRecoveryBatch')\nif (!recoverySource.includes('await this.flushWorkspaceSessionAsync()')) {\n  throw new Error('recovery persistence implementation changed; update this benchmark')\n}","handlingStrategy":"validation","validationCode":"// Verify the benchmark's fingerprint is still valid before running\nconst recoverySource = runtimeSource.slice(\n  runtimeSource.indexOf('private async persistLegacyWorkerTerminalRecoveryBatch'),\n  runtimeSource.indexOf('private reconcileMissingLegacyWorkerTerminal')\n)\nif (!recoverySource.includes('await this.flushWorkspaceSessionOrThrowAsync()')) {\n  throw new Error('benchmark fingerprint stale; update markers to match new runtime')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When refactoring persistLegacyWorkerTerminalRecoveryBatch, update the benchmark's marker strings and includes() checks in the same change.","Treat this guard as a refactor alarm, not noise — a stale benchmark times the wrong code."],"tags":["benchmark","refactor-guard","persistence"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}