pi-patch-keeper 1.2.8 → 1.2.10

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 +42 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -47,6 +47,7 @@ pi install npm:pi-patch-keeper
47
47
  - `before_agent_start`:比对注入手册版本与磁盘版本;不一致时通知并以 `nextTurn` 尾部消息提示模型以磁盘为准;**不返回 `systemPrompt`**。
48
48
  - 写盘用临时文件 + rename;修复前备份。
49
49
 
50
+ ## 原理(专业)
50
51
 
51
52
  ```mermaid
52
53
  flowchart TD
@@ -60,6 +61,21 @@ flowchart TD
60
61
  H -->|不一致| I[通知 + nextTurn 尾部消息<br/>以磁盘为准]
61
62
  ```
62
63
 
64
+ ## 原理(小白)
65
+
66
+ **像出门前的门卫**,检查三件事:开关是否一致、排队顺序对不对、手里的说明书是不是最新版;能顺手修的直接修,修不了就提醒你。
67
+
68
+ ```mermaid
69
+ flowchart TD
70
+ A[启动] --> B[门卫三项检查]
71
+ B --> C{开关一致?}
72
+ B --> D{顺序对不对?}
73
+ B --> E{说明书最新?}
74
+ C -->|否| F[提醒]
75
+ D -->|否| G[直接调好]
76
+ E -->|否| H[提醒:以手上为准]
77
+ ```
78
+
63
79
  ## License
64
80
 
65
81
  MIT
@@ -110,6 +126,7 @@ No config file (only reads `settings.json` and `APPEND_SYSTEM.md`); no environme
110
126
  - `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`**.
111
127
  - Writes are atomic (temp file + rename); a backup precedes any repair.
112
128
 
129
+ ## How it works (technical)
113
130
 
114
131
  ```mermaid
115
132
  flowchart TD
@@ -121,7 +138,32 @@ flowchart TD
121
138
  F -->|yes| G[backup + reorder packages]
122
139
  C --> H[before_agent_start<br/>compare injected manual vs disk]
123
140
  H -->|mismatch| I[notify + nextTurn message<br/>trust disk]
141
+
142
+ ```
143
+
144
+ ## How it works (plain words)
145
+
146
+ **Like a doorman** before you leave: checks three things — switches agree, queue order is right, the manual in hand is the latest version; fixes what it can and tells you the rest.
147
+
148
+ ```mermaid
149
+ flowchart TD
150
+ A[startup] --> B[doorman: three checks]
151
+ B --> C{switches agree?}
152
+ B --> D{order right?}
153
+ B --> E{manual latest?}
154
+ C -->|no| F[notify]
155
+ D -->|no| G[fix directly]
156
+ E -->|no| H[notify: trust the copy in hand]
124
157
  ```
158
+ flowchart TD
159
+ A[factory] --> B[read settings.json, build fingerprint]
160
+ B --> C[session_start]
161
+ C --> D{fingerprint changed?}
162
+ D -->|yes| E[notify: manuals may be stale]
163
+ C --> F{force order wrong?}
164
+ F -->|yes| G[backup + reorder packages]
165
+ C --> H[before_agent_start<br/>compare injected manual vs disk]
166
+ H -->|mismatch| I[notify + nextTurn message<br/>trust disk]
125
167
 
126
168
  ## License
127
169
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-patch-keeper",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
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",