Skip to content

Round-trip test: workflow-source renderer against the real validatePush - #524

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7272-workflow-source-roundtrip
Aug 31, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-7272-workflow-source-roundtrip

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

@corbits/workflow-source's renderWorkflowSourceTree is our hand-rolled writer for the one shape workflowKindHandler.validatePush (vendor/intx/hub-sessions/src/workflow-kind.ts) accepts for a workflow-kind asset. Upstream publishes the validator half only; nothing checked the pair stayed in sync except a push at deploy time.

This adds packages/workflow-source/src/validate-push.test.ts, which renders a tree with our renderer and runs it through the real workflowKindHandler imported from @intx/hub-sessions, plus checks on the adversarial shapes the validator rejects (envelope-only capability-declarations.json, committed node_modules, an ambiguous workflow.json beside package.json, a missing package.json).

No authoring path in this repo emits the workspaces monorepo shape today (every caller of renderWorkflowSourceTree passes a single packageName), so the test covers the single-package shape only, matching what we actually produce.

No writer or test helper for this tree exists anywhere in vendor/ today — workflowKindHandler.validatePush is the only related code upstream, and the closest thing to a fixture builder (workflow-deploy/src/testing/index.ts) synthesizes a WorkflowDefinition, not the codebase tree.

Test plan

  • HUB_DATA_DIR=$(mktemp -d) bun test packages/workflow-source — 11 pass, 0 fail
  • bun run typecheck (workflow-source package) — clean

…alidatePush

renderWorkflowSourceTree and workflowKindHandler.validatePush are a
parser/printer pair split across this repo and vendor/intx/hub-sessions,
with no test checking they stay in sync -- drift would otherwise surface
only as a push rejection in production. Exercise the rendered
single-package tree (the only shape any authoring path emits) against
the vendored validator directly, plus the adversarial shapes it rejects.
Note in the module header that validate-push.test.ts guards the
renderer/validator pair against silent drift.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7272-workflow-source-roundtrip branch from 9416845 to 127c5d3 Compare August 31, 2026 03:12
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review August 31, 2026 03:12
@TheGreatAxios
TheGreatAxios merged commit e4d9a27 into main Aug 31, 2026
7 checks passed
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