rebut-mcp 0.2.0 → 0.3.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.
Files changed (37) hide show
  1. package/README.en.md +15 -46
  2. package/README.ja.md +15 -46
  3. package/README.md +15 -47
  4. package/README.zh-CN.md +15 -46
  5. package/config.example.json +9 -0
  6. package/docs/guide/en/configuration.md +55 -65
  7. package/docs/guide/en/installation.md +64 -56
  8. package/docs/guide/en/operations.md +36 -28
  9. package/docs/guide/en.md +5 -16
  10. package/docs/guide/ja/configuration.md +55 -65
  11. package/docs/guide/ja/installation.md +64 -56
  12. package/docs/guide/ja/operations.md +36 -28
  13. package/docs/guide/ja.md +5 -16
  14. package/docs/guide/ko/configuration.md +55 -65
  15. package/docs/guide/ko/installation.md +64 -56
  16. package/docs/guide/ko/operations.md +38 -28
  17. package/docs/guide/ko.md +5 -16
  18. package/docs/guide/zh-CN/configuration.md +55 -65
  19. package/docs/guide/zh-CN/installation.md +64 -56
  20. package/docs/guide/zh-CN/operations.md +36 -28
  21. package/docs/guide/zh-CN.md +5 -16
  22. package/docs/releases/release-checklist.ko.md +27 -0
  23. package/lib/cli.mjs +1366 -754
  24. package/package.json +2 -1
  25. package/src/contracts.ts +40 -3
  26. package/docs/guide/en/architecture.md +0 -29
  27. package/docs/guide/en/reviewer-integration.md +0 -16
  28. package/docs/guide/en/validation.md +0 -38
  29. package/docs/guide/ja/architecture.md +0 -29
  30. package/docs/guide/ja/reviewer-integration.md +0 -16
  31. package/docs/guide/ja/validation.md +0 -38
  32. package/docs/guide/ko/architecture.md +0 -29
  33. package/docs/guide/ko/reviewer-integration.md +0 -16
  34. package/docs/guide/ko/validation.md +0 -38
  35. package/docs/guide/zh-CN/architecture.md +0 -29
  36. package/docs/guide/zh-CN/reviewer-integration.md +0 -16
  37. package/docs/guide/zh-CN/validation.md +0 -38
package/README.en.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Rebut
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
6
+ [![npm downloads](https://img.shields.io/npm/dm/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
7
+ [![MIT license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/abruption/rebut/blob/main/LICENSE)
8
+
5
9
  **Local-first independent code review MCP. Cloudflare Worker is optional.**
6
10
 
7
11
  [한국어](README.md) · **English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
8
12
 
9
13
  </div>
10
14
 
11
- Rebut reviews code using your own OpenAI API key. New installations run a local stdio server without a Cloudflare account or a separate HTTP daemon.
12
-
13
- Review material is sent to the OpenAI API; the local ledger stores only request and usage metadata.
15
+ An MCP for reviewing supplied code and diffs through OpenAI or Claude APIs. Review material is sent to the selected provider.
14
16
 
15
- The tested release targets macOS/Linux; Windows behavior and ACLs are not validated.
17
+ On 0.3.0+, select Claude with `rebut set provider anthropic`, then `rebut set api-key` and `rebut setup --client claude`. Host and provider are independent.
16
18
 
17
19
  ## Quick start
18
20
 
19
- Use Node.js 24 or later. This example uses macOS Keychain.
21
+ Requires Node.js 24+. This example uses macOS Keychain.
20
22
 
21
23
  ```sh
22
24
  npm install -g rebut-mcp
@@ -25,49 +27,16 @@ rebut setup --client codex
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- `rebut set api-key` accepts hidden OpenAI API key input and stores it in Keychain. On Linux and other environments, select `rebut set secret-store env` and supply `REBUT_OPENAI_API_KEY` through the actual MCP host’s secure environment. Setup records the variable name only; never put keys in arguments or tracked files.
29
-
30
- ## Optional Worker
31
-
32
- Choose a self-hosted Worker when multiple machines need a shared budget and request ledger. `rebut set endpoint URL` selects Worker mode. On macOS, `rebut set token` stores the separate Worker access token. The OpenAI API key, Worker access token and admin token are different credentials.
33
-
34
- ```sh
35
- rebut set endpoint https://YOUR_HOST/mcp
36
- rebut setup --client codex --replace
37
- ```
38
-
39
- Existing endpoint configurations remain in Worker mode. Switch explicitly with `rebut set mode local`; failures never trigger automatic backend fallback. Switching does not move existing requests or reservations.
40
-
41
- ## What it does
42
-
43
- - Collect, redact and freeze explicitly supplied files, diffs and requirements, then make one provider call.
44
- - Use atomic budget reservations and deduplication in local SQLite or Worker D1. Source, reviews and keys are not stored in the ledger.
45
- - Return structured findings with supplied file/line evidence, model identity, usage and estimated cost.
46
- - Expose review and metadata-only review_status. Keep the same ID after uncertainty and do not replay an unknown on another backend.
47
-
48
- Example defaults are $6.66/day and $200/month in UTC, one pending/unknown request, and 100 new requests/day. **Local limits cover only that device’s data directory**: they do not aggregate another Mac, Worker, external API usage or the OpenAI account balance. Worker users share that deployment’s ledger. Estimates are not invoices; uncertain executions keep their reservations and slots.
30
+ Restart Codex after registration. See [installation](docs/guide/en/installation.md) for Linux/env and Vaultwarden.
49
31
 
50
- The provider waiting ceiling is 30 minutes, with corresponding HTTP/MCP and Codex deadlines. Local profile changes require OS ownership; Worker changes use separate admin authentication. See [installation](docs/guide/en/installation.md) and [configuration](docs/guide/en/configuration.md) for credentials, models, budgets and optional Worker deployment.
32
+ New installations use local stdio. Choose [Worker mode](docs/guide/en/installation.md#optional-worker-deployment) to share budgets and request history across devices. Existing Worker settings remain unchanged.
51
33
 
52
- ## Developer validation
53
-
54
- ```sh
55
- npm ci --ignore-scripts
56
- npm run typecheck
57
- npm run build
58
- npm test
59
- npm run test:package
60
- ```
34
+ `review` is a paid call; `doctor --connect` checks connectivity without a paid review. Keep the same request ID when the result is uncertain.
61
35
 
62
- Automated tests and package smoke tests mock the provider. Default real API tests use gpt-6-luna; production uses gpt-6-astra / medium. Luna success does not establish Astra review quality.
36
+ ## Guides
63
37
 
64
- ## Documentation
38
+ - [Installation](docs/guide/en/installation.md)
39
+ - [Configuration](docs/guide/en/configuration.md)
40
+ - [Operations](docs/guide/en/operations.md)
65
41
 
66
- - [User guide](docs/guide/en.md)
67
- - [Installation and input collection](docs/guide/en/installation.md)
68
- - [Configuration, budgets and MCP contract](docs/guide/en/configuration.md)
69
- - [Operations and recovery](docs/guide/en/operations.md)
70
- - [Opt-in reviewer integration](docs/guide/en/reviewer-integration.md)
71
- - [Architecture](docs/guide/en/architecture.md)
72
- - [Validation and limits of the results](docs/guide/en/validation.md)
73
- - [MIT license](LICENSE)
42
+ [Releases](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/README.ja.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Rebut
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
6
+ [![npm downloads](https://img.shields.io/npm/dm/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
7
+ [![MIT license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/abruption/rebut/blob/main/LICENSE)
8
+
5
9
  **ローカル実行を標準とする独立コードレビューMCP。Cloudflare Workerは任意です。**
6
10
 
7
11
  [한국어](README.md) · [English](README.en.md) · [简体中文](README.zh-CN.md) · **日本語**
8
12
 
9
13
  </div>
10
14
 
11
- Rebutは自分のOpenAI APIキーでコードをレビューします。新規インストールはローカルstdioサーバーとして動作し、Cloudflareアカウントや別のHTTPデーモンは不要です。
12
-
13
- レビュー資料はOpenAI APIへ送信し、ローカル台帳には要求・使用量メタデータのみ保存します。
15
+ 提供したコードと diff を OpenAI または Claude API でレビューする MCP です。資料は選択したプロバイダーに送信します。
14
16
 
15
- 検証対象はmacOS/Linuxで、Windows動作・ACLは未検証です。
17
+ 0.3.0 以降の Claude 対応は `rebut set provider anthropic` → `rebut set api-key` → `rebut setup --client claude` の順です。ホストとプロバイダーは別々に選びます。
16
18
 
17
19
  ## クイックスタート
18
20
 
19
- Node.js 24以降が必要です。以下はmacOS Keychainを使う例です。
21
+ Node.js 24 以上が必要です。以下は macOS Keychain の例です。
20
22
 
21
23
  ```sh
22
24
  npm install -g rebut-mcp
@@ -25,49 +27,16 @@ rebut setup --client codex
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- `rebut set api-key` はOpenAI APIキーを非表示入力で受け取りKeychainに保存します。Linux等では `rebut set secret-store env` を選び、実際のMCPホストの安全な環境で `REBUT_OPENAI_API_KEY` を提供してください。登録には変数名だけを記録し、キーを引数や追跡対象ファイルに書きません。
29
-
30
- ## 任意のWorker
31
-
32
- 複数端末で予算と要求台帳を共有する場合はセルフホストのWorkerを選べます。`rebut set endpoint URL` はWorkerモードを選択します。macOSでは `rebut set token` で別のWorker接続トークンを保存します。OpenAI APIキー・Worker接続トークン・管理者トークンは別の資格情報です。
33
-
34
- ```sh
35
- rebut set endpoint https://YOUR_HOST/mcp
36
- rebut setup --client codex --replace
37
- ```
38
-
39
- 既存endpoint設定はWorkerモードを維持します。`rebut set mode local` で明示的に切り替え、障害時の自動切り替えはしません。切り替えても既存の要求や予約は移行されません。
40
-
41
- ## 主な機能
42
-
43
- - 明示されたファイル・diff・要件だけを収集・秘匿処理・固定し、プロバイダーを1回呼び出します。
44
- - ローカルSQLiteまたはWorker D1で原子的な予算予約と重複排除を行い、原文・レビュー本文・キーは台帳に保存しません。
45
- - 指定ファイル・行の根拠、モデル識別、使用量、推定費用を含む構造化された指摘を返します。
46
- - reviewとメタデータ専用review_statusを提供します。不確かな結果後は同じIDを維持し、unknownを別backendで再実行しません。
47
-
48
- 既定例はUTCで日額$6.66・月額$200、pending/unknown同時1件、日100件の新規要求です。**ローカル制限はその端末のデータディレクトリのみが対象**で、別のMac・Worker・外部API・OpenAIアカウント残高は合算しません。Worker利用者はそのデプロイの台帳を共有します。推定は請求書ではなく、不確かな実行の予約と枠は保持します。
30
+ 登録後に Codex を再起動してください。Linux/env・Vaultwarden 設定は[インストール](docs/guide/ja/installation.md)を参照してください。
49
31
 
50
- プロバイダー待機上限は30分で、HTTP/MCP・Codexの期限も合わせます。ローカルプロファイルはOS所有者、Workerは別の管理者認証で管理します。資格情報・モデル・予算・任意のWorkerデプロイは[インストール](docs/guide/ja/installation.md)と[設定](docs/guide/ja/configuration.md)を参照してください。
32
+ 新規インストールはローカル stdio を使います。端末間で予算・台帳を共有する場合は [Worker モード](docs/guide/ja/installation.md#任意の-worker-デプロイ)を選択します。既存 Worker 設定は維持します。
51
33
 
52
- ## 開発者向け検証
53
-
54
- ```sh
55
- npm ci --ignore-scripts
56
- npm run typecheck
57
- npm run build
58
- npm test
59
- npm run test:package
60
- ```
34
+ `review` は有料呼び出しです。`doctor --connect` は有料レビューなしで接続確認を行います。結果が不明なら同じリクエスト ID を維持してください。
61
35
 
62
- 自動テストとパッケージsmokeはプロバイダーを模擬します。既定の実APIテストはgpt-6-luna、運用はgpt-6-astra / mediumです。Lunaの成功はAstraのレビュー品質を証明しません。
36
+ ## ガイド
63
37
 
64
- ## ドキュメント
38
+ - [インストール](docs/guide/ja/installation.md)
39
+ - [設定](docs/guide/ja/configuration.md)
40
+ - [運用](docs/guide/ja/operations.md)
65
41
 
66
- - [ユーザーガイド](docs/guide/ja.md)
67
- - [インストールと入力の収集](docs/guide/ja/installation.md)
68
- - [設定、予算、MCP 仕様](docs/guide/ja/configuration.md)
69
- - [運用と復旧](docs/guide/ja/operations.md)
70
- - [明示的に選択するレビュアーの統合](docs/guide/ja/reviewer-integration.md)
71
- - [アーキテクチャ](docs/guide/ja/architecture.md)
72
- - [検証と結果の限界](docs/guide/ja/validation.md)
73
- - [MIT ライセンス](LICENSE)
42
+ [リリース](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/README.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Rebut
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
6
+ [![npm downloads](https://img.shields.io/npm/dm/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
7
+ [![MIT license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/abruption/rebut/blob/main/LICENSE)
8
+
5
9
  **로컬에서 바로 실행하는 독립 코드 검토 MCP. Cloudflare Worker는 선택 사항입니다.**
6
10
 
7
11
  **한국어** · [English](README.en.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
8
12
 
9
13
  </div>
10
14
 
11
- Rebut은 자신의 OpenAI API 키로 실행하는 코드 검토 도구입니다. 새 설치는 로컬 stdio 서버를 사용하며 Cloudflare 계정이나 별도 HTTP 서버가 필요하지 않습니다.
12
-
13
- 검토 자료는 OpenAI API로 전송하며, 로컬 원장에는 요청·사용량 메타데이터만 저장합니다.
15
+ OpenAI 또는 Claude API로 제공한 코드·diff를 검토하는 MCP입니다. 자료는 선택한 공급자로 전송합니다.
14
16
 
15
- 검증 대상은 macOS/Linux이며 Windows 동작·ACL은 확인하지 않았습니다.
17
+ Claude 지원은 0.3.0 이상에서 `rebut set provider anthropic` → `rebut set api-key` → `rebut setup --client claude` 순서로 설정합니다. 호스트와 공급자는 별도 선택입니다.
16
18
 
17
19
  ## 빠른 시작
18
20
 
19
- Node.js 24 이상이 필요합니다. 다음은 macOS Keychain을 사용하는 예입니다.
21
+ Node.js 24 이상이 필요합니다. macOS Keychain을 사용하는 예입니다.
20
22
 
21
23
  ```sh
22
24
  npm install -g rebut-mcp
@@ -25,50 +27,16 @@ rebut setup --client codex
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- `rebut set api-key`는 OpenAI API 키를 숨김 입력으로 받아 Keychain에 저장합니다. Linux 등에서는 `rebut set secret-store env`를 선택하고 실제 MCP 호스트의 안전한 환경에 `REBUT_OPENAI_API_KEY`를 제공하세요. 설정에는 변수명만 기록하며 키를 인자나 추적 파일에 넣지 않습니다.
29
-
30
- ## Worker 선택
31
-
32
- 여러 기기가 하나의 예산과 요청 장부를 공유하려면 직접 호스팅한 Worker를 선택할 수 있습니다. `rebut set endpoint URL`은 Worker 모드를 선택합니다. macOS에서는 `rebut set token`으로 별도의 Worker 접속 토큰을 저장합니다. OpenAI API 키와 접속·관리자 토큰은 서로 다른 자격증명입니다.
33
-
34
- ```sh
35
- rebut set endpoint https://YOUR_HOST/mcp
36
- rebut setup --client codex --replace
37
- ```
38
-
39
- 기존 endpoint 설정은 Worker 모드로 유지됩니다. `rebut set mode local`로 명시적으로 전환할 수 있으며 장애 시 다른 backend로 자동 대체하지 않습니다. backend 전환은 기존 기록이나 예약을 이전하지 않습니다.
40
-
41
- ## 주요 기능
42
-
43
- - 명시한 파일·diff·요구사항만 수집·마스킹·해시 고정하고 공급자를 한 번 호출합니다.
44
- - 로컬 SQLite 또는 Worker D1에서 원자적 예산 예약과 요청 중복 방지를 적용합니다. 원문·리뷰·키는 장부에 저장하지 않습니다.
45
- - 파일·행 근거, 모델 식별, 사용량, 예상 비용을 포함한 구조화된 검토 결과를 반환합니다.
46
- - `review`와 메타데이터 전용 `review_status`를 제공합니다. unknown 이후 같은 ID를 유지하며 다른 backend로 우회 재실행하지 않습니다.
47
-
48
- 기본 예시는 UTC 하루 $6.66·월 $200, 동시 pending/unknown 한 건, 하루 신규 요청 100건입니다. **로컬 한도는 해당 기기의 데이터 디렉터리에만 적용**됩니다. 다른 Mac·Worker·외부 API 사용량이나 OpenAI 계정 잔액을 합산하지 않습니다. Worker는 해당 배포의 장부를 공유합니다. 예상 비용은 청구서가 아니며 불확실한 실행의 예약과 슬롯은 유지합니다.
30
+ 등록 후 Codex를 재시작하세요. Linux/env·Vaultwarden 설정은 [설치 안내](docs/guide/ko/installation.md)를 참고하세요.
49
31
 
50
- 공급자 대기 상한은 30분이며 HTTP/MCP·Codex의 외부 제한도 함께 조정합니다. 로컬 프로필은 OS 소유자가, Worker 프로필은 별도 관리자 인증으로 관리합니다. 자세한 키 설정·모델·예산·Worker 배포는 [설치](docs/guide/ko/installation.md)와 [설정](docs/guide/ko/configuration.md)을 참고하세요.
32
+ 새 설치는 로컬 stdio를 사용합니다. 여러 기기의 예산·요청 장부를 공유하려면 [Worker 모드](docs/guide/ko/installation.md#선택적-worker-배포)를 선택하세요. 기존 Worker 설정은 유지됩니다.
51
33
 
52
- ## 개발 검증
53
-
54
- ```sh
55
- npm ci --ignore-scripts
56
- npm run typecheck
57
- npm run build
58
- npm test
59
- npm run test:package
60
- ```
34
+ `review`는 유료 호출이며 `doctor --connect`는 유료 검토 없이 연결만 확인합니다. 결과가 불확실하면 같은 요청 ID를 유지하세요.
61
35
 
62
- 자동화 테스트와 패키지 smoke는 공급자를 모의 처리합니다. 기본 실제 API 테스트는 gpt-6-luna, 운영 프로필은 gpt-6-astra / medium이며 Luna 성공으로 Astra 품질을 추론하지 않습니다.
36
+ ## 사용 안내
63
37
 
64
- ## 문서
38
+ - [설치](docs/guide/ko/installation.md)
39
+ - [설정](docs/guide/ko/configuration.md)
40
+ - [운영](docs/guide/ko/operations.md)
65
41
 
66
- - [사용자 가이드](docs/guide/ko.md)
67
- - [설치 및 입력 수집](docs/guide/ko/installation.md)
68
- - [설정, 예산 및 MCP 계약](docs/guide/ko/configuration.md)
69
- - [운영 및 복구](docs/guide/ko/operations.md)
70
- - [선택적 검토자 연동](docs/guide/ko/reviewer-integration.md)
71
- - [아키텍처](docs/guide/ko/architecture.md)
72
- - [검증 및 결과의 한계](docs/guide/ko/validation.md)
73
- - [최초 릴리즈 기록](docs/releases/0.1.0.ko.md) · [0.2.0 릴리즈 후보](docs/releases/0.2.0.ko.md)
74
- - [MIT 라이선스](LICENSE)
42
+ [릴리즈](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/README.zh-CN.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Rebut
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
6
+ [![npm downloads](https://img.shields.io/npm/dm/rebut-mcp)](https://www.npmjs.com/package/rebut-mcp)
7
+ [![MIT license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/abruption/rebut/blob/main/LICENSE)
8
+
5
9
  **默认本地运行的独立代码审查 MCP,可选 Cloudflare Worker。**
6
10
 
7
11
  [한국어](README.md) · [English](README.en.md) · **简体中文** · [日本語](README.ja.md)
8
12
 
9
13
  </div>
10
14
 
11
- Rebut 使用您自己的 OpenAI API 密钥审查代码。新安装默认运行本地 stdio 服务器,无需 Cloudflare 账户或独立 HTTP 守护进程。
12
-
13
- 审查资料会发送至 OpenAI API;本地账本仅存储请求和用量元数据。
15
+ 通过 OpenAI 或 Claude API 审查所提供代码和 diff 的 MCP。材料发送至所选供应商。
14
16
 
15
- 验证目标为 macOS/Linux,Windows 行为与 ACL 未验证。
17
+ 0.3.0+ 的 Claude 支持按 `rebut set provider anthropic` → `rebut set api-key` → `rebut setup --client claude` 设置;宿主与供应商分别选择。
16
18
 
17
19
  ## 快速开始
18
20
 
19
- 需要 Node.js 24 或更高版本。以下示例使用 macOS Keychain。
21
+ 需要 Node.js 24+。本例使用 macOS Keychain。
20
22
 
21
23
  ```sh
22
24
  npm install -g rebut-mcp
@@ -25,49 +27,16 @@ rebut setup --client codex
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- `rebut set api-key` 隐藏输入 OpenAI API 密钥并存入 Keychain。Linux 等环境请选择 `rebut set secret-store env`,通过实际 MCP 宿主的安全环境提供 `REBUT_OPENAI_API_KEY`。配置仅记录变量名,不要把密钥写入参数或受版本控制的文件。
29
-
30
- ## 可选 Worker
31
-
32
- 多台设备需要共享预算和请求账本时,可选择自托管 Worker。`rebut set endpoint URL` 会选择 Worker 模式。macOS 可通过 `rebut set token` 保存独立的 Worker 访问令牌。OpenAI API 密钥、Worker 访问令牌和管理员令牌是不同凭据。
33
-
34
- ```sh
35
- rebut set endpoint https://YOUR_HOST/mcp
36
- rebut setup --client codex --replace
37
- ```
38
-
39
- 已有 endpoint 配置继续使用 Worker 模式。通过 `rebut set mode local` 明确切换;失败不会自动切换后端。切换不会迁移已有请求或预留。
40
-
41
- ## 功能
42
-
43
- - 仅收集、脱敏并冻结明确提供的文件、diff 和要求,再调用供应商一次。
44
- - 在本地 SQLite 或 Worker D1 中进行原子预算预留和去重;账本不存储源码、审查正文或密钥。
45
- - 返回结构化发现、给定文件及行号证据、模型标识、用量与预估成本。
46
- - 提供 review 和仅元数据的 review_status。不确定后保留同一 ID,不在另一后端重放 unknown 请求。
47
-
48
- 默认示例为 UTC 每日 $6.66、每月 $200、一个 pending/unknown 请求及每日 100 个新请求。**本地限额仅覆盖该设备的数据目录**,不汇总另一台 Mac、Worker、外部 API 或 OpenAI 账户余额。Worker 用户共享该部署的账本。预估不是账单;不确定的执行继续占用预留和并发槽。
30
+ 注册后重启 Codex。Linux/env 与 Vaultwarden 设置见[安装指南](docs/guide/zh-CN/installation.md)。
49
31
 
50
- 供应商等待上限为 30 分钟,并配套调整 HTTP/MCP 和 Codex 期限。本地配置方案由 OS 所有者管理;Worker 变更需要独立管理员认证。凭据、模型、预算与可选部署见[安装](docs/guide/zh-CN/installation.md)和[配置](docs/guide/zh-CN/configuration.md)。
32
+ 新安装使用本地 stdio。跨设备共享预算与请求账本时选择 [Worker 模式](docs/guide/zh-CN/installation.md#可选-worker-部署)。已有 Worker 设置保持不变。
51
33
 
52
- ## 开发者验证
53
-
54
- ```sh
55
- npm ci --ignore-scripts
56
- npm run typecheck
57
- npm run build
58
- npm test
59
- npm run test:package
60
- ```
34
+ `review` 是付费调用,`doctor --connect` 仅检查连接,不进行付费审查。结果不确定时保留原请求 ID。
61
35
 
62
- 自动化测试与包 smoke 测试模拟供应商。默认真实 API 测试使用 gpt-6-luna,生产使用 gpt-6-astra / medium。Luna 成功不证明 Astra 的审查质量。
36
+ ## 指南
63
37
 
64
- ## 文档
38
+ - [安装](docs/guide/zh-CN/installation.md)
39
+ - [配置](docs/guide/zh-CN/configuration.md)
40
+ - [运维](docs/guide/zh-CN/operations.md)
65
41
 
66
- - [用户指南](docs/guide/zh-CN.md)
67
- - [安装与输入收集](docs/guide/zh-CN/installation.md)
68
- - [配置、预算与 MCP 契约](docs/guide/zh-CN/configuration.md)
69
- - [运维与恢复](docs/guide/zh-CN/operations.md)
70
- - [可选审查器集成](docs/guide/zh-CN/reviewer-integration.md)
71
- - [架构](docs/guide/zh-CN/architecture.md)
72
- - [验证及结果的局限](docs/guide/zh-CN/validation.md)
73
- - [MIT 许可证](LICENSE)
42
+ [发行记录](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
@@ -15,6 +15,15 @@
15
15
  "inputMicrousdPerMillion": 100000,
16
16
  "outputMicrousdPerMillion": 500000,
17
17
  "priceVersion": "openai-standard-2026-11-12"
18
+ },
19
+ "claude-medium": {
20
+ "provider": "anthropic",
21
+ "model": "claude-opus-5-5",
22
+ "reasoning": "medium",
23
+ "maxOutputTokens": 8192,
24
+ "inputMicrousdPerMillion": 4000000,
25
+ "outputMicrousdPerMillion": 20000000,
26
+ "priceVersion": "anthropic-standard-2026-11-14"
18
27
  }
19
28
  },
20
29
  "limits": {
@@ -1,106 +1,96 @@
1
- # Configuration and MCP contract
1
+ # Configuration
2
2
 
3
3
  [한국어](../ko/configuration.md) · **English** · [简体中文](../zh-CN/configuration.md) · [日本語](../ja/configuration.md)
4
4
 
5
- [Rebut](../../../README.en.md) · [User guide](../en.md)
5
+ [README](../../../README.en.md) · [Installation](installation.md) · [Operations](operations.md)
6
6
 
7
+ ## Modes and storage
7
8
 
8
- ## Local profiles and budget scope
9
+ | Mode | Selection | Ledger scope |
10
+ | --------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
11
+ | Local (new-install default) | `rebut set mode local` | Private SQLite in one data directory |
12
+ | Worker | `rebut set endpoint URL` or `rebut set mode worker` (existing endpoint required) | One deployment's D1 shared by its clients |
9
13
 
10
- New settings use local mode; endpoint-only legacy settings remain Worker. `rebut set api-key` stores a local OpenAI key in Keychain, while Worker `set token` and `set admin-token` store different credentials. env uses REBUT_OPENAI_API_KEY locally, REBUT_TOKEN/REBUT_ADMIN_TOKEN for Worker. Vaultwarden local keys use vaultwarden-api-key-item. `rebut profile list/set/remove` targets the selected backend; local profile changes require no Worker admin token. Local profiles, revisions and metadata are stored in private SQLite. Limits apply to one data directory, not all devices or the OpenAI account. Use a shared Worker for a central ledger. A mode switch does not migrate uncertain requests or release reservations.
14
+ Existing endpoint settings remain Worker mode. There is no automatic backend fallback; switching neither migrates records nor releases reservations.
11
15
 
16
+ On macOS/Linux, settings are `~/.config/rebut/config.json` and the local ledger is `~/.local/share/rebut/local/ledger.sqlite`. With `REBUT_CONFIG_DIR`, use `config.json` and `local/` inside that directory. Registration and status queries must use the same directory.
12
17
 
13
- ## Model and reasoning preferences
18
+ ## Credentials
14
19
 
15
- Set local preferences for newly collected bundles, or select a server profile directly:
20
+ `rebut set secret-store keychain|vaultwarden|env` selects the backend for every role without fallback. Keychain service: `com.abruption.rebut`.
16
21
 
17
- ```sh
18
- rebut set model MODEL_ID
19
- rebut set reasoning EFFORT
20
- rebut set profile PROFILE_ID
21
- ```
22
-
23
- `MODEL_ID`, `EFFORT`, and `PROFILE_ID` are placeholders. Model/reasoning preferences resolve an allowlisted server profile; they do not grant arbitrary model access. An explicit collector `--profile` overrides local preferences. With no preferences the default remains `astra-medium`. `rebut review` respects the profile embedded in the frozen bundle and does not rewrite it using current preferences.
24
-
25
- ## Owner-managed server profiles
26
-
27
- Worker mode only: local profile management does not require these admin credentials.
22
+ | Role | Keychain account / hidden-input command | Env | Default Vaultwarden item / setting key |
23
+ | -------------------- | --------------------------------------- | ---------------------- | ----------------------------------------------------- |
24
+ | Local provider | `openai-api-key` / `set api-key` | `REBUT_OPENAI_API_KEY` | `Rebut — OpenAI API Key` / `vaultwarden-api-key-item` |
25
+ | Worker access | `codex-mcp-bearer` / `set token` | `REBUT_TOKEN` | `Rebut — MCP Access Token` / `vaultwarden-item` |
26
+ | Worker administrator | `codex-mcp-admin` / `set admin-token` | `REBUT_ADMIN_TOKEN` | `Rebut — MCP Admin Token` / `vaultwarden-admin-item` |
28
27
 
29
- The owner/admin instructions in this section apply only to Worker mode. Local profile commands use OS ownership and the local SQLite registry.
28
+ Prefix commands with `rebut`. Change a Vaultwarden item with `rebut set SETTING_KEY NAME`. Use `--stdin` only for an explicitly protected pipe instead of hidden input. `rebut set api-key-env OPENAI_API_KEY` explicitly changes the local env name; the two variables do not fall back to each other. Administrator tokens are not forwarded to MCP hosts.
30
29
 
31
- `rebut profile list` makes an authenticated, read-only GET to list server profiles, models, reasoning settings, output limits, rates, and revisions. It does not call the provider or start a paid review.
30
+ ## Model profiles
32
31
 
33
32
  ```sh
34
33
  rebut profile list
35
- rebut set admin-token
34
+ rebut set model MODEL_ID
35
+ rebut set reasoning EFFORT
36
+ rebut set profile PROFILE_ID
36
37
  ```
37
38
 
38
- Profile mutation requires a separate owner admin bearer. `rebut set admin-token` uses hidden interactive input; `rebut set admin-token --stdin` explicitly accepts a protected pipe. Never pass tokens as arguments or put them in tracked files. macOS Keychain uses service `com.abruption.rebut`, review account `codex-mcp-bearer`, and admin account `codex-mcp-admin`. The selected Vaultwarden backend can use a separate user-selected item: default `Rebut — MCP Admin Token`, configured with `rebut set vaultwarden-admin-item NAME`. The env backend reads `REBUT_ADMIN_TOKEN` from a secure execution environment. The admin token is never forwarded to Codex. There is no automatic backend fallback.
39
-
40
- After a one-time Worker upgrade, D1 migration `0002`, and `ADMIN_TOKEN_SHA256` secret setup described in [installation](installation.md), the owner can add/update a profile. This example uses the existing Astra/medium configuration and its dated 2026-11-12 Standard rates; verify the official [model](https://developers.openai.com/api/docs/models/gpt-6-astra) and [pricing](https://developers.openai.com/api/docs/pricing) documents before choosing values. For a new model, substitute the placeholder `MODEL_ID` with a verified Responses-compatible model ID and explicitly supply its supported reasoning setting, output limit, and official rates.
39
+ Preferences affect new collection. Explicit `collect --profile` wins; `review` retains the frozen bundle's profile. The default is `astra-medium`. Allowlisting does not grant provider model access.
41
40
 
42
- ```sh
43
- rebut profile set astra-medium --model gpt-6-astra --reasoning medium --max-output-tokens 8192 --input-usd-per-million 10 --output-usd-per-million 50 --price-version official-2026-11-12
44
- ```
45
-
46
- Both prices and `--price-version` are required; the server uses them for budget reservations and cost estimates. Rebut does not automatically fetch prices or call a provider models endpoint. `--if-revision N` adds an explicit compare-and-swap revision condition to set/remove. A `409` conflict requires rereading `rebut profile list` and deciding what to change; never overwrite automatically.
41
+ The OS owner manages local profiles. Worker changes require migration `0002`, `ADMIN_TOKEN_SHA256`, and a separate administrator token. Listing profiles makes no paid model call.
47
42
 
48
43
  ```sh
44
+ rebut profile set PROFILE_ID --model MODEL_ID --reasoning medium --max-output-tokens 8192 --input-usd-per-million INPUT_USD --output-usd-per-million OUTPUT_USD --price-version PRICE_VERSION
49
45
  rebut profile remove PROFILE_ID --if-revision N
50
46
  ```
51
47
 
52
- Removal creates a disabling tombstone rather than deleting review history. Once Worker/D1 support is installed, these profile changes write D1 only: Responses-compatible new model IDs or reasoning values require no Worker build/deploy or npm upgrade. Existing requests retain their original model and revision after profile updates or removal. Changes never rerun requests or automatically release/refund reservations. The normal review bearer cannot mutate profiles; this owner API is not exposed as an MCP tool and cannot change budgets, authentication, or the provider URL.
53
-
54
- ## Server configuration
48
+ Replace uppercase placeholders with verified values. Check model/reasoning support and rates; both rates and the price version are required. `set` also accepts `--if-revision N`. On conflict, refresh the list and decide rather than automatically overwriting.
55
49
 
56
- [`config.example.json`](../../../config.example.json) defines the structure of the `REBUT_CONFIG` secret. Set `hostname` to the exact endpoint hostname, configure server-side profile IDs, and set deployment-wide limits. Clients choose profile IDs; they cannot override model names or the provider URL. The example is configuration, not a promise of account-level model access.
50
+ Changes affect future requests. Removal leaves an inactive tombstone without deleting history or reviving seeded profiles. Existing IDs retain their model, revision, and reservation. Dynamic profile edits do not require Worker redeployment.
57
51
 
58
- `REBUT_CONFIG` supplies seed profiles. D1 overrides and disabling tombstones take precedence; profile removal does not restore a seed with the same ID. The server freezes the resolved profile and revision for each reserved request.
52
+ ## Budgets
59
53
 
60
- | Profile | Model | Reasoning | Maximum output tokens | Standard input/output per 1M tokens |
61
- | -------------- | ------------- | --------- | --------------------- | ----------------------------------- |
62
- | `astra-medium` | `gpt-6-astra` | `medium` | 8,192 | $10 / $50 |
63
- | `luna-test` | `gpt-6-luna` | `medium` | 2,048 | $0.10 / $0.50 |
54
+ | Setting | Default | Local command |
55
+ | ------------------------------ | ------- | ----------------------------------- |
56
+ | UTC day | $6.66 | `rebut set daily-budget USD` |
57
+ | UTC month | $200 | `rebut set monthly-budget USD` |
58
+ | Per request | $6.66 | `rebut set request-budget USD` |
59
+ | Concurrent unresolved requests | 1 | `rebut set max-concurrent N` (1–10) |
60
+ | New requests per day | 100 | Deployment/initial configuration |
64
61
 
65
- Output limits include reasoning tokens. The dated price table is `openai-standard-2026-11-12`; estimates apply no cached-input discount. Use **Luna for real API tests** and mocks for automated tests. The production profile remains Astra/medium; Luna results do not establish Astra runtime availability or equivalent review quality. Verify the official [Astra](https://developers.openai.com/api/docs/models/gpt-6-astra), [Luna](https://developers.openai.com/api/docs/models/gpt-6-luna), and [pricing](https://developers.openai.com/api/docs/pricing) documents before deploying.
62
+ Local limits apply to one data directory; Worker limits apply across its deployment. They do not aggregate other devices, Workers, API usage, or OpenAI account balance. Manage Worker limits in `REBUT_CONFIG`. Daily, monthly, and request ceilings are independent; changing one does not increase the others. Restart hosts after settings changes.
66
63
 
67
- Requests pin `service_tier:default` and `prompt_cache_options.mode:explicit` with no breakpoints, disabling prompt caching for these profiles. No execution tools are supplied. Estimates are not invoices and do not account for other services sharing the key or project.
64
+ The service reserves conservatively for input and maximum output, then accounts for verified usage. Estimates are not invoices. Unknown keeps the full reservation and concurrency slot, including after date changes. Period accounting remains attached to the original UTC submission day/month.
68
65
 
69
- ## Budget and concurrency
66
+ ## Input and result contract
70
67
 
71
- | Setting | Example value |
72
- | ----------------------------------- | ---------------------------------- |
73
- | UTC calendar day | $6.66 (`dailyMicrousd:6660000`) |
74
- | UTC calendar month | $200 (`monthlyMicrousd:200000000`) |
75
- | Per request | $6.66 (`requestMicrousd:6660000`) |
76
- | Concurrent pending/unknown requests | 1 (`maxConcurrent:1`) |
77
- | New review requests per UTC day | 100 (`dailyRequests:100`) |
68
+ | Item | Limit |
69
+ | --------------------- | --------------------------- |
70
+ | Canonical UTF-8 input | 128,000 bytes |
71
+ | Files | 40 |
72
+ | Diff / requirements | 100,000 / 16,000 characters |
73
+ | Transport envelope | 160,000 bytes |
78
74
 
79
- These limits aggregate all principals in the deployment. Reserve before calling: serialized request bytes plus framing padding count as input tokens, and the maximum output budget is reserved. Validated usage settles conservatively at uncached Standard rates. Unknown execution or missing usage keeps the full reservation. A new UTC day/month resets that period's spend window; unresolved executions continue occupying concurrency. Budget windows follow the original submission date, not a subscription credit's grant or expiration date. This ledger cannot enforce an OpenAI account-wide limit across other consumers. Confirm your account/organization's credit eligibility separately.
75
+ SHA-256 covers masked `{schema_version,provider,task_kind,requirements,files,diff}` with file keys ordered `{path,start_line,content}`. ID and profile are separate from the evidence hash. See [the full schema](../../../src/contracts.ts).
80
76
 
81
- ## Input limits and hashing
77
+ - `review` processes frozen material. Only `completed` means success; results include file/diff line evidence, model, input hash, usage, and estimated cost. Empty findings do not prove correctness.
78
+ - `review_status` returns metadata for the original principal. Reusing an ID does not create another provider call; changing its hash/profile conflicts. Review bodies are not replayed.
82
79
 
83
- | Material | Limit |
84
- | --------------------------------------- | ------------------ |
85
- | Canonically serialized UTF-8 JSON input | 128,000 bytes |
86
- | Files | 40 |
87
- | Diff | 100,000 characters |
88
- | Requirements | 16,000 characters |
89
- | Transport envelope | 160,000 bytes |
80
+ Ledgers retain request/usage metadata, not code, review text, or keys. Material is sent to OpenAI; `store:false` does not promise zero provider retention. The prompt instructs the model to treat instructions inside supplied material as review data. Models receive no repository/URL fetching, shell, test, editing, or PR tools.
90
81
 
91
- The SHA-256 covers canonical `{schema_version,task_kind,requirements,files,diff}` after redaction, with file key order `{path,start_line,content}`. Request IDs and profile names are separate from this frozen evidence hash. See [`ReviewInputSchema`](../../../src/contracts.ts) for the full contract. Preserve the same evidence for independent first-pass reviewers and keep their outputs separate.
82
+ ## Claude provider — 0.3.0
92
83
 
93
- ## MCP tools
84
+ Select `rebut set provider anthropic`, then use the existing `rebut set api-key` flow for one key. Keychain service/account: `com.abruption.rebut` / `anthropic-api-key`. For Vaultwarden, `rebut set vaultwarden-api-key-item NAME` sets the selected provider item; its default is `Rebut — Anthropic API Key`. No account aliases, key rotation, or provider fallback is added.
94
85
 
95
- - `review`: choose an allowlisted profile ID and supply the frozen material. Returns status, validated findings, provider model/IDs, hash, usage and estimated microUSD. Only `completed` is a successful review. Refusal, incomplete generation, invalid output, and unknown execution remain distinct. Every finding must reference supplied file lines or supplied new-side diff lines. An empty findings array with a nonempty summary is valid; an empty or malformed response is not.
96
- - `review_status`: `{request_id}` returns only metadata for the caller's principal. It cannot replay the review body.
86
+ `claude-medium` uses Claude Opus 5.5 / medium. Explicitly add `--provider anthropic` when creating an Anthropic profile. Omitting it preserves an existing active profile provider; new/disabled profiles default to OpenAI, independently of the key-selection preference. Legacy profiles without provider remain OpenAI. The frozen bundle profile determines the actual provider and key, so retain the original bundle/ID after preference changes.
97
87
 
98
- After a timeout, query **the same request ID**. Repeating it never creates another provider execution. Reusing an ID with a changed input hash or profile returns `conflict`. A completed duplicate returns metadata rather than the review body: clients must save their initial response locally. See [operations](operations.md) for reconciliation; `not_found` after a transport failure is not by itself permission to use a new ID.
88
+ Each local/Worker ledger aggregates both providers under the same budget/concurrency limits. New requests retain `requested_provider` through reservation, completion, and errors; historical rows are unchanged. Missing thinking detail omits `reasoning_tokens`. Cache reads are conservatively charged at full base input rate; unexpected cache writes or nonstandard usage retain unknown reservations.
99
89
 
100
- ## Storage and privacy
90
+ Claude uses the Messages API with standard tier/global geo and no tools or prompt caching. Workspace regional policies may reject a request; do not retry another key. Deploy Worker code with its existing OpenAI configuration, update clients, and only then add the `ANTHROPIC_API_KEY` secret and Anthropic profiles. Never forward administrator tokens to hosts.
101
91
 
102
- The metadata-only D1 ledger retains request IDs, hashes, profile, status, reservation, sanitized provider IDs and usage. It never stores source or review text. Worker observability is disabled in the example. `AUTH_TOKENS` contains token digests, not bearer values; keep original bearer tokens in your password manager. See [installation](installation.md) for setup.
92
+ Check [Claude Console billing](https://support.claude.com/en/articles/8977456-how-do-i-pay-for-my-claude-api-usage) for API costs and credit eligibility. Rebut API calls are distinct from Claude Code subscription usage.
103
93
 
104
- The OpenAI request uses `store:false`; this does **not** promise zero provider retention or replace your organization's data policy. See [OpenAI data controls](https://developers.openai.com/api/docs/guides/your-data). Keep credentials and private deployment identifiers outside public source and logs.
94
+ New schema 2 bundles freeze the provider and include it in the hash. Collection reads profile metadata from the selected backend, so Worker collection requires its access token. Submission rejects a changed profile supplier with `provider_mismatch` before key loading or reservation. New legacy schema 1 requests are OpenAI-only; previously submitted IDs retain metadata access with their original bundle. Confirm a supplier change before collecting a new bundle.
105
95
 
106
- When the result is `invalid_output`, `invalid_output_reason` identifies the failed validation stage without retaining source or review text. Intermediate `commentary` messages are excluded; only `final_answer` (or a legacy message with no phase) is parsed as the structured review. Multiple final outputs, invalid JSON/schema, and findings outside supplied evidence remain errors.
96
+ Local collection may initialize the profile store. Schema 1 hashes omit provider and retain their original ordering.