-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.toml
More file actions
167 lines (159 loc) · 9.1 KB
/
Copy pathconfig.example.toml
File metadata and controls
167 lines (159 loc) · 9.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# miu-cr configuration — OPTIONAL. Everything works with zero config; this file
# only adds named provider profiles and picks a default.
#
# Copy to the per-user config path (same on macOS and Linux), then edit:
# ~/.config/miu/cr/config.toml
#
# Precedence, highest wins: CLI flags > environment > this file > built-in defaults.
# Exception — the OpenAI *credential*: --api-key / a configured profile key >
# `miucr login` (OAuth, your ChatGPT plan) > an ambient OPENAI_API_KEY. So a
# stray OPENAI_API_KEY set for another tool never overrides a deliberate login.
# Pin the method explicitly with `auth = "oauth"`, `auth = "api_key"`, or
# `auth = "bearer"` (see below).
# With `auth_env` or `auth_command`, miu-cr never writes credentials to disk and
# the resolved token lives in memory for one call only. A literal `auth_token`
# (below) is the exception: it sits in plaintext in this file you author.
#
# Credentials — prefer `auth_env` (the NAME of an env var holding the token) or
# `auth_command` (argv; stdout is the token) so no secret is written to this
# file. `auth_token` (a literal token) is supported but DISCOURAGED: it sits in
# plaintext on disk. Precedence: auth_token > non-empty auth_env > auth_command.
# A selected auth_command failure is fatal and stderr is omitted from the error.
# Profile to use when --provider is omitted and env auto-detect doesn't force a
# choice. Built-in profiles are "anthropic" and "openai".
default_provider = "anthropic"
# ── Built-in profiles (for reference — you do NOT need to redeclare these) ──
# [providers.anthropic]
# kind = "anthropic"
# model = "claude-sonnet-4-5-20250929"
# # x-api-key comes from ANTHROPIC_API_KEY (or --api-key).
#
# [providers.openai]
# kind = "openai"
# base_url = "https://api.openai.com/v1"
# model = "gpt-4o"
# # API key comes from OPENAI_API_KEY (or --api-key).
# #
# # ChatGPT-plan (codex) path: when you authenticate with `miucr login` (OAuth),
# # reviews run on the codex backend, which REJECTS api.openai.com models like
# # gpt-4o. Set `model = "gpt-5.5"` to pin the codex model (miucr init writes this
# # for you on the OAuth path). Precedence: --model > MIUCR_CODEX_MODEL > this
# # config model > gpt-5.5 (the built-in codex default).
# ── Example: GLM via z.ai (an Anthropic-compatible gateway) ──
# A named profile of kind "anthropic" pointed at the gateway; the credential is
# sent as a Bearer token. There is NO z.ai-specific code — this is pure config.
# Ready to uncomment, then:
# export ZAI_API_KEY=...
# miucr review --staged --provider zai
# [providers.zai]
# kind = "anthropic"
# base_url = "https://api.z.ai/api/anthropic"
# model = "glm-5.2"
# auth = "bearer" # profile credential goes in Authorization: Bearer
# auth_env = "ZAI_API_KEY" # name of the env var holding the token
# # auth_command = ["gopass", "show", "-o", "ai/zai"] # argv only; stdout is the token
# # auth_token = "<token>" # discouraged: plaintext on disk — prefer auth_env
# ── Optional: cap a provider instance's usage (no quota by default) ──
# Per-instance, aggregating across every review/repo that uses the provider —
# handy to bound a pricier provider everywhere at once. Fail-closed: at/over the
# limit a review is blocked with a typed `quota.exceeded` error (on the serve
# host the PR is skipped+logged). Counters persist in state.db / Postgres.
# [providers.openai.quota]
# dimension = "tokens" # tokens (default; input incl. cache + output) | requests (one per review)
# limit = 2_000_000 # cap in the chosen dimension; must be > 0
# window = "5h" # Go duration (1h, 5h, 24h, 168h) OR "monthly" (calendar UTC)
# ── Example: a generic OpenAI-compatible gateway (DeepSeek, Moonshot, self-hosted, …) ──
# Any endpoint speaking the OpenAI chat-completions API. The credential is sent
# as the API key. Select it with: miucr review --staged --provider my-gateway
# [providers.my-gateway]
# kind = "openai"
# base_url = "https://gateway.example.com/v1"
# model = "your-model-id"
# auth = "api_key" # profile credential goes in the OpenAI API-key slot
# auth_env = "MY_GATEWAY_TOKEN" # name of the env var holding the token
# # auth_command = ["gopass", "show", "-o", "ai/my-gateway"] # argv only; stdout is the token
# # auth_token = "<token>" # discouraged: plaintext on disk — prefer auth_env
# ── Store backend (optional; default = sqlite) ──
# SQLite is the default and needs no config. Postgres is opt-in for shared/serve.
# Prefer the MIUCR_PG_DSN env var so the password is not in plaintext on disk.
# [store]
# backend = "postgres" # "sqlite" (default) | "postgres"
# # dsn = "postgres://user@host:5432/miucr?sslmode=require" # prefer MIUCR_PG_DSN
# ── Semantic code-recall (OPT-IN; default = OFF) ──
# Embeds each POSTED finding's secret-SCRUBBED code anchor into a pgvector table,
# then at review time retrieves prior cosine-near findings as ADVISORY context. It
# NEVER suppresses or mutates a finding and is byte-for-byte M6 when off.
#
# REQUIRES: backend = "postgres" (above) with the `vector` extension installed
# (`CREATE EXTENSION vector;` — needs a role allowed to create it). With sqlite or
# enabled = false there is NO embed call, NO pgvector query, identical prompt.
#
# PRIVACY: enabling sends secret-scrubbed, code-DERIVED text to the embedder API.
# Point base_url at a self-hosted/compatible endpoint to keep it in your network.
# The embedder key (MIUCR_EMBED_API_KEY, falling back to OPENAI_API_KEY) and the
# PG DSN are never logged/persisted/in the envelope; base_url is non-secret.
# Vectors persist in YOUR Postgres until you purge them (see the docs).
#
# This block ships COMMENTED so copying this file does NOT enable embedding.
# [embedding]
# enabled = true # MUST be set true (default false) to turn it on
# model = "text-embedding-3-small" # embedding model (must match the pgvector column dim)
# dim = 1536 # vector dimension; immutable per DB — a mismatch fails loud
# # base_url = "https://api.openai.com/v1" # non-secret; override for self-hosted/compatible
# ── Review defaults (optional) ──
# Defaults for `miucr review` flags. An explicit flag ALWAYS wins; these only
# fill a flag you did not pass. See `miucr config show --all` for the effective
# config. Leave a key unset to keep the built-in flag default.
# [review]
# gate = "high" # fail (exit 2) at this severity: none|info|low|medium|high|critical
# filter_mode = "diff_context" # --pr inline eligibility: added|diff_context|file|nofilter
# prompt_format = "xml" # review prompt format: xml (default, injection-hardened) | markdown
# min_severity = "low" # --pr inline floor: none|info|low|medium|high|critical
# timeout = "300s" # review timeout (a Go duration: 300s, 5m, …)
# stalled_timeout = "5m" # no-progress watchdog; "0s" disables
# suggest = false # emit GitHub one-click suggestions on --post (default off)
# patch_repair = false # 2nd-pass recovery of one-click suggestions; only effective with suggest=true (default off)
#
# # Provider API retry behavior (all optional; values shown are defaults).
# [review.provider_retry]
# max_retries = 10
# initial_backoff = "5s"
# max_backoff = "2m"
# max_elapsed = "10m"
#
# # Internal symbol_context tool limits (all optional; values shown are defaults).
# [review.tools.symbol_context]
# max_bytes = 16000 # per-result byte budget (default 16000)
# max_files = 2000 # max files to scan (default 2000)
# max_parallel = 8 # worker concurrency (default 8, capped at 32)
#
# [review.approval]
# mode = "off" # off|clean|threshold
# max_priority = "P4" # threshold mode only; P0|P1|P2|P3|P4
# note = "on_findings" # none|on_findings|always
#
# # Optional in-process subagent fanout. Candidate findings from each scoped pass
# # still flow through the same deterministic anchoring, dedupe, gate, and publish
# # pipeline. Use "auto" for large reviews, "always" to force fanout, or "off".
# [review.subagents]
# mode = "auto" # off|auto|always
# max_parallel = 2 # default 2, capped at 8
# min_files = 8 # auto threshold; 0 uses default
# min_context_bytes = 60000 # auto threshold; 0 uses default
# require_all = true # failed subagent prevents approval/check success
#
# [[review.subagents.agents]]
# name = "go"
# include = ["**/*.go"]
# exclude = ["**/*_test.go"]
# system_prompt = "Focus on correctness, concurrency, error handling, and API compatibility."
#
# [[review.subagents.agents]]
# name = "frontend"
# include = ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
# system_prompt = "Focus on user-facing behavior, state flow, accessibility, and data contracts."
#
# # category_urls maps a finding Category (case-insensitive) to a docs URL so the
# # category renders as a clickable link in PR comments/summary + the SARIF helpUri.
# [review.category_urls]
# "security" = "https://example.com/docs/security"