Repository navigation
Add the cross-SDK replay-safe clock conformance case - #439
Conversation
conformance/replay-clock replays one history with each WorkerReplayClock v1 carrier case through the published Python, Rust and PHP SDKs and the embedded worker-protocol runner. It requires the same replay_now() values at entry, for repeated entry reads, after an activity and after a timer, and the same unavailable entry for missing or unproved carriers. run.py installs exact releases in throwaway containers and reports releases that predate the entry carrier as not yet released. Unit tests pin the vectors and the comparison. Refs #215 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci.yml and sonar.yml must keep their exact reviewed bytes, so the new conformance unit test is not added to their lists. It runs with python -m unittest tests.test_replay_clock_conformance. Refs #215 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent review: CHANGES REQUESTED at 69cfa83 A reviewer in a fresh context reviewed this PR against .github#215 and the current main of server, sdk-python, sdk-rust, sdk-php and workflow, including workflow#1307. Verified
Why it is BLOCKED: BLOCKING
Non-blocking
|
- run.py: each container gets a private --tmpfs /scratch (mode 0700, owned by the invoking user) for the venv, source copy, HOME, CARGO_HOME and COMPOSER_HOME instead of /tmp. One binding's container or JSON failure is recorded as "status": "error" and the remaining bindings still run; the exit status is non-zero on fail or error. Split per binding, validate exact versions before any run, and add --container-prefix. - python/runner.py reads only the case's own vectors file; an argv path that does not resolve to it is refused. - PHP runners load the autoloader with require_once. - rust/src/main.rs maps only ReplayClockUnavailable to null and asserts the builder refuses exactly the other-run and low-precision carriers; the redrive-source carrier must be accepted. README wording matches. - ci.yml and sonar.yml are reviewed workflow bytes; adding a test to their lists is not a routine data update, so the Docker-only runners are excluded from coverage in sonar-project.properties instead. - Tests cover the scratch mount, per-binding errors and selection. Refs #215 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Independent review: PASS at 40fbcf5 (re-review) The same reviewer re-checked the diff 69cfa83..40fbcf5 and the live state.
Blocking: none. Non-blocking: the unit test still runs in no CI job; wire it in at the next approved review of |



What
This adds the cross-SDK replay-clock conformance case for #215 under
conformance/replay-clock/.What it checks. The case replays one history and each
WorkerReplayClockv1 carrier case (server#1156) through four bindings:ctx.replay_now()replay_now()replayNow()WorkflowFiberRunner,Workflow::now()Every binding must report identical values for:
started_at, not the history insertion time;Missing or unproved carriers must leave entry unavailable in the service SDKs. That covers no carrier, another run's carrier, a low-precision
started_at, and a redrive source on ordinary history. The embedded runner's documented exception is pinned inbinding_overrides: it keeps theWorkflowStartedtime without a proved carrier.Files.
vectors-v1.json: the shared history, cases and expected observations.python/runner.py,rust/src/main.rs,php/sdk-runner.phpandphp/embedded-runner.php.run.py: installs exact published releases (DW_PYTHON_SDK_VERSION,DW_RUST_SDK_VERSION,DW_PHP_SDK_VERSION,DW_WORKFLOW_PHP_VERSION) in throwaway containers and compares every observation.requires_newer_thannames the last release without the entry carrier: Python 2.23.1, Rust 4.24.0, PHP 3.31.0 and Workflow 2.41.0. A release at or below it is reported asnot_yet_releasedrather than failed.--sourceruns an unreleased checkout. It is for development only.tests/test_replay_clock_conformance.pypins the vectors' consistency, the comparator, the overrides, the version gate, the private scratch mount and per-binding error handling.ci.ymlandsonar.ymlmust keep their reviewed workflow bytes, and adding a test to their lists is not a routine data update (it needs a reviewed runtime change). Run it withpython -m unittest tests.test_replay_clock_conformance.sonar.coverage.exclusions=conformance/replay-clock/**insonar-project.properties). They stay in security, reliability and maintainability analysis.Container hygiene. Each container runs as the invoking user with
--rm --init, CPU and memory limits, and a private--tmpfs /scratch(mode 0700). The venv, the source copy,HOME,CARGO_HOMEandCOMPOSER_HOMElive there, not in/tmp. If one binding's container fails or prints no observations, it is recorded as"status": "error"and the other bindings still run. The exit status is non-zero on any fail or error.Embedded finding.
workflow_runs.started_at(RedriveReplayClock::startedAt), the same column the carrier is built from, so the two are equal.WorkflowFiberRunner, used by external PHP workers, took theWorkflowStartedevent time, which is written with a separatenow(). workflow#1307 adds the optional carrier to it.Evidence
not_yet_released./scratchmount, in source mode against current main of sdk-python, sdk-rust and sdk-php: all three pass. The embedded binding passes against the workflow#1307 head (0804b368). Against current workflow main it is recorded aserror(Unknown named parameter $replayClock) while the other bindings still run, as expected before #1307 merges.python -m unittest tests.test_replay_clock_conformance: 10 OK.ruff: clean.After the release round, run it against the published tuple as the README describes, and record the per-binding
result.jsonstatuses on the release issue.Refs #215
🤖 Generated with Claude Code