From e0d23e7bf5d3ffa33446a6e60c3d5e295b308ba0 Mon Sep 17 00:00:00 2001 From: WRG-11 Date: Tue, 26 May 2026 11:33:10 +0300 Subject: [PATCH] fix(server): housekeep() bare gc() call -> _ok(store.gc(...)) (R89-19b 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). --- src/instinct/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instinct/server.py b/src/instinct/server.py index f4be54b..54d6aa6 100644 --- a/src/instinct/server.py +++ b/src/instinct/server.py @@ -933,7 +933,7 @@ def housekeep(dedup_threshold: float = 0.75) -> dict[str, Any]: "dedup" (dict with "found" and "applied"), "orphans_cleaned" (int), "fts_rebuilt" (bool). """ - return gc(dedup_threshold=dedup_threshold) + return _ok(store.gc(dedup_threshold=dedup_threshold)) # ── MCP Prompts ──────────────────────────────────────────────