Skip to content

Commit 10eceec

Browse files
committed
fix(seeding-cutover): restore catalog wiring stripped in the move (CL-7585)
1 parent 13cf565 commit 10eceec

14 files changed

Lines changed: 227 additions & 293 deletions

‎apps/hub/src/git-workflow-push.ts‎

Lines changed: 0 additions & 224 deletions
This file was deleted.

‎apps/hub/src/index.ts‎

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -279,27 +279,20 @@ import {
279279
type PresenceRoomKey,
280280
} from "@corbits/presence";
281281
import { supportedCredentialProviders } from "@corbits/connections/credential-test";
282-
import { createGitWorkflowPusher } from "./git-workflow-push";
283-
// The workflows the hub boot-converges natively, in push order (CL-7585):
284-
// the product's three scheduled automatables first (the order the old
285-
// seeding package's catalog used), then its two conversational agents.
286-
// No seeding package anymore — boot owns this list directly, and the
287-
// Routines picker admits a tenant's installed asset only when the same
288-
// installed-asset registry says so (see `installedAssetNames` on the
289-
// scheduled routes' catalog below).
290-
const HUB_BOOT_WORKFLOW_ASSET_NAMES = [
291-
"heartbeat",
292-
"morning-brief",
293-
"weekly-review",
294-
"concierge",
295-
"librarian",
296-
] as const;
282+
import { createGitWorkflowPusher } from "@corbits/connections/workflow-push";
297283
import { createHubAPI } from "@corbits/hub-api-client";
298284
import {
299285
createDrizzlePendingSeedStore,
300286
createBenchProvisioner,
301287
createOnboardingRoutes,
302288
} from "@workbench/onboarding";
289+
// The deployable-through-the-catalog-instantiate-route set, by asset
290+
// name (CL-7585): `@workbench/onboarding`'s `tenant-seed`
291+
// `CATALOG_WORKFLOWS`, strings only — the Routines picker admits a
292+
// tenant's installed asset only when the same installed-asset registry
293+
// says so (see `installedAssetNames` on the scheduled routes' catalog
294+
// below).
295+
import { CATALOG_WORKFLOW_ASSET_NAMES } from "@workbench/onboarding/tenant-seed";
303296
import {
304297
createConnectionRoutes,
305298
isInferenceProvider,
@@ -2067,7 +2060,7 @@ export async function createHub(config: HubConfig) {
20672060
grantStore: chatGrantStore,
20682061
conditionRegistry: chatConditionRegistry,
20692062
}),
2070-
catalogAssetNames: [...HUB_BOOT_WORKFLOW_ASSET_NAMES],
2063+
catalogAssetNames: [...CATALOG_WORKFLOW_ASSET_NAMES],
20712064
runNow: async (args) =>
20722065
runNowScheduledDefinition(
20732066
{ db, sidecarRouter, ...scheduledDeliveryJoinDeps },

‎apps/hub/src/templates/block-workflows.ts‎

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@
33
// (CL-6405) generalized to any catalog entry with a source package
44
// under `workflows/<name>` (CL-7073), not just `code-review`.
55
//
6-
// HONEST GAP (CL-7585): the only build step this module ever adapted —
7-
// the deleted seeding package's per-workflow `buildJson` closures (each
6+
// Runtime wiring (CL-7585): the per-workflow `buildJson` closures (each
87
// one closing over its workflow package's trigger address and turn
9-
// timeouts) — has no native home yet. Nothing in `apps/hub` may rebuild
10-
// it (the lane fence), and rebuilding it inside the instantiate path
11-
// would re-own seed behavior under a new name, so this builder answers
12-
// `undefined` for every asset name. The route (`./template-block-routes.ts`) turns that into
13-
// its existing 404 — no silent no-op, no fake deploy. The new home for
14-
// the per-workflow builders is a follow-up lane's call (sibling
15-
// template/instantiate owner); when it lands, it reimplements this
16-
// builder against the tenant's real, ordered inference preferences and
17-
// these 404s become deploys again — see the gap tests in
18-
// `./template-block-routes.test.ts`.
8+
// timeouts) live on `@workbench/onboarding`'s tenant-seed
9+
// `CATALOG_WORKFLOWS` entries, reached here through
10+
// `deployableCatalogWorkflow` — the hub names no builder of its own, so
11+
// the catalog's deployable set and the block sources served here can
12+
// never drift apart silently. `assistant` (seeded, never redeployed
13+
// here) and `heartbeat` (test-only, never deployed onto a real bench)
14+
// are outside `CATALOG_WORKFLOWS`, so they answer `undefined` here, same
15+
// as any name outside the catalog entirely — a route answering
16+
// `undefined` as a 404 is the honest statement of that.
1917
//
20-
// Server-only, on purpose: a future builder pulls in its workflow
21-
// package (e.g. `@corbits/granola-call-workflow`) and with it
22-
// `@intx/agent`/`@intx/workflow` — the heavy graph `./templates.ts`
23-
// keeps every manifest consumer off. Only `./template-block-routes.ts`
18+
// Server-only, on purpose: each `buildJson` closure pulls in its
19+
// workflow package (e.g. `@corbits/granola-call-workflow`) and with it
20+
// `@intx/agent`/`@intx/workflow`. Only `./template-block-routes.ts`
2421
// (mounted in `apps/hub`) imports this; it is deliberately not
2522
// re-exported from the package root.
23+
import { deployableCatalogWorkflow } from "@workbench/onboarding/tenant-seed";
2624

2725
export interface BlockWorkflowBuildInput {
2826
readonly tenantDomain: string;
@@ -40,16 +38,25 @@ export interface BlockWorkflowSource {
4038

4139
/**
4240
* The serialized source-form definition for one catalog workflow — or
43-
* `undefined`, for every asset name, until the per-workflow builders get
44-
* their new home (see above). `assistant` (seeded, never redeployed
45-
* here) and `heartbeat` (test-only, never deployed onto a real bench)
46-
* always answer `undefined`, same as any name outside the catalog
47-
* entirely. A route answering `undefined` as a 404 is the honest
48-
* statement of that gap.
41+
* `undefined` for `assistant`, `heartbeat`, and any name outside the
42+
* catalog. `buildJson` is a required field on every `CATALOG_WORKFLOWS`
43+
* entry, so a catalog name always answers here: the deployable set and
44+
* the served sources cannot drift apart silently.
4945
*/
5046
export function buildBlockWorkflowSource(
51-
_assetName: string,
52-
_input: BlockWorkflowBuildInput,
47+
assetName: string,
48+
input: BlockWorkflowBuildInput,
5349
): BlockWorkflowSource | undefined {
54-
return undefined;
50+
const workflow = deployableCatalogWorkflow(assetName);
51+
if (workflow === undefined) {
52+
return undefined;
53+
}
54+
return {
55+
assetName: workflow.assetName,
56+
displayName: workflow.displayName,
57+
workflowJson: workflow.buildJson(
58+
input.tenantDomain,
59+
input.inferencePreferences,
60+
),
61+
};
5562
}

0 commit comments

Comments
 (0)