fix(host,client): review round 23 — create-path contract at every client declaration; close-edge resets; NFD tripwire; canonical double join

This commit is contained in:
creatixchu
2026-07-30 03:17:30 +08:00
parent de24461b91
commit df313b7531
10 changed files with 46 additions and 21 deletions

View File

@@ -329,12 +329,16 @@ describe('workspaces', () => {
await expect(runtime.workspaces.listDirectory()).resolves.toMatchObject({ path: '/home/test', entries: [] })
await expect(runtime.workspaces.listDirectory('/home/test')).resolves.toMatchObject({ path: '/home/test' })
await expect(runtime.workspaces.createDirectory('/home/test', 'fresh')).resolves.toBe('/home/test/fresh')
// Canonical join: a bare-root parent yields /top, not //top (the
// IWorkspaces contract's verbatim entries[].path equality).
await expect(runtime.workspaces.createDirectory('/', 'top')).resolves.toBe('/top')
// The recorded signal seat mirrors the production face (undefined here;
// cancellation tests pass and observe a real one).
expect(runtime.workspaces.calls).toEqual([
{ method: 'listDirectory', args: [undefined, undefined] },
{ method: 'listDirectory', args: ['/home/test', undefined] },
{ method: 'createDirectory', args: ['/home/test', 'fresh'] },
{ method: 'createDirectory', args: ['/', 'top'] },
])
// Stubs replace the defaults like every sibling method.
const listing = { path: '/x', home: '/x', crumbs: [], entries: [] }