Implements Spec 110 Ops‑UX Enforcement and applies the repo‑wide “enterprise” standard for operation start + dedup surfaces. Key points - Start surfaces: only ephemeral queued toast (no DB notifications for started/queued/running). - Dedup paths: canonical “already queued” toast. - Progress refresh: dispatch run-enqueued browser event so the global widget updates immediately. - Completion: exactly-once terminal DB notification on completion (per Ops‑UX contract). Tests & formatting - Full suite: 1738 passed, 8 skipped (8477 assertions). - Pint: `vendor/bin/sail bin pint --dirty --format agent` (pass). Notable change - Removed legacy `RunStatusChangedNotification` (replaced by the terminal-only completion notification policy). Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #134
55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Tests\Support\OpsUx\SourceFileScanner;
|
|
|
|
it('does not reference the removed legacy run status notification', function (): void {
|
|
$root = SourceFileScanner::projectRoot();
|
|
$files = SourceFileScanner::phpFiles([$root.'/app', $root.'/tests'], [
|
|
__FILE__,
|
|
]);
|
|
|
|
$needle = 'RunStatus'.'ChangedNotification';
|
|
$violations = [];
|
|
|
|
foreach ($files as $file) {
|
|
$source = SourceFileScanner::read($file);
|
|
|
|
if (! str_contains($source, $needle)) {
|
|
continue;
|
|
}
|
|
|
|
$offset = 0;
|
|
|
|
while (($position = strpos($source, $needle, $offset)) !== false) {
|
|
$line = substr_count(substr($source, 0, $position), "\n") + 1;
|
|
|
|
$violations[] = [
|
|
'file' => SourceFileScanner::relativePath($file),
|
|
'line' => $line,
|
|
'snippet' => SourceFileScanner::snippet($source, $line),
|
|
];
|
|
|
|
$offset = $position + strlen($needle);
|
|
}
|
|
}
|
|
|
|
if ($violations !== []) {
|
|
$messages = array_map(static function (array $violation): string {
|
|
return sprintf(
|
|
"%s:%d\n%s",
|
|
$violation['file'],
|
|
$violation['line'],
|
|
$violation['snippet'],
|
|
);
|
|
}, $violations);
|
|
|
|
$this->fail(
|
|
"Legacy notification reference(s) found:\n\n".implode("\n\n", $messages)
|
|
);
|
|
}
|
|
|
|
expect($violations)->toBe([]);
|
|
})->group('ops-ux');
|