PR Vision v0.2.0: admin/settings interface + correctness fixes (#3)

Model manager (UI-swappable models) + versioned/idempotent prv_models migration; metric comparability (config-version stamping); run-lock; projected cost + truncation state; per-model run-health; cadence reschedule; API-key 3-state; design/a11y fixes (dark v2).

QA: APPROVE-WITH-P2-NOTES — qa-reviews/pr-vision/2026-06-14-ee4371d9163f992f60e09c7e4ac6cf8cd1d3c5eb.md

Agent-Session: pr-vision admin v0.2.0 merge
This commit is contained in:
peptiderepo
2026-06-14 14:48:25 +07:00
committed by GitHub
parent 401077fe45
commit 2fcef7a323
28 changed files with 2923 additions and 388 deletions

View File

@@ -10,14 +10,16 @@ declare(strict_types=1);
/**
* Main orchestrator for the PR Vision plugin.
*
* Boots sub-systems in the correct order, hooks into WP, and keeps
* the top-level file under the 300-line limit by delegating all logic
* to specialist classes.
* Boots sub-systems in the correct order, runs pending data migrations,
* hooks into WP, and keeps the top-level file under the 300-line limit by
* delegating all logic to specialist classes.
*
* Who triggers: plugins_loaded action (pr-vision.php).
* Dependencies: PRV_Cron, PRV_Admin_Page, PRV_Collector_Registry.
* Dependencies: PRV_Upgrader, PRV_Cron, PRV_Admin_Page, PRV_Settings_Page,
* PRV_Collector_Registry.
*
* @see ARCHITECTURE.md — Boot sequence diagram.
* @see ARCHITECTURE.md -- Boot sequence diagram.
* @see class-prv-upgrader.php -- Runs migrations on every boot.
* @package PrVision
*/
class PRV_Plugin {
@@ -25,18 +27,28 @@ class PRV_Plugin {
/**
* Wire up all WordPress hooks.
*
* Side effects: Registers admin menus, enqueues assets, and registers the
* collector/panel registry.
* Migrations run before anything reads from prv_models so the v2 format
* is always in place regardless of whether the plugin was freshly activated
* or just upgraded from v0.1.x while live.
*
* Side effects: Registers admin menus, enqueues assets, registers the
* collector/panel registry, runs data migrations.
*
* @return void
*/
public function init(): void {
// Migrations first -- must run before any config read.
PRV_Upgrader::run();
$cron = new PRV_Cron();
$cron->register_hooks();
if ( is_admin() ) {
$page = new PRV_Admin_Page();
$page->register_hooks();
$settings = new PRV_Settings_Page();
$settings->register_hooks();
}
// Register the v1 AI-visibility collector + panel.