Repository navigation
feat(core,cli,server,mcp): recall min_trust filter and trust_tier field (#1651) - #1661
Merged
Merged
Conversation
…ld (#1651) `min_trust` (human|agent|external|untrusted, lowercase) on CLI, HTTP and MCP recall keeps results whose provenance tier is at least that, applied before the limit through the shared window-widening fetch. Every memory result carries `trust_tier`, the same lowercase string the provenance report emits. Omitting it changes nothing. It filters the provenance tier only, not a trust state, and author_type is self-declared, so it is not a security boundary; documents have no tier and are dropped when it is set.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
min_trust(human|agent|external|untrusted, lowercase) on recall for CLI (--min-trust),POST /recalland MCPuteke_recall. An invalid value is a 400 / validation error.trust_tier, the lowercase string ofTrustTier::of(memory): the same string the provenance report writes in JSON andmin_trusttakes. The MCP text lines showtier <x>. Unified/pack results carry it too; documents have no tier and are dropped whenmin_trustis set.min_trustchanges nothing.author_typeis self-declared, so it is a convenience filter and not a security boundary.Why
Closes #1651. A caller that wants only human-stated facts had to filter client-side. Wire names agreed in uteke-cloud#460 (Amendment 3); the tier table is unchanged (Human = author_type human AND source_type user).
Testing
min_trustvalue returns the expected set;trust_tieron each result matchesTrustTier::of; limit 1 withmin_trust=humanstill returns the human note that ten agent notes outrank; omitting it is byte-identical; invalid values rejected.trust_tier/tieroutput.cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspacepass locally; docgen output committed.