environment('testing') || DB::getDriverName() !== 'pgsql' || DB::connection()->getConfig('host') !== '127.0.0.1' || ! preg_match('/^compras_receipts_test_[a-f0-9]{12}$/D', DB::connection()->getDatabaseName())) { throw new LogicException('Synthetic standalone business database required.'); } $settings = config('standalone-runtime'); $settings['enabled'] = true; $settings['prepare_only'] = false; $settings['features'] = array_fill_keys(StandaloneRuntime::FEATURES, true); config(['standalone-runtime' => [...$settings, 'enabled' => false], 'common-payables.source_instance' => 'standalone-business-synthetic']); $runtime = new StandaloneRuntime($settings, new StandaloneArtifact); $runtime->artifact(); (require base_path('database/standalone-migrations/2026_11_29_000001_create_runtime_installations.php'))->up(); DB::table('compras_runtime_installations')->insert(['id' => $settings['installation_id'], 'product' => 'compras', 'contract' => StandaloneArtifact::CONTRACT, 'manifest_sha256' => $settings['manifest_sha256'], 'database_binding_sha256' => StandaloneRuntime::databaseBinding(DB::connection()), 'recorded_by' => 'Synthetic standalone business regression', 'reason' => 'Authorised isolated candidate verification', 'installed_at' => now()]); (require base_path('database/standalone-migrations/2026_11_29_000002_install_standalone_extensions.php'))->up(); config(['standalone-runtime' => $settings]); app()->instance(StandaloneRuntime::class, $runtime); $paths = $runtime->configure(DB::connection()); config(['general-ledger.path' => $paths['general-ledger']]); $runtime->assertLoadedPackages(); }