Skip to content

Delete the routine draft/review state machine (CL-7375) - #568

Merged
TheGreatAxios merged 3 commits into
cl-7366-e2e-prooffrom
cl-7375-delete-routine-drafts
Sep 2, 2026
Merged

Delete the routine draft/review state machine (CL-7375)#568
TheGreatAxios merged 3 commits into
cl-7366-e2e-prooffrom
cl-7375-delete-routine-drafts

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Resolves CL-7375

Hard cutover, no shims: deletes the free-text describe-to-agent routine drafting flow. Myra creates and retargets routines only through GET .../workflows/targetsroutine_create/routine_update (@corbits/routines-tools), the same tool-call surface a person's own request goes through — there was never a second, review-first path.

Deleted

  • packages/routines/src/drafts.ts, myra-drafting.ts, suggest-name.ts and their tests, plus packages/routines/test/routine-drafts.test.ts
  • routine_draft Drizzle schema (packages/routines/src/schema.ts)
  • /routine-drafts* routes (create/list/get/approve/discard) in packages/routines/src/routes.ts
  • Draft wire types/paths (RoutineDraft, DraftedStep, CreateDraftInput, routineDraftsPath family, suggestRoutineNameFromPrompt) in packages/routines/src/client.ts
  • Draft wiring in apps/hub/src/index.ts: routineDraftStore, listAutomatableWorkflowsForDraftInventory, routineDraftingCryptoProviders, the drafts/drafting deps passed to createRoutineRoutes
  • createRoutineDraft/listRoutineDrafts/approveRoutineDraft/discardRoutineDraft in apps/web/src/routines-api.ts (no UI surface ever called them)
  • validateTriggerFieldsInput in packages/workflow-catalog/src/index.ts — its only caller was the deleted myra-drafting.ts

Added

  • 0007_drop_routine_draft migration (packages/routines/src/migrations.ts) — drops the routine_draft table. Every earlier migration that mentions routine_draft (including CL-7350's 0006, which backfills routine_draft.approved_routine_id/definition_asset_id) is left untouched as the historical record.

Retained (verified still live)

  • resolve-myra-definition-id.ts (@corbits/agent-directory) — still used by agent-definition drafting (apps/hub/src/index.ts:3364 area)
  • listMyraConversationalAgents — shared with agent-definition drafting's inventory
  • @corbits/agent-directory's own drafting (agent-definition-drafting.ts, agent-definition-draft-routes.ts) — unrelated feature, not routine drafts

Docs

  • docs/workflow-model.md — new "Deleted in CL-7375" section
  • packages/routines/README.md — "Key modules" list updated, notes the routine_targetsroutine_create/routine_update creation path

Verification

  • bun run typecheck — clean
  • bun test packages/routines packages/routines-tools apps/web/test/routine* — 394 pass, 0 fail (routines/-tools run with DATABASE_URL for the DB-gated migration/store/targets suites, including the new 0007 drop and the updated 0006 backfill test)
  • bun run check:browser-safe-subpaths — clean
  • bun run scripts/checks/report-error.ts --write-baseline — diff removes exactly one stale line (the deleted drafting route in routes.ts)
  • bun run scripts/checks/no-product-tenancy.ts — updated the routines schema's expected table list, still passes

This PR sits at the top of the routines/workflow-model stack (based on cl-7366-e2e-proof) so it can be dropped independently if the draft flow needs to stay.

@TheGreatAxios
TheGreatAxios force-pushed the cl-7375-delete-routine-drafts branch from 6a01fe5 to 90348be Compare September 2, 2026 10:06
@TheGreatAxios
TheGreatAxios force-pushed the cl-7375-delete-routine-drafts branch from 90348be to 9d1642e Compare September 2, 2026 10:09
@TheGreatAxios
TheGreatAxios force-pushed the cl-7375-delete-routine-drafts branch from a675465 to 4174c10 Compare September 2, 2026 10:16
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 force-pushed the cl-7375-delete-routine-drafts branch from 4174c10 to ce7daea Compare September 2, 2026 11:07
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review September 2, 2026 11:18
@TheGreatAxios
TheGreatAxios merged commit d0f2942 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