fix(core): relativize instruction description to project root

This commit is contained in:
Dax Raad
2026-07-01 21:03:46 -04:00
parent 6380919fda
commit 50a1fe49bc
+4 -3
View File
@@ -33,8 +33,9 @@ const layer = Layer.effect(
const store = yield* SessionStore.Service const store = yield* SessionStore.Service
const location = yield* Location.Service const location = yield* Location.Service
// Resolved once for the Location layer; the synthetic text and dedup ledger keep // Resolved once for the Location layer; the synthetic text and dedup ledger keep
// absolute paths, but the human-facing description shows paths relative to this root. // absolute paths, but the human-facing description shows paths relative to the project
const root = FSUtil.resolve(location.directory) // root so opening a subdirectory still describes paths from the project root.
const root = FSUtil.resolve(location.project.directory)
// Same-turn parallel reads settle concurrently, so an in-memory claim guards each // Same-turn parallel reads settle concurrently, so an in-memory claim guards each
// Session/path pair before any filesystem work. The durable history check below covers // Session/path pair before any filesystem work. The durable history check below covers
// paths injected in earlier turns after this Location layer was reopened. // paths injected in earlier turns after this Location layer was reopened.
@@ -100,7 +101,7 @@ function previouslyInjected(store: SessionStore.Interface, sessionID: SessionSch
}) })
} }
// Paths are normally discovered under the Location root, so the description shows them // Paths are normally discovered under the project root, so the description shows them
// relative to it. A directly-loaded path outside the root falls back to its absolute form // relative to it. A directly-loaded path outside the root falls back to its absolute form
// rather than emitting `../..` chains. // rather than emitting `../..` chains.
function describePath(root: string, path: string) { function describePath(root: string, path: string) {