U-D/U-E/O5: Prozess-Tester im eigenen Prozess (standardmäßig gesperrt, 15 Negativtests, statischer Wächter), Szenarien und Bericht, Kanalereignisse (API-Eingang ohne Umbau von iCal/Mail), Abschluss nach finanzieller Klärung, Löschfrist 30 Tage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-04 15:34:40 +01:00
1 parent c255783cec
commit 0689c0a591
68 files changed
+3350 -35

No files matched your search

@@ -0,0 +1,40 @@
<?php
namespace App\Console\Commands;
use App\Process\Tester\EffectLedger;
use App\Process\Tester\ProcessSandboxDriver;
use App\Process\Tester\SandboxBootstrapper;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
use Throwable;
/**
* Entry of a tester run – only inside the process ProcessSandbox starts for it (environment FEWO_SANDBOX_RUN, so the
* SandboxBootstrapper has turned the process into a sandbox before anything was resolved). Reads input.json of the run
* and writes report.json; never touches anything outside the run's directory.
*/
#[Signature('process:sandbox-run {run : id of the prepared run}')]
#[Description('Play a process tester scenario inside its isolated process (started by the process tester only)')]
class ProcessSandboxRun extends Command
{
public function handle(ProcessSandboxDriver $driver): int
{
if (! SandboxBootstrapper::active() || (string) getenv(SandboxBootstrapper::ENV) !== (string) $this->argument('run') || config('sandbox.run') !== $this->argument('run')) {
$this->error('Nur innerhalb eines vom Prozess-Tester gestarteten Laufs.');
return self::FAILURE;
}
$directory = (string) config('sandbox.directory');
try {
$report = $driver->run((array) json_decode((string) file_get_contents($directory.'/input.json'), true));
} catch (Throwable $exception) {
$report = ['aborted' => 'Lauf abgebrochen: '.class_basename($exception).': '.$exception->getMessage(), 'timeline' => [], 'violations' => EffectLedger::violations()];
}
file_put_contents($directory.'/report.json', json_encode($report, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
return self::SUCCESS;
}
}