pi-patch-keeper 1.2.8 → 1.2.9

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 +44 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -48,6 +48,8 @@ pi install npm:pi-patch-keeper
48
48
  - 写盘用临时文件 + rename;修复前备份。
49
49
 
50
50
 
51
+ ## 原理(专业)
52
+
51
53
  ```mermaid
52
54
  flowchart TD
53
55
  A[factory] --> B[读 settings.json 建指纹]
@@ -60,6 +62,22 @@ flowchart TD
60
62
  H -->|不一致| I[通知 + nextTurn 尾部消息<br/>以磁盘为准]
61
63
  ```
62
64
 
65
+ ## 原理(小白)
66
+
67
+ 像出门前的门卫,检查三件事:开关是否一致、排队顺序对不对、手里的说明书是不是最新版;能顺手修的直接修,修不了就提醒你。
68
+
69
+ ```mermaid
70
+ flowchart LR
71
+ A[启动] --> B[门卫检查三件事]
72
+ B --> C{开关一致?}
73
+ B --> D{排队顺序对?}
74
+ B --> E{说明书最新?}
75
+ C -->|否| F[提醒]
76
+ D -->|否| G[直接调好]
77
+ E -->|否| H[提醒:以手上那份为准]
78
+ ```
79
+
80
+
63
81
  ## License
64
82
 
65
83
  MIT
@@ -111,7 +129,33 @@ No config file (only reads `settings.json` and `APPEND_SYSTEM.md`); no environme
111
129
  - Writes are atomic (temp file + rename); a backup precedes any repair.
112
130
 
113
131
 
132
+ ## How it works (technical)
133
+
134
+ ```mermaid
135
+ flowchart TD
136
+ A[factory] --> B[read settings.json, build fingerprint]
137
+ B --> C[session_start]
138
+ C --> D{fingerprint changed?}
139
+ D -->|yes| E[notify: manuals may be stale]
140
+ C --> F{force order wrong?}
141
+ F -->|yes| G[backup + reorder packages]
142
+ C --> H[before_agent_start<br/>compare injected manual vs disk]
143
+ H -->|mismatch| I[notify + nextTurn message<br/>trust disk]
144
+
145
+ ## How it works (plain words)
146
+
147
+ 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.
148
+
114
149
  ```mermaid
150
+ flowchart LR
151
+ A[startup] --> B[doorman checks three things]
152
+ B --> C{switches agree?}
153
+ B --> D{queue order right?}
154
+ B --> E{manual up to date?}
155
+ C -->|no| F[notify]
156
+ D -->|no| G[fix it directly]
157
+ E -->|no| H[notify: trust the copy in hand]
158
+ ```
115
159
  flowchart TD
116
160
  A[factory] --> B[read settings.json, build fingerprint]
117
161
  B --> C[session_start]
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.9",
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",