dsh-git-bugfix 0.0.0-stage → 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ Initial public release of `dsh-git-bugfix`:
6
+
7
+ - Preserve existing branches and worktrees, with unique names for each fix attempt.
8
+ - Safely withdraw empty cherry-picks, including after a restart.
9
+ - Report Git status and persistence failures, and allow subsequent persistence retries.
10
+ - Limit XLSX decompression to 16 MiB per entry and 64 MiB cumulatively.
11
+
12
+ - **Import & Editing**: Excel (`.xlsx`), CSV (`.csv`, UTF-8 & GB18030), and plain text import (`Replace` / `Append` modes), inline defect description editing (`editDefect`), and `Ctrl+V` screenshot paste with automatic temporary attachment cleanup (zero local accumulation) and graceful non-vision fallback.
13
+ - **Isolated Local Worktrees**: Every defect runs in an isolated temporary worktree under `.dsh-git-bugfix/worktrees/` branched from the selected base branch, with `.git/info/exclude` protection and runtime blocking of `git push` / `fetch` / `pull`.
14
+ - **Single Local `bugfix/*` Branch & AI Conflict Resolution**: Automatic templated commits, `cherry-pick` integration, conflict file preview (`<<<<<<< / ======= / >>>>>>>`), AI conflict resolution with optional user guidance, automatic queue drain, `git merge --no-ff` back to the base branch, and per-defect branch cleanup.
15
+ - **Queue & Progress Controls**: Withdraw & re-fix (`withdraw`), discard, clear list, live progress (`activity`) with mid-run steering (`continueFix`), pause for clarification (`needs_input`), and compact handled cards.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-git-bugfix contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,152 @@
1
+ # dsh-git-bugfix
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/drypeek/dsh-git-bugfix/blob/main/package.json)
4
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D20-339933?logo=node.js&logoColor=white)](package.json)
5
+ [![DSH](https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.5-111827)](https://github.com/deepseek-ai/deepseek-harness)
6
+ [![GitHub last commit](https://img.shields.io/github/last-commit/drypeek/dsh-git-bugfix)](https://github.com/drypeek/dsh-git-bugfix/commits)
7
+ [![GitHub repo size](https://img.shields.io/github/repo-size/drypeek/dsh-git-bugfix)](https://github.com/drypeek/dsh-git-bugfix)
8
+ [![GitHub stars](https://img.shields.io/github/stars/drypeek/dsh-git-bugfix?style=social)](https://github.com/drypeek/dsh-git-bugfix)
9
+
10
+ English · [简体中文](README.md)
11
+
12
+ An **isolated Git-worktree automated bug-fix workbench plugin** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (third-party, not an official DeepSeek project).
13
+
14
+ Import a defect list from Excel or CSV, or paste an ad-hoc problem description with screenshots. The plugin dispatches AI subagents inside **isolated local Git worktrees**, collects every fix commit onto one local `bugfix/*` branch, helps you preview or AI-resolve merge conflicts, and merges everything back into your base branch with a single local `git merge --no-ff`.
15
+
16
+ ---
17
+
18
+ ## Why Use This? (Scenarios & Pain Points)
19
+
20
+ Most Git bug-fixing bots (such as GitHub Copilot Coding Agent or SWE-agent) are built around **GitHub Issues + cloud CI runners + automated PRs**. In practice, many teams and developers work differently. `dsh-git-bugfix` is a **local desktop workbench for isolated batch bug fixing**, designed for these everyday scenarios:
21
+
22
+ - **Defects arrive outside GitHub Issues**: In QA acceptance rounds, intranet/enterprise environments, or client delivery projects, bug reports often arrive as **Excel/CSV exports, pasted screenshots, or ad-hoc error logs**—no cloud Issues, webhooks, or CI runners required.
23
+ - **Fixing 5–20 bugs in one chat quickly tangles your working tree**: Asking an AI chat to fix multiple issues sequentially in your main checkout mixes unrelated diffs together, risks dirtying uncommitted work, and makes reverting a single fix painful. This plugin isolates every defect in its own temporary Git worktree, creates one commit per fix onto a shared local `bugfix/*` branch, and lets you inspect diffs or **withdraw & re-fix** any single item cleanly.
24
+ - **Zero infrastructure & intranet-friendly**: No external server, API bot, or remote repo permissions needed. Remote operations (`git push`, `fetch`, `pull`) are blocked at runtime—everything stays safely on your local machine until you choose to merge.
25
+
26
+ ---
27
+
28
+ ## Key Capabilities
29
+
30
+ ### 1. Flexible Import, Inline Editing & Screenshot Paste
31
+ - **Spreadsheet import (`.xlsx` / `.csv`)**: Recognizes common English/Chinese header aliases (`title`, `summary`, `description`, `问题概述`, `缺陷描述`, etc.) and only requires a title or description column. Supports both UTF-8 and GB18030 CSV files.
32
+ - **Text import**: Paste any unstructured bug report or stack trace directly into the queue without overwriting existing items.
33
+ - **Paste screenshots (`Ctrl+V`)**: Paste reference screenshots directly in the Edit or Text Import modal. If the active subagent/model does not support vision input, the prompt instructs it to ignore images and proceed with the text description—never halting the run. Temporary images are automatically deleted on completion, clear, or replace-import so **zero local storage accumulates**.
34
+ - **Full queue control**: Supports **Replace** and **Append** imports, inline **Edit description**, **Withdraw & re-fix**, **Discard**, and **Clear list**.
35
+
36
+ ### 2. Safe Local Isolation via Git Worktrees
37
+ - **Isolated temporary worktrees**: Every defect runs in its own temporary Git worktree under `.dsh-git-bugfix/worktrees/` branched from your selected **base branch**—your current working directory and uncommitted changes are never touched.
38
+ - **Zero remote operations**: `git push`, `git fetch`, and `pull` are blocked at runtime. All commits and merges remain strictly local.
39
+ - **Clean repository footprint**: Runtime artifacts under `.dsh-git-bugfix/` are excluded via `.git/info/exclude`, never modifying your project's `.gitignore`.
40
+
41
+ ### 3. One Local `bugfix/*` Branch & AI Conflict Resolution
42
+ - **Templated local commits**: Finished fixes are committed using your commit template and cherry-picked onto one local `bugfix/<timestamp>` integration branch.
43
+ - **Conflict preview & AI resolution**: When a cherry-pick hits a conflict, integration pauses and highlights the conflicted files. Click any file to inspect `<<<<<<< / ======= / >>>>>>>` conflict markers in the right sidebar, click **Resolve with AI** to let a subagent resolve straightforward conflicts, or resolve manually and continue/abort. Resolving a conflict automatically drains remaining `pending` fixes.
44
+ - **Clean non-fast-forward merge**: Click **Merge bug-fix branch into base branch** to perform a `git merge --no-ff` back to your base branch and clean up per-defect temporary branches while keeping the integration history.
45
+
46
+ ### 4. Live Progress & Mid-Run Steering
47
+ - **Live progress & Diff preview**: Expand **Live progress** while a defect is running to inspect modified files and view live diffs in the right sidebar.
48
+ - **Mid-run steering (`Send & continue`)**: Send new instructions mid-run without discarding edits already made in the worktree.
49
+ - **Smart pause & compact view**: Defects needing clarification pause in `needs_input`; handled cards (`applied`, `merged`, `discarded`) collapse automatically into single-line rows.
50
+
51
+ ---
52
+
53
+ ## Workflow Overview
54
+
55
+ ```mermaid
56
+ flowchart TD
57
+ A["Import defects (.xlsx / .csv / plain text / Ctrl+V screenshots)"] --> B["Create isolated temporary worktree from base branch"]
58
+ B --> C["AI subagent investigates and fixes in isolated worktree"]
59
+ C -->|"Needs info"| D["Pause at needs_input, resume with user guidance"]
60
+ D --> C
61
+ C -->|"Fixed"| E["Create local commit from template"]
62
+ E --> F["cherry-pick onto bugfix/<timestamp>"]
63
+ F -->|"Cleanly applied"| G["Clean up worktree and collapse card as applied"]
64
+ F -->|"Conflict"| H["Preview markers / add guidance and click Resolve with AI"]
65
+ H -->|"Resolved"| G
66
+ G --> I["Review & merge back via git merge --no-ff, clean up temp branches"]
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Installation & Upgrade
72
+
73
+ ### Requirements
74
+ - [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) `>= 0.2.2-rc.5` (`< 0.3.0-0`)
75
+ - Node.js `>= 20`
76
+ - Git `>= 2.36`
77
+
78
+ ### Install
79
+
80
+ Install from npm:
81
+
82
+ ```bash
83
+ dsh plugin --profile desktop add dsh-git-bugfix@0.1.0
84
+ ```
85
+
86
+ Install from local source:
87
+
88
+ ```bash
89
+ git clone https://github.com/drypeek/dsh-git-bugfix.git
90
+ dsh plugin --profile desktop add "link:/path/to/dsh-git-bugfix"
91
+ ```
92
+
93
+ > [!TIP]
94
+ > If you previously installed the older `dsh-bugfix` package name, run `dsh plugin --profile desktop remove dsh-bugfix` first before adding `dsh-git-bugfix`.
95
+
96
+ Restart DSH after host-side changes (`index.js`, `lib/`); refresh the page after browser-side changes (`client.js`).
97
+
98
+ ---
99
+
100
+ ## Quick Start
101
+
102
+ 1. **Open the workbench**: Open any Git repository session in DSH (send one message in a new session if needed to initialize context) and click **Auto Bug Fix** at the right end of the conversation tab bar.
103
+ 2. **Configure base branch & import**: Open **Settings**, confirm the **Base branch** (defaults to your current branch), save, and import an `.xlsx` / `.csv` file or add a text issue.
104
+ 3. **Fix & merge locally**: Click **Fix** on a single item or **Fix all** to batch-process; once all fixes are on `bugfix/*`, click **Merge bug-fix branch into base branch**.
105
+
106
+ ---
107
+
108
+ ## Configuration & Statuses
109
+
110
+ Import requests accept up to 32 MiB. XLSX decompression is limited to 16 MiB per entry and 64 MiB cumulatively.
111
+
112
+ Each fix attempt uses a unique branch and worktree name. Creating a branch that already exists reports an error and preserves its worktree. Withdrawing an empty cherry-pick resets the defect state.
113
+
114
+ ### Settings
115
+ | Option | Default | Description |
116
+ | --- | --- | --- |
117
+ | Base branch | Current branch | Target branch for creating worktrees and final `merge --no-ff` |
118
+ | Commit template | `fix(bug-{id}): {title}` | Supports `{id}`, `{title}`, `{summary}`, `{severity}`, `{state}`, `{link}`, `{date}` |
119
+ | Auto-apply to local branch | Enabled | Automatically cherry-picks finished fixes onto `bugfix/*`; disable to inspect diffs first |
120
+ | Build check | Disabled | Runs project build checks defined in `.agents/skills` or `.dsh/skills` before committing |
121
+ | Concurrency | `1` (`1–8`) | Keep `1` on large repositories to avoid checking out multiple full worktrees simultaneously |
122
+
123
+ ---
124
+
125
+ ## Project Layout & Tests
126
+
127
+ ```text
128
+ dsh-git-bugfix/
129
+ ├── index.js # DSH host plugin entry, HTTP API routes, subagent adapter
130
+ ├── client.js # DSH workbench UI, screenshot paste, sidebar diff/conflict viewer
131
+ ├── cordis.patch.yml # Cordis plugin patch manifest
132
+ ├── lib/
133
+ │ ├── xlsx.js # Excel (.xlsx) / CSV parser & header alias matching
134
+ │ ├── git.js # Git worktree, cherry-pick, conflict extraction & remote guardrails
135
+ │ ├── state.js # Persistent queue state, image cleanup & status helpers
136
+ │ └── fixer.js # Fix orchestrator, prompt builder, AI conflict resolver & merge flow
137
+ ├── locale/ # English & Chinese UI strings
138
+ └── test/ # Node native unit & flow tests
139
+ ```
140
+
141
+ Run syntax checks and the full test suite:
142
+
143
+ ```bash
144
+ npm run check
145
+ npm test
146
+ ```
147
+
148
+ ---
149
+
150
+ ## License
151
+
152
+ [MIT](https://github.com/drypeek/dsh-git-bugfix/blob/main/package.json)
package/README.md CHANGED
@@ -1,3 +1,163 @@
1
- # Temporary Holding Version
1
+ # dsh-git-bugfix
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/drypeek/dsh-git-bugfix/blob/main/package.json)
4
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D20-339933?logo=node.js&logoColor=white)](package.json)
5
+ [![DSH](https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.5-111827)](https://github.com/deepseek-ai/deepseek-harness)
6
+ [![GitHub last commit](https://img.shields.io/github/last-commit/drypeek/dsh-git-bugfix)](https://github.com/drypeek/dsh-git-bugfix/commits)
7
+ [![GitHub repo size](https://img.shields.io/github/repo-size/drypeek/dsh-git-bugfix)](https://github.com/drypeek/dsh-git-bugfix)
8
+ [![GitHub stars](https://img.shields.io/github/stars/drypeek/dsh-git-bugfix?style=social)](https://github.com/drypeek/dsh-git-bugfix)
9
+
10
+ [English](README.en.md) · 简体中文
11
+
12
+ 这是一个为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)打造的 **Git 隔离自动修 Bug 工作台插件**(第三方插件,非官方项目)。
13
+
14
+ 你只需要把缺陷表格(Excel / CSV)导进来,或者随手粘一段问题描述与报错截图,AI 就会在**互不干扰的本地临时 Git worktree** 里自动排查并修改代码,最后把所有修复集中到一条本地 `bugfix/*` 分支上,由你审阅 Diff 或化解冲突后,一键非快进合并(`git merge --no-ff`)回基线分支。
15
+
16
+ ---
17
+
18
+ ## 为什么需要它?(适用场景与痛点)
19
+
20
+ 市面上的 Git 自动修 Bug 机器人(如 GitHub Copilot Coding Agent、SWE-agent 等)大多绑定 **GitHub Issue + 云端 CI + PR 流程**,但实际开发中大量项目并不走这条路。本插件定位为**本地桌面端的多缺陷隔离清理工作台**,专门解决以下高频痛点:
21
+
22
+ - **缺陷来源不在 GitHub Issue 里**:测试验收、内网/政企或交付项目中,Bug 往往以 **Excel / CSV 导出表、聊天群截图、零散报错文本** 的形式出现,无需云端 Issue 或 Webhook 即可直接导入处理。
23
+ - **多个 Bug 同时在聊天框里改容易乱成一团**:在普通 AI 对话中连续修 5~20 个问题,很容易污染当前未提交的开发工作区,所有 Diff 混在一起、单条回滚困难。本插件为每条缺陷分配独立临时 Git worktree,修完自动按条提交并汇总到一条本地 `bugfix/*` 分支,支持单条 **撤回重修** 与逐条 Diff 审阅。
24
+ - **内网与零基础设施门槛**:无需部署服务端、CI Runner 或配置远端 Token;插件硬禁止 `git push / fetch / pull`,所有修改和合并完全留在本地仓库,适合个人或小团队开发者在本地安全、集中地批量清 Bug。
25
+
26
+ ---
27
+
28
+ ## 核心特性
29
+
30
+ ### 1. 怎么导入都行,支持编辑与截图粘贴
31
+ - **表格导入(`.xlsx` / `.csv`)**:不挑导出模板,只要表格里包含标题或描述列(例如 `缺陷概述`、`问题描述`、`标题`、`summary`、`title`、`description` 等)即可自动识别;同时兼容 UTF-8 与 Windows Excel 导出的中文 CSV(GB18030)。
32
+ - **文字导入**:临时想到一个需求、或复制了一段报错堆栈不想在聊天窗口里直接改?点「文字导入」粘贴进去即可加入队列自动修复。
33
+ - **支持粘贴图片(`Ctrl+V`)**:在「编辑描述 / 补充描述」或「文字导入」弹窗中可直接粘贴截图随缺陷一并下发给 AI;若当前子代理/模型不支持识图,提示词会引导其忽略图片并依据文字继续排查,**不会中断修复流程**。所有临时截图会在修复完成或清理/覆盖导入时自动删除,**不产生本地累加存储**。
34
+ - **灵活管理队列**:支持 **覆盖导入** / **追加导入**、直接修改原有缺陷描述(修正表格读取偏差)、单条 **撤回重修**、**放弃** 以及 **清空列表**。
35
+
36
+ ### 2. Git worktree 安全隔离,绝不触碰当前工作区
37
+ - **独立临时工作区**:每条缺陷都在 `.dsh-git-bugfix/worktrees/` 下的独立临时 Git worktree 中基于你指定的**基线分支**最新提交开展修改,完全不会污染你当前正在开发的工作目录和未提交改动。
38
+ - **零远端操作**:运行时强制禁止 `git push`、`git fetch`、`git pull`,插件只做本地提交与本地合并,永远不会向远端仓库推送任何内容。
39
+ - **防污染策略**:插件运行时目录 `.dsh-git-bugfix/` 仅写入本地仓库的 `.git/info/exclude`,绝不修改项目自身的 `.gitignore`。
40
+
41
+ ### 3. 本地 `bugfix/*` 汇总分支与 AI 冲突化解
42
+ - **按模板自动提交与汇总**:每修完一条缺陷,自动按配置模板生成本地 commit,并 `cherry-pick` 到本轮汇总分支(如 `bugfix/20261204-090830`)。
43
+ - **冲突预览与 AI 一键解冲突**:若 `cherry-pick` 发生冲突,流程会暂停并高亮冲突文件。你可以在右侧栏直接预览 `<<<<<<< / ======= / >>>>>>>` 冲突块,也可以点击 **「AI 解决冲突」** 让子代理尝试自动化解,再继续或中止;解决后队列中等待合入的 `pending` 修复会自动接续合入。
44
+ - **整洁的非快进合并**:整批处理完成后,点击 **「合并 bug-fix 分支到基线分支」**,使用 `git merge --no-ff` 一次性合回基线分支,并自动清理单条缺陷临时分支,只保留清晰的汇总提交记录。
45
+
46
+ ### 4. 实时进度可看,修到一半也能随时插话
47
+ - **实时进度与 Diff 预览**:修复进行中可展开 **「实时进度」**,查看 AI 当前已修改的文件列表,并点击文件在右侧栏实时审阅 Diff。
48
+ - **中途纠偏(补充并继续)**:发现 AI 方向跑偏时,无需等它失败,可直接在实时进度中输入新指示并点击 **「补充并继续」**,保留 worktree 内已有改动继续按新要求修复。
49
+ - **智能暂停与紧凑视图**:AI 拿不准需求或缺少前置条件时会自动停在 **「待补充」** 等待你的输入;已合入、已合并或已放弃的卡片默认折叠为单行,列表再长也能保持清爽。
50
+
51
+ ---
52
+
53
+ ## 工作流程一览
54
+
55
+ ```mermaid
56
+ flowchart TD
57
+ A["导入缺陷 (.xlsx / .csv / 纯文本 / Ctrl+V 截图)"] --> B["基于基线分支创建独立临时 worktree"]
58
+ B --> C["AI 子代理在隔离 worktree 中排查并修改"]
59
+ C -->|"需人工确认"| D["暂停在「待补充」,补充后继续"]
60
+ D --> C
61
+ C -->|"修复完成"| E["按模板生成本地 commit"]
62
+ E --> F["cherry-pick 至本轮汇总分支 bugfix/<timestamp>"]
63
+ F -->|"正常合入"| G["清理临时 worktree,卡片折叠为「已合入 bug-fix 分支」"]
64
+ F -->|"发生冲突"| H["右侧栏预览冲突 / 填写指导意见点击「AI 解决冲突」"]
65
+ H -->|"解决完成"| G
66
+ G --> I["审阅无误后:git merge --no-ff 合回基线分支并清理单条临时分支"]
67
+ ```
68
+
69
+ ---
70
+
71
+ ## 安装与更新
72
+
73
+ ### 环境要求
74
+ - [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)`>= 0.2.2-rc.5`(`< 0.3.0-0`)
75
+ - Node.js `>= 20`
76
+ - Git `>= 2.36`
77
+
78
+ ### 安装步骤
79
+
80
+ 从 npm 安装:
81
+
82
+ ```bash
83
+ dsh plugin --profile desktop add dsh-git-bugfix@0.1.0
84
+ ```
85
+
86
+ 从本地源码安装:
87
+
88
+ ```bash
89
+ git clone https://github.com/drypeek/dsh-git-bugfix.git
90
+ dsh plugin --profile desktop add "link:/path/to/dsh-git-bugfix"
91
+ ```
92
+
93
+ > [!TIP]
94
+ > 如果你之前安装过旧包名 `dsh-bugfix`,建议先执行 `dsh plugin --profile desktop remove dsh-bugfix` 移除旧链接,再安装 `dsh-git-bugfix`。
95
+
96
+ 安装后默认启用:
97
+ - 修改过后端文件(`index.js`、`lib/`)需要重启一次 DSH;
98
+ - 仅修改前端文件(`client.js`)刷新 DSH 页面即可生效。
99
+
100
+ ---
101
+
102
+ ## 三步快速上手
103
+
104
+ 1. **打开工作台**:在 DSH 中进入任意 Git 仓库会话(新会话需先发一条消息以激活会话上下文),在顶部页签栏右侧点击 **「Bug 自动修复」**。
105
+ 2. **确认基线分支并导入**:首次使用打开 **「设置」**,确认目标 **基线分支**(默认已选中当前分支)并保存;随后通过 **「导入表格 (Excel/CSV)」** 或 **「文字导入」** 添加待修缺陷。
106
+ 3. **自动修复与本地合并**:点击单条 **「修复」** 或顶部 **「自动修复」** 批量处理;所有修复合入 `bugfix/*` 分支后,点击 **「合并 bug-fix 分支到基线分支」** 完成本地合并。
107
+
108
+ ---
109
+
110
+ ## 配置与状态说明
111
+
112
+ 导入请求最大为 32 MiB。XLSX 解压后的单个条目最大为 16 MiB,累计解压上限为 64 MiB。
113
+
114
+ 每次修复使用带唯一标识的分支和工作区名称。创建时发现已有分支会报错,保留已有工作区。空 cherry-pick 的撤回只重置该缺陷的状态。
115
+
116
+ ### 常用设置项
117
+ | 配置项 | 默认值 | 说明 |
118
+ | --- | --- | --- |
119
+ | 基线分支 | 当前分支 | 每次创建修复 worktree 和最终 `merge --no-ff` 的目标分支 |
120
+ | 提交注释模板 | `fix(bug-{id}): {title}` | 支持 `{id}`、`{title}`、`{summary}`、`{severity}`、`{state}`、`{link}`、`{date}` |
121
+ | 自动合入本地分支 | 开启 | 修复完成后自动 `cherry-pick` 到当前 `bugfix/*` 分支;关闭后可先逐条验 Diff 再手动合入 |
122
+ | 编译验证 | 关闭 | 开启后会在修复结束前按仓库 `.agents/skills` 或 `.dsh/skills` 流程做编译检查 |
123
+ | 并行数 | `1`(范围 `1–8`) | 大型仓库建议保持 `1`,避免同时检出多个完整 worktree 占用过多磁盘与内存 |
124
+
125
+ ### 缺陷状态流转
126
+ - `待修复 (open)`:等待修复,可直接编辑描述、粘贴截图或点击修复。
127
+ - `修复中 (fixing)`:正在独立 worktree 中运行子代理,可随时查看实时进度或「补充并继续」。
128
+ - `待补充 (needs_input)`:AI 需要额外信息或确认,补充后点击继续修复。
129
+ - `待合入分支 (pending)`:已在独立分支完成提交,等待或正在合入 `bugfix/*` 汇总分支。
130
+ - `已合入 bug-fix 分支 (applied)`:已合入本轮 `bugfix/*` 分支,可随时「撤回重修」。
131
+ - `已合并到基线 (merged)`:已通过 `git merge --no-ff` 合并回基线分支。
132
+ - `失败 (failed)` / `已放弃 (discarded)`:修复异常或手动放弃。
133
+
134
+ ---
135
+
136
+ ## 目录结构与开发测试
137
+
138
+ ```text
139
+ dsh-git-bugfix/
140
+ ├── index.js # DSH 后端插件入口、HTTP API 路由注册与子代理调用适配
141
+ ├── client.js # DSH 前端工作台 UI、截图粘贴与右侧栏 Diff/冲突预览
142
+ ├── cordis.patch.yml # Cordis 插件挂载声明
143
+ ├── lib/
144
+ │ ├── xlsx.js # Excel (.xlsx) / CSV 解析与列名别名匹配
145
+ │ ├── git.js # Git worktree、cherry-pick、冲突提取与安全拦截
146
+ │ ├── state.js # 本地状态持久化、临时图片生命周期清理与队列管理
147
+ │ └── fixer.js # 修复调度器、提示词构建、AI 冲突解决与撤回/合并流程
148
+ ├── locale/ # 中英文 UI 文案
149
+ └── test/ # Node 原生单元与流程测试
150
+ ```
151
+
152
+ 运行语法检查与完整测试套件:
153
+
154
+ ```bash
155
+ npm run check
156
+ npm test
157
+ ```
158
+
159
+ ---
160
+
161
+ ## 开源协议
162
+
163
+ [MIT](https://github.com/drypeek/dsh-git-bugfix/blob/main/package.json)