Skip to content

feat(hub): contain cross-tenant dispatch at Workbench seams - #723

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7324-dispatch-containment
Sep 15, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-7324-dispatch-containment

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Implements CL-7324 Option A (bench-owner, hub-provisioned, tenant-bound dispatch only; Workbench-side containment; vendor/intx untouched).

Guards the two Workbench-owned dispatch seams so a foreign-tenant allocation can never dispatch against an anchor run of another tenant:

  • Service seam: tenant-bound wrapper around the native workflow-allocation service — foreign allocation throws retryable tenant_mismatch (never terminal, never falls through to another tenant) with reportError context.
  • Route seam: outer Hono wrap (same composition as the tenant-create guard) answers 403 allocation_tenant_mismatch on the mail/signals dispatch routes before enqueue/grant materialization.
  • Comment-only: documents the closed dispatchable-backend set in config (no schema change).

Zero edits under vendor/intx.

Verification

  • New apps/hub/src/dispatch-tenant-guard.test.ts: 10 pass (tenant-mismatch retry, 403 on foreign allocation, no fall-through, fail-closed on missing anchor)
  • Affected unit suites bun test apps/hub/src: 114 pass / 0 fail across 23 files
  • tsc --noEmit in apps/hub: clean; eslint on touched files: clean
  • Pre-push hook trips twice on unrelated flaky suites (mailbox-persist, setup-memory tsconfig timeout) — both pass in isolation; pushed --no-verify per lane allowance

Fixes CL-7324

@linear-code

linear-code Bot commented Sep 15, 2026

Copy link
Copy Markdown

CL-7324

@TheGreatAxios
TheGreatAxios force-pushed the cl-7324-dispatch-containment branch 6 times, most recently from 8647767 to 4ea4503 Compare September 15, 2026 21:12
Guard the two Workbench-owned dispatch seams so a foreign-tenant
allocation can never dispatch against an anchor run of another tenant:
service-level tenant_mismatch (retryable, never terminal) wraps
deployReadyAllocation, and the mail/signals dispatch routes answer 403
allocation_tenant_mismatch before enqueue/grant materialization.
Documents the closed dispatchable-backend set in config.

Fixes CL-7324
@TheGreatAxios
TheGreatAxios force-pushed the cl-7324-dispatch-containment branch from 4ea4503 to 552e759 Compare September 15, 2026 21:46
@TheGreatAxios
TheGreatAxios merged commit 75bb780 into main Sep 15, 2026
24 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-7324-dispatch-containment branch September 15, 2026 22:11
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