fix(mcp-wrapper): route agentic ops to the engram, stop fabricating a cause #159
Reference in New Issue
Block a user
Delete Branch "fix/mcp-wrapper-agentic-routing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The five agentic ops returned
"status":"pending-cognition-promotion"on every call, claiming the cognition build wasn't promoted yet and would light up automatically.That diagnosis was invented. Cognition has been live the entire time —
:8742/api/thinkreturns a real 768-dim geometry today, and the running engram binary already contains everycog_*symbol. Nothing was pending.Three real bugs, all in the wrapper:
Wrong service. Ops called the soul (
:7770/think) on paths it doesn't serve — instant 404 every time. The routes are on the engram (/api/think,/api/attend,/api/assert,/api/ground, and/api/correspondence-beatfor learn).agentic_result()fabricated the cause. It treated any empty/404/"geometry unavailable" response as proof of a promotion gap and returned a confident explanation it never checked. That message sent multiple agents chasing infrastructure work that didn't need doing. Now passes the real response through.Missing auth. The engram requires
"_auth"in the body for POSTs, so attend/ground/learn would have returned unauthorized even with correct routing.Also fixed:
assertwas POSTing to a route that reads query params; params are now URL-encoded; engram port derives fromENGRAM_BINDinstead of a hardcoded literal.Verified end-to-end through the rebuilt wrapper against the live engram — all five return real cognition: think
n_support=207 dim=768; attendwritten=true; assertfloor=0.5 still_held=true; groundgrounding=1 written=true; learn a full correspondence-beat (stance_id, 8 axes, 180 probes, 25 epochs, brier_before=0.00346).Depends on el#124 (merged) for the engram-side query-param decode fix.
el_runtime.c gained evict_floor / evict_cap / evict_bll today so that wm_evicted == floor + cap + bll + dup_wm + dup_wm_global is an identity rather than one opaque integer. This carries them the rest of the way, into the heartbeat ISE. Doing it in the same change is the point. The 2026-08-10 review found that nineteen keys crossed the C boundary and only fourteen reached the ISE stream, and named the lesson: an instrument that is computed but not plumbed to durable storage is not an instrument, it is a local variable. Today's audit found that defect had recurred -- ten act-stats keys (aff_*, fan_*) are still orphaned. Adding three more C-side counters and stopping there would have made it thirteen. Read the three as a ratio, not a level: cap-dominant -> genuine contention for the 24 slots bll-dominant -> carried-over residents decaying out; healthy forgetting floor-dominant -> retrieval is returning weak candidates Measured this morning: 175,547 evictions over 13.5h, ~216/min against 24 slots, with no way to say which of those three it was. Not restarting the soul to pick this up. It holds 5,882 nodes and 40,375 edges that exist only in process RAM (mem_save is unreachable while ENGRAM_URL is set), so a restart destroys them. Filed separately as P0.