Skip to content

docs(design): scope/collection filter evaluation (#76) - #136

Merged
jphein merged 2 commits into
mainfrom
docs/scope-filter-design-76
May 23, 2026
Merged

docs(design): scope/collection filter evaluation (#76)#136
jphein merged 2 commits into
mainfrom
docs/scope-filter-design-76

Conversation

@jphein

@jphein jphein commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Evaluates the four design alternatives raised in #76 for whether mempalace_search should expose a cross-collection filter now that the storage layer supports multi-collection-per-palace as a first-class capability.

Recommendation: Option 1 today (status quo, document), with Option 2 (collections= parameter, default [\"mempalace_drawers\"]) as the deferred trigger once a second MCP-visible collection earns its read surface.

Reasoning

PR #8 (0b945e1) retired mempalace_session_recovery — both write and read paths. The fork's MCP surface now reaches exactly one collection (mempalace_drawers). The premise of #76 ("the palace has multiple physically separate stores") is true at the storage layer but no longer true at the MCP/CLI surface this fork exposes.

The recovery-collection split (2026-04-25 → 2026-05-05) is itself the case study for why Option 3 (per-collection sibling tools) goes wrong: writes shipped before the read tool did, checkpoints became invisible to mempalace_search, and the structural fix was to retire the whole side collection. That lesson, ratified in the README's "what this fork has learned" section, should set the design bar: every new sibling collection has to earn its own read tool before any write lands.

Options evaluated

  1. Status quo, document. Cheapest; ratifies the post-PR-refactor(mcp): retire mempalace_session_recovery collection + read tool #8 reality.
  2. collections= parameter. Generalises the retired kind= filter; ranks across collections via RRF. Forward-compatible addition.
  3. Per-collection sibling tools. Most additive; echoes the recovery-collection failure mode. Deferred indefinitely.
  4. Federated default. Single tool reads all collections, fused. Highest implementation cost; calibration regressions are silent. Deferred until ≥3 collections.

Includes

  • Trade-offs matrix across complexity, performance, UX, backwards compat, and the "echoes a known failure mode" axis
  • Impact analysis on palace-daemon /search, SME's MemPalaceDaemonAdapter, and the MCP tool surface
  • Ranking concerns for cross-collection fusion (embedder identity, distance distribution comparability, metadata-filter parity)
  • Explicit trigger conditions for revisiting Option 1 → Option 2
  • fork-changes.yaml entry with rendered FORK_CHANGELOG.md and README.md

SME impact

Under the recommendation, the SME-side cleanup is straightforward: remove DEFAULT_KIND, remove the --kind CLI flag, delete the xfail'd test_kind_content_excludes_stop_hook_checkpoints. Unblocks PR #7's cleanup with no further coordination.

Test plan

  • Confirm the design doc renders correctly in FORK_CHANGELOG.md and the README fork-change-queue table
  • Verify no source code is changed (design only; runtime unchanged)
  • Review recommendation against the recovery-collection retirement lesson

Closes #76.

Copilot AI review requested due to automatic review settings May 23, 2026 00:51
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jphein jphein mentioned this pull request May 23, 2026
1 task
@jphein
jphein force-pushed the docs/scope-filter-design-76 branch from 803ceb5 to dc871a1 Compare May 23, 2026 01:04
@jphein jphein mentioned this pull request May 23, 2026
1 task
@jphein
jphein force-pushed the docs/scope-filter-design-76 branch from dc871a1 to e8704ed Compare May 23, 2026 01:10
Evaluates the four alternatives from #76 — status quo, collections=
parameter, per-collection sibling tools, federated default — across
implementation complexity, performance, UX, backwards compat, and
impact on palace-daemon /search, SME's MemPalaceDaemonAdapter, and
the MCP tool surface.

Recommendation: Option 1 (status quo, document) today, with Option 2
(collections= parameter, default ["mempalace_drawers"]) as the
deferred trigger once a second MCP-visible collection earns its read
surface. PR #8 (0b945e1) retired mempalace_session_recovery; the
fork's MCP surface now reaches exactly one collection, so the
premise of #76 has changed in this fork. The recovery-collection
retirement is itself the case study for why Option 3 (sibling tools,
writes-before-reads) goes wrong.

Includes explicit trigger conditions for revisiting Option 1 -> 2,
ranking concerns for cross-collection fusion (embedder identity,
distance distribution comparability, metadata-filter parity), and
fork-changes.yaml entry with rendered docs.

Closes #76.
@jphein
jphein force-pushed the docs/scope-filter-design-76 branch from e8704ed to fd8ec2e Compare May 23, 2026 01:14
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jphein
jphein merged commit bed4138 into main May 23, 2026
1 check passed
@jphein
jphein deleted the docs/scope-filter-design-76 branch May 23, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design call: bring back a scope/collection filter on search now that the palace has multiple stores?

2 participants