Skip to content

fix(server): housekeep() bare gc() call → _ok(store.gc(...)) (R89-19b INST-L2-01)#42

Merged
WRG-11 merged 1 commit into
mainfrom
session/B-r89-19b-inst-l2-01-housekeep-gc-fix
May 26, 2026
Merged

fix(server): housekeep() bare gc() call → _ok(store.gc(...)) (R89-19b INST-L2-01)#42
WRG-11 merged 1 commit into
mainfrom
session/B-r89-19b-inst-l2-01-housekeep-gc-fix

Conversation

@WRG-11
Copy link
Copy Markdown
Owner

@WRG-11 WRG-11 commented May 26, 2026

H Wave-9 Layer-2 deepdive finding (R89-14h)housekeep() at server.py:936 returned bare gc(dedup_threshold=...). The gc symbol resolves to a sibling @mcp.tool() decorated function in the same create_server() scope, which depending on FastMCP version either raises NameError or silently bypasses the canonical _ok(...) envelope.

Brief direction vs applied fix (SB-57 verify): brief proposed store.gc() directly; that drops the _ok() wrapper and breaks the "both tools identical" docstring contract. Applied fix mirrors the gc() tool exactly: return _ok(store.gc(dedup_threshold=dedup_threshold)).

Wave 6 INST-001 external closure — first conscious P9-6 ("monorepo-fixed, external-stale") closure event, 5+ days after monorepo patch.

Verify: 134/134 tests PASS (housekeep targeted 2/2 PASS).

Commit: e0d23e7

…b INST-L2-01; Wave 6 INST-001 external closure)

housekeep() returned bare gc(dedup_threshold=...). Since gc is a
function name decorated by @mcp.tool() in the same enclosing scope,
the bare call did not NameError but it also bypassed the canonical
return shape of the gc tool (which wraps store.gc() in _ok(...)). On
some FastMCP versions the @mcp.tool() decorator alters the wrapped
name; on those, this path WOULD NameError per H R89-14h diagnosis.

Either way the semantic contract is broken: docstring promises 'both
tools are identical', but housekeep returned an unwrapped dict while
gc returned _ok(...) shape.

Fix: mirror gc() exactly -> return _ok(store.gc(dedup_threshold=...)).

Verified: pytest tests/ -> 134/134 PASS (housekeep targeted: 2/2 PASS).

Sister to monorepo Wave 6 INST-001 (fixed in monorepo; this is the
1st conscious external closure of the P9-6 'monorepo-fixed-but-external-stale'
delta, 5+ days old).
@WRG-11 WRG-11 merged commit 1451cab into main May 26, 2026
11 checks passed
@WRG-11 WRG-11 deleted the session/B-r89-19b-inst-l2-01-housekeep-gc-fix branch May 26, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant