{"record":{"id":"f877ed7c107da279","repo":"Hmbown/CodeWhale","slug":"trajectory-not-found","errorCode":"trajectory_not_found","errorMessage":"no trajectories on this machine yet — start one with trajectory {action:\"start\"}","messagePattern":"no trajectories on this machine yet — start one with trajectory (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/trajectory.mjs","lineNumber":82,"sourceCode":"        const full = path.join(trajectoriesDir(), name);\n        const stat = fs.statSync(full);\n        return { id: name, bytes: stat.size, modified: stat.mtime.toISOString(), turns: countCalls(full) };\n      });\n  } catch { return []; }\n}\n\n/**\n * Resolve an id (\"latest\" or a traj-*.jsonl basename) to a file inside the\n * trajectories dir. Anything that escapes the directory is refused, not read.\n */\nexport function resolveTrajectory(id) {\n  const dir = trajectoriesDir();\n  const bad = (message) => Object.assign(new Error(message), { code: \"bad_args\" });\n  const missing = (message) => Object.assign(new Error(message), { code: \"trajectory_not_found\" });\n  let name = typeof id === \"string\" && id.trim() && id !== \"latest\" ? id.trim() : null;\n  if (!name) {\n    const recent = listTrajectories(1);\n    if (!recent.length) throw missing(\"no trajectories on this machine yet — start one with trajectory {action:\\\"start\\\"}\");\n    name = recent[0].id;\n  }\n  if (name.includes(\"/\") || name.includes(\"\\\\\") || name.startsWith(\".\")) throw bad(\"trajectory id must be a traj-*.jsonl name from trajectory status\");\n  const file = path.resolve(dir, name);\n  if (path.dirname(file) !== path.resolve(dir)) throw bad(\"trajectory id must stay inside the trajectories directory\");\n  if (!fs.existsSync(file)) throw missing(`no trajectory named \"${name}\" (see trajectory {action:\"status\"})`);\n  return file;\n}\n","sourceCodeStart":64,"sourceCodeEnd":91,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/trajectory.mjs#L64-L91","documentation":"resolveTrajectory: the trajectories directory has no recorded trajectories yet (or is unreadable), so neither 'latest' nor any traj-*.jsonl id can be resolved; ids escaping the directory are also refused rather than read. The absence of any recording is the condition at fault, not a malformed id.","triggerScenarios":"Thrown at crates/tui/plugins/computer-use/src/trajectory.mjs:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start a trajectory first: trajectory {action:\"start\"}.","Pass id:\"latest\" to operate on the most recent trajectory if one exists on another machine-synced store."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}