Repository navigation
fix(mothership): let Chat read its own permission config and file version history - #8839
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
…n config and file versions
waleedlatif1
force-pushed
the
fix/chat-own-config-file-versions
branch
from
October 9, 2026 06:11
333a003 to
3ba41c8
Compare
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workspaces permission-configandfiles versions list|describe|read|revertanswered every Chat call with403 This operation is unavailable through Mothership, because their use cases admitted no delegated callerpermission_groups.read_user_confignow admits Copilot delegation (sim:settings) through the same use case. Chat reads the delegating member's own group config in the chat's workspace. The use case resolves the subject user instead of readingprincipal.userIdfiles.versions.list,.read,.read_contentand.revertnow admit Copilot delegation through the existing workspace-file funnel (sim:workspace-files). Chat gets the delegating user's role andfiles.usecapability, pinned to its workspacefiles.versions.delete(irreversible purge) andfiles.versions.download(raw bytes) stay direct-only. The policy comment that deferred delegated version access now records this splitcopilot-refused-routes.jsonregenerated from the route inventory (the source for the CLI'smothershipUnavailableflag): version delete and download stay listed as refusedType of Change
Testing
New
lib/permission-groups/__integration__/copilot-permission-config.integration.ts(real Postgres, Chat's in-process CLI transport, real route and use case): two members each read their own group; a chat pinned to another workspace and a user with no workspace role are both refused with 404NOT_FOUND. Before the fix all 3 failed; after, 3/3 passNew
lib/workspace-files/__integration__/copilot-file-versions.integration.ts(real Postgres, local storage, Chat's composed file-read and scoped transports):[REDACTED_SECRET], and the same read without a provenance registry answers 503INSUFFICIENT_WORKSPACE_ROLEBefore the fix 4 of 5 failed (the direct-only guard passes both ways); after, 5/5 pass
Existing
lib/permission-groups,lib/workspace-files,lib/api/server/routes,app/api/v2/files,app/api/v2/workspaces,lib/mothership/agent-cli,lib/core/applicationsuites pass (session, personal-key, OAuth and workspace-key cases unchanged)bun run lint,bun run type-check,bun run check:audits(58),docs-manifest:check, block-registry check, rootbun run test(one timeout inlib/mothership/agent-cli/services.test.tsunder full-suite load; the file passes on its own and does not touch these operations)Checklist
test-auditauthoring gate)