@hifullmoon/aicommit 2.0.1 → 2.2.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.
@@ -112,16 +112,6 @@
112
112
  "enabled": false,
113
113
  "username": "aicommit"
114
114
  },
115
- "metrics": {
116
- "enabled": true,
117
- "path": "",
118
- "maxEntries": 500
119
- },
120
- "extensions": {
121
- "manifests": [],
122
- "timeoutMs": 3000,
123
- "maxContextChars": 2000
124
- },
125
115
  "maxDiffChars": 30000,
126
116
  "maxFileDiffChars": 3000,
127
117
  "splitMaxDiffChars": 16000,
package/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ This file lists notable user-facing changes. Internal refactors, test-only chang
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [2.2.0] - 2026-08-28
8
+
9
+ ### Added
10
+
11
+ - Expanded bundled model presets for OpenAI, DeepSeek, OpenRouter, and Ollama, including current GPT, Claude, Gemini, Qwen, GLM, Kimi, Grok, DeepSeek, and local open-model choices.
12
+
13
+ ## [2.1.0] - 2026-08-27
14
+
15
+ ### Changed
16
+
17
+ - Made quality and cross-platform compatibility checks blocking prerequisites of npm publishing in the single tag-triggered release workflow.
18
+ - Moved user configuration to `~/.aicommit/config.json` with legacy-path compatibility; project configuration remains `./.aicommit.config.json`.
19
+ - Simplified the primary help and documentation around the everyday setup, doctor, commit, and file-level split workflows; automation and team-policy commands are now presented as advanced tools.
20
+
21
+ ### Removed
22
+
23
+ - Removed local run metrics and the `stats` command; aicommit no longer creates `~/.aicommit/metrics.jsonl`.
24
+ - Removed executable extensions and extension-backed provider adapters to reduce the trusted-code and compatibility surface.
25
+ - Removed user-installable provider preset lifecycle commands; setup now uses the validated defaults shipped with each aicommit release.
26
+ - Removed the experimental `--split-hunks` planning entry point. Existing versioned hunk plan artifacts remain readable for recovery and compatibility.
27
+
7
28
  ## [2.0.1] - 2026-08-27
8
29
 
9
30
  ### Fixed
@@ -132,7 +153,9 @@ This file lists notable user-facing changes. Internal refactors, test-only chang
132
153
  - Added file-level split planning and execution with Git-state concurrency checks.
133
154
  - Added provider presets and user/project configuration boundaries.
134
155
 
135
- [Unreleased]: https://github.com/hi-fullmoon/AICommit/compare/v2.0.1...HEAD
156
+ [Unreleased]: https://github.com/hi-fullmoon/AICommit/compare/v2.2.0...HEAD
157
+ [2.2.0]: https://github.com/hi-fullmoon/AICommit/releases/tag/v2.2.0
158
+ [2.1.0]: https://github.com/hi-fullmoon/AICommit/releases/tag/v2.1.0
136
159
  [2.0.1]: https://github.com/hi-fullmoon/AICommit/releases/tag/v2.0.1
137
160
  [2.0.0]: https://github.com/hi-fullmoon/AICommit/releases/tag/v2.0.0
138
161
  [1.5.1]: https://github.com/hi-fullmoon/AICommit/releases/tag/v1.5.1
package/README.md CHANGED
@@ -44,9 +44,9 @@ The fastest way is the interactive wizard:
44
44
  aicommit setup
45
45
  ```
46
46
 
47
- It walks you through picking a provider from the active versioned preset manifest (bundled presets include OpenAI, DeepSeek, OpenRouter, MiniMax, Kimi Code, and Ollama) or entering a custom OpenAI-compatible endpoint, then entering your API key and one or more models, choosing a default model and commit language, and optionally testing the connection. Configuration is written atomically to the user config (`~/.aicommit.config.json`); a malformed or old-format existing file is backed up before replacement.
47
+ It walks you through choosing built-in provider defaults (OpenAI, DeepSeek, OpenRouter, MiniMax, Kimi Code, and Ollama) or entering a custom OpenAI-compatible endpoint, then entering your API key and one or more models, choosing a default model and commit language, and optionally testing the connection. Configuration is written atomically to the user config (`~/.aicommit/config.json`); a malformed or old-format existing file is backed up before replacement. The legacy `~/.aicommit.config.json` path remains readable and `aicommit setup` migrates its settings to the canonical path when saving.
48
48
 
49
- To configure by hand, start from [.aicommit.config.example.json](.aicommit.config.example.json). User config is loaded first, then allow-listed generation preferences from `./.aicommit.config.json` are deep-merged over it. Project config may set `language`, `commitPolicy`, `stripFiles`, `temperature`, and lower diff/token/timeout or repository-context ceilings. A project-owned `prompt` is ignored unless the user config explicitly sets `allowProjectPrompt: true`. Connection/provider fields (including `apiKeyEnv`), reasoning request controls, unknown keys, and attempts to raise a ceiling are ignored with a warning. This prevents a cloned repository from redirecting an authenticated request or silently increasing its cost/data scope.
49
+ To configure by hand, start from [.aicommit.config.example.json](.aicommit.config.example.json). User config is loaded first, then allow-listed generation preferences from the project config at `./.aicommit.config.json` are deep-merged over it. Project config may set `language`, `commitPolicy`, `stripFiles`, `temperature`, and lower diff/token/timeout or repository-context ceilings. A project-owned `prompt` is ignored unless the user config explicitly sets `allowProjectPrompt: true`. Connection/provider fields (including `apiKeyEnv`), reasoning request controls, unknown keys, and attempts to raise a ceiling are ignored with a warning. This prevents a cloned repository from redirecting an authenticated request or silently increasing its cost/data scope.
50
50
 
51
51
  To keep a key out of the JSON file, set `"apiKeyEnv": "OPENAI_API_KEY"` (and leave `apiKey` empty), or enter `env:OPENAI_API_KEY` in the setup wizard. Environment variables take priority over every other credential source and are recommended for CI and other stateless environments.
52
52
 
@@ -101,7 +101,7 @@ This is the only supported user-config shape. Earlier flat or provider-level `mo
101
101
  | `apiUrl` | OpenAI-compatible chat completions endpoint |
102
102
  | `apiKey` | API key (empty string allowed for local models) |
103
103
  | `apiKeyEnv` | Environment variable containing the API key; takes precedence over `apiKey` (default: empty) |
104
- | `providerType` | Required adapter: `openai`, `openrouter`, `deepseek`, `minimax`, `ollama`, `custom`, or a user-installed `extension:<id>` |
104
+ | `providerType` | Required adapter: `openai`, `openrouter`, `deepseek`, `minimax`, `ollama`, or `custom` |
105
105
  | `defaultModel` | Required model alias used when `-m` is not given |
106
106
  | `models` | Named model profiles under one provider |
107
107
  | `modelId` | Required API model identifier inside each model profile |
@@ -115,8 +115,6 @@ This is the only supported user-config shape. Earlier flat or provider-level `mo
115
115
  | `timeoutMs` | Per-request timeout in milliseconds (default: `120000`) |
116
116
  | `retry` | Transient retry limits: `maxAttempts`, `baseDelayMs`, and `maxDelayMs` (defaults: `3`, `500`, and `5000`) |
117
117
  | `credentialHelper` | Opt in to `git credential fill` with `enabled` and `username` (defaults: `false` and `aicommit`) |
118
- | `metrics` | Local-only metrics controls: `enabled`, absolute `path` or empty for the default, and `maxEntries` (defaults: `true`, empty, and `500`) |
119
- | `extensions` | User-owned absolute manifest paths plus execution timeout/context ceiling; repository config cannot enable or redirect extensions |
120
118
  | `maxDiffChars` | Diff chars sent to the model per call; oversized diffs become a `--stat` summary + truncated hunks (default: `30000`) |
121
119
  | `maxFileDiffChars` | Cap on a single file's diff section; bigger sections are truncated to their leading hunks so one huge file can't crowd out the rest (default: `3000`) |
122
120
  | `splitMaxDiffChars` | Diff chars sent to the split-planning call; split mode needs less hunk detail than final message generation (default: `16000`) |
@@ -163,7 +161,7 @@ aicommit doctor -p kimi-code
163
161
 
164
162
  `kimi-for-coding` is available to all Kimi Code membership tiers and follows the service's rolling model upgrades. Kimi Code membership keys use `api.kimi.com`; Kimi Platform pay-as-you-go keys use a different endpoint and are not interchangeable.
165
163
 
166
- See the bilingual [provider compatibility table](docs/provider-compatibility.md) for streaming, reasoning, token-budget, usage, authentication, preset, and extension-adapter boundaries.
164
+ See the bilingual [provider compatibility table](docs/provider-compatibility.md) for streaming, reasoning, token-budget, usage, and authentication boundaries.
167
165
 
168
166
  ### Repository policy and bounded context
169
167
 
@@ -217,22 +215,9 @@ Every provider adapter maps the same generation contract: messages, streaming, r
217
215
 
218
216
  Requests retry only transient failures: HTTP 429, recoverable 5xx responses, network interruption, and interrupted response bodies. Retries are bounded by `retry.maxAttempts`, use capped exponential backoff, and honor `Retry-After` when present. Authentication, invalid-parameter, and content-safety failures are returned immediately without retrying.
219
217
 
220
- ### Versioned provider presets
218
+ ### Built-in provider defaults
221
219
 
222
- Setup defaults live in a strict manifest separate from request adapters and the Git/interaction flow. A compatible provider can be added by updating preset data and referencing an existing adapter:
223
-
224
- ```bash
225
- aicommit preset show
226
- aicommit preset validate --file=provider-presets.json
227
- aicommit preset install --file=provider-presets.json
228
- aicommit preset rollback
229
- ```
230
-
231
- The active user manifest is `~/.aicommit/provider-presets.json`; each update keeps the previous valid version for rollback. Manifests declare their own semantic version, supported core range, and adapter-contract version, and cannot contain credentials. Core prerelease versions and build metadata are parsed using SemVer rules; build metadata does not affect compatibility ordering. See the bilingual [preset compatibility/update guide](docs/provider-presets.md) and [published schema](schemas/aicommit-provider-presets.schema.json).
232
-
233
- ### Credential-denied extensions
234
-
235
- Three minimal extension interfaces are available: bounded repository context, commit-message validation, and provider request/response adaptation. User-installed single-file ESM extensions run outside the CLI process under Node's permission model and declare `credentials: false`; they receive neither resolved credentials nor inherited secret environment variables. Repository config cannot install or select extension code. Node.js 20+ is required only when executable extensions are enabled; the core CLI remains compatible with Node.js 18. See the bilingual [extension contract, security model, and executable example](docs/extensions.md), plus the [manifest schema](schemas/aicommit-extension.schema.json).
220
+ Setup uses validated provider defaults shipped with AICommit. OpenAI includes GPT-4o and GPT-5.6 profiles; DeepSeek includes V4 Flash and Pro; OpenRouter includes Auto plus current GPT, Claude, Gemini, DeepSeek, Qwen, GLM, Kimi, and Grok choices; Ollama includes Qwen 3, DeepSeek R1, and GPT-OSS profiles. These are starting points: setup keeps the model IDs editable and existing user-defined profiles take precedence. For another OpenAI-compatible service, add a named provider directly to the user config; no separate manifest installation or third-party executable code is required.
236
221
 
237
222
  ### Saving tokens
238
223
 
@@ -245,9 +230,9 @@ Token spend per call is dominated by the diff; aicommit already strips lock file
245
230
 
246
231
  ## Privacy and data flow
247
232
 
248
- The bilingual [privacy model](docs/privacy.md) maps every local, provider, extension, metric, and distribution trust boundary. The summary below covers the default runtime path.
233
+ The bilingual [privacy model](docs/privacy.md) maps the local process, provider, credential, and distribution trust boundaries. The summary below covers the default runtime path.
249
234
 
250
- AICommit has no hosted backend and no metrics-upload implementation. At runtime it only makes generation requests to the `apiUrl` selected from your user-owned provider configuration. The API key is sent to that endpoint as authorization; verify custom endpoints before trusting them with credentials or repository content.
235
+ AICommit has no hosted backend and does not record or upload usage metrics. At runtime it only makes generation requests to the `apiUrl` selected from your user-owned provider configuration. The API key is sent to that endpoint as authorization; verify custom endpoints before trusting them with credentials or repository content.
251
236
 
252
237
  Commit-generation requests can contain:
253
238
 
@@ -260,11 +245,7 @@ Commit-generation requests can contain:
260
245
 
261
246
  AICommit does not intentionally send unrelated repository files, historical commit bodies, environment variables, or its local configuration file. Every selected diff, path list, history sample, preview, and convention excerpt is placed inside an explicit JSON envelope marked as untrusted data; the authoritative system policy instructs the model never to follow embedded repository instructions. Lock files, configured `stripFiles`, oversized sections, common sensitive filenames, private-key material, cloud access-key IDs, and credential-like assignments are omitted, truncated, or redacted before the default request. The interactive warning still allows explicitly sending the original diff, so review that choice carefully. Detection and prompt boundaries are guardrails, not complete secret or prompt-injection defenses.
262
247
 
263
- Project-level configuration is treated as untrusted: it cannot change the endpoint, provider, credentials, retry policy, metrics, reasoning request controls, or increase user-configured data/cost ceilings. Prefer `apiKeyEnv` or the OS-backed Git credential helper for credentials. The setup wizard can save a literal key in the user config when requested; that file is written atomically with owner-only permissions where the OS supports them.
264
-
265
- Successful and failed commit runs write a minimal local JSONL metric by default to `~/.aicommit/metrics.jsonl`. Each record contains exactly duration, normalized token usage, a bounded result category, whether the message was edited, and the rewrite count (including automatic policy correction). It never contains the diff, reasoning, commit message, file names, provider, model, or credentials. The file retains the newest 500 records by default and is written with owner-only permissions where supported.
266
-
267
- Use `aicommit stats` to view first-pass acceptance, edit/rewrite/failure rates, P50/P95 latency, token totals, and recent-vs-previous trends. After ten successful runs it compares two chronological baseline windows and reports progress toward the roadmap's 20% relative edit/rewrite-rate improvement target. `aicommit stats clear|enable|disable` manages the same local store; clearing is permanent. Set `metrics.enabled` to `false`, choose an absolute `metrics.path`, or change `metrics.maxEntries` in the user config. Project config cannot override these settings, and there is no upload implementation.
248
+ Project-level configuration is treated as untrusted: it cannot change the endpoint, provider, credentials, retry policy, reasoning request controls, or increase user-configured data/cost ceilings. Prefer `apiKeyEnv` or the OS-backed Git credential helper for credentials. The setup wizard can save a literal key in the user config when requested; that file is written atomically with owner-only permissions where the OS supports them.
268
249
 
269
250
  ## Usage
270
251
 
@@ -275,14 +256,11 @@ aicommit config show # show the effective config with secrets redacted
275
256
  aicommit config validate # validate config without resolving credentials
276
257
  aicommit config path # print user and project config paths
277
258
  aicommit completion bash # generate Bash completion on stdout
278
- aicommit stats # show local quality, latency, and token trends
279
- aicommit stats clear # permanently clear local metric history
280
259
  aicommit # generate & commit in current directory
281
260
  aicommit /path/to/repo # or a target directory
282
261
  aicommit split # choose staged/all scope, then split logical commits
283
262
  aicommit split --scope=staged # split only the reviewed index snapshot
284
263
  aicommit split --scope=all # split the complete working-tree snapshot
285
- aicommit split --scope=staged --split-hunks # experimental same-file hunk splitting
286
264
  aicommit --dry-run # generate and review without creating a commit
287
265
  aicommit split --dry-run # review a split plan without creating commits
288
266
  aicommit --yes # non-interactively commit already staged changes
@@ -306,7 +284,6 @@ aicommit -h # help
306
284
  | `-l`, `--lang` | Commit message language (`zh` or `en`) |
307
285
  | `-p`, `--provider` | Use the named provider from `providers` |
308
286
  | `-m`, `--model` | Use a named model profile from the selected provider |
309
- | `--split-hunks` | Opt in to experimental same-file text-hunk planning; disabled by default |
310
287
  | `--scope` | `staged` or `all` scope for `aicommit split` and `aicommit split plan` |
311
288
  | `--file` | JSON plan path for `aicommit split plan` and `aicommit split apply` |
312
289
  | `--dry-run` | Generate and review a message or split plan without creating commits |
@@ -329,13 +306,38 @@ Completion scripts are generated from the installed CLI and contain no configura
329
306
  # Bash
330
307
  aicommit completion bash > ~/.local/share/bash-completion/completions/aicommit
331
308
 
332
- # Zsh (ensure the destination directory is in $fpath)
309
+ # Zsh
310
+ mkdir -p ~/.zfunc
333
311
  aicommit completion zsh > ~/.zfunc/_aicommit
334
312
 
335
313
  # Fish
336
314
  aicommit completion fish > ~/.config/fish/completions/aicommit.fish
337
315
  ```
338
316
 
317
+ For Zsh, add the completion directory to `fpath` before the line that initializes Oh My Zsh or another completion framework. For Oh My Zsh, place this in `~/.zshrc` before `source "$ZSH/oh-my-zsh.sh"`:
318
+
319
+ ```zsh
320
+ fpath=("$HOME/.zfunc" $fpath)
321
+ source "$ZSH/oh-my-zsh.sh"
322
+ ```
323
+
324
+ If no Zsh framework initializes completion, use this instead:
325
+
326
+ ```zsh
327
+ fpath=("$HOME/.zfunc" $fpath)
328
+ autoload -Uz compinit
329
+ compinit
330
+ ```
331
+
332
+ Restart Zsh after editing the file. If a previous completion cache prevents discovery, remove only that cache before restarting:
333
+
334
+ ```bash
335
+ rm -f "$HOME"/.zcompdump*
336
+ exec zsh
337
+ ```
338
+
339
+ Verify the registration with `whence -w _aicommit`; it should print `_aicommit: function`. Then type `aicommit`, add a space, and press `Tab`.
340
+
339
341
  ### Machine-readable output
340
342
 
341
343
  Use `--output=json` for scripts and CI. Commit and split flows also require `--yes`, preventing a machine consumer from hanging on an interactive prompt. stdout contains exactly one JSON object; progress, debug details, and diagnostics go to stderr. `doctor --output=json` does not require `--yes`.
@@ -382,7 +384,7 @@ Stable process exits are shared by text and JSON modes:
382
384
 
383
385
  `aicommit doctor` checks the running Node.js and Git versions, loaded config sources, endpoint security, selected adapter capabilities, redacted credential source, and a live provider connection. It prints source labels such as `env:OPENAI_API_KEY`, `git credential helper`, or `keyless localhost`, never the credential value. Endpoint userinfo, credential-like query parameters, and fragments are also redacted from normal output and credential-resolution errors. Use `aicommit doctor -p <provider> -m <model>` to select a configured provider/model pair or `aicommit doctor --output=json` in automation.
384
386
 
385
- For stable error categories, npm verification failures, split recovery, preset compatibility, and extension isolation failures, use the bilingual [troubleshooting matrix](docs/troubleshooting.md).
387
+ For stable error categories, npm verification failures, provider configuration, and split recovery, use the bilingual [troubleshooting matrix](docs/troubleshooting.md).
386
388
 
387
389
  Flow: reads the staged diff, sends it to the AI, then lets you **accept** (Enter), **edit** (`e`), or **cancel** (`n`). In interactive selection prompts, `q` exits immediately. If nothing is staged but the working tree has unstaged or untracked changes, aicommit offers to stage them for you — all at once (`git add -A`) or file by file — before continuing. Once anything is staged, that index snapshot is authoritative; other working-tree changes are left untouched.
388
390
 
@@ -411,14 +413,12 @@ When reasoning mode is `on` (including via `--reasoning=<level>`), aicommit requ
411
413
 
412
414
  ### Split mode
413
415
 
414
- `aicommit split` (also available as the explicit `aicommit split run`) asks whether to group the staged index snapshot or all staged, unstaged, and untracked changes into logical commits. Use `--scope=staged` or `--scope=all` when the boundary must be explicit, including every non-interactive run. You can review the plan, regenerate messages for selected groups, or edit the plan as JSON before committing. Extension validation errors are shown with the plan and must be corrected by editing or regenerating before commit. Sensitive-content detection fails closed before a non-interactive provider request or automatic staging.
416
+ `aicommit split` (also available as the explicit `aicommit split run`) asks whether to group the staged index snapshot or all staged, unstaged, and untracked changes into file-level logical commits. Use `--scope=staged` or `--scope=all` when the boundary must be explicit, including every non-interactive run. You can review the plan, regenerate messages for selected groups, or edit the plan as JSON before committing. Sensitive-content detection fails closed before a non-interactive provider request or automatic staging.
415
417
 
416
418
  For an auditable two-step flow, `aicommit split plan --scope=staged|all --file=<path>` exports a versioned JSON artifact, and `aicommit split apply --file=<path>` rechecks its base commit, change set, and content fingerprint before touching the index. Keep plan files outside the worktree or under `.git` so they cannot become part of their own plan.
417
419
 
418
420
  Execution uses temporary indexes and a code-free checkpoint under `.git/aicommit`. A hook, Git error, interruption, or crash leaves completed commits in history and preserves the pending snapshot; the failure report shows checkpointed, in-flight, pending, and current worktree/index state. Resolve the cause and run `aicommit split resume`. Resume reconciles the possible post-commit crash window before creating anything else, so a completed group is neither duplicated nor omitted. If you intentionally finished or replaced the interrupted work through another Git workflow, run `aicommit split abort`; it removes only the stale checkpoint and never rewrites HEAD, the index, or the worktree. New committing split runs detect a checkpoint before contacting the provider. If planning or preflight fails before the first group, no split commit is created and the real index remains unchanged.
419
421
 
420
- Split remains file-level by default. `--split-hunks` opts in to experimental same-file splitting for tracked text modifications with multiple unified-diff hunks. The JSON plan and checkpoint store only hunk IDs, line ranges, and hashes—not patch content. Before the first commit, AICommit applies every selected patch to a temporary index and requires the final tree to reproduce the captured target blobs exactly; parsing, patching, binary/mode-change, or lossless-validation failures fall back to a file-level plan. The worktree is never modified by hunk execution.
421
-
422
422
  ## Development and releases
423
423
 
424
424
  See [CONTRIBUTING.md](CONTRIBUTING.md) for local development and pull-request checks, [SECURITY.md](SECURITY.md) for private vulnerability reporting, [RELEASING.md](RELEASING.md) for the maintainer process, and the bilingual [distribution guide](docs/distribution.md) for npm installation and rollback. Releases use npm Trusted Publishing with provenance and publish the exact verified package tarball. `npm run eval` runs the anonymous local quality corpus covering single and mixed changes, renames, generated files, long diffs, Chinese/English output, and malformed weak-model candidates; it is also part of `npm run ci`.
package/README.zh-CN.md CHANGED
@@ -46,9 +46,9 @@ npm install --global @hifullmoon/aicommit
46
46
  aicommit setup
47
47
  ```
48
48
 
49
- 向导会引导你从当前生效的版本化预设清单中选择 Provider(内置预设包括 OpenAI、DeepSeek、OpenRouter、MiniMax、Kimi Code 和 Ollama),或填写自定义 OpenAI 兼容端点;随后输入 API Key 和一个或多个模型、选择默认模型和提交信息语言,并可选测试连接。配置会原子写入用户配置文件 `~/.aicommit.config.json`;如果已有文件格式错误或属于旧格式,替换前会先备份。
49
+ 向导会引导你选择内置 Provider 默认值(OpenAI、DeepSeek、OpenRouter、MiniMax、Kimi Code 和 Ollama),或填写自定义 OpenAI 兼容端点;随后输入 API Key 和一个或多个模型、选择默认模型和提交信息语言,并可选测试连接。配置会原子写入用户配置文件 `~/.aicommit/config.json`;如果已有文件格式错误或属于旧格式,替换前会先备份。旧路径 `~/.aicommit.config.json` 仍可读取,运行 `aicommit setup` 并保存时会把其中设置迁移到规范路径。
50
50
 
51
- 如需手动配置,请从 [.aicommit.config.example.json](.aicommit.config.example.json) 开始。AICommit 先加载用户配置,再将 `./.aicommit.config.json` 中白名单内的生成偏好深度合并到用户配置之上。项目配置可以设置 `language`、`commitPolicy`、`stripFiles`、`temperature`,也可以降低 diff、token、timeout 或仓库上下文上限。项目拥有的 `prompt` 默认会被忽略,除非用户配置明确设置 `allowProjectPrompt: true`。连接或 Provider 字段(包括 `apiKeyEnv`)、推理请求控制、未知字段,以及任何试图提高上限的配置,都会被忽略并给出警告。这样可以防止克隆的仓库重定向已鉴权请求,或在不知情的情况下扩大成本和数据范围。
51
+ 如需手动配置,请从 [.aicommit.config.example.json](.aicommit.config.example.json) 开始。AICommit 先加载用户配置,再将项目配置 `./.aicommit.config.json` 中白名单内的生成偏好深度合并到用户配置之上。项目配置可以设置 `language`、`commitPolicy`、`stripFiles`、`temperature`,也可以降低 diff、token、timeout 或仓库上下文上限。项目拥有的 `prompt` 默认会被忽略,除非用户配置明确设置 `allowProjectPrompt: true`。连接或 Provider 字段(包括 `apiKeyEnv`)、推理请求控制、未知字段,以及任何试图提高上限的配置,都会被忽略并给出警告。这样可以防止克隆的仓库重定向已鉴权请求,或在不知情的情况下扩大成本和数据范围。
52
52
 
53
53
  如需避免把密钥写入 JSON,请设置 `"apiKeyEnv": "OPENAI_API_KEY"`(并将 `apiKey` 留空),或在 setup 向导中输入 `env:OPENAI_API_KEY`。环境变量优先于所有其他凭据来源,推荐用于 CI 和其他无状态环境。
54
54
 
@@ -103,7 +103,7 @@ AICommit 也可以读取操作系统上已经配置的 Git credential helper。
103
103
  | `apiUrl` | OpenAI 兼容的 Chat Completions 端点 |
104
104
  | `apiKey` | API Key;本地模型允许使用空字符串 |
105
105
  | `apiKeyEnv` | 保存 API Key 的环境变量名,优先于 `apiKey`(默认:空) |
106
- | `providerType` | 必填适配器:`openai`、`openrouter`、`deepseek`、`minimax`、`ollama`、`custom` 或用户安装的 `extension:<id>` |
106
+ | `providerType` | 必填适配器:`openai`、`openrouter`、`deepseek`、`minimax`、`ollama` 或 `custom` |
107
107
  | `defaultModel` | 必填;未指定 `-m` 时使用的模型别名 |
108
108
  | `models` | 一个 Provider 下的命名模型配置 |
109
109
  | `modelId` | 每个模型配置中必填的 API 模型标识 |
@@ -117,8 +117,6 @@ AICommit 也可以读取操作系统上已经配置的 Git credential helper。
117
117
  | `timeoutMs` | 单次请求超时,单位为毫秒(默认:`120000`) |
118
118
  | `retry` | 瞬时错误重试限制:`maxAttempts`、`baseDelayMs`、`maxDelayMs`(默认:`3`、`500`、`5000`) |
119
119
  | `credentialHelper` | 通过 `enabled` 和 `username` 选择性启用 `git credential fill`(默认:`false`、`aicommit`) |
120
- | `metrics` | 仅本地指标控制:`enabled`、绝对路径 `path`(空表示默认路径)、`maxEntries`(默认:`true`、空、`500`) |
121
- | `extensions` | 用户拥有的绝对扩展清单路径,以及执行超时和上下文上限;项目配置不能启用或重定向扩展 |
122
120
  | `maxDiffChars` | 单次发送给模型的 diff 字符数;超限后改为 `--stat` 摘要和截断的 hunk(默认:`30000`) |
123
121
  | `maxFileDiffChars` | 单文件 diff 上限;超限文件只保留前部 hunk,避免一个大文件挤占全部上下文(默认:`3000`) |
124
122
  | `splitMaxDiffChars` | 拆分规划请求的 diff 字符数;规划阶段需要的 hunk 细节少于最终信息生成(默认:`16000`) |
@@ -165,7 +163,7 @@ aicommit doctor -p kimi-code
165
163
 
166
164
  `kimi-for-coding` 对所有 Kimi Code 会员档位开放,并随服务滚动升级模型。Kimi Code 会员 Key 使用 `api.kimi.com`;Kimi 开放平台按量付费 Key 使用不同端点,两者不能混用。
167
165
 
168
- 流式输出、推理、token 预算、usage、鉴权、预设和扩展适配边界,请参阅双语 [Provider 兼容表](docs/provider-compatibility.md)。
166
+ 流式输出、推理、token 预算、usage 和鉴权边界,请参阅双语 [Provider 兼容表](docs/provider-compatibility.md)。
169
167
 
170
168
  ### 仓库策略与受限上下文
171
169
 
@@ -219,22 +217,9 @@ aicommit policy check --range=origin/main..HEAD --output=json
219
217
 
220
218
  请求只对瞬时错误重试:HTTP 429、可恢复的 5xx、网络中断和响应体中断。重试次数受 `retry.maxAttempts` 限制,使用带上限的指数退避,并遵循 `Retry-After`。鉴权、非法参数和内容安全错误会立即返回,不会重试。
221
219
 
222
- ### 版本化 Provider 预设
220
+ ### 内置 Provider 默认值
223
221
 
224
- setup 默认值保存在严格的清单中,与请求适配器及 Git / 交互流程分离。添加兼容 Provider 只需更新预设数据,并引用已有适配器:
225
-
226
- ```bash
227
- aicommit preset show
228
- aicommit preset validate --file=provider-presets.json
229
- aicommit preset install --file=provider-presets.json
230
- aicommit preset rollback
231
- ```
232
-
233
- 当前用户清单位于 `~/.aicommit/provider-presets.json`;每次更新都会保留上一份有效版本,以便回滚。清单声明自己的语义版本、支持的核心版本范围和适配器契约版本,并且不能包含凭据。核心预发布版本和构建元数据按 SemVer 规则解析;构建元数据不影响兼容性排序。参阅双语[预设兼容与更新指南](docs/provider-presets.md)及已发布的 [schema](schemas/aicommit-provider-presets.schema.json)。
234
-
235
- ### 无凭据扩展
236
-
237
- AICommit 提供三种最小扩展接口:受限仓库上下文、提交信息校验,以及 Provider 请求 / 响应适配。用户安装的单文件 ESM 扩展在 CLI 进程之外、Node 权限模型下运行,并声明 `credentials: false`;扩展既不会收到已解析凭据,也不会继承秘密环境变量。仓库配置不能安装或选择扩展代码。只有启用可执行扩展时才需要 Node.js 20+;核心 CLI 仍兼容 Node.js 18。参阅双语[扩展契约、安全模型和可执行示例](docs/extensions.md),以及[扩展清单 schema](schemas/aicommit-extension.schema.json)。
222
+ setup 使用随 AICommit 一起发布并经过校验的 Provider 默认值。OpenAI 预置 GPT-4o 与 GPT-5.6 系列,DeepSeek 预置 V4 Flash 与 Pro,OpenRouter 预置 Auto 以及当前常用的 GPT、Claude、Gemini、DeepSeek、Qwen、GLM、Kimi 和 Grok,Ollama 预置 Qwen 3、DeepSeek R1 与 GPT-OSS。这些配置只是起点:setup 仍允许编辑模型 ID,已有的用户自定义模型配置也会优先保留。需要其他 OpenAI 兼容服务时,直接在用户配置中增加命名 Provider;无需安装额外清单或执行第三方代码。
238
223
 
239
224
  ### 节省 Token
240
225
 
@@ -247,9 +232,9 @@ AICommit 提供三种最小扩展接口:受限仓库上下文、提交信息
247
232
 
248
233
  ## 隐私与数据流
249
234
 
250
- 双语[隐私模型](docs/privacy.md)描述了本地进程、Provider、扩展、指标和分发环节的信任边界。下面概述默认运行路径。
235
+ 双语[隐私模型](docs/privacy.md)描述了本地进程、Provider、凭据和分发环节的信任边界。下面概述默认运行路径。
251
236
 
252
- AICommit 没有托管后端,也没有指标上传实现。运行时只会向用户配置选定的 `apiUrl` 发起生成请求。API Key 会作为鉴权信息发送到该端点;在把凭据或仓库内容交给自定义端点前,请先验证其可信度。
237
+ AICommit 没有托管后端,也不会记录或上传使用指标。运行时只会向用户配置选定的 `apiUrl` 发起生成请求。API Key 会作为鉴权信息发送到该端点;在把凭据或仓库内容交给自定义端点前,请先验证其可信度。
253
238
 
254
239
  提交生成请求可能包含:
255
240
 
@@ -262,11 +247,7 @@ AICommit 没有托管后端,也没有指标上传实现。运行时只会向
262
247
 
263
248
  AICommit 不会主动发送无关的仓库文件、历史提交正文、环境变量或本地配置文件。每个选中的 diff、路径列表、历史样本、预览和约定摘录都会放入标记为“不可信数据”的显式 JSON 信封;权威 system policy 会要求模型绝不执行仓库内容中嵌入的指令。lock 文件、配置的 `stripFiles`、超大段落、常见敏感文件名、私钥材料、云访问 Key ID 和疑似凭据赋值,会在默认请求前被省略、截断或脱敏。交互警告仍允许你明确发送原始 diff,请谨慎确认。检测规则和 prompt 边界属于安全护栏,不能完全替代秘密扫描或 prompt injection 防护。
264
249
 
265
- 项目级配置被视为不可信:它不能修改端点、Provider、凭据、重试策略、指标、推理请求控制,也不能提高用户配置的数据或成本上限。凭据建议使用 `apiKeyEnv` 或由操作系统保护的 Git credential helper。如果用户明确要求,setup 向导也可以把明文 Key 写入用户配置;在操作系统支持时,该文件会以仅所有者可读写权限原子保存。
266
-
267
- 默认情况下,成功和失败的提交运行会向 `~/.aicommit/metrics.jsonl` 写入最小化的本地 JSONL 指标。每条记录只包含耗时、标准化 token 用量、受限结果分类、消息是否被编辑,以及重写次数(包括自动策略修正)。它绝不包含 diff、推理、提交信息、文件名、Provider、模型或凭据。默认只保留最新 500 条记录,并在系统支持时使用仅所有者权限写入。
268
-
269
- 使用 `aicommit stats` 查看首次接受率、编辑 / 重写 / 失败率、P50 / P95 延迟、token 总量,以及近期窗口和前一窗口的趋势。成功运行达到 10 次后,它会比较两个按时间排序的基线窗口,并报告相对于路线图“编辑 / 重写率降低 20%”目标的进度。`aicommit stats clear|enable|disable` 管理同一本地数据;清除操作不可恢复。可以在用户配置中将 `metrics.enabled` 设为 `false`、指定绝对 `metrics.path`,或修改 `metrics.maxEntries`。项目配置不能覆盖这些设置,也不存在上传实现。
250
+ 项目级配置被视为不可信:它不能修改端点、Provider、凭据、重试策略、推理请求控制,也不能提高用户配置的数据或成本上限。凭据建议使用 `apiKeyEnv` 或由操作系统保护的 Git credential helper。如果用户明确要求,setup 向导也可以把明文 Key 写入用户配置;在操作系统支持时,该文件会以仅所有者可读写权限原子保存。
270
251
 
271
252
  ## 使用方法
272
253
 
@@ -277,14 +258,11 @@ aicommit config show # 显示脱敏后的有效配置
277
258
  aicommit config validate # 校验配置,但不解析凭据
278
259
  aicommit config path # 显示用户配置和项目配置路径
279
260
  aicommit completion bash # 向 stdout 生成 Bash 补全脚本
280
- aicommit stats # 显示本地质量、延迟和 token 趋势
281
- aicommit stats clear # 永久清除本地指标历史
282
261
  aicommit # 在当前目录生成提交信息并提交
283
262
  aicommit /path/to/repo # 或指定目标目录
284
263
  aicommit split # 选择 staged / all 范围并拆分逻辑提交
285
264
  aicommit split --scope=staged # 只拆分已审阅的 index 快照
286
265
  aicommit split --scope=all # 拆分完整工作区快照
287
- aicommit split --scope=staged --split-hunks # 实验性同文件 hunk 拆分
288
266
  aicommit --dry-run # 生成并审阅,但不创建提交
289
267
  aicommit split --dry-run # 审阅拆分计划,但不创建提交
290
268
  aicommit --yes # 非交互提交已明确暂存的变更
@@ -308,7 +286,6 @@ aicommit -h # 帮助
308
286
  | `-l`, `--lang` | 提交信息语言:`zh` 或 `en` |
309
287
  | `-p`, `--provider` | 使用 `providers` 中的命名 Provider |
310
288
  | `-m`, `--model` | 使用所选 Provider 下的命名模型配置 |
311
- | `--split-hunks` | 启用实验性同文件文本 hunk 规划;默认关闭 |
312
289
  | `--scope` | `aicommit split` 和 `aicommit split plan` 的范围:`staged` 或 `all` |
313
290
  | `--file` | `aicommit split plan` 和 `aicommit split apply` 的 JSON 计划路径 |
314
291
  | `--dry-run` | 生成并审阅消息或拆分计划,但不创建提交 |
@@ -331,13 +308,38 @@ aicommit -h # 帮助
331
308
  # Bash
332
309
  aicommit completion bash > ~/.local/share/bash-completion/completions/aicommit
333
310
 
334
- # Zsh(请确保目标目录位于 $fpath 中)
311
+ # Zsh
312
+ mkdir -p ~/.zfunc
335
313
  aicommit completion zsh > ~/.zfunc/_aicommit
336
314
 
337
315
  # Fish
338
316
  aicommit completion fish > ~/.config/fish/completions/aicommit.fish
339
317
  ```
340
318
 
319
+ Zsh 还需要在 Oh My Zsh 或其他补全框架初始化之前,将补全目录加入 `fpath`。使用 Oh My Zsh 时,请在 `~/.zshrc` 的 `source "$ZSH/oh-my-zsh.sh"` 之前加入:
320
+
321
+ ```zsh
322
+ fpath=("$HOME/.zfunc" $fpath)
323
+ source "$ZSH/oh-my-zsh.sh"
324
+ ```
325
+
326
+ 如果没有使用负责初始化补全的 Zsh 框架,则改用:
327
+
328
+ ```zsh
329
+ fpath=("$HOME/.zfunc" $fpath)
330
+ autoload -Uz compinit
331
+ compinit
332
+ ```
333
+
334
+ 修改后重启 Zsh。如果旧补全缓存导致脚本仍未被发现,可以只清理该缓存后再重启:
335
+
336
+ ```bash
337
+ rm -f "$HOME"/.zcompdump*
338
+ exec zsh
339
+ ```
340
+
341
+ 运行 `whence -w _aicommit` 验证注册结果;正常应输出 `_aicommit: function`。随后输入 `aicommit`、空一格并按 `Tab` 即可使用补全。
342
+
341
343
  ### 机器可读输出
342
344
 
343
345
  脚本和 CI 请使用 `--output=json`。提交和 split 流程还必须使用 `--yes`,避免机器消费者卡在交互提示上。stdout 只包含一个 JSON 对象;进度、调试信息和诊断输出会写入 stderr。`doctor --output=json` 不要求 `--yes`。
@@ -384,7 +386,7 @@ aicommit completion fish > ~/.config/fish/completions/aicommit.fish
384
386
 
385
387
  `aicommit doctor` 会检查当前 Node.js 与 Git 版本、已加载的配置来源、端点安全、所选适配器能力、脱敏后的凭据来源,以及实时 Provider 连接。它会显示 `env:OPENAI_API_KEY`、`git credential helper`、`keyless localhost` 等来源标签,但绝不会显示凭据值。端点 userinfo、疑似凭据的查询参数和 URL fragment 也会从正常输出及凭据解析错误中脱敏。使用 `aicommit doctor -p <provider> -m <model>` 选择已配置的 Provider / 模型组合,或在自动化中使用 `aicommit doctor --output=json`。
386
388
 
387
- 稳定错误分类、npm 校验失败、split 恢复、预设兼容和扩展隔离错误,请参阅双语[故障排查矩阵](docs/troubleshooting.md)。
389
+ 稳定错误分类、npm 校验失败、Provider 配置和 split 恢复问题,请参阅双语[故障排查矩阵](docs/troubleshooting.md)。
388
390
 
389
391
  基本流程:读取暂存 diff,发送给 AI,然后让你选择**接受**(Enter)、**编辑**(`e`)或**取消**(`n`)。在交互式选择提示中,按 `q` 会立即退出。如果没有暂存内容,但工作区存在未暂存或未跟踪变更,AICommit 会先询问是否为你暂存——可以一次性执行 `git add -A`,也可以逐文件选择——然后继续。一旦存在暂存内容,就以该 index 快照为准,其余工作区变更保持不动。
390
392
 
@@ -413,14 +415,12 @@ aicommit completion fish > ~/.config/fish/completions/aicommit.fish
413
415
 
414
416
  ### 拆分提交模式
415
417
 
416
- `aicommit split`(也可以显式写成 `aicommit split run`)会询问是对暂存 index 快照分组,还是对全部已暂存、未暂存和未跟踪变更分组。边界必须明确时请使用 `--scope=staged` 或 `--scope=all`,所有非交互运行都应显式指定范围。提交前可以审阅计划、为选中的组重新生成消息,或直接编辑 JSON 计划。扩展校验错误会随计划显示,必须通过编辑或重新生成修复后才能提交。敏感内容检测会在非交互 Provider 请求或自动暂存前 fail closed。
418
+ `aicommit split`(也可以显式写成 `aicommit split run`)会询问是对暂存 index 快照分组,还是对全部已暂存、未暂存和未跟踪变更做文件级分组。边界必须明确时请使用 `--scope=staged` 或 `--scope=all`,所有非交互运行都应显式指定范围。提交前可以审阅计划、为选中的组重新生成消息,或直接编辑 JSON 计划。敏感内容检测会在非交互 Provider 请求或自动暂存前 fail closed。
417
419
 
418
420
  如需可审计的两步流程,使用 `aicommit split plan --scope=staged|all --file=<path>` 导出版本化 JSON 工件,再用 `aicommit split apply --file=<path>` 在接触 index 前重新校验 base commit、变更集和内容指纹。计划文件应保存在工作区之外或 `.git` 下,避免被纳入自身计划。
419
421
 
420
422
  执行过程使用临时 index,并在 `.git/aicommit` 下保存不含代码内容的 checkpoint。hook、Git 错误、中断或崩溃发生后,已完成提交仍保留在历史中,待处理快照也会保留;失败报告会显示已 checkpoint、执行中、待处理,以及当前工作区 / index 状态。解决问题后运行 `aicommit split resume`。恢复流程会先协调“提交完成后崩溃”的可能窗口,再创建任何新提交,因此不会重复或遗漏已完成分组。如果你通过其他 Git 流程有意完成或替换了中断工作,请运行 `aicommit split abort`;它只删除过期 checkpoint,绝不会改写 HEAD、index 或工作区。新的 split 提交流程会在联系 Provider 前检测现有 checkpoint。如果规划或预检在第一组之前失败,不会创建任何 split 提交,真实 index 也保持不变。
421
423
 
422
- split 默认仍按文件拆分。`--split-hunks` 可选择性启用实验性的同文件拆分,适用于包含多个 unified-diff hunk 的 tracked 文本修改。JSON 计划和 checkpoint 只保存 hunk ID、行范围和哈希,不保存 patch 内容。第一次提交前,AICommit 会把每个选中 patch 应用到临时 index,并要求最终 tree 精确还原捕获的目标 blob;解析、patch、二进制 / mode-change 或无损校验失败时会退回文件级计划。hunk 执行绝不会修改工作区。
423
-
424
424
  ## 开发与发布
425
425
 
426
426
  本地开发和 Pull Request 检查请参阅 [CONTRIBUTING.md](CONTRIBUTING.md),私密漏洞报告请参阅 [SECURITY.md](SECURITY.md),维护者发布流程请参阅 [RELEASING.md](RELEASING.md),npm 安装和用户回滚请参阅双语[分发指南](docs/distribution.md)。发布通过 npm Trusted Publishing 生成 provenance,并发布经过校验的精确 package tarball。`npm run eval` 会运行匿名本地质量语料,覆盖单一与混合变更、rename、生成文件、长 diff、中英文输出和格式错误的弱模型候选;该命令也是 `npm run ci` 的一部分。
package/SECURITY.md CHANGED
@@ -23,7 +23,6 @@ AICommit is a local CLI that sends selected repository context directly to the c
23
23
  - untrusted diff, file, model, and reasoning text must not execute terminal control sequences;
24
24
  - common sensitive content should be detected and protected before the default model request;
25
25
  - remote endpoints must use HTTPS, while plaintext HTTP is limited to loopback development services.
26
- - third-party extension API v1 must deny resolved credential access, run out of process with a sanitized environment, and fail instead of falling back to unsandboxed execution;
27
26
  - npm releases must use Trusted Publishing provenance.
28
27
 
29
28
  Sensitive-content detection is intentionally a defense in depth and cannot replace a dedicated secret scanner. Interactive users can explicitly choose to send original content after a warning. Review the selected endpoint and diff before doing so.
package/bin/aicommit.js CHANGED
@@ -6,10 +6,8 @@ import { main } from '../src/main.js';
6
6
  import { sanitizeTerminalText } from '../src/utils.js';
7
7
  import { classifyError } from '../src/errors.js';
8
8
  import { errorOutput, isJsonOutputRequested, successOutput } from '../src/output.js';
9
- import { recordMetric } from '../src/metrics.js';
10
9
 
11
10
  const jsonOutput = isJsonOutputRequested();
12
- const runStartedAt = performance.now();
13
11
  if (jsonOutput) {
14
12
  // Keep stdout as a strict one-object machine channel. Existing progress UI
15
13
  // remains useful diagnostics, but is redirected to stderr in JSON mode.
@@ -18,13 +16,6 @@ if (jsonOutput) {
18
16
 
19
17
  try {
20
18
  const result = await main();
21
- await recordMetric({
22
- durationMs: result?.latencyMs ?? performance.now() - runStartedAt,
23
- usage: result?.usage,
24
- result: result?.committed ? 'committed' : result?.exitReason || 'success',
25
- edited: result?.edited,
26
- rewrites: result?.rewrites,
27
- }).catch((err) => console.error(` ⚠ Failed to write local metrics: ${err.message}`));
28
19
  if (jsonOutput) process.stdout.write(`${JSON.stringify(successOutput(result))}\n`);
29
20
  } catch (err) {
30
21
  const classified = classifyError(err);
@@ -33,15 +24,6 @@ try {
33
24
  '\n ' + chalk.red(`✗ ${sanitizeTerminalText(classified.message || classified)}\n`),
34
25
  );
35
26
  }
36
- await recordMetric({
37
- durationMs: performance.now() - runStartedAt,
38
- usage: null,
39
- result: classified.category,
40
- edited: false,
41
- rewrites: 0,
42
- }).catch((metricError) =>
43
- console.error(` ⚠ Failed to write local metrics: ${metricError.message}`),
44
- );
45
27
  if (jsonOutput) process.stdout.write(`${JSON.stringify(errorOutput(classified))}\n`);
46
28
  process.exitCode = classified.exitCode;
47
29
  }
@@ -26,7 +26,7 @@ The release workflow uses npm Trusted Publishing without a long-lived `NPM_TOKEN
26
26
  ```bash
27
27
  workdir=$(mktemp -d)
28
28
  cd "$workdir"
29
- npm install --package-lock-only @hifullmoon/aicommit@2.0.1
29
+ npm install --package-lock-only @hifullmoon/aicommit@2.2.0
30
30
  npm audit signatures
31
31
  ```
32
32
 
package/docs/privacy.md CHANGED
@@ -1,19 +1,17 @@
1
1
  # Privacy model / 隐私模型
2
2
 
3
- AICommit is a local CLI, not a hosted relay. Repository data travels directly from the local process to the provider endpoint selected in the user-owned config. There is no telemetry upload implementation.
3
+ AICommit is a local CLI, not a hosted relay. Repository data travels directly from the local process to the provider endpoint selected in the user-owned config. The CLI does not record or upload usage metrics.
4
4
 
5
- AICommit 是本地 CLI,不是托管中转服务。仓库数据从本地进程直接发送到用户配置选定的 provider endpoint;项目没有遥测上传实现。
5
+ AICommit 是本地 CLI,不是托管中转服务。仓库数据从本地进程直接发送到用户配置选定的 provider endpoint;CLI 不记录或上传使用指标。
6
6
 
7
7
  ## Trust boundaries / 信任边界
8
8
 
9
- | Boundary / 边界 | Data visible there / 可见数据 | Default control / 默认控制 |
10
- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
11
- | Main CLI process / CLI 主进程 | Selected Git metadata/diff, effective config, resolved provider credential / 选定 Git 元数据与 diff、有效配置、provider 凭据 | User config owns connection fields; project config is filtered / 连接字段归用户配置,项目配置受过滤 |
12
- | Git subprocess / Git 子进程 | Requested status, diff, index/tree operations / 请求的 status、diff、index/tree 操作 | Explicit arguments, temporary indexes, fingerprints and recovery checkpoints / 显式参数、临时 index、指纹与恢复 checkpoint |
13
- | Provider endpoint / Provider 端点 | Prompt, protected selected diff/context, model options, Bearer credential / prompt、保护后的选定 diff/context、模型选项、Bearer 凭据 | Remote HTTPS except loopback; preview/protection before send; bounded context / 远端仅 HTTPS;发送前预览/保护;上下文有预算 |
14
- | Extension child / 扩展子进程 | Only the input for its declared interface / 仅声明接口所需输入 | Sanitized environment, no resolved credential, Node permission model, timeout/output bounds / 清理环境、不传凭据、Node 权限模型、超时/输出限制 |
15
- | Local metrics file / 本地指标文件 | Duration, token totals, bounded result, edited/rewrite flags / 延迟、token 总量、结果类别、编辑/重写标记 | Local-only, owner permissions, retention cap, disable/clear controls / 仅本地、owner 权限、保留上限、可关闭/清除 |
16
- | GitHub/npm during installation / 安装期 GitHub/npm | Package download metadata / package 下载元数据 | Version tag and npm Trusted Publishing provenance / 版本 tag 与 npm Trusted Publishing provenance |
9
+ | Boundary / 边界 | Data visible there / 可见数据 | Default control / 默认控制 |
10
+ | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
11
+ | Main CLI process / CLI 主进程 | Selected Git metadata/diff, effective config, resolved provider credential / 选定 Git 元数据与 diff、有效配置、provider 凭据 | User config owns connection fields; project config is filtered / 连接字段归用户配置,项目配置受过滤 |
12
+ | Git subprocess / Git 子进程 | Requested status, diff, index/tree operations / 请求的 status、diff、index/tree 操作 | Explicit arguments, temporary indexes, fingerprints and recovery checkpoints / 显式参数、临时 index、指纹与恢复 checkpoint |
13
+ | Provider endpoint / Provider 端点 | Prompt, protected selected diff/context, model options, Bearer credential / prompt、保护后的选定 diff/context、模型选项、Bearer 凭据 | Remote HTTPS except loopback; preview/protection before send; bounded context / 远端仅 HTTPS;发送前预览/保护;上下文有预算 |
14
+ | GitHub/npm during installation / 安装期 GitHub/npm | Package download metadata / package 下载元数据 | Version tag and npm Trusted Publishing provenance / 版本 tag 与 npm Trusted Publishing provenance |
17
15
 
18
16
  ## Provider request contents / Provider 请求内容
19
17
 
@@ -21,9 +19,9 @@ A normal generation can send the system policy, requested language, selected cha
21
19
 
22
20
  普通生成可能发送 system policy、语言、选定文件路径/状态、staged diff、受限仓库上下文及 provider/model 控制。Split planning 还可能发送 tracked diff 与未跟踪普通文件的受限预览。默认重写只发送上一条消息而不重发 diff。连通性检查只发送固定 `OK` prompt。
23
21
 
24
- AICommit does not intentionally send unrelated files, historical commit bodies, local metric records, environment variables, its config file, Git credential-helper output, split checkpoint content, or model reasoning in machine output.
22
+ AICommit does not intentionally send unrelated files, historical commit bodies, environment variables, its config file, Git credential-helper output, split checkpoint content, or model reasoning in machine output.
25
23
 
26
- AICommit 不会主动发送无关文件、历史 commit body、本地指标、环境变量、配置文件、Git credential-helper 输出、split checkpoint 内容,也不会在机器输出中包含模型 reasoning。
24
+ AICommit 不会主动发送无关文件、历史 commit body、环境变量、配置文件、Git credential-helper 输出、split checkpoint 内容,也不会在机器输出中包含模型 reasoning。
27
25
 
28
26
  ## Data minimization and sensitive content / 数据最小化与敏感内容
29
27
 
@@ -39,20 +37,20 @@ AICommit 不会主动发送无关文件、历史 commit body、本地指标、
39
37
  - 仓库文本作为不可信 JSON 数据编码,由权威 system policy 约束。
40
38
  - 交互用户可在警告后明确发送原文;这是应谨慎使用的主动覆盖。
41
39
 
42
- Detection, redaction, prompt boundaries, and the extension permission model are defense in depth, not proofs that arbitrary data or malicious code is safe. Extensions may access the network and can observe the candidate/context/response explicitly passed to their capability. Install only reviewed extensions and verify custom endpoints before sending private code.
40
+ Detection, redaction, and prompt boundaries are defense in depth, not proofs that arbitrary data is safe. Verify custom endpoints before sending private code.
43
41
 
44
- 检测、脱敏、prompt 边界与扩展权限模型都是纵深防御,不能证明任意数据或恶意代码绝对安全。扩展可能访问网络,并能看到其 capability 明确收到的候选消息、上下文或响应。只安装已审查扩展,并在向自定义 endpoint 发送私有代码前核实其可信度。
42
+ 检测、脱敏和 prompt 边界都是纵深防御,不能证明任意数据绝对安全。在向自定义 endpoint 发送私有代码前,请核实其可信度。
45
43
 
46
44
  ## Credentials and retention / 凭据与保留
47
45
 
48
- Credential resolution order is environment variable → opted-in Git credential helper → literal user config → keyless loopback. Project config and team policy cannot select a credential source. The provider credential is used only by the core transport; extension API v1 always declares `credentials: false` and never receives the resolved value.
46
+ Credential resolution order is environment variable → opted-in Git credential helper → literal user config → keyless loopback. Project config and team policy cannot select a credential source. The provider credential is used only by the core transport.
49
47
 
50
- 凭据解析顺序为:环境变量 → 用户启用的 Git credential helper → 用户配置明文 → 无 key 的 loopback。项目配置和团队 policy 无权选择凭据来源。Provider 凭据只由核心传输层使用;扩展 API v1 固定声明 `credentials: false`,不会收到解析后的值。
48
+ 凭据解析顺序为:环境变量 → 用户启用的 Git credential helper → 用户配置明文 → 无 key 的 loopback。项目配置和团队 policy 无权选择凭据来源。Provider 凭据只由核心传输层使用。
51
49
 
52
- Providers control their own server-side retention and training policies; AICommit cannot enforce them. Consult the selected provider's current terms. Locally, Git commits retain the accepted message, split checkpoints persist only code-free plan metadata until completion/recovery, and metrics retain at most the configured number of minimal records.
50
+ Providers control their own server-side retention and training policies; AICommit cannot enforce them. Consult the selected provider's current terms. Locally, Git commits retain the accepted message, and split checkpoints persist only code-free plan metadata until completion or recovery.
53
51
 
54
- Provider 自行决定服务端保留与训练策略,AICommit 无法强制控制;请查阅所选 provider 的现行条款。本地 Git commit 会保留接受的消息;split checkpoint 在完成/恢复前只保存不含代码的计划元数据;metrics 最多保留配置数量的最小记录。
52
+ Provider 自行决定服务端保留与训练策略,AICommit 无法强制控制;请查阅所选 provider 的现行条款。本地 Git commit 会保留接受的消息;split checkpoint 在完成或恢复前只保存不含代码的计划元数据。
55
53
 
56
- Use `aicommit config show`, `aicommit stats`, and `aicommit preset show` to inspect effective local state without revealing credentials. Use `aicommit stats clear` to permanently remove local metric history.
54
+ Use `aicommit config show` to inspect effective local state without revealing credentials.
57
55
 
58
- 使用 `aicommit config show`、`aicommit stats` 和 `aicommit preset show` 可在不显示凭据的情况下检查本地状态。使用 `aicommit stats clear` 可永久删除本地指标历史。
56
+ 使用 `aicommit config show` 可在不显示凭据的情况下检查本地状态。