fix(host): review round 20 — canonical shape declared at the interface; hermetic home-shape spec; single resolve

This commit is contained in:
creatixchu
2026-07-30 02:10:07 +08:00
parent cc92b6b578
commit 983e6d07a4
9 changed files with 55 additions and 17 deletions

View File

@@ -1016,6 +1016,10 @@ export function createFixtureApi(options: FixtureOptions = {}): ApiProxy {
// same tree the browse primitives serve).
pickDirectory: request => ok(request, { path: `${FIXTURE_HOME}/Documents/project` }),
listDirectory: (request) => {
// The fixture accepts CANONICAL paths only: a decorated input
// (./, //, ..) misses the tree map and reads as unreadable, where
// the real backend resolve()s it first. The keyless lanes drive
// canonical paths, so the divergence stays out of transcripts.
const target = request.payload.path ?? FIXTURE_HOME
const children = childrenOf(target)
if (children === undefined) {