{"record":{"id":"9cd72e088ed9d19b","repo":"deepseek-ai/deepseek-harness","slug":"session-projection-cache-what-for-id-fail","errorCode":null,"errorMessage":"session projection cache: ${what} for \"${id}\" failed (cache stays stale): ${String(error)}","messagePattern":"session projection cache: (.+?) for \"(.+?)\" failed \\(cache stays stale\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/session/session-projection-cache/src/index.ts","lineNumber":278,"sourceCode":"      state.timer = undefined\n    }\n  }\n\n  /** Replace one session's stored record with its log identity and a detached snapshot of `rows`. */\n  private async put(id: SessionId, identity: CheckpointIdentity, rows: ProjectionCheckpoint): Promise<void> {\n    const detached = snapshotJsonValue(rows)\n    if (detached === undefined) {\n      throw new TypeError('projection checkpoint is not losslessly JSON-serializable (a unit state violates the plain-JSON contract)')\n    }\n    await this.requireTable().put(id, { identity, rows: detached as CheckpointRecord['rows'] })\n  }\n\n  /** Fail-soft {@link put}: cache writes must never fail their caller's read or event path. */\n  private async putSoft(id: SessionId, identity: CheckpointIdentity, rows: ProjectionCheckpoint, what: string): Promise<void> {\n    try {\n      await this.put(id, identity, rows)\n    } catch (error) {\n      this.ctx.logger.warn(`session projection cache: ${what} for \"${id}\" failed (cache stays stale): ${String(error)}`)\n    }\n  }\n\n  private requireTable(): KvTable<SessionId, CheckpointRecord> {\n    /* v8 ignore next -- Service.init assigns the table before the service becomes injectable */\n    if (this.table === undefined) throw new Error('session projection cache is not initialized')\n    return this.table\n  }\n}\n\n/** Project a header onto the identity fields a record is bound to. */\nfunction identityOf(header: SessionHeader): CheckpointIdentity {\n  return { createdAt: header.createdAt, ...header.cwd === undefined ? {} : { cwd: header.cwd } }\n}\n\n/** Whether a stored record's bound identity names the caller's lifecycle. */\nfunction identityMatches(stored: CheckpointIdentity, expected: CheckpointIdentity): boolean {\n  return stored.createdAt === expected.createdAt && stored.cwd === expected.cwd","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/session/session-projection-cache/src/index.ts#L260-L296","documentation":"Error \"session projection cache: ${what} for \"${id}\" failed (cache stays stale): ${String(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/session/session-projection-cache/src/index.ts:278 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the projection cache storage (path, permissions, disk); the cache stays stale until the operation succeeds."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}