Skip to content

feat(api): expose organization access and usage operations - #8127

Merged
waleedlatif1 merged 4 commits into
stagingfrom
codex/organization-api-completeness
Sep 22, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
codex/organization-api-completeness

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Expose 21 organization and workspace operations for access requests, invitations, credit caps, usage reporting, and caller permission configuration through the existing authorized application layer.
  • Generate matching API documentation, CLI commands, and MCP operations. Add canonical member user IDs, explicit approval/decline flags, nullable credit caps, and complete invitation batch outcomes.
  • Recheck current permission policy during locked mutations and invitation batches, preserve existing internal responses, and cover pagination, timezone boundaries, and concurrent invitation/access changes in PostgreSQL and CI.

Type of Change

  • New feature

Testing

1,770 backend tests, 1,219 CLI tests, 56 docs tests, 33 generator tests, and 35 local PostgreSQL integration tests passed. All 47 audits, all 26 workspace type checks, lint, generated-artifact checks, and docs-manifest validation passed. Reviewed the complete diff and compared resolved OpenAPI schemas against staging: existing request shapes remain unchanged; workspace member responses add userId.

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)

@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
Image docs Ready Ready Preview Sep 22, 2026 6:09am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no new findings were introduced since the previous review, and all previous findings are resolved.

Summary

Exposes organization and workspace access-management operations through the v2 API, CLI, MCP, and generated documentation.

  • Adds access-request discovery, submission, cancellation, preview, resolution, and settings operations.
  • Adds workspace invitation batching, invitation-workspace listing, member credit-limit management, permission configuration, and organization usage reporting.
  • Strengthens authorization around locked mutations and adds pagination, timezone, concurrency, and PostgreSQL integration coverage.
  • Adds stable member user IDs and updates generated API contracts and documentation.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Client[API / CLI / MCP client] --> Routes[v2 API routes]
  Routes --> Auth[Authorized application operations]
  Auth --> Access[Access request use cases]
  Auth --> Invites[Invitation use cases]
  Auth --> Limits[Member credit-limit use cases]
  Auth --> Usage[Organization usage queries]
  Access --> DB[(PostgreSQL)]
  Invites --> DB
  Limits --> DB
  Usage --> DB
  Contracts[OpenAPI contracts] --> Client
  Contracts --> Docs[Generated documentation]
Loading

Reviews (5) · Last reviewed commit: "fix(workspaces): align detachment with i..."

Comment thread apps/sim/lib/invitations/application/send-invitation-batch.ts

@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 128 files

Not reviewed (too large): apps/docs/openapi-v2-resources.json (~20,237 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/invitations/application/send-invitation-batch.ts
Comment thread apps/sim/lib/billing/application/member-usage-limits/use-cases.ts Outdated
Comment thread apps/sim/lib/billing/application/organization-usage/event-cursor.ts
Comment thread apps/sim/lib/api/contracts/organization-usage.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

Comment thread apps/sim/lib/billing/application/member-usage-limits/use-cases.ts Outdated

@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 132 files

Not reviewed (too large): apps/docs/openapi-v2-resources.json (~20,237 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/billing/organizations/member-limits.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 134 files

Not reviewed (too large): apps/docs/openapi-v2-resources.json (~20,237 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/workspaces/organization-workspaces.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

Comment thread apps/sim/app/api/v1/admin/organizations/[id]/route.ts

@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 137 files

Not reviewed (too large): apps/docs/openapi-v2-resources.json (~20,237 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/app/api/v1/admin/organizations/[id]/route.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 137 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Not reviewed (too large): apps/docs/openapi-v2-resources.json (~20,237 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

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.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 96b941f into staging Sep 22, 2026
34 of 35 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/organization-api-completeness branch September 22, 2026 06:18

This branch was successfully deployed

1 active deployment
Preview 5e4d6424 Deployed Sep 22, 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