feat(search): filter before ranking and expose citation handles - #144
Conversation
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — c61178c5
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
This approval is provisional. It rests on the audit running. If the audit cannot run — for example the CLI bridge rejects it — this approval is dismissed rather than left standing, so an unrun check never reads as a passing one.
tangletools · auto-approval · reason: drewstone_author · 2026-08-17T01:39:24Z
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — be64fd11
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
This approval is provisional. It rests on the audit running. If the audit cannot run — for example the CLI bridge rejects it — this approval is dismissed rather than left standing, so an unrun check never reads as a passing one.
tangletools · auto-approval · reason: drewstone_author · 2026-08-17T01:57:43Z
Problem
A caller that needs only curated priors, empirical findings, profile records, or another page subset must currently rank the entire store and filter afterward. Excluded pages can therefore influence both the token and graph stages before disappearing.
Search results also make the stable page id reachable only through a nested object. A downstream tool shipped a citation field its agents could not populate because the rendered search hit omitted the only handle they had to copy.
Change
SearchKnowledgeOptionswith page-id, tag, kind, and caller predicate filters.KnowledgeSearchHit, which carriescitationIdat the top level and defines it as exactlypage.id.An explicit empty filter matches no pages; omission means no restriction.
Tests
The added suite proves:
citationId === page.id;This closes the retrieval and result-identity gap identified by Discovery's package-adoption audit without adding an opaque ranker or research policy.