hardening 2.1: 2meet-data-optimizer 1.1.0 (search-index mode, staged rollout) #4
Reference in New Issue
Block a user
Delete Branch "hardening/2.1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hardening 2.1 for
2meet-data-optimizer(version 1.1.0) — HivePress / WooCommerce search-index mode: native meta is the source of truth, flat tables are its search index. Decision and design:docs/adr-004-search-index-mode-for-hp-wc.md. Backlog:dev30/notes/pr-backlog.md(PR-052〜065 + 054b / 057b / 062b / 062c / 064b).Pairs with
2meet-data-optimizer-hivepress-addon0.2.0 (hardening/2.1).Summary
tmdo_promotion_guard_allow).wp tmdo repair-array-literals);bridge-restore-nativeoverwrite / only-missing by mode, no invented defaults; zone tables never created are never queried._sortshape; WordPress split query kept; flat-first for flat-sorted searches (tmdo_router_flat_first).tests/live(run inside a real site);composer phpcsusesphpcs.xmllike CI.Commits
Verification
dev30/notes/tmdo-acceptance-2.1-2026-09-26.md— V1–V3, V5–V7 pass (V1 T4: WC direct-SQL stock, known); V4 results identical to native, p50 321–866 ms vs 300 target (accepted, carried into 2.2).Rollout
Merging does not deploy:
plugins/(15 sites) stays on the current main until the staged rollout (dev22 first, 48 h). Existing aeav_only sites (dev20/21/22) needbridge-restore-native --demotewith this version — seedev30/notes/ops-aeav-sites-audit-2026-09-26.md.- TMDO_Cache_Layer::prefetch() / warm_post() (and so on_save_post / on_loop_start) queried wp_wpdo_cold_{post_type} whenever cold fields were registered, even with the cold module idle and the table never created: every HivePress / WC save logged "table doesn't exist" errors. They now return unless the module is write-active and the table exists. - CacheLayerTest activates the module in setUp; new cases assert zero cold queries while idle or when the table is missing. - Verify: CacheLayerTest 12 OK; unit 671 OK, integration 480 OK, phpcs (phpcs.xml) 0, stan OK; dev36 live: seeding listings/products/ vendors with cold_hp_listing idle → 0 wpdo_cold errors (was hundreds) - PR: PR-054- TMDO_Zone_Router::delete_post() deleted from wp_wpdo_hot_/cold_{post_type} whenever fields were registered for that zone, so every post delete on a HivePress site (cold fields registered, module idle, table never created) logged a "table doesn't exist" error. Hot and cold deletes now also need the table to exist; module state is not checked, so a table left by a rolled-back module still loses the rows of deleted posts. - Live suite zero_side_effect: saving / updating / deleting an hp_listing issues no query on missing zone tables (covers PR-054 and this PR). - Verify: ZoneRouterTest 22 OK; live zero_side_effect + shadow_write + serialized 9/9 PASS (old code: zero_side_effect FAIL); unit 687 OK, integration 484 OK, phpcs (phpcs.xml) 0, stan OK - PR: PR-054b- dual_write / shadow_read no longer write flat in the update_/add_/ delete_{type}_metadata pre-filters, before WP decides whether native changes at all. added_/updated_/deleted_{type}_meta (priority 1) call TMDO_Hook_Bus::sync_from_native(), which copies the entity's first native row (plain SQL, NULL when gone) into flat. Flat now follows native when WP skips (same value), refuses (non-matching prev_value, add $unique on an existing key) or deletes (also delete_all: touched IDs are collected from the meta IDs in delete_{type}_meta), and a flat value left stale by a direct SQL write heals on the next write. - update_metadata_by_mid key changes: the old key is remembered in update_{type}_metadata_by_mid and re-synced too. - wpdo_after_write / wpdo_after_delete fire from the sync with the same arguments; aeav_only keeps the pre-filter short-circuit unchanged. - $internal_ops lock key includes the entity type (user 5 ≠ post 5). - Live suite resync: 4 entities × 2 modes × 3 scenarios (old code: 16 of 24 FAIL); integration: pre-filter leaves flat to the sync, delete_all re-syncs every touched user. - Verify: live resync + shadow_write + serialized + zero_side_effect 33/33 PASS; unit 687 OK, integration 485 OK, phpcs (phpcs.xml) 0, stan OK - PR: PR-057