{"record":{"id":"6f322e8790c746d5","repo":"deepseek-ai/deepseek-harness","slug":"goal-stale-revision","errorCode":"GOAL_STALE_REVISION","errorMessage":"stale goal ref \"${ref.id}\" revision ${ref.revision}; current is \"${current.id}\" revision ${current.revision}","messagePattern":"stale goal ref \"(.+?)\" revision (.+?); current is \"(.+?)\" revision (.+?)","errorType":"exception","errorClass":"GoalError","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/index.ts","lineNumber":405,"sourceCode":"    }\n    this.commit(agent, cache, change, 'disarmed')\n    return { ...tombstone }\n  }\n\n  /** Resolve and validate the cache used by a mutation. */\n  private prepareMutation(agent: Agent): GoalCache {\n    this.assertLive(agent)\n    const cache = this.cache(agent.session)\n    this.sync(agent.session, cache)\n    return cache\n  }\n\n  /** Reject stale or missing current-state refs. */\n  private expectCurrent(cache: GoalCache, ref: GoalRef): GoalSnapshot {\n    const current = cache.state.goal\n    if (current === undefined) throw new GoalError('no current goal', 'GOAL_NOT_FOUND')\n    if (ref.id !== current.id || ref.revision !== current.revision) {\n      throw new GoalError(\n        `stale goal ref \"${ref.id}\" revision ${ref.revision}; current is \"${current.id}\" revision ${current.revision}`,\n        'GOAL_STALE_REVISION',\n      )\n    }\n    return current\n  }\n\n  /** Enforce exact live-agent identity rather than trusting a matching id. */\n  private assertLive(agent: Agent): void {\n    if (this.ctx.agents.get(agent.id) !== agent) {\n      throw new GoalError(`agent \"${agent.id}\" is not live in this registry`, 'GOAL_AGENT_NOT_LIVE')\n    }\n  }\n\n  /** Return the per-session cache, folding a seed once with activation disarmed. */\n  private cache(session: Session): GoalCache {\n    let cache = this.caches.get(session)\n    if (cache !== undefined) return cache","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/index.ts#L387-L423","documentation":"Error \"stale goal ref \"${ref.id}\" revision ${ref.revision}; current is \"${current.id}\" revision ${current.revision}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/index.ts:405 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":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}