refactor(2meet-data-optimizer-hivepress-addon): stop registering Hot zone fields
Tests / PHP Lint (pull_request) Successful in 50s
Tests / Unit Tests (pull_request) Successful in 58s
Tests / Integration Tests (pull_request) Successful in 57s

- ADR-003 step 4 (AddOn side): core, requests, bookings, memberships and
  marketplace adapters no longer register zone=hot fields or contribute
  hot_* FSM modules; their keys live in TMDO_HivePress_Entity_Groups.
  Cold/warm registrations are unchanged.
- Hot-table doctor probes go with them (trait defaults apply). The
  hot-clause query rewrite and cron optimizer are now inert and are left
  for the ADR step-5 removal together with core's hot path.
- New NoHotZoneRegistrationTest pins the invariant across all 13 adapters;
  per-adapter hot assertions removed.
- Verify: HP unit 142 / integration 49 green, phpcs clean (WordPress)
- PR: PR-037
This commit is contained in:
2026-09-26 01:13:35 +08:00
parent 0e260ee3a9
commit 0254e40d83
11 changed files with 71 additions and 527 deletions
-29
View File
@@ -33,31 +33,6 @@ class HivePressBookingsAdapterTest extends TestCase {
$this->assertSame( 'HivePress\\Bookings\\Plugin', $this->adapter->detection_class() );
}
public function test_on_register_fields_reserves_booking_hot_columns(): void {
$registry = WPDO_Schema_Registry::instance();
$this->adapter->on_register_fields( $registry );
$start = $registry->get_field( 'hp_booking', 'hp_start_time' );
$this->assertSame( 'hot', $start['zone'] );
$this->assertTrue( (bool) $start['indexed'] );
$end = $registry->get_field( 'hp_booking', 'hp_end_time' );
$this->assertSame( 'hot', $end['zone'] );
$this->assertTrue( (bool) $end['indexed'] );
}
public function test_on_register_fields_uses_real_booking_meta_keys(): void {
$registry = WPDO_Schema_Registry::instance();
$this->adapter->on_register_fields( $registry );
// hivepress-bookings has no guests field; places are stored as hp_quantity.
$this->assertNull( $registry->get_field( 'hp_booking', 'hp_guests' ) );
$quantity = $registry->get_field( 'hp_booking', 'hp_quantity' );
$this->assertNotNull( $quantity );
$this->assertSame( 'hot', $quantity['zone'] );
}
public function test_score_reflects_unverified_perf_dimension(): void {
$score = $this->adapter->suitability_score();
// D8 reduced to 0.9 because schema is best-effort until addon installs.
@@ -65,8 +40,4 @@ class HivePressBookingsAdapterTest extends TestCase {
// Aggregate = (7 × 1.0 + 0.9) / 8 × 10 = 9.875 → 9.88.
$this->assertSame( 9.88, $score['aggregate'] );
}
public function test_migrations_lists_booking_module(): void {
$this->assertSame( array( 'hot_hp_booking' ), $this->adapter->migrations() );
}
}