package memoriatest import ( "context" "amadan.net/oficina/suite" "amadan.net/oficina/memoria/internal/memoria" ) // testAsker is the person every store-level test searches as. // // §4.1's typed subject in lone shape: a lowercased address, with the kind // on the value so a receiver keyed on person refs answers UNKNOWN for the // whole call rather than guessing. var testAsker = suite.Subject{Kind: suite.SubjectAddress, Value: "reader@example.com"} // searchAsReader runs a search as an ordinary signed-in reader and returns // the passages that survived §4.1's ruling. // // **It is not a way around the ruling and must never become one.** It // calls Store.Search like everything else does; all it supplies is the // asker the test would otherwise have to spell out at thirty call sites, // and all it drops is the notices, which these tests are not about. A // helper that reached past Search to the raw hits would be the seam // AGENTS.md warns about — the guard that exists only in a comment. func searchAsReader(s *memoria.Store, ctx context.Context, q string, n int) ([]memoria.Result, error) { p, err := s.Search(ctx, testAsker, q, n) return p.Results, err }