René's URL Explorer Experiment


Title: improvement(files): make the row the documented owner of module context by icecrasher321 · Pull Request #6803 · simstudioai/sim · GitHub

Open Graph Title: improvement(files): make the row the documented owner of module context by icecrasher321 · Pull Request #6803 · simstudioai/sim

X Title: improvement(files): make the row the documented owner of module context by icecrasher321 · Pull Request #6803 · simstudioai/sim

Description: Summary Follow-up to #6789. That PR fixed the 404 by resolving a file's module context from its stored row instead of its key prefix; this states the contract that fix relies on, so the next reader doesn't re-derive module ownership from the prefix the same way #6654 did. Prefix = bucket + tenancy. Row = module owner. workspace_files.context is server-authored like the key, but unlike the key it is mutable — materialize_file promotes a chat attachment to a workspace file by flipping that column. Encoding a mutable fact in an immutable key would mean copying the bytes on every transition just to restate them, which is why the prefix can't own this and executeSave stays a metadata-only flip. resolveTrustedFileContext claimed the prefix was flatly "authoritative" — the claim that made routing on it look safe. Now scoped to what it actually defends: a caller-supplied context still can never relabel a private key. resolveStoredFileContext is documented as the sanctioned reader rather than a workaround. verifyWorkspaceFileAccess filtered its binding lookup to context = 'workspace', so attachments missed the row and fell through to object metadata, which can't see a soft delete. It now matches either workspace-scoped context — which is what callers already wanted, since the LLM-attachment and presigned-URL paths pass 'workspace' for attachment keys today. A soft-deleted attachment is now denied on all of them. The parse route carried the same gate, labelling parsed attachments with the raw storage segment instead of the uploaded filename. Module-scoped filters are deliberately untouched: the Files module, folder manager, forking and the workspace-file use cases match context = 'workspace' because they mean the Files module, not the bucket. Considered and rejected: giving mothership its own mothership/ prefix. It would force executeSave to copy bytes to a workspace/ key on every promotion, turning an atomic metadata transaction into copy → commit → delete with orphan/stale failure modes on both sides — a data migration to restate something a column already says. Type of Change Bug fix Testing The new authorization tests use a getFileMetadataByKey mock that honors the context/includeDeleted arguments, so they actually exercise the filter — 2 fail against the old authorizer, while the workspace-context cases still pass, showing no Files-module regression. (A mock that ignored those args would have passed either way, which is how the original gate went unnoticed.) bun run test app/api/files lib/uploads lib/workspace-files — 895 pass (79 files). type-check, lint, and all 29 audits clean. Not exercised against a running app. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Follow-up to #6789. That PR fixed the 404 by resolving a file's module context from its stored row instead of its key prefix; this states the contract that fix relies on, so the next re...

X Description: Summary Follow-up to #6789. That PR fixed the 404 by resolving a file's module context from its stored row instead of its key prefix; this states the contract that fix relies on, so the nex...

Opengraph URL: https://github.com/simstudioai/sim/pull/6803

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:67212256-cdfe-ec23-da93-179d86cda430
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAC06:3680DC:20E4F7:2E6E19:6AFB6F25
html-safe-nonce7d733224956574915cf8eb85be936db221c38eafbbc9e6d1cb8502a3e3ea1f00
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzA2OjM2ODBEQzoyMEU0Rjc6MkU2RTE5OjZBRkI2RjI1IiwidmlzaXRvcl9pZCI6IjM0NjU3OTUwMDc3MTE3NjgzNTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccd10f89bdd1b8641fc168a415da4192f157f5d6179892f1fd74c9bee6c9e838e
hovercard-subject-tagpull_request:4300496948
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6803/files
twitter:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
og:image:altSummary Follow-up to #6789. That PR fixed the 404 by resolving a file's module context from its stored row instead of its key prefix; this states the contract that fix relies on, so the next re...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release88808b1fae5ab8a526a73e7ce5542a10eb9d6971
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6803/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6803%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6803%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6803/files
Reloadhttps://github.com/simstudioai/sim/pull/6803/files
Reloadhttps://github.com/simstudioai/sim/pull/6803/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
icecrasher321https://github.com/icecrasher321
staginghttps://github.com/simstudioai/sim/tree/staging
fix/mothership-attachment-servehttps://github.com/simstudioai/sim/tree/fix/mothership-attachment-serve
Conversation 3 https://github.com/simstudioai/sim/pull/6803
Commits 1 https://github.com/simstudioai/sim/pull/6803/commits
Checks 30 https://github.com/simstudioai/sim/pull/6803/checks
Files changed https://github.com/simstudioai/sim/pull/6803/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6803/files
improvement(files): make the row the documented owner of module context https://github.com/simstudioai/sim/pull/6803/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/6803/files
4965459 improvement(files): make the row the documented owner of module context Aug 18, 2026 https://github.com/simstudioai/sim/pull/6803/commits/4965459a98218d7624c433e43b6084d6ca31ba99
Clear filters https://github.com/simstudioai/sim/pull/6803/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6803/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6803/files
authorization.test.ts https://github.com/simstudioai/sim/pull/6803/files#diff-dd97e1d4cf0ccbff22fb40938ad04a2ce0aaa6934f2d63500665b6ef46ef5153
authorization.ts https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
route.ts https://github.com/simstudioai/sim/pull/6803/files#diff-5de8408eba335984f30d739706963bb60ea778413ab6a54836d2524ef2b7c968
route.ts https://github.com/simstudioai/sim/pull/6803/files#diff-2e1bb2cb6d37718fb0edc1164a1eea09d303379d4717f3844d00ac38e92d8ae9
metadata.ts https://github.com/simstudioai/sim/pull/6803/files#diff-1de12a134a12569e530e519c085fb87fc17011a093468e8ae4cc6f1c1ff0f370
types.ts https://github.com/simstudioai/sim/pull/6803/files#diff-9fe4883673f33f33785c7e6e3f5757e9329f88d2d6207a9dc82289b5acd3492b
file-utils.ts https://github.com/simstudioai/sim/pull/6803/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
apps/sim/app/api/files/authorization.test.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-dd97e1d4cf0ccbff22fb40938ad04a2ce0aaa6934f2d63500665b6ef46ef5153
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/app/api/files/authorization.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-dd97e1d4cf0ccbff22fb40938ad04a2ce0aaa6934f2d63500665b6ef46ef5153
apps/sim/app/api/files/authorization.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/app/api/files/authorization.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
https://github.com/simstudioai/sim/pull/6803/files#diff-1879aed9b771b6ac07ebc3daa9b658a48d2d3c1a2dda7a79df18adabc99c0a25
apps/sim/app/api/files/parse/route.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-5de8408eba335984f30d739706963bb60ea778413ab6a54836d2524ef2b7c968
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/app/api/files/parse/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-5de8408eba335984f30d739706963bb60ea778413ab6a54836d2524ef2b7c968
https://github.com/simstudioai/sim/pull/6803/files#diff-5de8408eba335984f30d739706963bb60ea778413ab6a54836d2524ef2b7c968
https://github.com/simstudioai/sim/pull/6803/files#diff-5de8408eba335984f30d739706963bb60ea778413ab6a54836d2524ef2b7c968
https://github.com/simstudioai/sim/pull/6803/files#diff-5de8408eba335984f30d739706963bb60ea778413ab6a54836d2524ef2b7c968
apps/sim/app/api/files/serve/[...path]/route.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-2e1bb2cb6d37718fb0edc1164a1eea09d303379d4717f3844d00ac38e92d8ae9
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/app/api/files/serve/%5B...path%5D/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-2e1bb2cb6d37718fb0edc1164a1eea09d303379d4717f3844d00ac38e92d8ae9
https://github.com/simstudioai/sim/pull/6803/files#diff-2e1bb2cb6d37718fb0edc1164a1eea09d303379d4717f3844d00ac38e92d8ae9
apps/sim/lib/uploads/server/metadata.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-1de12a134a12569e530e519c085fb87fc17011a093468e8ae4cc6f1c1ff0f370
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/lib/uploads/server/metadata.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-1de12a134a12569e530e519c085fb87fc17011a093468e8ae4cc6f1c1ff0f370
https://github.com/simstudioai/sim/pull/6803/files#diff-1de12a134a12569e530e519c085fb87fc17011a093468e8ae4cc6f1c1ff0f370
https://github.com/simstudioai/sim/pull/6803/files#diff-1de12a134a12569e530e519c085fb87fc17011a093468e8ae4cc6f1c1ff0f370
https://github.com/simstudioai/sim/pull/6803/files#diff-1de12a134a12569e530e519c085fb87fc17011a093468e8ae4cc6f1c1ff0f370
apps/sim/lib/uploads/shared/types.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-9fe4883673f33f33785c7e6e3f5757e9329f88d2d6207a9dc82289b5acd3492b
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/lib/uploads/shared/types.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-9fe4883673f33f33785c7e6e3f5757e9329f88d2d6207a9dc82289b5acd3492b
https://github.com/simstudioai/sim/pull/6803/files#diff-9fe4883673f33f33785c7e6e3f5757e9329f88d2d6207a9dc82289b5acd3492b
apps/sim/lib/uploads/utils/file-utils.tshttps://github.com/simstudioai/sim/pull/6803/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
View file https://github.com/simstudioai/sim/blob/4965459a98218d7624c433e43b6084d6ca31ba99/apps/sim/lib/uploads/utils/file-utils.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6803/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6803/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
https://github.com/simstudioai/sim/pull/6803/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
https://github.com/simstudioai/sim/pull/6803/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
https://github.com/simstudioai/sim/pull/6803/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
Please reload this pagehttps://github.com/simstudioai/sim/pull/6803/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.