pi-patch-keeper 1.2.5 → 1.2.7

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.
Files changed (2) hide show
  1. package/README.md +30 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
- # pi-patch-keeper
1
+ <p align="center">
2
+ <a href="#zh"><img alt="中文" src="https://img.shields.io/badge/%E4%B8%AD%E6%96%87-%E4%B8%AD%E6%96%87-2F81F7?style=for-the-badge"></a>
3
+ <a href="#english"><img alt="English" src="https://img.shields.io/badge/English-EN-FF6B35?style=for-the-badge"></a>
4
+ </p>
5
+
6
+ <a id="zh"></a>
2
7
 
3
- > 中文 · [English](#english)(页面内折叠)
8
+ # pi-patch-keeper
4
9
 
5
10
  pi 配置守卫:codemode 一致性、force 顺序、环境指纹漂移、注入手册对齐。**不含 PiDeck 与第三方源码补丁。**
6
11
 
@@ -34,9 +39,18 @@ pi install npm:pi-patch-keeper
34
39
  - `before_agent_start`:比对注入手册版本与磁盘版本;不一致时通知并以 `nextTurn` 尾部消息提示模型以磁盘为准;**不返回 `systemPrompt`**。
35
40
  - 写盘用临时文件 + rename;修复前备份。
36
41
 
37
- ## 不在本包内
38
42
 
39
- PiDeck builtin 补丁恢复、asar 只读检测、pi-lens / pi-memory / pi-tactician 源码补丁、本机快照恢复 —— 依赖 PiDeck 安装目录与第三方包内部实现,只在本机模块 `patch-keeper-local` 中,不发布。
43
+ ```mermaid
44
+ flowchart TD
45
+ A[factory] --> B[读 settings.json 建指纹]
46
+ B --> C[session_start]
47
+ C --> D{指纹变化?}
48
+ D -->|是| E[通知:手册/结论可能过期]
49
+ C --> F{force 顺序错?}
50
+ F -->|是| G[备份 + 重排 packages]
51
+ C --> H[before_agent_start<br/>比对注入手册版本与磁盘]
52
+ H -->|不一致| I[通知 + nextTurn 尾部消息<br/>以磁盘为准]
53
+ ```
40
54
 
41
55
  ## License
42
56
 
@@ -46,8 +60,7 @@ MIT
46
60
 
47
61
  <a id="english"></a>
48
62
 
49
- <details>
50
- <summary><b>English</b></summary>
63
+ <h1 align="center">🌐 English Version &nbsp;⬇️</h1>
51
64
 
52
65
  pi configuration guards: codemode consistency, force order, settings fingerprint drift, injected-manual alignment. **No PiDeck or third-party source patching.**
53
66
 
@@ -81,12 +94,19 @@ No config file (only reads `settings.json` and `APPEND_SYSTEM.md`); no environme
81
94
  - `before_agent_start`: compares the injected manual version with disk; on mismatch it notifies and sends a `nextTurn` message telling the model to trust disk; **never returns `systemPrompt`**.
82
95
  - Writes are atomic (temp file + rename); a backup precedes any repair.
83
96
 
84
- ## Not in this package
85
97
 
86
- PiDeck builtin patch restore, read-only asar checks, pi-lens / pi-memory / pi-tactician source patches, local snapshot restore — they depend on the PiDeck install dir and third-party internals, and live only in the local module `patch-keeper-local` (not published).
98
+ ```mermaid
99
+ flowchart TD
100
+ A[factory] --> B[read settings.json, build fingerprint]
101
+ B --> C[session_start]
102
+ C --> D{fingerprint changed?}
103
+ D -->|yes| E[notify: manuals may be stale]
104
+ C --> F{force order wrong?}
105
+ F -->|yes| G[backup + reorder packages]
106
+ C --> H[before_agent_start<br/>compare injected manual vs disk]
107
+ H -->|mismatch| I[notify + nextTurn message<br/>trust disk]
108
+ ```
87
109
 
88
110
  ## License
89
111
 
90
112
  MIT
91
-
92
- </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-patch-keeper",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "pi config guards: codemode single-source check, force-order guard (auto-fix), settings fingerprint drift, injected-manual alignment. (PiDeck / third-party source patches are a local-only module, not bundled.)",
5
5
  "type": "module",
6
6
  "license": "MIT",