fix(api): simplify XLVask Selvvask surface by removing AI autopilot pipeline (#367)
## Summary Removes the XLVask autopilot / automation / MiniMax / OpenAI pipeline and the related module config, CLI, cron, and migration scaffolding. The Selvvask view (Superuser -> Fakturaer -> Periode -> Selvvask) is reduced to a single read-only listing of usage logs plus operator-driven ignore / unignore / accept / reject endpoints gated on the `review_xlvask_usage_order` permission. See `inventory/self-serve-inventory.md` for the full surface map. ## Test plan - [x] `vendor/bin/pest --testsuite=Unit` -> **1266 passed**, 1 unrelated pre-existing failure (`BirdControlPlaneActivationTest`, needs `PLENO_REPO_ROOT_FOR_TESTS`). - [x] `php -l` on every modified PHP file -> no syntax errors. - [x] Grep validation -> zero production-code references to removed surfaces (`xlvask_autopilot_service`, `xlvask_automation_service`, `xlvask_automation_policy_service`, `EnsureXLVaskAutomationSchema`, `runScheduledAutomationIfReady`, `processAutopilotQueue`, `MiniMax`, `minimax`, ...). - [ ] Qodana + Tests workflows green on this PR. Co-authored-by: openhands <openhands@all-hands.dev> --------- Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* XL Vask automation schema migration script.
|
||||
*
|
||||
* Mirrors the scripts/account-deletion-schema.php and
|
||||
* scripts/bird-control-plane-schema.php patterns so ops can run an explicit,
|
||||
* non-cron, non-HTTP migration from the API container.
|
||||
*
|
||||
* Usage (from the api repo root, against the configured DB):
|
||||
* php scripts/xlvask-automation-migrate.php check
|
||||
* php scripts/xlvask-automation-migrate.php apply --yes
|
||||
*
|
||||
* "check" never mutates state and always exits 0 when ready / 1 when not.
|
||||
* "apply" requires an explicit --yes flag before calling the gated
|
||||
* migration_20260804_xlvask_ai_auto_policy_v2::apply() entry point, which
|
||||
* itself is operator-only by design (see AUTOMATION_RUNBOOK §2).
|
||||
*/
|
||||
|
||||
if (PHP_SAPI !== 'cli') {
|
||||
fwrite(STDERR, "This command is CLI-only.\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
const WD = __DIR__ . '/../services/nginx/app';
|
||||
require_once WD . '/vendor/autoload.php';
|
||||
require_once WD . '/config.php';
|
||||
require_once WD . '/classes/db.php';
|
||||
require_once WD . '/classes/xlvask_usage_logs_schema_bootstrap.php';
|
||||
require_once WD . '/modules/xlvask/migrations/20260804_xlvask_ai_auto_policy_v2.php';
|
||||
|
||||
$command = $argv[1] ?? 'check';
|
||||
|
||||
if (!in_array($command, ['check', 'apply'], true)) {
|
||||
fwrite(STDERR, "Usage: scripts/xlvask-automation-migrate.php check|apply --yes\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
$db = new \classes\db($CONFIG_DB);
|
||||
$db->connect();
|
||||
|
||||
if ($command === 'apply') {
|
||||
if (($argv[2] ?? '') !== '--yes') {
|
||||
fwrite(STDERR, "Refusing schema mutation without: apply --yes\n");
|
||||
exit(2);
|
||||
}
|
||||
$status = \classes\xlvask_usage_logs_schema_bootstrap::applyExplicitMigration();
|
||||
} else {
|
||||
$status = \classes\xlvask_usage_logs_schema_bootstrap::migrationStatus();
|
||||
}
|
||||
|
||||
fwrite(STDOUT, json_encode($status, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL);
|
||||
exit((bool)($status['ready'] ?? false) ? 0 : 1);
|
||||
Reference in New Issue
Block a user