feat: unify server-side selector execution - #7185
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
# Conflicts: # apps/sim/app/api/tools/cloudwatch/describe-log-groups/route.ts # apps/sim/app/api/tools/cloudwatch/describe-log-streams/route.ts # apps/sim/app/api/tools/confluence/page/route.ts # apps/sim/app/api/tools/jsm/selector-requesttypes/route.ts # apps/sim/app/api/tools/jsm/selector-servicedesks/route.ts # apps/sim/lib/api/contracts/selectors/google.ts # apps/sim/lib/api/contracts/selectors/index.ts # apps/sim/lib/api/contracts/selectors/jira.ts # apps/sim/lib/api/contracts/selectors/microsoft.ts # apps/sim/lib/api/contracts/selectors/sharepoint.ts # apps/sim/lib/api/contracts/selectors/wealthbox.ts # apps/sim/lib/api/contracts/tools/index.ts
# Conflicts: # scripts/check-tool-registry-boundary.baseline.json
|
Too many files changed for review (296 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
All reported issues were addressed across 296 files
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Re-trigger cubic
|
@cubic-dev-ai rerun and review the complete updated PR against staging. Re-check the addressed selector, OAuth, IMAP, provider-boundary, and UX findings; report only remaining or newly introduced issues. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 314 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
|
@cubic-dev-ai rerun and review the complete updated PR against staging. Re-check the addressed selector, OAuth, IMAP, provider-boundary, and UX findings; report only remaining or newly introduced issues. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 315 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Fix all with cubic | Re-trigger cubic
…r-selector-execution # Conflicts: # apps/sim/app/api/tools/netsuite/objects/route.test.ts # apps/sim/app/api/tools/netsuite/objects/route.ts # scripts/check-tool-registry-boundary.baseline.json
|
@cubic-dev-ai rerun and review the complete updated PR against staging. Re-check the repaired existing-IMAP deployment binding, connector selector validation guidance, and the documented Confluence and NetSuite dispositions. Report only remaining or newly introduced issues. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 315 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai rerun and review the complete updated PR against staging. Re-check the existing-IMAP deployment binding update and rollback paths, including failed polling setup. Report only remaining or newly introduced issues. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
…r-selector-execution
There was a problem hiding this comment.
All reported issues were addressed
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai rerun and review the complete updated PR against staging. Re-check all addressed selector, OAuth, IMAP, provider-boundary, and UX findings, including existing-IMAP deployment binding update and rollback paths. Report only remaining or newly introduced issues. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 315 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Re-trigger cubic
|
@cubic-dev-ai rerun and review the complete updated PR against staging. Re-check the IMAP active-deployment webhook lookup and rollback paths together with all previously addressed selector, OAuth, provider-boundary, and UX findings. Report only remaining or newly introduced issues. |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 315 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Re-trigger cubic
…r-selector-execution # Conflicts: # apps/sim/hooks/selectors/providers/workspace/selectors.ts
Summary
Moves every dynamic selector onto one exhaustive, server-authorized execution architecture while preserving the existing dropdown/combobox UX, React Query behavior, pagination, search, detail hydration, and saved workflow/connector formats.
provider-serverinternal-serverlocal(workspace.triggerTypes)selectors.executeapplication operation andPOST /api/selectors/execute.{{KEY}}references only after session and canonical workflow/workspace authorization./pageremain as thin compatibility adapters over staging's in-process operations; selectors do not call them.add-selector/validate-selectorskills and updates adjacent integration, connector, trigger, block, and application-operation guidance.There is no feature flag, browser-side provider fallback,
provider-legacyclassification, database migration, or saved-configuration migration.Architecture
Before
flowchart TD A["Workflow, trigger, connector, fork, search, comparison, display"] --> B{"Surface-specific context builder"} B --> C["Browser personal-environment resolution"] B --> D["Unresolved dependency values"] C --> E["Client provider registry and provider-specific query key"] D --> E C --> X["Hidden shared value unavailable: dependency omitted or disabled"] E --> F["Provider-specific API route"] E --> G["Browser OAuth-token helper for some providers"] G --> F F --> H["External provider"]After
flowchart TD A["Workflow, trigger, connector, fork, search, comparison, display"] --> B["One active-value context builder: literals plus exact unresolved references"] B --> C["One React Query facade with opaque privacy-safe identity"] C --> D["POST /api/selectors/execute"] D --> E["Authenticate session and resolve canonical scope"] E --> F["Authorize selectors.execute"] F --> G["Manifest capability and exact context allowlist"] G --> H["Resolve exact references server-side"] H --> I["Authorize credential use and provider/service binding"] I --> J["Apply destination policy and execute trusted adapter"] J --> K["Project, bound, sanitize, and return options only"] B --> L{"Local classification?"} L -->|"workspace.triggerTypes only"| M["Pure local attachment"]Security boundary
private, no-store; there is no selector result cache or high-volume selector audit event.Authorized use of a shared credential intentionally declassifies only the provider resource metadata represented by normalized options; it does not declassify the credential or referenced secret itself.
Explicit process-local token-cache exception
This exception applies only to short-lived client-credential bearer tokens minted by the existing credential service. In selector privacy mode, credential-derived cache identities are HMACed. Each resolution reauthorizes the request, verifies provider binding, rereads the credential row, and validates the current encrypted-secret fingerprint before using a cached token, so credential rotation or reconnection prevents stale-token reuse. Entries remain in one server process, become ineligible for reuse at token expiry, are removed lazily on a later client-credential resolution or process exit, and never cross the selector boundary.
Explicit security-owner acceptance of this exception is required before merge. If it is not accepted, selector privacy mode must bypass client-credential token-cache reads and writes.
Migration inventory
lib/api/contracts/selectorsnow contains only the unifiedexecutecontract; retained CloudWatch, Confluence, and JSM tool contracts live undercontracts/tools, and the Harmonic provider schema is adapter-local.staging: 330 files, 13,696 additions, 20,382 deletions.Type of Change
Testing
Focused migration suites:
Repository gates:
bun run --cwd apps/sim type-checkbun run --cwd packages/testing type-checkbun run check:audits(all 37 audits)bun run check:route-verbsbun run check:api-validation:strictbun run check:fork-dependent-coveragebun run check:react-querybun run check:client-boundarybun run check:tool-registry-boundarybun run check:skillsbun run lint:check(all 26 packages pass without warnings)bun run --cwd apps/sim buildgit diff --checkReview follow-up fixes
workspace.secretNamesuses an ACL-aware names-only environment path that does not decrypt values or populate the decrypted snapshot cache.{{KEY}}. TheIDkey /IDvalue collision is covered; partial or unrelated protected plaintext still fails closed.Known limitation and deferred follow-ups
The review also identified adjacent pre-existing/shared concerns that are intentionally outside this PR’s locked scope:
Sites.Read.All, while current Excel consent is file-only, so ordinary Excel credentials are expected to receive403. The consent and credential model is tracked in #7197; no OAuth-scope or reconsent change is included here.Reviewer focus
Deferred live browser validation
The PR remains draft until disposable provider credentials are available. Automated tests do not require live credentials.
Excel-backed SharePoint site discovery is not an acceptance item for this PR and is expected to fail until #7197 selects and implements a consent model. Native SharePoint credential validation remains part of any Microsoft live-provider coverage.
Checklist
Screenshots/Videos
No visual UI redesign. The selector UX is intentionally preserved; live-provider screenshots are deferred with the credential checklist above.