Delete the routine draft/review state machine (CL-7375) - #568
Merged
Conversation
TheGreatAxios
force-pushed
the
cl-7375-delete-routine-drafts
branch
from
September 2, 2026 10:06
6a01fe5 to
90348be
Compare
TheGreatAxios
force-pushed
the
cl-7375-delete-routine-drafts
branch
from
September 2, 2026 10:09
90348be to
9d1642e
Compare
TheGreatAxios
force-pushed
the
cl-7375-delete-routine-drafts
branch
from
September 2, 2026 10:16
a675465 to
4174c10
Compare
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
force-pushed
the
cl-7375-delete-routine-drafts
branch
from
September 2, 2026 11:07
4174c10 to
ce7daea
Compare
TheGreatAxios
marked this pull request as ready for review
September 2, 2026 11:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/targets→routine_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.tsand their tests, pluspackages/routines/test/routine-drafts.test.tsroutine_draftDrizzle schema (packages/routines/src/schema.ts)/routine-drafts*routes (create/list/get/approve/discard) inpackages/routines/src/routes.tsRoutineDraft,DraftedStep,CreateDraftInput,routineDraftsPathfamily,suggestRoutineNameFromPrompt) inpackages/routines/src/client.tsapps/hub/src/index.ts:routineDraftStore,listAutomatableWorkflowsForDraftInventory,routineDraftingCryptoProviders, thedrafts/draftingdeps passed tocreateRoutineRoutescreateRoutineDraft/listRoutineDrafts/approveRoutineDraft/discardRoutineDraftinapps/web/src/routines-api.ts(no UI surface ever called them)validateTriggerFieldsInputinpackages/workflow-catalog/src/index.ts— its only caller was the deletedmyra-drafting.tsAdded
0007_drop_routine_draftmigration (packages/routines/src/migrations.ts) — drops theroutine_drafttable. Every earlier migration that mentionsroutine_draft(including CL-7350's0006, which backfillsroutine_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:3364area)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 draftsDocs
docs/workflow-model.md— new "Deleted in CL-7375" sectionpackages/routines/README.md— "Key modules" list updated, notes theroutine_targets→routine_create/routine_updatecreation pathVerification
bun run typecheck— cleanbun test packages/routines packages/routines-tools apps/web/test/routine*— 394 pass, 0 fail (routines/-tools run withDATABASE_URLfor the DB-gated migration/store/targets suites, including the new0007drop and the updated0006backfill test)bun run check:browser-safe-subpaths— cleanbun run scripts/checks/report-error.ts --write-baseline— diff removes exactly one stale line (the deleted drafting route inroutes.ts)bun run scripts/checks/no-product-tenancy.ts— updated the routines schema's expected table list, still passesThis 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.