* Compute the path of `subProjectPath` relative to `projectPath` for use under * the workspace's own checkout. Returns `null` if the recorded sub-project * path is not actually a descendant of the parent project (stale persisted * state) — callers should treat that as "no sub-project segment" and
(projectPath: string, subProjectPath: string)
| 428 | * back to parent-only instructions rather than failing. |
| 429 | */ |
| 430 | function deriveSubProjectRelativePath(projectPath: string, subProjectPath: string): string | null { |
| 431 | const relative = path.relative(projectPath, subProjectPath); |
| 432 | if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) { |
| 433 | return null; |
| 434 | } |
| 435 | return relative; |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Read instruction sets from global and context sources as a structured tree. |
no test coverage detected