Skip to content

feat!: rename credentials mode "auth0" to "oauth" - #188

Merged
soleil-colza merged 1 commit into
mainfrom
eng-723
Jul 11, 2026
Merged

feat!: rename credentials mode "auth0" to "oauth"#188
soleil-colza merged 1 commit into
mainfrom
eng-723

Conversation

@soleil-colza

@soleil-colza soleil-colza commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Renames the OAuth-side identifier in ~/.arkor/credentials.json from the vendor-named mode: "auth0" to the protocol-named mode: "oauth" (ENG-723).

Breaking change. No migration from the old value is provided; in the worst case an OAuth user recovers by re-running arkor login --oauth, which rewrites the credentials file with the new tag.

Renamed alongside the tag value

  • Public SDK type Auth0CredentialsOAuthCredentials (exported from arkor)
  • Telemetry authMode / auth_mode value "auth0""oauth"
  • AUTH0_MISSING_STATE_MESSAGEOAUTH_MISSING_STATE_MESSAGE (message copy unchanged)
  • Studio header identity label auth0oauth
  • Docs (EN/JA): cli/auth, concepts/project-structure, studio/overview, sdk/overview
  • packages/arkor/README.md: telemetry auth_mode enum and the CLI table row
  • Test fixtures / titles / comments across 9 test files

Deliberately unchanged (Auth0 vendor references, not mode names)

  • Persisted auth0Domain field and the core/auth0.ts module (PKCE flow against the Auth0 tenant)
  • Auth0-branded error copy ("Auth0 token exchange failed", "Auth0 did not return a refresh token", loopback-port hint)
  • JWT sub fixtures (auth0|user-123) in telemetry tests
  • runAuth0Login (drives the Auth0-specific PKCE flow, same boundary as auth0.ts)

Verification

  • Unit tests: arkor 401, studio-app 199, all passing; typecheck and lint (oxlint + ESLint) clean across all packages; oxfmt --check clean
  • Built artifacts inspected: dist/bin.mjs and the bundled Studio SPA contain zero mode-level auth0 literals; remaining auth0 strings are the vendor contexts listed above
  • Studio E2E (Playwright): 9/9 passing against the rebuilt dist/bin.mjs, including the /api/* token and host-header guard contract specs
  • git grep -i auth0 over all tracked files triaged to completion: every surviving occurrence is a deliberate vendor reference

Summary by cubic

Rename the credentials mode from "auth0" to "oauth" across CLI, SDK, Studio, and telemetry to align with protocol naming (ENG-723). This breaks existing ~/.arkor/credentials.json; re-login is required.

  • Refactors

    • Credentials tag mode: "auth0"mode: "oauth"; telemetry authMode/auth_mode updated to "oauth".
    • SDK type Auth0CredentialsOAuthCredentials (exported from arkor).
    • AUTH0_MISSING_STATE_MESSAGEOAUTH_MISSING_STATE_MESSAGE; Studio header now shows oauth.
    • Docs updated (EN/JA) and tests aligned.
    • Auth0 vendor references remain (e.g., auth0Domain, core/auth0.ts, error strings).
  • Migration

    • Update imports to OAuthCredentials.
    • Run arkor login --oauth to rewrite credentials with mode: "oauth".
    • No automatic migration from files with mode: "auth0".

Written for commit 5028ccb. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation

    • Updated authentication terminology from “Auth0” to “OAuth” across English and Japanese guides.
    • Clarified OAuth credential modes, telemetry values, Studio identity labels, and SDK type references.
  • Bug Fixes

    • OAuth credentials are now consistently recognized and displayed as oauth.
    • Improved missing project-state guidance for OAuth-based deployment workflows.
  • API

    • Renamed the public credentials type to OAuthCredentials.

Breaking change to ~/.arkor/credentials.json: the OAuth login path now
tags credentials with mode: "oauth" instead of the vendor-named
mode: "auth0". No migration from the old value is provided; in the
worst case an OAuth user recovers by re-running `arkor login --oauth`,
which rewrites the credentials file with the new tag.

Renamed alongside the tag value for consistency:
- public SDK type Auth0Credentials -> OAuthCredentials
- telemetry authMode / auth_mode value "auth0" -> "oauth"
- AUTH0_MISSING_STATE_MESSAGE -> OAUTH_MISSING_STATE_MESSAGE
- Studio header identity label auth0 -> oauth
- docs (EN/JA): cli/auth, concepts/project-structure, studio/overview,
  sdk/overview

References to the Auth0 vendor itself are unchanged: the persisted
auth0Domain field, core/auth0.ts, PKCE / token-exchange error copy,
and JWT sub fixtures (auth0|user-123) in tests.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The change replaces Auth0-specific credential terminology with OAuth terminology across credential types, persisted mode values, telemetry, project-state errors, Studio handling, tests, and English/Japanese documentation.

Changes

OAuth credential migration

Layer / File(s) Summary
OAuth credential contract
packages/arkor/src/core/credentials.ts, packages/arkor/src/index.ts, packages/studio-app/src/lib/api.ts, docs/.../sdk/overview.mdx
Renames Auth0Credentials to OAuthCredentials, changes the credential mode to "oauth", and updates public type references.
Credential creation and storage behavior
packages/arkor/src/core/auth0.ts, packages/arkor/src/core/credentials.test.ts, packages/arkor/src/cli/commands/*test.ts
OAuth exchange results, credential fixtures, login assertions, URL resolution, and authorization tests now use mode: "oauth".
OAuth project-state and Studio handling
packages/arkor/src/core/projectState.*, packages/arkor/src/studio/*, packages/studio-app/src/components/..., packages/studio-app/src/pages/...
Renames the missing-state error constant and updates Studio deployment handling, identity display, comments, and related tests to OAuth terminology.
OAuth telemetry identity
packages/arkor/src/core/telemetry.*, packages/arkor/README.md
Telemetry auth-mode unions and identity results now use "oauth" while retaining JWT sub extraction and fallback IDs.
CLI and product documentation alignment
docs/cli/*, docs/concepts/*, docs/studio/*, packages/arkor/README.md
English and Japanese documentation now describe OAuth credentials, OAuth PKCE, the "oauth" mode, and the OAuth token subject used for identity.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 100.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely matches the main breaking change: renaming the credentials mode from auth0 to oauth.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eng-723
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch eng-723

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Jul 10, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/arkor

The overall coverage remains at 99%, unchanged from the main branch.

TypeScript / code-coverage/create-arkor

The overall coverage remains at 56%, unchanged from the main branch.

TypeScript / code-coverage/cli-internal

The overall coverage remains at 97%, unchanged from the main branch.

TypeScript / code-coverage/studio-app

The overall coverage remains at 53%, unchanged from the main branch.


Updated July 10, 2026 22:16 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../studio-app/src/components/layout/IdentityChip.tsx 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@drift-check drift-check 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.

Documentation drift

Code Review Bot flagged 1 possible documentation drift(s). These are advisory.

  • AGENTS.md (info): The code changes rename the authentication mode 'auth0' to 'oauth' in the Studio app's API and UI logic, but the documentation doesn't explicitly mention this specific string, so it's a minor terminology drift. However, since this is a change in a core concept (Auth0 -> OAuth), it's worth noting if the documentation ever references Auth0. Looking at the provided AGENTS.md, it doesn't mention Auth0, but the change is a conceptual shift in the codebase. Wait, the prompt asks if the CURRENT documentation is inaccurate. AGENTS.md does not mention 'auth0' or 'oauth'. Therefore, it is not inaccurate.

Results are for commit 5028ccb. On newer commits, the bot's summary comment reflects the latest run.

@drift-check

drift-check Bot commented Jul 10, 2026

Copy link
Copy Markdown

Code Review Bot

Documentation drift

Found 1 possible documentation drift(s) — see the bot's latest pull request review for details. These are advisory.

Reviewed 26 file(s); skipped 0.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR renames the OAuth credential mode from auth0 to oauth. The main changes are:

  • Updated credential types and persisted OAuth mode values.
  • Updated telemetry, Studio labels, and API typings to use oauth.
  • Renamed related missing-state constants and tests.
  • Updated English and Japanese docs for the new mode name.

Confidence Score: 5/5

The changed flow looks mergeable after small cleanup for legacy credential diagnostics.

  • New logins and internal callers use the new oauth mode consistently.
  • Existing auth0 credential files can still reach UI and telemetry paths without normalization.
  • The remaining issues affect labeling and telemetry, not token use or access control.

packages/studio-app/src/components/layout/IdentityChip.tsx; packages/arkor/src/core/telemetry.ts

Important Files Changed

Filename Overview
packages/arkor/src/core/credentials.ts Renames the OAuth credential interface and discriminator to OAuthCredentials and mode: "oauth".
packages/arkor/src/core/auth0.ts Updates the Auth0-backed PKCE exchange wrapper to persist the new OAuth mode string.
packages/arkor/src/core/telemetry.ts Updates telemetry mode values to oauth, with a remaining legacy credential misclassification path.
packages/arkor/src/index.ts Replaces the public Auth0Credentials type export with OAuthCredentials.
packages/arkor/src/core/projectState.ts Renames the OAuth missing-state constant while keeping the same non-anonymous guard behavior.
packages/arkor/src/studio/server.ts Updates the renamed missing-state import and keeps passing credential mode values through to the SPA.
packages/studio-app/src/lib/api.ts Updates the Studio credentials type to the new oauth discriminator.
packages/studio-app/src/components/layout/IdentityChip.tsx Updates the Studio identity label to show oauth, with a remaining legacy credential display mismatch.

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/studio-app/src/components/layout/IdentityChip.tsx:46
**Legacy OAuth Sessions Look Anonymous**

When Studio reads an existing credentials file with `mode: "auth0"`, `/api/credentials` passes that mode through while still using the OAuth access token. This branch treats every non-`oauth` mode as anonymous, so an upgraded OAuth user can be shown as `anonymous` until they re-run login.

```suggestion
  const modeLabel = creds.mode === "anon" ? "anonymous" : "oauth";
```

### Issue 2 of 2
packages/arkor/src/core/telemetry.ts:138-142
**Legacy OAuth Telemetry Becomes None**

Existing `mode: "auth0"` credentials still have the OAuth `accessToken` shape, but this check skips them and falls through to `authMode: "none"`. Upgraded OAuth users can therefore emit unauthenticated telemetry until they re-run `arkor login --oauth`.

Reviews (1): Last reviewed commit: "feat!: rename credentials mode "auth0" t..." | Re-trigger Greptile

);
}
const modeLabel = creds.mode === "auth0" ? "auth0" : "anonymous";
const modeLabel = creds.mode === "oauth" ? "oauth" : "anonymous";

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.

P2 Legacy OAuth Sessions Look Anonymous

When Studio reads an existing credentials file with mode: "auth0", /api/credentials passes that mode through while still using the OAuth access token. This branch treats every non-oauth mode as anonymous, so an upgraded OAuth user can be shown as anonymous until they re-run login.

Suggested change
const modeLabel = creds.mode === "oauth" ? "oauth" : "anonymous";
const modeLabel = creds.mode === "anon" ? "anonymous" : "oauth";
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/studio-app/src/components/layout/IdentityChip.tsx
Line: 46

Comment:
**Legacy OAuth Sessions Look Anonymous**

When Studio reads an existing credentials file with `mode: "auth0"`, `/api/credentials` passes that mode through while still using the OAuth access token. This branch treats every non-`oauth` mode as anonymous, so an upgraded OAuth user can be shown as `anonymous` until they re-run login.

```suggestion
  const modeLabel = creds.mode === "anon" ? "anonymous" : "oauth";
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Comment on lines +138 to 142
if (creds?.mode === "oauth") {
const sub = decodeJwtSub(creds.accessToken);
if (sub) return { distinctId: sub, authMode: "auth0" };
return { distinctId: readOrCreateTelemetryId(), authMode: "auth0" };
if (sub) return { distinctId: sub, authMode: "oauth" };
return { distinctId: readOrCreateTelemetryId(), authMode: "oauth" };
}

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.

P2 Legacy OAuth Telemetry Becomes None

Existing mode: "auth0" credentials still have the OAuth accessToken shape, but this check skips them and falls through to authMode: "none". Upgraded OAuth users can therefore emit unauthenticated telemetry until they re-run arkor login --oauth.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/arkor/src/core/telemetry.ts
Line: 138-142

Comment:
**Legacy OAuth Telemetry Becomes None**

Existing `mode: "auth0"` credentials still have the OAuth `accessToken` shape, but this check skips them and falls through to `authMode: "none"`. Upgraded OAuth users can therefore emit unauthenticated telemetry until they re-run `arkor login --oauth`.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/arkor/src/core/auth0.ts`:
- Line 4: Handle legacy mode: "auth0" credentials in readCredentials() or
ensureCredentials(): detect the stale discriminant before credentials flow
through unchanged, then either migrate them to the current credential shape or
explicitly reject them with a clear message instructing the user to log in
again.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ce573d91-3d9f-44c7-9ab2-93cef9a3f007

📥 Commits

Reviewing files that changed from the base of the PR and between b3a12e0 and 5028ccb.

📒 Files selected for processing (26)
  • docs/cli/auth.mdx
  • docs/concepts/project-structure.mdx
  • docs/ja/cli/auth.mdx
  • docs/ja/concepts/project-structure.mdx
  • docs/ja/sdk/overview.mdx
  • docs/ja/studio/overview.mdx
  • docs/sdk/overview.mdx
  • docs/studio/overview.mdx
  • packages/arkor/README.md
  • packages/arkor/src/cli/commands/login.test.ts
  • packages/arkor/src/cli/commands/whoami.test.ts
  • packages/arkor/src/core/auth0.test.ts
  • packages/arkor/src/core/auth0.ts
  • packages/arkor/src/core/client.test.ts
  • packages/arkor/src/core/credentials.test.ts
  • packages/arkor/src/core/credentials.ts
  • packages/arkor/src/core/projectState.test.ts
  • packages/arkor/src/core/projectState.ts
  • packages/arkor/src/core/telemetry.test.ts
  • packages/arkor/src/core/telemetry.ts
  • packages/arkor/src/index.ts
  • packages/arkor/src/studio/server.test.ts
  • packages/arkor/src/studio/server.ts
  • packages/studio-app/src/components/layout/IdentityChip.tsx
  • packages/studio-app/src/lib/api.ts
  • packages/studio-app/src/pages/Endpoints.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (176)
  • GitHub Check: CodeRabbit
  • GitHub Check: install · yarn-berry · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.0.0
  • GitHub Check: install · npm · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-10 · windows-latest · node 22.22.0
  • GitHub Check: install · bun · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · bun · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 22.22.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn-berry · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-11 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · windows-latest · node 22.22.0
  • GitHub Check: install · yarn · ubuntu-latest · node 26.0.0
  • GitHub Check: install · npm · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn · ubuntu-latest · node 24.12.0
  • GitHub Check: install · yarn · ubuntu-latest · node 24.0.0
  • GitHub Check: install · bun · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn-berry · ubuntu-latest · node 24.12.0
  • GitHub Check: install · pnpm-9 · ubuntu-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · ubuntu-latest · node 24.12.0
  • GitHub Check: install · npm · ubuntu-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: install · bun · ubuntu-latest · node 24.0.0
  • GitHub Check: install · npm · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · ubuntu-latest · node 22.22.0
  • GitHub Check: install · pnpm-10 · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-10 · ubuntu-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · ubuntu-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · ubuntu-latest · node 22.22.0
  • GitHub Check: install · pnpm-11 · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · ubuntu-latest · node 22.22.0
  • GitHub Check: install · npm · ubuntu-latest · node 22.22.0
  • GitHub Check: Seer Code Review
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 22.22.0
  • GitHub Check: coverage · upload to Codecov
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: install · bun · macos-latest · node 26.0.0
  • GitHub Check: install · yarn · macos-latest · node >=26.0.0 <27
  • GitHub Check: install · npm · macos-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · macos-latest · node >=26.0.0 <27
  • GitHub Check: install · npm · macos-latest · node 26.0.0
  • GitHub Check: install · pnpm-10 · macos-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · macos-latest · node 26.0.0
  • GitHub Check: install · pnpm-11 · macos-latest · node 26.0.0
  • GitHub Check: install · pnpm-9 · macos-latest · node 26.0.0
  • GitHub Check: install · bun · macos-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-11 · macos-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn · macos-latest · node >=24.12.0 <25
  • GitHub Check: install · bun · macos-latest · node 24.12.0
  • GitHub Check: install · bun · macos-latest · node 24.0.0
  • GitHub Check: install · yarn · macos-latest · node 22.22.0
  • GitHub Check: install · yarn · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · macos-latest · node 24.12.0
  • GitHub Check: install · yarn · macos-latest · node 24.12.0
  • GitHub Check: install · pnpm-10 · macos-latest · node 22.22.0
  • GitHub Check: install · pnpm-11 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · macos-latest · node 22.22.0
  • GitHub Check: install · npm · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn · windows-latest · node 26.0.0
  • GitHub Check: install · bun · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · bun · macos-latest · node 22.22.0
  • GitHub Check: install · yarn · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-9 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · windows-latest · node 26.0.0
  • GitHub Check: install · npm · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-9 · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-10 · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · bun · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · npm · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 26.0.0
  • GitHub Check: install · npm · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · bun · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · npm · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 24.12.0
  • GitHub Check: install · bun · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 24.0.0
  • GitHub Check: install · yarn · windows-latest · node 24.0.0
  • GitHub Check: install · yarn · windows-latest · node 24.12.0
  • GitHub Check: install · npm · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · npm · windows-latest · node 22.22.0
  • GitHub Check: install · yarn · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 22.22.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-10 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn-berry · windows-latest · node 22.22.0
  • GitHub Check: install · bun · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · bun · windows-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 22.22.0
  • GitHub Check: coverage · upload to Codecov
🧰 Additional context used
📓 Path-based instructions (8)
docs/**/*.{mdx,md}

📄 CodeRabbit inference engine (AGENTS.md)

If you edit English docs under docs/, update the corresponding Japanese mirror under docs/ja/ in the same change.

Files:

  • docs/studio/overview.mdx
  • docs/sdk/overview.mdx
  • docs/ja/concepts/project-structure.mdx
  • docs/ja/sdk/overview.mdx
  • docs/cli/auth.mdx
  • docs/concepts/project-structure.mdx
  • docs/ja/cli/auth.mdx
  • docs/ja/studio/overview.mdx
**/*.mdx

📄 CodeRabbit inference engine (AGENTS.md)

Do not assume GitHub-style heading slugging in Mintlify docs; verify rendered heading ids before adding or changing cross-page anchor links.

Files:

  • docs/studio/overview.mdx
  • docs/sdk/overview.mdx
  • docs/ja/concepts/project-structure.mdx
  • docs/ja/sdk/overview.mdx
  • docs/cli/auth.mdx
  • docs/concepts/project-structure.mdx
  • docs/ja/cli/auth.mdx
  • docs/ja/studio/overview.mdx
**

⚙️ CodeRabbit configuration file

**: # Arkor Development Guide

Note: Claude Code automatically loads this file.

Repository shape

pnpm + Turbo monorepo. Workspaces are declared in pnpm-workspace.yaml (packages/*, e2e/*, examples/*, docs).

Path Role
packages/arkor Published arkor SDK + CLI + bundled local Studio server (Hono). bin/arkordist/bin.mjs. Library entry → dist/index.mjs.
packages/create-arkor Published create-arkor scaffolder (pnpm create arkor).
packages/cli-internal Private workspace package. Source is bundled into arkor and create-arkor via tsdown's deps.alwaysBundle. Never appears as a runtime dependency on npm.
packages/studio-app Private Vite + React 19 SPA. pnpm --filter @arkor/studio-app bundle builds it; packages/arkor/scripts/copy-studio-assets.mjs copies dist/ into packages/arkor/dist/assets/.
e2e/cli Private vitest suite that spawns the built dist/bin.mjs of both CLIs in temp dirs.
e2e/studio Private Playwright suite that spawns arkor dev against an in-process fake cloud-api and drives the Studio SPA in Chromium.
examples/doc-drift Private use-case example: documentation drift check against an Arkor deployment (zero-dependency script + copy-me workflow).
docs Mintlify sources for docs.arkor.ai.

Common commands

Root scripts fan out via Turbo (which respects ^build deps in turbo.json):

pnpm install
pnpm build          # turbo run build across all packages
pnpm typecheck      # tsc --noEmit across all packages
pnpm lint           # oxlint --deny-warnings, then strict ESLint 10 (single root config each)
pnpm format         # oxfmt --write across the repo (config in oxfmt.config.ts)
pnpm format:check   # oxfmt --check; CI gates on this (no wri...

Files:

  • docs/studio/overview.mdx
  • packages/arkor/src/index.ts
  • packages/studio-app/src/lib/api.ts
  • packages/arkor/src/core/client.test.ts
  • docs/sdk/overview.mdx
  • docs/ja/concepts/project-structure.mdx
  • packages/arkor/src/core/auth0.test.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • docs/ja/sdk/overview.mdx
  • packages/arkor/src/cli/commands/whoami.test.ts
  • packages/studio-app/src/components/layout/IdentityChip.tsx
  • docs/cli/auth.mdx
  • packages/arkor/src/core/projectState.test.ts
  • docs/concepts/project-structure.mdx
  • packages/arkor/README.md
  • packages/arkor/src/core/auth0.ts
  • packages/arkor/src/core/projectState.ts
  • docs/ja/cli/auth.mdx
  • packages/arkor/src/core/credentials.ts
  • packages/arkor/src/cli/commands/login.test.ts
  • packages/arkor/src/core/telemetry.ts
  • packages/arkor/src/studio/server.ts
  • packages/arkor/src/studio/server.test.ts
  • docs/ja/studio/overview.mdx
  • packages/arkor/src/core/credentials.test.ts
  • packages/arkor/src/core/telemetry.test.ts
packages/arkor/src/**/*.{ts,mts,cts}

📄 CodeRabbit inference engine (AGENTS.md)

When touching the Studio server or SPA fetch layer, preserve the token-in-header flow for fetch, the studioToken query parameter for EventSource, the host-header allow-list, no CORS, and timing-safe token comparison.

Files:

  • packages/arkor/src/index.ts
  • packages/arkor/src/core/client.test.ts
  • packages/arkor/src/core/auth0.test.ts
  • packages/arkor/src/cli/commands/whoami.test.ts
  • packages/arkor/src/core/projectState.test.ts
  • packages/arkor/src/core/auth0.ts
  • packages/arkor/src/core/projectState.ts
  • packages/arkor/src/core/credentials.ts
  • packages/arkor/src/cli/commands/login.test.ts
  • packages/arkor/src/core/telemetry.ts
  • packages/arkor/src/studio/server.ts
  • packages/arkor/src/studio/server.test.ts
  • packages/arkor/src/core/credentials.test.ts
  • packages/arkor/src/core/telemetry.test.ts
packages/**/*.{js,jsx,ts,tsx,mjs,cjs}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Avoid using the em dash character (U+2014) in comments, string literals, and template literals in any package file; this includes CLI runtime messages, generated-file template bodies, and test names.

Files:

  • packages/arkor/src/index.ts
  • packages/studio-app/src/lib/api.ts
  • packages/arkor/src/core/client.test.ts
  • packages/arkor/src/core/auth0.test.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/arkor/src/cli/commands/whoami.test.ts
  • packages/studio-app/src/components/layout/IdentityChip.tsx
  • packages/arkor/src/core/projectState.test.ts
  • packages/arkor/src/core/auth0.ts
  • packages/arkor/src/core/projectState.ts
  • packages/arkor/src/core/credentials.ts
  • packages/arkor/src/cli/commands/login.test.ts
  • packages/arkor/src/core/telemetry.ts
  • packages/arkor/src/studio/server.ts
  • packages/arkor/src/studio/server.test.ts
  • packages/arkor/src/core/credentials.test.ts
  • packages/arkor/src/core/telemetry.test.ts
**/*.{js,jsx,ts,tsx,mjs,cjs}

📄 CodeRabbit inference engine (CONTRIBUTING.ja.md)

Do not use em dashes (U+2014) in comments, string literals, or template literals anywhere in the codebase; use colons, periods, commas, parentheses, spaced hyphens (" - "), or rephrasing instead.

Files:

  • packages/arkor/src/index.ts
  • packages/studio-app/src/lib/api.ts
  • packages/arkor/src/core/client.test.ts
  • packages/arkor/src/core/auth0.test.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/arkor/src/cli/commands/whoami.test.ts
  • packages/studio-app/src/components/layout/IdentityChip.tsx
  • packages/arkor/src/core/projectState.test.ts
  • packages/arkor/src/core/auth0.ts
  • packages/arkor/src/core/projectState.ts
  • packages/arkor/src/core/credentials.ts
  • packages/arkor/src/cli/commands/login.test.ts
  • packages/arkor/src/core/telemetry.ts
  • packages/arkor/src/studio/server.ts
  • packages/arkor/src/studio/server.test.ts
  • packages/arkor/src/core/credentials.test.ts
  • packages/arkor/src/core/telemetry.test.ts
packages/*/src/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Add Vitest tests under packages/*/src/**/*.test.ts for SDK/CLI/scaffold logic changes.

Files:

  • packages/arkor/src/core/client.test.ts
  • packages/arkor/src/core/auth0.test.ts
  • packages/arkor/src/cli/commands/whoami.test.ts
  • packages/arkor/src/core/projectState.test.ts
  • packages/arkor/src/cli/commands/login.test.ts
  • packages/arkor/src/studio/server.test.ts
  • packages/arkor/src/core/credentials.test.ts
  • packages/arkor/src/core/telemetry.test.ts
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Do not assume GitHub-style heading slugging in Mintlify docs; verify rendered heading ids before adding or changing cross-page anchor links.

Files:

  • packages/arkor/README.md
🪛 ast-grep (0.44.1)
packages/arkor/src/studio/server.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔇 Additional comments (27)
docs/cli/auth.mdx (1)

58-58: LGTM!

Also applies to: 165-165, 188-188

docs/concepts/project-structure.mdx (1)

88-88: LGTM!

docs/ja/cli/auth.mdx (1)

58-58: LGTM!

Also applies to: 165-165, 188-188

docs/ja/concepts/project-structure.mdx (1)

81-81: LGTM!

docs/ja/studio/overview.mdx (1)

12-12: LGTM!

docs/studio/overview.mdx (1)

12-12: LGTM!

packages/arkor/src/core/telemetry.ts (1)

86-86: LGTM!

Also applies to: 138-141, 154-154

packages/arkor/src/core/telemetry.test.ts (1)

43-43: LGTM!

Also applies to: 159-182, 217-232, 247-257, 274-286

packages/arkor/README.md (2)

89-89: LGTM!

Also applies to: 160-163


89-89: 📐 Maintainability & Code Quality

No Japanese README mirror herepackages/arkor/README.ja.md does not exist, so there’s nothing to update alongside packages/arkor/README.md.

			> Likely an incorrect or invalid review comment.
packages/arkor/src/core/credentials.ts (1)

9-27: LGTM!

Also applies to: 38-38, 115-116

packages/studio-app/src/lib/api.ts (1)

5-5: LGTM!

packages/arkor/src/core/credentials.test.ts (1)

17-17: LGTM!

Also applies to: 73-75, 100-102, 169-176, 191-191, 207-212

packages/arkor/src/cli/commands/whoami.test.ts (2)

226-226: LGTM!

Also applies to: 257-257


280-285: Stale "Auth0" wording left in an otherwise-renamed test.

Title suffix and mode were renamed to oauth, but the test description ("uses the Auth0 access token…") and the comment ("auth0-specific token") still use the pre-rename vendor term for what is now a generic OAuth credential field.

✏️ Suggested wording fix
-  it("uses the Auth0 access token in the bearer header (oauth mode)", async () => {
+  it("uses the access token in the bearer header (oauth mode)", async () => {
     // Branch coverage for `creds.mode === "anon" ? creds.token : creds.accessToken`.
     // The token closure runs lazily on the first request, so the spy must
-    // observe the auth0-specific token reaching /v1/me.
+    // observe the oauth-mode token reaching /v1/me.
packages/arkor/src/core/projectState.ts (1)

14-30: LGTM!

Also applies to: 53-63

packages/arkor/src/core/projectState.test.ts (1)

12-12: LGTM!

Also applies to: 24-25, 91-94

packages/arkor/src/index.ts (1)

34-34: LGTM!

docs/ja/sdk/overview.mdx (1)

64-64: LGTM!

packages/arkor/src/core/client.test.ts (1)

666-666: LGTM!

Also applies to: 677-677

packages/arkor/src/core/auth0.test.ts (1)

63-63: LGTM!

Also applies to: 72-72

packages/arkor/src/cli/commands/login.test.ts (1)

366-366: LGTM!

Also applies to: 433-433, 510-510, 592-592

docs/sdk/overview.mdx (1)

64-64: LGTM!

packages/arkor/src/studio/server.ts (1)

24-24: LGTM!

Also applies to: 506-541, 661-672, 734-738

packages/arkor/src/studio/server.test.ts (1)

816-816: LGTM!

Also applies to: 2067-2075, 2095-2095

packages/studio-app/src/components/layout/IdentityChip.tsx (1)

46-46: LGTM!

packages/studio-app/src/pages/Endpoints.tsx (1)

212-212: LGTM!

Comment thread packages/arkor/src/core/auth0.ts
@k-taro56

Copy link
Copy Markdown
Contributor

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@k-taro56 k-taro56 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.

エンジニアを褒めるネコ_LGTM

@soleil-colza
soleil-colza merged commit 9a27b69 into main Jul 11, 2026
382 checks passed
@soleil-colza
soleil-colza deleted the eng-723 branch July 11, 2026 03:56
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.

2 participants