Skip to content

Run CLI workflows on Yieldstar - #38

Closed
djgrant wants to merge 2 commits into
yieldstar-integration-build-1from
yieldstar-integration-build-2
Closed

Run CLI workflows on Yieldstar#38
djgrant wants to merge 2 commits into
yieldstar-integration-build-1from
yieldstar-integration-build-2

Conversation

@djgrant

@djgrantdjgrant commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #37.

Problem

PR 37 left CLI deploy and destroy on the synchronous reconciler, while durable Yieldstar execution existed only as an embedded deploy generator. Destroy had no first-class durable workflow, and the old mutation path still carried its own step runner, renewable leases, refresh fallback, and separate state documentation.

Approach

  • Added NodeYieldstarRuntime in @notation/core to wire Yieldstar 0.5.0's WorkflowRunner, SQLite heap, stores, scheduler, timers, and resident event loop.
  • Moved deployApp and destroyApp onto deployWithYieldstar and destroyWithYieldstar, with the CLI printing resumable execution IDs and using one .notation/workflows.db state path.
  • Added durable destroy with shared deploy/destroy coordination, reverse dependency ordering, retryable provider waits, conditional state deletion, orphan hydration, lifecycle events, and replay-safe provider delete steps.
  • Removed the synchronous mutation class, operation step runner, refresh path, state lease contract and implementations, CLI file-state selection, and superseded documentation.
  • Kept provider clients and live resource objects inside Notation's workflow closures; the outer runtime owns execution, waiting, state, and coordination.

Result

CLI deploy and destroy now remain resident across Yieldstar timer wake-ups. Reusing an execution ID after a crash replays completed provider calls from the durable heap, including delete calls completed before state removal. Embedded callers retain the generator boundary and can supply their own Yieldstar runtime.

Checks

  • CI=true pnpm build — 13/13 tasks passed.
  • CI=true pnpm typecheck — 11/11 tasks passed.
  • CI=true pnpm test:once — 75 passed, 4 skipped.
  • Added coverage for resident long-provider waits, create crash replay, destroy crash replay, retryable delete waiting, reverse dependency destroy order, conditional store identity/version, concurrent workflow coordination, orphan deletion, and drift repair.

- Emit reconciler.drift.detected as a durable step before a drift-update
decision, restoring event parity with the synchronous reconciler.
- Emit a durable update skip lifecycle event when a resource has no update
operation instead of returning silently.
- Remove an unreachable dryRun check after the provider mutation.
- Read store snapshots in one round trip in YieldStarStateBackend and treat
a store deleted mid-read as resource absence, instead of listing every
store before each get, update, and delete.
- Return the committed store version from YieldStarStateBackend.update
rather than a locally computed revision.
- Test orphan deletion through the registry and drift repair with events on
the durable path.
- Document resuming a crashed deployment with the same execution ID to
release deployment coordination through replay.
@djgrant
djgrant changed the base branch from yieldstar-integration-review-1 to yieldstar-integration-build-1July 22, 2026 07:58
@djgrantdjgrant changed the title Run CLI workflows on YieldStarRun CLI workflows on YieldstarJul 22, 2026
@djgrant

Copy link
Copy Markdown
CollaboratorAuthor

Superseded by the squashed two-PR stack: #42 (reconciliation foundation) and #43 (runtime and CLI cutover). The combined result of that stack is byte-identical to this stack's final tree.

@djgrantdjgrant closed this Jul 22, 2026
Sign up for freeto 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.

1 participant

@djgrant