Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(mcp-host): prove a meta.json FIFO is judged by its descriptor type
Alfredo Lopeze456cb112859
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex 21c3d4a36..e25f484ca 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.536",+ "version": "0.1.537","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.536",+ "version": "0.1.537","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex 2b2a69a70..549a06768 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.536",+ "version": "0.1.537","description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude","main": "dist/main.js","engines": {diff --git a/mcp-host/src/internalTools/gfsDownloadStoreNonBlocking.test.ts b/mcp-host/src/internalTools/gfsDownloadStoreNonBlocking.test.tsindex 7fcc332a0..1e3d939e6 100644--- a/mcp-host/src/internalTools/gfsDownloadStoreNonBlocking.test.ts+++ b/mcp-host/src/internalTools/gfsDownloadStoreNonBlocking.test.ts@@ -125,6 +125,28 @@ describe('GFS download store: a FIFO in the store tree never blocks', () => {await expect(store.readManagedFile(after.receipt.path, KEY)).resolves.toEqual(after.bytes)})+ it('a meta.json FIFO with a writer attached is judged by its type, not read', async () => {+ const store = await openStore()+ const root = callerDirectory(hostRoot, KEY)+ const directory = plantFifoMeta(root)+ const fifo = path.join(directory, 'meta.json')+ // A writer that never writes: a read would get EAGAIN, not end-of-file.+ const reader = syncFs.openSync(fifo, syncFs.constants.O_RDONLY | syncFs.constants.O_NONBLOCK)+ const writer = syncFs.openSync(fifo, syncFs.constants.O_WRONLY)+ syncFs.closeSync(reader)+ try {+ const sweep = store.cleanupExpired()+ expect(await settleWithin(sweep, fifo, 'reader')).toBe('settled')+ await expect(sweep).resolves.toMatchObject({ removedIncomplete: 1 })+ expect(exists(directory)).toBe(false)+ } finally {+ syncFs.closeSync(writer)+ }+ // Witness: the store keeps admitting and serving afterwards.+ const copy = await completedCopy(store, root, KEY, 6, 24)+ await expect(store.readManagedFile(copy.receipt.path, KEY)).resolves.toEqual(copy.bytes)+ })+it('managed reads of a published copy whose source became a FIFO refuse without blocking', async () => {const store = await openStore()const root = callerDirectory(hostRoot, KEY)diff --git a/scripts/ci/pinned-vitest-cases/mcp-host.json b/scripts/ci/pinned-vitest-cases/mcp-host.jsonindex c19048938..a6da54fce 100644--- a/scripts/ci/pinned-vitest-cases/mcp-host.json+++ b/scripts/ci/pinned-vitest-cases/mcp-host.json@@ -786,5 +786,9 @@{"suite": "gfsDownloadStoreAdversarial.test.ts","fullName": "GFS download store adversarial round: a failed duplicate removal stays charged a duplicate of a published copy whose removal fails stays charged to its caller"+ },+ {+ "suite": "gfsDownloadStoreNonBlocking.test.ts",+ "fullName": "GFS download store: a FIFO in the store tree never blocks a meta.json FIFO with a writer attached is judged by its type, not read"}]