@kyo-so/cli 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.13.0] - 2026-07-17
11
+
12
+ ### Added
13
+
14
+ - Add a read-only `kyoso-budget-report` package bin and `audit:budget-report`
15
+ source script for explicit trusted trace directories, with execution grouping,
16
+ separate all-call/normal-path byte percentiles, token-reporting rates,
17
+ call-correlated output-limit signals, root-identity-anchored traversal,
18
+ bounded trace ingestion, sanitized metadata, and completion/skip reasons.
19
+ - Expose effective model execution identity in Audit events and JSON/Markdown
20
+ results while keeping requested-only and provider-reported values distinct.
21
+
22
+ ### Changed
23
+
24
+ - Raise the default Codex and Claude timeouts to 600 seconds and the review-wide
25
+ deadline from 480 to 660 seconds, and update the pinned Codex ACP adapter from
26
+ `1.1.2` to `1.1.4`.
27
+ - Recalibrate review output defaults to a non-blocking 512 KiB warning and a
28
+ 1 MiB hard breaker, make the ten-finding limit a soft target, and continue
29
+ optional phases when token usage is unknown by default.
30
+ - Preserve strictly parseable paid results after output-limit cancellation,
31
+ enforce one absolute review deadline across phases, and align the dogfooding
32
+ MCP client timeout with its 35-minute review preset.
33
+ - Promote the Marketplace Plugin to `0.6.0` and pin its Codex and Claude Code
34
+ MCP definitions to `@kyo-so/cli@0.12.0`, delivering typed review contracts,
35
+ deterministic finding admission, and explicit coverage through the Plugin runtime.
36
+
10
37
  ## [0.12.0] - 2026-07-16
11
38
 
12
39
  ### Added
package/README.ja.md CHANGED
@@ -50,11 +50,9 @@ backend が 1 つだけ有効な場合は、2 role の ensemble の代わりに
50
50
 
51
51
  PluginはSkillと公開済みのKyoso CLIの完全一致versionへpinしたMCP定義を同梱しますが、CLI本体は同梱しません。MCPの初回起動ではnpmへのnetwork accessが必要です。cache済みpackageでoffline起動できる場合はありますが、保証しません。manifestの`Read` capabilityは表示metadataであり、filesystem認可を追加するものではありません。
52
52
 
53
- `kyoso setup ... --with-openrouter` の出力と手動セットアップ例は、引き続き利用者が管理するクライアント登録テンプレートです。Marketplace Plugin `0.5.0` は `@kyo-so/cli@0.11.0` へpinしています。
54
-
55
53
  PluginのSkillは同梱の`kyoso` MCP serverをdependencyとして宣言するため、Kyoso reviewの明示的な実行はCLI fallbackではなくMCPへ誘導されます。同梱Plugin MCPを無効化した場合は、Plugin Skillを利用不可として扱います。MCPを再有効化するか、Pluginを削除してCLI+Skill-onlyへ移行してください。PluginはCLI fallback modeではありません。
56
54
 
57
- Marketplace Plugin `0.4.0` はMCP processへ`OPENROUTER_API_KEY`の変数名を公開しますが、credential値は保存しません。KyosoはOpenRouterを明示選択したCodex childだけへ値を転送し、展開されていないplaceholderは未設定として扱います。
55
+ Plugin経由のOpenRouter key転送については、[Codex OpenRouter project opt-in](#codex-の-openrouter-project-opt-in) を参照してください。
58
56
 
59
57
  #### CLI+Skill-only
60
58
 
@@ -181,7 +179,7 @@ kyoso plan \
181
179
  --file src/auth/callback.ts
182
180
  ```
183
181
 
184
- 結果は上から順に読んでください。`Decision` は deterministic gate の結果、`Coverage` は実行した必須観点と役割、各 finding の `disposition` は block 対象か参考情報かを示します。
182
+ 結果は上から順に読んでください。`Decision` は deterministic gate の結果、`Coverage` は実行した必須観点と役割、各 finding の `disposition` は block 対象か参考情報かを示します([Review contract と finding admission](#review-contract-と-finding-admission) を参照)。
185
183
 
186
184
  patch に対して CISA Secure by Design security review を実行します。
187
185
 
@@ -226,6 +224,18 @@ Kyoso が公開する MCP tools は次の 3 つだけです。
226
224
 
227
225
  MCP stdout は protocol messages 専用です。logs は stderr または local audit traces に出力されます。
228
226
 
227
+ ## Skill
228
+
229
+ 同梱の `kyoso-review` skill は意図的に狭い用途にしています。Kyoso、multi-agent review、plan review、security review、CISA Secure by Design review、diff review を明示的に依頼したときだけ trigger されるべきです。
230
+
231
+ Skillは利用可能な最初の経路を使います。順序はKyoso MCP tools、PATH上のインストール済み`kyoso`、`npx -y @kyo-so/cli`、`bunx @kyo-so/cli`です。package runner fallbackはnetwork accessが必要になり、version driftも起こり得るため、MCPなしの通常経路にはインストール済みCLIを使います。typed [review contract](#review-contract-と-finding-admission) にnon-goalsまたはaccepted risksがありMCPを利用できない場合、CLI fallbackは`focus`しか保持できないためSkillは停止します。
232
+
233
+ `kyoso setup codex --write --skill-only`はcanonical Skill directoryを既定で`.agents/skills/kyoso-review/`へコピーします。`--global`を追加すると`~/.agents/skills/kyoso-review/`へコピーします。
234
+
235
+ `kyoso setup claude-code --write --skill-only`は既定で`.claude/skills/kyoso-review/`へコピーします。`--global`を追加すると`~/.claude/skills/kyoso-review/`へコピーします。
236
+
237
+ managed installはcanonical directoryのdigestとCLI versionを`.kyoso-install.json`へ記録します。現行または既知historical copyはadoptして自動更新します。変更済み/未知のcopyはconflictとして残し、上書きしません。`--force`はそのSkill directoryだけを置換し、MCP設定を削除・上書きしません。
238
+
229
239
  ## Review contract と finding admission
230
240
 
231
241
  すべての review で、correctness、regression、security boundaries、secrets/injection、data integrity、public contract を削除不能な safety floor として確認します。review の形状に応じて supply chain、privacy、resource amplification も追加します。user-global `reviewPolicy.additionalLenses` は観点を追加できますが、floor は削除できません。
@@ -260,18 +270,6 @@ Kyoso は各 finding の evidence quality、対象変更との関係、stable fi
260
270
 
261
271
  deterministic decision に影響するのは `gate` と `actionable` だけです。`disputed` は completion を incomplete にし、自動修正してはいけません。`coverage` は required/attempted lenses、required/completed perspectives、独立した cross-model review の有無を記録します。`Tests to Add` は具体的な regression test を最大3件に制限し、generic command や広範な test-suite 要求は除外します。
262
272
 
263
- ## Skill
264
-
265
- 同梱の `kyoso-review` skill は意図的に狭い用途にしています。Kyoso、multi-agent review、plan review、security review、CISA Secure by Design review、diff review を明示的に依頼したときだけ trigger されるべきです。
266
-
267
- Skillは利用可能な最初の経路を使います。順序はKyoso MCP tools、PATH上のインストール済み`kyoso`、`npx -y @kyo-so/cli`、`bunx @kyo-so/cli`です。package runner fallbackはnetwork accessが必要になり、version driftも起こり得るため、MCPなしの通常経路にはインストール済みCLIを使います。typed contractにnon-goalsまたはaccepted risksがありMCPを利用できない場合、CLI fallbackは`focus`しか保持できないためSkillは停止します。
268
-
269
- `kyoso setup codex --write --skill-only`はcanonical Skill directoryを既定で`.agents/skills/kyoso-review/`へコピーします。`--global`を追加すると`~/.agents/skills/kyoso-review/`へコピーします。
270
-
271
- `kyoso setup claude-code --write --skill-only`は既定で`.claude/skills/kyoso-review/`へコピーします。`--global`を追加すると`~/.claude/skills/kyoso-review/`へコピーします。
272
-
273
- managed installはcanonical directoryのdigestとCLI versionを`.kyoso-install.json`へ記録します。現行または既知historical copyはadoptして自動更新します。変更済み/未知のcopyはconflictとして残し、上書きしません。`--force`はそのSkill directoryだけを置換し、MCP設定を削除・上書きしません。
274
-
275
273
  ## Configuration
276
274
 
277
275
  ### Files and precedence
@@ -297,9 +295,6 @@ Global TOML は command 実行や env forwarding を含む user-owned settings
297
295
  [agents.codex]
298
296
  command = "bunx"
299
297
  args = ["@agentclientprotocol/codex-acp"]
300
- # この完全一致のproject directoryだけに`provider`選択、または継承した
301
- # OpenRouterのmodel上書きを許可します。
302
- allowProjectProvider = ["/absolute/path/to/project"]
303
298
 
304
299
  [agents.codex.env]
305
300
  CODEX_CONFIG = '{"model":"gpt-5.5"}'
@@ -309,7 +304,7 @@ CODEX_CONFIG = '{"model":"gpt-5.5"}'
309
304
 
310
305
  ### Agents
311
306
 
312
- Agent keys: `agents.<codex|claude>.<enabled|model|effort|role|timeoutMs>`。Codexには`agents.codex.provider`もあり、`"openrouter"`はexternal providerを選択し、`"default"`は継承したOpenRouter選択を通常のCodex behaviorへ戻します。Claudeにprovider設定はありません。`agents.codex.allowProjectProvider`はglobal config専用のabsolute project directory allowlistです。完全一致のproject TOMLだけが`provider`を選択、または継承したOpenRouterの`model`を上書きでき、descendantやglobには一致しません。project configと`--set`では変更できず、legacy boolean値は拒否します。`command` / `args` / `env`もglobal config専用です([Files and precedence](#files-and-precedence) を参照)。
307
+ Agent keys: `agents.<codex|claude>.<enabled|model|effort|role|timeoutMs>`。Codexには`agents.codex.provider`もあり、`"openrouter"`はexternal providerを選択し、`"default"`は継承したOpenRouter選択を通常のCodex behaviorへ戻します。Claudeにprovider設定はありません。projectから`provider`を選択するには、global config専用の`agents.codex.allowProjectProvider` allowlistが必要です。詳細な規則は [Codex OpenRouter project opt-in](#codex-の-openrouter-project-opt-in) を参照してください。`command` / `args` / `env`もglobal config専用です([Files and precedence](#files-and-precedence) を参照)。
313
308
 
314
309
  `agents.<name>.model` または `agents.<name>.effort` を省略すると、各 agent 独自の default を使用します。Codex は `~/.codex/config.toml`(`CODEX_HOME`を設定している場合は`$CODEX_HOME/config.toml`)などの local Codex config を使用し、Claude は adapter default を使用します。
315
310
 
@@ -353,7 +348,7 @@ model = "openai/o4-mini"
353
348
 
354
349
  `provider = "openrouter"` の場合、`model`は空白でない値が必須です。これはOpenRouterのmodel IDです。Kyosoはcatalogやtool calling対応を検証しないため、利用するmodelのtool supportはproviderで確認してください。
355
350
 
356
- `allowProjectProvider`はprojectの`provider`と、OpenRouterを継承中のproject `model`上書きに必要で、listには解決後のproject config fileを含むcanonical directoryのabsolute pathを完全一致で指定します。invocationのcwdやlexical pathではありません。trusted `kyoso.config.ts`を含むproject config fileとallowlist entryの両方をsymlink経由も含めて同じdirectoryのreal pathへ解決して比較するため、そのdirectoryへ解決されるentryは一致し、別の場所へ解決されるentryまたは解決できないpathはfail closedです。user globalの`provider = "openrouter"`にはallowlist entryは不要です。CLIで選択する場合は、同一 invocation に`--set agents.codex.provider=openrouter`と`--set agents.codex.model=<model>`の両方が必要であり、project modelで前者を補完することはできません。`allowProjectProvider`は`--set` pathではなく、legacy boolean値は拒否されます。
351
+ `allowProjectProvider`はprojectの`provider`と、OpenRouterを継承中のproject `model`上書きに必要で、listには解決後のproject config fileを含むcanonical directoryのabsolute pathを完全一致で指定します。invocationのcwdやlexical pathではありません。descendantやglobには一致しません。trusted `kyoso.config.ts`を含むproject config fileとallowlist entryの両方をsymlink経由も含めて同じdirectoryのreal pathへ解決して比較するため、そのdirectoryへ解決されるentryは一致し、別の場所へ解決されるentryまたは解決できないpathはfail closedです。user globalの`provider = "openrouter"`にはallowlist entryは不要です。CLIで選択する場合は、同一 invocation に`--set agents.codex.provider=openrouter`と`--set agents.codex.model=<model>`の両方が必要であり、project modelで前者を補完することはできません。`allowProjectProvider`は`--set` pathではなく、legacy boolean値は拒否されます。
357
352
 
358
353
  user global configがOpenRouterを選択している場合、projectは`provider = "default"`で明示的にopt-outできます。このresetにはmodelもauthorizationも不要で、同じlayerで通常のCodex modelを明示しない限り継承したOpenRouter modelも消去し、そのprojectではOpenRouter keyをforwardしません。
359
354
 
@@ -365,9 +360,9 @@ export OPENROUTER_API_KEY="<secret>"
365
360
 
366
361
  keyは`kyoso.toml`、Git管理するconfig、Audit trace、review outputへ保存しません。KyosoはKyoso processまたは明示した`agents.codex.env`のいずれのsourceであっても、このproviderを選択した場合だけCodex childへ転送します。`provider`を省略するか`provider = "default"`の場合は、両方のsourceを意図的に転送しません。空でない明示的な`agents.codex.env.OPENROUTER_API_KEY`は、転送しなかったことを示すsanitized warningも出します。選択されたCodex OpenRouter childだけがkeyを受け取れるため、`agents.claude.env`など別のchild configurationに空でないkeyがある場合も同じwarningを出します。`provider`を省略すると既存のCodex login、`OPENAI_API_KEY`、`CODEX_API_KEY`、`CODEX_CONFIG`の挙動を維持し、行を削除するとその挙動へ戻ります。
367
362
 
368
- GUI clientはshell exportを継承しない場合があります。新規manual MCP registrationは`kyoso setup <client> --write --with-openrouter`で作成し、clientを再起動してから`kyoso doctor`でKyoso processがkeyを検出できるか確認してください。`kyoso setup`は既存のMCP entryを再書換えせずに保持するため、既存registrationでは[examples](examples/codex-config.toml)を参照してopt-in allowlistを手動更新する必要があります。
363
+ Marketplace PluginはMCP processへ`OPENROUTER_API_KEY`の変数名を公開しますが、credential値は保存しません。GUI clientはshell exportを継承しない場合があります。新規manual MCP registrationは`kyoso setup <client> --write --with-openrouter`で作成し、clientを再起動してから`kyoso doctor`でKyoso processがkeyを検出できるか確認してください。`kyoso setup`は既存のMCP entryを再書換えせずに保持するため、既存registrationでは[examples](examples/codex-config.toml)を参照してopt-in allowlistを手動更新する必要があります。
369
364
 
370
- 新規manual MCP registrationは既定で`OPENROUTER_API_KEY`を含めません。providerを意図して選択した後だけ`--with-openrouter`で追加し、既存registrationは書換えません。Claude Code registrationの`${OPENROUTER_API_KEY}`はclientが展開する必要があり、Kyosoは`${NAME}`、`$NAME`、`%NAME%`(前後の空白は許容)だけから成る未展開credential placeholderだけを無視し、変数名だけを含むsanitized warningを出します。ほかの文字列を含む値は維持します。custom credential-like nameの末尾が`_KEY`、`_TOKEN`、`_SECRET`、`_PASSWORD`である場合にも同じ規則を適用し、credentialではないtemplateは維持されます。
365
+ 新規manual MCP registrationは既定で`OPENROUTER_API_KEY`を含めません。providerを意図して選択した後だけ`--with-openrouter`で追加し、既存registrationは書換えません。`kyoso setup ... --with-openrouter` の出力と手動セットアップ例は、引き続き利用者が管理するクライアント登録テンプレートです。Claude Code registrationの`${OPENROUTER_API_KEY}`はclientが展開する必要があり、Kyosoは`${NAME}`、`$NAME`、`%NAME%`(前後の空白は許容)だけから成る未展開credential placeholderだけを無視し、変数名だけを含むsanitized warningを出します。ほかの文字列を含む値は維持します。custom credential-like nameの末尾が`_KEY`、`_TOKEN`、`_SECRET`、`_PASSWORD`である場合にも同じ規則を適用し、credentialではないtemplateは維持されます。
371
366
 
372
367
  このuser-authorized project-scoped opt-inを推奨します。global `provider = "openrouter"`は、projectが`provider = "default"`を設定するまで継承されます。`provider`の省略だけでは解除されません。固定のOpenRouter Responses API presetはbetaです。custom endpoint、provider routing、fallback、judge integrationは公開しません。keyをこのpresetに束縛するため、OpenRouter modeではtop-levelの`profile`または`profiles`を含む`CODEX_CONFIG`と、objectではない`model_providers` valueをchild起動前に拒否します。objectの場合は`model_providers`を固定の`kyoso-openrouter` entryだけに置換し、破棄したentry数だけを含むsanitized warningを出します。provider IDやconfig valueは出力しません。拒否するfield以外では、`model`、`model_provider`、`model_providers`以外のunrelatedな`CODEX_CONFIG` fieldを維持するため、foreign provider configurationがkey付きのendpointを選択することはできません。Claudeは設定済みproviderのままで、judgeは`OPENROUTER_API_KEY`を使用しません。
373
368
 
@@ -424,20 +419,40 @@ single-agent mode では、残った backend が `combined_reviewer` として1
424
419
 
425
420
  ### Execution budget and review stopping
426
421
 
427
- 各 review には、model call数、総 wall time、streaming中のagent text(message / thought chunk)、agentあたりのfinding数に user-global の hard ceiling があります。
422
+ 各 review には、model call数、総 wall time、streaming中のagent text(message / thought chunk)に user-global の hard ceiling があります。streaming textにはより低いsoft warning thresholdがあり、agentあたりのfinding数はsoft targetです。
428
423
 
429
424
  ```toml
430
425
  [reviewBudget]
431
426
  maxModelCalls = 4
432
- maxTotalWallTimeMs = 480000
433
- maxAgentOutputBytes = 65536
427
+ maxTotalWallTimeMs = 660000
428
+ warnAgentOutputBytes = 524288
429
+ maxAgentOutputBytes = 1048576
434
430
  maxFindingsPerAgent = 10
435
- skipOptionalPhasesWhenTokenUsageUnknown = true
431
+ skipOptionalPhasesWhenTokenUsageUnknown = false
432
+ ```
433
+
434
+ `reviewBudget` は user-global 専用です。project `kyoso.toml` と `--set` では変更できません。MCP / library request は `options.reviewBudget` で ceiling を下げることだけができ、引き上げはできません。512 KiBのwarningはnon-blocking、1 MiBのlimitはcallをcancelし、10件のfinding targetを超えたmaterial findingも破棄しません。token usage不明時は既定でwarningを出して継続し、user-globalで明示的に`true`を設定した場合だけ厳格なoptional-phase skipを維持します。Kyoso は primary reviewer を両方予約してから開始し、残りのcallだけを verification に使い、LLM Judge は advisory として扱います。既定のJudge modeは `deterministic_only` です。
435
+
436
+ 結果には `completion`、`executionBudget`、`requestFingerprint` が含まれます。Markdown と Audit は call数、wall time、message / thought / total output bytes、reported / partial / unknown token usage を示します。完了したmodel callは`executionIdentity`も提示でき、Kyosoのrouteとrequested modelをprovider-reported identityから分離します。requested-only valueをprovider報告値として表示しません。`completion.status` が `incomplete` の場合、Kyoso は `retryable: false` の通常の `block` 結果を返します。これは code defect の断定ではなく、review coverage が未完了であることを意味します。同じ fingerprint を自動 retry しないでください。同一review checkpointでは、bundled Skill は初回1 passと material fix後の確認1 passだけを許可し、3回目には明示的な user approval が必要です。
437
+
438
+ ### Timeouts
439
+
440
+ Default agent timeout は Codex / Claude ともに600秒です。verification round の default は 90 秒です。review全体のdeadlineは既定660秒(`reviewBudget.maxTotalWallTimeMs`)で、defaultの並列primary phase後に標準の60秒のfinalization余裕を確保します。各phaseはdeadlineを延長せず残り時間を使います。`kyoso doctor` は設定済みの直列phase時間と、10%または60秒の大きい方を余裕として加えたreview-wide推奨値を表示します。LLM judge timeoutは、judge modeが許し、direct provider credentialが利用できる場合だけ加算します。
441
+
442
+ このrepositoryのprimary 15分+verification 15分のdogfooding presetでは、次のuser-global overrideを使います。
443
+
444
+ ```toml
445
+ [reviewBudget]
446
+ maxTotalWallTimeMs = 2100000
436
447
  ```
437
448
 
438
- `reviewBudget` user-global 専用です。project `kyoso.toml` と `--set` では変更できません。MCP / library request は `options.reviewBudget` で ceiling を下げることだけができ、引き上げはできません。Kyoso primary reviewer を両方予約してから開始し、残りのcallだけを verification に使い、LLM Judge advisory として扱います。既定のJudge modeは `deterministic_only` です。
449
+ Codex Pluginと新規生成するmanual Codex registrationは`tool_timeout_sec = 2160`を使い、Kyosoの35分deadlineより60秒長く待機します。既存manual registrationは`kyoso setup`が保持するため、手動更新が必要です。Claude Code Plugin manifestclient tool timeoutを設定しないため、同値をミリ秒で指定してClaude Codeを起動し、clientを再起動してください。
450
+
451
+ ```bash
452
+ MCP_TOOL_TIMEOUT=2160000 claude
453
+ ```
439
454
 
440
- 結果には `completion`、`executionBudget`、`requestFingerprint` が含まれます。Markdown と Audit は call数、wall time、output bytes、reported / unknown token usage を示します。`completion.status` が `incomplete` の場合、Kyoso は `retryable: false` の通常の `block` 結果を返します。これは code defect の断定ではなく、review coverage が未完了であることを意味します。同じ fingerprint を自動 retry しないでください。同一review checkpointでは、bundled Skill は初回1 passと material fix後の確認1 passだけを許可し、3回目には明示的な user approval が必要です。
455
+ client timeoutを延ばしてもKyoso内部のreview-wide deadlineは延長されません。ほかのpresetでは、client timeoutを`reviewBudget.maxTotalWallTimeMs`より長くしてください。
441
456
 
442
457
  ### Verification
443
458
 
@@ -464,10 +479,6 @@ Judge keys: `judge.<mode|provider|timeoutMs>`。Judge LLMs は optional で、de
464
479
 
465
480
  Judge defaults は意図的に lightweight models を使用します。より強い judge を使う場合は、`KYOSO_ANTHROPIC_JUDGE_MODEL` に `claude-sonnet-5` のような Sonnet-class model を設定してください。
466
481
 
467
- ### Timeouts
468
-
469
- Default agent timeouts は Codex 120 秒、Claude 300 秒です。verification round の default は 90 秒です。review全体のdeadlineは既定480秒で、各phaseはdeadlineを延長せず残り時間を使います。MCP clients は tool calls に少なくとも480秒を許可してください。
470
-
471
482
  ### Audit
472
483
 
473
484
  対応するPOSIX runtimeでは、Audit traces はuser state base(absoluteな`$XDG_STATE_HOME`、なければ`$HOME/.local/state`)配下の次の場所に書き込まれます。
@@ -478,6 +489,20 @@ Default agent timeouts は Codex 120 秒、Claude 300 秒です。verification r
478
489
 
479
490
  `audit.directory`はlogicalなrelative directory(既定: `.kyoso/traces`)であり、workspace内のdirectoryではありません。既存のworkspace `.kyoso/traces`は自動で移行・削除されません。
480
491
 
492
+ installed packageからabsoluteなtrusted trace directoryを明示して、read-onlyのbudget reportを生成します。
493
+
494
+ ```bash
495
+ kyoso-budget-report --trace-dir /absolute/path/to/traces --json
496
+ ```
497
+
498
+ source checkoutではpackage scriptを使います。
499
+
500
+ ```bash
501
+ bun run audit:budget-report -- --trace-dir /absolute/path/to/traces --json
502
+ ```
503
+
504
+ reportはregularな`.jsonl`だけを再帰的に読み、symlinkをskipし、trace pathを推測しません。callをagent、kind、provider route、requested model、requested / reported identity status別に集計し、全callと正常系を分けたnearest-rankのp50 / p95 / p99 / max byte分布、token usage reporting率、output warning / limit率、completion / skip理由を表示します。正常系callは`resultStatus = "completed"`かつ`errorCode`なしを明示したeventだけです。曖昧なhistorical eventは全call統計だけに残します。top-levelのbyte分布とoutput warning / hard limitのcall率はprimaryとverifierだけを対象にし、judge callは全call数とexecution別集計へ残しつつ再較正指標を薄めません。warning call率には同じtrace / kind / agentのcompleted callへ対応付けられたwarning eventだけを含め、重複・孤立warning eventは別に表示します。JSONは固定された入力上限を`inputLimits`へ出し、file、byte、line、event、call、review、warning、group、reason、directoryのいずれかが上限を超えた場合は切り詰めずに停止します。走査は、検証済みcurrent directoryを指定rootのdevice / inodeへ固定した専用workerで行い、recursive descentでもdirectory identityを再検証するため、lexical rootを差し替えて元に戻しても読み取り先は変わりません。fileはsymlinkをfollowしないnon-blocking openで読み、discovery時のsizeを超えて消費しません。platformがこれらのopen capabilityを提供できなければreportを中止します。metadata sanitizeはdefense in depthであるため、operatorがtrustedと判断したtrace directoryだけを指定してください。bytesからtokenや費用を推定換算しません。再較正ではsoft warningを正常系p99の2倍以上に置き、hard breakerをwarningより十分高くして正常系発火率をほぼ0に保ち、policy変更前にprovider / model別のtoken usage unknown率を確認します。
505
+
481
506
  Raw agent output は既定で無効です。`audit.includeFileContents` は reserved で `false` に固定され、この設定から file contents が保存されることはありません。`audit.includeRawAgentOutput`を有効にすると、traces に sensitive review output が残る場合があります。local retention policy に従って古い traces を削除してください。Windowsまたは安全なfilesystem capabilityを証明できない環境では、Audit trace writeは無効のままで、reviewはsanitized warningを返します([Safety Model](#safety-model) を参照)。
482
507
 
483
508
  ## Safety Model
@@ -498,7 +523,12 @@ Windows、および必要なfilesystem capabilityを証明できない環境で
498
523
 
499
524
  ## 移行
500
525
 
526
+ ### アップグレード時の注意
527
+
501
528
  - Project `kyoso.toml` の `tools.*` は user-global config へ移してください。repository content が review を無効化できないよう、project-owned tool availability は拒否されます。
529
+
530
+ ### 導入モードの切り替え
531
+
502
532
  - 手動MCPからCLI+Skill: CLIとSkillを先に導入し、`codex mcp remove kyoso`または`claude mcp remove kyoso --scope local|project|user`を実行します。
503
533
  - CLI+SkillからPlugin: Pluginを追加してenabledを確認してから、手動MCP登録を削除します。手動コピーSkillは自動削除しません。
504
534
  - PluginからCLI+Skill: CLIとSkillを先に導入し、`codex plugin remove kyoso@kyoso`を実行します。
@@ -506,7 +536,7 @@ Windows、および必要なfilesystem capabilityを証明できない環境で
506
536
 
507
537
  ## Troubleshooting
508
538
 
509
- - MCP timeout: client tool timeouts を少なくとも 360 秒、`verification.enabled` が true の場合は少なくとも 480 秒に設定してください。Kyoso defaults は [Timeouts](#timeouts) を参照してください。
539
+ - MCP timeout: client timeoutはreview-wide deadlineより長くしてください。35分presetではCodexに2160秒、Claude Codeに`MCP_TOOL_TIMEOUT=2160000`を設定します。[Timeouts](#timeouts)を参照してください。
510
540
  - Fresh npm release: safe-chain などの minimum-package-age protection により、publish 直後は `npx @kyo-so/cli` の解決が一時的に block される場合があります。
511
541
  - Deprecated TypeScript config: `--trust-config` を渡さない限り、untrusted `kyoso.config.ts` は skip されます。新規設定は `kyoso.toml` を使ってください。
512
542
  - OpenRouter key missing: 空でないCodex `model`、Kyoso processへ転送された`OPENROUTER_API_KEY`、clientの再起動を確認し、`kyoso doctor`を実行してください。Marketplace Plugin `0.4.0`以降はこの変数名をKyoso processへ転送し、それ以前のversionは転送しません。既存MCP registrationはsetupで再書換えされません。
package/README.md CHANGED
@@ -48,11 +48,9 @@ When in doubt, pick the Marketplace Plugin: two commands install the Skill and t
48
48
 
49
49
  The Plugin bundles the Skill and an MCP definition pinned to an exact published Kyoso CLI version; it does not bundle the CLI itself. Its first MCP start needs network access to npm. A cached package may work offline, but offline startup is not guaranteed. The manifest's `Read` capability is display metadata, not additional filesystem authorization.
50
50
 
51
- The `kyoso setup ... --with-openrouter` output and manual setup examples remain user-managed client-registration templates. Marketplace Plugin `0.5.0` is pinned to `@kyo-so/cli@0.11.0`.
52
-
53
51
  The Plugin Skill declares the bundled `kyoso` MCP server as a dependency, so explicit Kyoso reviews are directed through MCP rather than a CLI fallback. If you disable the bundled Plugin MCP, treat the Plugin Skill as unavailable: re-enable it, or remove the Plugin and install CLI plus Skill-only instead. The Plugin is not a CLI-fallback mode.
54
52
 
55
- Marketplace Plugin `0.4.0` exposes the `OPENROUTER_API_KEY` variable name to its MCP process; it does not store a credential value. Kyoso forwards the value only to a Codex child that explicitly selects OpenRouter, and treats an unexpanded placeholder as missing.
53
+ For OpenRouter key forwarding through the Plugin, see [Codex OpenRouter project opt-in](#codex-openrouter-project-opt-in).
56
54
 
57
55
  #### CLI plus Skill-only
58
56
 
@@ -179,7 +177,7 @@ kyoso plan \
179
177
  --file src/auth/callback.ts
180
178
  ```
181
179
 
182
- Read the result from the top down: `Decision` is the deterministic gate outcome, `Coverage` shows which required lenses and perspectives ran, and each finding's `disposition` says whether it blocks or only informs the review.
180
+ Read the result from the top down: `Decision` is the deterministic gate outcome, `Coverage` shows which required lenses and perspectives ran, and each finding's `disposition` says whether it blocks or only informs the review (see [Review contract and finding admission](#review-contract-and-finding-admission)).
183
181
 
184
182
  Run a CISA Secure by Design security review against a patch:
185
183
 
@@ -224,6 +222,18 @@ Kyoso exposes exactly these MCP tools:
224
222
 
225
223
  MCP stdout is reserved for protocol messages. Logs go to stderr or local audit traces.
226
224
 
225
+ ## Skill
226
+
227
+ The bundled `kyoso-review` skill is intentionally narrow. It should trigger only when you explicitly ask for Kyoso, multi-agent review, plan review, security review, CISA Secure by Design review, or diff review.
228
+
229
+ The Skill uses the first available path: Kyoso MCP tools, an installed `kyoso` on `PATH`, `npx -y @kyo-so/cli`, then `bunx @kyo-so/cli`. The package-runner fallbacks may need network access and can drift to a newer version, so an installed CLI is the normal MCP-less path. If a typed [review contract](#review-contract-and-finding-admission) contains non-goals or accepted risks and MCP is unavailable, the Skill stops because the CLI fallback can preserve only `focus`.
230
+
231
+ `kyoso setup codex --write --skill-only` copies the canonical Skill directory to `.agents/skills/kyoso-review/` by default. Add `--global` to copy it to `~/.agents/skills/kyoso-review/`.
232
+
233
+ `kyoso setup claude-code --write --skill-only` copies it to `.claude/skills/kyoso-review/` by default. Add `--global` to copy it to `~/.claude/skills/kyoso-review/`.
234
+
235
+ Managed installs record the canonical directory digest and CLI version in `.kyoso-install.json`. Exact current or known historical copies are adopted and updated automatically. A changed or unknown copy is reported as a conflict and left untouched; `--force` replaces only that Skill directory and never removes or overwrites MCP configuration.
236
+
227
237
  ## Review contract and finding admission
228
238
 
229
239
  Every review includes a non-removable safety floor: correctness, regression, security boundaries, secrets/injection, data integrity, and public contract. Kyoso also adds supply-chain, privacy, and resource-amplification lenses when the review shape calls for them. User-global `reviewPolicy.additionalLenses` can add more lenses; it cannot remove the floor.
@@ -258,18 +268,6 @@ Kyoso recalculates every finding's evidence quality, relation to the reviewed ch
258
268
 
259
269
  Only `gate` and `actionable` findings affect the deterministic decision. A `disputed` finding makes completion incomplete and must not be auto-fixed. `coverage` records required/attempted lenses, required/completed perspectives, and whether independent cross-model review occurred. `Tests to Add` contains at most three concrete regression tests; generic commands and broad test-suite requests are omitted.
260
270
 
261
- ## Skill
262
-
263
- The bundled `kyoso-review` skill is intentionally narrow. It should trigger only when you explicitly ask for Kyoso, multi-agent review, plan review, security review, CISA Secure by Design review, or diff review.
264
-
265
- The Skill uses the first available path: Kyoso MCP tools, an installed `kyoso` on `PATH`, `npx -y @kyo-so/cli`, then `bunx @kyo-so/cli`. The package-runner fallbacks may need network access and can drift to a newer version, so an installed CLI is the normal MCP-less path. If a typed contract contains non-goals or accepted risks and MCP is unavailable, the Skill stops because the CLI fallback can preserve only `focus`.
266
-
267
- `kyoso setup codex --write --skill-only` copies the canonical Skill directory to `.agents/skills/kyoso-review/` by default. Add `--global` to copy it to `~/.agents/skills/kyoso-review/`.
268
-
269
- `kyoso setup claude-code --write --skill-only` copies it to `.claude/skills/kyoso-review/` by default. Add `--global` to copy it to `~/.claude/skills/kyoso-review/`.
270
-
271
- Managed installs record the canonical directory digest and CLI version in `.kyoso-install.json`. Exact current or known historical copies are adopted and updated automatically. A changed or unknown copy is reported as a conflict and left untouched; `--force` replaces only that Skill directory and never removes or overwrites MCP configuration.
272
-
273
271
  ## Configuration
274
272
 
275
273
  ### Files and precedence
@@ -295,9 +293,6 @@ Global TOML is for user-owned settings that can launch commands or forward envir
295
293
  [agents.codex]
296
294
  command = "bunx"
297
295
  args = ["@agentclientprotocol/codex-acp"]
298
- # Authorize only this exact project directory to select `provider` or override
299
- # a model while OpenRouter is inherited.
300
- allowProjectProvider = ["/absolute/path/to/project"]
301
296
 
302
297
  [agents.codex.env]
303
298
  CODEX_CONFIG = '{"model":"gpt-5.5"}'
@@ -307,7 +302,7 @@ CODEX_CONFIG = '{"model":"gpt-5.5"}'
307
302
 
308
303
  ### Agents
309
304
 
310
- Agent keys: `agents.<codex|claude>.<enabled|model|effort|role|timeoutMs>`. Codex also supports `agents.codex.provider`: `"openrouter"` selects the external provider, while `"default"` resets an inherited OpenRouter selection to normal Codex behavior; Claude has no provider setting. `agents.codex.allowProjectProvider` is a global-config-only allowlist of absolute project directories: it authorizes only an exact matching project TOML to select `provider` or override `model` while OpenRouter is inherited, with no descendant or glob matching. Project config and `--set` cannot change it, and legacy boolean values are rejected. The `command`, `args`, and `env` keys are also global-config-only (see [Files and precedence](#files-and-precedence)).
305
+ Agent keys: `agents.<codex|claude>.<enabled|model|effort|role|timeoutMs>`. Codex also supports `agents.codex.provider`: `"openrouter"` selects the external provider, while `"default"` resets an inherited OpenRouter selection to normal Codex behavior; Claude has no provider setting. Selecting the provider from a project requires the global-config-only `agents.codex.allowProjectProvider` allowlist; see [Codex OpenRouter project opt-in](#codex-openrouter-project-opt-in) for the full rules. The `command`, `args`, and `env` keys are also global-config-only (see [Files and precedence](#files-and-precedence)).
311
306
 
312
307
  Omit `agents.<name>.model` or `agents.<name>.effort` to use each agent's own default. Codex uses the local Codex config, such as `~/.codex/config.toml` (or `$CODEX_HOME/config.toml` when `CODEX_HOME` is set); Claude uses the adapter default.
313
308
 
@@ -351,7 +346,7 @@ model = "openai/o4-mini"
351
346
 
352
347
  `model` is required and must not be blank when `provider = "openrouter"`. It is an OpenRouter model ID; Kyoso does not validate the catalog or whether that model supports tool calling, so confirm tool support with the provider.
353
348
 
354
- `allowProjectProvider` applies to a project `provider` and to a project `model` override while OpenRouter is inherited; its list must contain the absolute canonical directory containing the resolved project configuration file, not the invocation cwd or a lexical path. A project configuration file (including trusted `kyoso.config.ts`) and an allowlist entry that resolve through symlinks to that directory match; entries resolving elsewhere, or unresolvable paths, fail closed. A user-global `provider = "openrouter"` needs no allowlist entry. An explicit CLI pair of `--set agents.codex.provider=openrouter` and `--set agents.codex.model=<model>` in the same invocation is also allowed without it; a project model cannot supply the CLI override's model. `allowProjectProvider` is not a `--set` path and legacy boolean values are rejected.
349
+ `allowProjectProvider` applies to a project `provider` and to a project `model` override while OpenRouter is inherited; its list must contain the absolute canonical directory containing the resolved project configuration file, not the invocation cwd or a lexical path, with no descendant or glob matching. A project configuration file (including trusted `kyoso.config.ts`) and an allowlist entry that resolve through symlinks to that directory match; entries resolving elsewhere, or unresolvable paths, fail closed. A user-global `provider = "openrouter"` needs no allowlist entry. An explicit CLI pair of `--set agents.codex.provider=openrouter` and `--set agents.codex.model=<model>` in the same invocation is also allowed without it; a project model cannot supply the CLI override's model. `allowProjectProvider` is not a `--set` path and legacy boolean values are rejected.
355
350
 
356
351
  When a user-global config selects OpenRouter, a project can explicitly opt out with `provider = "default"`. This reset needs neither a model nor authorization, clears the inherited OpenRouter model unless the same layer explicitly supplies a normal Codex model, and prevents OpenRouter key forwarding for that project.
357
352
 
@@ -363,9 +358,9 @@ export OPENROUTER_API_KEY="<secret>"
363
358
 
364
359
  The key is never stored in `kyoso.toml`, Git-managed configuration, Audit traces, or review output. Kyoso forwards it only to the Codex child when this provider is selected, whether it comes from the Kyoso process or explicit `agents.codex.env`. When `provider` is omitted or `provider = "default"`, Kyoso deliberately withholds both sources; a non-empty explicit `agents.codex.env.OPENROUTER_API_KEY` also produces a sanitized warning that it was withheld. The same warning is emitted for a non-empty key in another child configuration, such as `agents.claude.env`, because only the selected Codex OpenRouter child can receive it. Omitting `provider` preserves the existing Codex login, `OPENAI_API_KEY`, `CODEX_API_KEY`, and `CODEX_CONFIG` behavior; removing the line returns to that behavior.
365
360
 
366
- GUI clients may not inherit a shell export. Create a new manual MCP registration with `kyoso setup <client> --write --with-openrouter`, restart the client, then run `kyoso doctor` to confirm that the Kyoso process can detect the key. `kyoso setup` preserves an existing MCP entry instead of rewriting it, so existing registrations need the opt-in allowlist updated manually from [the examples](examples/codex-config.toml).
361
+ The Marketplace Plugin exposes the `OPENROUTER_API_KEY` variable name to its MCP process without storing a credential value. GUI clients may not inherit a shell export. Create a new manual MCP registration with `kyoso setup <client> --write --with-openrouter`, restart the client, then run `kyoso doctor` to confirm that the Kyoso process can detect the key. `kyoso setup` preserves an existing MCP entry instead of rewriting it, so existing registrations need the opt-in allowlist updated manually from [the examples](examples/codex-config.toml).
367
362
 
368
- New manual MCP registrations omit `OPENROUTER_API_KEY` by default. Add it only with `--with-openrouter` after intentionally selecting the provider; existing registrations are never rewritten. In a Claude Code registration, `${OPENROUTER_API_KEY}` must be expanded by the client; Kyoso ignores only a whole unexpanded credential placeholder — `${NAME}`, `$NAME`, or `%NAME%`, with optional surrounding whitespace — and emits a sanitized warning containing only the variable name. Values with any other text are preserved. The same rule applies to custom credential-like names ending in `_KEY`, `_TOKEN`, `_SECRET`, or `_PASSWORD`; non-credential templates are preserved.
363
+ New manual MCP registrations omit `OPENROUTER_API_KEY` by default. Add it only with `--with-openrouter` after intentionally selecting the provider; existing registrations are never rewritten. The `kyoso setup ... --with-openrouter` output and the manual setup examples remain user-managed client-registration templates. In a Claude Code registration, `${OPENROUTER_API_KEY}` must be expanded by the client; Kyoso ignores only a whole unexpanded credential placeholder — `${NAME}`, `$NAME`, or `%NAME%`, with optional surrounding whitespace — and emits a sanitized warning containing only the variable name. Values with any other text are preserved. The same rule applies to custom credential-like names ending in `_KEY`, `_TOKEN`, `_SECRET`, or `_PASSWORD`; non-credential templates are preserved.
369
364
 
370
365
  Prefer this user-authorized project-scoped opt-in. A global `provider = "openrouter"` is inherited by projects until a project sets `provider = "default"`; merely omitting `provider` does not unset it. The fixed OpenRouter Responses API preset is beta; custom endpoints, provider routing, fallbacks, and judge integration are not exposed. To keep the key bound to that preset, OpenRouter mode rejects a `CODEX_CONFIG` with a top-level `profile` or `profiles` field and rejects a non-object `model_providers` value before launching the child. For an object value, it replaces `model_providers` with only the fixed `kyoso-openrouter` entry and emits a sanitized warning with the discarded-entry count only; provider IDs and configuration values never appear. Apart from those rejected fields, it preserves unrelated `CODEX_CONFIG` fields outside `model`, `model_provider`, and `model_providers`, so no foreign provider configuration can select an endpoint with the key. Claude remains on its configured provider, and the judge does not use `OPENROUTER_API_KEY`.
371
366
 
@@ -422,20 +417,40 @@ This mode does not provide independent cross-model validation and may retain sel
422
417
 
423
418
  ### Execution budget and review stopping
424
419
 
425
- Every review has a user-global hard ceiling for model calls, total wall time, streamed agent text (message and thought chunks), and findings per agent:
420
+ Every review has user-global hard ceilings for model calls, total wall time, and streamed agent text (message and thought chunks). Streamed text also has a lower soft-warning threshold, while findings per agent is a soft target:
426
421
 
427
422
  ```toml
428
423
  [reviewBudget]
429
424
  maxModelCalls = 4
430
- maxTotalWallTimeMs = 480000
431
- maxAgentOutputBytes = 65536
425
+ maxTotalWallTimeMs = 660000
426
+ warnAgentOutputBytes = 524288
427
+ maxAgentOutputBytes = 1048576
432
428
  maxFindingsPerAgent = 10
433
- skipOptionalPhasesWhenTokenUsageUnknown = true
429
+ skipOptionalPhasesWhenTokenUsageUnknown = false
430
+ ```
431
+
432
+ `reviewBudget` is user-global only: project `kyoso.toml` and `--set` cannot change it. MCP and library requests may lower a ceiling through `options.reviewBudget`, never raise it. The 512 KiB warning is non-blocking, the 1 MiB limit cancels the call, and the ten-finding target does not discard additional material findings. Unknown token usage warns and continues by default; an explicit user-global `true` preserves strict optional-phase skipping. Kyoso reserves both primary reviewers before starting either one, uses any residual calls for verification, and treats the LLM judge as advisory. The default judge mode is `deterministic_only`.
433
+
434
+ The result includes `completion`, `executionBudget`, and `requestFingerprint`; Markdown and Audit show call counts, wall time, message/thought/total output bytes, and reported, partial, or unknown token usage. Each completed model call can also expose `executionIdentity`, separating the Kyoso route and requested model from provider-reported identity; requested-only values are never presented as provider reports. If `completion.status` is `incomplete`, Kyoso returns a normal `block` result with `retryable: false`: the block means review coverage is incomplete, not that a code defect was established. Do not automatically retry the same fingerprint. At one review checkpoint, the bundled Skill permits one initial pass and one confirmation pass only after material fixes; a third pass requires explicit user approval.
435
+
436
+ ### Timeouts
437
+
438
+ Default agent timeouts are 600 seconds for both Codex and Claude; the verification round defaults to 90 seconds. The review-wide deadline defaults to 660 seconds (`reviewBudget.maxTotalWallTimeMs`), leaving the standard 60-second finalization margin after the default parallel primary phase. Each phase uses the remaining deadline rather than extending it. `kyoso doctor` reports the configured sequential phase time and a recommended review-wide deadline with a 10% or 60-second margin, whichever is larger. It includes an LLM judge timeout only when the judge mode permits it and a direct-provider credential is available.
439
+
440
+ This repository's 15-minute primary plus 15-minute verification dogfooding preset uses the following user-global override:
441
+
442
+ ```toml
443
+ [reviewBudget]
444
+ maxTotalWallTimeMs = 2100000
434
445
  ```
435
446
 
436
- `reviewBudget` is user-global only: project `kyoso.toml` and `--set` cannot change it. MCP and library requests may lower a ceiling through `options.reviewBudget`, never raise it. Kyoso reserves both primary reviewers before starting either one, uses any residual calls for verification, and treats the LLM judge as advisory. The default judge mode is `deterministic_only`.
447
+ The Codex Plugin and newly generated manual Codex registrations use `tool_timeout_sec = 2160`, leaving 60 seconds beyond that 35-minute Kyoso deadline. Existing manual registrations are preserved by `kyoso setup` and must be updated manually. The Claude Code Plugin manifest does not set a client tool timeout; launch Claude Code with the equivalent millisecond value, then restart the client:
448
+
449
+ ```bash
450
+ MCP_TOOL_TIMEOUT=2160000 claude
451
+ ```
437
452
 
438
- The result includes `completion`, `executionBudget`, and `requestFingerprint`; Markdown and Audit show call counts, wall time, output bytes, and reported or unknown token usage. If `completion.status` is `incomplete`, Kyoso returns a normal `block` result with `retryable: false`: the block means review coverage is incomplete, not that a code defect was established. Do not automatically retry the same fingerprint. At one review checkpoint, the bundled Skill permits one initial pass and one confirmation pass only after material fixes; a third pass requires explicit user approval.
453
+ Increasing the client timeout does not extend Kyoso's internal review-wide deadline. For other presets, keep the client timeout longer than `reviewBudget.maxTotalWallTimeMs`.
439
454
 
440
455
  ### Verification
441
456
 
@@ -462,10 +477,6 @@ Judge keys: `judge.<mode|provider|timeoutMs>`. Judge LLMs are optional and defau
462
477
 
463
478
  Judge defaults intentionally use lightweight models. For a stronger judge, set `KYOSO_ANTHROPIC_JUDGE_MODEL` to a Sonnet-class model such as `claude-sonnet-5`.
464
479
 
465
- ### Timeouts
466
-
467
- Default agent timeouts are Codex 120 seconds and Claude 300 seconds; the verification round defaults to 90 seconds. The review-wide deadline defaults to 480 seconds, and each phase uses the remaining deadline rather than extending it. MCP clients should allow at least 480 seconds for tool calls.
468
-
469
480
  ### Audit
470
481
 
471
482
  On supported POSIX runtimes, Audit traces are written below the user state base (`$XDG_STATE_HOME` when absolute, otherwise `$HOME/.local/state`):
@@ -476,6 +487,20 @@ On supported POSIX runtimes, Audit traces are written below the user state base
476
487
 
477
488
  `audit.directory` is a logical relative directory (default: `.kyoso/traces`), not a directory in the workspace. Existing workspace `.kyoso/traces` files are not migrated or deleted automatically.
478
489
 
490
+ Generate a read-only budget report from the installed package by supplying an absolute trusted trace directory explicitly:
491
+
492
+ ```bash
493
+ kyoso-budget-report --trace-dir /absolute/path/to/traces --json
494
+ ```
495
+
496
+ From a source checkout, use the package script:
497
+
498
+ ```bash
499
+ bun run audit:budget-report -- --trace-dir /absolute/path/to/traces --json
500
+ ```
501
+
502
+ The report recursively reads regular `.jsonl` files only, skips symlinks, and never infers a trace path. It groups calls by agent, kind, provider route, requested model, and requested/reported identity status; reports separate all-call and normal-path nearest-rank p50/p95/p99/max byte distributions, token-usage reporting rates, output-warning/limit rates, and completion/skip reasons; and never converts bytes into estimated tokens or cost. A normal-path call explicitly has `resultStatus = "completed"` and no `errorCode`; ambiguous historical events remain in all-call statistics only. Top-level byte distributions and output-warning/hard-limit call rates use primary and verifier calls; judge calls remain in all-call and per-execution totals but do not dilute recalibration metrics. Warning call rates include only warning events correlated to a completed call with the same trace, kind, and agent; duplicate or orphan warning events are reported separately. The JSON exposes fixed ingestion bounds as `inputLimits`, and the command aborts instead of truncating when file, byte, line, event, call, review, warning, group, reason, or directory bounds are exceeded. Traversal runs in a dedicated worker whose validated current directory is bound to the supplied root's device and inode; recursive descent revalidates each directory identity, so replacing and restoring the lexical root cannot redirect reads. File reads use no-follow, non-blocking opens and never consume beyond the discovered size; the report aborts when the platform cannot provide those open capabilities. Metadata sanitization is defense in depth, so supply only an operator-trusted trace directory. For recalibration, keep a soft warning at least twice the normal-path p99, place the hard breaker well above the warning so its normal trigger rate stays near zero, and inspect unknown token-usage rates by provider/model before changing policy.
503
+
479
504
  Raw agent output is disabled by default. `audit.includeFileContents` is reserved and fixed to `false`; file contents are never persisted through that setting. If `audit.includeRawAgentOutput` is enabled, traces may persist sensitive review output; delete old traces according to your local retention policy. On Windows or an environment without proven safe filesystem capabilities, Audit trace writing stays disabled and the review returns a sanitized warning (see [Safety Model](#safety-model)).
480
505
 
481
506
  ## Safety Model
@@ -496,7 +521,12 @@ Windows, and environments where the required filesystem capabilities cannot be p
496
521
 
497
522
  ## Migration
498
523
 
524
+ ### Upgrade notes
525
+
499
526
  - Move any project `tools.*` settings from `kyoso.toml` to user-global config. Project-owned tool availability is now rejected so repository content cannot disable reviews.
527
+
528
+ ### Switching integration modes
529
+
500
530
  - Manual MCP to CLI plus Skill: install the CLI and Skill first, then run `codex mcp remove kyoso` or `claude mcp remove kyoso --scope local|project|user`.
501
531
  - CLI plus Skill to Plugin: add the Plugin, confirm it is enabled, then remove the manual MCP registration. Manually copied Skills are not removed automatically.
502
532
  - Plugin to CLI plus Skill: install the CLI and Skill first, then run `codex plugin remove kyoso@kyoso`.
@@ -504,7 +534,7 @@ Windows, and environments where the required filesystem capabilities cannot be p
504
534
 
505
535
  ## Troubleshooting
506
536
 
507
- - MCP timeout: set client tool timeouts to at least 360 seconds, or at least 480 seconds when `verification.enabled` is true. See [Timeouts](#timeouts) for the Kyoso defaults.
537
+ - MCP timeout: keep the client timeout longer than the review-wide deadline. For the 35-minute preset, use 2160 seconds in Codex or `MCP_TOOL_TIMEOUT=2160000` in Claude Code. See [Timeouts](#timeouts).
508
538
  - Fresh npm release: minimum-package-age protection in tools such as safe-chain may briefly block `npx @kyo-so/cli` resolution after publish.
509
539
  - Deprecated TypeScript config: untrusted `kyoso.config.ts` is skipped unless you pass `--trust-config`; prefer `kyoso.toml`.
510
540
  - OpenRouter key missing: confirm a non-empty Codex `model`, an `OPENROUTER_API_KEY` forwarded to the Kyoso process, and a restarted client; run `kyoso doctor`. Marketplace Plugin `0.4.0` and later forward this variable name to the Kyoso process; earlier versions do not. Existing MCP registrations are not rewritten by setup.