Files
Tim Lingo 3723e3b7e7 fix(mcp-wrapper): forget/delete tools no longer return fake ok receipts (BUG-18)
Root cause: two false-receipt paths in the wrapper's delete family.
- delete_by_id (removeKnowledge, deleteProcess, deleteImprint,
  dischargeWonder) FABRICATED {"ok":true,...,"note":"soft-deleted"}
  without calling the soul at all — the 'soul does not yet expose a delete
  HTTP route' note was stale (/api/neuron/node/delete exists and tombstones
  any node type).
- tool_forget forwarded the soul's response but never verified the deletion
  actually persisted before answering ok.

The change (Receipt Contract rule 1 — a tool result must reflect what
actually happened):
- delete_by_id now routes to the soul's real /api/neuron/node/delete and
  propagates its answer (honest 'node not found' for bad ids).
- Both handlers read back before answering ok: GET /api/neuron/graph?id=..
  &depth=1 must show the tombstone marker (label "tombstone:<id>"); if it
  does not, answer {"ok":false,"error":"delete_not_persisted",...} in
  the soul's not-persisted error shape (api_not_persisted).
- Soul errors and transport failures pass through unchanged.

E2E evidence (sandbox soul :7791 + wrapper :7792, elb builds):
- unpatched: removeKnowledge on a NONEXISTENT id -> {"ok":true,
  "deleted":"kn-DOES-NOT-EXIST-deadbeef","note":"soft-deleted"} (lie)
- patched:   same call -> {"error":"node not found: ..."} (soul's answer)
- happy path: remember -> forget -> {"ok":true,"tombstoned":true};
  read-back: hidden from default /list/Memory, present with
  ?include_deleted=1, node KEPT in full graph view (immutability intact)
- scripts/verify-soul-contract.sh on the soul it talks to: GATE PASS
  (27/27 presence + immutability)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 10:52:21 -05:00
..