fix(server): housekeep() bare gc() call → _ok(store.gc(...)) (R89-19b INST-L2-01)#42
Merged
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
H Wave-9 Layer-2 deepdive finding (R89-14h) —
housekeep()atserver.py:936returned baregc(dedup_threshold=...). Thegcsymbol resolves to a sibling@mcp.tool()decorated function in the samecreate_server()scope, which depending on FastMCP version either raisesNameErroror 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 thegc()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