Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(mcp-host): pin the provenance guard of managed GFS reads

Alfredo Lopez2bac0b572e0d
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index 6b11cad41..691b61787 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.554",
+ "version": "0.1.555",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.554",
+ "version": "0.1.555",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --git a/mcp-host/package.json b/mcp-host/package.json
index bdccc946c..b007a7164 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.554",
+ "version": "0.1.555",
"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/gfsDownloadStoreProvenance.test.ts b/mcp-host/src/internalTools/gfsDownloadStoreProvenance.test.ts
index ad19b469d..0dcac390c 100644
--- a/mcp-host/src/internalTools/gfsDownloadStoreProvenance.test.ts
+++ b/mcp-host/src/internalTools/gfsDownloadStoreProvenance.test.ts
@@ -263,6 +263,27 @@ describe('GFS download store provenance: planted copies', () => {
expect(exists(planted.sourcePath)).toBe(true)
})
+ it("P7b: an expired adopted entry in the caller's own directory answers download_missing, not download_expired", async () => {
+ const bytes = Buffer.alloc(18, 0x46)
+ // metaFor expires the plant one hour after now; the published copy lives a day.
+ const planted = plantComplete(rootA, A, 22, bytes)
+ const info = vi.spyOn(logger, 'info')
+ const restarted = await openStore()
+ adoptedLogged(info, 1)
+ const own = await completedCopy(restarted, rootA, A, 23, 16, {
+ expiresAt: new Date(Date.now() + 24 * 60 * 60_000).toISOString(),
+ })
+
+ vi.setSystemTime(new Date(Date.now() + 2 * 60 * 60_000))
+
+ // The adopted entry is still indexed: the provenance guard, not openEntryContent, decides.
+ expect((await restarted.debugInventory()).byCaller.get(A)).toEqual({ files: 2, bytes: 34 })
+ await expectNotServed(restarted, planted.id, A)
+ // Witness: the same read path serves the caller's own published copy at the same instant.
+ await expect(restarted.readManagedFile(own.receipt.path, A)).resolves.toEqual(own.bytes)
+ expect(exists(planted.sourcePath)).toBe(true)
+ })
+
it('P8: a meta identity that differs from its directory grants nothing to either caller', async () => {
const bytes = Buffer.alloc(12, 0x45)
const planted = plantComplete(rootB, C, 14, bytes)
diff --git a/scripts/ci/pinned-vitest-cases/mcp-host.json b/scripts/ci/pinned-vitest-cases/mcp-host.json
index 6499b729f..3b845707d 100644
--- a/scripts/ci/pinned-vitest-cases/mcp-host.json
+++ b/scripts/ci/pinned-vitest-cases/mcp-host.json
@@ -363,6 +363,10 @@
"suite": "gfsDownloadStoreProvenance.test.ts",
"fullName": "GFS download store provenance: planted copies T-S2: a planted entry is never read through the managed path"
},
+ {
+ "suite": "gfsDownloadStoreProvenance.test.ts",
+ "fullName": "GFS download store provenance: planted copies P7b: an expired adopted entry in the caller's own directory answers download_missing, not download_expired"
+ },
{
"suite": "gfsDownloadStoreProvenance.test.ts",
"fullName": "GFS download store provenance: planted copies T-S3: a planted directory with a published id is removed and the published copy is untouched"