rebut-mcp 0.1.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 (42) hide show
  1. package/README.en.md +18 -41
  2. package/README.ja.md +18 -41
  3. package/README.md +18 -41
  4. package/README.zh-CN.md +18 -41
  5. package/bin/rebut.mjs +1 -1
  6. package/config.example.json +9 -0
  7. package/docs/guide/en/configuration.md +55 -63
  8. package/docs/guide/en/installation.md +66 -57
  9. package/docs/guide/en/operations.md +45 -16
  10. package/docs/guide/en.md +5 -16
  11. package/docs/guide/ja/configuration.md +55 -63
  12. package/docs/guide/ja/installation.md +66 -57
  13. package/docs/guide/ja/operations.md +45 -16
  14. package/docs/guide/ja.md +5 -16
  15. package/docs/guide/ko/configuration.md +55 -63
  16. package/docs/guide/ko/installation.md +66 -57
  17. package/docs/guide/ko/operations.md +47 -16
  18. package/docs/guide/ko.md +5 -16
  19. package/docs/guide/zh-CN/configuration.md +55 -63
  20. package/docs/guide/zh-CN/installation.md +66 -57
  21. package/docs/guide/zh-CN/operations.md +45 -16
  22. package/docs/guide/zh-CN.md +5 -16
  23. package/docs/releases/0.1.0.ko.md +43 -0
  24. package/docs/releases/0.2.0.ko.md +72 -0
  25. package/docs/releases/release-checklist.ko.md +62 -0
  26. package/lib/cli.mjs +1992 -248
  27. package/migrations/0001_ledger.sql +20 -0
  28. package/migrations/0002_profiles.sql +6 -0
  29. package/package.json +12 -6
  30. package/src/contracts.ts +59 -3
  31. package/docs/guide/en/architecture.md +0 -20
  32. package/docs/guide/en/reviewer-integration.md +0 -16
  33. package/docs/guide/en/validation.md +0 -25
  34. package/docs/guide/ja/architecture.md +0 -20
  35. package/docs/guide/ja/reviewer-integration.md +0 -16
  36. package/docs/guide/ja/validation.md +0 -25
  37. package/docs/guide/ko/architecture.md +0 -20
  38. package/docs/guide/ko/reviewer-integration.md +0 -16
  39. package/docs/guide/ko/validation.md +0 -25
  40. package/docs/guide/zh-CN/architecture.md +0 -20
  41. package/docs/guide/zh-CN/reviewer-integration.md +0 -16
  42. package/docs/guide/zh-CN/validation.md +0 -25
package/README.en.md CHANGED
@@ -2,64 +2,41 @@
2
2
 
3
3
  # Rebut
4
4
 
5
- **Independent, evidence-grounded reviews through the OpenAI Responses API.**
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)
6
8
 
7
- [한국어](README.md) · **English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
9
+ **Local-first independent code review MCP. Cloudflare Worker is optional.**
8
10
 
9
- **An authenticated Cloudflare Worker MCP that reviews the frozen material you explicitly provide.**
11
+ [한국어](README.md) · **English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
10
12
 
11
13
  </div>
12
14
 
13
- Rebut is an **opt-in reviewer**. It does not replace an existing Claude/Gemini workflow or automatically call three reviewers. MIT licensed; deploy with your own Cloudflare account and OpenAI key. Source publication and a personal paid deployment are separate actions.
15
+ An MCP for reviewing supplied code and diffs through OpenAI or Claude APIs. Review material is sent to the selected provider.
16
+
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.
14
18
 
15
19
  ## Quick start
16
20
 
17
- Requires **Node.js 24 or later**. Install the npm CLI and configure your own deployed Worker:
21
+ Requires Node.js 24+. This example uses macOS Keychain.
18
22
 
19
23
  ```sh
20
24
  npm install -g rebut-mcp
21
- rebut set endpoint https://YOUR_HOST/mcp
22
- rebut set token
25
+ rebut set api-key
23
26
  rebut setup --client codex
24
- rebut doctor
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- On macOS, `rebut set token` uses a hidden interactive prompt and stores the bearer in Keychain by default. Never pass a token as an argument. See [installation](docs/guide/en/installation.md) for explicit Vaultwarden/env backends and Codex migration options.
29
-
30
- `rebut-mcp` (initial CLI version `0.1.0`, executable `rebut`) is a client and stdio bridge for a **self-hosted Worker**. Deploy Worker/D1 from a GitHub source checkout with your own Cloudflare account and OpenAI key. Public source or the npm package grants no access to a personal Worker or credits. The package contains no real endpoint, private config, bearer, provider key, or reviews. These instructions target CLI `0.1.0`.
31
-
32
- Keep developer validation in the source checkout:
33
-
34
- ```sh
35
- npm ci
36
- npm run typecheck
37
- npm run build
38
- npm test
39
- ```
40
-
41
- Automated tests mock the provider and make no paid model calls. Actual API tests use **gpt-6-luna**; production uses **gpt-6-astra / medium**. Luna results do not establish Astra availability or equivalent review quality. Worker deployment requires D1 and the secrets `OPENAI_API_KEY`, `REBUT_CONFIG`, and `AUTH_TOKENS`; follow [installation and private deployment](docs/guide/en/installation.md).
42
-
43
- Choose local defaults with `rebut set model MODEL_ID`, `rebut set reasoning EFFORT`, or `rebut set profile PROFILE_ID`. Preferences resolve server-allowlisted profiles for new collection; explicit `collect --profile` wins, and `review` keeps the frozen bundle profile. With no preferences the default is `astra-medium`. `rebut profile list` reads authenticated server model/rate metadata without a provider call. Owners can manage profiles in D1 after a one-time Worker upgrade, migration `0002`, and separate admin credential setup; see [configuration](docs/guide/en/configuration.md).
44
-
45
- ## What it does
30
+ Restart Codex after registration. See [installation](docs/guide/en/installation.md) for Linux/env and Vaultwarden.
46
31
 
47
- - Collects explicitly allowed text sources, removes common secret patterns, and hashes frozen evidence. Inspect redaction before sending.
48
- - Checks authentication, an allowlisted profile, duplicate request IDs and a deployment-wide atomic budget reservation before one bounded Responses call.
49
- - Returns structured findings with supplied file/line evidence, model identity, token usage and estimated cost.
50
- - Exposes `review` and metadata-only `review_status`. After timeout/unknown, keep the same request ID; the server never automatically creates a replacement paid call.
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
- The example limits are **$6.66 per UTC day**, **$200 per UTC month**, one pending/unknown request at a time, and 100 new review requests/day. The ledger tracks Rebut, not the account-wide credit balance. Unknown execution retains its reservation. Review bodies are not replayable; save the initial response locally.
34
+ `review` is a paid call; `doctor --connect` checks connectivity without a paid review. Keep the same request ID when the result is uncertain.
53
35
 
54
- The reviewer cannot clone repositories, fetch arbitrary URLs, execute commands/tests, edit files, or create pull requests. Source, review bodies and keys are not stored in D1 or Worker logs. `store:false` is not a zero-retention guarantee for the provider.
36
+ ## Guides
55
37
 
56
- ## Documentation
38
+ - [Installation](docs/guide/en/installation.md)
39
+ - [Configuration](docs/guide/en/configuration.md)
40
+ - [Operations](docs/guide/en/operations.md)
57
41
 
58
- - [User guide](docs/guide/en.md)
59
- - [Installation and input collection](docs/guide/en/installation.md)
60
- - [Configuration, budgets and MCP contract](docs/guide/en/configuration.md)
61
- - [Operations and recovery](docs/guide/en/operations.md)
62
- - [Opt-in reviewer integration](docs/guide/en/reviewer-integration.md)
63
- - [Architecture](docs/guide/en/architecture.md)
64
- - [Validation and limits of the results](docs/guide/en/validation.md)
65
- - [MIT license](LICENSE)
42
+ [Releases](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/README.ja.md CHANGED
@@ -2,64 +2,41 @@
2
2
 
3
3
  # Rebut
4
4
 
5
- **OpenAI Responses API による、証拠に基づく独立したレビュー。**
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)
6
8
 
7
- [한국어](README.md) · [English](README.en.md) · [简体中文](README.zh-CN.md) · **日本語**
9
+ **ローカル実行を標準とする独立コードレビューMCP。Cloudflare Workerは任意です。**
8
10
 
9
- **明示的に提供された確定済みの資料をレビューする、認証付き Cloudflare Worker MCP。**
11
+ [한국어](README.md) · [English](README.en.md) · [简体中文](README.zh-CN.md) · **日本語**
10
12
 
11
13
  </div>
12
14
 
13
- Rebut は**明示的に選択して利用するレビュアー**です。既存の Claude/Gemini ワークフローを置き換えたり、3 つのレビュアーを自動で呼び出したりしません。MIT ライセンスで提供され、自分の Cloudflare アカウントと OpenAI キーでデプロイします。ソースの公開と個人用の有料デプロイは、それぞれ別の操作です。
15
+ 提供したコードと diff を OpenAI または Claude API でレビューする MCP です。資料は選択したプロバイダーに送信します。
16
+
17
+ 0.3.0 以降の Claude 対応は `rebut set provider anthropic` → `rebut set api-key` → `rebut setup --client claude` の順です。ホストとプロバイダーは別々に選びます。
14
18
 
15
19
  ## クイックスタート
16
20
 
17
- **Node.js 24 以降**が必要です。npm CLI をインストールし、自分でデプロイした Worker を設定します。
21
+ Node.js 24 以上が必要です。以下は macOS Keychain の例です。
18
22
 
19
23
  ```sh
20
24
  npm install -g rebut-mcp
21
- rebut set endpoint https://YOUR_HOST/mcp
22
- rebut set token
25
+ rebut set api-key
23
26
  rebut setup --client codex
24
- rebut doctor
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- macOS の `rebut set token` は入力を隠す対話型プロンプトを使い、既定では Bearer トークンを Keychain に保存します。トークンを引数で渡さないでください。Vaultwarden/env バックエンドの明示的な選択と Codex 移行オプションは[インストール手順](docs/guide/ja/installation.md)を参照してください。
29
-
30
- `rebut-mcp`(初期 CLI バージョン `0.1.0`、実行コマンド `rebut`)は**セルフホストした Worker**のクライアントと stdio ブリッジです。Worker/D1 は引き続き GitHub のソースチェックアウトから、自分の Cloudflare アカウントと OpenAI キーでデプロイします。公開ソースや npm パッケージは、個人の Worker やクレジットへのアクセスを付与しません。パッケージに実際のエンドポイント、非公開設定、Bearer、プロバイダーキー、レビュー本文は含まれません。この手順は CLI `0.1.0` を対象としています。
31
-
32
- 開発者向けの検証はソースチェックアウトで実行します。
33
-
34
- ```sh
35
- npm ci
36
- npm run typecheck
37
- npm run build
38
- npm test
39
- ```
40
-
41
- 自動テストはプロバイダーをモックし、有料モデルを呼び出しません。実際の API テストには **gpt-6-luna**、本番には **gpt-6-astra / medium** を使います。Luna の結果は Astra の利用可否や同等のレビュー品質を実証しません。Worker には D1 と `OPENAI_API_KEY`、`REBUT_CONFIG`、`AUTH_TOKENS` のシークレットが必要です。[インストールと非公開デプロイ](docs/guide/ja/installation.md)に従ってください。
42
-
43
- `rebut set model MODEL_ID`、`rebut set reasoning EFFORT`、`rebut set profile PROFILE_ID` でローカルの既定値を選びます。新しい収集ではサーバーの許可リスト内のプロファイルに解決され、明示的な `collect --profile` が優先し、`review` は確定済みバンドルのプロファイルを保持します。設定がなければ `astra-medium` です。`rebut profile list` はプロバイダーを呼ばず、認証付きでサーバーのモデルと料金のメタデータを読み取ります。所有者は一度限りの Worker 更新、マイグレーション `0002`、別の管理認証情報の設定後に D1 でプロファイルを管理できます。[設定](docs/guide/ja/configuration.md)を参照してください。
44
-
45
- ## 主な機能
30
+ 登録後に Codex を再起動してください。Linux/env・Vaultwarden 設定は[インストール](docs/guide/ja/installation.md)を参照してください。
46
31
 
47
- - 明示的に許可したテキストソースを収集し、一般的なシークレットのパターンを除去して、確定済みの証拠のハッシュを計算します。送信前にマスキング結果を確認してください。
48
- - 認証、許可リスト内のプロファイル、リクエスト ID の重複、デプロイ全体のアトミックな予算予約を確認してから、制限付きの Responses 呼び出しを 1 回実行します。
49
- - 提供されたファイルと行に基づく証拠、モデル情報、トークン使用量、推定費用を含む構造化された指摘を返します。
50
- - `review` と、メタデータのみを返す `review_status` を公開します。タイムアウトや結果不明の後も同じリクエスト ID を使ってください。サーバーは代わりの有料呼び出しを自動で作成しません。
32
+ 新規インストールはローカル stdio を使います。端末間で予算・台帳を共有する場合は [Worker モード](docs/guide/ja/installation.md#任意の-worker-デプロイ)を選択します。既存 Worker 設定は維持します。
51
33
 
52
- 設定例の上限は **UTC の 1 日あたり $6.66**、**UTC の 1 か月あたり $200**、保留中または結果不明のリクエストは同時に 1 件、新規レビューリクエストは 1 日あたり 100 件です。台帳は Rebut の利用を追跡し、アカウント全体のクレジット残高は追跡しません。実行結果が不明な場合は予約を保持します。レビュー本文は再取得できないため、最初のレスポンスをローカルに保存してください。
34
+ `review` は有料呼び出しです。`doctor --connect` は有料レビューなしで接続確認を行います。結果が不明なら同じリクエスト ID を維持してください。
53
35
 
54
- レビュアーは、リポジトリのクローン、任意の URL の取得、コマンドやテストの実行、ファイルの編集、プルリクエストの作成を行えません。ソース、レビュー本文、キーは D1 や Worker のログに保存されません。`store:false` は、プロバイダーによるデータ保持がゼロであることを保証しません。
36
+ ## ガイド
55
37
 
56
- ## ドキュメント
38
+ - [インストール](docs/guide/ja/installation.md)
39
+ - [設定](docs/guide/ja/configuration.md)
40
+ - [運用](docs/guide/ja/operations.md)
57
41
 
58
- - [ユーザーガイド](docs/guide/ja.md)
59
- - [インストールと入力の収集](docs/guide/ja/installation.md)
60
- - [設定、予算、MCP 仕様](docs/guide/ja/configuration.md)
61
- - [運用と復旧](docs/guide/ja/operations.md)
62
- - [明示的に選択するレビュアーの統合](docs/guide/ja/reviewer-integration.md)
63
- - [アーキテクチャ](docs/guide/ja/architecture.md)
64
- - [検証と結果の限界](docs/guide/ja/validation.md)
65
- - [MIT ライセンス](LICENSE)
42
+ [リリース](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/README.md CHANGED
@@ -2,64 +2,41 @@
2
2
 
3
3
  # Rebut
4
4
 
5
- **OpenAI Responses API를 통한 독립적이고 근거에 기반한 검토.**
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)
6
8
 
7
- **한국어** · [English](README.en.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
9
+ **로컬에서 바로 실행하는 독립 코드 검토 MCP. Cloudflare Worker는 선택 사항입니다.**
8
10
 
9
- **명시적으로 제공한 고정 자료를 검토하는 인증 기반 Cloudflare Worker MCP.**
11
+ **한국어** · [English](README.en.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
10
12
 
11
13
  </div>
12
14
 
13
- Rebut은 **명시적으로 선택하여 사용하는 검토 도구**입니다. 기존 Claude/Gemini 작업 흐름을 대체하거나 검토자 세 명을 자동으로 호출하지 않습니다. MIT 라이선스로 제공되며, 자신의 Cloudflare 계정과 OpenAI 키로 배포합니다. 소스 공개와 개인 유료 배포는 별개의 작업입니다.
15
+ OpenAI 또는 Claude API로 제공한 코드·diff를 검토하는 MCP입니다. 자료는 선택한 공급자로 전송합니다.
16
+
17
+ Claude 지원은 0.3.0 이상에서 `rebut set provider anthropic` → `rebut set api-key` → `rebut setup --client claude` 순서로 설정합니다. 호스트와 공급자는 별도 선택입니다.
14
18
 
15
19
  ## 빠른 시작
16
20
 
17
- **Node.js 24 이상**이 필요합니다. npm CLI를 설치하고 직접 배포한 Worker를 설정합니다.
21
+ Node.js 24 이상이 필요합니다. macOS Keychain을 사용하는 예입니다.
18
22
 
19
23
  ```sh
20
24
  npm install -g rebut-mcp
21
- rebut set endpoint https://YOUR_HOST/mcp
22
- rebut set token
25
+ rebut set api-key
23
26
  rebut setup --client codex
24
- rebut doctor
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- macOS에서 `rebut set token`은 입력을 숨기는 대화형 프롬프트로 bearer를 받아 기본 Keychain에 저장합니다. 토큰을 인자로 전달하지 마세요. 명시적인 Vaultwarden/env 백엔드와 Codex 마이그레이션 옵션은 [설치 안내](docs/guide/ko/installation.md)를 참고하세요.
29
-
30
- `rebut-mcp`(초기 CLI 버전 `0.1.0`, 실행 명령 `rebut`)는 **직접 호스팅한 Worker**의 클라이언트이자 stdio 브리지입니다. Worker/D1은 GitHub 소스 체크아웃에서 자신의 Cloudflare 계정과 OpenAI 키로 배포합니다. 공개 소스나 npm 패키지는 개인 Worker 또는 크레딧 접근 권한을 주지 않습니다. 패키지에는 실제 엔드포인트, 비공개 설정, bearer, 공급자 키, 검토 본문이 포함되지 않습니다. 이 안내는 CLI `0.1.0`을 대상으로 합니다.
31
-
32
- 개발자 검증은 소스 체크아웃에서 수행합니다.
33
-
34
- ```sh
35
- npm ci
36
- npm run typecheck
37
- npm run build
38
- npm test
39
- ```
40
-
41
- 자동화 테스트는 공급자를 모의 처리하며 유료 모델을 호출하지 않습니다. 실제 API 테스트에는 **gpt-6-luna**, 운영에는 **gpt-6-astra / medium**을 사용합니다. Luna 결과로 Astra의 사용 가능 여부나 동등한 검토 품질을 입증할 수는 없습니다. Worker 배포에는 D1과 `OPENAI_API_KEY`, `REBUT_CONFIG`, `AUTH_TOKENS` 시크릿이 필요합니다. [설치 및 비공개 배포](docs/guide/ko/installation.md)를 따르세요.
42
-
43
- `rebut set model MODEL_ID`, `rebut set reasoning EFFORT`, `rebut set profile PROFILE_ID`로 로컬 기본값을 선택합니다. 새 수집에서 서버 허용 목록의 프로필을 찾으며 명시적인 `collect --profile`이 우선하고 `review`는 고정 번들의 프로필을 유지합니다. 환경설정이 없으면 `astra-medium`입니다. `rebut profile list`는 공급자 호출 없이 인증된 서버 모델·요금 메타데이터를 조회합니다. 소유자는 일회성 Worker 업그레이드, 마이그레이션 `0002`, 별도 관리자 자격증명 설정 뒤 D1에서 프로필을 관리할 수 있습니다. [설정](docs/guide/ko/configuration.md)을 참고하세요.
44
-
45
- ## 주요 기능
30
+ 등록 후 Codex를 재시작하세요. Linux/env·Vaultwarden 설정은 [설치 안내](docs/guide/ko/installation.md)를 참고하세요.
46
31
 
47
- - 명시적으로 허용한 텍스트 소스를 수집하고, 흔한 비밀정보 패턴을 제거한 뒤 고정한 증거 자료의 해시를 계산합니다. 전송 전에 마스킹 결과를 확인하세요.
48
- - 인증, 허용 목록의 프로필, 중복 요청 ID, 배포 전체의 원자적 예산 예약을 확인한 뒤 한도가 설정된 Responses 호출을 한 번 수행합니다.
49
- - 제공한 파일·행 근거, 모델 식별 정보, 토큰 사용량, 예상 비용을 포함한 구조화된 지적 사항을 반환합니다.
50
- - `review`와 메타데이터만 제공하는 `review_status`를 노출합니다. 시간 초과 또는 unknown 이후에도 같은 요청 ID를 유지하세요. 서버는 대체 유료 호출을 자동으로 만들지 않습니다.
32
+ 새 설치는 로컬 stdio를 사용합니다. 여러 기기의 예산·요청 장부를 공유하려면 [Worker 모드](docs/guide/ko/installation.md#선택적-worker-배포)를 선택하세요. 기존 Worker 설정은 유지됩니다.
51
33
 
52
- 예시 한도는 **UTC 기준 하루 $6.66**, **UTC 기준 한 달 $200**, 동시 pending/unknown 요청 한 개, 하루 신규 검토 요청 100개입니다. 원장은 Rebut 사용량을 추적하며 계정 전체의 크레딧 잔액을 추적하지 않습니다. 실행 결과를 알 수 없으면 예약을 유지합니다. 검토 본문은 다시 조회할 수 없으므로 최초 응답을 로컬에 저장하세요.
34
+ `review`는 유료 호출이며 `doctor --connect`는 유료 검토 없이 연결만 확인합니다. 결과가 불확실하면 같은 요청 ID를 유지하세요.
53
35
 
54
- 검토자는 저장소 복제, 임의 URL 가져오기, 명령·테스트 실행, 파일 수정, 풀 리퀘스트 생성을 할 수 없습니다. 소스, 검토 본문, 키는 D1이나 Worker 로그에 저장하지 않습니다. `store:false`는 공급자의 보관 기간이 0임을 보장하지 않습니다.
36
+ ## 사용 안내
55
37
 
56
- ## 문서
38
+ - [설치](docs/guide/ko/installation.md)
39
+ - [설정](docs/guide/ko/configuration.md)
40
+ - [운영](docs/guide/ko/operations.md)
57
41
 
58
- - [사용자 가이드](docs/guide/ko.md)
59
- - [설치 및 입력 수집](docs/guide/ko/installation.md)
60
- - [설정, 예산 및 MCP 계약](docs/guide/ko/configuration.md)
61
- - [운영 및 복구](docs/guide/ko/operations.md)
62
- - [선택적 검토자 연동](docs/guide/ko/reviewer-integration.md)
63
- - [아키텍처](docs/guide/ko/architecture.md)
64
- - [검증 및 결과의 한계](docs/guide/ko/validation.md)
65
- - [MIT 라이선스](LICENSE)
42
+ [릴리즈](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/README.zh-CN.md CHANGED
@@ -2,64 +2,41 @@
2
2
 
3
3
  # Rebut
4
4
 
5
- **通过 OpenAI Responses API 提供独立、基于证据的审查。**
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)
6
8
 
7
- [한국어](README.md) · [English](README.en.md) · **简体中文** · [日本語](README.ja.md)
9
+ **默认本地运行的独立代码审查 MCP,可选 Cloudflare Worker。**
8
10
 
9
- **一个经过身份验证的 Cloudflare Worker MCP,仅审查您明确提供并已冻结的材料。**
11
+ [한국어](README.md) · [English](README.en.md) · **简体中文** · [日本語](README.ja.md)
10
12
 
11
13
  </div>
12
14
 
13
- Rebut 是一个**需要明确选择启用的审查器**。它不会替代现有的 Claude/Gemini 工作流,也不会自动调用三个审查器。采用 MIT 许可证;使用您自己的 Cloudflare 账户和 OpenAI 密钥部署。公开源代码与部署个人付费服务是两个独立的操作。
15
+ 通过 OpenAI 或 Claude API 审查所提供代码和 diff 的 MCP。材料发送至所选供应商。
16
+
17
+ 0.3.0+ 的 Claude 支持按 `rebut set provider anthropic` → `rebut set api-key` → `rebut setup --client claude` 设置;宿主与供应商分别选择。
14
18
 
15
19
  ## 快速开始
16
20
 
17
- 需要 **Node.js 24 或更高版本**。安装 npm CLI,并配置您自行部署的 Worker:
21
+ 需要 Node.js 24+。本例使用 macOS Keychain。
18
22
 
19
23
  ```sh
20
24
  npm install -g rebut-mcp
21
- rebut set endpoint https://YOUR_HOST/mcp
22
- rebut set token
25
+ rebut set api-key
23
26
  rebut setup --client codex
24
- rebut doctor
25
27
  rebut doctor --connect
26
28
  ```
27
29
 
28
- 在 macOS 上,`rebut set token` 使用隐藏输入的交互式提示,默认将 Bearer 令牌保存在 Keychain 中。绝不要将令牌作为参数传递。明确选择 Vaultwarden/env 后端及 Codex 迁移选项见[安装指南](docs/guide/zh-CN/installation.md)。
29
-
30
- `rebut-mcp`(初始 CLI 版本 `0.1.0`,命令 `rebut`)是**自托管 Worker**的客户端和 stdio 桥接程序。Worker/D1 仍需从 GitHub 源代码检出目录使用您自己的 Cloudflare 账户和 OpenAI 密钥部署。公开源代码或 npm 包不会授予个人 Worker 或额度的访问权限。包中不包含真实端点、私有配置、Bearer 令牌、提供商密钥或审查正文。这些说明适用于 CLI `0.1.0`。
31
-
32
- 开发者验证仍在源代码检出目录中执行:
33
-
34
- ```sh
35
- npm ci
36
- npm run typecheck
37
- npm run build
38
- npm test
39
- ```
40
-
41
- 自动化测试模拟提供商,不会进行付费模型调用。真实 API 测试使用 **gpt-6-luna**,生产使用 **gpt-6-astra / medium**。Luna 结果不能证明 Astra 可用或审查质量相当。Worker 部署需要 D1 及 `OPENAI_API_KEY`、`REBUT_CONFIG`、`AUTH_TOKENS` 三个 Secret;请按照[安装与私有部署](docs/guide/zh-CN/installation.md)操作。
42
-
43
- 使用 `rebut set model MODEL_ID`、`rebut set reasoning EFFORT` 或 `rebut set profile PROFILE_ID` 选择本地默认值。新收集时偏好会匹配服务器允许列表的配置方案;显式 `collect --profile` 优先,`review` 保留冻结输入包中的配置方案。无偏好时默认为 `astra-medium`。`rebut profile list` 无需调用提供商即可读取经过身份验证的服务器模型/费率元数据。所有者完成一次 Worker 升级、迁移 `0002` 及单独管理凭据设置后,可在 D1 中管理配置方案;见[配置](docs/guide/zh-CN/configuration.md)。
44
-
45
- ## 功能
30
+ 注册后重启 Codex。Linux/env 与 Vaultwarden 设置见[安装指南](docs/guide/zh-CN/installation.md)。
46
31
 
47
- - 收集明确允许的文本来源,移除常见的秘密信息模式,并对冻结的证据计算哈希。发送前请检查脱敏结果。
48
- - 在进行一次受限的 Responses 调用之前,检查身份验证、允许列表中的配置、重复请求 ID,以及部署范围内的原子预算预留。
49
- - 返回结构化发现,包含所提供文件和行的证据、模型身份、令牌用量及估算费用。
50
- - 提供 `review` 和仅返回元数据的 `review_status`。超时或结果未知后,请保留同一个请求 ID;服务器绝不会自动创建替代的付费调用。
32
+ 新安装使用本地 stdio。跨设备共享预算与请求账本时选择 [Worker 模式](docs/guide/zh-CN/installation.md#可选-worker-部署)。已有 Worker 设置保持不变。
51
33
 
52
- 示例限制为:**每个 UTC 日 $6.66**、**每个 UTC 月 $200**、同一时间仅允许一个待处理/结果未知的请求,以及每天 100 个新的审查请求。账本仅跟踪 Rebut,不代表整个账户的余额。执行结果未知时会保留预算预留。审查正文无法重放;请将首次响应保存在本地。
34
+ `review` 是付费调用,`doctor --connect` 仅检查连接,不进行付费审查。结果不确定时保留原请求 ID。
53
35
 
54
- 审查器不能克隆仓库、获取任意 URL、执行命令或测试、编辑文件,也不能创建拉取请求。源代码、审查正文和密钥不会存储在 D1 或 Worker 日志中。`store:false` 不保证提供商零保留数据。
36
+ ## 指南
55
37
 
56
- ## 文档
38
+ - [安装](docs/guide/zh-CN/installation.md)
39
+ - [配置](docs/guide/zh-CN/configuration.md)
40
+ - [运维](docs/guide/zh-CN/operations.md)
57
41
 
58
- - [用户指南](docs/guide/zh-CN.md)
59
- - [安装与输入收集](docs/guide/zh-CN/installation.md)
60
- - [配置、预算与 MCP 契约](docs/guide/zh-CN/configuration.md)
61
- - [运维与恢复](docs/guide/zh-CN/operations.md)
62
- - [可选审查器集成](docs/guide/zh-CN/reviewer-integration.md)
63
- - [架构](docs/guide/zh-CN/architecture.md)
64
- - [验证及结果的局限](docs/guide/zh-CN/validation.md)
65
- - [MIT 许可证](LICENSE)
42
+ [发行记录](https://github.com/abruption/rebut/releases) · [MIT](LICENSE)
package/bin/rebut.mjs CHANGED
@@ -2,5 +2,5 @@
2
2
  import { runCli, safeError } from "../lib/cli.mjs";
3
3
  runCli(process.argv.slice(2)).catch((error) => {
4
4
  process.stderr.write(safeError(error) + "\n");
5
- process.exitCode = 1;
5
+ if (!process.exitCode) process.exitCode = 1;
6
6
  });
@@ -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,104 +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
- ## Local CLI configuration
7
+ ## Modes and storage
8
8
 
9
- Install with `npm install -g rebut-mcp`; set the Worker with `rebut set endpoint https://YOUR_HOST/mcp`. macOS defaults to Keychain: `rebut set token` uses hidden interactive input; `rebut set token --stdin` explicitly accepts a protected pipe. Never pass bearer values in argv or tracked files. Select an existing Vaultwarden workflow with `rebut set secret-store vaultwarden`; its default item is `Rebut — MCP Access Token`, configurable with `rebut set vaultwarden-item NAME`. On non-macOS, explicitly use `rebut set secret-store env` and supply `REBUT_TOKEN` via a secure execution environment. There is no automatic backend fallback.
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 |
10
13
 
11
- For the `env` backend, Codex setup stores only `env_vars = ['REBUT_TOKEN']` (the variable name), never its value. Supply the token in the secure execution environment of the actual Codex host; setting it only for the setup command does not make it available to later Codex sessions.
14
+ Existing endpoint settings remain Worker mode. There is no automatic backend fallback; switching neither migrates records nor releases reservations.
12
15
 
13
- `rebut setup --client codex` uses `CODEX_HOME` or `~/.codex`; `--codex-home PATH` selects another home. It registers `rebut mcp`, preserves other MCP entries, and requires `--replace` to migrate an existing private `rebut` bridge. `rebut doctor` shows sanitized local configuration/credential availability; `rebut doctor --connect` checks remote `tools/list` for free. Neither performs a paid review. See [installation](installation.md).
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.
14
17
 
15
- ## Model and reasoning preferences
18
+ ## Credentials
16
19
 
17
- 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`.
18
21
 
19
- ```sh
20
- rebut set model MODEL_ID
21
- rebut set reasoning EFFORT
22
- rebut set profile PROFILE_ID
23
- ```
24
-
25
- `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.
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` |
26
27
 
27
- ## Owner-managed server profiles
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.
28
29
 
29
- `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
30
31
 
31
32
  ```sh
32
33
  rebut profile list
33
- rebut set admin-token
34
+ rebut set model MODEL_ID
35
+ rebut set reasoning EFFORT
36
+ rebut set profile PROFILE_ID
34
37
  ```
35
38
 
36
- 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
+ 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.
37
40
 
38
- 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
-
40
- ```sh
41
- 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
42
- ```
43
-
44
- 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.
45
42
 
46
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
47
45
  rebut profile remove PROFILE_ID --if-revision N
48
46
  ```
49
47
 
50
- 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.
51
-
52
- ## 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.
53
49
 
54
- [`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.
55
51
 
56
- `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
57
53
 
58
- | Profile | Model | Reasoning | Maximum output tokens | Standard input/output per 1M tokens |
59
- | -------------- | ------------- | --------- | --------------------- | ----------------------------------- |
60
- | `astra-medium` | `gpt-6-astra` | `medium` | 8,192 | $10 / $50 |
61
- | `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 |
62
61
 
63
- 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.
64
63
 
65
- 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.
66
65
 
67
- ## Budget and concurrency
66
+ ## Input and result contract
68
67
 
69
- | Setting | Example value |
70
- | ----------------------------------- | ---------------------------------- |
71
- | UTC calendar day | $6.66 (`dailyMicrousd:6660000`) |
72
- | UTC calendar month | $200 (`monthlyMicrousd:200000000`) |
73
- | Per request | $6.66 (`requestMicrousd:6660000`) |
74
- | Concurrent pending/unknown requests | 1 (`maxConcurrent:1`) |
75
- | 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 |
76
74
 
77
- 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).
78
76
 
79
- ## 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.
80
79
 
81
- | Material | Limit |
82
- | --------------------------------------- | ------------------ |
83
- | Canonically serialized UTF-8 JSON input | 128,000 bytes |
84
- | Files | 40 |
85
- | Diff | 100,000 characters |
86
- | Requirements | 16,000 characters |
87
- | 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.
88
81
 
89
- 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
90
83
 
91
- ## 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.
92
85
 
93
- - `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.
94
- - `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.
95
87
 
96
- 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.
97
89
 
98
- ## 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.
99
91
 
100
- 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.
101
93
 
102
- 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.
103
95
 
104
- 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.