Repository navigation
fix(workflow-code): name workspace files by path in file() references - #10545
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryWorkspace files now use their folder path and filename in
No new actionable findings were accepted. Review was based on source inspection; no tests were run.
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 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 36 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
5b73228 to
796fe00
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 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 36 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
file('<folder>/<name>') now resolves the workspace file at that path and
writes the object the editor's file picker stores (storage key and file
id), a stored workspace file prints back as file('<path>'), and the source
resources manifest and workspace.d.ts list file paths.
…m withheld callers
…itten, and report truncation exactly
- a path the stored workflow does not already hold resolves only for a caller whose group allows Files; any other caller gets the unknown-file finding a missing path gets
- resolve file() paths by exact name and folder path instead of the VFS reference parser, so files named content or meta.json inside a folder resolve
- read file pages until the manifest cap is filled so files no path names cannot hide a truncated list
- document the quoted file('docs/report.pdf') form in the manifest description
a061b18 to
be37ecf
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
file('contracts/acme.pdf'), but the server resolvedfilekeys through resource-key slugs (a-txt-2) that nothing listed.file('<folder>/<name>')now resolves the workspace file at that path. That is the key the workspace directory already gives a file underfiles/<path>. Files no longer get key rows.wf_…file id into the upload object'skey, which the runtime reads as a storage key, so runs failed with "File is required". Afile('<path>')value now materializes the object the editor's workspace file picker stores: name, serve path, storage key, size, type, file id and folder path (newResourceKeyResolver.uploadOf).file('<path>')when itsidnames a live workspace file, or its storagekeydoes when it has noid. Files uploaded in place stay verbatim objects. An unchanged re-apply keeps the stored bytes.--topromotion resolves the target workspace's own file at the same path.files(paths, gated byfiles.uselike the Files tab).workspace.d.tstypes those paths asFileKey, plus the paths the directory holds underfiles/.file()is nowfile<K extends FileKey>. File-upload fields acceptFileRefor a list of them, andUploadedFile.keyis a plain string again.syntax.mdx,SYNTAX.md,workspace-code/DESIGN.md, the directory guide,catalog/types.tsand themodel.tsencoding note now describe the path form.withinCreatehook that only that claim used. A create's pending entry is keyed by its path, so a workflow in the same apply still dry-runs, and the commit re-plans against the written file.wf_…id inkey) now prints asfile('<path>'). An unchanged re-apply keeps the stored bytes, so the run-time failure remains until the field is edited or the workflow is re-applied from another workspace.filerows inworkspace_resource_keyno longer resolve. Nothing reads them.core.d.ts,syntax.mdxandSYNTAX.mdare shared with other QA batches: B1 lands first, then this PR, then B5.Type of Change
Testing
Each new test went red when its guard was reverted on its own (resolver, canonicalize lift, materialize
uploadOf, files adapter pending path, manifest, SDK typing) and passes with the fix.files.integration.ts(real Postgres + local storage):file('moved/a.txt')stores its id and storage key, andgetprintsfile('moved/a.txt').E_MAT_UNKNOWN_RESOURCE, with the workspace's paths as the hint.file('contract.pdf').files.integration.tsreview follow-ups:%20under a top-levelfilesfolder resolves as written.moved//a.txt) isE_MAT_UNKNOWN_RESOURCE, not a server error.read-source-resources.integration.ts: lists files by path, and omits them when the Files tab is hidden for the caller's group.workspace-declarations.test.ts: a generated block's file-upload field accepts[file('moved/a.txt')], and an unlisted path is a type error.bun run testpassed.bun run generate, lint, type-check, the block registry check andcheck:api-validation:strictpassed.check:auditspassed except knip, which reports the docs app's build-generated.contentimport as unresolved in a fresh worktree. This PR does not touch that file.Checklist
test-auditauthoring gate)