Skip to content

v1.0.4

Choose a tag to compare

@github-actions github-actions released this 05 Jun 21:18
c78d2c3

Added

  • expansion_combine_mode scoring setting (default relevance_union). A new admin field (Scoring section) + sanitizer + activation default for the scolta-php round-robin AI-summary candidate selection across query-expansion sub-queries (tag1consulting/scolta-php#170). expansion_combine_mode is a select (relevance_union keeps the historical behavior; round_robin deals the top few from each sub-query so the AI summary sees breadth across distinct sub-topics); invalid values fall back to relevance_union. The mode is preset-defaulted (see Changed below) and any value set by hand overrides the preset. The visible result list stays relevance-sorted either way. Also re-synced the committed assets/js/scolta.js (and its .sha256) to the canonical scolta-php source, which adds the selectSummaryCandidates round-robin logic. Added AdminExpansionFieldsTest covering the render and sanitizer; extended ActivationTest to assert the default.

Changed

  • Synced assets/js/scolta.js (and its .sha256) from scolta-php (index-driven static facet panel with exact typed-query counts). The facet panel's dimensions and values now come from the index taxonomy (pagefind.filters()) in fixed alphabetical order, so nothing appears, disappears, or reorders across a search or AI expansion; facet counts are the exact breakdown of the typed query taken from Pagefind's native per-search .filters, computed once and never recomputed on a facet click. Clicking a facet filters results and updates only the header count. Counts describe the typed search term, so they can read lower than the header "N results" once AI expansion enlarges the result list — this is intentional. An expansion-aware variant that summed .filters across the expanded term set was tried and reverted (Pagefind cannot count a union of multiple search terms; summing overcounted). Asset-only re-sync of the canonical browser script; no WordPress-side logic changed. (tag1consulting/scolta-php#187)
  • expansion_combine_mode is now preset-defaulted, and the expansion_per_term_top_k (K) setting is removed. Following the scolta-php #170 evaluation, round_robin is the better summary-candidate strategy on faceted corpora and a safe no-op elsewhere, so it is now a per-Site-Type preset default in scolta-php: the Recipe & Content Catalog, Blog & Editorial, and E-commerce presets default the combine mode to round_robin; the others (and the activation default) stay relevance_union. The WordPress "Expansion Combine Mode" select keeps the per-site override and is preset-defaulted through the existing on-preset-change value injection in sanitize_settings(), so it resolves explicit value > preset default > base default like the other preset-overridable scoring fields. The per-sub-query top-K is no longer tunable — evaluation found no benefit above 3 and over-reach below it — so scolta-php locks it at 3 internally and the "Expansion Per-Term Top K" admin field, its sanitizer key, and its activation default are removed; AdminExpansionFieldsTest now asserts the render method is gone and the sanitizer no longer emits expansion_per_term_top_k, and ActivationTest asserts it is no longer an activation default. The preset-default behavior flows through existing config plumbing, so no scolta-php release bump is required for it. (tag1consulting/scolta-php#180)
  • Stopped restating scoring/display defaults in the README; point to scolta-php's CONFIG_REFERENCE.md instead. The Default column of the README's Search Scoring and Display tables duplicated scolta-php's canonical defaults and had drifted (title_match_boost showed 1.0 vs the current 2.0; recency_boost_max showed 0.5 vs 0.25). Those columns are removed and each table now links to scolta-php docs/CONFIG_REFERENCE.md, the single source of truth for defaults (verified against ScoltaConfig in scolta-php CI). Setting keys, admin-UI locations, preset guidance, and the worked override examples are unchanged. No scoring logic or default values change.
  • Reworded the search-tuning admin help and docs to lead with the Site Type preset instead of the raw number. The expand_subword_max_frequency field is relabeled "Search Breadth (advanced)" with an outcome-worded description ("how aggressively multi-word searches broaden… most sites should pick a Site Type preset instead") in place of the previous document-frequency jargon. Added a "Tuning search breadth" section to the README (symptom→fix, leads with the Recipe & Content Catalog preset, links to scolta-php's docs/TUNING.md for the evidence) and a matching readme.txt FAQ entry ("Why am I getting fewer search results than before?"). No scoring logic or default values change.

Fixed

  • Synced assets/js/scolta.js (and its .sha256) from scolta-php (facet-collapse fix). Applying a facet filter on a multilingual site (e.g. ?q=…&f_language=en) collapsed that facet to its single selected value, leaving no way to switch or broaden the selection. scolta-php's scolta.js now computes "drop-self" facet counts — a Pagefind search with all active filters except the dimension itself — so a filtered dimension lists all its values with live counts and stays switchable. Asset-only re-sync of the canonical browser script; no WordPress-side logic changed. (tag1consulting/scolta-php#186)
  • Restored the sort/filter badge styles that had drifted out of the committed assets/css/scolta.css. The committed CSS copy was ~60 lines behind scolta-php's canonical stylesheet — it was missing .scolta-filter-group, the sort-indicator block (#scolta-sort-indicator, .scolta-sort-badge, .scolta-sort-dismiss) and the filter-indicator block (#scolta-filter-indicator, .scolta-filter-badge, .scolta-filter-dismiss). The in-sync scolta.js renders those elements, so the sort/filter badges shipped unstyled on WordPress. Root cause: the install copy hook only ever copied scolta.js, never the CSS or WASM. The committed CSS is now byte-identical to scolta-php's canonical assets/css/scolta.css.

Changed

  • The Composer install hook now copies all four duplicated assets, not just scolta.js. post-install-cmd/post-update-cmd delegate to a new copy-assets script that copies scolta.js, scolta.css, and both WASM files from vendor/tag1/scolta-php/assets/ into their committed locations (each guarded by [ -f … ] && cp … || true so a non-Composer context is non-fatal). This is what keeps the committed CSS/WASM copies from silently drifting again.
  • CI now guards every duplicated front-end asset against drift, not just assets/js/scolta.js. The asset-sync check reads scolta-php's assets/ASSETS.sha256 manifest and verifies each committed copy against it. Backward-compatible: if the scolta-php in the lock predates the manifest, CI falls back to the existing per-file scolta.js.sha256 check, so this can merge before scolta-php is released and upgrade to full manifest verification once the lock is bumped. (scolta-php#174)
  • Dropped the redundant message()/conversation()/messageForOperation() overrides in Scolta_Ai_Service; the base AiServiceAdapter now owns the budget-exception try/catch. Each override existed only to wrap the parent:: call in try/catch (\RuntimeException) → the budget hook. scolta-php's base class now does that wrapping and calls a protected handlePossibleBudgetException() hook, so the adapter keeps only its hook override. The hook was renamed handle_possible_budget_exception()handlePossibleBudgetException() and made protected (camelCase, with a scoped phpcs:ignore) so it overrides the vendor base method. Behavior is identical — an Amazee budget error still converts to AmazeeBudgetExceededException and notifies the budget handler exactly once. Requires scolta-php ≥ 1.0.3 (the release that adds the hook). (scolta-php#173)
  • Resynced the bundled scolta-core WASM (assets/wasm/) with the updated default summarize prompt. The rebuilt binary carries the explicit output-length budget (keep summaries under ~150 words, a single flat bulleted list, no section/sub-category headers) that prevents AI overviews from being truncated mid-sentence at the model's output-token ceiling (scolta-php#168). Byte-identical to scolta-php's assets/wasm/ bundle, which the plugin copies via copy-assets; this committed copy serves non-Composer install paths. The runtime prompt resolves server-side in PHP, so this keeps the committed browser asset in parity with core. (tag1consulting/scolta-core#37)
  • Opened 1.0.4-dev development cycle.