Space connections
Target design for provisioning Executor apps and supplying connections to Finance spaces.
Product direction and implementation status
Creating a client-bound Finance space should automatically provision an Executor app from a reusable Finance template. Workbench owns onboarding, connection management and the space agent’s configuration. People supply connections through Workbench; they should not manually create Executor apps or configure agent credentials.
This direction was confirmed on November 20, 2026 and is tracked in WB-84. The lifecycle and resource design below distinguishes the target from the implemented first slice. Client-bound Finance creation now atomically records setup intent; the opt-in Finance setup consumer creates and deploys a native app and retains its binding. A disabled-by-default restricted consent API now persists manager-issued, recipient-bound intents and uses native account setup, identity verification and linking. QuickBooks callback routing, the reviewed shared Ledger app and per-space grants are implemented. The production bootstrap now supplies production resources and activation during the release workflow. The isolated Linear pilot below supplies browser OAuth and automatic scoped native agent grants. Host admission and OIDC supply identity foundations, not space connection authorization.
WB-56 records successful app creation and deployment on a disposable Executor beta.59 instance. Earlier personal-agent previews exercised provider handoff and Linear tool calls. Those results do not establish shared Finance provisioning, live QuickBooks consent or production readiness.
Ownership and topology
| Concept | Target ownership and purpose |
|---|---|
| Workbench space | The owning firm retains the space; its business binding identifies the client whose work it contains. |
| Executor apps | A per-space connection adapter retains provider assignments; a centrally maintained Finance app can be shared through separate per-space scoped grants. |
| Account requirement | A named connection purpose on that app, such as accounting books or an invoice mailbox. |
| Connected account | A provider credential held by Executor, with the consenting person recorded separately from its authorized Workbench usage. |
| Connection assignment | Workbench’s explicit mapping from the space and requirement to the exact Executor account and external company or mailbox. |
| Agent access | Only the app, accounts and operations authorized for that space and invocation. |
Several providers and multiple accounts of one provider can belong to the same space app. Adding an account does not create another app. Several authorized agents can use the same space app; creating an agent does not inherently create another app.
For the current firm, multiple space apps can share an Executor organization and the existing self-hosted service. App creation is a service operation, not a new Railway or Cloudflare infrastructure deployment per space. The mapping from future Workbench firms to Executor organizations remains an engineering decision; do not infer one organization per client or hardcode the pilot organization as the general tenant model.
Use app-scoped requirements for connections intentionally supplied to shared Finance work. A request from a teammate must not substitute that teammate’s personal account. Multiple mailboxes need explicit roles or validated account selection within the app’s linked set. Account labels, the caller’s name and model inference are not authorization or account resolution.
Provisioning lifecycle
- Authorize creation and persist the firm-owned, client-bound Finance space. Record setup intent durably so a crash after creation cannot lose the request; also support initialization of existing eligible spaces.
- Have a background consumer claim the setup operation and recheck current setup authority and its business/relationship snapshot using the existing Finance boundary.
- Create the Executor app from a pinned template and persist its identity. Configure the explicit app audience and scoped agent access, then activate the reviewed version. Persist a receipt for each external step.
- Reconcile timeouts and unknown outcomes before replay. Do not assume Executor app creation is idempotent or use a display name as unique identity. The implementation must establish a recoverable operation-to-app association before enabling automatic retries.
- Expose actual progress and missing requirements through Workbench. An activated app with no QuickBooks account is provisioned but still needs a connection.
- Reuse the same binding on later requests. Template upgrades preserve app identity and require compatibility checks for existing requirements and account links.
Extend the existing setup lifecycle rather than creating a second onboarding job hierarchy. Keep HTTP contracts and handlers in the existing server service, with business operations in focused domain modules and external Executor calls behind an Effect service. Use the repository’s contract, handler and Worker composition boundaries. Choose the durable consumer with the runtime owner; this design does not select or install another workflow engine.
Connection lifecycle
An authorized manager or agent requests a named connection through Workbench. Workbench resolves the app and requirement from the saved space binding and checks the particular action. The agent can request consent; it cannot provide consent on a person’s behalf.
Create a pending connection intent binding the authenticated consenting person, owning firm, client business, space, app, requirement, requested operations, expiry and allowed return destination. Verify the same scope and current authority at the provider callback. Cancellation, expiration or revoked authority prevents completion. Treat callback replay idempotently.
Executor holds provider secrets and performs the provider-specific credential lifecycle. Workbench stores references and verified source identity, not credential copies in conversations, Computer files or model context. On completion, verify the exact provider company/environment or mailbox before making the assignment usable. A successful callback or a previously linked slot alone does not establish the expected business connection.
Reconnect must preserve the approved source identity. A different company, mailbox or account replacement requires an explicit reassignment decision; it cannot silently inherit the old usage grant. Disconnect must distinguish removing this space’s assignment from deleting a reusable credential or revoking it at the provider. Never disrupt another app merely because the same account was intentionally linked there.
Keep these outcomes separate: app provisioned, provider authorized, account assigned, data refresh successful, required evidence complete and Finance ready. WB-15 owns readiness; WB-23 and WB-27 own QuickBooks source coverage and read-only ingestion.
Implemented restricted consent boundary
The server’s Finance connections contract exposes authorization, status, start, completion and disconnect operations. Anyone with current access to a Finance space can view its connections and supply their own account through browser OAuth. Their consent is explicitly for the shared space app. This does not give them firm administration, native app editing, permission to authorize another person’s account or permission to disconnect assignments. Those management operations still require a provider administrator or lead.
A current provider administrator or lead can also name an existing person in the firm or bound client business, the exact external source ID and sandbox/production environment. This authorizes only that recipient to supply that connection; it grants no space read, app editing or tool execution. Consent expires after 15 minutes. Each requirement admits one open intent or active assignment; multiple active accounts in the same requirement are not implemented by this slice.
Start rechecks the issuer’s current authority, both users’ active state, the recipient’s membership and the immutable business relationship. Self-consent requires the supplier’s current space access; delegated consent requires the issuer’s current Finance setup authority. Losing that authority stops completion and subsequent agent reads using the assignment. It claims the intent in SQL before creating and deploying one private intake app for that intent. Native OAuth state is stored only as a hash. The browser receives the provider authorization URL; native pending IDs, accounts, management tokens and provider client secrets stay on the server. A second start never creates another app.
Completion requires the same authenticated recipient and active organization. It validates the fixed native callback origin/path, unique state/code/company parameters, expected company and state hash before native exchange. The reviewed intake template must expose a read-only connectionIdentity tool accepting {accountId, companyId} and returning {accountId, companyId, environment} after reading and verifying the provider’s actual identity. Echoing the input or trusting the callback alone does not satisfy that template contract. A mismatch stays on the private intake app. Native Finance slots are checked before start and assignment; an existing link is never intentionally replaced by this initial-connect flow.
Each external mutation has a persisted claim and available receipts. Repeated completed requests do not re-exchange the provider code. Unknown create, exchange, link or unlink results become reconcile_required; they cannot be retried automatically or superseded by another intent. A crash can leave an in-progress claim requiring operator reconciliation. There is no recovery UI or automatic cleanup yet. A manager can cancel an uncompleted intent, or unlink an active assignment. A current manager can disconnect even after the original issuer loses their role. In-flight mutations return a conflict to competing management requests. Disconnect preserves the native credential and private intake app; provider-wide revocation is a separate operation.
Native beta.59 stress tests used two Finance apps and a synthetic provider. A real scoped MCP OAuth token read only app A even when its authorizing person could use A and B. Calling the general MCP URL did not widen it. Account unlink stopped existing-token reads without disrupting B; relinking the same account restored reads. Group removal stopped access, refresh retained the grant scope, and connection revocation stopped both existing-token execution and refresh. Workbench HTTP integration tests independently cover durable claims, recipient/manager separation, callback tampering, wrong-company results, removed authority, expiry, cancellation and unknown outcomes.
The QuickBooks OAuth APIs remain disabled until the consent configuration, matching reviewed provider definitions and browser return routing are ready. The unactivated QuickBooks path still expects the native Executor callback at /api/oauth/callback; its Workbench browser relay is not implemented. The separate Linear pilot uses its dedicated host’s configured callback URL. Do not divert unrelated personal Executor callbacks. The authenticated completion POST is the backend boundary for that integration, not a browser onboarding UI. Live QuickBooks consent and provider-token refresh, reconnect, multiple accounts per requirement and end-to-end agent invocation remain unverified or unimplemented. The native token test’s refresh is an agent OAuth refresh, not a QuickBooks token refresh.
Authorization and the host extension
Workbench remains authoritative for business, space and action grants. Check current authority on management requests, model context retrieval, tool dispatch, scheduled work and publication. A separate agent or app supplies isolation structure; the server must still validate the saved scope. A shared conversation recipient is not automatically a provider tool caller. Private Wes retains its own authorized context.
Keep provisioning credentials separate from the space agent’s execution capability. A backend management token must not become an unrestricted agent tool. Use a space-scoped Executor capability and validated account assignment for calls. If people need direct Executor access, synchronize their explicit audience/group membership and revocation; Workbench-only participation does not itself require direct Executor access.
The pinned shared-consent limitation and tested alternative live in restricted shared provider consent. The restricted connection broker uses a dedicated backend service identity for native account setup and linking. A client authorizes the external provider through a Workbench intent, without receiving that service credential or native app-management rights. A private intake app keeps an unverified account out of the Finance app. Native beta.59 API support for this flow passed a disposable synthetic-provider test; durable Workbench authorization is implemented and tested locally, while browser callback routing remains to be implemented.
Clients must not become Executor organization administrators. Keep native permission checks intact and enforce a particular subject, space/app and requirement in Workbench. Record the actual consenting person separately because a backend-created native account belongs to the service identity. Scoped agent credential issuance is a separate boundary: the supported initial browser authorization remains necessary unless a dedicated issuer is implemented.
Delivery sequence and acceptance
| Existing issue | Next implementation boundary |
|---|---|
| WB-56 | Persist the app/requirement/account references, add the Executor adapter and consume setup intent to provision one recoverable app per space. |
| WB-24 | Implement scoped management and consent, including the host capability and reconnect/disconnect semantics. |
| WB-27 | Supply the real QuickBooks provider operations and verify company selection, token refresh, pagination and recovery; start read-only. |
| WB-15 / WB-22 | Feed verified connection and source state into Finance readiness and the existing Finance Core invocation. |
The existing personal-agent previews are implementation references for provider handoff, connection intents and scoped Executor calls. Their user-owned connection state is not the shared-space data model. Preserve native approvals and recovery behavior while adapting it to the immutable space and initiating actor. The old direct-adapter/defer-Executor recommendation is superseded by Executor’s selection in WB-24; WB-62 is canceled and is not an implementation mandate.
The first hosted proof is two client Finance spaces and one operator assigned to both. Creating each space produces exactly one recoverable app binding. A client supplies the intended QuickBooks company through Workbench; the correct space agent reads it, while the other space cannot. Exercise a lost provisioning response, revoked consent before callback, callback replay, a wrong-company reconnect, and disconnect followed by a tool call. Verify that account metadata and private context do not leak to other audiences.
Use authorized test environments. A successful Linear preview or local fixture is not a live QuickBooks result. Automatic cleanup, credential deletion, provider write-back and additional infrastructure deployments require their own lifecycle decisions; none are introduced by this design.
Clickable Linear preview
Creating a client-bound Finance space commits its Team conversation, agent identity and setup intent together. After commit, Workbench dispatches setup in the background. A scheduled pass recovers pending work within the configured firm, or across firms when the operator explicitly sets EXECUTOR_PROVISIONING_ORGANIZATION_ID=*. Each candidate still requires its own active creator, firm, client relationship and space authority. Setup currently covers client-bound Finance spaces; internal Finance spaces remain outside this path. There is no initial Set up connections button: the existing Client Settings → Connections page shows Setting up until both the native app and its scoped agent grant are ready, then offers Add connection. A failed setup preserves the space. Unknown external outcomes show Needs attention and are never blindly replayed.
The control plane creates a private native app, signs its service identity into Executor, creates a read-only scoped connection naming that one app, and completes the service’s native MCP OAuth grant in browser-approval mode. This service authorization does not approve a person’s provider account. The service password remains a backend secret; neither it nor the management PAT is an agent credential. finance_executor_grant records the claim before external mutations and stores the grant under AES-GCM with the immutable organization, space, host and app binding as authenticated context. The Team DO owns subsequent token rotation privately. A grant with an uncertain result is quarantined; issuing another grant requires reconciliation first.
Connections are listed under their Finance space in Client Settings, with a link back to its Team conversation. The space header links directly to this page; Apps & Files contains files rather than connection controls. Wes’s connections_open tool returns the current space’s settings link without accepting another client or space as input. It does not connect an account or approve OAuth. Settings show configuration without an adjacent conversation panel. The Open Finance Team link returns to the space conversation when help is needed.
The person chooses Add connection and searches Executor’s live catalog. The backend forwards a bounded search to the native catalog API and accepts exact listed entry IDs for installation. Existing Linear, Notion and Sentry connections retain their reviewed MCP adapters; Linear explicitly requests read scope. The provider displays its own OAuth permissions. The agent’s native grant remains read-only even when the provider’s consent grants broader upstream permissions. Other catalog entries install a private native app for that space and expose the app’s own account requirements and OAuth methods. Entries needing non-OAuth setup can be installed, but Workbench does not accept API keys or pretend sign-in is available. The native Executor management app is excluded from space installation. The preview callback checks the original state, recipient and exact registered redirect before linking the saved account only to that space’s app. The provider’s OAuth credentials and renewal stay in Executor. No API-key form is provided. Provider consent is the only interactive authorization in the normal new-space flow.
The app imports https://mcp.linear.app/mcp/readonly with Executor’s mcpRouter, rather than wrapping GraphQL. EXECUTOR_CONSENT_SOURCE_ID identifies that provider endpoint, not a Linear organization UUID. Browser consent chooses the upstream workspace; this pilot does not independently verify its company identity. The native account ID and app assignment provide the isolation boundary. Send @Wes list three recent Linear issues in Team to test the connection.
The Worker releases a decrypted agent grant only for a currently authorized invocation and the same space binding. Provider reads require active assignments. With the shared app configured, installed skills and setup tools are also available before provider consent. Native /mcp/whoami must report browser approval mode, the exact connection and the configured app count. A retained connection receipt is checked before later model requests and publication. Disconnect invalidates retained unpublished context and new reads; published messages remain conversation history.
Preview activation is pinned to the isolated PR stage; its explicit wildcard enables authorized client Finance spaces across preview firms. Production activation is supplied by the release bootstrap before Alchemy deployment. EXECUTOR_SERVICE_EMAIL, EXECUTOR_SERVICE_PASSWORD and EXECUTOR_GRANT_ENCRYPTION_KEY configure the control-plane identity and encrypted grant storage. Keep the encryption key stable across deployments; replacing it requires rewrapping or reissuing existing grants. The preview host’s provider callback points to the preview’s /executor/callback, leaving other Executor hosts unaffected. External cleanup remains separate work. Provider-specific OAuth client configuration may still be required: a catalog entry alone does not provision credentials with its upstream service.
Connection picker
The picker follows the native Executor account-setup pattern: searchable provider rows, existing connection status, then browser sign-in. The initial reviewed choices are Linear, Notion and Sentry. Each has one active account per Finance space; this does not yet add multiple accounts of the same provider or arbitrary MCP URLs. Other providers still need an implemented native account requirement and reviewed OAuth/MCP configuration.
The picker providers run inside the same per-space adapter app, so adding a provider preserves that adapter’s identity and the existing grant. New apps declare optional account lists and expose tools only for connected providers. Selecting another provider on an older Linear app first claims a source upgrade in SQL, saves the replacement template and deploys it to the same app ID. The Linear provider identity and requirement name are preserved. An unknown upgrade result blocks execution and cannot be retried blindly; it does not delete existing account assignments. Selecting or connecting another provider does not reset the client, space, conversation or other provider links.
Connection intents, callbacks and disconnects use the selected provider’s persisted requirement and source ID. Public requests select a catalog ID rather than supplying an arbitrary MCP URL. The native token reaches only the space adapter and, when configured, the shared app with that space’s exact context account. Each agent read records the current active assignment set; removing any assignment invalidates retained reads that could have used that set. A prior single-provider receipt remains valid while that assignment remains active. Unresolved main-app link/unlink mutations block native grant release until their outcome is known.
References: Executor account setup, Notion MCP, Sentry MCP. Native beta.59 checks verified compilation, unchanged Linear provider identity on upgrade, empty account lists and browser OAuth start for all three providers. Completing Notion or Sentry consent still requires the person’s provider authorization; an actual provider read is not implied by successful OAuth start.
Shared Finance app in the preview
EXECUTOR_SHARED_APP_ID selects an operator-installed native Executor app. It is not accepted from the browser or model. Finance skills, account requirements and setup behavior remain in that app; Workbench does not implement an accounting workflow. The preview uses a pinned live Ledger Goblins source snapshot, not its newer undeployed workflow changes. Its source stays in Executor. Existing per-space connection adapters and their provider links are preserved.
After the ordinary grant is ready, the consumer claims attachment in SQL, creates one server-owned workbenchSpace account, records its receipt, and updates the existing scoped connection to exactly two entries: its own adapter and the configured shared app. The shared app must use caller-scoped accounts and declare workbenchSpace.many(). Its connection selects exactly one context account, so the shared code receives one trusted space identity even before any QuickBooks account exists. Native globally linked app accounts are rejected at this boundary. The provider is an internal space identity, not another credential the person must supply.
The attachment changes the existing connection, preserving its OAuth grant and the Team durable object’s rotated credentials. Its short-lived control session is separate from the grant’s retained authorizing session. An uncertain account creation or policy update quarantines the claim; scheduled recovery never blindly issues another identity. Native app and context receipts remain available for reconciliation. Context and app references are authenticated inside the encrypted seed and checked against server configuration before release.
A bootstrap read receipt is bound to the space adapter and grant. It cannot be reused in another space, and current organization/business authority is checked before later model requests and publication. Existing provider assignments retain their own authority and disconnect checks. The host still verifies browser approval mode and the expected native app count for every Executor operation.
The shared app exposes its own setup-status query and setup skill. The tested path discovers the monthly-close skill, reports missing QuickBooks, and sends the person to the current space’s Connections page through the host’s existing link tool. QuickBooks is available through native catalog installation. Its catalog provider and the preview Ledger Goblins provider have the same native provider identity, so an authorized catalog account can fill the shared app’s caller-scoped requirement. Real Intuit sign-in still needs the native host’s OAuth client configuration. A definite OAuthClientUnavailable refusal leaves the installation usable and reports setup required; it does not mark an account connected or quarantine an untouched agent grant. A missing provider must never be substituted or presented as a completed close.
The shared app stores verified QuickBooks company bindings in its own SQL, partitioned by trusted space identity and native account ID. Its finance data tools also require that account to be selected by the current native grant; a SQL row alone never grants access. Ledger Goblins’ preserved scripts also retain their documented host dependencies: skill discovery is not evidence that a full monthly close can execute.
Validation includes two native grants to the same installed app before QuickBooks consent, different trusted space identities, rejection of a foreign space assertion, and discovery of the setup and monthly-close skills. Separate disposable tests verified per-connection account filtering and a central code update, and demonstrated that unpartitioned SQL is shared. Workbench HTTP integration coverage owns attachment claims, bootstrap receipt isolation, authority revocation and uncertain-outcome quarantine.
Catalog installation and account assignment
The connection picker displays Executor’s catalog logos beside integration names, preferring light-theme artwork for Workbench’s supplied palette. Missing or failed images show a neutral connection icon; the visible name remains the accessible label.
finance_executor_installation records one catalog installation per space binding and entry ID. The native app ID, selected account IDs, consenting user and organization, callback-state hash and setup status are private server receipts. OAuth credentials remain in Executor. Installation claims and native policy edits are serialized through the existing space grant before external mutations; unknown results require reconciliation and are not replayed. New installations do not issue another OAuth grant or overwrite the Team object’s refreshed credentials.
The scoped connection contains the space adapter, shared Ledger Goblins with its trusted space identity, and that space’s catalog apps. Each app stays read-only. A catalog app with caller account requirements enters the agent grant only after an account is connected; native scoped connections cannot select an accountless target for those apps. Ledger Goblins remains available beforehand through its trusted space identity. OAuth completion validates the initiating actor, current access, exact callback, state and expiry before selecting an account. Account assignments feed the shared app only when the native provider identity matches a caller-scoped collection requirement. Global app credentials are used only by separate per-space catalog apps, never by the centrally shared Finance app. Shared-app SQL bindings use the trusted space identity as an explicit partition.
QuickBooks completion additionally requires exactly one numeric realmId from the validated OAuth callback. Workbench passes it, the native account ID and the trusted space ID to Ledger’s quickbooks.bindCompany mutation through the control identity. That operation verifies CompanyInfo with the account’s production or sandbox method before retaining the binding. The read-only agent grant cannot invoke the mutation. Company and report queries derive the company ID from this binding; one linked account is selected automatically, and multiple accounts require a company choice from quickbooks.accounts. The CompanyInfo object’s Id is not the OAuth company ID and is not used to reconstruct it.
Existing accounts without a retained company selection need a secure reconnect through Connections. Do not ask people to find or enter numeric IDs. Refreshing provider tokens preserves the separate company binding. Rebinding an existing account to another company is rejected; connect a different company as a separate account. A verification failure quarantines completion and prevents release of the changed grant. Successful company access verifies the connection, not the completeness of a finance diagnostic.
The reviewed Ledger source also provides quickbooks.query for record-level reads through Intuit’s Query API. It accepts one SELECT * or SELECT COUNT(*) statement for one supported entity, with optional WHERE and ORDERBY. The tool derives the company from the same space/account binding and uses GET only. Pagination uses separate startPosition and maxResults inputs (defaults 1 and 100; maximum page size 1000); a returned next position indicates another page to check, not verified completeness. Count queries do not accept pagination. Results retain the provider response and capture time, with a 512 KiB response limit. Provider failures are errors, never empty findings. The app’s quickbooks-query skill explains tool selection, syntax, examples, limitations and evidence coverage. Its bundled catalog covers 38 queryable entities with lazily read field references extracted from official Intuit metadata; each reference preserves field types, filter/sort flags and model relationships. The catalog records source URLs and hashes. Missing flags are not inferred as permissions. Dated financial statements and aging continue to use quickbooks.report. This capability requires publishing the reviewed source to the existing app; bootstrap preserves installed source rather than enabling new tools automatically.
Ledger’s quickbooks.report supports Orchestrator’s live report set, including P&L detail and A/R and A/P aging detail. Aging summaries and detail use endDate as the as-of date and send it to Intuit as report_date. The tool rejects results that do not confirm that cutoff in their headers. Other reports use an inclusive start and end date and a Cash or Accrual basis.
Canceling pending consent invalidates that callback. An admin or lead can disconnect a requirement: the native grant loses the account before the per-space app link is removed. Retained read receipts include the installation state, so cancellation, account changes, disconnect and access loss invalidate unpublished context. Reusable credentials are retained; disconnect does not delete native accounts. Pending browser authorization belongs to its initiating person, not every space member.
Before OAuth starts, Workbench reads the native provider’s setup metadata. Operators can set EXECUTOR_CATALOG_OAUTH_CLIENTS to a JSON array of {provider, method, clientId} entries using native provider and OAuth client IDs. This keeps registrations separate when sandbox and production methods share an issuer. A configured selection must be unique and usable; missing or duplicate selections stop consent instead of falling back to another registration. Without a matching override, automatic methods retain native registration and client-required methods select their sole usable client. Secrets stay in Executor; account contributors never choose developer credentials.
The picker searches the official catalog through the configured Executor host. On a self-host with EXECUTOR_CATALOG_URL=off, the host lists only its built-in app; enable the official feed for catalog search. The production bootstrap creates the native host and shared app, retains stable credentials, and supplies callback configuration and provisioning activation to the release. An installed package and its skills do not establish that finance scripts or a full monthly close can execute.