MCPcopy Create free account
hub / github.com/holaboss-ai/holaOS / assertIncludesAll

Function assertIncludesAll

scripts/memory-eval.mjs:586–593  ·  view source on GitHub ↗
(label, haystack, terms)

Source from the content-addressed store, hash-verified

584}
585
586function assertIncludesAll(label, haystack, terms) {
587 const normalizedTerms = terms.map((term) => normalizeComparableText(term));
588 const matched = matchingTerms(normalizeComparableText(haystack), normalizedTerms);
589 if (matched.length !== normalizedTerms.length) {
590 const missing = terms.filter((term, index) => !matched.includes(normalizedTerms[index]));
591 throw new Error(`${label} is missing expected terms: ${missing.join(", ")}`);
592 }
593}
594
595function hitText(hit) {
596 return [hit.title, hit.summary, hit.excerpt, hit.entity_name].filter(Boolean).join("\n");

Callers

nothing calls this directly

Calls 2

matchingTermsFunction · 0.90
normalizeComparableTextFunction · 0.85

Tested by

no test coverage detected