fix(uploads): manual file uploads must ignore provenance stamping - #6314
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Tag-definition delete routes now map Copilot no longer silently drops attachments when upload tracking or workspace-file provenance verification fails—the chat payload throws on prepare errors, and the lifecycle aborts with a projection error instead of continuing without files. Tests cover successful attachment context and the new failure paths. The agent handler normalizes workspace-picker file objects (serve URL + Reviewed by Cursor Bugbot for commit f4f2e71. Configure here. |
Greptile SummaryThis PR separates manual-upload metadata binding from secret-provenance classification and makes provenance lookup failures fail closed.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The changed upload paths preserve provenance established during registration, canonical keys remain workspace-scoped and uniquely bound to active records, and verification failures now stop attachments before model execution.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/uploads/contexts/workspace/workspace-file-secret-provenance.ts | Uses canonical active storage keys for model-safety classification and binds provenance within the database timestamp's JavaScript-visible millisecond. |
| apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts | Makes chat upload tracking metadata-only so it preserves provenance established when user-uploaded bytes were registered. |
| apps/sim/lib/copilot/chat/payload.ts | Stops Copilot payload construction with a user-facing error when an authorized attachment cannot be prepared. |
| apps/sim/lib/copilot/request/lifecycle/run.ts | Fails closed when initial attachment provenance cannot be verified rather than silently continuing without files. |
| apps/sim/providers/index.ts | Prevents provider execution when attachment provenance lookup fails. |
| apps/sim/executor/handlers/agent/agent-handler.test.ts | Adds coverage for normalizing and hydrating persisted workspace-picker file metadata. |
Sequence Diagram
sequenceDiagram
participant User
participant Upload as Upload Registration
participant DB as Workspace Files
participant Chat as Chat Binding
participant Filter as Provenance Filter
participant Model
User->>Upload: Upload file bytes
Upload->>DB: Store file and initial provenance
User->>Chat: Attach file to chat
Chat->>DB: Update chat metadata only
Chat->>Filter: Submit canonical storage key
Filter->>DB: Load active row and provenance
alt Provenance is model-safe
Filter->>Model: Include attachment
else Unsafe or unknown
Filter-->>Chat: Reject or omit attachment
else Lookup fails
Filter-->>Chat: Fail request explicitly
end
Reviews (1): Last reviewed commit: "fix(uploads): manual uploads provenance ..." | Re-trigger Greptile
|
bugbot run |
|
bugbot run |
|
bugbot run |
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 f4f2e71. Configure here.
Summary
Manual uploads don't have provenance markers. They're user generated.
Type of Change
Testing
Tested manually
Checklist