Skip to content

feat(runtime): add atomic workflow scheduler state-store and recovery boundary #541

Description

@seonghobae

Problem

The pure selectRunnableWorkflowTasks selector returns scheduling candidates only. Production execution authority requires one Noema-owned durable state/repository boundary binding an admitted execution/plan revision to atomic task claims, checkpoint CAS, effect-aware recovery, cancellation, blocked-descendant handling and bounded provenance.

Current implementation state — 2026-09-07 KST

Protected Noema is main@0dec8d84b1e4744e7a9c6a77e2e2631a183ee2ab after normal integration of trust prerequisite #554. Protected central .github/main remains GitHub-verified c9052e607e5f3cc76e73207e7786b21500721b79.

Active implementation owner is PR #542 exact 4616b5e93e19d51973aea330aa4124b51725b795, open / Draft. Its ancestry already contains ordinary/non-force two-parent restack 7f743f4ee8d81c8d52511ef421d8e40a32edf2a8, combining predecessor #542 2bb6076d911a526570176294c99fd86421c152eb with protected main@0dec8d84.... The branch preserves durable workflow state/execution-plan authority plus protected ALLOWED_WORKFLOW_SHA = c9052e607e5f3cc76e73207e7786b21500721b79; provider/model routing, quarantine/security/outbound policy and foreign domain truth remain outside this boundary.

Hosted RED → minimum causal repair

Post-restack exact 7f743f4... CI 34063013448 checked out the exact head, resolved live base to 0dec8d84..., passed lockfile control, install and typecheck, then reported 577 passing test files / one failing test and 4,079 passing tests / one failing test. The only failure was the retained-provenance hostile fixture: it replaced receipt index 0 with null, simultaneously destroying the native sequence-one initialized causal root and the receipt record shape. Production correctly rejected the earlier root invariant, while the test demanded the later malformed-receipt diagnostic.

Commit 4616b5e93e19d51973aea330aa4124b51725b795 is the minimum causal repair. The fixture now preserves the valid sequence-one initialized receipt, advances the synthetic ledger to sequence 2, and appends null as the second receipt. The test therefore isolates the non-record-receipt invariant without changing production validation, synthetic-data scope or the repository's 100% coverage gate.

Fresh current-head evidence for 4616b5e...:

  • ci 34064157863: terminal success.
  • reviewer-ci 34064157866: terminal success.
  • required Security Scan 34064157896: terminal success.
  • patch-validator-image 34064157873: in progress/non-passing.

Fresh review-thread authority contains no unresolved finding. No predecessor result transfers as merge authority.

Required production semantics

  1. Atomic workflow snapshot/task claim under exact execution, plan, dependency, cancellation and claim preconditions.
  2. Checkpoint compare-and-swap; replay is explicit and does not manufacture a new transition.
  3. Effect-specific recovery; side effects are never silently retried from transport failure.
  4. Explicit blocked descendants and deterministic/versioned scheduling policy.
  5. One execution-scoped durable authority and one admitted plan identity; no public/cross-service command surface.
  6. Bounded, payload-minimized provenance for claim/effect/completion/checkpoint/cancellation/recovery. Native sequence-one provenance starts at initialized; supported pre-ledger state may begin observable provenance with its first valid task_claimed receipt rather than inventing older history.
  7. Owned production branches remain executable under the repository's 100% statement/branch/line gate; hostile corruption rejection paths are not exempted as unreachable.

Completion evidence

  • Production Durable Object composition exists behind Noema-owned ports/repositories.
  • Execution-scoped plan authority and legacy-state conflict handling exist.
  • Atomic claim, checkpoint replay/CAS, cancellation, recovery and provenance contracts exist with hostile/concurrency regressions.
  • Retained ledger cardinality and explicit-empty-ledger corruptions fail closed.
  • Forged sequence-one checkpoint_committed native root fails closed.
  • Hosted compatibility/coverage/stale-base REDs were classified and repaired without weakening production controls.
  • fix(trust): roll audited central workflow source to c9052e6 #554 integrated normally first at protected main@0dec8d84....
  • feat(workflow): add atomic durable task claim and checkpoint CAS #542 was ordinary/non-force restacked without losing NOEMA_WORKFLOW_STATE or current trust-source authority.
  • Post-restack fixture ambiguity was isolated and repaired at 4616b5e...; current CI, reviewer-ci and required Security Scan are terminal success.
  • Current unchanged exact head receives terminal-success patch-validator-image plus fresh live-base evidence.
  • Normal protected integration preserves every valid feat(workflow): add atomic durable task claim and checkpoint CAS #542 delta; no simple close or predecessor-evidence transfer.
  • Applicable protected-runtime/release evidence is collected before deployed atomicity or immutable release is claimed.

Documentation / architecture

Keep PRD/TRD/ARCHITECTURE/Context Map/Ubiquitous Language/ADR/UML/TEST_STRATEGY/OPERABILITY/recovery/TRACEABILITY/CHANGELOG aligned with the executable boundary. The sole cross-lane docs/product-technical-gap-baseline.md writer remains #547. Source composition and candidate CI are not Cloudflare production/runtime proof until protected operational evidence exists.

Related: #528, #545, PR #542.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions