Skip to content

Repair native range-blocked workflows with a pending select activity - #399

Merged
rmcdaniel merged 6 commits into
mainfrom
rust-325-select-pending
Oct 11, 2026
Merged

rmcdaniel merged 6 commits into
mainfrom
rust-325-select-pending

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

When a mixed select's timer wins while its activity has never started, an incompatible version author can block the resumed workflow task. Native repair previously refused this checkpoint. This change preserves the first committed selection winner, explicitly repairs the original blocked workflow task with wait_kind: activity, and retains the original activity while compatible replay waits. Its separately routed activity-only worker then executes that activity, and a later workflow task completes the original run.

The implementation accepts one complete adjacent activity/timer leaf group, retaining metadata and the actual terminal history relationship. Member resolution and workflow wakeup commit under the existing database transition lock. Wakeups coalesce ready tasks while preserving later work when an older snapshot is leased. Unsupported groups and selection activity failures are refused before mutation. Native HTTP regressions cover two pools/restarts, original-task repair, waiting replay, stale fencing, immutable history, activity-first winner persistence and atomic rejection of invalid batches.

Published PHP activity-only workers encode an empty workflow contract map as []; native registration now accepts that representation and persists an empty map. Nonempty arrays/scalars remain refused. The native pending regression uses that actual registration shape and checks rejected definitions preserve the pending activity/history. Native scheduling explicitly initializes unclaimed activities at zero before first claim, matching both fixed PHP references without altering schema or existing data.

The separate pending-native profile runs the unchanged fixture against PHP HTTP, embedded Workflow and Rust on independent databases in the normal six-configuration matrix. Its manifest retains the exact qualified #397 artifact tuple and binds the reference manifest hash. Earlier reference invocations, failed tuple, completed-activity fixture and publication versions remain unchanged.

Validation: all 4,301 shared-reader models, 72 Docker-isolation regressions, shell syntax, Rust formatting and diff checks pass. Exact-source Shared 38141199951, PHP 38141199897 and boundaries pass. All six native configurations pass compilation, native execution, existing differential/role/fencing/pressure profiles and the new pending profile. All 18 actual pending recordings (three runtimes across six configurations) independently retain 5 → 7 → 8 → 8 → 11 events, three cold author PIDs, activity invocations 0/0/1, a distinct final task and the exact typed Avro output. Actual SQLite execution has 71 passing tests. Downloaded artifact digests/sizes match both API and actual uploader receipts; checkout 8bf75a7 has the same tree as candidate 6d40e2d. This verifies one bounded development scenario; broader selection/repair, other author languages, matched performance, migration and cutover remain separate #325 gates.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Native pending-activity follow-through is draft #399, current source d62015d97cacc1333f4e173e84898049288f6ca0. It persists bounded mixed-selection metadata and the first committed winner, preserves a later wakeup beside an older leased snapshot, and repairs only the proven timer-won/unclaimed-activity checkpoint. Failed/retrying selection activities remain explicitly refused before mutation.

All 4,301 reader models and 72 Docker isolation regressions pass locally. Native HTTP regression source covers restarts, two pools, original-task repair, immutable history, waiting acknowledgement, stale fencing, activity-first selection and wakeup interleaving. Formatting/syntax checks are distinct from compilation and actual runtime qualification.

Normal exact-source Shared fixtures and PHP/source qualification are pending. The matrix now selects the unchanged pending fixture against all three isolated runtimes, using the same qualified published PHP/embedded bytes and a separately frozen native profile. The initial superseded 2cae71fd qualification runs received cancellation requests after the wakeup review correction; no partial result is called a completed native qualification.

Workflow #755 is closed with final passing reference/main receipt. Published versions and prior failed/completed cohorts remain unchanged. Broader parity, other author languages, matched performance, migration and cutover remain ahead under #325.

@rmcdaniel

Copy link
Copy Markdown
Member Author

The first full native candidate d62015d97cacc1333f4e173e84898049288f6ca0 is unqualified: Shared run 38138468168 failed all six database jobs. PHP/source and boundary passed, but do not establish native execution.

Rust compiled. The actual SQLite job execution suite has 69 passing tests and two failed new assertions: a never-started activity exposed attempt count one instead of zero, and the activity-winner test's lease identity assertion received null. The normal shared recordings and pending-native profile were skipped after this failed test step; later source-fencing/pressure checks do not qualify the candidate. PostgreSQL 16 retained the same two assertion failures.

Official SQLite artifact 11701958679 is 1,150,070 bytes, SHA-256 10561c9a8fba065ff0cef978156c1f22bdad8a562b0cbcc771b15397fa8d302b; PostgreSQL 16 artifact 11701273660 is 1,080,452 bytes, SHA-256 ac4bc9b1fe20fb06c653ce1d677740778e26fc8b9330c07715bb08155d0a69aa. Downloaded bytes independently match API/uploader identities; actual decoded logs and test output are retained.

Source 35e4f8b282a640ebd16cd8de0387eeded004b2ed now explicitly initializes authored activities at zero rather than inheriting the physical SQL schema's default of one. Both the original ordinary PHP recording and the corrected pending reference have zero before claim. The physical schema/history and expected fixture are unchanged. Lease identity assertions now retain the actual claim context for diagnosis; that issue remains under investigation. Corrected Shared and PHP/source qualification are pending. #399 remains draft; no native pending result or release is claimed.

@rmcdaniel

Copy link
Copy Markdown
Member Author

The null mismatches were internal event-ID assertions, which I misidentified earlier as lease identity assertions. Actual lease identity guards pass. Public HTTP history intentionally omits the internal event id; the persisted SelectionResolved.resolution_event_id is still present. The two tests incorrectly compared that value with an absent HTTP field.

Candidate 35e4f8b282a640ebd16cd8de0387eeded004b2ed compiled and corrected the unclaimed counter, but remains unqualified: actual SQLite job has 69 passing execution tests and those two failed event-ID assertions; normal recordings were skipped. Official artifact 11701939920, 1,150,151 bytes, SHA-256 4bc7fbf3461f9cded9c7ec3f21e572c940d17788db48e589c5f35430ae94eb08, independently matches the API, uploader and downloaded bytes. Raw actual logs and tests are retained.

Current source 37e5ec331373388e4d88a4e36ed87d5c4de7a79a verifies each winner against the actual persisted event at the public history sequence, using a read-only database query on each backend. This preserves the HTTP response and strengthens the physical relationship check. The unchanged fixtures, repair/fencing assertions, limits and published cohort remain intact. Exact-source Shared qualification and PHP/source are pending; #399 remains draft.

@rmcdaniel

Copy link
Copy Markdown
Member Author

The exact 37e5ec3 Shared run failed all six runtime jobs; PHP/source and boundary checks pass. Actual SQLite execution has 71 passing native tests. Existing shared, patch and legacy recordings succeed. The new pending native author preserves the timer winner, explicitly repairs the blocked original workflow task and replays waiting history, then stops before activity execution.

The retained actual request explains the failure: published PHP SDK 2.2.7 registers its separately routed activity-only worker with workflow_command_contracts: [], PHP's empty associative-map representation. Rust rejects it with 422 invalid_worker_definition. PHP HTTP and embedded complete the unchanged fixture.

Correction dec10cd92ac66949ed04e4a841022e64b74d8ee5 / tree fa1e761c1b7069e618c71b841d49dba4e7b0f07a accepts that empty representation and persists an empty internal map. Nonempty arrays/scalars remain refused. The pending native regression now uses an activity-only registration, checks invalid definitions preserve history/pending work, and executes the original activity. Formatting and diff checks pass; exact hosted qualification is required before this draft moves forward. Frozen manifests, fixture, resource limits, deadlines and published versions stay unchanged.

Official failed SQLite artifact 11702830714 is independently verified against API/uploader/download: 23,098,359 bytes, SHA-256 7d606b6233a43407be15de5e54b6912c6e2501a2fb3f2cb0335cbd34b99eea15. Failed evidence remains distinct from future qualification. Server #396 owns the separate PHP Nexus fix and reserved Server 2.5.21 / Helm 0.1.158 publication.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Server #396 is merged as ff4a07706bea0dd4a028c58377e35a9456a44cc7. This branch incorporates that main commit without competing PHP/Nexus/version edits. Current native candidate is 6d40e2d3fa02982d3d7bd6cc6696a9a4a0fe4813, tree 80938cdf8ce0d38965c9006d4ab2745bd8141415.

Combined-source qualification is Shared 38141199951 and PHP 38141199897, plus normal boundaries. The superseded dec10 SQLite compilation/native-test step passed, but its full recordings were still running when the integration became available. Cancellation was requested for its own Shared/PHP runs to avoid completing the superseded matrix; no complete or cancelled qualification claim applies before final receipts.

The pending profile remains pinned to the qualified Server 2.5.20 / Workflow 2.5.10 / PHP SDK 2.2.7 reference, with unchanged fixture and artifact bytes. The operating owner publishes and verifies #396's Server 2.5.21 / Helm 0.1.158 separately. This draft remains native development only.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Native #399 candidate 6d40e2d3fa02982d3d7bd6cc6696a9a4a0fe4813 / tree 80938cdf8ce0d38965c9006d4ab2745bd8141415 is qualified for the bounded pending mixed-selection repair scenario. Actual checkout 8bf75a7ee4821997bd72e47f16c7fb8cb7626871 has the same tree. Shared 38141199951, PHP 38141199897 and both boundaries pass. All six runtime configurations pass; SQLite has 71 passing native execution tests. Existing differential, role-token, worker-fencing and pressure profiles also pass.

All six official archives were independently downloaded and matched against API and actual uploader sizes/digests. Their 18 actual pending recordings each pass: PHP HTTP / embedded / Rust, with 5 → 7 → 8 → 8 → 11 events; three distinct cold author PIDs; original activity invocations 0/0/1; the committed timer winner, original blocked-task repair and unchanged waiting history; a different final workflow task; and exact int64 9007199254740993, Unicode and null Avro values. This is one scenario executed across the matrix, not 18 new capabilities.

The pending reference remains frozen at Server 2.5.20 / Workflow 2.5.10 / PHP SDK 2.2.7. General-owned #396 is integrated and its Server 2.5.21 publication is separately delivered. Failed and cancelled source receipts remain distinct. Merge/main follow-through is next; broader selection/repair, other SDK and consumer directions, matched performance, migration and cutover remain open under #325.

@rmcdaniel
rmcdaniel marked this pull request as ready for review October 11, 2026 13:15
@rmcdaniel
rmcdaniel merged commit 2dbf05d into main Oct 11, 2026
14 checks passed
@rmcdaniel
rmcdaniel deleted the rust-325-select-pending branch October 11, 2026 13:20
@rmcdaniel

Copy link
Copy Markdown
Member Author

#399 and its qualification-log follow-through #400 are delivered.

Native merge 2dbf05dcb4cfab8fc89973e24245438a167e3d37 retains qualified tree 80938cdf8ce0d38965c9006d4ab2745bd8141415. Main Shared 38142464272 passes every runtime configuration; main PHP 38142464238 and boundary pass. Actual main SQLite output has 71 passing execution tests and three passing pending records completing the original run with one activity invocation and exact typed output. Its official artifact 11703741913 independently matches API/uploader/download: 23,403,475 bytes, SHA-256 681873f69b06ec4cde97c88a46d171cf1001bf07f0c04de72e0ee636e3fd3ded.

Documentation merge 6c7de566f302c84935aecbb38ab2b02a89e28019 retains reviewed tree e49670b9501e739f12671ad9640dc064e742f21c. Its normal PR checks and main PHP 38143217560, boundary and capacity publication audit pass. This is a port-log update; native code, frozen fixtures/manifests and publication metadata are unchanged.

Both merged remote/local branches, disposable checkout/scratch and task formatter image/intermediate are removed, with branch/image absence verified and shared resources preserved. Raw records remain byte-identical in verified compressed evidence; failed/cancelled candidates stay separate. This closes the bounded pending mixed-selection repair follow-through. #325 remains open for broader selection/repair, actual SDK/consumer directions, matched performance, migration and cutover.

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.

2 participants