# Changelog

> Release history of the Qoliber Advanced FAQ suite in Keep-a-Changelog format.

Current version: **1.1.0**

All notable changes to the Qoliber Advanced FAQ suite are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/).

## 1.1.0 — 2026-08-07 — post-release hardening (external review rounds 1–7)

> Suite-level overview. Each satellite module also keeps its own `CHANGELOG.md`
> (`AdvancedFaqSearch`, `AdvancedFaqWebapi`, `AdvancedFaqRule`, `AdvancedFaqHyva`,
> `AdvancedFaqAi`, `AdvancedFaqGraphQl`, `Ai`) with the module-scoped detail.

### Fixed

- **Store force-enable / detail rendering (QF-01).** A FAQ disabled at the default
  scope but force-enabled for a store view now renders its detail page in that store
  (the redundant global-status gate was removed; the store-aware check owns status),
  and a store-override save now purges the hub/topic/featured aggregate tags so a
  newly-enabled FAQ appears immediately.
- **REST writes go through the aggregate save.** `POST /V1/advanced-faq/items` now
  routes to `Qoliber\AdvancedFaqWebapi\Api\FaqWriteInterface::save`, so relations
  persist, featured/listing caches purge and the post-commit reindex fires — matching
  the admin. Optional `topicIds`/`tagIds`/`categoryIds`/`productIds`/`includeChildren`
  ride alongside the FAQ body; a `null` relation array preserves existing relations, and
  the SEO `has_detail_page` flag now round-trips over REST/GraphQL (round-4 finding 5).
- **Gemini request payload.** `contents`/`parts` are now encoded as JSON arrays (not
  objects), and a null `generationConfig` is omitted — generation no longer 400s.
- **Rule cache invalidation.** Saving/deleting a rule now flushes the full page cache,
  and a daily cron flushes it on a rule's activation (`from_date`) or expiry
  (`to_date + 1`, matching the inclusive active window). Rule module gained its first tests.
- **Durable OpenSearch reindex recovery.** The shutdown-only in-memory reindex buffer is
  replaced by a persistent operation queue (`qoliber_advancedfaq_reindex_queue`), drained
  by the request fast-path and a `*/5` cron backstop. This recovers deletes, topic/tag
  reindexes, outages of any length, and delete/taxonomy changes concurrent with a full
  rebuild. A rebuild also re-applies any FAQ changed since its snapshot began.
- **Reindex-queue concurrency & durability hardening (review rounds 3–6).** Drains lease rows with
  a token and acknowledge only under it; a re-enqueue clears the lease so newer data is never
  dropped; failed index **and delete** operations propagate so they are retried, not acked;
  permanently-failing rows become **retained dead-letters** (recoverable via
  `qoliber:advancedfaq:reindex-queue --retry-dead-letter`), never deleted. All reindex writers
  (queue drains and full rebuilds) are serialised by a DB-namespaced MySQL advisory lock, making
  last-write-wins correct without fragile optimistic versioning. The CLI `--run` loop reads a drain
  outcome and stops on a failed/no-progress batch or a held lock instead of burning every retry.
- **MySQL search finds translated text.** On a non-default store the search now matches
  the per-store (translated) question/answer, not only the default columns.
- **Guides on the hub refresh on change.** Creating, activating, deactivating or deleting
  a FAQ Page now purges the hub listing tag, so new Guides appear without waiting for TTL.
- **Release gate.** Widget unit test constructor signature corrected (PHPStan + unit green).

### Added

- **Reindex-queue operability** — `bin/magento qoliber:advancedfaq:reindex-queue`
  (backlog + failure counts; `--run` drains/retries) and a search-recovery runbook.
- **PHP 8.5** added to every package's supported range (code is 8.5-ready; see the
  README note — a full 8.5 install waits on a Mage-OS/laminas release that permits 8.5).
- **Test coverage** — end-to-end REST write specs (create + relations, `has_detail_page`
  true→false, partial-update preservation, delete→404, ACL) and queue failure-mode
  integration tests, with the unit suite now exiting zero (round-7 shutdown-mock fix).

### Changed

- **Packaging (v1.1.0).** Every module carries `version: 1.1.0` and the canonical
  Qoliber composer metadata (authors, `homepage`, `minimum-stability`), house-style
  file headers across all PHP/XML/JS, and the previously-undeclared
  `magento/module-page-cache` / `magento/module-cache-invalidate` dependencies, mirrored
  in the `module.xml` sequences.

## 1.0.0 — 2026-06

Initial release of the Advanced FAQ suite (core + optional satellites).

### Added

- **Content model & admin**: Topics, Tags, FAQ items (short WYSIWYG answer + optional
  long-form `full_answer`) and standalone FAQ Pages, with grids, inline edit, mass
  enable/disable/delete and store-view scoping.
- **Storefront surfaces (Luma)**: `/faq` hub with search and topic sidebar navigation,
  topic hubs `/faq/<topic>`, opt-in per-FAQ SEO detail pages
  `/faq/<topic>/<url-key>`, a product-page FAQ tab, a category FAQ block, and a configurable
  **FAQ Block widget** (topic / selected / featured; accordion or list).
- **Hyvä storefront** (`Qoliber_AdvancedFaqHyva`): CSP-safe Tailwind templates for all
  surfaces plus navigation integration.
- **Assignment**: direct product, category-inherited, topic/tag, and rule-based
  auto-assignment via catalog-rule conditions (`Qoliber_AdvancedFaqRule`).
- **Search**: built-in MySQL provider with real-time indexing; optional OpenSearch provider
  (`Qoliber_AdvancedFaqSearch`) with edge-ngram prefix matching, real-time indexing and a
  no-results "content gaps" Search Insights report.
- **SEO / AEO**: clean URLs, canonicals, breadcrumbs, XML sitemap inclusion, and toggleable
  schema.org-valid `FAQPage` JSON-LD structured data for answer-engine / AI discoverability.
- **APIs**: REST endpoints (`Qoliber_AdvancedFaqWebapi`) for storefront reads and admin CRUD;
  GraphQL queries (`Qoliber_AdvancedFaqGraphQl`) — `advancedFaqTopics`,
  `advancedFaqTopicItems`, `advancedFaqForProduct`, `advancedFaqForCategory`.
- **Internationalization / multi-store**: per-store-view content overrides with fallback
  across storefront, REST and GraphQL.
- **AI answer generation** (`Qoliber_AdvancedFaqAi` + `Qoliber_Ai`): admin "Generate" button
  and the `qoliber:advancedfaq:ai:generate` console command for draft answers.
- **Extension points**: `SearchProviderInterface`, `AnswerGeneratorInterface` and
  `RuleMatcherInterface`, allowing the core to run standalone and satellites to override
  cleanly.
- **Configuration**: the `qoliber_advancedfaq` section (enable, product/category placement,
  JSON-LD toggle, navigation link) and the `qoliber:advancedfaq:search:reindex` command.
