mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
System workers (scheduler, deletenamespace, workerdeployment) need: - GetVersion(ctx, changeID, min, max) — replay-determinism marker - SideEffect(ctx, fn) — once-per-ordinal recorded computation - MutableSideEffect(ctx, changeID, fn, eq) — replaceable recorded value - GetMetricsHandler(ctx).WithTags(...) — workflow-scoped metrics - UpsertSearchAttributes(ctx, attrs) — visibility upsert CoroutineEnv extended with the five seam methods. workerEnv carries per-run maps (versions, sideEffects, mutables) keyed by changeID / call ordinal; replays on the same input re-record the same values at the same call sites — Phase-1 contract. StubEnv mirrors the contract for tests, plus SetMetricsHandler and UpsertedSearchAttributes() for assertions. Property tests cover record-once, clamping, independent changeIDs, side-effect ordinal stability, mutable equality, and metrics routing. Refused without proven concrete need: HasLastCompletionResult, GetLastCompletionResult, UpsertTypedSearchAttributes, GetTypedSearch- Attributes. Nothing kept calls them.