Skip to content

feat(hub)!: workflow detail and schedule state derive from stock definitions; drop the routes (CL-8160) - #787

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-8160-workflow-detail-stock
Sep 17, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-8160-workflow-detail-stock

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Deletes @corbits/workflows's hub-mounted createWorkflowDetailRoute
    (GET /api/tenants/:tenantId/workflows/definitions/:id/detail) and
    createScheduledWorkflowRoutes (/api/tenants/:tenantId/workflows:
    scheduled list, scheduled run-now, available-catalog) from
    apps/hub/src/index.ts, per the owner ruling that workflow detail
    and schedule state ride on stock @intx/hub-api reads or stay a
    package-internal pure function — never a hub-composed route.
  • apps/web/src/workflow-detail-api.ts now pages through stock's
    GET /api/tenants/:tenantId/workflows/definitions (there is no
    GET-by-id at all in stock) and stops at the matching id.
  • apps/web/src/pages/workflow-detail-page.tsx renders exactly what
    stock 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's listScheduledWorkflows and
    listAvailableCatalogWorkflows now resolve to an empty list rather
    than fetch a route that no longer exists (no stock-derivable
    ScheduleTrigger/cron read, no stock connection-satisfaction read);
    runScheduledWorkflowNow always rejects. The Routines page's
    existing empty states render as if no bench had a schedule.
  • packages/workflows's browser-safe ./client 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)

Stock's WorkflowDefinitionResponse
(vendor/intx/types/src/workflows.ts) exposes only id, tenantId,
name, description, currentVersion, status
('deployed' | 'stopped'), createdAt, updatedAt — confirmed by
reading vendor/intx/hub-api/src/routes/workflow-definitions.ts
directly (list/versions/rollback, no GET-by-id). There is no manifest
read (a package's package.json corbits.workflow block), no wire
projection, no grant snapshot, and no asset display name anywhere in
stock. Asking for:

  1. A workflow definition's package.json corbits.workflow block
    (title/description/icon/schedule) exposed through a stock read.
  2. Either a GET /workflows/definitions/:id, or enough on the
    list/versions response to reconstruct a detail page without paging
    the whole list.
  3. A stock-readable ScheduleTrigger/cron surface, so schedule state can
    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.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)

Test plan

  • bun run typecheck
  • bun run check:structural (all checks pass, including
    browser-safe-subpaths on @corbits/workflows/client)
  • bun --cwd packages/workflows test (148 pass, 10 DB-gated skip —
    no DATABASE_URL locally)
  • bun --cwd apps/web test (791 pass)
  • bun run lint fails on a pre-existing, unrelated formatting issue
    already on origin/main (AGENTS.md) — not touched by this PR

…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.
@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

CL-8160

@TheGreatAxios
TheGreatAxios merged commit 50c56ba into main Sep 17, 2026
5 of 22 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