{"record":{"id":"165c79e10f0b0935","repo":"ruvnet/ruflo","slug":"unknown-lease","errorCode":"unknown-lease","errorMessage":"unknown lease ${presented.leaseId}","messagePattern":"unknown lease (.+?)","errorType":"exception","errorClass":"InMemoryFenceReferenceError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/codex/src/harness/in-memory-fenced-lease-reference.ts","lineNumber":183,"sourceCode":"    const stored = this.assertStoredFence(presented);\n    if (stored.expiresAtMs <= this.now()) {\n      this.leases.delete(presented.leaseId);\n      throw new InMemoryFenceReferenceError('expired-fence', `lease ${presented.leaseId} expired`);\n    }\n  }\n\n  current(repositoryId?: string): FencedLease[] {\n    this.pruneExpired(this.now());\n    return [...this.leases.values()]\n      .map(({ lease }) => lease)\n      .filter((lease) => repositoryId === undefined || lease.repositoryId === repositoryId)\n      .sort((left, right) => compare(left.leaseId, right.leaseId))\n      .map(copyLease);\n  }\n\n  private assertStoredFence(presented: FencedLease): StoredLease {\n    const stored = this.leases.get(presented.leaseId);\n    if (!stored) throw new InMemoryFenceReferenceError('unknown-lease', `unknown lease ${presented.leaseId}`);\n    const current = stored.lease;\n    if (\n      current.repositoryId !== presented.repositoryId\n      || current.sessionId !== presented.sessionId\n      || current.workloadId !== presented.workloadId\n      || current.worktreeId !== presented.worktreeId\n      || current.kind !== presented.kind\n      || !sameStrings(current.scopes, presented.scopes)\n      || current.epoch !== presented.epoch\n      || current.version !== presented.version\n    ) {\n      throw new InMemoryFenceReferenceError('stale-fence', `stale or altered fence ${presented.leaseId}`);\n    }\n    return stored;\n  }\n\n  private pruneExpired(now: number): void {\n    for (const [leaseId, stored] of this.leases) {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/codex/src/harness/in-memory-fenced-lease-reference.ts#L165-L201","documentation":"Thrown when an operation references a leaseId that the registry does not know. Defense: persist the leaseId returned by acquire and never fabricate one; after a restart, re-acquire instead of reusing stale in-memory identifiers.","triggerScenarios":"Thrown at v3/@claude-flow/codex/src/harness/in-memory-fenced-lease-reference.ts:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Acquire the lease first and use the leaseId returned by acquire, not a fabricated or stale id.","Check that the lease was not already released or expired before presenting it.","Verify you are talking to the same lease manager instance that issued the lease."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}