pi-dsh-mimic 0.1.0 → 0.1.2
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.md +58 -112
- package/README.zh-CN.md +48 -91
- package/SECURITY.md +9 -6
- package/docs/advanced.md +15 -7
- package/docs/advanced.zh-CN.md +11 -6
- package/docs/project2-evidence.md +13 -5
- package/package.json +1 -1
- package/src/constants.ts +0 -2
- package/src/index.ts +0 -2
- package/src/session-stage.ts +1 -4
package/README.md
CHANGED
|
@@ -1,134 +1,90 @@
|
|
|
1
|
-
[Repository index](../../README.en.md) · [简体中文](README.zh-CN.md) ·
|
|
1
|
+
[Repository index](../../README.en.md) · [简体中文](README.zh-CN.md) ·
|
|
2
|
+
[Experiments and design](docs/advanced.md) ·
|
|
3
|
+
[Project2 evidence ledger](docs/project2-evidence.md)
|
|
2
4
|
|
|
3
5
|
# pi-dsh-mimic
|
|
4
6
|
|
|
5
|
-
`pi-dsh-mimic`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
response,
|
|
9
|
-
|
|
7
|
+
`pi-dsh-mimic` changes only the first DeepSeek V4 Pro request in
|
|
8
|
+
[Pi](https://github.com/earendil-works/pi). The real task begins with the DSH
|
|
9
|
+
Minimal persona and its `bash` and `str_replace_editor` tools. After the first
|
|
10
|
+
valid response, later requests return to Pi-native formatting and the complete
|
|
11
|
+
tool catalog.
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- the V4 Pro engineering trajectory established by a DSH Minimal first request;
|
|
14
|
-
- Pi's mature tools, session management, and plugin ecosystem.
|
|
15
|
-
|
|
16
|
-
Users do not need to install or run the complete DSH harness, and the session
|
|
17
|
-
does not remain restricted to Minimal's two tools.
|
|
13
|
+
It does not require the full DSH harness and adds no extra model round.
|
|
18
14
|
|
|
19
15
|
## How it works
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`str_replace_editor`;
|
|
26
|
-
2. after the first successful assistant response or durable tool call, request
|
|
27
|
-
#2 restores Pi's native provider payload and complete current tool catalog;
|
|
28
|
-
3. the Minimal persona remains for the session, while Pi's larger generated
|
|
29
|
-
system prompt is not replayed as an extra user message.
|
|
17
|
+
1. In a fresh target session, the original task becomes the Minimal request.
|
|
18
|
+
2. The first successful assistant response or actual tool call ends bootstrap.
|
|
19
|
+
3. Later requests keep the Minimal persona while Pi again owns payload encoding,
|
|
20
|
+
tool ordering, and plugin tools.
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
Provider errors and aborted responses do not consume bootstrap. A small Pi
|
|
23
|
+
custom entry persists the phase across resume. If the process crashes after a
|
|
24
|
+
completed response but before the phase is recorded, durable assistant/tool
|
|
25
|
+
history repairs the state on reload.
|
|
33
26
|
|
|
34
|
-
##
|
|
27
|
+
## Experimental result
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
On one frozen Project2 V4.1b long-horizon maintenance task, default Pi scored
|
|
30
|
+
92. Four final runs of the same one-shot flow scored 98, 96, 96, and 98. This
|
|
31
|
+
comparison supports the current first-request design; it does not establish a
|
|
32
|
+
general result across projects, model revisions, or evaluations.
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| Early Minimal-mimic prototype | Official DeepSeek API | **98** | F3 16, F6 10, F8 7 |
|
|
43
|
-
| Same-flow replication | Official DeepSeek API | 96 | F3 16, F6 10, F8 5 |
|
|
44
|
-
| First packaged implementation | Official DeepSeek API | 96 | F3 16, F6 8, F8 7 |
|
|
45
|
-
| Current independent implementation `0.1.0` | OpenCode Go | **98** | F3 16, F6 10, F8 7 |
|
|
46
|
-
|
|
47
|
-
The results show that a DSH Minimal first request can establish a strong V4 Pro
|
|
48
|
-
trajectory inside Pi and that restoring Pi's full tool catalog does not break
|
|
49
|
-
it. See [Experiments and design](docs/advanced.md) for the rejected alternatives
|
|
50
|
-
and the evidence behind each implementation choice. The
|
|
51
|
-
[Project2 evidence ledger](docs/project2-evidence.md), maintained in Chinese,
|
|
52
|
-
contains evaluator IDs and sources.
|
|
34
|
+
See [Experiments and design](docs/advanced.md) for conditions, negative results,
|
|
35
|
+
and implementation choices. The [Project2 evidence ledger](docs/project2-evidence.md)
|
|
36
|
+
contains the complete runs and evaluator sources.
|
|
53
37
|
|
|
54
38
|
## Install and use
|
|
55
39
|
|
|
56
|
-
Requirements: Node.js 22.19 or later, Pi 0.84.2 or later, and
|
|
57
|
-
|
|
58
|
-
routes.
|
|
40
|
+
Requirements: Node.js 22.19 or later, Pi 0.84.2 or later, and a provider
|
|
41
|
+
configured in Pi whose model id contains `deepseek-v4-pro`. The official
|
|
42
|
+
DeepSeek API and OpenCode Go are the repository-qualified routes. The extension
|
|
43
|
+
also activates for third-party providers; compatibility, data handling, and
|
|
44
|
+
billing then follow the provider selected by the user.
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
Install for the current user:
|
|
61
47
|
|
|
62
48
|
```bash
|
|
63
|
-
pi
|
|
64
|
-
--provider deepseek \
|
|
65
|
-
--model deepseek-v4-pro
|
|
49
|
+
pi install npm:pi-dsh-mimic
|
|
66
50
|
```
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
environment variable:
|
|
52
|
+
Install at project scope:
|
|
70
53
|
|
|
71
54
|
```bash
|
|
72
|
-
pi -
|
|
73
|
-
--provider opencode-go \
|
|
74
|
-
--model deepseek-v4-pro
|
|
55
|
+
pi install -l npm:pi-dsh-mimic
|
|
75
56
|
```
|
|
76
57
|
|
|
77
|
-
|
|
58
|
+
Try the current checkout directly:
|
|
78
59
|
|
|
79
60
|
```bash
|
|
80
|
-
pi
|
|
61
|
+
pi -e ./packages/pi-dsh-mimic \
|
|
62
|
+
--provider deepseek \
|
|
63
|
+
--model deepseek-v4-pro
|
|
81
64
|
```
|
|
82
65
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
The manifest already includes the `pi-package` keyword required by the
|
|
86
|
-
[Pi Package Catalog](https://pi.dev/packages); the catalog can discover it only
|
|
87
|
-
after publication to npm. The published install command will be
|
|
88
|
-
`pi install npm:pi-dsh-mimic`.
|
|
66
|
+
For OpenCode Go, set Pi's expected `OPENCODE_API_KEY` environment variable and
|
|
67
|
+
select the `opencode-go` provider.
|
|
89
68
|
|
|
90
69
|
Select V4 Pro before starting a new session. Switching to V4 Pro inside an
|
|
91
|
-
existing conversation does not
|
|
70
|
+
existing conversation does not create a synthetic bootstrap. The extension
|
|
71
|
+
registers `str_replace_editor` in a target session; if that same session later
|
|
72
|
+
switches to another model, the tool may remain in the current catalog. Start a
|
|
73
|
+
new session when a clean non-target tool catalog matters.
|
|
92
74
|
|
|
93
|
-
## Request
|
|
75
|
+
## Request changes
|
|
94
76
|
|
|
95
|
-
| |
|
|
77
|
+
| | First request | Later requests |
|
|
96
78
|
| --- | --- | --- |
|
|
97
|
-
|
|
|
98
|
-
| User history | Original task, including Pi
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Provider errors and aborted responses do not consume the bootstrap. A small Pi
|
|
108
|
-
custom entry persists the phase, and durable assistant/tool history repairs a
|
|
109
|
-
crash-stale state on resume.
|
|
110
|
-
|
|
111
|
-
## Offline verification
|
|
112
|
-
|
|
113
|
-
TypeScript typechecking and all 13 automated tests pass. Twelve cover package
|
|
114
|
-
behavior and its manifest; one verifies the session-statistics helper. Package
|
|
115
|
-
behavior coverage includes:
|
|
116
|
-
|
|
117
|
-
- original task, persona, field order, cache omission, and two-tool schemas in
|
|
118
|
-
request #1;
|
|
119
|
-
- Pi-native payload, complete catalog, and plugin-tool restoration in request
|
|
120
|
-
#2;
|
|
121
|
-
- images, API-error retry, text promotion, session resume, and crash-stale
|
|
122
|
-
recovery;
|
|
123
|
-
- existing-conversation isolation, both providers, and non-target models;
|
|
124
|
-
- editor create, view, replace, insert, and ambiguous-replacement rejection.
|
|
125
|
-
|
|
126
|
-
OpenCode Go bash-first and editor-first offline loopbacks also pass through Pi's
|
|
127
|
-
real package loader and provider path with `realModelCalls=0`. Request #2 carries
|
|
128
|
-
a real tool result and restores `read/bash/edit/write/str_replace_editor`. After
|
|
129
|
-
normalizing the user task, the new request #1 matches the historical 98-point
|
|
130
|
-
capture in messages, key order, schemas, `strict:false`, and serialized
|
|
131
|
-
structure.
|
|
79
|
+
| Persona | `You are a helpful software engineer assistant.` | unchanged |
|
|
80
|
+
| User history | Original task, including Pi images | unchanged |
|
|
81
|
+
| Tools | `bash`, `str_replace_editor` | Pi's current full catalog, including plugin tools |
|
|
82
|
+
| Payload | DSH Minimal shape | Pi-native encoding and ordering |
|
|
83
|
+
|
|
84
|
+
`str_replace_editor` can view, create, and modify absolute paths with the Pi
|
|
85
|
+
process's filesystem permissions. The task, context, and tool results are sent
|
|
86
|
+
to the provider selected by the user. The extension does not read or store API
|
|
87
|
+
keys. See [SECURITY.md](SECURITY.md) for the full boundary.
|
|
132
88
|
|
|
133
89
|
## Development
|
|
134
90
|
|
|
@@ -139,17 +95,7 @@ npm run check
|
|
|
139
95
|
npm run pack:check
|
|
140
96
|
```
|
|
141
97
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
This package runs with the Pi process's filesystem permissions;
|
|
145
|
-
`str_replace_editor` can create and modify files. The task, context, and tool
|
|
146
|
-
results are sent to the selected DeepSeek or OpenCode provider. The package
|
|
147
|
-
does not read, store, log, or transmit API keys and adds no model round. See
|
|
148
|
-
[SECURITY.md](SECURITY.md).
|
|
149
|
-
|
|
150
|
-
The Minimal persona and two tool-protocol texts come from DeepSeek Harness's
|
|
98
|
+
The Minimal persona and two tool protocols come from DeepSeek Harness's
|
|
151
99
|
[public Minimal protocol](https://github.com/deepseek-ai/deepseek-harness). See
|
|
152
|
-
[LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
153
|
-
|
|
154
|
-
experiments. It is not affiliated with or endorsed by Pi, DeepSeek, OpenCode,
|
|
155
|
-
or OpenAI.
|
|
100
|
+
[LICENSE](LICENSE) and [NOTICE](NOTICE). This project is not affiliated with or
|
|
101
|
+
endorsed by Pi, DeepSeek, OpenCode, or OpenAI.
|
package/README.zh-CN.md
CHANGED
|
@@ -1,114 +1,79 @@
|
|
|
1
|
-
[仓库索引](../../README.md) · [English](README.md) ·
|
|
1
|
+
[仓库索引](../../README.md) · [English](README.md) ·
|
|
2
|
+
[实验与设计](docs/advanced.zh-CN.md) · [Project2 证据账本](docs/project2-evidence.md)
|
|
2
3
|
|
|
3
4
|
# pi-dsh-mimic
|
|
4
5
|
|
|
5
|
-
`pi-dsh-mimic` 在 [Pi](https://github.com/earendil-works/pi)
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
`pi-dsh-mimic` 只修改 DeepSeek V4 Pro 在 [Pi](https://github.com/earendil-works/pi)
|
|
7
|
+
中的第一次模型请求。真实任务先进入 DSH Minimal 的 persona 与 `bash`、
|
|
8
|
+
`str_replace_editor` 两个工具;第一次有效响应后,后续请求恢复 Pi 原生格式和完整工具
|
|
9
|
+
目录。
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- DSH Minimal 首请求带来的 V4 Pro 工程能力;
|
|
12
|
-
- Pi 成熟的工具、session 管理和插件生态。
|
|
13
|
-
|
|
14
|
-
用户无需安装或运行完整 DSH harness,也不必长期停留在两个工具的 Minimal 环境中。
|
|
11
|
+
它不需要安装完整 DSH harness,也不会增加额外模型轮次。
|
|
15
12
|
|
|
16
13
|
## 工作方式
|
|
17
14
|
|
|
18
|
-
新建目标 session
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`str_replace_editor`;
|
|
22
|
-
2. 第一个成功 assistant response 或 durable tool call 后,请求 #2 恢复 Pi 原生
|
|
23
|
-
provider payload 和当下完整工具目录;
|
|
24
|
-
3. Minimal persona 在整个 session 保持,Pi 较长的自动 system prompt 不会作为额外
|
|
25
|
-
user message 重放。
|
|
15
|
+
1. 新建目标 session 后,原始任务直接成为 Minimal 请求;
|
|
16
|
+
2. 第一次成功的 assistant response 或实际 tool call 结束 bootstrap;
|
|
17
|
+
3. 后续请求继续使用 Minimal persona,但 payload、工具排序和插件工具由 Pi 接管。
|
|
26
18
|
|
|
27
|
-
|
|
19
|
+
Provider error 或 aborted response 不消耗 bootstrap。阶段会写入一个小型 Pi custom entry,
|
|
20
|
+
因此 session resume 后仍能恢复;如果进程在响应完成后、阶段写入前崩溃,durable
|
|
21
|
+
assistant/tool 历史会把状态修正到执行阶段。
|
|
28
22
|
|
|
29
|
-
##
|
|
23
|
+
## 实验结果
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
在一个冻结的 Project2 V4.1b 长程代码维护任务中,默认 Pi 得到 92;使用相同 one-shot
|
|
26
|
+
流程的四次最终结果为 98、96、96、98。这个对照支持当前首请求设计,但不能直接外推到
|
|
27
|
+
其他项目、模型版本或评测。
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| 默认 Pi baseline | DeepSeek 官方 API | 92 | F3 11,F6 10,F8 6 |
|
|
37
|
-
| 早期 Minimal 模拟原型 | DeepSeek 官方 API | **98** | F3 16,F6 10,F8 7 |
|
|
38
|
-
| 同流程复现实验 | DeepSeek 官方 API | 96 | F3 16,F6 10,F8 5 |
|
|
39
|
-
| 首次 package 化实现 | DeepSeek 官方 API | 96 | F3 16,F6 8,F8 7 |
|
|
40
|
-
| 当前独立实现 `0.1.0` | OpenCode Go | **98** | F3 16,F6 10,F8 7 |
|
|
41
|
-
|
|
42
|
-
这些结果表明:DSH Minimal 首请求可以在 Pi 中稳定建立高能力轨迹,而恢复 Pi 完整工具
|
|
43
|
-
目录不会破坏它。实验过程、被否决的设计和每项实现选择的依据见
|
|
44
|
-
[实验与设计](docs/advanced.zh-CN.md);完整 evaluator IDs 与来源见
|
|
45
|
-
[Project2 证据账本](docs/project2-evidence.md)。
|
|
29
|
+
实验条件、负结果和实现取舍见[实验与设计](docs/advanced.zh-CN.md),完整运行与 evaluator
|
|
30
|
+
来源见 [Project2 证据账本](docs/project2-evidence.md)。
|
|
46
31
|
|
|
47
32
|
## 安装和使用
|
|
48
33
|
|
|
49
|
-
要求:Node.js 22.19 或更新版本、Pi 0.84.2
|
|
50
|
-
|
|
34
|
+
要求:Node.js 22.19 或更新版本、Pi 0.84.2 或更新版本,并已在 Pi 中配置模型标识包含
|
|
35
|
+
`deepseek-v4-pro` 的 provider。DeepSeek 官方 API 与 OpenCode Go 是本仓库已验证的路径;
|
|
36
|
+
第三方 provider 也会激活扩展,其兼容性、数据边界和计费由用户选择的 provider 决定。
|
|
51
37
|
|
|
52
|
-
|
|
38
|
+
安装到当前用户:
|
|
53
39
|
|
|
54
40
|
```bash
|
|
55
|
-
pi
|
|
56
|
-
--provider deepseek \
|
|
57
|
-
--model deepseek-v4-pro
|
|
41
|
+
pi install npm:pi-dsh-mimic
|
|
58
42
|
```
|
|
59
43
|
|
|
60
|
-
|
|
44
|
+
项目级安装:
|
|
61
45
|
|
|
62
46
|
```bash
|
|
63
|
-
pi -
|
|
64
|
-
--provider opencode-go \
|
|
65
|
-
--model deepseek-v4-pro
|
|
47
|
+
pi install -l npm:pi-dsh-mimic
|
|
66
48
|
```
|
|
67
49
|
|
|
68
|
-
|
|
50
|
+
直接试用当前 checkout:
|
|
69
51
|
|
|
70
52
|
```bash
|
|
71
|
-
pi
|
|
53
|
+
pi -e ./packages/pi-dsh-mimic \
|
|
54
|
+
--provider deepseek \
|
|
55
|
+
--model deepseek-v4-pro
|
|
72
56
|
```
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[Pi Package Catalog](https://pi.dev/packages),安装命令将是
|
|
77
|
-
`pi install npm:pi-dsh-mimic`。当前 checkout 不会被市场索引。
|
|
58
|
+
OpenCode Go 使用 Pi 预期的 `OPENCODE_API_KEY` 环境变量,并将 provider 设为
|
|
59
|
+
`opencode-go`。
|
|
78
60
|
|
|
79
|
-
|
|
61
|
+
请先选择 V4 Pro,再新建 session。已有对话中途切换到 V4 Pro 不会补造 bootstrap。
|
|
62
|
+
扩展在目标 session 中注册 `str_replace_editor`;如果在同一个 session 里再切换到其他
|
|
63
|
+
模型,这个工具可能继续留在当前工具目录。需要干净的非目标模型环境时,新建 session。
|
|
80
64
|
|
|
81
|
-
##
|
|
65
|
+
## 请求变化
|
|
82
66
|
|
|
83
|
-
| |
|
|
67
|
+
| | 第一次请求 | 后续请求 |
|
|
84
68
|
| --- | --- | --- |
|
|
85
|
-
|
|
|
86
|
-
| User 历史 | 原始任务,包括 Pi
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
90
|
-
扩展不调用 `setActiveTools`,也不覆盖 Pi 原生 `bash`、`read`、`edit` 或 `write`。目标
|
|
91
|
-
新 session 武装时才注册一个可执行 `str_replace_editor`;请求 #2 起,其他 package
|
|
92
|
-
提供的工具会自然出现在完整目录中。
|
|
93
|
-
|
|
94
|
-
Provider error 或 aborted response 不消耗 bootstrap。阶段通过小型 Pi custom entry
|
|
95
|
-
持久化,恢复时也能根据 durable assistant/tool 历史修正 crash-stale 状态。
|
|
69
|
+
| Persona | `You are a helpful software engineer assistant.` | 保持不变 |
|
|
70
|
+
| User 历史 | 原始任务,包括 Pi 图片 | 保持不变 |
|
|
71
|
+
| 工具 | `bash`、`str_replace_editor` | Pi 当前完整目录,包括其他插件工具 |
|
|
72
|
+
| Payload | DSH Minimal 形状 | Pi 原生编码与排序 |
|
|
96
73
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
manifest,1 项验证 session 统计工具。Package 行为测试覆盖:
|
|
101
|
-
|
|
102
|
-
- 首请求原任务、persona、字段顺序、cache 移除和两工具 schema;
|
|
103
|
-
- 请求 #2 恢复 Pi 原生 payload、完整目录和其他插件工具;
|
|
104
|
-
- 图片、API error 重试、文本回答晋升、session resume 和 crash-stale 恢复;
|
|
105
|
-
- 已有对话隔离、DeepSeek/OpenCode 双 provider 与非目标模型隔离;
|
|
106
|
-
- editor 的 create、view、replace、insert 和歧义替换拒绝。
|
|
107
|
-
|
|
108
|
-
OpenCode Go bash-first 与 editor-first 离线回环还通过 Pi 的真实 package loader 和 provider
|
|
109
|
-
路径验证了两个请求,`realModelCalls=0`。请求 #2 携带真实工具结果,并恢复
|
|
110
|
-
`read/bash/edit/write/str_replace_editor`。归一 user task 后,新请求 #1 与历史 98 分
|
|
111
|
-
capture 在消息、字段顺序、schema、`strict:false` 和序列化结构上逐项相等。
|
|
74
|
+
`str_replace_editor` 可以查看、创建和修改绝对路径文件,并继承 Pi 进程的文件系统权限。
|
|
75
|
+
任务、上下文和工具结果会发送给用户选择的 provider。扩展不读取或保存 API key;完整
|
|
76
|
+
边界见 [SECURITY.md](SECURITY.md)。
|
|
112
77
|
|
|
113
78
|
## 开发
|
|
114
79
|
|
|
@@ -119,15 +84,7 @@ npm run check
|
|
|
119
84
|
npm run pack:check
|
|
120
85
|
```
|
|
121
86
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
保存、记录或传输 API key,也不增加额外模型轮次。完整说明见
|
|
127
|
-
[SECURITY.md](SECURITY.md)。
|
|
128
|
-
|
|
129
|
-
Minimal persona 与两项工具协议文本来自
|
|
130
|
-
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的公开 Minimal 协议;
|
|
131
|
-
对应许可声明见 [LICENSE](LICENSE) 和 [NOTICE](NOTICE)。当前实现依据该公开协议、本项目
|
|
132
|
-
捕获的请求和 Project2 实验完成,与 Pi、DeepSeek、OpenCode 或 OpenAI 均无隶属或官方
|
|
133
|
-
背书关系。
|
|
87
|
+
Minimal persona 与两项工具协议来自 DeepSeek Harness 的
|
|
88
|
+
[公开 Minimal 协议](https://github.com/deepseek-ai/deepseek-harness),许可见
|
|
89
|
+
[LICENSE](LICENSE) 和 [NOTICE](NOTICE)。本项目与 Pi、DeepSeek、OpenCode 或 OpenAI
|
|
90
|
+
均无隶属或官方背书关系。
|
package/SECURITY.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
`pi-dsh-mimic` does not read, save, log, or transmit API keys. Provider
|
|
6
6
|
credentials remain under Pi and the selected provider's configuration. Never
|
|
7
|
-
put a
|
|
8
|
-
|
|
7
|
+
put a provider credential in a prompt, repository file, issue, screenshot, or
|
|
8
|
+
captured request.
|
|
9
9
|
|
|
10
10
|
If a credential has been exposed, revoke or rotate it with the provider before
|
|
11
11
|
continuing.
|
|
@@ -13,10 +13,13 @@ continuing.
|
|
|
13
13
|
## Provider data boundary
|
|
14
14
|
|
|
15
15
|
For target sessions, the task, conversation messages, tool schemas, and later
|
|
16
|
-
tool results are sent through
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
tool results are sent through the provider selected in Pi. A model id containing
|
|
17
|
+
`deepseek-v4-pro` activates the extension regardless of provider name. The
|
|
18
|
+
repository-qualified routes are `deepseek/deepseek-v4-pro` and
|
|
19
|
+
`opencode-go/deepseek-v4-pro`; third-party provider compatibility and data
|
|
20
|
+
handling remain the user's responsibility. The extension changes the first
|
|
21
|
+
request's persona and tool surface, but it is not an API proxy and does not
|
|
22
|
+
create a confidential channel.
|
|
20
23
|
|
|
21
24
|
The package adds no model round. The user's ordinary first task is the
|
|
22
25
|
bootstrap request and is billed normally by the selected provider.
|
package/docs/advanced.md
CHANGED
|
@@ -16,7 +16,14 @@ runtime.
|
|
|
16
16
|
|
|
17
17
|
## Experimental basis
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Project2 V4.1b is a personal, self-hosted long-horizon repository-maintenance
|
|
20
|
+
evaluation. The model repairs a deliberately broken multi-module Python backend
|
|
21
|
+
and ESP32-S3 firmware project covering authentication and session privacy,
|
|
22
|
+
database migrations, cross-module features, backward compatibility,
|
|
23
|
+
Wi-Fi/MQTT/NVS/protocol and ESP-IDF contracts, and final delivery evidence. It
|
|
24
|
+
is not a general benchmark.
|
|
25
|
+
|
|
26
|
+
Local runs use this Project2 V4.1b task at frozen commit
|
|
20
27
|
`04255b55f16c4439e538239fb9783070c4165081`. When a run resumed after an
|
|
21
28
|
interruption, only its final submission score entered the comparison. A wrong
|
|
22
29
|
project root, a zero-token configuration failure, and duplicate evaluation do
|
|
@@ -78,7 +85,7 @@ implementations:
|
|
|
78
85
|
| Implementation | Provider | Score | F3 | F6 | F8 |
|
|
79
86
|
| --- | --- | ---: | ---: | ---: | ---: |
|
|
80
87
|
| First packaged implementation | Official DeepSeek API | 96 | 16 | 8 | 7 |
|
|
81
|
-
| Current independent implementation
|
|
88
|
+
| Current independent implementation | OpenCode Go | **98** | 16 | 10 | 7 |
|
|
82
89
|
|
|
83
90
|
The initial OpenCode Go request hit an account opt-in 403 before producing a
|
|
84
91
|
token. The same session resumed after opt-in, stopped naturally, and scored 98.
|
|
@@ -110,7 +117,7 @@ establishes a DSH Minimal first request, while Pi remains the execution runtime.
|
|
|
110
117
|
|
|
111
118
|
| Current behavior | Main evidence |
|
|
112
119
|
| --- | --- |
|
|
113
|
-
| Arm only fresh sessions
|
|
120
|
+
| Arm only fresh sessions whose model id contains `deepseek-v4-pro` | Provider names do not gate activation; an existing conversation cannot reproduce a real bootstrap; isolation tests cover target and non-target models |
|
|
114
121
|
| Put the original task in request #1 | Early prototype 98; Whoami 93 |
|
|
115
122
|
| Use the Minimal persona and DSH schemas in request #1 | Pi-native `bash/read` 93; approximate Minimal 93 |
|
|
116
123
|
| Return to Pi-native execution after the first valid response | One-shot 96–98; persistent DSH wire 94 |
|
|
@@ -136,10 +143,11 @@ without injecting them into the prompt.
|
|
|
136
143
|
|
|
137
144
|
## Implementation verification
|
|
138
145
|
|
|
139
|
-
TypeScript typechecking and all
|
|
140
|
-
providers,
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
TypeScript typechecking and all 14 automated tests pass. Thirteen cover both
|
|
147
|
+
qualified providers, namespaced model ids on third-party providers, images,
|
|
148
|
+
error retry, text promotion, session resume, crash-stale recovery,
|
|
149
|
+
existing-conversation isolation, and non-target model isolation; one verifies
|
|
150
|
+
the session-statistics helper. Editor tests cover create, view, unique
|
|
143
151
|
replacement, insertion, relative-path rejection, and ambiguous-replacement
|
|
144
152
|
rejection.
|
|
145
153
|
|
package/docs/advanced.zh-CN.md
CHANGED
|
@@ -13,7 +13,12 @@ session、工具执行、文件编辑和插件组合。用户既能获得 Projec
|
|
|
13
13
|
|
|
14
14
|
## 实验口径
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Project2 V4.1b 是一个个人、自托管的长程代码维护评测。模型接手一个故意保留缺陷的
|
|
17
|
+
多模块 Python 后端与 ESP32-S3 固件仓库,完成鉴权与 session 隐私、数据库迁移、跨模块
|
|
18
|
+
功能、兼容性、Wi-Fi/MQTT/NVS/协议与 ESP-IDF 契约,以及最终交付证据。它不是通用
|
|
19
|
+
benchmark。
|
|
20
|
+
|
|
21
|
+
本地实验使用这套 Project2 V4.1b 任务,冻结于提交
|
|
17
22
|
`04255b55f16c4439e538239fb9783070c4165081`。同一运行中断后续跑时,只记录最终交卷分;
|
|
18
23
|
错误 project root、零 token 配置失败和重复评分不计作新样本。
|
|
19
24
|
|
|
@@ -65,7 +70,7 @@ context 必须显式携带 `session_id`,voice 路径先取得 current session
|
|
|
65
70
|
| 实现 | Provider | 分数 | F3 | F6 | F8 |
|
|
66
71
|
| --- | --- | ---: | ---: | ---: | ---: |
|
|
67
72
|
| 首次 package 化实现 | DeepSeek 官方 API | 96 | 16 | 8 | 7 |
|
|
68
|
-
| 当前独立实现
|
|
73
|
+
| 当前独立实现 | OpenCode Go | **98** | 16 | 10 | 7 |
|
|
69
74
|
|
|
70
75
|
OpenCode Go 的初始请求在生成 token 前遇到账户 opt-in 403。同一 session 完成 opt-in 后
|
|
71
76
|
续跑,模型最终自然 `stop` 并得到 98。这次运行验证了当前实现能够通过 OpenCode Go
|
|
@@ -94,7 +99,7 @@ provider payload 和 active catalog,其他 package 的工具会自然出现。
|
|
|
94
99
|
|
|
95
100
|
| 当前行为 | 主要证据 |
|
|
96
101
|
| --- | --- |
|
|
97
|
-
|
|
|
102
|
+
| 只武装模型标识包含 `deepseek-v4-pro` 的新 session | provider 名称不限制激活;已有对话无法还原真实 bootstrap;隔离测试覆盖目标与非目标模型 |
|
|
98
103
|
| 原任务直接进入请求 #1 | 早期原型 98;Whoami 93 |
|
|
99
104
|
| 请求 #1 使用 Minimal persona 与 DSH 两项 schema | Pi 原生 `bash/read` 93;近似 Minimal 93 |
|
|
100
105
|
| 第一次有效响应后恢复 Pi 原生执行 | one-shot 96–98;持续 DSH wire 94 |
|
|
@@ -117,9 +122,9 @@ wire 调用 225 次工具只得到 94,早期原型调用 148 次得到 98;
|
|
|
117
122
|
|
|
118
123
|
## 实现验证
|
|
119
124
|
|
|
120
|
-
TypeScript typecheck 已通过,
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
TypeScript typecheck 已通过,14 项自动化测试全部通过:13 项覆盖两个已验证 provider、
|
|
126
|
+
第三方 provider 的命名空间模型标识、图片、错误重试、文本晋升、session resume、
|
|
127
|
+
crash-stale 恢复、已有对话隔离和非目标模型隔离;另 1 项验证 session 统计工具。
|
|
123
128
|
Editor 测试覆盖 create、view、unique replace、insert、相对路径拒绝和歧义替换拒绝。
|
|
124
129
|
|
|
125
130
|
OpenCode Go bash-first 与 editor-first 离线回环通过 Pi 的真实 package loader 和 provider
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
本文记录支持当前实现的完整结果、纳入与排除规则、外部校准和来源关系。原始 run、
|
|
16
16
|
trajectory、provider capture 与 grader 输出由维护者实验归档保存,不随仓库分发。
|
|
17
17
|
|
|
18
|
+
Project2 V4.1b 是一个个人、自托管的长程代码维护评测,不是跨项目通用 benchmark。
|
|
19
|
+
候选模型需要修复一个多模块 Python 后端与 ESP32-S3 固件仓库,覆盖鉴权与 session 隐私、
|
|
20
|
+
数据库迁移、跨模块功能、兼容性、Wi-Fi/MQTT/NVS/协议与 ESP-IDF 契约,以及交付证据。
|
|
21
|
+
100 分 Ability 分数表示这套冻结任务中的工程完成度。
|
|
22
|
+
|
|
18
23
|
## 计分口径
|
|
19
24
|
|
|
20
25
|
- 同一运行中断后续跑,只保留最终交卷分;续跑前分数属于中间状态。
|
|
@@ -41,7 +46,7 @@ trajectory、provider capture 与 grader 输出由维护者实验归档保存,
|
|
|
41
46
|
| 默认 Pi baseline | 完整 Pi prompt + 5 工具,全程 native | `Let me` | **92** | F3 11,F6 10,F8 6 | 默认对照;ambient-session 少 5 分 |
|
|
42
47
|
| 早期 Minimal 模拟原型 | 原任务 + Minimal + DSH `bash/editor`;随后 Pi 原生 5 工具;不重放 context | `We need` | **98** | F3 16,F6 10,F8 7 | 首次证明 Pi 能进入高能力轨迹 |
|
|
43
48
|
| 首次 package 化实现 | 同一首包;随后 Pi 原生;同 session 续过一次 402 | `We need` | **96** | F3 16,F6 8,F8 7 | 干净 package 复现目标轨迹;迁移少 2 分 |
|
|
44
|
-
| 当前独立实现
|
|
49
|
+
| 当前独立实现 | 初始首包遇 403;opt-in 后同 session 续跑并恢复 Pi 原生 | `We need` | **98** | F3 16,F6 10,F8 7 | OpenCode Go 再次进入同一高分档 |
|
|
45
50
|
| 持续 DSH wire | 同一首包;后续请求继续 DSH 规范化 | `We need` | **94** | F3 11,F6 10,F8 8 | 指纹保持,关键安全判断没有保持 |
|
|
46
51
|
| Pi context 重放 | 同一首包;随后 Pi 原生,但把完整 system context 作为额外 user message | `We need` | **90** | F3 11,F6 8,F8 6 | 额外 context 增加干扰,迁移退化 |
|
|
47
52
|
| 同流程复现实验 | 同一首包;随后 Pi 原生;不重放 context | `We need` | **96** | F3 16,F6 10,F8 5 | 高分区间复现;ESP 静态完成度较低 |
|
|
@@ -103,7 +108,7 @@ blocks 只计 assistant content 中的 `thinking` block。`We need` 与 `Let me`
|
|
|
103
108
|
| 默认 Pi baseline | 92 | 113 | 78 | 0 | 115 | 2 / 156 |
|
|
104
109
|
| 早期 Minimal 模拟原型 | 98 | 149 | 135 | 8 | 1 | 10 / 1 |
|
|
105
110
|
| 首次 package 化实现 | 96 | 147 | 147 | 11 | 0 | 11 / 0 |
|
|
106
|
-
| 当前独立实现
|
|
111
|
+
| 当前独立实现 | 98 | 160 | 156 | 7 | 0 | 7 / 0 |
|
|
107
112
|
| 持续 DSH wire | 94 | 196 | 190 | 6 | 2 | 7 / 2 |
|
|
108
113
|
| Pi context 重放 | 90 | 189 | 184 | 6 | 0 | 8 / 0 |
|
|
109
114
|
| 同流程复现实验 | 96 | 160 | 155 | 10 | 0 | 12 / 0 |
|
|
@@ -120,7 +125,7 @@ blocks 只计 assistant content 中的 `thinking` block。`We need` 与 `Let me`
|
|
|
120
125
|
| 默认 Pi baseline | 157 | `bash` 79,`edit` 32,`read` 30,`write` 16 | `toolUse` 112,`stop` 1,`error` 1 |
|
|
121
126
|
| 早期 Minimal 模拟原型 | 148 | `bash` 83,`edit` 49,`write` 16 | `toolUse` 148,`stop` 1 |
|
|
122
127
|
| 首次 package 化实现 | 189 | `bash` 82,`read` 48,`edit` 42,`write` 17 | `toolUse` 146,`stop` 1,`error` 2 |
|
|
123
|
-
| 当前独立实现
|
|
128
|
+
| 当前独立实现 | 193 | `bash` 98,`read` 49,`edit` 31,`write` 15 | `toolUse` 159,`stop` 1,`error` 1 |
|
|
124
129
|
| 持续 DSH wire | 225 | `bash` 94,`edit` 65,`read` 53,`write` 13 | `toolUse` 195,`stop` 1 |
|
|
125
130
|
| Pi context 重放 | 220 | `bash` 76,`edit` 66,`read` 63,`write` 15 | `toolUse` 188,`stop` 1 |
|
|
126
131
|
| 同流程复现实验 | 176 | `bash` 176 | `toolUse` 159,`stop` 1,`error` 1 |
|
|
@@ -213,9 +218,12 @@ evaluator。
|
|
|
213
218
|
|
|
214
219
|
## 当前决定
|
|
215
220
|
|
|
216
|
-
- 产品名为 `pi-dsh-mimic
|
|
221
|
+
- 产品名为 `pi-dsh-mimic`。`0.1.0` 是首次公开实现;`0.1.1` 只补充 Project2 语境和
|
|
222
|
+
已发布安装说明,运行时代码不变;`0.1.2` 将激活条件改为模型标识包含
|
|
223
|
+
`deepseek-v4-pro`,不再按 provider 名称限制。
|
|
217
224
|
- 默认流程固定为 task-bearing one-shot:请求 #1 模拟 DSH Minimal,请求 #2 恢复 Pi。
|
|
218
|
-
-
|
|
225
|
+
- DeepSeek 官方 API 与 OpenCode Go 是本文已有运行和离线回环证据的 provider;第三方
|
|
226
|
+
provider 可以激活扩展,但不属于本文已经验证的实验范围。
|
|
219
227
|
- Minimal persona 保持;完整 Pi system context 不重放。
|
|
220
228
|
- Project2 同一请求流程已有四次 96–98,不继续重复付费运行。
|
|
221
229
|
- 新任务、模型或服务版本变化、provider payload 实质变化,或新的完整任务结果可以重开
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export const TARGET_MODEL_ID = "deepseek-v4-pro";
|
|
2
2
|
|
|
3
|
-
export const TARGET_PROVIDERS = ["deepseek", "opencode-go"] as const;
|
|
4
|
-
|
|
5
3
|
export const MINIMAL_PERSONA = "You are a helpful software engineer assistant.";
|
|
6
4
|
|
|
7
5
|
export const STATE_ENTRY_TYPE = "pi-dsh-mimic/session-stage";
|
package/src/index.ts
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
MINIMAL_PERSONA,
|
|
13
13
|
STATE_ENTRY_TYPE,
|
|
14
14
|
TARGET_MODEL_ID,
|
|
15
|
-
TARGET_PROVIDERS,
|
|
16
15
|
} from "./constants.js";
|
|
17
16
|
import { executeEditor, type EditorArgs } from "./editor.js";
|
|
18
17
|
import {
|
|
@@ -184,5 +183,4 @@ export {
|
|
|
184
183
|
MINIMAL_PERSONA,
|
|
185
184
|
STATE_ENTRY_TYPE,
|
|
186
185
|
TARGET_MODEL_ID,
|
|
187
|
-
TARGET_PROVIDERS,
|
|
188
186
|
};
|
package/src/session-stage.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
STATE_ENTRY_TYPE,
|
|
3
3
|
TARGET_MODEL_ID,
|
|
4
|
-
TARGET_PROVIDERS,
|
|
5
4
|
} from "./constants.js";
|
|
6
5
|
import { isJsonObject } from "./protocol.js";
|
|
7
6
|
|
|
@@ -21,9 +20,7 @@ export function supportedRoute(model: { provider?: unknown; id?: unknown } | und
|
|
|
21
20
|
if (typeof model?.provider !== "string" || typeof model.id !== "string") return undefined;
|
|
22
21
|
const provider = model.provider.toLowerCase();
|
|
23
22
|
const modelId = model.id.toLowerCase();
|
|
24
|
-
if (modelId
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
23
|
+
if (!modelId.includes(TARGET_MODEL_ID)) return undefined;
|
|
27
24
|
return `${provider}/${modelId}`;
|
|
28
25
|
}
|
|
29
26
|
|