Skip to content

Prove aligned workflow and routine paths end to end (CL-7366) - #563

Merged
TheGreatAxios merged 6 commits into
cl-7373-fold-workflowsfrom
cl-7366-e2e-proof
Sep 2, 2026
Merged

Prove aligned workflow and routine paths end to end (CL-7366)#563
TheGreatAxios merged 6 commits into
cl-7373-fold-workflowsfrom
cl-7366-e2e-proof

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Linear: https://linear.app/abklabs/issue/CL-7366

What this proves

One new API-level e2e file, scripts/e2e/routine-alignment.test.ts, driving only public HTTP routes against a real hub+sidecar+Postgres (no seeded internal rows), plus one extension to scripts/e2e/browser/walkthrough.ts.

Covered

  1. Bench-level routine create with no invited agent, target discovered via GET .../workflows/targets, run-now fire appears in /routines/:id/runs.
  2. Retarget: PATCH /routines/:id swaps definitionAssetId only, other fields unchanged.
  3. Fail-closed retarget: a made-up asset id, and an asset id from a second tenant, both 404.
  4. Myra-shaped author -> deploy over the run-authenticated /api/workflow-workflow-authoring surface: POST /author (201, commitSha), POST /:assetId/deploy (201, asset now a routine target), redeploy with a wrong expectedWireHash (409 wire_hash_mismatch).
  5. The routine's own run principal (an agent) holds no approval:* grant, checked via GET /api/tenants/:t/grants.
  6. GET /workflows/definitions/:assetId/detail reports deployed for the live asset, 404 for a bogus id.

Adjusted from the original scenario list

  • POST /:assetId/deploy/preview (step 2 in scenario 4) is asserted against what the codebase actually does today: CL-7362 ("native probe with empty ApprovalSet, no freeze") is listed as not-yet-wired in docs/workflow-source-authoring.md's "Seams that do not exist yet" — the route answers a documented unavailable envelope. The test asserts that exact fail-closed shape rather than faking a wireHash/grants preview, then proceeds to deploy directly (no preview-derived expectedWireHash).

Walkthrough

Step 11 (11-routine-target-picker-blocks-until-picked): opens /routines, opens "New routine", asserts the target picker offers >= 1 option, confirms a blur with no target picked does not autosave, picks a target, confirms it then autosaves ("Saved"), and confirms the routine appears back on /routines.

Verification

  • bunx tsc --noEmit -p tsconfig.json and bunx eslint clean on both changed files.
  • docker compose -f docker-compose.test.yml up -d + DATABASE_URL=postgres://postgres:postgres@localhost:5432/workbench HUB_DATA_DIR=$(mktemp -d) bun test scripts/e2e/routine-alignment.test.ts — 1 pass.
  • The browser walkthrough extension was not run locally in this session (needs a system Chrome + a longer real-browser run); CI's e2e job is authoritative for it per AGENTS.md.

Test plan

  • routine-alignment.test.ts passes locally against Postgres (see above)
  • CI e2e job (including the walkthrough) green

Resolves CL-7366

@TheGreatAxios
TheGreatAxios changed the base branch from cl-7364-cleanup to cl-7373-fold-workflows September 2, 2026 07:46
@TheGreatAxios
TheGreatAxios force-pushed the cl-7366-e2e-proof branch 4 times, most recently from f450a58 to 264174d Compare September 2, 2026 10:15
A create or PATCH-carried retarget now must clear the same two gates
before it is persisted: resolveLaunchableDefinition must resolve the
asset, and the acting principal must be authorized for
workflow-definition:<id>/read — the same verb listRoutineTargets
already checks per row. A denial is a typed 403 alongside the
existing 400/404/409 target envelopes, on both the tenant-session and
Myra's workflow-run-authenticated routine surfaces.

Also routes a pre-existing catch in postRoutineEnabledNotice through
reportError, since this change's diff now touches that line and
check:report-error requires it.
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review September 2, 2026 11:09
@TheGreatAxios
TheGreatAxios merged commit 8418b32 into main Sep 2, 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