Repository navigation
feat(hub)!: apps/hub converges to index + config (CL-8185) - #791
Merged
Merged
Conversation
Owner ruling (CL-8185, less-is-more): apps/hub/src is deleted down to index.ts + config.ts except mailbox-persist.ts (chat-domain, other consumers survive CL-8175) and the two files another concurrent sweep owns (native-workflow-routine-launch.ts, inbox-unsnooze-sweep.ts). Deleted outright (dead or fully redundant): - mcp-credential-bindings.ts: no importer anywhere. - pinned-package-credential-bindings.ts (+test): never wired into index.ts; chat has its own separate copy. - grant-conditions.ts: identical to mountHubRoutes' own stock default when no conditionRegistry is supplied; index.ts now builds the same literal locally instead of importing it. Deleted, no inline replacement (feature regression, see Upstream asks below): - hub-error-handler.ts: app.onError is gone; an escaping route exception now falls through to Hono's bare 500. - in-flight-requests.ts / shutdown.ts: shutdown is now an immediate server.stop(true) + hub.close() + exit, no drain window, no reported cause on a hang. - sign-in-rate-limit.ts: sign-in reverts to better-auth's own IP-keyed rate limit (its private-network bypass is the reason this ever existed). - launch-caches.ts: the launch path's SHA-keyed read cache is gone; every launch re-reads tool-package tarballs and rebuilds deploy packs uncached (perf only, not correctness). - tool-grants.ts: pinned-package tool grants are stubbed to none; a pinned tool package's calls fail closed again. - turn-part-content-default.ts: a turn_part insert that omits `content` now relies on the column's own DB default. - turn-text-snapshot.ts: chat's turnTextSnapshot port is unwired (optional); a client reattaching mid-turn no longer gets a part-cursor catch-up. - mail-redelivery.ts: an undelivered outbound mail is no longer retried after waking the recipient. - credential-material-refresh.ts: outbound mail no longer refreshes a tenant's due oauth_token credentials first. - grant-allowance.ts: the parked-call auto-approve gate is gone; every signal correlation takes the plain parked path. - workflow-run-tenant-auth.ts: `withWorkflowRunTenantAuth`'s tenant-subtree bearer widening is gone. `createWorkflowRunAuthenticator` itself is kept (inlined into index.ts) since it's the one concrete WorkflowRunAuthenticator every workflow-run-authenticated surface in this app takes structurally, including stock hub-api's own workflowRunAuthenticator deploy-mount option. Kept, folded into config.ts (hub boot would otherwise corrupt this very work tree, per AGENTS.md's documented HUB_DATA_DIR hazard): - hub-data-dir-git-safety.ts's assertHubDataDirGitSafety, called from createHub() at boot (not from readHubConfig, which stays a pure parse so tests parsing a config never trip real filesystem/git IO). scripts/evals-run.ts's own AssetService construction (previously routed through apps/hub/src/asset-service-factory.ts) moves to packages/evals as createEvalAssetService, since @intx/hub-sessions is not a resolvable dependency from root-level scripts. Upstream asks: - No app-level onError hook in @intx/hub-api's createApp/mountHubRoutes. - No bounded-drain shutdown helper (in-flight tracking + timeout + reported cause) in @intx/hub-api or @intx/hub-sessions. - better-auth's sign-in rate limit has no account-keyed extension point (customRules only overrides window/max per path, never the key), so it stays IP-keyed and forgeable on a private network. - No SHA-keyed read cache for the launch path in @intx/hub-sessions (perf only). - No stock capability walk from a launch's pinned tool packages to tool: grants (only inline tool factories get one). - turn_part.content has no guaranteed DB-level default on every deployment. - No stock mail-redelivery-after-wake retry for sidecar-router undelivered mail. - No stock serving-time oauth_token refresh ahead of outbound mail. - No stock auto-approve gate for a parked signal correlation whose resource a standing grant already covers. - Stock hub-api only bearer-authenticates the single /workflows/deployments mount; nothing lets a workflow-run agent reach any other tenant route without a session. Deleted tests (hard cutover, behavior removed with the code): - apps/hub/src/*.test.ts for every file deleted above that had one (asset-service-factory, credential-material-refresh, hub-data-dir-git-safety, hub-error-handler, in-flight-requests, launch-caches, pinned-package-credential-bindings, shutdown, sign-in-rate-limit, tool-grants, turn-part-content-default, turn-text-snapshot). - apps/hub/src/hub-zero-t4-registry.test.ts: asserted pinned-package-credential-bindings.ts stayed free of a legacy import; the file is gone. - apps/hub/test/mail-redelivery.test.ts, shutdown-drain.test.ts: test modules that no longer exist. - apps/hub/test/git-fixture.ts: shared fixture whose only two consumers (asset-service-factory.test.ts, hub-data-dir-git-safety.test.ts) are both gone. - apps/hub/test/composition.test.ts's "sign-in rate limiting is keyed on the target account" describe block: asserted the deleted account-keyed limiter's behavior end to end. - apps/hub/test/config.test.ts's two signInRateLimit-specific assertions/test. report-error-baseline.txt regenerated (4 stale entries for deleted files removed; 0 new findings). Remaining in apps/hub/src beyond index.ts/config.ts: mailbox-persist.ts (chat-domain, consumed by chat-ui and agent-directory too — leaving for CL-8175), native-connector-registry.ts, native-workflow-routine-launch.ts, inbox-unsnooze-sweep.ts, notify-delivery.ts, and their tests — none of these were in this sweep's file list, and the latter two are owned by a concurrent agent. server.ts was not split out: hub boot still lives in index.ts's own `if (import.meta.main)` block.
TheGreatAxios
added a commit
that referenced
this pull request
Sep 17, 2026
… APIs Rebases the 79adc433 re-vendor onto main (#790 oxfmt reformat, #791 hub composition-root reduction) and fixes what the bump broke: routeMail's new required authenticatedSender param, deployReadyAllocation's new reconciliation-context param, and the retirement of SessionService.sendUserMessage (every caller now delivers a signed MIME message through SidecarRouter.routeMail, matching native-workflow-routine-launch.ts's existing pattern) and of workflow_definition.origin / workflow_definition_version.wire_projection (the routine/catalog code that read a launch body off the frozen projection is deleted outright — schedule/{available-catalog, deployed-cron-deployments,list-scheduled}.ts, launchable/target.ts, the hub cron-emitter wiring, and their tests — since Interchange no longer stores that projection at all). packages/workflows/definition-projection.ts keeps only its pure, DB-free half (the named errors and the schema-validated FoldedBody reader) for chat, which still needs the type surface ahead of its own CL-8175 retirement; its two DB-touching resolvers now fail loud with a named error instead of guessing at retired data. Re-applies workflow-host's CL-6448 single-step grants collapse, which the bump otherwise silently dropped. Updates VENDORED.md and kill-dates.txt for the 79adc433 pin, drops the delta rows upstream has since absorbed (the per-principal signing-key series, beforeToolExtension, the message_response signal kind, the childRunId forward), and bumps @corbits/interaction-tools past a test-only change the freshness check caught.
TheGreatAxios
added a commit
that referenced
this pull request
Sep 17, 2026
* Re-vendor @intX agent, harness, mail-memory, mailbox, mime, workflow-deploy, hub-common at 79adc433 * Re-vendor remaining @intX packages at 79adc433 db, types, hub-api, hub-sessions, hub-agent, inference, workflow, workflow-host copied wholesale from Interchange 79adc433, stripping upstream test files. * fix(vendor): rebase re-pin onto main and cut over removed Interchange APIs Rebases the 79adc433 re-vendor onto main (#790 oxfmt reformat, #791 hub composition-root reduction) and fixes what the bump broke: routeMail's new required authenticatedSender param, deployReadyAllocation's new reconciliation-context param, and the retirement of SessionService.sendUserMessage (every caller now delivers a signed MIME message through SidecarRouter.routeMail, matching native-workflow-routine-launch.ts's existing pattern) and of workflow_definition.origin / workflow_definition_version.wire_projection (the routine/catalog code that read a launch body off the frozen projection is deleted outright — schedule/{available-catalog, deployed-cron-deployments,list-scheduled}.ts, launchable/target.ts, the hub cron-emitter wiring, and their tests — since Interchange no longer stores that projection at all). packages/workflows/definition-projection.ts keeps only its pure, DB-free half (the named errors and the schema-validated FoldedBody reader) for chat, which still needs the type surface ahead of its own CL-8175 retirement; its two DB-touching resolvers now fail loud with a named error instead of guessing at retired data. Re-applies workflow-host's CL-6448 single-step grants collapse, which the bump otherwise silently dropped. Updates VENDORED.md and kill-dates.txt for the 79adc433 pin, drops the delta rows upstream has since absorbed (the per-principal signing-key series, beforeToolExtension, the message_response signal kind, the childRunId forward), and bumps @corbits/interaction-tools past a test-only change the freshness check caught.
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
Owner ruling (less-is-more): apps/hub/src is deleted down to
index.ts+config.ts, exceptmailbox-persist.ts(chat-domain, consumed outsidepackages/chattoo — left for CL-8175) and the two files owned by aconcurrent sweep (
native-workflow-routine-launch.ts,inbox-unsnooze-sweep.ts— already merged out from under this branch bythe time it rebased).
Deleted outright (dead or redundant with stock):
mcp-credential-bindings.ts— no importer anywhere.pinned-package-credential-bindings.ts(+test) — never wired intoindex.ts; chat has its own separate copy.grant-conditions.ts— identical tomountHubRoutes's own stockdefault when no
conditionRegistryis supplied;index.tsnow buildsthe same literal locally instead of importing it.
Deleted, capability regression (see Upstream asks):
hub-error-handler.ts,in-flight-requests.ts+shutdown.ts(shutdownis now an immediate
server.stop(true)+hub.close()+ exit, no drainwindow),
sign-in-rate-limit.ts(sign-in reverts to better-auth's ownIP-keyed limit),
launch-caches.ts(perf only),tool-grants.ts(pinned-package tool grants stubbed to none),
turn-part-content-default.ts,turn-text-snapshot.ts(optional chat port, unwired),mail-redelivery.ts,credential-material-refresh.ts,grant-allowance.ts,workflow-run-tenant-auth.ts(withWorkflowRunTenantAuth's tenant-subtreebearer widening is gone;
createWorkflowRunAuthenticatoritself is kept,inlined into
index.ts, since stock hub-api's ownworkflowRunAuthenticatordeploy-mount option and several Corbits packages take this shape directly).
Kept, folded into
config.ts:hub-data-dir-git-safety.ts'sassertHubDataDirGitSafety— hub boot would otherwise corrupt this verywork tree (AGENTS.md's documented
HUB_DATA_DIRhazard). Called fromcreateHub()at boot, not fromreadHubConfig, so tests parsing a confignever trip real filesystem/git IO.
scripts/evals-run.ts's ownAssetServiceconstruction (previouslyrouted through
apps/hub/src/asset-service-factory.ts) moves topackages/evalsascreateEvalAssetService, since@intx/hub-sessionsisn't a resolvable dependency from root-level scripts.
Upstream asks
onErrorhook in@intx/hub-api'screateApp/mountHubRoutes.cause) in
@intx/hub-apior@intx/hub-sessions.(
customRulesonly overrides window/max per path, never the key), so itstays IP-keyed and forgeable on a private network.
@intx/hub-sessions(perf only).tool:grants (only inline tool factories get one).
turn_part.contenthas no guaranteed DB-level default on every deployment.oauth_tokenrefresh ahead of outbound mail.a standing grant already covers.
/workflows/deploymentsmount; nothing lets a workflow-run agent reach any other tenant route
without a session.
Deleted tests (hard cutover, behavior removed with the code)
apps/hub/src/*.test.tsfor every deleted file that had one:asset-service-factory,credential-material-refresh,hub-data-dir-git-safety,hub-error-handler,in-flight-requests,launch-caches,pinned-package-credential-bindings,shutdown,sign-in-rate-limit,tool-grants,turn-part-content-default,turn-text-snapshot.apps/hub/src/hub-zero-t4-registry.test.ts— assertedpinned-package-credential-bindings.tsstayed free of a legacy import;the file is gone.
apps/hub/test/mail-redelivery.test.ts,shutdown-drain.test.ts— testmodules that no longer exist.
apps/hub/test/git-fixture.ts— shared fixture whose only two consumersare both gone.
apps/hub/test/composition.test.ts's "sign-in rate limiting is keyed onthe target account" describe block — asserted the deleted account-keyed
limiter's behavior end to end.
apps/hub/test/config.test.ts's twosignInRateLimit-specificassertions.
report-error-baseline.txtregenerated (stale entries for deleted filesremoved; 0 new findings).
Remaining in apps/hub/src beyond index.ts/config.ts
mailbox-persist.ts(chat-domain, also consumed bychat-uiandagent-directory— left for CL-8175),native-connector-registry.ts,native-workflow-routine-launch.ts,inbox-unsnooze-sweep.ts(owned by aconcurrent sweep — appears already removed on
mainas of this rebase),notify-delivery.ts, and their tests — none of these were in thissweep's target file list.
server.tswas not split out: hub boot stilllives in
index.ts's ownif (import.meta.main)block.Test plan
bun run typecheckbun run fmt:check/bun run lintbun run check:structural(report-error baseline regenerated)bun --cwd apps/hub test— non-DB-gated suites pass (66 pass, 0 fail)composition,boot-does-not-seed,chat-mount,mailbox-persist,relaunch-sweep-close,notify-delivery) could not be verified locally: the shared localPostgres is saturated by other concurrently-running agents
("sorry, too many clients already"). CI provisions its own Postgres
and should be unaffected — flagging for the reviewer to confirm CI
is green on this PR.