@davideasden/pi-undo 0.3.5 → 0.3.6

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 CHANGED
@@ -21,7 +21,7 @@ Each completed agent run creates a checkpoint that captures both the Pi session
21
21
 
22
22
  ## Requirements
23
23
 
24
- - Pi `1.2.0` 或更高版本(已在 1.2.0 和 1.3.0 上验证,见 [Pi 1.3.0 兼容验证记录](docs/pi-1.3.0-validation.md))。`1.1.x` 及更早版本不再受支持,也不在 CI 中测试:早期版本的扩展生命周期行为不同(例如 `before_agent_start` 的触发范围与会话 busy 语义),不保证撤回语义正确。历史验证记录见 [Pi 0.86.1 撤回修复与验证记录](docs/pi-0.86.1-validation.md)。
24
+ - Pi `1.2.0` 或更高版本(已在 1.2.0、1.3.0 和 1.4.0 上验证,见 [Pi 1.4.0 兼容验证记录](docs/pi-1.4.0-validation.md))。`1.1.x` 及更早版本不再受支持,也不在 CI 中测试:早期版本的扩展生命周期行为不同(例如 `before_agent_start` 的触发范围与会话 busy 语义),不保证撤回语义正确。历史验证记录见 [Pi 0.86.1 撤回修复与验证记录](docs/pi-0.86.1-validation.md)。
25
25
  - Node.js `22.19.0` or later.
26
26
  - Git available on `PATH` (used internally for content-addressed snapshots).
27
27
 
@@ -173,7 +173,7 @@ recovery_required
173
173
 
174
174
  本机 macOS arm64 的三次 undo 中位数:3,000 包/1 文件从 1,976 ms 降至 924 ms,10,000 包/1 文件从 5,857 ms 降至 2,755 ms;100 文件的子目录撤销从 517 ms 降至 180 ms,混合撤销从 711 ms 降至 186 ms。测量方法和限制见 [原生性能验证记录](docs/native-performance.md)。
175
175
 
176
- 可通过真实 Pi 1.2.0 SDK 和离线 faux provider 运行大型工作区基准;它覆盖 3,000/10,000 个依赖包、修改 1/100 个文件,每组撤回三次并验证重做:
176
+ 可通过真实 Pi SDK(夹具固定为 1.4.0)和离线 faux provider 运行大型工作区基准;它覆盖 3,000/10,000 个依赖包、修改 1/100 个文件,每组撤回三次并验证重做:
177
177
 
178
178
  ```bash
179
179
  PI_UNDO_LARGE_WORKSPACE=1 npx vitest run test/large-workspace.test.ts
@@ -31,4 +31,4 @@ pi-undo 使用的扩展生命周期、命令、会话树和编辑器 API 在 Pi
31
31
 
32
32
  ## 剩余限制
33
33
 
34
- 未在 Windows 和 Linux 上重复完整测试。`mutation_conflict` 的自动解除仍然被禁止,这是为了避免在外部写入与 pi-undo 操作无法确定先后时造成不可逆覆盖。
34
+ 未在 Windows 和 Linux 上重复完整测试。`mutation_conflict` 的自动解除仍然被禁止,这是为了避免在外部写入与 pi-undo 操作无法确定先后时造成不可逆覆盖。Pi 1.4.0 的记录见 [pi-1.4.0-validation.md](pi-1.4.0-validation.md)。
@@ -0,0 +1,44 @@
1
+ # Pi 1.4.0 兼容验证记录
2
+
3
+ 验证对象:`@davideasden/pi-undo` 当前工作树。
4
+
5
+ 验证环境:Pi 1.4.0(`@earendil-works/pi-coding-agent@1.4.0`,npm 发布产物)、Node.js 23.11.1、macOS arm64。生命周期接口以 Pi 1.4.0 的 `core/extensions/types.ts` 与 SDK 行为为准;测试使用离线 faux provider,不请求模型网络。
6
+
7
+ ## 结论
8
+
9
+ pi-undo 无需改动源码即可在 Pi 1.4.0 上运行。1.3.0 → 1.4.0 的扩展 API 没有任何改动:`core/extensions/types.ts`、`core/extensions/runner.ts`、`core/session-manager.ts` 均未变更,差异只在加载器新增 `@earendil-works/pi-ai/models` 别名。
10
+
11
+ 开发依赖与测试夹具已从 1.3.0 提升到 1.4.0;`peerDependencies` 仍为 `>=1.2.0`,运行时不绑定具体版本。
12
+
13
+ ## 验证项目
14
+
15
+ | 检查 | 结果 |
16
+ | --- | --- |
17
+ | `npm run typecheck`(`src`/`extensions`/`test`,对着 1.4.0 类型) | 通过 |
18
+ | `npm test` | 25 个测试文件通过、5 个跳过;680 项通过、10 项跳过 |
19
+ | 真实加载器加载包目录(`DefaultResourceLoader` + `additionalExtensionPaths`) | 0 错误,注册 `undo`/`redo`/`diff`/`undo-cancel`/`undo-recover` 与全部 8 个事件处理器 |
20
+ | 端到端(真实加载器 + faux provider) | run → `/undo` → `/redo`,文件内容与 footer 状态正确 |
21
+
22
+ 加载器检查使用 1.4.0 的 `DefaultResourceLoader` 加载包根目录(`package.json` 的 `pi.extensions` 指向 `extensions/pi-undo.ts`),验证 TypeScript 转译、`../src/*.ts` 相对导入与 `proper-lockfile` 解析;断言 `errors` 为空且命令与事件齐全。
23
+
24
+ 跳过项与 1.3.0 一致:`durable-pack-*`/`tree-query` 基准、`large-workspace` 基准,以及需要 `PI_UNDO_RUN_RESIDENT_LIVE=1` 的常驻扫描 smoke。
25
+
26
+ ## 1.3.0 → 1.4.0 变更核对
27
+
28
+ - 扩展类型与事件形状未变:`ExtensionContext`、`ExtensionCommandContext`、`input`、`message_end`、`before_agent_start`、`agent_settled`、`session_before_tree`、`session_tree` 与 1.3.0 完全一致。
29
+ - 交互式扩展对话框改为栈式实现(`select`/`confirm`/`input`/`editor`/内联 `custom` 可嵌套,关闭后回到上一个,不再出现 promise 永久挂起)。`/diff` 使用 `ui.select` + `ui.custom({ overlay: true })`,走 overlay 路径,行为不变;嵌套场景下比 1.3.0 更可靠。
30
+ - `AgentSession` 的改动集中在溢出恢复的 tool result 配对与 `_restoreToolsFromTranscript`,不涉及 pi-undo 依赖的 run 生命周期、`agent_settled` 派发与树导航。
31
+ - 加载器新增 `@earendil-works/pi-ai/models` 别名;pi-undo 运行时不导入 `pi-ai`,无影响。
32
+
33
+ ## 关键边界处理
34
+
35
+ 1.3.0 的边界结论在 1.4.0 上没有回归:
36
+
37
+ - `before_agent_start` 的 `messageType: "custom"` 仍然不创建 undo run。
38
+ - workspace canonical root 变化时,捕获失败原因包含 `workspace_identity_changed`,用户输入继续执行但不进入撤回历史,并提示 `/undo-recover`。
39
+ - 后台 finalization 失败会立即锁定撤回历史,等 `/undo-recover` 重试。
40
+ - `mutation_conflict` 继续 fail closed,不会自动猜测回滚或前进方向。
41
+
42
+ ## 剩余限制
43
+
44
+ 未在 Windows 和 Linux 上重复完整测试。TUI 对话框栈只在类型与调用路径上验证,未做人工交互回归。1.3.0 的历史记录见 [pi-1.3.0-validation.md](pi-1.3.0-validation.md)。
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davideasden/pi-undo",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Persistent workspace undo and redo for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,7 +38,8 @@
38
38
  "docs/native-performance.md",
39
39
  "docs/pi-0.86.1-validation.md",
40
40
  "docs/pi-1.2.0-validation.md",
41
- "docs/pi-1.3.0-validation.md"
41
+ "docs/pi-1.3.0-validation.md",
42
+ "docs/pi-1.4.0-validation.md"
42
43
  ],
43
44
  "scripts": {
44
45
  "test": "vitest run",
@@ -57,9 +58,9 @@
57
58
  "proper-lockfile": "4.1.2"
58
59
  },
59
60
  "devDependencies": {
60
- "@earendil-works/pi-ai": "1.3.0",
61
- "@earendil-works/pi-coding-agent": "1.3.0",
62
- "@earendil-works/pi-tui": "1.3.0",
61
+ "@earendil-works/pi-ai": "1.4.0",
62
+ "@earendil-works/pi-coding-agent": "1.4.0",
63
+ "@earendil-works/pi-tui": "1.4.0",
63
64
  "@types/node": "24.12.4",
64
65
  "@types/proper-lockfile": "4.1.4",
65
66
  "typescript": "5.9.3",