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
@@ -1,103 +1,111 @@
1
- # Installation and input collection
1
+ # Installation and use
2
2
 
3
3
  [한국어](../ko/installation.md) · **English** · [简体中文](../zh-CN/installation.md) · [日本語](../ja/installation.md)
4
4
 
5
- [Rebut](../../../README.en.md) · [User guide](../en.md)
5
+ [README](../../../README.en.md) · [Configuration](configuration.md) · [Operations](operations.md)
6
6
 
7
+ Requires Node.js 24+. macOS/Linux are tested; Windows behavior and ACLs are unverified.
7
8
 
8
- Use Node.js **24 or later**. New installations default to a local stdio MCP server. No Cloudflare account, Worker endpoint or HTTP daemon is required.
9
+ ## Local MCP
9
10
 
10
- ```sh
11
- npm install -g rebut-mcp
12
- ```
13
-
14
- ## Local setup
15
-
16
- On macOS, `rebut set api-key` takes hidden OpenAI API key input and stores it in the login Keychain. The provider account is `openai-api-key` under `com.abruption.rebut`, separate from the Worker access/admin accounts. `--stdin` accepts a protected pipe; never use credential values as command arguments.
11
+ New installation using macOS Keychain:
17
12
 
18
13
  ```sh
14
+ npm install -g rebut-mcp
19
15
  rebut set api-key
20
- ```
21
-
22
- For environment-backed credentials, select `rebut set secret-store env` and provide `REBUT_OPENAI_API_KEY` in the secure environment of the actual MCP host. Setup records only that variable name. For Vaultwarden, use `rebut set secret-store vaultwarden` and `rebut set vaultwarden-api-key-item NAME`; the default local item is `Rebut — OpenAI API Key`. Existing bw-get login is required. There is no automatic credential or backend fallback.
23
-
24
- ## Connect and verify
25
-
26
- ```sh
27
16
  rebut setup --client codex
28
17
  rebut doctor --connect
29
18
  ```
30
19
 
31
- `rebut setup --client codex` registers `rebut mcp` using CODEX_HOME or ~/.codex; select another home with --codex-home PATH. The host starts the server automatically. `doctor --connect` checks local credential availability, SQLite and real MCP tool registration without making a provider call; it does not prove API account access. Local env setup forwards REBUT_OPENAI_API_KEY by name only. Preserve custom REBUT_CONFIG_DIR when replacing a registration.
20
+ Restart the host to start the local stdio server. No Cloudflare account or HTTP server is required. Review material goes to OpenAI using your key. `doctor --connect` checks credential availability and MCP tools without a paid review; it does not validate API account access.
32
21
 
33
- ## Optional Worker mode
22
+ An existing endpoint keeps Worker mode. To switch, run `rebut set mode local`, configure the key, and refresh registration. Switching does not migrate the ledger.
34
23
 
35
- Setting an endpoint explicitly selects Worker mode. Existing endpoint-only configurations keep Worker mode on upgrade. Worker mode uses its separate MCP access token, not the local OpenAI key: on macOS store it with `rebut set token`; env mode reads REBUT_TOKEN and Vaultwarden uses vaultwarden-item. Admin operations use the separate admin credential. Use the private deployment section below if you need to create a Worker.
24
+ Other credential backends:
36
25
 
37
- ```sh
38
- rebut set endpoint https://YOUR_HOST/mcp
39
- rebut setup --client codex --replace
40
- ```
26
+ | Backend | Selection | Local OpenAI key |
27
+ | --------------------------- | ------------------------------------ | ---------------------------------------------------------------- |
28
+ | Keychain (macOS default) | `rebut set secret-store keychain` | Hidden input with `rebut set api-key` |
29
+ | Environment (Linux default) | `rebut set secret-store env` | `REBUT_OPENAI_API_KEY` in the actual MCP host environment |
30
+ | Vaultwarden | `rebut set secret-store vaultwarden` | Prepare `bw-get`, then `rebut set vaultwarden-api-key-item NAME` |
41
31
 
42
- Use `rebut set mode local` to switch explicitly. No automatic fallback occurs. Backends do not share or migrate request history, reservations or budgets: never replay an unknown against another backend. Local SQLite lives at ~/.local/share/rebut/local/ledger.sqlite, or local/ under a custom REBUT_CONFIG_DIR. Defaults are UTC $6.66/day and $200/month for this data directory only; local budget commands are `set daily-budget`, `set monthly-budget`, and `set request-budget` with decimal USD values. Worker limits remain deployment configuration.
32
+ Vaultwarden needs an authenticated `bw-get` executable that accepts the item name as an argument and returns the secret on stdout. Override its path with `REBUT_BW_GET` in the MCP host environment if needed.
43
33
 
44
- ## Source checkout and developer validation
34
+ Keep credentials out of CLI arguments and tracked files. Env registration stores variable names only. Sharing `OPENAI_API_KEY` requires explicit `rebut set api-key-env OPENAI_API_KEY`; there is no fallback. See [credential roles](configuration.md).
45
35
 
46
- This guide targets CLI 0.2.0. The npm package runs the local server and optional Worker bridge; it is not a hosted review service and grants no API credits. Only optional Worker deployment needs a Cloudflare account and source checkout. Packages contain no real endpoint, private settings, credentials or review bodies.
36
+ ## Codex registration and updates
47
37
 
48
38
  ```sh
49
- npm ci
50
- npm run typecheck
51
- npm run build
52
- npm test
39
+ npm install -g rebut-mcp
40
+ rebut setup --client codex --replace
41
+ rebut doctor --connect
53
42
  ```
54
43
 
55
- Tests use synthetic inputs, mocked provider responses, real SQLite statements, and a local Workers/D1 runtime. `npm test` requires the Worker bundle from `npm run build`. No automated test makes a paid model call. See the [validation record](validation.md) for the separate Luna smoke test.
44
+ Registration uses `CODEX_HOME` or `~/.codex`; use `--codex-home PATH` for another location. Back up `config.toml` before `setup --replace`. Supply the same custom `REBUT_CONFIG_DIR` in the setup shell. Restart the host after registration; running processes do not reload settings.
56
45
 
57
- ## Freeze a review input
46
+ For 0.2.x → 0.3.0, use **Worker code with existing OpenAI configuration → CLI/registration/host restart → Claude key/profile enablement**. From 0.1.x, upgrade the CLI to 0.2.x first for the long deadlines. Provider/HTTP client/Codex tool limits are 1,800/1,830/1,860 seconds. They do not guarantee connection survival; other hosts also need suitable tool limits.
58
47
 
59
- Use an explicit source-file allowlist; do not collect an entire repository automatically. The collector emits frozen JSON on stdout. Default profile: `astra-medium`; real API tests must explicitly use `luna-test`.
48
+ `rebut remove --client codex` removes registration, not settings, credentials, or the ledger. Follow [operations](operations.md) for backups and downgrades.
49
+
50
+ ## Run a review
60
51
 
61
52
  ```sh
62
53
  umask 077
63
- rebut collect --root /path/to/project --request-id request-001 --requirements 'Check that the supplied function preserves its input' --profile astra-medium -- src/example.ts > /protected/path/request-001.bundle.json
54
+ rebut collect --root /path/to/project --request-id review-001 --requirements 'Check the supplied code' --profile astra-medium -- src/example.ts > /protected/path/review-001.bundle.json
55
+ rebut review < /protected/path/review-001.bundle.json
56
+ rebut status review-001
64
57
  ```
65
58
 
66
- The collector rejects symlinks, FIFOs, secret filenames, binary files, and oversize material. It removes common recognizable secret patterns while preserving line numbers. Pattern redaction is incomplete: inspect the resulting bundle before sending. Files may also be supplied as numbered snippets, or a unified diff may be provided directly. The canonical hash and limits are explained under [configuration](configuration.md).
59
+ Select files explicitly. The collector rejects unsafe files, symlinks, FIFOs, and binaries and masks common secret patterns; inspect the bundle before sending it. `review` is a paid call; `status` retrieves metadata. Save the initial response because review bodies cannot be replayed.
67
60
 
68
- ## Deploy privately
61
+ Select paid reviews explicitly. Check for `completed` and compare the returned model and input hash with the frozen bundle/profile, then verify each finding against the source. For independent reviews, supply the same frozen material without sharing reviewers' results. After timeout/unknown, retain the ID and backend rather than submitting a new ID. Follow [recovery](operations.md#unknown-recovery).
69
62
 
70
- 1. Copy `wrangler.jsonc` to `wrangler.private.json` (ignored by Git). Set your account ID, an available Worker name, actual D1 ID, and `workers_dev:true` or your own route. Create a dedicated D1 database with `npx wrangler d1 create rebut-ledger`; set its ID in the private config.
71
- 2. Apply `npx wrangler d1 migrations apply rebut-ledger --remote --config wrangler.private.json`.
72
- 3. Deploy with `npx wrangler deploy --config wrangler.private.json`. An unconfigured Worker returns 503 and cannot call the provider.
73
- 4. Store three Workers Secrets: `OPENAI_API_KEY`, `REBUT_CONFIG`, and `AUTH_TOKENS`. Use Wrangler's interactive secret prompt or `secret bulk` via protected stdin; never put secret values in arguments or tracked files. `REBUT_CONFIG` uses the structure in [`config.example.json`](../../../config.example.json); change `hostname` to your exact endpoint hostname. `AUTH_TOKENS` is a JSON object mapping stable principal IDs to SHA-256 digests of independently generated random 256-bit bearer tokens. Store original tokens in your password manager. Clients with the same token share a principal; distinct tokens isolate request/status access.
74
- 5. Connect a bearer-header-capable MCP client to `https://YOUR_HOST/mcp`, and verify `tools/list`. Host and browser Origin validation apply before tool execution. This bearer setup does not implement OAuth for clients that require OAuth discovery.
63
+ ## Optional Worker deployment
75
64
 
76
- ## One-time upgrade for owner-managed profiles
65
+ Use a Worker to share budgets and request history across devices. Deployment requires a source checkout, your Cloudflare account, and D1.
77
66
 
78
- Dynamic profiles require one Worker upgrade from the source checkout, D1 migration `0002`, and the `ADMIN_TOKEN_SHA256` Worker secret. Apply pending migrations to the existing D1 database, preserving its ledger, then deploy the upgraded Worker with your private config. Generate a separate random 256-bit admin bearer, store its SHA-256 hash as `ADMIN_TOKEN_SHA256` using a protected interactive secret prompt, and keep the original bearer in your credential store. Do not reuse the review bearer or change existing principal IDs. After this one-time setup, CLI profile changes write D1 without another Worker build/deploy or npm upgrade.
67
+ 1. Check out the source and run `npm ci --ignore-scripts`. Copy `wrangler.jsonc` to ignored `wrangler.private.json`; set your account, Worker name, and host configuration.
68
+ 2. Create D1 with `npx wrangler d1 create rebut-ledger --config wrangler.private.json` and put its ID in the private `DB` binding.
69
+ 3. Apply existing migrations `0001` and `0002` with `npx wrangler d1 migrations apply rebut-ledger --remote --config wrangler.private.json`. Keep the same D1 and request rows on upgrades.
70
+ 4. Deploy with `npx wrangler deploy --config wrangler.private.json`. Before configuration, the Worker returns 503.
71
+ 5. Store these secrets through the interactive `npx wrangler secret put NAME --config wrangler.private.json` prompt, never as argument values.
79
72
 
80
- Store the owner bearer with `rebut set admin-token` (hidden input), or explicitly use `rebut set admin-token --stdin` with a protected pipe. With the selected Vaultwarden backend, the default admin item is `Rebut — MCP Admin Token`; change it with `rebut set vaultwarden-admin-item NAME`. The env backend uses `REBUT_ADMIN_TOKEN` in a secure execution environment; it is never forwarded to Codex. Keychain service `com.abruption.rebut` separates review account `codex-mcp-bearer` from admin account `codex-mcp-admin`. Backends do not fall back automatically. See [configuration](configuration.md) for model preferences, listing, explicit prices, and revision-safe updates/removal.
73
+ | Worker secret | Value |
74
+ | -------------------- | ---------------------------------------------------------------------------------------------- |
75
+ | `OPENAI_API_KEY` | Your provider key |
76
+ | `REBUT_CONFIG` | JSON matching [the example](../../../config.example.json), with the actual endpoint `hostname` |
77
+ | `AUTH_TOKENS` | Stable principal ID → SHA-256 digest of a separate random 256-bit bearer token |
78
+ | `ADMIN_TOKEN_SHA256` | Digest of a separate administrator bearer, if profile management is needed |
81
79
 
82
- ## Run the client
80
+ Keep original bearers in your credential store. Separate review and administrator tokens, and retain principal IDs when rotating tokens. Authentication is Bearer, not OAuth.
83
81
 
84
- `rebut review` reads a JSON bundle from stdin and starts a paid review only when explicitly selected by the user. `rebut status REQUEST_ID` is a free metadata query.
82
+ Client setup on macOS:
85
83
 
86
84
  ```sh
87
- rebut review < /protected/path/request-001.bundle.json
88
- rebut status request-001
85
+ rebut set endpoint https://YOUR_HOST/mcp
86
+ rebut set token
87
+ rebut setup --client codex --replace
88
+ rebut doctor --connect
89
89
  ```
90
90
 
91
- Save the initial response locally with restrictive permissions; the server stores only metadata and cannot replay review bodies. Keep the same request ID after timeout or uncertainty. The provider deadline is 1,800 seconds (30 minutes). The MCP HTTP client allows 1,830 seconds and Codex `tool_timeout_sec` is 1,860 seconds, leaving time to record and deliver the outcome. Startup and handshake limits remain short and separate. Update both the Worker and CLI, refresh existing registration with `rebut setup --client codex --replace`, and restart Codex. Editing host configuration alone does not update the older limit inside the 0.1.0 CLI. See the [opt-in reviewer workflow](reviewer-integration.md).
91
+ Setting an endpoint selects Worker mode, using an access token instead of a local OpenAI key. See [configuration](configuration.md) for env/Vaultwarden roles and administrator credentials. Worker deployment is separate from npm updates.
92
+
93
+ ## Claude API and Claude Code — 0.3.0
92
94
 
93
- ## Upgrade or remove
95
+ Version 0.3.0+ selects the review provider and MCP host separately. Local macOS Keychain example:
94
96
 
95
- Use the [operations guide](operations.md) to preserve the D1 ledger and reconcile pending executions before upgrading or removing a deployment. Source publication and a private paid deployment are separate actions.
97
+ ```sh
98
+ rebut set mode local
99
+ rebut set provider anthropic
100
+ rebut set api-key
101
+ rebut setup --client claude
102
+ rebut doctor --connect
103
+ ```
96
104
 
97
- Upgrade in this order: **install the CLI → refresh Codex registration with existing options preserved → restart Codex/MCP → deploy the Worker**. Deploying the longer Worker deadline first can let the old CLI disconnect at 65 seconds. Preserve custom registration options such as `REBUT_CONFIG_DIR`. Node HTTP headers/body deadlines also match the MCP tool deadline. Thirty minutes is an application upper bound, not a guarantee from every network or host. Sleep, termination or disconnection can leave a request reserved or unknown; query its original ID without automatic replay or reservation release.
105
+ Switching providers selects its default profile and clears model/reasoning overrides; selecting the same provider preserves them. Existing OpenAI keys, profiles, and ledger history are not deleted.
98
106
 
99
- After changing mode, credential backend or local budgets, refresh registration with `rebut setup --client codex --replace` when needed and restart MCP hosts. Existing processes keep their startup settings; doctor does not reload them. Preserve custom `REBUT_CONFIG_DIR` (for example, provide the same environment variable when rerunning setup). The chosen secret-store backend applies to all credential roles, which use separate accounts/items.
107
+ Stop Claude Code and back up its config before registration. Only the Rebut user entry in `~/.claude.json` is updated. Use `--claude-config PATH` for another file; this is required when `CLAUDE_CONFIG_DIR` is set. A conflicting Rebut entry requires `--replace`. Project/managed same-name overrides must be checked separately. Registration atomically replaces the file with mode 0600; ACLs/xattrs are not retained. Restart Claude Code and inspect `/mcp`.
100
108
 
101
- Local env mode defaults to REBUT_OPENAI_API_KEY so a key belonging to Codex or another application is not silently reused. To deliberately share OPENAI_API_KEY, run `rebut set api-key-env OPENAI_API_KEY`, refresh registration and restart. There is no fallback between these variables. Daily, monthly and per-request ceilings are independent; changing one does not scale the others. Custom limits are retained across upgrades. Tool descriptions are startup hints; execution resolves the explicit request profile dynamically.
109
+ For env storage, select `rebut set secret-store env` and supply `REBUT_ANTHROPIC_API_KEY` to the actual host. Shared `ANTHROPIC_API_KEY` selection is not supported, avoiding changes to Claude Code authentication. Keychain/Vaultwarden registration adds no provider env placeholder. Env setup may also initialize local SQLite while resolving profiles. Env registration forwards the current default profile provider variable. A frozen other-provider bundle without its env key fails before reservation. Doctor reports the default profile provider in `provider`, and the `set api-key` target in `keyConfigurationProvider`. Re-register each host with `setup --replace` and restart after provider/backend/env changes.
102
110
 
103
- The tested release targets macOS/Linux; Windows behavior and ACLs are not validated.
111
+ Optional local-only `rebut doctor --provider` retrieves model metadata without generation, review reservations, or usage records. Resolving profiles may initialize local SQLite. `doctor --connect` remains an MCP check. Metadata reachability does not prove generation access, balance, geo, structured-output support, or quality.
@@ -1,51 +1,59 @@
1
- # Operations
1
+ # Operations and recovery
2
2
 
3
3
  [한국어](../ko/operations.md) · **English** · [简体中文](../zh-CN/operations.md) · [日本語](../ja/operations.md)
4
4
 
5
- [Rebut](../../../README.en.md) · [User guide](../en.md)
5
+ [README](../../../README.en.md) · [Installation](installation.md) · [Configuration](configuration.md)
6
6
 
7
- ## Local operations
7
+ ## Unknown recovery
8
8
 
9
- Stop local MCP processes before backing up the metadata-only SQLite ledger and its settings. Preserve request history and unknown reservations; do not delete or live-sync an open ledger to clear a limit. API keys are not in SQLite and stay in the selected credential backend. SIGTERM attempts to abort and record uncertain in-flight work before closing; a crash, SIGKILL or network interruption may still leave reserved state. Look up the original ID without replaying it. `rebut remove` removes registration only, not the ledger or credentials. The D1 operations below apply only to Worker mode.
9
+ `reserved` may still be running or interrupted; `unknown` has an uncertain result or usage. Either may be billed. Neither automatically retries, expires, or refunds. One unresolved request can occupy the default slot and block new reviews.
10
10
 
11
- ## Worker
11
+ 1. Query `rebut status REQUEST_ID` with the same backend, principal, and `REBUT_CONFIG_DIR`. If the ID is lost, local `rebut status --pending` lists up to 100 entries with `has_more`. Local metadata queries need no OpenAI key; Worker queries use the existing access token. Neither invokes a paid model.
12
+ 2. Stop hosts and back up the closed local SQLite ledger and settings. Back up Worker D1 using Cloudflare export/Time Travel.
13
+ 3. Compare the original ID, input hash, profile, and available provider request/usage evidence. `not_found` alone does not prove non-execution; do not retry through a new ID or backend.
14
+ 4. Preserve uncertain rows, full accounting reservations, and slots. Only an operator with independent evidence should reconcile the exact `(principal, request_id)`; the app offers no forced release/refund/deletion tool.
15
+ 5. An operator intentionally starting a **different new review** can add only the required local capacity with `rebut set max-concurrent N` (maximum 10), retaining existing reservations. This neither releases the old request nor authorizes replay. Money ceilings still apply, custom limit snapshots remain intact, and hosts must restart.
12
16
 
17
+ `budget_reserved_microusd` and `budget_accounted_microusd` are app accounting values, not confirmed invoices. If all ten slots are uncertain, stop until evidence-based reconciliation. Restore temporary capacity to its intended value afterward and restart. Deleting rows removes deduplication and is not recovery.
13
18
 
14
- Back up the metadata-only D1 ledger using Cloudflare's supported export/Time Travel mechanisms. Do not delete the ledger to clear an inconvenient pending request: doing so loses spend and duplicate protection. Retain request rows for the lifetime of IDs clients may reuse; pruning permits old IDs to execute again.
19
+ ## Diagnostics
15
20
 
16
- Use `rebut status REQUEST_ID` for a free metadata lookup under the original principal. `rebut doctor` checks sanitized local configuration and credential availability; `rebut doctor --connect` performs a free remote `tools/list` check. None of these commands starts a paid review. Preserve the request ID and reservation after any uncertain result.
21
+ `rebut doctor` checks local configuration/credentials; `doctor --connect` checks the selected backend and tool list. Neither is a paid review or a provider account-access test. Distinguish SSH Keychain failure from success in the same machine's logged-in session.
17
22
 
18
- Owner profile changes use revisions: after a `409` conflict, reread `rebut profile list` before deciding whether to set/remove again. Removal leaves a disabling tombstone. Existing requests keep their original model/revision, principal-scoped ID, and reservation even after profile changes; no automatic rerun, refund, or reservation release follows. After the one-time Worker upgrade, D1 migration `0002`, and `ADMIN_TOKEN_SHA256` setup, profile updates require only D1 writes. Keep the separate admin bearer out of Codex/MCP configuration.
23
+ New unknown records may include `unknown_reason`, `provider_elapsed_ms`, provider IDs, and `upstream_status`. Bodies and exception strings are not retained. An HTTP error can precede a body-read timeout, so interpret fields together. Elapsed time is not proof of completed execution/billing, and missing historical fields are not reconstructed.
19
24
 
20
- ## Timeout, disconnect, or unknown
25
+ SIGINT/SIGTERM attempt to record unknown and close. SIGKILL, crashes, and network loss can leave reserved rows. No path automatically replays the call.
21
26
 
22
- `reserved` means an execution was reserved and may still be running or may have been interrupted; it is not proof of an unbilled failure. `unknown` means the outcome or usage could not be verified. Neither status is automatically retried, expired, or refunded. Both occupy concurrency indefinitely until reviewed. This intentionally stops further spending when execution cannot be reconciled.
27
+ ## Upgrades and key rotation
23
28
 
24
- 1. Keep the original request ID, principal, input hash, profile, and provider IDs (if present).
25
- 2. Query `review_status` using that principal. A response with `not_found` after a transport failure is not alone sufficient evidence to submit a new ID: reconcile server processing and the original request first.
26
- 3. Compare provider project usage and request diagnostics. With `store:false`, response retrieval may be unavailable; no review replay is promised.
27
- 4. Only an operator with independent evidence should update the exact `(principal, request_id)` row, preserve its charged/reserved amount unless authoritative usage establishes a different charge, and set a reconciled terminal state. The application exposes no reset/refund/delete tool. Record evidence privately. Never silently turn an unknown execution into a new paid invocation.
29
+ For 0.3.0, follow the staged order in [installation](installation.md#codex-registration-and-updates). Retain custom directories and back up all of `config.toml` before registration. See [installation commands](installation.md#codex-registration-and-updates).
28
30
 
29
- Reservations are charged to the original UTC submission day/month, including after reconciliation. Day and month boundaries do not reset unknown concurrency. The request amount cannot exceed the remaining daily/monthly aggregate limits. Rate limiting applies to new reserved review IDs (100/day in the example), not free metadata calls; put network-level abuse controls in front if needed.
31
+ Back up `config.json` before using 0.2.0-only fields. Version 0.1.0 rejects them, including for Worker users, so a downgrade may need the older settings backup. Downgrading to 0.1.0 after using a local ledger is not ledger recovery. Never delete the ledger to restore settings compatibility.
30
32
 
31
- ## Upgrade
33
+ Keep the same D1 and apply only pending migrations. For bearer rotation, update the `AUTH_TOKENS` digest and client credential store while preserving the principal ID. Rotate `OPENAI_API_KEY` separately. Do not place administrator tokens in MCP settings. `rebut remove` removes registration only.
32
34
 
33
- Run `npm ci`, typecheck, build, and tests. Review migration SQL first, then apply new migrations to the same D1 database and deploy with your private config. Existing `(principal, request_id)` rows must survive upgrades. Changing an allowlisted profile does not reexecute completed IDs; use new IDs only for intentionally new reviews after reconciliation. Changing a principal ID loses access to its existing status rows, so keep IDs stable when rotating bearer tokens.
35
+ ## Development checks
34
36
 
35
- ## Rotate or remove
37
+ ```sh
38
+ npm ci --ignore-scripts
39
+ npm run typecheck
40
+ npm run build
41
+ npm test
42
+ npm run test:package
43
+ ```
36
44
 
37
- Rotate a token by generating a new random value and replacing that principal's digest in `AUTH_TOKENS`, then updating the authorized client's password-manager-backed configuration. Do not change the principal ID merely to rotate a token. Rotate the OpenAI key by updating only `OPENAI_API_KEY`; other consumers of a shared key need their own coordination. Delete the Worker to stop new requests. Export and review the ledger before separately removing D1; deletion is irreversible and makes deduplication history unavailable.
45
+ Worker tests use build output. Automated tests/package smoke mock the provider; they do not prove paid API access or model quality. Default actual API tests use `luna-test`; the operational default is `astra-medium`. Luna success does not establish Astra availability/quality. Historical details remain in the [0.2.0 source record](https://github.com/abruption/rebut/tree/v0.2.0/docs/guide/en).
38
46
 
39
- ## Local recovery and bounded capacity
47
+ Source boundaries: `service.ts` owns hashing, profiles, reservation/accounting; `review.ts` owns provider/evidence validation; `local.ts` supplies stdio/SQLite; `worker.ts` supplies HTTP authentication/D1. Local ledgers cover one directory; Workers share a deployment ledger.
40
48
 
41
- 1. Stop MCP hosts and inspect the original request with `rebut status REQUEST_ID`; do not resubmit it.
42
- 2. Back up the closed local ledger and settings. Review provider evidence when available. `budget_reserved_microusd` and `budget_accounted_microusd` are application accounting, not confirmed invoices for unknown executions.
43
- 3. If the execution remains uncertain, retain its row, full accounted reservation and ID. Do not mark it unbilled, delete it or manufacture a completed result.
44
- 4. After explicitly accepting that retained accounting, an operator may add bounded capacity for intentionally new reviews. For one uncertain request occupying the default one slot, `rebut set max-concurrent 2` adds one slot; the range is 1–10. It does not release the old slot, refund money or authorize retry of the old input.
45
- 5. Restart MCP hosts. Daily/monthly/request limits still apply to the total accounted spend. Actual ledger settlement needs independent evidence and a targeted operator review; it is not automated.
49
+ ## npm publication
46
50
 
47
- If the ID is missing, start with `rebut status --pending`: it lists up to 100 local reserved/unknown metadata records without keys or provider calls, with has_more if more exist. It is a diagnostic snapshot, not authorization for a new paid invocation. If no rows are pending, a money or daily-request ceiling may still be responsible for limit_exceeded.
51
+ Manual `publish.yml` runs from main, validates tag/source/version, and requires owner approval in the `npm` Environment. Building/smoke testing has no OIDC write permission; only publishing the verified tarball has it. PR merges and GitHub Release events do not publish.
48
52
 
49
- Capacity is capped at 10. If all slots remain uncertain, stop for evidence-based operator reconciliation rather than deleting history or mislabelling unknown as unbilled. Once independently reconciled, reduce temporary capacity back to the intended normal limit (default 1) and restart.
53
+ After publication/verification problems, inspect the original run and registry version/integrity before deciding whether to retry. Do not republish an already published version. The [Korean release checklist](../../releases/release-checklist.ko.md#github-actions-trusted-publisher) covers setup, approval, and seven-day artifact retention. The workflow does not deploy Workers or update installed clients.
50
54
 
51
- Choose capacity from the pending count plus the deliberately allowed new parallel requests (maximum 10), rather than copying the example 2 over an existing custom limit. Capacity/budget commands retain a complete local-limit snapshot. If the original ID is missing, run status --pending before step 1.
55
+ ## Upgrading to 0.3.0
56
+
57
+ New settings or Anthropic profiles may cause 0.2.x to reject settings/profile lists. Back up settings and the closed ledger before upgrading. Review a rollback procedure that disables Anthropic profiles using 0.3.0 and restores compatible settings; never delete request history or unknown reservations. The updater does not reserialize unrelated Claude configuration, but a running host can overwrite changes, so stop it before registration.
58
+
59
+ Plain `rebut doctor` does not resolve profiles or initialize SQLite and reports `profileResolution: not_checked`. Explicit `--connect` or `--provider` may inspect/initialize the local profile store.
package/docs/guide/en.md CHANGED
@@ -1,20 +1,9 @@
1
- # Rebut user guide
1
+ # Rebut Guide
2
2
 
3
3
  [한국어](ko.md) · **English** · [简体中文](zh-CN.md) · [日本語](ja.md)
4
4
 
5
- [Rebut](../../README.en.md)
5
+ [README](../../README.en.md)
6
6
 
7
- Rebut is a local-first, opt-in code review MCP using your own OpenAI Responses API key. New installs run stdio locally; Cloudflare Worker is optional for a shared ledger. It reviews only supplied frozen evidence and gives the model no repository, URL-fetch, shell, test, edit or PR tools.
8
-
9
- Install rebut-mcp, configure the local provider key, then run rebut setup --client codex. Existing endpoint-only configurations stay Worker. See [installation](en/installation.md) for Keychain, Vaultwarden, env credentials and optional Worker setup.
10
-
11
- | Guide | Contents |
12
- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
13
- | [Installation](en/installation.md) | Requirements, source setup, input collection, private deployment, MCP client |
14
- | [Configuration](en/configuration.md) | Profiles, model/test policy, UTC budgets, input/hash/tool contract, privacy |
15
- | [Operations](en/operations.md) | Timeout/unknown reconciliation, ledger preservation, upgrade, rotation and removal |
16
- | [Reviewer integration](en/reviewer-integration.md) | Explicit reviewer selection, shared frozen evidence, Vaultwarden wrapper, result checks |
17
- | [Architecture](en/architecture.md) | MCP/provider boundaries, atomic reservation and duplicate prevention |
18
- | [Validation](en/validation.md) | Mock tests, real Luna smoke test, usage and unverified scope |
19
-
20
- Start with installation and configuration. Read operations before handling an unknown execution or changing a deployment. Existing Claude/Gemini defaults remain under the host's control.
7
+ - [Installation](en/installation.md): Requirements, credentials, Codex registration, collection, Worker deployment
8
+ - [Configuration](en/configuration.md): Modes, profiles, budgets, input/output contract
9
+ - [Operations](en/operations.md): Unknown recovery, upgrades, development, publication
@@ -1,106 +1,96 @@
1
- # 設定と MCP 仕様
1
+ # 設定
2
2
 
3
3
  [한국어](../ko/configuration.md) · [English](../en/configuration.md) · [简体中文](../zh-CN/configuration.md) · **日本語**
4
4
 
5
- [Rebut](../../../README.ja.md) · [ユーザーガイド](../ja.md)
5
+ [README](../../../README.ja.md) · [インストール](installation.md) · [運用](operations.md)
6
6
 
7
+ ## モードと保存先
7
8
 
8
- ## ローカルプロファイルと予算範囲
9
+ | モード | 選択 | 台帳の範囲 |
10
+ | -------------------- | ------------------------------------------------------------------------------- | ------------------------------------------- |
11
+ | ローカル(新規既定) | `rebut set mode local` | 1 つのデータディレクトリ内の private SQLite |
12
+ | Worker | `rebut set endpoint URL` または `rebut set mode worker`(既存 endpoint が必要) | デプロイの D1 を複数クライアントで共有 |
9
13
 
10
- 新規設定はローカル、既存endpoint設定はWorkerを維持します。set api-keyはローカルOpenAIキーで、Workerのset token/set admin-tokenとは別です。envはローカルREBUT_OPENAI_API_KEY、WorkerはREBUT_TOKEN/REBUT_ADMIN_TOKENを使い、Vaultwardenのローカル項目はvaultwarden-api-key-itemです。profile list/set/removeは選択backendに適用し、ローカルではWorker管理者トークン不要です。プロファイル・リビジョン・メタデータはprivate SQLiteへ保存し、予算はそのディレクトリだけを対象として別端末やOpenAI全体を合算しません。中央台帳にはWorkerを共有してください。切り替えで不確かな要求の移行や予約解除はしません。
14
+ 既存 endpoint は Worker のままです。障害時に自動で切り替えず、切り替えても記録・予約を移行または解除しません。
11
15
 
16
+ macOS/Linux の設定は `~/.config/rebut/config.json`、ローカル台帳は `~/.local/share/rebut/local/ledger.sqlite` です。`REBUT_CONFIG_DIR` 指定時はその中の `config.json` と `local/` を使います。登録と状態照会も同じディレクトリを使ってください。
12
17
 
13
- ## モデルと推論の設定
18
+ ## 認証情報
14
19
 
15
- 新しく収集するバンドルのローカル設定を指定するか、サーバーのプロファイルを直接選択します。
20
+ `rebut set secret-store keychain|vaultwarden|env` は全役割のバックエンドを選び、自動フォールバックはありません。Keychain サービスは `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`、`PROFILE_ID` はプレースホルダーです。モデルと推論の設定はサーバーの許可リスト内のプロファイルに解決され、任意のモデルへのアクセスは付与しません。コレクターの明示的な `--profile` がローカル設定より優先されます。設定がなければ既定は `astra-medium` のままです。`rebut review` は確定済みバンドルに含まれるプロファイルを使い、現在の設定で書き換えません。
22
+ | 役割 | Keychain アカウント / 非表示入力コマンド | env | Vaultwarden 既定項目 / 設定キー |
23
+ | -------------------- | ---------------------------------------- | ---------------------- | ----------------------------------------------------- |
24
+ | ローカルプロバイダー | `openai-api-key` / `set api-key` | `REBUT_OPENAI_API_KEY` | `Rebut — OpenAI API Key` / `vaultwarden-api-key-item` |
25
+ | Worker 接続 | `codex-mcp-bearer` / `set token` | `REBUT_TOKEN` | `Rebut — MCP Access Token` / `vaultwarden-item` |
26
+ | Worker 管理者 | `codex-mcp-admin` / `set admin-token` | `REBUT_ADMIN_TOKEN` | `Rebut — MCP Admin Token` / `vaultwarden-admin-item` |
24
27
 
25
- ## 所有者によるサーバープロファイル管理
28
+ コマンドの先頭は `rebut` です。Vaultwarden 項目変更は `rebut set SETTING_KEY NAME`。明示した保護されたパイプ入力に限り `--stdin` を使います。`rebut set api-key-env OPENAI_API_KEY` はローカル変数名の明示変更で、変数間のフォールバックはありません。管理者トークンは MCP ホストに渡しません。
26
29
 
27
- Worker専用です。ローカルプロファイル管理にはこの管理者資格情報は不要です。
28
-
29
- `rebut profile list` は認証付きの読み取り専用 GET で、サーバーのプロファイル、モデル、推論設定、出力上限、料金、リビジョンを一覧表示します。プロバイダーの呼び出しや有料レビューは行いません。
30
+ ## モデルプロファイル
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
- プロファイルの変更には、別の所有者用管理 Bearer が必要です。`rebut set admin-token` は入力を隠す対話型プロンプトを使い、`rebut set admin-token --stdin` は保護されたパイプを明示的に受け付けます。トークンを引数や追跡対象ファイルに入れないでください。macOS Keychain のサービスは `com.abruption.rebut`、レビュー用アカウントは `codex-mcp-bearer`、管理用は `codex-mcp-admin` です。選択済みの Vaultwarden バックエンドでは、ユーザーが別の項目を選択できます。既定は `Rebut — MCP Admin Token` で、`rebut set vaultwarden-admin-item NAME` で変更します。env バックエンドは安全な実行環境から `REBUT_ADMIN_TOKEN` を読み取ります。管理トークンは Codex に転送されません。バックエンドは自動で代替されません。
37
-
38
- [インストール](installation.md)に記載した一度限りの Worker 更新、D1 マイグレーション `0002`、`ADMIN_TOKEN_SHA256` シークレット設定後、所有者はプロファイルを追加・更新できます。以下の例は既存の Astra/medium 設定と 2026-11-12 時点の Standard 料金を使っています。値を選ぶ前に公式の[モデル](https://developers.openai.com/api/docs/models/gpt-6-astra)と[料金](https://developers.openai.com/api/docs/pricing)を確認してください。新しいモデルにはプレースホルダー `MODEL_ID` を確認済みの Responses 互換モデル ID に置き換え、対応する推論設定、出力上限、公式料金をすべて明示します。
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
- ```
39
+ 設定は新規収集に適用します。明示した `collect --profile` が優先され、`review` は固定バンドルのプロファイルを維持します。既定は `astra-medium` です。許可リストはプロバイダーのモデル権限を与えません。
43
40
 
44
- 両方の料金と `--price-version` は必須で、サーバーは予算予約と費用見積もりに使用します。Rebut は料金を自動取得せず、プロバイダーのモデルエンドポイントも呼び出しません。`--if-revision N` は set/remove に明示的な比較交換のリビジョン条件を加えます。`409` の競合時は `rebut profile list` を読み直して変更内容を判断し、自動で上書きしないでください。
41
+ ローカルは OS 所有者が管理します。Worker の変更には `0002`、`ADMIN_TOKEN_SHA256`、別の管理者トークンが必要です。一覧取得は有料モデルを呼びません。
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
- 削除はレビュー履歴を消さず、無効化する tombstone を残します。Worker/D1 の対応を一度導入すれば、プロファイル変更は D1 への書き込みだけです。Responses 互換の新しいモデル ID や推論値には Worker の再ビルド・再デプロイや npm 更新は不要です。プロファイルの更新・削除後も、既存のリクエストは元のモデルとリビジョンを保持します。変更による再実行や予約の自動解放・返金はありません。通常のレビュー Bearer ではプロファイルを変更できません。この所有者 API は MCP ツールとして公開されず、予算、認証、プロバイダー URL も変更できません。
51
-
52
- ## サーバー設定
53
-
54
- [`config.example.json`](../../../config.example.json) は `REBUT_CONFIG` シークレットの構造を定義しています。`hostname` をエンドポイントの正確なホスト名に設定し、サーバー側のプロファイル ID とデプロイ全体の上限を設定します。クライアントはプロファイル ID を選択しますが、モデル名やプロバイダー URL を上書きすることはできません。この例は設定を示すものであり、アカウントでのモデルアクセスを保証するものではありません。
48
+ 大文字は確認した値に置き換えます。モデル・推論対応と料金を確認し、入力/出力料金と価格バージョンを指定してください。`set` も `--if-revision N` を使えます。競合時は一覧を再取得して判断し、自動上書きしません。
55
49
 
56
- `REBUT_CONFIG` は初期プロファイルを提供します。D1 の上書きと無効化 tombstone が優先され、削除しても同じ ID の初期プロファイルは復活しません。サーバーは予約した各リクエストの解決済みプロファイルとリビジョンを固定します。
50
+ 変更は後続リクエストに適用します。削除は無効化 tombstone を残し、履歴を消したり初期プロファイルを復活させたりしません。既存 ID のモデル・リビジョン・予約は維持します。動的変更に Worker 再デプロイは不要です。
57
51
 
58
- | プロファイル | モデル | 推論 | 最大出力トークン数 | 100 万トークンあたりの Standard 入力/出力料金 |
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 |
52
+ ## 予算
62
53
 
63
- 出力上限には推論トークンを含みます。日付付き料金表は `openai-standard-2026-11-12` であり、見積もりにキャッシュ入力の割引は適用しません。**実際の API テストには Luna** を使い、自動テストにはモックを使ってください。本番プロファイルは引き続き Astra/medium です。Luna の結果は、Astra の実行時の利用可否や同等のレビュー品質を実証するものではありません。デプロイ前に公式の [Astra](https://developers.openai.com/api/docs/models/gpt-6-astra)、[Luna](https://developers.openai.com/api/docs/models/gpt-6-luna)、[料金](https://developers.openai.com/api/docs/pricing)ドキュメントを確認してください。
54
+ | 項目 | 既定 | ローカルコマンド |
55
+ | -------------------- | ----- | ------------------------------------ |
56
+ | UTC 日 | $6.66 | `rebut set daily-budget USD` |
57
+ | UTC 月 | $200 | `rebut set monthly-budget USD` |
58
+ | リクエスト単位 | $6.66 | `rebut set request-budget USD` |
59
+ | 同時未解決リクエスト | 1 | `rebut set max-concurrent N`(1–10) |
60
+ | 1 日の新規リクエスト | 100 | デプロイ/初期設定 |
64
61
 
65
- リクエストは `service_tier:default` と、ブレークポイントを設けない `prompt_cache_options.mode:explicit` に固定され、これらのプロファイルではプロンプトキャッシュが無効になります。実行ツールは提供しません。見積もりは請求書ではなく、同じキーやプロジェクトを共有する他のサービスは考慮しません。
62
+ ローカルはディレクトリ単位、Worker はデプロイ全体の制限です。他端末・Worker・API 使用や OpenAI 残高は合算しません。Worker は `REBUT_CONFIG` で管理します。日・月・単位上限は独立し、1 つの変更で他が増えることはありません。変更後はホストを再起動します。
66
63
 
67
- ## 予算と同時実行
64
+ 呼び出し前に入力と最大出力を保守的に予約し、確認した使用量で計上します。見積もりは請求書ではありません。unknown は全額予約と同時実行枠を保持し、日付変更でも枠は解放しません。期間計上は最初の UTC 提出日・月に属します。
68
65
 
69
- | 設定 | 設定例 |
70
- | ------------------------------------------- | ---------------------------------- |
71
- | UTC の暦日 | $6.66 (`dailyMicrousd:6660000`) |
72
- | UTC の暦月 | $200 (`monthlyMicrousd:200000000`) |
73
- | リクエストあたり | $6.66 (`requestMicrousd:6660000`) |
74
- | 保留中または結果不明の同時リクエスト数 | 1 (`maxConcurrent:1`) |
75
- | UTC の 1 日あたりの新規レビューリクエスト数 | 100 (`dailyRequests:100`) |
66
+ ## 入力と結果の契約
76
67
 
77
- これらの上限は、デプロイ内のすべてのプリンシパルを合算したものです。呼び出し前に予約します。シリアライズしたリクエストのバイト数にフレーミング用の余裕を加えた値を入力トークン数として数え、最大出力予算を予約します。検証済みの使用量は、キャッシュなしの Standard 料金で保守的に精算します。実行結果が不明な場合や使用量が欠落している場合は、予約全額を保持します。UTC の日付や月が変わると、その期間の支出枠はリセットされますが、未解決の実行は同時実行枠を占有し続けます。予算期間はサブスクリプションのクレジット付与日や有効期限ではなく、最初の送信日に従います。この台帳は、他の利用元を含む OpenAI アカウント全体の上限を強制できません。アカウントや組織のクレジット適用資格は別途確認してください。
68
+ | 項目 | 上限 |
69
+ | ----------------- | --------------------- |
70
+ | 正規化 UTF-8 入力 | 128,000 bytes |
71
+ | ファイル | 40 |
72
+ | diff / 要件 | 100,000 / 16,000 文字 |
73
+ | 転送エンベロープ | 160,000 bytes |
78
74
 
79
- ## 入力上限とハッシュ
75
+ SHA-256 はマスク後の `{schema_version,provider,task_kind,requirements,files,diff}`、ファイルキー順は `{path,start_line,content}` です。ID とプロファイルは証拠ハッシュとは別です。[完全なスキーマ](../../../src/contracts.ts)を参照してください。
80
76
 
81
- | 資料 | 上限 |
82
- | ------------------------------------------ | -------------- |
83
- | 正規化してシリアライズした UTF-8 JSON 入力 | 128,000 バイト |
84
- | ファイル数 | 40 |
85
- | 差分 | 100,000 文字 |
86
- | 要件 | 16,000 文字 |
87
- | 転送エンベロープ | 160,000 バイト |
77
+ - `review` は固定資料を検討します。成功は `completed` のみで、ファイル/diff 行の根拠、モデル、入力ハッシュ、使用量、推定費用を返します。空の findings は正しさの証明ではありません。
78
+ - `review_status` は元の principal のメタデータを照会します。同じ ID は追加呼び出しを作らず、ハッシュ/プロファイル変更は競合になります。本文は再取得しません。
88
79
 
89
- SHA-256 は、マスキング後の正規化された `{schema_version,task_kind,requirements,files,diff}` を対象とし、ファイルのキー順序は `{path,start_line,content}` です。リクエスト ID とプロファイル名は、この確定済み証拠のハッシュとは別です。完全な仕様は [`ReviewInputSchema`](../../../src/contracts.ts) を参照してください。独立した初回レビュアーには同じ証拠を渡し、それぞれの出力を分けて保持してください。
80
+ 台帳にはリクエスト/使用量メタデータだけを残し、コード・レビュー本文・キーは保存しません。資料は OpenAI に送信し、`store:false` はプロバイダーのゼロ保持を保証しません。プロンプトは資料内の指示をレビューデータとして扱うようモデルに指示します。モデルにリポジトリ/URL 取得、シェル、テスト、編集、PR ツールは与えません。
90
81
 
91
- ## MCP ツール
82
+ ## Claude プロバイダー — 0.3.0
92
83
 
93
- - `review`: 許可リスト内のプロファイル ID を選び、確定済みの資料を渡します。ステータス、検証済みの指摘、プロバイダーのモデルと ID、ハッシュ、使用量、推定 microUSD を返します。レビュー成功を表すのは `completed` だけです。拒否、不完全な生成、無効な出力、結果不明の実行は、それぞれ異なる状態として扱います。すべての指摘は、提供されたファイルの行、または提供された差分の変更後側の行を参照する必要があります。要約が空でなければ、指摘の配列が空でも有効です。空のレスポンスや形式の不正なレスポンスは無効です。
94
- - `review_status`: `{request_id}` により、呼び出し元のプリンシパルに属するメタデータだけを返します。レビュー本文は再取得できません。
84
+ `rebut set provider anthropic` 後、既存の `rebut set api-key` でキー 1 つを設定します。Keychain サービス/アカウントは `com.abruption.rebut` / `anthropic-api-key`。Vaultwarden は `rebut set vaultwarden-api-key-item NAME` で選択中の項目を指定し、既定は `Rebut — Anthropic API Key`。アカウント別名・キー循環・プロバイダーフォールバックは追加しません。
95
85
 
96
- タイムアウト後は、**同じリクエスト ID** を照会してください。同じ ID を再送しても、別のプロバイダー実行は作成されません。入力ハッシュやプロファイルを変更して ID を再利用すると `conflict` を返します。完了済みの重複リクエストはレビュー本文ではなくメタデータを返すため、クライアントは最初のレスポンスをローカルに保存する必要があります。照合については[運用](operations.md)を参照してください。転送障害後の `not_found` だけでは、新しい ID を使う根拠にはなりません。
86
+ `claude-medium` は Claude Opus 5.5 / medium です。Anthropic プロファイル新規作成時は `--provider anthropic` を明示します。省略時は既存の有効プロファイルを維持し、新規/無効な項目は OpenAI と扱い、キー選択設定は継承しません。provider のない旧プロファイルは OpenAI です。固定バンドルのプロファイルが実際のプロバイダーとキーを決めるため、設定変更後も元のバンドル/ID を保持します。
97
87
 
98
- ## 保存とプライバシー
88
+ 各ローカル/Worker 台帳で両プロバイダーの予算・同時実行を合算します。新規リクエストの `requested_provider` は予約・完了・エラーでも維持し、旧行は変更しません。thinking 詳細がなければ `reasoning_tokens` を省略します。キャッシュ読み込みは基本入力料金全額で保守的に計上し、要求していないキャッシュ書き込みや非標準使用量は unknown として保持します。
99
89
 
100
- メタデータのみを保存する D1 台帳には、リクエスト ID、ハッシュ、プロファイル、ステータス、予約額、安全な形式に処理したプロバイダー ID、使用量を保持します。ソースやレビュー本文は一切保存しません。設定例では Worker のオブザーバビリティを無効にしています。`AUTH_TOKENS` には Bearer 値ではなくトークンのダイジェストを保存します。元の Bearer トークンはパスワードマネージャーに保管してください。セットアップは[インストール](installation.md)を参照してください。
90
+ Claude は standard tier/global geo の Messages API を使い、ツールやプロンプトキャッシュはありません。workspace の地域制約で拒否される場合も他キーで再試行しません。既存 OpenAI 設定のまま Worker コードを更新し、クライアント更新後に `ANTHROPIC_API_KEY` シークレットと Anthropic プロファイルを追加します。管理者トークンをホストへ渡しません。
101
91
 
102
- OpenAI リクエストは `store:false` を使用します。これはプロバイダーによる保持がゼロであることを保証せず、組織のデータポリシーに代わるものでも**ありません**。[OpenAI のデータ管理](https://developers.openai.com/api/docs/guides/your-data)を参照してください。認証情報と非公開のデプロイ識別子は、公開ソースやログに含めないでください。
92
+ API 費用・クレジット適用は [Claude Console 請求案内](https://support.claude.com/en/articles/8977456-how-do-i-pay-for-my-claude-api-usage)で確認し、Rebut API 呼び出しと Claude Code サブスクリプション使用量を区別してください。
103
93
 
104
- 結果が `invalid_output` の場合、`invalid_output_reason` により、ソースやレビュー本文を保持せずに失敗した検証段階を識別できます。途中の `commentary` メッセージは除外し、`final_answer` または phase のない従来形式のメッセージだけを構造化レビューとして解析します。複数の最終出力、不正な JSON やスキーマ、提供された証拠の範囲外を指す指摘は、引き続きエラーになります。
94
+ 新規 schema 2 バンドルはプロバイダーを固定してハッシュに含めます。収集時に選択したバックエンドのプロファイルを参照するため、Worker では接続トークンが必要です。提出時に供給先が変わっていればキー読み込み・予約前に `provider_mismatch` で拒否します。旧 schema 1 の新規要求は OpenAI のみとし、提出済み ID は元のバンドルでメタデータを照会できます。変更を確認してから新バンドルを収集してください。
105
95
 
106
- この節の所有者/管理者手順はWorkerモード専用です。ローカルプロファイルはOS所有権とSQLiteを使います。
96
+ ローカル収集はプロファイルストアを初期化する場合があります。schema 1 のハッシュは provider を含めず旧順序を維持します。