{"record":{"id":"4667617a6a057ffa","repo":"mastra-ai/mastra","slug":"path-not-found-in-skill-version-tree-path","errorCode":null,"errorMessage":"Path not found in skill version tree: ${path}","messagePattern":"Path not found in skill version tree: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workspace/skills/versioned-skill-source.ts","lineNumber":103,"sourceCode":"        size: entry.size,\n        createdAt: this.#versionCreatedAt,\n        modifiedAt: this.#versionCreatedAt,\n        mimeType: entry.mimeType,\n      };\n    }\n\n    // Check if it's a directory\n    if (this.#directories.has(normalized)) {\n      return {\n        name,\n        type: 'directory',\n        size: 0,\n        createdAt: this.#versionCreatedAt,\n        modifiedAt: this.#versionCreatedAt,\n      };\n    }\n\n    throw new Error(`Path not found in skill version tree: ${path}`);\n  }\n\n  async readFile(path: string): Promise<string | Buffer> {\n    const normalized = this.#normalizePath(path);\n    const entry = this.#tree.entries[normalized];\n\n    if (!entry) {\n      throw new Error(`File not found in skill version tree: ${path}`);\n    }\n\n    const blob = await this.#blobStore.get(entry.blobHash);\n    if (!blob) {\n      throw new Error(`Blob not found for hash ${entry.blobHash} (file: ${path})`);\n    }\n\n    // Decode base64-encoded binary content back to Buffer\n    if (entry.encoding === 'base64') {\n      return Buffer.from(blob.content, 'base64');","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workspace/skills/versioned-skill-source.ts#L85-L121","documentation":"VersionedSkillSource.stat looks up the normalized path first in the version tree's file entries, then in the derived directory set; if the path is neither a file in the tree nor an implied directory, it throws. The version tree is an immutable manifest of a published skill version, so any path not recorded in it simply does not exist for that version.","triggerScenarios":"Calling stat on a VersionedSkillSource with a path absent from the SkillVersionTree entries and not derivable as a parent directory of any entry — wrong filename, wrong version, or a file that exists only in a newer version.","commonSituations":"Reading files that exist on the live filesystem but were never published into this version; referencing a path with a leading skill-dir prefix when the source is already scoped to one skill; stale paths after republishing a version that dropped files.","solutions":["Call exists(path) first to check membership in this version's tree before stat.","Remove any skill-directory prefix — VersionedSkillSource paths are relative to the skill root ('SKILL.md', not '<skill>/SKILL.md').","Verify you are reading the intended version; the file may exist in a different SkillVersionTree.","If the file should exist, republish the skill version including it."],"exampleFix":"// before\nawait versioned.stat('my-skill/SKILL.md'); // already scoped to skill\n// after\nawait versioned.stat('SKILL.md');","handlingStrategy":"validation","validationCode":"if (await versioned.exists(path)) {\n  const st = await versioned.stat(path);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await versioned.stat(path);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Path not found in skill version tree')) {\n    return null; // treat as non-existent for this version\n  }\n  throw err;\n}","preventionTips":["Use paths relative to the skill root — no skill-dir prefix or leading slash.","Pin reads to the version you know contains the file.","Call exists() before stat in generic file-browsing code."],"tags":["filesystem","skills","versioning","not-found"],"backgroundTag":"file-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}