Commit fdcd0b4
feat(cli): add why + tunnels fast-path daemon commands (slice of #191)
Two more verbs join the daemon-fast-path family (tags / overlap / list /
move / stats / cypher / graph): mempalace why <drawer_id> and mempalace
tunnels [--wing W] [--passive].
mempalace why composes three read-only daemon calls into a single
explain-this-drawer report — no searcher.py changes, pure orchestration.
mempalace_get_drawer for location + tags + content snippet; a read-only
Cypher hop over the drawer's :MENTIONS-Entity edges (drawer ID sanitized
through sanitize_kg_value and inlined as a Cypher literal since /cypher
takes no params); mempalace_search keyed on the drawer's own first
non-blank paragraph for nearest semantic neighbors (drawer itself
filtered out). A 500 on the entities hop (AGE not configured on a
chroma-only backend) degrades to an empty MENTIONS block — the report
still renders. The minimum-viable debugging lens for retrieval
calibration work.
mempalace tunnels wraps the existing mempalace_list_tunnels MCP tool —
default returns explicit (agent-wired) tunnels only; --passive opts in
to the inferred passive overlap per issue #75; --wing W filters to
tunnels touching one wing.
36 new tests follow the cmd_tags/cmd_overlap mock-urlopen pattern:
three-block report rendering, self-drawer filtered from neighbors, JSON
envelope shapes, drawer-id-as-literal Cypher composition, /cypher 500
degrades cleanly, --neighbors/--entities limits, missing/whitespace
drawer_id rejection, daemon-down/unreachable/drawer-not-found/search-down
exit codes, kind column in the tunnels table, --passive opts in mixed
kinds, --wing/--passive forwarding to mempalace_list_tunnels arguments,
inner-error envelopes, argparse wiring incl. negative-limit rejection.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent db413bb commit fdcd0b4
8 files changed
Lines changed: 1556 additions & 152 deletions
File tree
- docs
- mempalace
- tests
- website
- public
- reference/python-api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
27 | 77 | | |
28 | 78 | | |
29 | 79 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
27 | 84 | | |
28 | 85 | | |
29 | 86 | | |
| |||
0 commit comments