Skip to content

Rename organization to team - #99

Open
purpshell wants to merge 3 commits into
mainfrom
team-rename-20261112
Open

purpshell wants to merge 3 commits into
mainfrom
team-rename-20261112

Conversation

@purpshell

@purpshell purpshell commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Renames "organization" to "team" across the CLI. Greenfield: no deprecated aliases or shims.

Tracks contract revision 61610853b4 of polymorfa/polymorfa#887.
Depends on the polymorfa/sdks team-rename PR (organizationApiKey → teamApiKey, OrganizationClient → TeamClient, organizations → teams, validateOrganizationApiKey → validateTeamApiKey, ClientInstance<'organization'> → ClientInstance<'team'>).
Must merge after #887 and the SDK PR. package.json still pins the current published @polymorfa/sdk; it must be bumped to the SDK release that carries the rename before this merges. Nothing is published here.

Renamed surface

  • --owner organization → --owner team (every command that takes --owner; value choices are now project|team)
  • Stored profile key organization → team
  • Output/JSON: principalType organization_key → team_key, organizationId → teamId, resource owner organization → team
  • Listener frame field organizationId → teamId
  • SDK credential type organizationApiKey → teamApiKey
  • Help text, errors, README, skills and docs
  • Fixture IDs org_* → team_*
  • No commands, subcommands or environment variables were named org/organization in this repo (credentials use POLYMORFA_API_KEY), so none changed.

Kept (not the tenant): message send contact --organization (vCard ORG: company field), npm/GitHub organization wording in internal/npm-prerelease.md, .org URLs.

Reference artifact

contracts/cli-reference.json regenerated (npm run docs:reference, 381 commands) for the docs app's sync-cli-reference.mjs.

Five-part assessment

  • API: unaffected at runtime beyond the wire names; the CLI now sends/reads teamId, team_key, bansafe_team_suspended, teams routes through the SDK. contracts/abprops-capabilities.json updated for the renamed error code.
  • SDKs: blocked on the polymorfa/sdks team-rename PR and its release. Code uses the new public names. Verified against a locally renamed copy of the pinned SDK, not the real release.
  • CLI: updated (this PR).
  • Docs: updated README, skills, docs/ and the reference artifact. The public Mintlify CLI reference in polymorfa/polymorfa syncs from contracts/cli-reference.json after this merges; not yet synced.
  • Feature releases: unaffected: no feature flag, entitlement or rollout changes; availability follows #887's release plan.

Verification

  • tsc typecheck, eslint ., prettier --check: clean
  • vitest run: 1169/1169 pass (with --maxWorkers=3 --testTimeout=30000; the default run shows load-related 5s timeouts on a busy machine)
  • npm run docs:reference: regenerated
  • Not run: verify:browser, verify:bundled-runtime, npm pack, audit:prod, and a build against the real renamed SDK release.
  • Final grep for \borg(anization)?s?\b|orgId|organizationId|organization_api_key|ORG_KEY|--org\b: remaining hits are only the vendor/non-tenant items listed above plus .org URLs (registry.npmjs.org).

Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Contract and dependency status (2026-11-12)

  • polymorfa/polymorfa#887 merged into dev as a3db53e74c6e24507ca01e2ff6ecba19358422c7. Its specs are identical to contract revision f180dc1ee2.
  • Rename organization to team across the SDKs sdks#372 merged into main as 6f4afba13d48ba55356def32b6aa1aa2f169f5a7.
  • Blocked: CI compiles against the published @polymorfa/sdk, which still exports the organization names (validateOrganizationApiKey, Client<'organization'>). No SDK release with the team names exists yet. The nightly publish (publish-dev.yml) builds only after staging acceptance passes for the API commit pinned in the SDK's contracts/source.json, which needs #887 deployed to staging. Once a nightly 0.x.y-dev.<timestamp> is published, bump the exact @polymorfa/* versions here, rerun CI, and merge.

Current state (2026-11-16)

  • Merged origin/main at 088ea9e522a3138134bfe336cdbc1cfdbb3f550d (ordinary merge, no conflicts). Head: a79c8731953c82727eb251891577d0cce0f5b49f.
  • Team rename applied to what main added: organizationId → teamId in the newsletter-observation test; contracts/business-account-modes.json re-synced to API a3db53e74c (team wording, bansafe_team_suspended); contracts/cli-reference.json regenerated (390 commands).
  • Test credential fixtures now use valid opaque shapes (checksummed pmfa_ / pmfa_pt_, canonical pmfa_ct_), which SDK source validates; the expected SDK wording ("opaque format", "team keys") replaces the old text.
  • Verified against polymorfa/sdks main at ccc8eebab8 (includes #372 6f4afba13d), built locally and linked into node_modules only (not committed): typecheck, eslint ., prettier --check, npm run build, cli-reference --check, verify:browser, npm pack --dry-run, audit:prod and script tests pass. vitest run: 1233/1236 pass. The 3 failures (campaign-experiments.test.ts, missing Template row in expected output) also fail on unmodified origin/main and are unrelated to the rename.
  • verify:bundled-runtime installs the published SDK and fails with validateTeamApiKey missing, as expected until a renamed SDK is published.
  • Still blocked on a published @polymorfa/sdk containing Rename organization to team across the SDKs sdks#372. The SDK nightly is refused daily by the release-gate hold ("Guest calls are held from publication until API source acceptance"); a manual preview channel is pending in Add manual SDK preview releases without API acceptance sdks#376. The CLI's release scripts accept only an accepted nightly (-dev.<digits>, npm dev tag, staging receipt) or stable release; a preview version is not accepted for CLI publication. Bump the exact SDK version in package.json/package-lock.json once a suitable release exists.
  • CI on this head fails ("Verify Node 22", "Windows agent process lifecycle") only on SDK type errors from the published SDK (validateTeamApiKey, Client<"team">, ClientOwner).

Tracks contract revision 61610853b4 of polymorfa/polymorfa#887. Renames the
--owner value, profile key, principal type, output fields, SDK credential and
client names, help text, README, skills and tests. No aliases or shims.
Regenerates contracts/cli-reference.json.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 34953a12-ecc9-4883-9fe4-376276fe8201
Commits

Reviewing files that changed from the base of the PR and between 088ea9e and a79c873.

Files selected for processing: 160

  • README.md
  • contracts/abprops-capabilities.json
  • contracts/business-account-modes.json
  • contracts/cli-reference.json
  • docs/command-research/business-app.md
  • docs/command-research/call-consent.md
  • docs/command-research/calls-lids-users.md
  • docs/command-research/calls.md
  • docs/command-research/campaigns.md
  • docs/command-research/customers.md
  • docs/command-research/developer-events-webhooks.md
  • docs/command-research/platform-management.md
  • docs/command-research/quicklinks.md
  • docs/command-research/voice.md
  • docs/development/bansafe-sdk-integration.md
  • docs/superpowers/plans/2026-08-19-cli-foundation-and-api.md
  • docs/superpowers/specs/2026-08-19-polymorfa-cli-design.md
  • package.json
  • scripts/verify-browser.mjs
  • skills/polymorfa/SKILL.md
  • src/base-command.ts
  • src/commands/analytics/get.ts
  • src/commands/analytics/metrics.ts
  • src/commands/audit-log/list.ts
  • src/commands/auth/login.ts
  • src/commands/auth/status.ts
  • src/commands/billing/limits/list.ts
  • src/commands/billing/limits/set.ts
  • src/commands/billing/priority/list.ts
  • src/commands/billing/priority/reorder.ts
  • src/commands/billing/priority/set.ts
  • src/commands/calls/export.ts
  • src/commands/calls/opt-outs/add.ts
  • src/commands/calls/opt-outs/import.ts
  • src/commands/calls/opt-outs/list.ts
  • src/commands/calls/opt-outs/remove.ts
  • src/commands/calls/policy/get.ts
  • src/commands/calls/policy/set.ts
  • src/commands/calls/stats.ts
  • src/commands/key/list.ts
  • src/commands/key/revoke.ts
  • src/commands/listen.ts
  • src/commands/member/list.ts
  • src/commands/optout/settings/update.ts
  • src/commands/optout/settings/view.ts
  • src/commands/security-incident/list.ts
  • src/commands/session-ban/list.ts
  • src/commands/session/list.ts
  • src/commands/session/status.ts
  • src/commands/session/view.ts
  • src/commands/webhook/test.ts
  • src/commands/widget/update.ts
  • src/commands/widget/view.ts
  • src/config/profiles.ts
  • src/context/environment.ts
  • src/context/owner.ts
  • src/developer/client.ts
  • src/developer/render.ts
  • src/functions/command.ts
  • src/listener/frames.ts
  • src/mcp/server.ts
  • src/mcp/session-discovery.ts
  • src/output/contracts.ts
  • src/sdk/client.ts
  • src/services/audiences.ts
  • src/services/auth.ts
  • src/services/bansafe.ts
  • src/services/billing-controls.ts
  • src/services/call-analytics.ts
  • src/services/call-consent.ts
  • src/services/campaign-conversions.ts
  • src/services/campaign-frequency-cap.ts
  • src/services/campaign-segments-drip.ts
  • src/services/customers.ts
  • src/services/doctor.ts
  • src/services/init-starter.ts
  • src/services/number-tiers.ts
  • src/services/opt-outs.ts
  • src/services/platform-management.ts
  • src/services/projects.ts
  • src/services/usage.ts
  • test/browser/run.test.ts
  • test/commands/analytics.test.ts
  • test/commands/api-gh.test.ts
  • test/commands/api.test.ts
  • test/commands/audience-profiles.test.ts
  • test/commands/audiences-optouts.test.ts
  • test/commands/auth.test.ts
  • test/commands/bansafe.test.ts
  • test/commands/billing-controls.test.ts
  • test/commands/business-account-modes.test.ts
  • test/commands/business.test.ts
  • test/commands/call-analytics.test.ts
  • test/commands/call-consent.test.ts
  • test/commands/call-links.test.ts
  • test/commands/call-records.test.ts
  • test/commands/calls-and-identities.test.ts
  • test/commands/calls-sockets.test.ts
  • test/commands/calls.test.ts
  • test/commands/campaign-conversions.test.ts
  • test/commands/campaign-experiments.test.ts
  • test/commands/campaign-follow-ups.test.ts
  • test/commands/campaign-frequency-cap.test.ts
  • test/commands/campaign-recipients.test.ts
  • test/commands/campaign-segments-drip.test.ts
  • test/commands/campaigns.test.ts
  • test/commands/channels.test.ts
  • test/commands/cloud-group.test.ts
  • test/commands/cloud.test.ts
  • test/commands/contacts.test.ts
  • test/commands/customers.test.ts
  • test/commands/developer-webhooks.test.ts
  • test/commands/doctor.test.ts
  • test/commands/event-stream.test.ts
  • test/commands/events.test.ts
  • test/commands/flow-endpoints.test.ts
  • test/commands/flows.test.ts
  • test/commands/functions.test.ts
  • test/commands/group-mutations.test.ts
  • test/commands/groups.test.ts
  • test/commands/history.test.ts
  • test/commands/hybrid-credentials.test.ts
  • test/commands/hybrid-link.test.ts
  • test/commands/labels.test.ts
  • test/commands/listen.test.ts
  • test/commands/media.test.ts
  • test/commands/message-sends.test.ts
  • test/commands/messages.test.ts
  • test/commands/newsletter-observations.test.ts
  • test/commands/number-tiers.test.ts
  • test/commands/operations.test.ts
  • test/commands/platform-management.test.ts
  • test/commands/presence.test.ts
  • test/commands/privacy.test.ts
  • test/commands/profile.test.ts
  • test/commands/project-context.test.ts
  • test/commands/quick-replies.test.ts
  • test/commands/quicklinks.test.ts
  • test/commands/request-logs.test.ts
  • test/commands/sip-trunks.test.ts
  • test/commands/trigger.test.ts
  • test/commands/usage.test.ts
  • test/commands/voice-wait-timeout.test.ts
  • test/commands/voice.test.ts
  • test/config/profiles.test.ts
  • test/context/environment.test.ts
  • test/context/owner.test.ts
  • test/developer/client.test.ts
  • test/developer/output.test.ts
  • test/input/stdin.test.ts
  • test/listener/frames.test.ts
  • test/listener/session.test.ts
  • test/mcp/session-discovery.test.ts
  • test/sdk/client.test.ts
  • test/services/auth.test.ts
  • test/services/call-consent.test.ts
  • test/services/doctor.test.ts
  • test/services/groups.test.ts
  • test/services/projects.test.ts
  • test/services/voice.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T20:37:07.653539Z a79c873 Manual request
🔒 Security Review ✅ Completed 2026-11-16T20:38:39.910696Z a79c873 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f63032bb5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config/profiles.ts Resolved
Rename the newsletter observation fixture to teamId, sync the Business
account-mode contract to API a3db53e74c (team wording), regenerate the CLI
reference, and use credential fixtures with valid opaque shapes so tests run
against the SDK source that validates them.
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@purpshell

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: a79c873195

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: a79c873195

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: a79c873195

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@purpshell

Copy link
Copy Markdown
Member Author

Dependency status, 2026-11-17

A renamed SDK now exists on the preview channel: @polymorfa/sdk@0.1.0-preview.20261116213644 (preview tag, source 2966d921, API acceptance not verified). I pinned it locally on this head:

  • Pass: npm ci, format, lint, typecheck, build, the CLI reference check, the script tests and verify:browser. The SDK type errors are gone.
  • Fail: three test/release/check-prerelease.test.ts cases. scripts/check-prerelease.mjs accepts only an SDK matching ^0\.\d+\.\d+-dev\.\d+$, and those tests check the real manifest and lockfile, so npm test and PR CI fail with a preview pin.
  • Also fail: three campaign-experiments.test.ts cases, which fail the same way on unmodified main.

I have not pushed the preview pin, and I have not changed the guard. To land this PR, one of these is needed:

  1. A published 0.x.y-dev.N SDK carrying Rename organization to team across the SDKs sdks#372. The nightly is currently refused by the guest-call release hold and needs API staging acceptance.
  2. A release-policy decision from the CLI release owner to let this repository depend on a preview SDK. That means widening check-prerelease.mjs and its tests, while CLI publication keeps requiring an accepted SDK.

CLI publication is already refused today ("SDK publication with matching API acceptance must finish first"), independent of this PR.

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