refactor: enforce Copilot table application boundary - #6453
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
81faf24 to
d0493ad
Compare
|
@cursor review |
PR SummaryMedium Risk Overview Copilot no longer uses admission-only paths or a generic table executor. V2 import/export routes use shared Reviewed by Cursor Bugbot for commit 6e9c395. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR replaces Copilot Table compatibility paths with fixed application commands and moves Table transfer and workflow-group routes onto application-owned authorization boundaries.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported unscoped Copilot Table delegation is now bound to exact table scope and checked against the canonically loaded table context.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/copilot/application/execute-table-use-case.ts | Constructs the shared Copilot application principal and projects exact table scope for table-targeting commands. |
| apps/sim/lib/copilot/application/table-commands.ts | Defines fixed adapters for compound Table commands and deliberately distinguishes table-scoped from workspace-scoped operations. |
| apps/sim/lib/table/application/authorization.ts | Enforces bidirectional agreement between delegated table scope and the canonical authorization context. |
| apps/sim/lib/table/application/copilot-table-lifecycle.ts | Implements workspace-authorized table lifecycle commands with canonical per-table containment checks. |
| apps/sim/lib/table/application/imports.ts | Moves import lifecycle authorization and credential-bound upload control into fixed application use cases. |
| apps/sim/lib/table/application/exports.ts | Moves export creation, access, cancellation, and download signing behind application authorization. |
| apps/sim/lib/table/application/groups.ts | Centralizes workflow-group validation, authorization, mutation, auditing, and effects in named Table commands. |
| apps/sim/lib/copilot/tools/server/table/user-table.ts | Replaces generic or adapter-composed Table execution with explicit application command dispatch. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Model[Copilot model tool call] --> Adapter[Fixed Table adapter]
Adapter --> Principal[Copilot delegated principal]
Principal --> Scope{Command scope}
Scope -->|Existing table| TableScope[Exact tableId scope]
Scope -->|Workspace command| WorkspaceScope[Workspace scope]
TableScope --> Command[Named application command]
WorkspaceScope --> Command
Command --> Canonical[Canonical resource resolution]
Canonical --> Auth[Workspace and resource authorization]
Auth --> Mutation[Locked mutation or query]
Mutation --> Effects[Audit and shared effects]
Effects --> Presenter[Surface presenter]
Reviews (8): Last reviewed commit: "fix(tables): complete authorized applica..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2856cd5. Configure here.
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 54e16a0. Configure here.
54e16a0 to
ecae9b8
Compare
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d7df662. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6e9c395. Configure here.
Summary
serviceId: copilot) from the merged foundation. Fixed adapters construct that Principal, map boundary input, call exactly one code-defined application command/query, and present the result; there is no generic Table multi-operation executor.Application operation manifest
Migrated
Table Copilot operations
Workflow operation
list_workflow_outputscalls one exact authorized Workflow resolver using the shared Copilot Principal. Workflow-output resolution used by group mutations is owned inside the top-level authorized Table command and is not a nested Workflow use case.HTTP Table transfer/group operations
Deferred
Non-goals
list_enrichmentsis a pure code-defined catalog presentation with no durable resource load or mutation; it is intentionally not forced through the Table operation registry.Import and internal-auth policy
Durable import resources are workspace-owned: reading an import requires workspace read access, and cancelling an import requires workspace write access. This intentionally allows a currently authorized workspace member or workspace API key to control the durable job independent of the original uploader.
Upload control remains credential-bound. Upload parts, completion, and upload cancellation require the exact creating principal/API-key credential plus the upload token; finalization reasserts that binding. Delegated principals remain rejected from HTTP upload creation, parts, and completion. Copilot workspace-file imports enter delegated-only Table application commands instead of entering or bypassing the HTTP upload lifecycle.
The ordinary first-party transfer and workflow-group routes are session-only. A caller audit found only browser React Query callers and no workflow executor or trusted server caller sending Bearer auth to these contracts. Executor Bearer support is therefore not applicable here: this PR adds neither
createInternalSessionOrExecutorAuthnor a dead delegation-token abstraction, and it never derives executor authority from a route workspace, uploader, owner, or billing actor. Any future executor caller must use scoped headers generated from canonical workflow execution context.Foundation
This branch is rebased on
d69224595cand consumes the merged delegated identity, consolidated Copilot adapter, and route-boundary foundations from #6462, #6450, and #6451. No duplicate fallback Principal or workspace executor is included.Validation
@sim/authtype-check passedbun run check:api-validation:strictpassedgit diff --checkpassedbun.lockcontains unrelated local tool-version drift and is intentionally excluded.