Skip to content

fix(arkor): align the SDK and docs with the cloud API job/deployment schemas - #210

Open
yuto-trd wants to merge 8 commits into
mainfrom
eng-984
Open

fix(arkor): align the SDK and docs with the cloud API job/deployment schemas#210
yuto-trd wants to merge 8 commits into
mainfrom
eng-984

Conversation

@yuto-trd

@yuto-trd yuto-trd commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

The docs and every scaffolded template wrote evalSteps: 25, but the cloud API validates that field as a step config, so a fresh create-arkor project fails at job submission. Auditing the rest of the SDK against @orbit/shared's schemas turned up several more divergences; they are fixed together here.

Fixes ENG-984.

What was wrong, and what changed

evalSteps shape (the reported bug). stepConfigSchema requires exactly one of { steps } or { ratio }, so a bare number is rejected. All three templates (triage / translate / redaction) emitted the bad form, so this broke every scaffolded project, not just the doc example.

Fixing the shape alone was not enough: handler.py only sets eval_steps when eval_dataset is not None, which requires datasetSplit.enabled, and that defaults to { enabled: false } server-side. A corrected evalSteps on its own would submit cleanly and then produce no eval loss, leaving the "training and eval loss out of the box" promise in the template comment and the docs untrue. Templates now set datasetSplit: { enabled: true, testSize: 0.1 } alongside evalSteps: { steps: 25 }.

model_menu deployments crashed listDeployments(). The server's deploymentTargetSchema has three variants; the SDK decoder had two. decode() calls .parse() with no fallback over z.array(deploymentSchema), so one menu deployment rejected the entire response:

base_model: OK
model_menu: FAIL -> deployments.0.target: Invalid input

The resulting ZodError is not a CloudApiError, so Studio's GET /api/deployments fell through to the generic catch and returned an opaque 500 {"error": "Studio backend error"}. Menu deployments are created from the web dashboard and the one-click app flow, so a project can own one without ever touching Studio.

Reads and writes are now separate types, because the installed @arkor/cloud-api-client@0.0.1-alpha.2 generated request types do not carry the variant yet (widening the write side would only produce a compile error at the call site):

  • DeploymentTarget carries all three variants and is what DeploymentDto.target uses.
  • New WritableDeploymentTarget = Exclude<DeploymentTarget, { kind: "model_menu" }> is what CreateDeploymentInput / UpdateDeploymentInput use.

The SPA is fixed too: describeTarget fell through to the base_model branch and rendered Base model: undefined.

Fields the server already supported but the SDK dropped. The ten sampling parameters on InferArgs (stop, presencePenalty, frequencyPenalty, seed, logprobs, topLogprobs, logitBias, streamOptions, enableThinking, reasoningEffort); gpuTypes on TrainerInput / JobConfig; the training.completed metrics (finalLoss / totalSteps / totalTime, new TrainingMetrics type) and training.failed step, now on the onCompleted / onFailed contexts; and expiresAt on DeploymentDto. All additive.

Doc fix. An omitted HuggingFace split was documented as falling back to the dataset's default split. The backend substitutes the literal "train", which fails for a dataset that publishes no such split.

Out of scope: dryRun

dryRun is typed on TrainerInput / JobConfig and documented across six pages, but does not exist anywhere on the server. jobConfigSchema is a non-strict zod object, so the key is silently dropped with no error. The SDK half (927ab6a) landed on main on 2026-04-28; the server half is still unmerged on origin/eng-450, which holds both the schema field and the trainer truncation logic (DRY_RUN_ROWS=50 / DRY_RUN_MAX_STEPS=10) that the template comment's "50 rows, max_steps=10" refers to.

The practical effect is that a user who sets dryRun: true expecting a cheap smoke test is billed for a full run. Landing the backend implementation versus dropping the field is a product call, so it is tracked separately rather than decided here.

Companion change

orbit carries a one-line follow-up: stepConfigSchema's comment and error message say ratio < 1 while the implementation is .max(1). The implementation is right (ratio 1 means "once, at the end of the run"), so the comment and message move to match it. The string is not embedded in openapi.json, so no model regeneration is needed.

Testing

pnpm typecheck (10 tasks), pnpm lint (7 packages), and oxfmt --check all pass. Tests: arkor 442, studio-app 199, create-arkor 47, all passing. @arkor/cli-internal is 226/227 — the one failure is git.test.ts's commit-signing fallback, which fails identically on a clean tree and is a local-environment issue unrelated to this change.

New coverage:

  • Every deployment target kind decodes, an unknown kind still rejects, and expiresAt normalises (absent / null / Date).
  • Templates pin the object form of evalSteps and assert the split is enabled, so a regression to a bare number fails the build rather than production.
  • infer() copies fields one by one instead of spreading, so each new sampling parameter is asserted on the outgoing request body.
  • onCompleted metrics with values and with the block absent (all-null normalisation), plus onFailed step.

TypeScript enforces the SPA branch: deleting the model_menu case from describeTarget fails typecheck with Property 'baseModel' does not exist on type '... | { kind: "model_menu"; }'.


Summary by cubic

Aligns the SDK, docs, and Studio with the cloud API job/deployment schemas to stop scaffolded jobs from failing, add missing inference options, and fix Studio/QuickStart behavior for model_menu deployments. Fixes ENG-984.

  • Bug Fixes

    • Templates/docs now use evalSteps: { steps: 25 } and enable datasetSplit so new projects submit and show eval loss; clarified step-config shape and bounds ({ steps } or { ratio } with 0 < ratio < 1, warmupSteps also allows ratio: 0); documented datasetSplit shape/defaults and that HuggingFace dataset.split defaults to the literal "train".
    • Deployments: reads accept the model_menu target; writes use WritableDeploymentTarget (excludes model_menu). Decoders now discriminate on kind, and DeploymentDto exposes and normalizes expiresAt. Studio Endpoints renders the target label with a real code element and no longer 500s; QuickStart gets the target kind and uses a MODEL_NAME placeholder for menu deployments.
    • Callbacks: onCompleted includes metrics (finalLoss, totalSteps, totalTime), onFailed includes step (or null). English/JA docs updated across references and cookbooks.
  • New Features

    • infer() forwards more sampling fields: stop, presencePenalty, frequencyPenalty, seed, logprobs, topLogprobs, logitBias, streamOptions, enableThinking, reasoningEffort.
    • Trainer config accepts gpuTypes: string[] for managed GPU selection; values are validated at job submission. Exports now include ReasoningEffort, TrainingMetrics, and WritableDeploymentTarget.

Written for commit c3c7c94. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added inference controls for stopping, sampling, log probabilities, token biasing, streaming usage, and reasoning effort.
    • Added training GPU selection plus training callback context updates (completion metrics and failure step).
    • Expanded deployments to support model-menu targets and surfaced an expiresAt field for one-click deploys.
    • Updated quick-start examples to use the correct model placeholder per deployment target type.
  • Documentation
    • Refreshed English and Japanese guides for training lifecycle callbacks, template scaffolds, evalSteps/datasetSplit behavior, dataset split defaults, deployment target semantics, and inference parameters.

…schemas

The docs and every scaffolded template wrote `evalSteps: 25`, but the cloud
API validates that field as a step config (exactly one of `{ steps }` or
`{ ratio }`), so a fresh `create-arkor` project failed at job submission.
Auditing the rest of the SDK against `@orbit/shared`'s schemas turned up
several more divergences, fixed together here.

evalSteps. Templates and docs now send `{ steps: 25 }`. They also set
`datasetSplit: { enabled: true, testSize: 0.1 }`: the trainer only configures
an eval loop when a held-out split exists and `datasetSplit` defaults to
`{ enabled: false }` server-side, so the corrected `evalSteps` alone would
have been accepted and then produced no eval loss at all, leaving the
"eval loss out of the box" promise in the template comment untrue.

model_menu deployments. The server's deployment target union grew a third
variant; the SDK's decoder still had two. `decode()` calls `.parse()` with no
fallback over `z.array(deploymentSchema)`, so a single menu deployment in a
project rejected the whole `listDeployments` response, and Studio's Endpoints
tab returned an opaque 500. Menu deployments are created from the web
dashboard and the one-click app flow, so a project can own one without ever
touching Studio. Reads and writes are now separate types: `DeploymentTarget`
carries all three variants, and the new `WritableDeploymentTarget` excludes
`model_menu` for create/update, because the generated
`@arkor/cloud-api-client` request types do not carry the variant yet.

Fields the server already supported but the SDK dropped: the ten sampling
parameters on `InferArgs` (`stop`, `presencePenalty`, `frequencyPenalty`,
`seed`, `logprobs`, `topLogprobs`, `logitBias`, `streamOptions`,
`enableThinking`, `reasoningEffort`), `gpuTypes` on `TrainerInput`, the
`training.completed` metrics and `training.failed` step now surfaced on
`onCompleted` / `onFailed`, and `expiresAt` on `DeploymentDto`.

Docs also claimed an omitted HuggingFace `split` falls back to the dataset's
default split; the backend substitutes the literal "train", which fails for a
dataset that publishes no such split.

`dryRun` is deliberately untouched: it is documented and typed but does not
exist anywhere on the server, which needs a separate call on whether to land
the backend implementation or drop the field.

Fixes ENG-984
Copilot AI review requested due to automatic review settings July 25, 2026 08:46
@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 25, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR updates trainer callback payloads, inference controls, deployment target contracts, Studio QuickStart behavior, generated trainer templates, and English/Japanese documentation.

Changes

Trainer and inference contracts

Layer / File(s) Summary
Trainer and inference type contracts
packages/arkor/src/core/types.ts, packages/arkor/src/core/client.ts, packages/arkor/src/index.ts
Adds GPU selection, reasoning controls, inference parameters, training metrics, callback fields, and public type re-exports.
Trainer event dispatch and forwarding
packages/arkor/src/core/trainer.ts, packages/arkor/src/core/trainer.test.ts
Forwards GPU and inference settings, and maps terminal SSE metrics and failure steps into normalized callback payloads with tests.
Trainer and inference documentation
docs/{,ja}/concepts/lifecycle.mdx, docs/{,ja}/sdk/{callbacks,infer,overview}.mdx
Documents callback metrics and steps, expanded inference arguments, and public type exports.

Deployment target and expiry support

Layer / File(s) Summary
Deployment target and response contracts
packages/arkor/src/core/{deployments,schemas}.ts, packages/arkor/src/core/*test.ts
Adds readable model_menu targets, restricts write targets, and normalizes expiresAt in deployment responses.
Deployment UI and reference documentation
packages/studio-app/src/{lib/api.ts,pages/*}, docs/{,ja}/sdk/deployments.mdx
Passes target kinds through Studio QuickStart, renders model-menu guidance, updates fixtures, and documents deployment variants and expiry.

Template and forwarded-field guidance

Layer / File(s) Summary
Generated trainer template contracts
packages/cli-internal/src/templates*
Generated trainers use object-shaped evalSteps and enabled datasetSplit; tests enforce both settings.
Cookbook and forwarded-field guidance
docs/{,ja}/{cookbook/sdk}/*.mdx
Documents evaluation split behavior, step configuration objects, GPU forwarding, explicit "train" defaults, and API-time validation.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TrainingSSE
  participant Trainer
  participant TrainerCallbacks
  TrainingSSE->>Trainer: completed metrics or failed step
  Trainer->>TrainerCallbacks: normalized terminal callback context
Loading
sequenceDiagram
  participant DeploymentResponse
  participant DeploymentSchema
  participant StudioEndpoints
  participant QuickStart
  DeploymentResponse->>DeploymentSchema: decode target and expiresAt
  DeploymentSchema->>StudioEndpoints: provide typed deployment
  StudioEndpoints->>QuickStart: pass targetKind
  QuickStart->>QuickStart: generate target-specific model samples
Loading

Possibly related PRs

Suggested reviewers: k-taro56

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: aligning the SDK and docs with cloud API job and deployment schema updates.
✨ 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-984
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch eng-984

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.

@drift-check

drift-check Bot commented Jul 25, 2026

Copy link
Copy Markdown

Code Review Bot

No comment/code divergences or documentation drift detected. Reviewed 32 file(s); skipped 0.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR aligns the SDK, scaffolds, documentation, and Studio deployment UI with the cloud API schemas.

  • Corrects scaffolded evaluation configuration and enables dataset splitting.
  • Adds missing inference, GPU-selection, callback-metric, deployment-expiry, and model-menu fields.
  • Separates readable deployment targets from writable targets.
  • Updates Studio target rendering and QuickStart samples for model-menu deployments.
  • Adds regression coverage and corresponding English and Japanese documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/arkor/src/core/trainer.ts Forwards GPU and inference fields and exposes normalized completion metrics and failure-step data to callbacks.
packages/arkor/src/core/schemas.ts Extends deployment decoding for model-menu targets and expiration while retaining a narrower write schema.
packages/arkor/src/core/deployments.ts Expands deployment response types and separates writable targets from the complete read-side union.
packages/arkor/src/core/types.ts Adds the cloud-supported trainer, inference, and callback data contracts.
packages/cli-internal/src/templates.ts Corrects generated evaluation-step shapes and enables held-out dataset splits in all starter templates.
packages/studio-app/src/pages/Endpoints.tsx Handles model-menu deployment targets explicitly in the Endpoints interface.
packages/studio-app/src/pages/QuickStart.tsx Generates model-menu-aware QuickStart request examples.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config[Trainer configuration] --> Builder[SDK job-config builder]
  Builder --> Cloud[Cloud API schemas]
  Cloud --> Events[Training SSE events]
  Events --> Callbacks[SDK callbacks]
  Cloud --> Decoder[Deployment response decoder]
  Decoder --> Studio[Studio Endpoints UI]
  Templates[Scaffold templates] --> Config
Loading

Reviews (8): Last reviewed commit: "Merge branch 'main' into eng-984" | Re-trigger Greptile

The `local/no-em-dash` ESLint rule only covers source files; the CI job
runs `scripts/check-no-em-dash.mts` over the whole tracked tree, which
caught these two in the mdx docs.
Copilot AI review requested due to automatic review settings July 25, 2026 08:50

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai 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.

Review completed against the latest diff

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

Re-trigger cubic

Comment thread packages/arkor/src/core/schemas.ts Outdated
Comment thread packages/arkor/src/core/types.ts
Comment thread packages/arkor/src/core/trainer.test.ts Outdated
Comment thread packages/arkor/src/core/types.ts
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/studio-app/src/pages/Endpoints.tsx 0.00% 2 Missing ⚠️
packages/studio-app/src/pages/QuickStart.tsx 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-code-quality

github-code-quality Bot commented Jul 25, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/arkor

The overall coverage in commit c3c7c94 in the eng-984 branch remains at 98%, unchanged from commit ddfbd05 in the main branch.

TypeScript / code-coverage/create-arkor

The overall coverage in commit c3c7c94 in the eng-984 branch remains at 60%, unchanged from commit ddfbd05 in the main branch.

TypeScript / code-coverage/cli-internal

The overall coverage in commit c3c7c94 in the eng-984 branch remains at 97%, unchanged from commit ddfbd05 in the main branch.

TypeScript / code-coverage/studio-app

The overall coverage in commit c3c7c94 in the eng-984 branch remains at 53%, unchanged from commit ddfbd05 in the main branch.

Show a code coverage summary of the most impacted files.
File main ddfbd05 eng-984 c3c7c94 +/-
src/pages/QuickStart.tsx 69% 68% -1%

Updated July 27, 2026 07:54 UTC

Address cubic's review on PR #210.

The deployment target union was shared between the response decoder and
`createDeploymentRequestSchema`, so widening it for `model_menu` also
widened what Studio's create route accepts. That route casts the parsed
body to `createDeployment`'s parameter type, which silently defeats the
`WritableDeploymentTarget` restriction the same change introduced. The
three variants are now separate consts composed into a read union (all
three) and a write union (adapter / base_model), so the runtime check and
the type contract agree.

cubic framed this as an invalid create reaching the bootstrap path, which
is not quite right: the cloud API does accept `model_menu`, so such a
create would succeed rather than 400. The split is worth making for the
type-contract reason instead.

Also from the same review: `TrainerInput.gpuTypes` becomes a non-empty
tuple, since an empty list names no primary dispatch candidate and the
cloud API requires `.min(1)`; and the metrics test's name no longer claims
to cover the failing step, which the onFailed test above it already does.

cubic's remaining point (modelling `topLogprobs` / `logprobs` as a union so
a positive value requires `logprobs: true`) is not taken: the coupling is
documented on the field and in the reference, and a union there would
complicate a widely-used public type for one parameter pair.
Copilot AI review requested due to automatic review settings July 25, 2026 09:05

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…ments

Follow-up to the review on PR #210.

Revert `gpuTypes` to `string[]`. The non-empty tuple added a commit ago
rejects every array whose length TypeScript cannot see, not just the empty
one it was meant to guard: slugs are environment-specific, so they usually
arrive as a plain `string[]` from config or `process.env.X.split(",")`. The
only escape is `as [string, ...string[]]`, which asserts away the very
non-emptiness the tuple existed to prove, and `JobConfig.gpuTypes` erases
the guarantee one hop later anyway. Both docs pages claimed an empty list
was a compile error while the same section's intro said these fields have
no compile-time check at all; the intro now describes what is actually
checked, and cites `buildJobConfig` by name instead of a line range that
this PR itself made stale.

`describeTarget` returned a plain string containing Markdown backticks, so
the menu deployment's label rendered them literally in the endpoint list
and header. QuickStart.tsx hit this exact bug before and documents the fix
it settled on; `describeTarget` now returns a `ReactNode` and renders a
real `<code>`.

QuickStart's samples hardcoded `"model":"ignored"` and said in prose that
`model` is ignored "because the deployment pins the target". That is false
for a menu deployment, where `model` is the per-request selector, and the
card is rendered on the detail page of every deployment kind. It now takes
the target kind, uses a `MODEL_NAME` placeholder for menu deployments, and
branches the prose.

`docs/concepts/lifecycle.mdx` and its JA mirror documented `onCompleted` /
`onFailed` without the `metrics` and `step` fields this PR added; only
`docs/sdk/callbacks.mdx` was updated. The introduction and overview both
link the concepts page first, so a reader arriving that way never learned
the new fields exist.

Finally, `datasetSplit` had no documented shape even though this PR turns
it on in every scaffolded project. The reference now gives the full shape
and defaults, and the cookbook states the trade-off the change makes
silently: `testSize: 0.1` means the scaffold trains on 90% of the dataset.
Copilot AI review requested due to automatic review settings July 25, 2026 10:01

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The reference and cookbook both documented the ratio form as
`0 < n <= 1`. That matched the cloud API's `.max(1)` at the time, but the
bound itself was a bug: `resolve_step` passes the value straight to
`SFTConfig`, and transformers reads these fields as a fraction of the run
only below 1, so `ratio: 1` means "every optimizer step" rather than "once
at the end". arkorlab/orbit#357 tightens the schema to `< 1`; these pages
follow, and now say why the bound is exclusive instead of leaving it as a
bare range.

Also folds in the `warmupSteps` carve-out the cookbook was missing. It
said the same shape applies to `warmupSteps`, while the reference said
`warmupSteps` additionally accepts `ratio: 0` — two statements of one
backend rule that disagreed inside the same PR.

Found by the Codex review on arkorlab/orbit#357.
Copilot AI review requested due to automatic review settings July 25, 2026 11:42

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/sdk/deployments.mdx (1)

108-111: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

"model field is ignored" is now only true for non-model_menu deployments.

Both language versions of this doc were just extended (a few lines above) to explain that model_menu deployments do use the model field to pick which catalog model answers the request. The pre-existing blanket statement right after the curl example still says the field is always ignored "since the deployment already pins the target," which directly contradicts the model_menu section a reader just read moments earlier.

  • docs/sdk/deployments.mdx#L108-L111: qualify the statement, e.g. "…ignored for adapter/base_model deployments, since those pin the target; a model_menu deployment uses it to select which model answers the request."
  • docs/ja/sdk/deployments.mdx#L104-L110: apply the equivalent qualification in Japanese to keep the two docs paired, e.g. 「adapter/base_model デプロイでは無視されます…;model_menu デプロイでは応答するモデルを選ぶために使われます。」
🤖 Prompt for 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.

In `@docs/sdk/deployments.mdx` around lines 108 - 111, The deployment
documentation must qualify the model-field behavior by deployment type. In
docs/sdk/deployments.mdx lines 108-111, state that adapter/base_model
deployments ignore model while model_menu deployments use it to select the
responding catalog model; make the equivalent clarification in Japanese in
docs/ja/sdk/deployments.mdx lines 104-110, preserving the paired documentation.
packages/arkor/src/core/trainer.ts (1)

292-318: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

infer() still copies InferArgs fields one-by-one into the request body.

Each new InferArgs sampling field (stop, penalties, seed, logprobs, etc.) requires a matching manual line here, in the type definition, and in the tests. Nothing enforces that these three stay in sync going forward; the accompanying test comment at trainer.test.ts Lines 843-846 already flags this exact risk: "infer() copies fields one by one rather than spreading args, so a field added to InferArgs without a matching line in the builder is silently dropped between the user's call and the request body."

A full ...args spread isn't safe here since signal must stay out of body (it's forwarded separately as the top-level signal option), so a straight spread would leak it into the wire payload. Consider a compile-time exhaustiveness guard instead, e.g. a helper type that fails to compile if a key is added to InferArgs (other than messages/signal) without being threaded through the body builder, so this class of bug surfaces at typecheck time rather than needing a human to remember the three-way sync.

🤖 Prompt for 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.

In `@packages/arkor/src/core/trainer.ts` around lines 292 - 318, Update the infer
request-body construction in the function returning client.chat so InferArgs
sampling fields cannot be silently omitted. Avoid spreading signal into body;
introduce a compile-time exhaustiveness guard covering InferArgs keys while
excluding messages and signal, and keep the existing top-level signal forwarding
unchanged.
🤖 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 `@docs/ja/sdk/create-trainer.mdx`:
- Around line 92-96: Update the gpuTypes row in the Japanese create-trainer
documentation to describe the SDK type as string[], remove the claim that empty
arrays fail at compile time, and state that invalid or empty values are rejected
when submitting the job. Align the unknown-slug wording with the English
documentation while preserving the existing priority and fallback behavior
description.

In `@packages/arkor/src/core/schemas.ts`:
- Around line 121-145: Replace the sequential z.union definitions in
deploymentTargetSchema and writableDeploymentTargetSchema with
z.discriminatedUnion using the "kind" discriminator and their existing variant
schemas. Preserve the read union’s adapter, base_model, and model_menu variants
and the write union’s narrower adapter and base_model variants.

---

Outside diff comments:
In `@docs/sdk/deployments.mdx`:
- Around line 108-111: The deployment documentation must qualify the model-field
behavior by deployment type. In docs/sdk/deployments.mdx lines 108-111, state
that adapter/base_model deployments ignore model while model_menu deployments
use it to select the responding catalog model; make the equivalent clarification
in Japanese in docs/ja/sdk/deployments.mdx lines 104-110, preserving the paired
documentation.

In `@packages/arkor/src/core/trainer.ts`:
- Around line 292-318: Update the infer request-body construction in the
function returning client.chat so InferArgs sampling fields cannot be silently
omitted. Avoid spreading signal into body; introduce a compile-time
exhaustiveness guard covering InferArgs keys while excluding messages and
signal, and keep the existing top-level signal forwarding unchanged.
🪄 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: 598f2666-e544-4c70-a410-4f0c1523f413

📥 Commits

Reviewing files that changed from the base of the PR and between 492bd20 and 8d64010.

📒 Files selected for processing (32)
  • docs/concepts/lifecycle.mdx
  • docs/cookbook/customizing-templates.mdx
  • docs/ja/concepts/lifecycle.mdx
  • docs/ja/cookbook/customizing-templates.mdx
  • docs/ja/sdk/callbacks.mdx
  • docs/ja/sdk/create-trainer.mdx
  • docs/ja/sdk/dataset.mdx
  • docs/ja/sdk/deployments.mdx
  • docs/ja/sdk/infer.mdx
  • docs/ja/sdk/overview.mdx
  • docs/sdk/callbacks.mdx
  • docs/sdk/create-trainer.mdx
  • docs/sdk/dataset.mdx
  • docs/sdk/deployments.mdx
  • docs/sdk/infer.mdx
  • docs/sdk/overview.mdx
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/client.ts
  • packages/arkor/src/core/deployments.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/arkor/src/core/schemas.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/arkor/src/core/trainer.ts
  • packages/arkor/src/core/types.ts
  • packages/arkor/src/index.ts
  • packages/cli-internal/src/templates.test.ts
  • packages/cli-internal/src/templates.ts
  • packages/studio-app/src/lib/api.ts
  • packages/studio-app/src/pages/Endpoints.helpers.test.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/studio-app/src/pages/QuickStart.test.ts
  • packages/studio-app/src/pages/QuickStart.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (205)
  • GitHub Check: install · bun · macos-latest · node 24.12.0
  • GitHub Check: install · pnpm-9 · macos-latest · node 24.12.0
  • GitHub Check: install · npm · macos-latest · node 24.12.0
  • GitHub Check: install · yarn · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-11 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-10 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-9 · windows-latest · node 26.0.0
  • GitHub Check: install · bun · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn · windows-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · npm · windows-latest · node 26.0.0
  • GitHub Check: install · npm · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-9 · windows-latest · node >=26.0.0 <27
  • 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-11 · macos-latest · node 22.22.0
  • GitHub Check: install · yarn · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 24.12.0
  • GitHub Check: install · bun · windows-latest · node 26.0.0
  • GitHub Check: install · bun · windows-latest · node 24.0.0
  • GitHub Check: install · npm · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-10 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-10 · windows-latest · node 26.0.0
  • 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 · pnpm-10 · windows-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · 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
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.0.0
  • GitHub Check: install · yarn · windows-latest · node 24.12.0
  • GitHub Check: install · npm · windows-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-11 · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.0.0
  • GitHub Check: install · bun · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · npm · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · windows-latest · node 22.22.0
  • GitHub Check: install · bun · windows-latest · node 22.22.0
  • GitHub Check: install · yarn-berry · 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 <27
  • GitHub Check: install · npm · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · 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
  • GitHub Check: install · pnpm-9 · windows-latest · node 22.22.0
  • GitHub Check: install · yarn · ubuntu-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node 22.22.0
  • GitHub Check: install · npm · ubuntu-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · ubuntu-latest · node 22.22.0
  • GitHub Check: install · bun · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · ubuntu-latest · node 22.22.0
  • GitHub Check: install · yarn · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · macos-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · macos-latest · node 24.0.0
  • GitHub Check: install · npm · macos-latest · node 24.12.0
  • GitHub Check: install · pnpm-9 · macos-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-10 · macos-latest · node >=24.12.0 <25
  • GitHub Check: install · bun · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · macos-latest · node 24.12.0
  • GitHub Check: install · npm · macos-latest · node 24.0.0
  • GitHub Check: install · yarn · macos-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · macos-latest · node 24.12.0
  • GitHub Check: install · bun · macos-latest · node 24.12.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 26.0.0
  • GitHub Check: install · bun · macos-latest · node 22.22.0
  • GitHub Check: install · npm · macos-latest · node 22.22.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · windows-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · macos-latest · node 22.22.0
  • GitHub Check: install · bun · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · macos-latest · node 22.22.0
  • GitHub Check: install · pnpm-11 · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · npm · windows-latest · node >=24.12.0 <25
  • 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 >=26.0.0 <27
  • GitHub Check: install · pnpm-9 · windows-latest · node 26.0.0
  • GitHub Check: install · yarn · windows-latest · node 24.12.0
  • GitHub Check: install · npm · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · windows-latest · node 24.0.0
  • GitHub Check: install · bun · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-10 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · macos-latest · node 22.22.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 · pnpm-11 · windows-latest · node 24.12.0
  • GitHub Check: install · npm · windows-latest · node 26.0.0
  • GitHub Check: install · yarn · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn-berry · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · bun · windows-latest · node 24.12.0
  • GitHub Check: install · bun · windows-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.12.0
  • GitHub Check: install · bun · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 24.12.0
  • GitHub Check: install · npm · windows-latest · node 24.0.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: cubic · AI code reviewer
  • GitHub Check: install · yarn-berry · 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 24.0.0
  • GitHub Check: install · yarn · windows-latest · node 22.22.0
  • GitHub Check: install · npm · windows-latest · node 22.22.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · bun · 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 · pnpm-11 · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · bun · windows-latest · node 22.22.0
  • GitHub Check: install · npm · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · windows-latest · node 22.22.0
  • GitHub Check: install · yarn · ubuntu-latest · node 24.0.0
  • GitHub Check: Seer Code Review
  • 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 <23
  • 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 >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=26.0.0 <27
  • 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.0.0 <24.1.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.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 24.12.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 >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 26.0.0
  • 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 <25
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=26.0.0 <27
  • 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.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.0.0 <24.1.0
  • 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 >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 22.22.0
  • GitHub Check: coverage · upload to Codecov
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 26.0.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.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · macos-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 · macos-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · windows-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 · windows-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.3.0 <24.5.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.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.8.0 <24.10.0
  • GitHub Check: coverage · upload to Codecov
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-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 · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 24.12.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 >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.1.0 <24.3.0
⚠️ CI failures not shown inline (2)

GitHub Actions: Running Copilot Code Review / copilot-pull-request-reviewer: Running Copilot Code Review

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
 �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
 �[36;1m�[0m
 �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
 �[36;1mSTOP_***REDACTED*** /proc/sys/kernel/random/uuid)�[0m
 �[36;1m�[0m
 �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
 �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
 �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
 �[36;1m# The trap preserves the original exit code.�[0m
 �[36;1mcopilot_cleanup() {�[0m
 �[36;1m  echo "::$STOP_***REDACTED***
 �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
 �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
 �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
 �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m

GitHub Actions: Running Copilot Code Review / 0_copilot-pull-request-reviewer.txt: Running Copilot Code Review

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
 �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
 �[36;1m�[0m
 �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
 �[36;1mSTOP_***REDACTED*** /proc/sys/kernel/random/uuid)�[0m
 �[36;1m�[0m
 �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
 �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
 �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
 �[36;1m# The trap preserves the original exit code.�[0m
 �[36;1mcopilot_cleanup() {�[0m
 �[36;1m  echo "::$STOP_***REDACTED***
 �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
 �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
 �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
 �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m
🧰 Additional context used
📓 Path-based instructions (8)
docs/**/*.mdx

📄 CodeRabbit inference engine (AGENTS.md)

Keep English and Japanese documentation paired: changes under docs/ must also update the corresponding files under docs/ja/. Verify Mintlify-generated anchors before adding cross-page links; preserve /, =, and full-width parentheses while accounting for stripped ASCII punctuation and backticks.

Files:

  • docs/ja/sdk/dataset.mdx
  • docs/sdk/dataset.mdx
  • docs/ja/sdk/create-trainer.mdx
  • docs/sdk/create-trainer.mdx
  • docs/sdk/overview.mdx
  • docs/sdk/deployments.mdx
  • docs/concepts/lifecycle.mdx
  • docs/ja/concepts/lifecycle.mdx
  • docs/sdk/infer.mdx
  • docs/cookbook/customizing-templates.mdx
  • docs/ja/sdk/callbacks.mdx
  • docs/ja/sdk/deployments.mdx
  • docs/ja/cookbook/customizing-templates.mdx
  • docs/ja/sdk/overview.mdx
  • docs/ja/sdk/infer.mdx
  • docs/sdk/callbacks.mdx
**/{*.md,*.mdx,*.yaml,*.yml}

📄 CodeRabbit inference engine (AGENTS.md)

Do not format Markdown, MDX, YAML, or YML files with oxfmt; these are excluded because documentation anchors and deliberate YAML layout must remain hand-managed.

Files:

  • docs/ja/sdk/dataset.mdx
  • docs/sdk/dataset.mdx
  • docs/ja/sdk/create-trainer.mdx
  • docs/sdk/create-trainer.mdx
  • docs/sdk/overview.mdx
  • docs/sdk/deployments.mdx
  • docs/concepts/lifecycle.mdx
  • docs/ja/concepts/lifecycle.mdx
  • docs/sdk/infer.mdx
  • docs/cookbook/customizing-templates.mdx
  • docs/ja/sdk/callbacks.mdx
  • docs/ja/sdk/deployments.mdx
  • docs/ja/cookbook/customizing-templates.mdx
  • docs/ja/sdk/overview.mdx
  • docs/ja/sdk/infer.mdx
  • docs/sdk/callbacks.mdx
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/studio-app/src/pages/Endpoints.helpers.test.ts
  • packages/arkor/src/index.ts
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/cli-internal/src/templates.test.ts
  • packages/studio-app/src/lib/api.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/cli-internal/src/templates.ts
  • packages/arkor/src/core/client.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/arkor/src/core/schemas.ts
  • packages/studio-app/src/pages/QuickStart.tsx
  • packages/arkor/src/core/types.ts
  • packages/studio-app/src/pages/QuickStart.test.ts
  • packages/arkor/src/core/deployments.ts
  • packages/arkor/src/core/trainer.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/studio-app/src/pages/Endpoints.helpers.test.ts
  • packages/arkor/src/index.ts
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/cli-internal/src/templates.test.ts
  • packages/studio-app/src/lib/api.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/cli-internal/src/templates.ts
  • packages/arkor/src/core/client.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/arkor/src/core/schemas.ts
  • packages/studio-app/src/pages/QuickStart.tsx
  • packages/arkor/src/core/types.ts
  • packages/studio-app/src/pages/QuickStart.test.ts
  • packages/arkor/src/core/deployments.ts
  • packages/arkor/src/core/trainer.ts
packages/*/src/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Add Vitest tests in the same change for SDK, CLI, scaffolder, schema, or other package logic changes; consider an e2e/cli scenario for CLI flow changes.

Files:

  • packages/studio-app/src/pages/Endpoints.helpers.test.ts
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/cli-internal/src/templates.test.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/studio-app/src/pages/QuickStart.test.ts
**/*.{js,ts,jsx,tsx,json,css,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use oxfmt for formatting with the repository configuration; do not manually override its whitespace, wrapping, quotes, or trailing-comma decisions.

Files:

  • packages/studio-app/src/pages/Endpoints.helpers.test.ts
  • packages/arkor/src/index.ts
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/cli-internal/src/templates.test.ts
  • packages/studio-app/src/lib/api.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/cli-internal/src/templates.ts
  • packages/arkor/src/core/client.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/arkor/src/core/schemas.ts
  • packages/studio-app/src/pages/QuickStart.tsx
  • packages/arkor/src/core/types.ts
  • packages/studio-app/src/pages/QuickStart.test.ts
  • packages/arkor/src/core/deployments.ts
  • packages/arkor/src/core/trainer.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run both linters through the root configurations: oxlint --deny-warnings . followed by eslint .; add configuration overrides at the root rather than per-package configs.

Files:

  • packages/studio-app/src/pages/Endpoints.helpers.test.ts
  • packages/arkor/src/index.ts
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/cli-internal/src/templates.test.ts
  • packages/studio-app/src/lib/api.ts
  • packages/studio-app/src/pages/Endpoints.tsx
  • packages/cli-internal/src/templates.ts
  • packages/arkor/src/core/client.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/arkor/src/core/schemas.ts
  • packages/studio-app/src/pages/QuickStart.tsx
  • packages/arkor/src/core/types.ts
  • packages/studio-app/src/pages/QuickStart.test.ts
  • packages/arkor/src/core/deployments.ts
  • packages/arkor/src/core/trainer.ts
packages/arkor/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Preserve Studio CSRF protections: send the token in X-Arkor-Studio-Token for fetch, use studioToken for EventSource, enforce the localhost host-header allow-list, do not configure CORS, and compare tokens with timingSafeEqual.

Files:

  • packages/arkor/src/index.ts
  • packages/arkor/src/core/client.deployments.test.ts
  • packages/arkor/src/core/schemas.test.ts
  • packages/arkor/src/core/client.ts
  • packages/arkor/src/core/trainer.test.ts
  • packages/arkor/src/core/schemas.ts
  • packages/arkor/src/core/types.ts
  • packages/arkor/src/core/deployments.ts
  • packages/arkor/src/core/trainer.ts
🪛 LanguageTool
docs/sdk/create-trainer.mdx

[style] ~90-~90: The word ‘caveats’ is a legal term. To make your text as clear as possible to all readers, do not use this foreign term unless it is used with its legal meaning. Possible alternatives are “cautions” or “warnings”.
Context: ...hecked, not the slugs inside it, so the caveats below apply to it just the same. | Fie...

(CAVEAT)


[style] ~110-~110: This sentence is over 40 words long. Consider splitting it up, as shorter sentences make the text easier to read.
Context: ...sfully and then produces no eval loss. These fields are explicitly not stable: the backend contract for them can change between releases, and there is no compile-time check on the value you pass, so a wrong shape surfaces as a validation error from the cloud API when the job is submitted rather than as a type error. Prefer the typed fields above; reach fo...

(TOO_LONG_SENTENCE)

🔇 Additional comments (44)
packages/cli-internal/src/templates.ts (1)

27-39: LGTM!

Also applies to: 89-90, 110-111, 149-150

packages/cli-internal/src/templates.test.ts (1)

31-38: LGTM!

Also applies to: 40-47

docs/cookbook/customizing-templates.mdx (1)

22-23: LGTM!

Also applies to: 41-46, 58-58, 107-107

docs/ja/cookbook/customizing-templates.mdx (1)

22-23: LGTM!

Also applies to: 41-46, 58-58, 107-107

docs/sdk/create-trainer.mdx (1)

90-111: LGTM!

docs/ja/sdk/create-trainer.mdx (1)

98-109: LGTM!

docs/sdk/dataset.mdx (1)

35-35: LGTM!

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

35-35: LGTM!

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

14-17: LGTM!

Also applies to: 26-48, 92-98, 141-147

packages/arkor/src/core/schemas.ts (2)

105-120: LGTM!

Also applies to: 249-253


160-170: 🗄️ Data Integrity & Integration

No change needed. updateDeploymentRequestSchema is not defined, and updateDeployment() sends the caller-provided partial body via $patch without server-side schema.safeParse() validation.

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

115-244: LGTM! Thorough coverage of the read/write target-kind split and the expiresAt normalization behavior. As per path instructions, packages/*/src/**/*.test.ts should add Vitest tests alongside schema changes, which this satisfies.

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

343-347: LGTM!

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

7-7: LGTM!

Also applies to: 48-71, 1066-1070

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

14-14: LGTM!

Also applies to: 34-75, 109-189, 196-215, 305-308

packages/studio-app/src/pages/QuickStart.test.ts (1)

24-268: LGTM!

docs/ja/sdk/deployments.mdx (2)

72-82: LGTM!


193-195: LGTM!

docs/sdk/deployments.mdx (2)

73-83: LGTM!


195-197: LGTM!

packages/studio-app/src/pages/Endpoints.helpers.test.ts (1)

21-36: LGTM!

packages/arkor/src/core/types.ts (4)

54-54: LGTM!


223-279: LGTM!


322-350: LGTM!


401-419: LGTM!

packages/arkor/src/core/client.ts (2)

40-40: LGTM!


373-386: LGTM!

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

16-16: LGTM!


26-26: LGTM!


54-54: LGTM!

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

78-78: LGTM!

docs/concepts/lifecycle.mdx (2)

95-110: LGTM!


111-117: LGTM!

docs/ja/concepts/lifecycle.mdx (2)

95-109: LGTM!


111-117: LGTM!

docs/sdk/callbacks.mdx (2)

17-24: LGTM!


91-110: LGTM!

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

79-89: LGTM!

Also applies to: 144-144, 336-344, 354-358

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

159-159: LGTM!

Also applies to: 197-197, 469-478, 494-640, 798-807, 843-856

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

17-26: LGTM!

Also applies to: 91-112

docs/sdk/infer.mdx (1)

37-51: LGTM!

Also applies to: 67-80

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

37-51: LGTM!

Also applies to: 67-80

docs/sdk/overview.mdx (1)

64-68: LGTM!

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

64-68: LGTM!

Comment thread docs/ja/sdk/create-trainer.mdx Outdated
Comment thread packages/arkor/src/core/schemas.ts Outdated
… unions

Address the CodeRabbit review on PR #210.

The `gpuTypes` revert two commits ago only touched the English page, so the
Japanese one kept advertising `[string, ...string[]]` and a compile error on
an empty array: a type that no longer exists and a guarantee the SDK never
makes. A reader of the JA page would work around a compiler error that
cannot happen. Its section intro was stale for the same reason, still
claiming every forwarded field is `unknown` and still citing the
`trainer.ts:100-108` range this PR itself invalidated, both of which the
English side already had fixed.

The two deployment target unions now discriminate on `kind`, which is how
the cloud API's own `deploymentTargetSchema` is built. The performance
argument is immaterial at two or three branches; what matters is the
rejection path. An unknown kind now fails on the discriminator with a path
of `target.kind`, instead of an aggregate of every branch's mismatch, and
that aggregate is what `studio/server.ts` stringifies into the 400 the user
reads. `adapterRefSchema` is left as a plain union: it has the same shape,
but it was not part of the review and widening the diff for it buys nothing
here.

Verified the rejection output rather than assuming it: both schemas now
report `note: "No matching discriminator"` with `discriminator: "kind"`.
Copilot AI review requested due to automatic review settings July 27, 2026 07:08

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/ja/sdk/create-trainer.mdx (1)

98-105: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the forwarding example copy-paste valid.

Replacing the required name, model, and dataset fields with // ... makes this createTrainer call fail TypeScript validation when copied. Retain the required fields from the earlier example.

Proposed documentation correction
 createTrainer({
-  // ...
+  name: "support-bot-v1",
+  model: "unsloth/gemma-4-E4B-it",
+  dataset: { type: "huggingface", name: "arkorlab/triage-demo" },
   evalSteps: { steps: 25 },
   saveSteps: { ratio: 0.25 },
   datasetSplit: { enabled: true, testSize: 0.1 },
 });
🤖 Prompt for 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.

In `@docs/ja/sdk/create-trainer.mdx` around lines 98 - 105, Update the
createTrainer example to retain the required name, model, and dataset fields
from the earlier example alongside evalSteps, saveSteps, and datasetSplit, so
the snippet remains valid when copied and compiled.
🤖 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 `@docs/ja/sdk/create-trainer.mdx`:
- Line 92: Update the step configuration example in the
warmupSteps/loggingSteps/saveSteps/evalSteps documentation to use an unambiguous
ratio placeholder, such as `{ ratio: number }`, and state the constraint `0 <
ratio < 1` separately in prose while preserving the existing warmupSteps
exception.

---

Outside diff comments:
In `@docs/ja/sdk/create-trainer.mdx`:
- Around line 98-105: Update the createTrainer example to retain the required
name, model, and dataset fields from the earlier example alongside evalSteps,
saveSteps, and datasetSplit, so the snippet remains valid when copied and
compiled.
🪄 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: 7488c43d-1114-4158-aed8-696f2d2de130

📥 Commits

Reviewing files that changed from the base of the PR and between 8d64010 and 782ccab.

📒 Files selected for processing (2)
  • docs/ja/sdk/create-trainer.mdx
  • packages/arkor/src/core/schemas.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (205)
  • GitHub Check: install · bun · macos-latest · node 24.12.0
  • GitHub Check: install · bun · windows-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · macos-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · macos-latest · node 24.0.0
  • GitHub Check: install · yarn · windows-latest · node 24.12.0
  • GitHub Check: install · bun · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · npm · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · windows-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · npm · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn · windows-latest · node 26.0.0
  • GitHub Check: install · npm · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · bun · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-10 · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 26.0.0
  • GitHub Check: install · bun · windows-latest · node 24.12.0
  • GitHub Check: install · npm · 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.12.0 <25
  • GitHub Check: install · pnpm-10 · windows-latest · node 24.12.0
  • GitHub Check: install · yarn · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · npm · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-11 · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-9 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn-berry · windows-latest · node 24.0.0
  • GitHub Check: install · bun · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.12.0
  • GitHub Check: install · yarn · windows-latest · node 24.0.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · windows-latest · node 22.22.0
  • GitHub Check: install · bun · 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 <23
  • GitHub Check: install · pnpm-9 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · npm · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn-berry · windows-latest · node 22.22.0
  • GitHub Check: install · npm · windows-latest · node 22.22.0
  • GitHub Check: install · bun · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-10 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · ubuntu-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-10 · windows-latest · node 22.22.0
  • GitHub Check: install · yarn · ubuntu-latest · node 26.0.0
  • GitHub Check: install · yarn · ubuntu-latest · node 22.22.0
  • GitHub Check: install · yarn · ubuntu-latest · node 24.0.0
  • GitHub Check: install · yarn · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · ubuntu-latest · node 22.22.0
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: install · pnpm-10 · macos-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · macos-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn-berry · macos-latest · node 24.12.0
  • GitHub Check: install · bun · macos-latest · node 24.12.0
  • GitHub Check: install · bun · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · macos-latest · node 24.12.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 · bun · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn-berry · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-10 · macos-latest · node 22.22.0
  • GitHub Check: install · bun · macos-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · macos-latest · node 22.22.0
  • GitHub Check: install · bun · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · pnpm-9 · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-11 · macos-latest · node >=22.22.0 <23
  • GitHub Check: install · npm · macos-latest · node 24.0.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=26.0.0 <27
  • GitHub Check: install · yarn-berry · macos-latest · node 22.22.0
  • GitHub Check: install · npm · 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 · 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 >=26.0.0 <27
  • GitHub Check: install · pnpm-11 · windows-latest · node 26.0.0
  • GitHub Check: install · bun · windows-latest · node 24.12.0
  • GitHub Check: install · yarn · windows-latest · node 26.0.0
  • GitHub Check: install · bun · windows-latest · node 26.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-9 · windows-latest · node 26.0.0
  • GitHub Check: install · pnpm-11 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-10 · windows-latest · node 26.0.0
  • 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-10 · windows-latest · node 24.12.0
  • GitHub Check: install · npm · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · npm · windows-latest · node 24.0.0
  • GitHub Check: install · yarn · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · pnpm-10 · windows-latest · node >=24.12.0 <25
  • GitHub Check: install · yarn · windows-latest · node 24.12.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node 24.12.0
  • GitHub Check: install · pnpm-9 · 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.0.0
  • GitHub Check: install · pnpm-11 · 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 · npm · windows-latest · node 24.12.0
  • GitHub Check: install · yarn · windows-latest · node 24.0.0
  • GitHub Check: install · yarn-berry · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-9 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · bun · windows-latest · node 22.22.0
  • 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 · npm · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-9 · 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 24.0.0
  • GitHub Check: install · bun · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · yarn · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · npm · windows-latest · node 22.22.0
  • GitHub Check: install · pnpm-10 · windows-latest · node >=22.22.0 <23
  • GitHub Check: install · pnpm-11 · windows-latest · node 22.22.0
  • GitHub Check: Seer Code Review
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=26.0.0 <27
  • 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.12.0 <25
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 22.22.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.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=22.22.0 <23
  • 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.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.10.0 <24.12.0
  • 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 · macos-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-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 <23
  • 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.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.12.0 <25
  • 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.0.0 <24.1.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 >=26.0.0 <27
  • GitHub Check: coverage · upload to Codecov
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=24.12.0 <25
  • 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.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 26.0.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 >=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 · windows-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · macos-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.1.0 <24.3.0
  • GitHub Check: typecheck · lint · test · build · macos-latest · node 22.22.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 >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 26.0.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · windows-latest · node 24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.5.0 <24.8.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.10.0 <24.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 26.0.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.12.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.10.0 <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 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=22.22.0 <23
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node 22.22.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.12.0 <25
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.8.0 <24.10.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=24.0.0 <24.1.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.3.0 <24.5.0
  • GitHub Check: typecheck · lint · test · build · windows-latest · node >=24.5.0 <24.8.0
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=26.0.0 <27
  • GitHub Check: typecheck · lint · test · build · ubuntu-latest · node >=22.22.0 <23
  • GitHub Check: coverage · upload to Codecov
⚠️ CI failures not shown inline (2)

GitHub Actions: Running Copilot Code Review / copilot-pull-request-reviewer: Running Copilot Code Review

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
 �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
 �[36;1m�[0m
 �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
 �[36;1mSTOP_***REDACTED*** /proc/sys/kernel/random/uuid)�[0m
 �[36;1m�[0m
 �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
 �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
 �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
 �[36;1m# The trap preserves the original exit code.�[0m
 �[36;1mcopilot_cleanup() {�[0m
 �[36;1m  echo "::$STOP_***REDACTED***
 �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
 �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
 �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
 �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m

GitHub Actions: Running Copilot Code Review / 0_copilot-pull-request-reviewer.txt: Running Copilot Code Review

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
 �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
 �[36;1m�[0m
 �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
 �[36;1mSTOP_***REDACTED*** /proc/sys/kernel/random/uuid)�[0m
 �[36;1m�[0m
 �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
 �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
 �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
 �[36;1m# The trap preserves the original exit code.�[0m
 �[36;1mcopilot_cleanup() {�[0m
 �[36;1m  echo "::$STOP_***REDACTED***
 �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
 �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
 �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
 �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m
🧰 Additional context used
📓 Path-based instructions (7)
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/core/schemas.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/core/schemas.ts
packages/arkor/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Preserve Studio CSRF protections: send the token in X-Arkor-Studio-Token for fetch, use studioToken for EventSource, enforce the localhost host-header allow-list, do not configure CORS, and compare tokens with timingSafeEqual.

Files:

  • packages/arkor/src/core/schemas.ts
**/*.{js,ts,jsx,tsx,json,css,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use oxfmt for formatting with the repository configuration; do not manually override its whitespace, wrapping, quotes, or trailing-comma decisions.

Files:

  • packages/arkor/src/core/schemas.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run both linters through the root configurations: oxlint --deny-warnings . followed by eslint .; add configuration overrides at the root rather than per-package configs.

Files:

  • packages/arkor/src/core/schemas.ts
docs/**/*.mdx

📄 CodeRabbit inference engine (AGENTS.md)

Keep English and Japanese documentation paired: changes under docs/ must also update the corresponding files under docs/ja/. Verify Mintlify-generated anchors before adding cross-page links; preserve /, =, and full-width parentheses while accounting for stripped ASCII punctuation and backticks.

Files:

  • docs/ja/sdk/create-trainer.mdx
**/{*.md,*.mdx,*.yaml,*.yml}

📄 CodeRabbit inference engine (AGENTS.md)

Do not format Markdown, MDX, YAML, or YML files with oxfmt; these are excluded because documentation anchors and deliberate YAML layout must remain hand-managed.

Files:

  • docs/ja/sdk/create-trainer.mdx
🔇 Additional comments (4)
packages/arkor/src/core/schemas.ts (3)

121-149: LGTM!


174-174: LGTM!


253-257: LGTM!

docs/ja/sdk/create-trainer.mdx (1)

88-91: LGTM!

Also applies to: 93-97, 107-109

Comment thread docs/ja/sdk/create-trainer.mdx Outdated

@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: 782ccabcfb

ℹ️ 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 docs/sdk/create-trainer.mdx Outdated
`{ ratio: <0 < n < 1> }` nests two inequalities inside angle brackets, so
the reader cannot tell at a glance whether the inner text is a placeholder
or a type name. Name the fields and put the range in prose, with a concrete
value alongside it. The `{ steps: <integer >= 0> }` half used the same
notation and moves with it.

Applied to the reference and the cookbook in both languages: the notation
was shared across all four, and fixing only the page the review pointed at
would have split the EN/JA pair.

Found by the CodeRabbit review on PR #210.
Copilot AI review requested due to automatic review settings July 27, 2026 07:36

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 27, 2026 07:52

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@k-taro56

Copy link
Copy Markdown
Contributor

@codex

@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: c3c7c94d97

ℹ️ 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".

| Field | Status |
| --- | --- |
| `warmupSteps`, `loggingSteps`, `saveSteps`, `evalSteps` | Forwarded as-is. Use only if you already know the backend's expected shape. |
| `warmupSteps`, `loggingSteps`, `saveSteps`, `evalSteps` | Forwarded as-is. Each takes a **step config object**, not a bare number: exactly one of `{ steps }`, a non-negative integer, or `{ ratio }`, a number greater than 0 and less than 1 (e.g. `{ ratio: 0.25 }`). `warmupSteps` additionally accepts `ratio: 0`. The ratio's upper bound is exclusive because the trainer passes it straight through to a field the underlying library reads as a fraction *only* below 1; at exactly 1 it would flip to meaning "every single step", so the cloud API rejects it rather than silently checkpointing on every optimizer step. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document ratio 1 as an accepted step config

The cloud schema uses an inclusive maximum for ratio, so { ratio: 1 } is valid and means once at the end of the run; it is not rejected or interpreted as every optimizer step. This guidance incorrectly excludes a supported configuration and is repeated in the cookbook and Japanese mirror, so users may avoid or replace a valid end-of-run evaluation/checkpoint setting.

Useful? React with 👍 / 👎.

* shows up in this project's list and must render rather than fall
* through to the `base_model` branch as `Base model: undefined`.
*/
| { kind: "model_menu" };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep model-menu targets out of writable Studio bodies

Adding model_menu to this shared union also makes CreateDeploymentBody and UpdateDeploymentBody, which still use DeploymentTarget, accept { kind: "model_menu" }. In the Studio API inspected here, such a create passes TypeScript but is rejected by createDeploymentRequestSchema, while the installed cloud client cannot write this variant; similarly, forwarding a target from a fetched menu deployment into updateDeployment compiles and then fails remotely. Mirror the SDK's separate writable-target type in the SPA body types.

Useful? React with 👍 / 👎.

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.

3 participants