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.
- package/README.en.md +15 -46
- package/README.ja.md +15 -46
- package/README.md +15 -47
- package/README.zh-CN.md +15 -46
- package/config.example.json +9 -0
- package/docs/guide/en/configuration.md +55 -65
- package/docs/guide/en/installation.md +64 -56
- package/docs/guide/en/operations.md +36 -28
- package/docs/guide/en.md +5 -16
- package/docs/guide/ja/configuration.md +55 -65
- package/docs/guide/ja/installation.md +64 -56
- package/docs/guide/ja/operations.md +36 -28
- package/docs/guide/ja.md +5 -16
- package/docs/guide/ko/configuration.md +55 -65
- package/docs/guide/ko/installation.md +64 -56
- package/docs/guide/ko/operations.md +38 -28
- package/docs/guide/ko.md +5 -16
- package/docs/guide/zh-CN/configuration.md +55 -65
- package/docs/guide/zh-CN/installation.md +64 -56
- package/docs/guide/zh-CN/operations.md +36 -28
- package/docs/guide/zh-CN.md +5 -16
- package/docs/releases/release-checklist.ko.md +27 -0
- package/lib/cli.mjs +1366 -754
- package/package.json +2 -1
- package/src/contracts.ts +40 -3
- package/docs/guide/en/architecture.md +0 -29
- package/docs/guide/en/reviewer-integration.md +0 -16
- package/docs/guide/en/validation.md +0 -38
- package/docs/guide/ja/architecture.md +0 -29
- package/docs/guide/ja/reviewer-integration.md +0 -16
- package/docs/guide/ja/validation.md +0 -38
- package/docs/guide/ko/architecture.md +0 -29
- package/docs/guide/ko/reviewer-integration.md +0 -16
- package/docs/guide/ko/validation.md +0 -38
- package/docs/guide/zh-CN/architecture.md +0 -29
- package/docs/guide/zh-CN/reviewer-integration.md +0 -16
- package/docs/guide/zh-CN/validation.md +0 -38
|
@@ -1,103 +1,111 @@
|
|
|
1
|
-
# Installation and
|
|
1
|
+
# Installation and use
|
|
2
2
|
|
|
3
3
|
[한국어](../ko/installation.md) · **English** · [简体中文](../zh-CN/installation.md) · [日本語](../ja/installation.md)
|
|
4
4
|
|
|
5
|
-
[
|
|
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
|
-
|
|
9
|
+
## Local MCP
|
|
9
10
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
+
Other credential backends:
|
|
36
25
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
rebut
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
+
## Codex registration and updates
|
|
47
37
|
|
|
48
38
|
```sh
|
|
49
|
-
npm
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
npm test
|
|
39
|
+
npm install -g rebut-mcp
|
|
40
|
+
rebut setup --client codex --replace
|
|
41
|
+
rebut doctor --connect
|
|
53
42
|
```
|
|
54
43
|
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
82
|
+
Client setup on macOS:
|
|
85
83
|
|
|
86
84
|
```sh
|
|
87
|
-
rebut
|
|
88
|
-
rebut
|
|
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
|
-
|
|
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
|
-
|
|
95
|
+
Version 0.3.0+ selects the review provider and MCP host separately. Local macOS Keychain example:
|
|
94
96
|
|
|
95
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
[
|
|
5
|
+
[README](../../../README.en.md) · [Installation](installation.md) · [Configuration](configuration.md)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Unknown recovery
|
|
8
8
|
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
+
## Diagnostics
|
|
15
20
|
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
+
## Upgrades and key rotation
|
|
23
28
|
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
35
|
+
## Development checks
|
|
34
36
|
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
1
|
+
# Rebut Guide
|
|
2
2
|
|
|
3
3
|
[한국어](ko.md) · **English** · [简体中文](zh-CN.md) · [日本語](ja.md)
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
[README](../../README.en.md)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
#
|
|
1
|
+
# 設定
|
|
2
2
|
|
|
3
3
|
[한국어](../ko/configuration.md) · [English](../en/configuration.md) · [简体中文](../zh-CN/configuration.md) · **日本語**
|
|
4
4
|
|
|
5
|
-
[
|
|
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
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
`rebut profile list` は認証付きの読み取り専用 GET で、サーバーのプロファイル、モデル、推論設定、出力上限、料金、リビジョンを一覧表示します。プロバイダーの呼び出しや有料レビューは行いません。
|
|
30
|
+
## モデルプロファイル
|
|
30
31
|
|
|
31
32
|
```sh
|
|
32
33
|
rebut profile list
|
|
33
|
-
rebut set
|
|
34
|
+
rebut set model MODEL_ID
|
|
35
|
+
rebut set reasoning EFFORT
|
|
36
|
+
rebut set profile PROFILE_ID
|
|
34
37
|
```
|
|
35
38
|
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
## サーバー設定
|
|
53
|
-
|
|
54
|
-
[`config.example.json`](../../../config.example.json) は `REBUT_CONFIG` シークレットの構造を定義しています。`hostname` をエンドポイントの正確なホスト名に設定し、サーバー側のプロファイル ID とデプロイ全体の上限を設定します。クライアントはプロファイル ID を選択しますが、モデル名やプロバイダー URL を上書きすることはできません。この例は設定を示すものであり、アカウントでのモデルアクセスを保証するものではありません。
|
|
48
|
+
大文字は確認した値に置き換えます。モデル・推論対応と料金を確認し、入力/出力料金と価格バージョンを指定してください。`set` も `--if-revision N` を使えます。競合時は一覧を再取得して判断し、自動上書きしません。
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
変更は後続リクエストに適用します。削除は無効化 tombstone を残し、履歴を消したり初期プロファイルを復活させたりしません。既存 ID のモデル・リビジョン・予約は維持します。動的変更に Worker 再デプロイは不要です。
|
|
57
51
|
|
|
58
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
80
|
+
台帳にはリクエスト/使用量メタデータだけを残し、コード・レビュー本文・キーは保存しません。資料は OpenAI に送信し、`store:false` はプロバイダーのゼロ保持を保証しません。プロンプトは資料内の指示をレビューデータとして扱うようモデルに指示します。モデルにリポジトリ/URL 取得、シェル、テスト、編集、PR ツールは与えません。
|
|
90
81
|
|
|
91
|
-
##
|
|
82
|
+
## Claude プロバイダー — 0.3.0
|
|
92
83
|
|
|
93
|
-
- `
|
|
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
|
-
|
|
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
|
-
|
|
90
|
+
Claude は standard tier/global geo の Messages API を使い、ツールやプロンプトキャッシュはありません。workspace の地域制約で拒否される場合も他キーで再試行しません。既存 OpenAI 設定のまま Worker コードを更新し、クライアント更新後に `ANTHROPIC_API_KEY` シークレットと Anthropic プロファイルを追加します。管理者トークンをホストへ渡しません。
|
|
101
91
|
|
|
102
|
-
|
|
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
|
-
|
|
94
|
+
新規 schema 2 バンドルはプロバイダーを固定してハッシュに含めます。収集時に選択したバックエンドのプロファイルを参照するため、Worker では接続トークンが必要です。提出時に供給先が変わっていればキー読み込み・予約前に `provider_mismatch` で拒否します。旧 schema 1 の新規要求は OpenAI のみとし、提出済み ID は元のバンドルでメタデータを照会できます。変更を確認してから新バンドルを収集してください。
|
|
105
95
|
|
|
106
|
-
|
|
96
|
+
ローカル収集はプロファイルストアを初期化する場合があります。schema 1 のハッシュは provider を含めず旧順序を維持します。
|