Skip to content

[SLOP(claude-opus-4-8-high)] feat(workflow-engine): add getVersion primitive for workflow versioning#5308

Draft
abcxff wants to merge 1 commit into
mainfrom
stack/slop-claude-opus-4-8-high-feat-workflow-engine-add-getversion-primitive-for-workflow-versioning-wpnprqor
Draft

[SLOP(claude-opus-4-8-high)] feat(workflow-engine): add getVersion primitive for workflow versioning#5308
abcxff wants to merge 1 commit into
mainfrom
stack/slop-claude-opus-4-8-high-feat-workflow-engine-add-getversion-primitive-for-workflow-versioning-wpnprqor

Conversation

@abcxff

@abcxff abcxff commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@abcxff

abcxff commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Stack for rivet-dev/rivet

Get stack: forklift get 5308
Push local edits: forklift submit
Merge when ready: forklift merge 5308

@railway-app

railway-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-5308 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud 😴 Sleeping (View Logs) Web Jun 23, 2026 at 4:59 am
frontend-inspector 😴 Sleeping (View Logs) Web Jun 23, 2026 at 4:59 am
kitchen-sink 😴 Sleeping (View Logs) Web Jun 23, 2026 at 4:57 am
ladle ✅ Success (View Logs) Web Jun 23, 2026 at 4:52 am
website 😴 Sleeping (View Logs) Web Jun 21, 2026 at 7:58 am
mcp-hub ✅ Success (View Logs) Web Jun 19, 2026 at 1:46 pm

@claude

claude Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR Review: getVersion workflow versioning primitive

This PR adds a getVersion(name, latest) primitive to the workflow engine that lets a workflow detect whether it is an old in-flight instance or a freshly started one, enabling safe code-path migrations. The heuristic — scan for unvisited history entries under the current scope — is well-conceived and the per-iteration loop test validates the critical split-cutover case. Test coverage is solid.


Findings

1. Stale mirror-schema path in CLAUDE.md — medium

rivetkit-typescript/packages/workflow-engine/CLAUDE.md instructs:

When updating schemas/v1.bare in this package, also update the mirror at rivetkit-typescript/packages/rivetkit/schemas/persist/v1.bare. … Run pnpm -C rivetkit-typescript/packages/rivetkit run build:schema.

Neither the path rivetkit-typescript/packages/rivetkit/schemas/persist/v1.bare nor the build:schema script exist. The PR correctly updated the actual mirror (src/common/bare/transport/v1.ts), but the CLAUDE.md guidance now points to a dead location. A future contributor following it will spend time looking for files that don't exist or silently skip the mirror update, causing inspector deserialization divergence. The CLAUDE.md should be updated to name the real mirror path and the real rebuild command.


2. writeWorkflowEntryKind and entryKindToBare missing exhaustiveness guards — low

rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:613 and rivetkit-typescript/packages/workflow-engine/schemas/serde.ts:236 both switch on a discriminated union without a default: assertUnreachable(x as never) guard. The CLAUDE.md rule is: "Enumerate every variant explicitly so adding a new variant later is a compile error instead of a silent behavior change." Enumerating variants satisfies the first half; the assertUnreachable guard is what makes a future missing case a compile error rather than a silent write-nothing (which corrupts the BARE byte stream). This is a pre-existing pattern but the PR is adding a new union variant — a good time to close the gap. inspector.ts's toWorkflowEntryKind already uses assertUnreachable and can serve as the model.


3. serializeWorkflowEntryKind in native.ts has no default guard — low

native.ts serializeWorkflowEntryKind (around line 915) enumerates all current cases but has no default arm at all. A silently-dropped variant would return undefined and crash the caller at the kind: field assignment. Adding default: assertUnreachable(kind as never) here would turn that into a compile-time error instead of a runtime crash.


4. Inline comment style nit

A few comments in executeGetVersion (lines ~2632, ~2639) use parentheticals as labels ((old in-flight), (old branch)), which the CLAUDE.md flags as the fragmented structure to avoid. Rewording them as plain sentences would keep the code consistent with the rest of the engine.


Overall

The core algorithm is correct. The heuristic correctly handles the key edge cases: fresh instances, old in-flight instances, and per-iteration loop cutover. Findings 2-4 are pre-existing patterns that this PR is a natural opportunity to fix; finding 1 needs a CLAUDE.md update to keep the mirror-schema guidance accurate.

🤖 Generated with Claude Code

@abcxff abcxff force-pushed the stack/slop-claude-opus-4-8-high-feat-workflow-engine-add-getversion-primitive-for-workflow-versioning-wpnprqor branch from 4492a9d to ea8aaf0 Compare June 23, 2026 00:53
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5308 June 23, 2026 00:53 Destroyed
@abcxff abcxff force-pushed the stack/slop-claude-opus-4-8-high-feat-workflow-engine-add-getversion-primitive-for-workflow-versioning-wpnprqor branch from ea8aaf0 to 2635c05 Compare June 23, 2026 04:47
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.

1 participant