MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / trailPath

Function trailPath

src/ui-server/api/trail-store.ts:136–144  ·  view source on GitHub ↗
(projectRoot: string, id: string)

Source from the content-addressed store, hash-verified

134 * written — checked before the join, so nothing path-shaped is ever built.
135 */
136export function trailPath(projectRoot: string, id: string): string {
137 if (!isTrailId(id)) {
138 throw badRequest(
139 `"${id}" is not a saved trail id.`,
140 'Trail ids are the lowercase slug in the file name, e.g. "how-a-request-is-served".'
141 );
142 }
143 return resolveProjectFile(projectRoot, `${TRAILS_RELATIVE_DIR}/${id}.json`);
144}
145
146/* ------------------------------------------------------------------- read -- */
147

Callers 3

readStoredTrailFunction · 0.85
writeStoredTrailFunction · 0.85
deleteStoredTrailFunction · 0.85

Calls 3

badRequestFunction · 0.90
resolveProjectFileFunction · 0.90
isTrailIdFunction · 0.85

Tested by

no test coverage detected