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 exact restart trash charge and document latched charges

Alfredo Lopez1769d70b99ff
diff --git a/docs/operations/gfs-large-file-host-downloads.md b/docs/operations/gfs-large-file-host-downloads.md
index d50d6b4b5..1a767214c 100644
--- a/docs/operations/gfs-large-file-host-downloads.md
+++ b/docs/operations/gfs-large-file-host-downloads.md
@@ -458,6 +458,9 @@ when its turn comes, so one that is not a real directory then, such as a
symlinked `.gfs-downloads` or a child replaced by a symlink during the walk,
measures zero) and charged that size if its removal fails. A tree that cannot
be measured is logged and stays uncharged until a later sweep measures it.
+A charge, once set, is not measured again: bytes written into a directory
+after its charge was set, while its removal keeps failing, are not added to
+the budget, although the free-space check still sees them.
When a removal leaves the directory under its own name (the rename failed, the
parent check refused before it, or a refusal after it was undone by renaming
it back), an indexed entry keeps its own charge and is never charged a second
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index a89a6130b..749f1749e 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.547",
+ "version": "0.1.548",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.547",
+ "version": "0.1.548",
"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 b6166a820..6ce40b79c 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.547",
+ "version": "0.1.548",
"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/gfsDownloadStoreRemovalCharge.test.ts b/mcp-host/src/internalTools/gfsDownloadStoreRemovalCharge.test.ts
index 1c93f081c..c8c0261f1 100644
--- a/mcp-host/src/internalTools/gfsDownloadStoreRemovalCharge.test.ts
+++ b/mcp-host/src/internalTools/gfsDownloadStoreRemovalCharge.test.ts
@@ -60,6 +60,17 @@ function storedBytes(directory: string): number {
return sum
}
+// Every regular file, `meta.json` included: what a chargeless measurement counts.
+function regularBytes(directory: string): number {
+ let sum = 0
+ for (const child of syncFs.readdirSync(directory, { withFileTypes: true })) {
+ const target = path.join(directory, child.name)
+ if (child.isDirectory()) sum += regularBytes(target)
+ else if (child.isFile()) sum += syncFs.statSync(target).size
+ }
+ return sum
+}
+
function view(store: GfsDownloadStore) {
const state = store as unknown as {
entries: Map<string, { sizeBytes: number }>
@@ -453,7 +464,9 @@ describe('GFS download store removal charges', () => {
const reopened = await storeWithBudget()
expect(hits).toHaveLength(4)
expect(storedBytes(hostRoot)).toBe(8 * MIB)
- expect(view(reopened).held).toBeGreaterThanOrEqual(8 * MIB)
+ // Measured once on restart: both trees' regular files, meta.json included.
+ expect(regularBytes(hostRoot)).toBeGreaterThan(8 * MIB)
+ expect(view(reopened).held).toBe(regularBytes(hostRoot))
await expectRefused(reopened)
await recoverAndWitness(reopened)
})