diff --git a/.github/feature-test-timings.json b/.github/feature-test-timings.json index 574aaa79f..2e1d17612 100644 --- a/.github/feature-test-timings.json +++ b/.github/feature-test-timings.json @@ -228,6 +228,7 @@ "tests/Feature/V2/V2TerminalReasonDiagnosticsTest.php": 23.591816, "tests/Feature/V2/V2TimeoutCleanupAdmissionTest.php": 4.969863, "tests/Feature/V2/V2TimeoutCleanupMigrationTest.php": 10.047079, + "tests/Feature/V2/V2TimeoutCleanupSummaryMigrationTest.php": 10.047079, "tests/Feature/V2/V2TimeoutCleanupTest.php": 22.127049, "tests/Feature/V2/V2TimerDeadlineMigrationTest.php": 35.432759, "tests/Feature/V2/V2TimerWorkflowTest.php": 12.113366, @@ -498,6 +499,7 @@ "tests/Feature/V2/V2TerminalReasonDiagnosticsTest.php": 1.951918, "tests/Feature/V2/V2TimeoutCleanupAdmissionTest.php": 7.510203, "tests/Feature/V2/V2TimeoutCleanupMigrationTest.php": 2.120066, + "tests/Feature/V2/V2TimeoutCleanupSummaryMigrationTest.php": 2.120066, "tests/Feature/V2/V2TimeoutCleanupTest.php": 15.088411, "tests/Feature/V2/V2TimerDeadlineMigrationTest.php": 7.377256, "tests/Feature/V2/V2TimerWorkflowTest.php": 12.996575, diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecc0e627..071350c15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +- Run lists show the timeout cleanup outcome (#863). The run summary gains a + nullable `timeout_cleanup` JSON column holding what describe returns under + `run.timeout_cleanup` (`outcome: running` while cleanup is open, then the + recorded `completed`, `failed`, `expired` or `preempted` outcome), and + `RunListItemView` returns it, null when no cleanup was recorded. Migration + `2026_11_26_000100_add_timeout_cleanup_to_workflow_run_summaries` adds the + column outside the migrator transaction under the schema lock budget, with + no backfill. To fill it for opted-in runs that closed before the upgrade, + rebuild them with `workflow:v2:rebuild-projections --run-id=...`. + ## 2.42.0 - 2026-11-26 2.42.0 has no database migration. It adds a replay-aware workflow logger, diff --git a/docs/architecture/timeout-cleanup.md b/docs/architecture/timeout-cleanup.md index e9160219f..76016744f 100644 --- a/docs/architecture/timeout-cleanup.md +++ b/docs/architecture/timeout-cleanup.md @@ -176,6 +176,17 @@ history export. When no cleanup was recorded, the response omits the field. An expired outcome can omit `started_at` if the first detection was already past the hard deadline. +Run lists carry the same value. The run summary (`workflow_run_summaries`) +stores it in a nullable `timeout_cleanup` JSON column, written whenever the +whole run is projected, which includes cleanup entry and every close, so +Waterline's run list and `RunListItemView` return `timeout_cleanup`, null +when no cleanup was recorded. The column is added without a backfill. A +summary projected before the upgrade gains the value the next time its run is +projected; an already closed opted-in run (`workflow_runs` with +`timeout_cleanup_work_deadline_at` set) keeps null until +`workflow:v2:rebuild-projections --run-id=...` rebuilds it. Describe, run +detail and the observation read history and are correct either way. + ## Defaults and compatibility - Without `withTimeoutCleanup()`, nothing changes: the hard timeout closes diff --git a/src/V2/Models/WorkflowRunSummary.php b/src/V2/Models/WorkflowRunSummary.php index 9b7d7bf1a..d1f384d3d 100644 --- a/src/V2/Models/WorkflowRunSummary.php +++ b/src/V2/Models/WorkflowRunSummary.php @@ -43,6 +43,7 @@ class WorkflowRunSummary extends Model 'is_current_run' => 'bool', 'repair_attention' => 'bool', 'task_attention' => 'array', + 'timeout_cleanup' => 'array', 'task_problem' => 'bool', 'visibility_labels' => 'array', 'projection_schema_version' => 'integer', diff --git a/src/V2/Support/RunListItemView.php b/src/V2/Support/RunListItemView.php index 751a78402..bcb771dd5 100644 --- a/src/V2/Support/RunListItemView.php +++ b/src/V2/Support/RunListItemView.php @@ -79,6 +79,12 @@ public static function fromSummary(WorkflowRunSummary $summary): array 'task_attention' => array_key_exists('task_attention', $summary->getAttributes()) ? $summary->task_attention : null, + // Additive (#863): the timeout cleanup state describe returns + // under run.timeout_cleanup; null when none was recorded. + 'timeout_cleanup' => array_key_exists(TimeoutCleanup::SUMMARY_COLUMN, $summary->getAttributes()) + && is_array($summary->getAttribute(TimeoutCleanup::SUMMARY_COLUMN)) + ? $summary->getAttribute(TimeoutCleanup::SUMMARY_COLUMN) + : null, 'task_problem' => (bool) $summary->task_problem, 'task_problem_badge' => WorkflowTaskProblem::metadata( (bool) $summary->task_problem, @@ -149,6 +155,7 @@ public static function fields(): array 'repair_blocked_reason', 'repair_blocked', 'task_attention', + 'timeout_cleanup', 'task_problem', 'task_problem_badge', 'declared_entry_mode', diff --git a/src/V2/Support/RunSummaryProjector.php b/src/V2/Support/RunSummaryProjector.php index 01f0b0bb6..82fadd47d 100644 --- a/src/V2/Support/RunSummaryProjector.php +++ b/src/V2/Support/RunSummaryProjector.php @@ -561,6 +561,9 @@ public static function project(WorkflowRun $run, bool $disposableRun = false): W 'repair_blocked_reason' => $repairBlockedReason, 'repair_attention' => RepairBlockedReason::needsAttention($repairBlockedReason), ...WorkflowTaskLeaseLoss::summaryAttributes($run), + // Cleanup is entered and closed only by transitions that + // project the whole run, so bounded projections keep it. + ...TimeoutCleanup::summaryAttributes($run), 'task_problem' => $taskProblem, 'exception_count' => count($failureSnapshots), 'history_event_count' => $historyBudget['history_event_count'], diff --git a/src/V2/Support/TimeoutCleanup.php b/src/V2/Support/TimeoutCleanup.php index 142148f72..654788de2 100644 --- a/src/V2/Support/TimeoutCleanup.php +++ b/src/V2/Support/TimeoutCleanup.php @@ -38,6 +38,11 @@ final class TimeoutCleanup */ public const STARTED_KEY = 'timeout_cleanup'; + /** + * The additive `workflow_run_summaries` column and list-item field. + */ + public const SUMMARY_COLUMN = 'timeout_cleanup'; + public static function assertEmbeddedAdmission(?int $allowanceSeconds): void { if ($allowanceSeconds !== null && config('workflows.v2.task_dispatch_mode') === 'poll') { @@ -257,6 +262,30 @@ public static function observe(WorkflowRun $run, mixed $startedPayload): ?array ])), is_string(...)); } + /** + * The run summary's additive `timeout_cleanup` attribute: what `observe` + * returns, so run lists match describe and the run observation. None + * when the summary table has no such column. + * + * @return array|null> + */ + public static function summaryAttributes(WorkflowRun $run): array + { + if (! WorkflowTaskLeaseLoss::summaryHasColumn(self::SUMMARY_COLUMN)) { + return []; + } + + $started = $run->relationLoaded('historyEvents') + ? $run->historyEvents->first( + static fn (WorkflowHistoryEvent $event): bool => $event->event_type === HistoryEventType::WorkflowStarted + ) + : null; + + return [ + self::SUMMARY_COLUMN => self::observe($run, $started?->payload), + ]; + } + /** * @return array{0: string|null, 1: CarbonInterface|null} */ diff --git a/src/V2/Support/WorkflowTaskLeaseLoss.php b/src/V2/Support/WorkflowTaskLeaseLoss.php index 8adb28f72..6cb55484d 100644 --- a/src/V2/Support/WorkflowTaskLeaseLoss.php +++ b/src/V2/Support/WorkflowTaskLeaseLoss.php @@ -50,6 +50,12 @@ final class WorkflowTaskLeaseLoss */ private const SCHEMA_RECHECK_SECONDS = 60; + /** + * Run-summary columns added after the table, which a schema rollback can + * remove again. + */ + private const ADDITIVE_SUMMARY_COLUMNS = ['task_attention', TimeoutCleanup::SUMMARY_COLUMN]; + /** * @var array */ @@ -284,7 +290,16 @@ public static function tracked(bool $fresh = false): bool */ public static function summaryTracked(bool $fresh = false): bool { - return self::hasColumn(self::summaryModel(), 'task_attention', $fresh); + return self::summaryHasColumn('task_attention', $fresh); + } + + /** + * Whether the configured run-summary table has an additive column, with + * the same cached, rollback-aware check as `task_attention`. + */ + public static function summaryHasColumn(string $column, bool $fresh = false): bool + { + return self::hasColumn(self::summaryModel(), $column, $fresh); } /** @@ -317,11 +332,12 @@ public static function untrackedOnMissingColumn(Model $model, callable $query): } /** - * Write a run summary whose values may carry task_attention. + * Write a run summary whose values may carry an additive column + * (`task_attention`, `timeout_cleanup`). * - * A schema rollback can drop the column while the cached check still + * A schema rollback can drop such a column while the cached check still * reports it. On that error the cache is forgotten and $write runs again - * without task_attention. A failed statement aborts a caller's open + * without the additive columns. A failed statement aborts a caller's open * PostgreSQL transaction, so there the error is rethrown instead and the * caller's retry sees the current schema. * @@ -332,7 +348,7 @@ public static function untrackedOnMissingColumn(Model $model, callable $query): */ public static function writeSummary(array $values, callable $write): mixed { - if (! array_key_exists('task_attention', $values)) { + if (array_intersect_key($values, array_flip(self::ADDITIVE_SUMMARY_COLUMNS)) === []) { return $write($values); } @@ -350,9 +366,7 @@ public static function writeSummary(array $values, callable $write): mixed throw $exception; } - unset($values['task_attention']); - - return $write($values); + return $write(array_diff_key($values, array_flip(self::ADDITIVE_SUMMARY_COLUMNS))); } } diff --git a/src/migrations/2026_11_26_000100_add_timeout_cleanup_to_workflow_run_summaries.php b/src/migrations/2026_11_26_000100_add_timeout_cleanup_to_workflow_run_summaries.php new file mode 100644 index 000000000..2860837d7 --- /dev/null +++ b/src/migrations/2026_11_26_000100_add_timeout_cleanup_to_workflow_run_summaries.php @@ -0,0 +1,71 @@ +schema(); + + foreach ($this->summaryTables($schema, withColumn: false) as $table) { + $this->withSchemaLockBudget(static fn () => $schema->table( + $table, + static fn (Blueprint $blueprint) => $blueprint->json(self::COLUMN) + ->nullable(), + )); + } + } + + public function down(): void + { + $schema = $this->schema(); + + foreach ($this->summaryTables($schema, withColumn: true) as $table) { + $schema->table($table, static fn (Blueprint $blueprint) => $blueprint->dropColumn(self::COLUMN)); + } + } + + private function schema(): Builder + { + return Schema::connection($this->getConnection()); + } + + /** + * The existing run-summary tables (the package table and a configured + * model's table) that have, or lack, the column. + * + * @return list + */ + private function summaryTables(Builder $schema, bool $withColumn): array + { + $model = ConfiguredV2Models::resolve('run_summary_model', WorkflowRunSummary::class); + $tables = array_unique(['workflow_run_summaries', (new $model())->getTable()]); + + return array_values(array_filter( + $tables, + static fn (string $table): bool => $schema->hasTable($table) + && $schema->hasColumn($table, self::COLUMN) === $withColumn, + )); + } +}; diff --git a/tests/Feature/V2/V2EmbeddedReplayRegressionCorpusTest.php b/tests/Feature/V2/V2EmbeddedReplayRegressionCorpusTest.php index e859245d9..379d3562a 100644 --- a/tests/Feature/V2/V2EmbeddedReplayRegressionCorpusTest.php +++ b/tests/Feature/V2/V2EmbeddedReplayRegressionCorpusTest.php @@ -498,6 +498,47 @@ public function testTimeoutCleanupObservationCorpusKeepsTheRecordedClockAndOutco $this->assertEquals($scenario['terminal'], $observer->runDetail($run)['timeout_cleanup'] ?? null); } + public function testTimeoutCleanupSummaryCorpusListsTheRecordedOutcome(): void + { + $path = self::FIXTURE_DIR . '/timeout-cleanup-summary-listed.json'; + if (! is_file($path)) { + $this->markTestSkipped('The timeout cleanup summary evidence is absent.'); + } + $fixture = json_decode((string) file_get_contents($path), true, flags: JSON_THROW_ON_ERROR); + $scenario = $fixture['summary']; + config([ + 'queue.default' => 'database', + ]); + Queue::fake(); + $this->travelTo(Carbon::parse($fixture['history'][0]['recorded_at'])); + $stub = WorkflowStub::make($fixture['workflow']['type'], $fixture['id']); + $stub->start($fixture['workflow']['arguments'][0], new StartOptions( + executionTimeoutSeconds: $scenario['execution_timeout_seconds'], + timeoutCleanupSeconds: $scenario['timeout_cleanup_seconds'], + )); + $runId = $stub->runId(); + $this->runReadyTaskOfType($runId, TaskType::Workflow); + $observer = $this->app->make(OperatorObservabilityRepository::class); + $listed = static fn (): mixed => $observer->listItem( + WorkflowRunSummary::query()->findOrFail($runId) + )['timeout_cleanup']; + $this->assertNull($listed()); + + // The watchdog enters cleanup and projects the run. + $this->travel($scenario['detect_after_seconds'])->seconds(); + TaskWatchdog::runPass(runIds: [$runId]); + $this->assertEquals($scenario['running'], $listed()); + + // The cleanup turn returns; the close projects the recorded outcome. + $this->runReadyTaskOfType($runId, TaskType::Workflow); + $this->assertSame(RunStatus::Failed, WorkflowRun::query()->findOrFail($runId)->status); + $this->assertEquals($scenario['terminal'], $listed()); + $this->assertEquals( + $scenario['terminal'], + WorkflowRunSummary::query()->findOrFail($runId)->toArray()['timeout_cleanup'] + ); + } + public function testTimeoutCleanupTaskExpiryCorpusKeepsTheOutcome(): void { $path = self::FIXTURE_DIR . '/timeout-cleanup-task-expiry.json'; @@ -3303,6 +3344,11 @@ public function testFixturesExecuteThroughDeclaredReplayConsumers(): void continue; } + if ($fixture['id'] === 'timeout-cleanup-summary-listed') { + // The live projection at entry and close runs in the dedicated corpus test. + continue; + } + if ($fixture['id'] === 'version-usage-retained-reused-decision') { config()->set('app.key', 'version-usage-corpus-signing-key'); $this->assertVersionUsageRetainedDecision($fixture); diff --git a/tests/Feature/V2/V2TimeoutCleanupSummaryMigrationTest.php b/tests/Feature/V2/V2TimeoutCleanupSummaryMigrationTest.php new file mode 100644 index 000000000..86f66a735 --- /dev/null +++ b/tests/Feature/V2/V2TimeoutCleanupSummaryMigrationTest.php @@ -0,0 +1,78 @@ +migration(); + $this->assertFalse($migration->withinTransaction); + + $source = (string) file_get_contents(self::path()); + $this->assertSame(1, substr_count($source, 'withSchemaLockBudget')); + // No backfill: a summary gains the value when its run is projected. + $this->assertDoesNotMatchRegularExpression('/->\s*(update|insert|upsert|delete)\s*\(/', $source); + } + + public function testItAddsANullableColumnToAPopulatedTableAndCanRunAgain(): void + { + $migration = $this->migration(); + $migration->down(); + $this->assertFalse(Schema::hasColumn('workflow_run_summaries', 'timeout_cleanup')); + + $ids = []; + foreach (range(1, 5) as $number) { + $ids[] = $id = (string) Str::ulid(); + DB::table('workflow_run_summaries')->insert([ + 'id' => $id, + 'workflow_instance_id' => 'migration-instance-' . $number, + 'run_number' => 1, + 'class' => 'App\\Workflows\\Example', + 'workflow_type' => 'example', + 'status' => 'running', + 'status_bucket' => 'running', + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + + $migration->up(); + // An interrupted or repeated run skips work already done. + $migration->up(); + + $this->assertTrue(Schema::hasColumn('workflow_run_summaries', 'timeout_cleanup')); + $this->assertSame( + 5, + DB::table('workflow_run_summaries') + ->whereIn('id', $ids) + ->whereNull('timeout_cleanup') + ->count(), + ); + } + + private function migration(): WorkflowMigration + { + return require self::path(); + } + + private static function path(): string + { + return dirname(__DIR__, 3) . '/src/migrations/' . self::NAME . '.php'; + } +} diff --git a/tests/Feature/V2/V2TimeoutCleanupTest.php b/tests/Feature/V2/V2TimeoutCleanupTest.php index 2b834b26b..72208675e 100644 --- a/tests/Feature/V2/V2TimeoutCleanupTest.php +++ b/tests/Feature/V2/V2TimeoutCleanupTest.php @@ -4,8 +4,10 @@ namespace Tests\Feature\V2; +use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Queue; +use Illuminate\Support\Facades\Schema; use PHPUnit\Framework\Attributes\DataProvider; use Tests\Fixtures\V2\TestTimeoutCleanupCompensationWorkflow; use Tests\Fixtures\V2\TestTimeoutCleanupSameTurnWorkflow; @@ -29,8 +31,11 @@ use Workflow\V2\Jobs\RunWorkflowTask; use Workflow\V2\Models\WorkflowHistoryEvent; use Workflow\V2\Models\WorkflowRun; +use Workflow\V2\Models\WorkflowRunSummary; use Workflow\V2\Models\WorkflowTask; use Workflow\V2\StartOptions; +use Workflow\V2\Support\RunSummaryProjector; +use Workflow\V2\Support\WorkflowTaskLeaseLoss; use Workflow\V2\TaskWatchdog; use Workflow\V2\WorkflowStub; @@ -72,6 +77,8 @@ public function testAnIdleRunIsWokenAtItsWorkDeadlineAndEndsTimedOut( $runId = $workflow->runId(); $this->runReadyWorkflowTask($runId); $this->assertSame(RunStatus::Waiting, WorkflowRun::query()->findOrFail($runId)->status); + // Armed, not entered: nothing to report yet. + $this->assertVisibleTimeoutCleanup(WorkflowRun::query()->findOrFail($runId), null); // Past the work deadline, before the hard deadline: the watchdog wakes it. $this->travel(61) @@ -509,6 +516,37 @@ public function testUnavailableWorkersCannotKeepAnOptedInRunOpen(bool $lateDetec $this->assertSame($count, WorkflowHistoryEvent::query()->where('workflow_run_id', $runId)->count()); } + public function testASummaryColumnRollbackKeepsProjectingWithoutTheListValue(): void + { + [, $run] = $this->enterCleanupAt(61); + $this->assertTrue(WorkflowTaskLeaseLoss::summaryHasColumn('timeout_cleanup')); + + // The process still believes the summary column exists. + Schema::table('workflow_run_summaries', static function (Blueprint $table): void { + $table->dropColumn('timeout_cleanup'); + }); + + try { + $summary = RunSummaryProjector::project($run->refresh()); + $this->assertSame($run->id, $summary->id); + $this->assertFalse(WorkflowTaskLeaseLoss::summaryHasColumn('timeout_cleanup')); + $item = $this->app->make(OperatorObservabilityRepository::class) + ->listItem(WorkflowRunSummary::query()->findOrFail($run->id)); + $this->assertNull($item['timeout_cleanup']); + // Describe still reads history. + $this->assertSame('running', $this->app->make(WorkflowControlPlane::class) + ->describe($run->workflow_instance_id, [ + 'run_id' => $run->id, + ])['run']['timeout_cleanup']['outcome'] ?? null); + } finally { + Schema::table('workflow_run_summaries', static function (Blueprint $table): void { + $table->json('timeout_cleanup') + ->nullable(); + }); + WorkflowTaskLeaseLoss::summaryHasColumn('timeout_cleanup', true); + } + } + public function testExpiryWhileWaitingOnASignalInterruptsTheWaitAndALateSignalNeverApplies(): void { $this->travelTo(now()->startOfSecond()); @@ -708,6 +746,50 @@ public function testAnActivityResultRecordedAfterCleanupStartsIsDiscardedForTheI $this->assertTimedOutAfterCleanup($workflow, $runId, $started, 'completed'); } + public function testABoundedProjectionAfterACleanupActivityKeepsTheListedValue(): void + { + $this->travelTo(now()->startOfSecond()); + $workflow = WorkflowStub::make(TestTimeoutCleanupCompensationWorkflow::class, 'timeout-cleanup-bounded'); + $workflow->start(new StartOptions(executionTimeoutSeconds: 70, timeoutCleanupSeconds: 10)); + $runId = $workflow->runId(); + $this->runReadyWorkflowTask($runId); + $this->travel(61) + ->seconds(); + TaskWatchdog::runPass(runIds: [$runId]); + // The cleanup turn schedules the compensation activity. + $this->runReadyWorkflowTask($runId); + $started = $this->soleEvent($runId, HistoryEventType::WorkflowTimeoutCleanupStarted); + $running = [ + 'outcome' => 'running', + 'cause' => 'timeout', + 'timeout_kind' => 'execution', + 'started_at' => $started->payload['detected_at'], + 'work_deadline_at' => $started->payload['work_deadline_at'], + 'cleanup_deadline_at' => $started->payload['cleanup_deadline_at'], + ]; + $this->assertVisibleTimeoutCleanup(WorkflowRun::query()->findOrFail($runId), $running); + $before = WorkflowRunSummary::query()->findOrFail($runId); + + // The activity outcome opens the resume workflow task, and the bounded + // open-workflow-task projection is the summary's last writer. It + // writes only the task, wait and history columns. + $this->runReadyActivityTask($runId); + $completed = $this->soleEvent($runId, HistoryEventType::ActivityCompleted); + $after = WorkflowRunSummary::query()->findOrFail($runId); + $resume = WorkflowTask::query() + ->where('workflow_run_id', $runId) + ->where('task_type', TaskType::Workflow->value) + ->where('status', TaskStatus::Ready->value) + ->sole(); + $this->assertSame($resume->id, $after->next_task_id); + $this->assertSame((int) $completed->sequence, (int) $after->history_event_count); + $this->assertGreaterThan((int) $before->history_event_count, (int) $after->history_event_count); + $this->assertVisibleTimeoutCleanup(WorkflowRun::query()->findOrFail($runId), $running); + + $this->runReadyWorkflowTask($runId); + $this->assertTimedOutAfterCleanup($workflow, $runId, $started, 'completed'); + } + /** * @return iterable */ @@ -871,6 +953,8 @@ private function assertTimedOutAfterCleanup( $started->payload['cleanup_deadline_at'], $terminal->payload['timeout_cleanup']['cleanup_deadline_at'], ); + // Describe, observation, detail, the summary and the list item agree. + $this->assertVisibleTimeoutCleanup($run, $terminal->payload['timeout_cleanup']); } /** @@ -943,6 +1027,25 @@ private function assertVisibleTimeoutCleanup(WorkflowRun $run, ?array $expected) $this->assertSame($expected, $surface['timeout_cleanup'] ?? null); } } + + // Run lists: the projected summary (Waterline serializes the model) + // and the list item carry the same value, null when none. A JSON + // column may reorder keys, so only the members are compared. + $summary = WorkflowRunSummary::query()->findOrFail($run->id); + $item = $observer->listItem($summary); + $this->assertArrayHasKey('timeout_cleanup', $item); + foreach ([ + $summary->timeout_cleanup, + $summary->toArray()['timeout_cleanup'], + $item['timeout_cleanup'], + ] as $listed) { + if ($expected === null) { + $this->assertNull($listed); + } else { + $this->assertIsArray($listed); + $this->assertEquals($expected, $listed); + } + } } /** diff --git a/tests/Fixtures/V2/ReplayRegression/timeout-cleanup-summary-listed.json b/tests/Fixtures/V2/ReplayRegression/timeout-cleanup-summary-listed.json new file mode 100644 index 000000000..67389789d --- /dev/null +++ b/tests/Fixtures/V2/ReplayRegression/timeout-cleanup-summary-listed.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://raw.githubusercontent.com/durable-workflow/.github/main/regression-corpus/evidence-schema.json", + "fixture_schema": "durable-workflow.replay-regression/v1", + "id": "timeout-cleanup-summary-listed", + "protocol_version": "1.20", + "bindings": ["php"], + "consumers": ["workflow-fiber-runner"], + "workflow": { + "type": "Tests\\Fixtures\\V2\\TestTimeoutCleanupWorkflow", + "arguments": ["complete"], + "payload_codec": "avro" + }, + "history": [ + { + "sequence": 1, + "event_type": "WorkflowStarted", + "payload": { + "timeout_cleanup": { + "allowance_seconds": 10, + "work_deadlines": { + "execution": "2026-11-24T00:01:00+00:00" + } + } + }, + "recorded_at": "2026-11-24T00:00:00.000000Z" + }, + { + "sequence": 2, + "event_type": "TimerScheduled", + "payload": {"timer_id": "timeout-cleanup-summary-timer", "sequence": 1, "delay_seconds": 3600}, + "recorded_at": "2026-11-24T00:00:00.000000Z" + } + ], + "expected": {"completed": false, "result": null, "commands": []}, + "summary": { + "issue": "durable-workflow/workflow#863", + "execution_timeout_seconds": 70, + "timeout_cleanup_seconds": 10, + "detect_after_seconds": 61, + "running": { + "outcome": "running", + "cause": "timeout", + "timeout_kind": "execution", + "started_at": "2026-11-24T00:01:01+00:00", + "work_deadline_at": "2026-11-24T00:01:00+00:00", + "cleanup_deadline_at": "2026-11-24T00:01:10+00:00" + }, + "terminal": { + "outcome": "completed", + "timeout_kind": "execution", + "started_at": "2026-11-24T00:01:01+00:00", + "cleanup_deadline_at": "2026-11-24T00:01:10+00:00", + "finished_at": "2026-11-24T00:01:01+00:00" + }, + "note": "The run summary and list item carry what describe returns under run.timeout_cleanup: null while armed, outcome running from the projection at cleanup entry, then the recorded outcome from the projection at close." + } +}