Skip to content

Rust Server train: condition waits (#713), task snapshots (#718), patch cohort (#722), message streams (#709) - #744

Merged
rmcdaniel merged 16 commits into
rust-325-train-oct24-bfrom
rust-325-train-oct24-c
Oct 25, 2026
Merged

rmcdaniel merged 16 commits into
rust-325-train-oct24-bfrom
rust-325-train-oct24-c

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of #325. Security class: R1 train, four constituents. Stacked on #743 (base rust-325-train-oct24-b); it merges after #743.

Constituents

The unserved-route list drops the three message stream routes #709 now serves.

The R1 handoff with the exact SHA follows when this PR's runs are terminal.

rmcdaniel and others added 16 commits October 23, 2026 19:17
Appends, diagnostics, delivery as the runtime-reserved signal, worker
cursor acknowledgements and waits on workflow task completions, and the
hand-over of the cursor and unconsumed messages to a continued run, with
the message-streams parity fixture recorded from published PHP 2.11.1.

A signal consumed by a condition wait now records no SignalApplied unless
it is declared, the instance cursor event carries its task snapshot, and a
completion reports the next message task, as PHP does. Retention holds runs
whose instance has inbound streams until stream cleanup is ported.
Published PHP treats an open_condition_wait's condition_key and
condition_definition_fingerprint as optional strings of any form, trimmed
and left out when empty. Native required both and a sha256 fingerprint. The
wait projection and run summary now read a keyless wait as PHP does.
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.
…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.
…s maintenance loop (#721)

On SQLite the published PHP API server and its maintenance loop share one
database file. A contended poll gets PHP's typed backend_lock_pressure
refusal, and the published Python run_until helper ends its Worker on it
(sdk-python #218). The cohort tests patch replacement, not writer
contention: stop the loop for the PHP record, restart it right after, and
record and assert its state. The observer still never retries a poll
refusal; MySQL and PostgreSQL jobs are unchanged.
…t until a sustained restart (#721)

Security review of #722: the restore trap was installed only after a
successful stop and disarmed before the restart was checked. Move the
window into published-sdk-patch/maintenance.sh: arm restoration before
the stop, restart with up to three attempts that each require the loop
to stay running across three checks, and disarm only after that. A
failed restart records the observed state and fails with restoration
still armed.

tests/Unit/PatchCohortMaintenanceTest.mjs injects a stop that exits
nonzero after taking effect, a failed PHP record, and a start that
exits at once, with a fake docker. The previous ordering fails the first
and the last.
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.
…721)

The Docker workflow isolation policy requires a stopped container's name to
resolve to github.run_id, run_attempt and job in the same source. Name the
SQLite job's maintenance container from GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT
and GITHUB_JOB, refuse to act unless it equals the job's
$RESOURCE_SCOPE-php-maintenance, and add a control proving a container
outside the job scope is never touched.
…ust-325-train-oct24-c

# Conflicts:
#	.github/workflows/server-parity.yml
#	rust/src/runtime/store.rs
#	rust/tests/execution.rs
#709 serves the three message-stream routes, which the route coverage
test reported as now served. Native serves 129 of 175 route methods at
this tree; 46 remain.
@rmcdaniel
rmcdaniel merged commit ab20a21 into rust-325-train-oct24-b Oct 25, 2026
15 of 20 checks passed
@rmcdaniel
rmcdaniel deleted the rust-325-train-oct24-c branch October 25, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant