You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve: expand_query prompt now instructs the LLM to avoid standalone audience/demographic terms (children, family, professional, etc.), reducing false matches from contextual noise. Adds explicit rule 11 for AUDIENCE QUALIFIERS directing expansion to focus on the topic, not the audience.
Added
indexer property test coverage. Added testIndexerDefaultsToAuto and testFromArrayMapsIndexer to ScoltaConfigTest — the indexer property (default 'auto', accepts 'php'/'binary'/'auto') had zero test coverage.
AI feature toggle enforcement in AiEndpointHandler. When aiExpandQuery=false or aiSummarize=false, the handler now returns ['ok'=>false, 'status'=>404, 'error'=>'Feature disabled'] immediately without calling the AI service. AiControllerTrait::createHandler() passes these flags from ScoltaConfig. Added five tests: disabled returns 404, disabled does not call AI service (expand and summarize), follow-up unaffected by either toggle.
AI configuration tests (Phase 5). Added testAiLanguagesFlagsPropagateToJsOutput: sets ai_languages, ai_expand_query=false, ai_summarize=false, max_follow_ups=0 and confirms all appear correctly in toJsScoringConfig() output.
Display behavior tests (Phase 2). Added excerpt_length to testToJsScoringConfigValuesMatchConfig to confirm EXCERPT_LENGTH in JS output reflects config.
Scoring behavior tests (Phase 1).ScoltaConfigTest: completeness check for all 25 toJsScoringConfig() keys, value-mapping assertions, phrase-proximity field assertions, and a negative test confirming server-side keys (cacheTtl, aiApiKey, etc.) are absent from the JS output. AiEndpointHandlerTest: testCacheTtlZeroNeverReadsCache, testCacheTtlZeroNeverWritesCache, testMaxFollowUpsZeroBlocksImmediately (with TrackingCacheDriver). New tests/Service/AiServiceAdapterTest.php: custom prompt overrides returned raw without {SITE_NAME} substitution; default prompts resolve site name and description; empty overrides fall back to default.
Fixed
Hygiene: Replaced uniqid('', true) with bin2hex(random_bytes(8)) in IndexMerger — avoids period-containing directory names that can confuse cleanup scripts.
Hygiene: Removed @ error suppression from mkdir calls in IndexMerger, PagefindFormatWriter, and StreamingFormatWriter; replaced with explicit is_dir() fallback + RuntimeException.
Hygiene: Removed @unserialize in PhpIndexer; replaced with try/catch \Throwable so corrupt cache entries surface in logs instead of silently recomputing.
Hygiene: Added === false error checks to all bare file_put_contents calls in ContentExporter, PagefindFormatWriter, and StreamingFormatWriter.
Hygiene: Added TOCTOU-safe comments to intentional @unlink calls in BuildState.
Hygiene: Added source-parse tests preventing reintroduction of @mkdir, @unlink outside BuildState, uniqid(..., true), unchecked file_put_contents, and unserialize without allowed_classes.
Summarize and follow_up prompts now include a GROUNDING CHECK section. The new section
instructs the LLM to verify each fact against the provided excerpts before citing it, extract
whatever IS relevant from partially-matching excerpts, note any gaps, and suggest specific search
terms — replacing the old binary "no results" fallback that could cause the LLM to hallucinate
or discard partially-relevant content entirely.
Summarize prompt now requires per-excerpt scanning and a minimum bullet count. The FORMAT
RULES bullet was rewritten to instruct the LLM to scan each excerpt individually and produce
at least 3-5 detail bullets when content is present, rather than conditionally adding "a
bulleted list" only when details happen to be obvious. Reduces sparse or single-bullet responses
for queries with multiple relevant excerpts.