Repository navigation
Rust #325: task snapshots on every event PHP records with a task, and describe command class/preview - #718
Rust #325: task snapshots on every event PHP records with a task, and describe command class/preview#718rmcdaniel wants to merge 5 commits into
Conversation
Published PHP's WorkflowHistoryEvent::record adds the task's snapshot to each event it records with the task model. Native now adds it centrally for those event types, uses the full snapshot on TimerScheduled and the activity events, and leases a timer task to itself while it fires, as RunTimerTask does, so TimerFired carries the leased timer task.
PHP's run description names the run's workflow class on every command and says whether the command's payload preview is omitted. Native left both out. Only a stored external reference is read to decide the flag.
|
Security/data-boundary review at exact 05a6110: no command payload is emitted by this diff, but the new preview flag is incorrect for the native stored-reference shape and the metadata-only query is broader than its comment.
The expanded task snapshot field set itself excludes task payloads and credentials and stays within the existing tenant-owned history surface. Keep that property, the stacked #710 base, and fresh exact-head/current-main qualification. This head is not accepted yet. |
…nto rust-325-task-snapshots # Conflicts: # rust/tests/execution/worker_history_presentation.rs
…fix; run-bound task snapshots Security review of #718: - oversized() reads native's external_payload envelope as well as PHP's external_storage, so a stored reference over the payload limit omits the preview (and the target name, as PHP does). Run input and output previews use the same check. - The described-command query reads a payload only when its first 30 characters equal native's stored prefix, compared case-sensitively on each backend (COLLATE BINARY, binary cast, PostgreSQL text). - record() reads a task snapshot only from a task of the event's own run. Tests: a real stored reference at the 2 MiB limit and one byte above, upper-case/v2/malformed/large-inline counterfactuals, the query itself on SQLite, and a mismatched-run event with no snapshot.
|
Corrections for the Security review (comment 6376568945), at exact head
Tests:
Counterfactuals: the old Local: SQLite |
|
Security re-review at replacement head One data-path blocker remains. The query calculates The new test masks this mismatch: it performs one real small upload, then rewrites No merge acceptance yet. Hosted checks are also still pending, and #718 remains stacked on #710. |
Security review of #718 at 65772ab: native keeps a signal's stored input reference in workflow_signal_records.arguments; workflow_commands.payload holds the encoded command. Read the exact native sentinel from s.arguments for signals and from c.payload for starts only, case-sensitively per backend. The describe test now proves the real signal row is the source, mutates that row around the limit with the same counterfactuals, shows an oversized sentinel in a signal's command row does not count, and covers the start command's row.
|
Correction for the Security re-review (comment 6378027005), at exact head Query. The stored sentinel is now read from each command type's real input column:
Tests.
Counterfactual. Restoring the previous Local. SQLite |
|
Security re-review of exact head |
Part of #325. Stacked on #710 (
rust-325-history-presentation); it will be retargeted tomainonce #710 merges.Problem
Published PHP's
WorkflowHistoryEvent::recordadds atasksnapshot to every event it records with the task model in hand. Native added snapshots event by event and missed several. The same workflow was driven against both servers through a side effect, an activity, a timer, a child, a signal wait and a condition wait. Native had no snapshot on these events:TimerFired;ChildWorkflowScheduledandChildRunStarted;SignalWaitOpened,ConditionWaitOpenedandConditionWaitSatisfied;SignalAppliedand the instanceMessageCursorAdvanced.Its own snapshots on
TimerScheduledand the activity events also dropped fields PHP keeps.Change
When an event of a type that PHP records with the task model is appended with a task and has no snapshot, native adds the task's snapshot. The list of types comes from the Workflow package's source.
TimerScheduleduses the full snapshot.ActivityStarted,ActivityCompletedandActivityFailedkeep PHP's fields (queue,connection,lease_expires_at,repair_count).A timer task is leased to itself while its timer fires, as
RunTimerTaskdoes: it gets a workflow-task lease and one more attempt. The lease is cleared once the timer has fired, soTimerFiredcarries the leased timer task.Described commands: each command in a run description now names the run's
workflow_classand carriespayload_preview_omitted, as PHP'sWorkflowControllerdoes. With fresh workers on both sides, a field-by-field diff of the same workflow's description then differs only in the deployment's randomrequest_route_nameand the fingerprint hashed from it.Record:
docs/rust-server-port-checkpoints/2026-10-23-task-snapshots.md.Checks
events_recorded_with_a_task_carry_its_snapshotcovers the timer, child, signal-wait, signal and condition-wait events.Left as they are
request_route_name, a name Laravel generates at random for cached routes.