* Resolve a parsed path to its store with containment verified. * createRoot is reserved for commands that can create files (create, UI * save): everything else must not materialize scope roots. Missing roots * simply make targets report "not found".
(
ctx: MemoryScopeContext,
scope: MemoryScope,
relPath: string,
opts?: { createRoot?: boolean }
)
| 599 | * simply make targets report "not found". |
| 600 | */ |
| 601 | private async resolveStore( |
| 602 | ctx: MemoryScopeContext, |
| 603 | scope: MemoryScope, |
| 604 | relPath: string, |
| 605 | opts?: { createRoot?: boolean } |
| 606 | ): Promise<MemoryStore> { |
| 607 | const store = this.getStore(ctx, scope); |
| 608 | if (opts?.createRoot) { |
| 609 | await store.ensureRoot(); |
| 610 | } else { |
| 611 | await store.assertRootSafe(); |
| 612 | } |
| 613 | await store.assertContained(relPath); |
| 614 | return store; |
| 615 | } |
| 616 | |
| 617 | private requireFilePath(parsed: ParsedMemoryPath, virtualPath: string): MemoryScope { |
| 618 | if (parsed.scope === null || parsed.relPath === "") { |
no test coverage detected