Repository navigation
feat(hub)!: workflow detail and schedule state derive from stock definitions; drop the routes (CL-8160) - #787
Merged
Conversation
…s (CL-8160) The Workbench-composed detail read and the scheduled-workflow routes (list/run-now/available-catalog) are being deleted next commit per an owner ruling that this data derives from stock @intx/hub-api reads or stays a package-internal pure function, never a hub route. Delete the tests that proved routes and UI behavior that no longer has any backing route to prove against, rather than adapting them to a shape they were never meant to cover. Deleted tests: - packages/workflows/src/detail/detail-route.drizzle.test.ts - packages/workflows/src/detail/definition-lifecycle.test.ts - packages/workflows/src/schedule/scheduled-route.test.ts - apps/web/test/routines-available-section.test.tsx (whole file — the Available section has no stock-derivable data source) - apps/web/test/routines-page.test.tsx's "RoutinesRoute — membership-based aggregation" suite (network-backed aggregation against the deleted /workflows/scheduled route) - apps/web/test/routine-detail-page.test.tsx's "an id renders the scheduled workflow itself" case - apps/web/src/shell/context-menu/items.test.tsx's run-now success-path case (the outcome it proved is no longer reachable)
…nitions; drop the routes (CL-8160)
Delete `@corbits/workflows`'s hub-mounted `createWorkflowDetailRoute`
(GET /api/tenants/:tenantId/workflows/definitions/:id/detail) and
`createScheduledWorkflowRoutes` (GET/POST under
/api/tenants/:tenantId/workflows: scheduled, scheduled/:id/run,
available) from apps/hub/src/index.ts, per the owner ruling that
workflow detail and schedule state ride on stock @intx/hub-api reads,
not a hub-composed route.
Upstream gap: stock's WorkflowDefinitionResponse
(vendor/intx/types/src/workflows.ts) exposes only id, tenantId, name,
description, currentVersion, status ('deployed' | 'stopped'),
createdAt, updatedAt — no manifest/package.json read, no wire
projection, no grant snapshot, and no asset display name. This means:
- The workflow detail page (apps/web/src/pages/workflow-detail-page.tsx)
now renders exactly what stock gives — name, description, status,
current version — and drops the former five-value lifecycle, source
commit, steps table, and declared/approved grants + credential
binding names, none of which stock exposes.
- `apps/web/src/workflow-detail-api.ts` has no GET-by-id to call at all
(stock only lists, lists versions, and rolls back) — it pages through
the stock list and stops at a matching id.
- Routines' scheduled roster, run-now, pause/resume, and the "Available"
catalog-workflow section have no stock-derivable replacement (no wire
projection to find a ScheduleTrigger's cron, no connection-satisfaction
read) — `apps/web/src/routines-api.ts`'s listScheduledWorkflows and
listAvailableCatalogWorkflows now resolve empty rather than fetch a
route that no longer exists, and runScheduledWorkflowNow always
rejects. The Routines page's existing empty states render as if no
bench had a schedule.
`packages/workflows`'s browser-safe `./client` entry keeps a thin
`WorkflowDefinitionDetail` shape and `workflowNotLaunchableReason`
narrowed to stock's two-value status. The pure schedule-state readers
(`listScheduledWorkflowDefinitions`, `listAvailableCatalogWorkflows`,
`listDeployedCronDefinitions`) stay as package-internal functions with
no hub route, per the ruling.
Upstream ask (also filed on CL-8160): expose a workflow definition's
package.json corbits.workflow block (title/description/icon/schedule)
through a stock read, and either a GET-by-id or enough on the list/
versions response to reconstruct a detail page without paging the
whole list.
…L-8160) Deleting createScheduledWorkflowRoutes' only mount (previous commit) left runNowScheduledDefinition with no caller anywhere in the repo, and rebasing onto main's own unrelated cutover (catalog-blocks deploy mount removal) surfaced two more now-unused imports (renderWorkflowSourceTree, WORKFLOW_SOURCE_ENTRY) and three unused arktype schemas/helpers in routines-api.ts that only existed to validate responses from routes that no longer exist.
6 tasks done
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.
Summary
@corbits/workflows's hub-mountedcreateWorkflowDetailRoute(
GET /api/tenants/:tenantId/workflows/definitions/:id/detail) andcreateScheduledWorkflowRoutes(/api/tenants/:tenantId/workflows:scheduled list, scheduled run-now, available-catalog) from
apps/hub/src/index.ts, per the owner ruling that workflow detailand schedule state ride on stock
@intx/hub-apireads or stay apackage-internal pure function — never a hub-composed route.
apps/web/src/workflow-detail-api.tsnow pages through stock'sGET /api/tenants/:tenantId/workflows/definitions(there is noGET-by-id at all in stock) and stops at the matching id.
apps/web/src/pages/workflow-detail-page.tsxrenders exactly whatstock exposes: name, description, status (
deployed/stopped),current version. The former five-value lifecycle, source commit,
steps table, and declared/approved grants + credential binding names
are gone — stock has no manifest read, no wire projection, and no
grant snapshot to derive them from.
apps/web/src/routines-api.ts'slistScheduledWorkflowsandlistAvailableCatalogWorkflowsnow resolve to an empty list ratherthan fetch a route that no longer exists (no stock-derivable
ScheduleTrigger/cron read, no stock connection-satisfaction read);
runScheduledWorkflowNowalways rejects. The Routines page'sexisting empty states render as if no bench had a schedule.
packages/workflows's browser-safe./clientkeeps a thinWorkflowDefinitionDetailshape andworkflowNotLaunchableReasonnarrowed to stock's two-value status. The pure schedule-state readers
(
listScheduledWorkflowDefinitions,listAvailableCatalogWorkflows,listDeployedCronDefinitions) stay as package-internal functionswith no hub route, per the ruling.
Upstream ask (also filed on CL-8160)
Stock's
WorkflowDefinitionResponse(
vendor/intx/types/src/workflows.ts) exposes onlyid,tenantId,name,description,currentVersion,status(
'deployed' | 'stopped'),createdAt,updatedAt— confirmed byreading
vendor/intx/hub-api/src/routes/workflow-definitions.tsdirectly (list/versions/rollback, no GET-by-id). There is no manifest
read (a package's
package.jsoncorbits.workflowblock), no wireprojection, no grant snapshot, and no asset display name anywhere in
stock. Asking for:
package.jsoncorbits.workflowblock(title/description/icon/schedule) exposed through a stock read.
GET /workflows/definitions/:id, or enough on thelist/versions response to reconstruct a detail page without paging
the whole list.
be computed client-side from stock deployment reads as the ruling
intends, and a stock connection-satisfaction read for the
"Available" catalog-workflow section.
Without these, Routines' scheduled roster, run-now, pause/resume, and
Available section have no stock-derivable replacement and stay empty
until an upstream ask lands.
Deleted tests
packages/workflows/src/detail/detail-route.drizzle.test.tspackages/workflows/src/detail/definition-lifecycle.test.tspackages/workflows/src/schedule/scheduled-route.test.tsapps/web/test/routines-available-section.test.tsx(whole file — theAvailable section has no stock-derivable data source)
apps/web/test/routines-page.test.tsx's "RoutinesRoute —membership-based aggregation" suite (network-backed aggregation
against the deleted
/workflows/scheduledroute)apps/web/test/routine-detail-page.test.tsx's "an id renders thescheduled workflow itself" case
apps/web/src/shell/context-menu/items.test.tsx's run-nowsuccess-path case (the outcome it proved is no longer reachable)
Test plan
bun run typecheckbun run check:structural(all checks pass, includingbrowser-safe-subpathson@corbits/workflows/client)bun --cwd packages/workflows test(148 pass, 10 DB-gated skip —no
DATABASE_URLlocally)bun --cwd apps/web test(791 pass)bun run lintfails on a pre-existing, unrelated formatting issuealready on
origin/main(AGENTS.md) — not touched by this PR