ReMe/tests
RerankerGuo 047c1f39ee feat(search): add containment-style tags filter for multi-user scoping (#368)
Closes #368

## What
- Add containment-style tags filter to LocalFileStore._matches_search_filter with AND semantics (chunk must contain every expected tag). Matches the design note in the issue: frontmatter tags: [user:alice] plus the markdown chunker include_frontmatter_in_metadata=true lets multi-agent deployments scope recalls to a single user without per-user workspaces.
- Promote tags context parameter in SearchStep and SearchV2Step to search_filter[tags], mirroring the existing start_date/end_date promotion. Accept both list[str] and comma-separated strings (trimmed). Explicit search_filter.tags takes precedence.
- Add _tag_contains helper on LocalFileStore (covers list/set/tuple, scalar, and None inputs) and move the final two early-returns of _matches_search_filter to a combined boolean so pylint keeps the function's return-count under the limit.
- Unit tests: containment semantics at the filter layer, list+CSV promotion in both SearchStep and SearchV2Step, precedence over top-level context.

## Why
- The v0.4.x user-facing change removed an explicit user-scoping parameter. The documented workaround (separate workspaces per user) is heavyweight; the maintainer suggestion (store user:<name> in frontmatter tags) needed the corresponding search-side filter to be actionable in practice.
- Using containment (AND) rather than exact equality keeps the frontmatter format natural: mix of user:<name>, project:<proj>, domain tags still works without calling multiple filters.
- Using a reserved top-level tags key keeps the behavior explicit and the metadata semantics stable (metadata keys still use exact equality, which is what callers need for conversation_date style filters).

## Not in scope
- Does NOT flip include_frontmatter_in_metadata default to true — that's a deploy-time config decision and changes memory usage. Docs update to note the knob is tracked separately.
- No vector or keyword index changes; filtering stays post-hoc consistent with date/path/metadata filters today.

## Testing
- [x] New unit tests (4) for filter semantics, list and CSV promotion, precedence, SearchV2Step — all PASS
- [x] Existing search step test suite — 36/36 PASS (no regressions)
- [x] Pre-commit: check-ast, black, flake8, pylint, pyroma, add-trailing-comma, whitespace, private-key — all PASS
2026-07-29 19:37:02 +08:00
..
integration feat(agent): add Codex agent wrapper and ReMe MCP bridge (#358) 2026-07-17 13:39:18 +08:00
unit feat(search): add containment-style tags filter for multi-user scoping (#368) 2026-07-29 19:37:02 +08:00