Skip to content

feat(project-files): add core storage and realtime operations - #9016

Merged
mzxchandra merged 13 commits into
stagingfrom
codex/project-files-core
Oct 14, 2026
Merged

mzxchandra merged 13 commits into
stagingfrom
codex/project-files-core

Conversation

@mzxchandra

@mzxchandra mzxchandra commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep unreleased Project API and CLI references out of published docs, using explicit documentation exclusions. Runtime contracts, commands, and feature gates remain unchanged; publish the retained definitions at launch.
  • Add authorized Project file CRUD, folders, uploads, history, lifecycle, and realtime document/list operations.
  • Part 2 of the five-PR split of feat(files): add the Project file backend and APIs #8610, based on staging after the storage-foundation PR refactor(files): unify mutation accounting and retention #9015 merged. Includes contracts, CLI/API generation, and core HTTP acceptance coverage.
  • Unify Workspace and Project realtime permissions: readers remain subscribed, mutation frames require write access, and write loss stops browser editing and agent streams. Persist snapshots with their authenticated editor.
  • Preserve old-app/new-relay mutation checks and new-app/old-schema-v2-relay writer admission. The latter is limited to Workspace relays whose acknowledged joins require write access; live readers require the upgraded relay.
  • Keep rendering/search, bulk operations, and sharing in subsequent PRs. These are review boundaries, not five required releases.

Testing

  • Documentation change: 147 focused generator/docs tests passed; OpenAPI, CLI docs, docs-manifest and import checks passed. Verified only Project paths were removed, published CLI references omit Projects, and runtime CLI help remains available.
  • Current capability change: 82 provider/editor tests, 43 realtime unit tests, and 36 PostgreSQL/Redis/Socket.IO integration checks passed. Negative controls fail when the capability/streaming guards are removed.
  • Real local app + relay + Chromium: six checks passed for reader/writer admission, live edits and downloaded persisted bytes, downgrade, continued subscription/reload, network reconnect, and revocation.
  • Browser coverage is the existing Workspace UI. Project backend/socket paths are covered; the Project product browser surface remains in feat(files): Project file browser and Mothership integration #9034.
  • Staging synchronization previously passed 54 focused migrated database checks, 28 storage units, 12 CLI checks, and 57 realtime tests. Regenerated CLI/API/OpenAPI artifacts and verified their checks after synchronization; targeted formatting and commit hooks passed.
  • Prepared the pre-deployment staging fixture and private after-deployment verification handoff. Post-deployment validation and current-head hosted CI remain pending.

Type of Change

  • Feature / refactor

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Focused tests added/updated and passing
  • Full hosted CI passed
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Review stack

  1. refactor(files): unify mutation accounting and retention #9015 — mutation accounting and retention (merged into staging)
  2. feat(project-files): add core storage and realtime operations #9016 — core files, history, uploads, realtime (base: staging)
  3. feat(project-files): add rendered delivery and indexed search #9017 — rendering, derived content, search
  4. feat(project-files): add cross-owner copy and bulk transfers #9018 — cross-owner copy, extraction, downloads, export
  5. feat(project-files): add public sharing and protected delivery #9019 — public sharing

Review #9016 against staging; later slices remain based on their immediate parent. #8610 is superseded by this stack.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 14, 2026 10:59pm UTC

Request Review

@mzxchandra
mzxchandra changed the base branch from codex/project-files-storage to staging October 14, 2026 19:35
@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

Please review current head c40cf93, which includes the CI fixes and resolved staging synchronization.

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

Please review current head c40cf93, which includes the CI fixes and resolved staging synchronization.

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

Please review current head c40cf93, which includes the CI fixes and resolved staging synchronization.

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/next.config.ts
Comment thread apps/sim/lib/projects/files/application/content.ts Outdated
Comment thread apps/sim/lib/projects/files/application/read.ts
Comment thread apps/sim/lib/api/contracts/project-file-uploads.ts
Comment thread apps/realtime/src/handlers/file-doc.ts
Comment thread apps/sim/lib/projects/files/__integration__/content.integration.ts
Comment thread apps/sim/lib/api/contracts/v2/openapi/project-file-folders.ts Outdated
Comment thread apps/sim/lib/api/contracts/v2/openapi/project-file-uploads.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Critical impact] The reviewed changes appear safe to merge, with no outstanding actionable findings.

Summary

Adds authorized Project file storage, folders, uploads, history, and realtime operations. The latest changes mark raw downloads as opaque and expand tests for refused delivery.

  • Project files can be browsed, moved, archived, and restored.
  • Project files can be uploaded through bound transfer sessions.
  • Project files keep version history that callers can inspect and restore.
  • Realtime file readers can stay connected without edit access.
  • Project file API contracts are generated for runtime and kept out of published docs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Source download requested] --> B[Check current access]
  B --> C[Check whether raw bytes may leave]
  C -->|Allowed| D[Open stored content]
  C -->|Refused| E[Return error without content]
  D --> F[Recheck access and file revision]
  F --> G[Check delivery again]
  G -->|Allowed| H[Return bytes]
  G -->|Refused| I[Cancel stream or withhold buffer]
Loading

Reviews (6) · Last reviewed commit: "fix(files): classify raw Project downloa..." · Reviewed by Greptile

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

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.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/projects/files/application/documents.ts
Comment thread apps/sim/lib/uploads/contexts/workspace/file-manager.ts Outdated
Comment thread apps/sim/app/api/v2/projects/[projectId]/files/route.ts
Comment thread apps/sim/lib/projects/files/application/read.ts
Comment thread apps/sim/lib/projects/files/application/read.ts
Comment thread apps/sim/lib/uploads/contexts/workspace/file-folder-manager.ts Outdated
Comment thread apps/sim/lib/api/contracts/v2/openapi/project-file-uploads.ts
@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 228 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.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/api/contracts/v2/openapi/project-file-uploads.ts Outdated
Comment thread apps/sim/lib/projects/files/application/content.ts Outdated
@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 228 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.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/projects/files/application/content.ts Outdated
@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 228 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.

Turn on auto-fix | Re-trigger cubic

@mzxchandra
mzxchandra marked this pull request as ready for review October 14, 2026 23:04
@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

@mzxchandra
mzxchandra requested a review from a team as a code owner October 14, 2026 23:04

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 228 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.

Turn on auto-fix | Re-trigger cubic

@mzxchandra
mzxchandra merged commit bca7836 into staging Oct 14, 2026
57 checks passed
@mzxchandra
mzxchandra deleted the codex/project-files-core branch October 14, 2026 23:15
@mzxchandra

Copy link
Copy Markdown
Contributor Author

Staging verification (2026-10-14): both app and relay promotion to merge bca7836 were independently verified. With Projects disabled, the exercised Workspace paths passed: two-account editing, live Write→Read downgrade with continued updates and edit refusal, real offline/reconnect recovery, revocation and fresh access denial, and restored write access. Saved bytes, unique markers, and both authors in history were verified; original roles and network settings were restored.

Coverage limits: adversarial rejected-frame quarantine/replay and Project-enabled paths were not tested on staging. The original fixture bytes were verified before mutation, but the old serving SHA and fresh pre-deployment role-browser checks remain unverified. Production was not covered.

This branch was previously deployed

1 inactive deployment
Preview — 6c035116 Deployed Oct 14, 2026 by vercel[bot]
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