pi-patch-keeper 1.2.7 → 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.
- package/README.md +60 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
pi 配置守卫:codemode 一致性、force 顺序、环境指纹漂移、注入手册对齐。**不含 PiDeck 与第三方源码补丁。**
|
|
11
11
|
|
|
12
|
+
## 快速事实
|
|
13
|
+
|
|
14
|
+
| 项 | 说明 |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| 配置文件 | **无**(只读 settings.json / APPEND_SYSTEM.md) |
|
|
17
|
+
| 命令行 | /patch-keeper [fix] |
|
|
18
|
+
| 调用方式 | **全自动**:启动自检并自动修复 force 顺序;fix 手动重跑 |
|
|
19
|
+
|
|
12
20
|
## 安装
|
|
13
21
|
|
|
14
22
|
```bash
|
|
@@ -40,6 +48,8 @@ pi install npm:pi-patch-keeper
|
|
|
40
48
|
- 写盘用临时文件 + rename;修复前备份。
|
|
41
49
|
|
|
42
50
|
|
|
51
|
+
## 原理(专业)
|
|
52
|
+
|
|
43
53
|
```mermaid
|
|
44
54
|
flowchart TD
|
|
45
55
|
A[factory] --> B[读 settings.json 建指纹]
|
|
@@ -52,6 +62,22 @@ flowchart TD
|
|
|
52
62
|
H -->|不一致| I[通知 + nextTurn 尾部消息<br/>以磁盘为准]
|
|
53
63
|
```
|
|
54
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
|
+
|
|
55
81
|
## License
|
|
56
82
|
|
|
57
83
|
MIT
|
|
@@ -64,6 +90,14 @@ MIT
|
|
|
64
90
|
|
|
65
91
|
pi configuration guards: codemode consistency, force order, settings fingerprint drift, injected-manual alignment. **No PiDeck or third-party source patching.**
|
|
66
92
|
|
|
93
|
+
## At a glance
|
|
94
|
+
|
|
95
|
+
| Item | Description |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| Config file | **None** (reads settings.json / APPEND_SYSTEM.md only) |
|
|
98
|
+
| Commands | /patch-keeper [fix] |
|
|
99
|
+
| Automation | **Fully automatic**: self-checks at startup and repairs force order; fix re-runs it |
|
|
100
|
+
|
|
67
101
|
## Install
|
|
68
102
|
|
|
69
103
|
```bash
|
|
@@ -95,7 +129,33 @@ No config file (only reads `settings.json` and `APPEND_SYSTEM.md`); no environme
|
|
|
95
129
|
- Writes are atomic (temp file + rename); a backup precedes any repair.
|
|
96
130
|
|
|
97
131
|
|
|
132
|
+
## How it works (technical)
|
|
133
|
+
|
|
98
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
|
+
|
|
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
|
+
```
|
|
99
159
|
flowchart TD
|
|
100
160
|
A[factory] --> B[read settings.json, build fingerprint]
|
|
101
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.
|
|
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",
|