Repository navigation
Add a consumed scalar business replay clock - #289
Conversation
|
The original Successor The exception-test Sonar finding is corrected in this successor. Separating scalar row validation reduced the remaining lifecycle function to complexity20, still above15; a further lifecycle extraction follows on the same PR. No rule suppression, skip, corpus-policy or validator weakening was introduced. The same fixture/consumer and existing legacy clocks/errors remain enforced. No main/publisher/operating or #184 change is involved. |
|
Bounded producer-field review of One concrete native redrive mismatch remains in The remaining requested mapping is coherent within its declared subset:
Ordinary-entry Source Git blobs: Server redrive |
|
Correction after the follow-up source finding: the runtime producer-discriminator claim and timer-refusal control below are withdrawn. Core also writes this acceptance prefix. Bounded producer correction for Server's field finding is exact The clock accepts only either the Core start-at-zero shape or the finite native Controls: 49 clock controls, 13 native writer-profile controls, preserved Core evidence controls and 102 official corpus tests pass in the combined 371-control run. Full units: 5624 passed, 3 optional-dependency skips, 130 integration tests deselected. Ruff/mypy pass. The 2859-byte native fixture SHA256 is Every redrive fixture remains registered. The new named native activity-only profile validates the distinct prefix, identities, sequence, inline Avro shape and original times, with rejection controls. Core's existing checker, fixture bytes and positive/negative expectations are unchanged; the native fixture must still fail that different Core shape. No corpus selector, guard or validator was skipped or suppressed. Inventory is replay 104→106, codec 43→43. The identical 102-test official consumer was run on base The earlier scope correction independently passed the original Python3.11 job on |
|
Bounded follow-up for exact One new producer assumption in this delta needs correction: The new Ordinary-entry |
|
The shared-prefix finding is corrected at The new 3552-byte Core fixture SHA256 is 103 identical official consumer tests on four product revisions:
All negatives are expected timestamps versus unavailable observations, with zero collection/import errors. Consumer SHA256 is Local final source validation: 49 clock controls and 379 combined clock/corpus/redrive controls pass; full units 5632 passed /3 optional-dependency skips /130 integration tests deselected; Ruff/mypy pass. Fresh current-head hosted qualification is running. Earlier failures and the withdrawn inference/control retain their separate records. This is not a published/native tuple, full #215 conformance, #285 live-health acceptance or #184 disposition. |
|
Bounded source-field/time carry for exact The runtime no longer classifies a producer from the shared acceptance prefix or suppresses a proven reused timer on that basis. Finite prefix identity and contiguous outer history checks remain; timestamp/recorded-at representation handling remains explicit. The extracted reuse-time helper preserves source-run, resume-boundary, original-time and distinct activity-identity checks. Native evidence remains a separate activity-only writer profile, while the complete Core acceptance/start plus reused timer has a positive case. I independently matched the new Core fixture: 3,552 bytes / SHA-256 Ordinary-entry |
|
Current successor is The preceding head The new business-clock isolation wrapper wrote a ContextVar during suspended-generator disposal, which can occur during another ContextVar update. This successor removes those disposal writes and uses a thread-local guard for synchronous close instead. Cleanup remains in its original context, including customer ContextVar tokens. Normal clock scopes use their original tokens again; the pre-existing cancellation replay token/reset is unchanged. No exception is suppressed to turn this failure into success, and no interpreter defect is claimed established. 51 clock controls now include explicit-close and cyclic-finalizer cases that preserve a suspended generator's ContextVar reset, refuse both its own and a captured parent clock during cleanup, and restore the parent replay/time afterward. The cyclic-discard/error control also verifies cancellation replay context restoration. Full local units: 5634 passed, three existing optional-dependency skips, 130 integration tests deselected. Ruff/mypy pass; 446 focused handler/corpus/redrive controls pass. Corpus policy passes with replay 104→107 and codec 43 unchanged. The identical 103-test official consumer and its three fixtures are unchanged from the recorded base/before-prefix/wrong-inference comparison and pass on this successor. Fresh current-head Python 3.11 and the complete required checks remain pending. Server's bounded field/time carry on |
|
|
Exact source Docs PR run Proceeding through normal protected merge. Automatic main checks and the source-triggered docs preview/deploy-skip are the next acceptance checkpoint. The stable publisher is manual-only with an exact published SDK tag; the main merge does not publish a package or promote this API into the existing stable portal. Full central #215 published conformance remains open. |
|
Actual-main acceptance is complete at All 21 PR checks passed. Actual main has 19 successful checks and one declared docs-deploy skip, none pending/failed/cancelled, across five successful original workflows:
Direct PR Sonar inventory is zero. Main's analysis is bound to The main Pages artifact 13477075767 is a source preview, never deployed. ZIP SHA-256 Five ordinary live byte comparisons (audit, landing, SDK reference, Client and Worker API) still match the previously accepted stable artifact. Live docs remain Exact merged branch This completes the selected scalar activity/timer/redrive source cohort for central #215. Ordinary-entry carrier authority, additional families/callbacks, published cross-SDK conformance and rollout remain open. |



Workflow code can now deliberately use
ctx.replay_now()for business deadlines and elapsed time at supported consumed boundaries. The additive accessor returns the exact UTC-aware activity/timer instant or explicit redrive start and raises exportedReplayClockUnavailablewhen authority is missing, ambiguous, unsupported or outside the matching execution scope. Legacyctx.now(), UUIDs, commands, history and cancellation clocks keep their existing behavior.The clock indexes identities, then reads time only on the actual scalar result/failure branch. Equal/backward times retain their precision. Redrive supports retained start-only history and the finite same-identity
StartAccepted/WorkflowStartedprefix shared by Core and native. The prefix does not identify the producer. Correlated reused activity success and timer pairs retain original time; failures use their own event time. Workerrecorded_atand public-historytimestampforms are supported. Query callbacks require the supported final inspected prefix. Scoped restoration and task/thread identity prevent another replay or callback from borrowing an instant. Ordinary entry still lacks a proved canonicalrun.started_atcarrier; local/inline/grouped and other families remain explicitly unavailable.Validation: all 21 current-head checks pass, including Python 3.10–3.15, integration and teardown, portal preview, corpus, CodeQL and Sonar. Direct Sonar issue inventory is zero. Python 3.11 passes 5635 tests with two optional skips; full local units pass 5634 with three optional-dependency skips and 130 integration tests deselected. Ruff/mypy pass. The 51 clock controls include cyclic-discard cleanup, original-error preservation, generator ContextVar tokens, identity/prefix refusals, complete Core timer reuse and both timestamp representations. Disposal uses a synchronous thread-local clock guard so finalizers do not write ContextVars; generator tokens and the existing cancellation replay context keep their behavior.
The identical official consumer runs 103 tests on four product sources: base
6f30853bhas three behavioral failures; pre-prefix-fix089d7a9has two; wrong-inference199caf6has exactly one on the complete Core timer case; candidate passes all 103. No collection/import failures supply a negative. Existing corpus selectors/guards and Core's successor checker/controls remain unchanged. Native's named evidence profile stays activity-only. A finite Core prefix adapter validates its acceptance row before applying the unchanged successor checker; it rewrites no payload/time. Every redrive fixture remains registered and checked. Replay inventory grows 104→107; codec stays 43.Refs durable-workflow/.github#215. Follows the source cohort, confirmed Python API and existing consumed-event/callback decisions. Full published cross-SDK conformance, later families and guides remain open. Stable docs stay bound to published SDK 2.14.1. No new wire field, marker, package/release, driver/TLS execution or #184 route is selected.