refactor(2meet-data-optimizer): remove HPCT legacy from core

- Feature flags keep only the live AddOn modules (wc_orders, latepoint) as ADDON_MODULES / addon_modules(); drop map_hpct_status() and the 7 HivePress HPCT modules whose interceptors were removed in PR-014
- Remove HPCT detection/notice (Compatibility, core), the admin HPCT import tab and status row, CLI import-hpct, the 7 advisor rules for dead modules, and the removed interceptors from COEXIST_WHITELIST
- Verify: NoHpctLegacyTest guard; core unit 635 / integration 449, HP 145/49, WC 10/22 OK; all sites have every module idle and never imported HPCT
- PR: PR-020c
This commit is contained in:
2026-09-26 00:14:18 +08:00
parent 1eedaa9b3c
commit 8a1c9c0353
13 changed files with 110 additions and 378 deletions
+20 -20
View File
@@ -65,65 +65,65 @@ class FSMAdvisorTest extends TestCase {
}
public function test_idle_state_returns_HOLD(): void {
$this->set_module_state( 'reviews', 'idle' );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'idle' );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'HOLD', $advice['action'] );
$this->assertSame( 'info', $advice['level'] );
}
public function test_complete_state_returns_HOLD(): void {
$this->set_module_state( 'reviews', 'complete' );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'complete' );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'HOLD', $advice['action'] );
}
public function test_dual_write_with_short_soak_returns_WAIT(): void {
// In dual_write 0 days < 1 day min soak.
$this->set_module_state( 'reviews', 'dual_write', 0 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'dual_write', 0 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'WAIT', $advice['action'] );
$this->assertGreaterThanOrEqual( 1, $advice['days_remaining'] );
}
public function test_dual_write_after_min_soak_returns_PROMOTE(): void {
$this->set_module_state( 'reviews', 'dual_write', 2 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'dual_write', 2 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'PROMOTE', $advice['action'] );
$this->assertSame( 'backfill', $advice['next_state'] );
}
public function test_verify_with_long_soak_returns_PROMOTE(): void {
// verify needs 7 days; 10 days = should promote.
$this->set_module_state( 'reviews', 'verify', 10 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'verify', 10 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'PROMOTE', $advice['action'] );
$this->assertSame( 'cutover', $advice['next_state'] );
}
public function test_verify_with_short_soak_returns_WAIT(): void {
$this->set_module_state( 'reviews', 'verify', 3 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'verify', 3 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'WAIT', $advice['action'] );
$this->assertSame( 4, $advice['days_remaining'] );
}
public function test_cleanup_with_short_wash_returns_WAIT(): void {
$this->set_module_state( 'reviews', 'cleanup', 1 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'cleanup', 1 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'WAIT', $advice['action'] );
$this->assertSame( 2, $advice['days_remaining'] );
}
public function test_cleanup_after_wash_returns_PROMOTE(): void {
$this->set_module_state( 'reviews', 'cleanup', 5 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'cleanup', 5 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'PROMOTE', $advice['action'] );
$this->assertSame( 'complete', $advice['next_state'] );
}
public function test_advice_metrics_include_state_and_soak(): void {
$this->set_module_state( 'reviews', 'dual_write', 5 );
$advice = WPDO_FSM_Advisor::advise( 'reviews' );
$this->set_module_state( 'wc_orders', 'dual_write', 5 );
$advice = WPDO_FSM_Advisor::advise( 'wc_orders' );
$this->assertSame( 'dual_write', $advice['metrics']['state'] );
$this->assertSame( 5, $advice['metrics']['days_in_state'] );
$this->assertSame( 1, $advice['metrics']['min_soak_days'] );
@@ -132,8 +132,8 @@ class FSMAdvisorTest extends TestCase {
public function test_advise_all_returns_map_for_all_modules(): void {
$advice = WPDO_FSM_Advisor::advise_all();
$this->assertNotEmpty( $advice );
// All known HPCT + zone modules should be present (default idle).
foreach ( WPDO_Feature_Flags::HPCT_MODULES as $m ) {
// All known AddOn + zone modules should be present (default idle).
foreach ( WPDO_Feature_Flags::ADDON_MODULES as $m ) {
$this->assertArrayHasKey( $m, $advice );
}
}