@lmzhen/dsh-evolution-approval 0.3.83 → 0.4.0
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 +22 -26
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,42 +1,38 @@
|
|
|
1
1
|
# @lmzhen/dsh-evolution-approval
|
|
2
2
|
|
|
3
|
-
Stage/pending approval service for
|
|
3
|
+
Stage/pending approval service for self-evolution writes. DSH native approval is
|
|
4
|
+
one-shot; this service adds the Hermes staged queue: `request()` stores background writes,
|
|
5
|
+
`approve()` replays them through a runner, `reject()` discards them. The model-facing write tools
|
|
6
|
+
register their own runners (`tool-memory` via `registerRunner('memory', …)`, `tool-skill-manage`
|
|
7
|
+
via `registerRunner('skill', …)`), so staged writes are replayable only when the corresponding
|
|
8
|
+
tool package is composed.
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
`request()` stores background writes, `approve()` replays them through a runner,
|
|
7
|
-
and `reject()` discards them. The model-facing write tools register their own
|
|
8
|
-
runners — `tool-memory` via `registerRunner('memory', …)` and
|
|
9
|
-
`tool-skill-manage` via `registerRunner('skill', …)` — so staged writes are
|
|
10
|
-
replayable only when the corresponding tool package is composed.
|
|
11
|
-
|
|
12
|
-
Run the package tests:
|
|
10
|
+
Tests:
|
|
13
11
|
|
|
14
12
|
```sh
|
|
15
|
-
node node_modules/vitest/vitest.mjs run packages/evolution
|
|
16
|
-
# flat mirror: node node_modules/vitest/vitest.mjs run packages/evolution-approval/tests
|
|
13
|
+
node node_modules/vitest/vitest.mjs run packages/evolution-approval/tests # overlay: packages/evolution/evolution-approval/tests
|
|
17
14
|
```
|
|
18
15
|
|
|
19
|
-
## Model
|
|
20
|
-
|
|
21
|
-
### Indirect model surface
|
|
22
|
-
|
|
23
|
-
#### What the model sees
|
|
16
|
+
## Model surface
|
|
24
17
|
|
|
25
|
-
|
|
18
|
+
- **Model-visible:** nothing of its own: a staged write's effect is what the model notices.
|
|
19
|
+
- **Prompt prefix / KV cache:** unchanged by this package: family-level rules single-sourced in `packages/README.md` §"Model-visible prompt prefix and the KV cache".
|
|
20
|
+
- **Mount it?** yes — the `evolution-approval` row, in `evolution-host`/`evolution-all`/one-click `evolution-preset` (`enabled: false` there).
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
## Configuration
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
- `enabled` (default `false`): master switch (off = ungated).
|
|
25
|
+
- `stageForeground` (default `true`): stage foreground writes too.
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
## Known limitations
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
- `approve()` dedupes inside one process and providers resolve the record atomically, but the replay runner executes BEFORE that resolution: two OS processes approving one id can both write while one wins the audit transition. Run approvals from one writer process, or make runners idempotent.
|
|
30
|
+
- **Approve + reject on one id** are not serialized inside a process: a reject can resolve a still-executing record while the runner completes and the write still lands: verify the write state, or reject only when no approve is in flight.
|
|
31
|
+
- **No freshness re-validation:** the staged `args` snapshot is replayed as-is (no content hash), so `approve()` never checks whether the target changed; `/evolution pending --detail` shows what will be replayed.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
**Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
|
|
36
34
|
|
|
35
|
+
## Notes and history
|
|
37
36
|
|
|
38
|
-
-
|
|
39
|
-
- **Concurrent approve + reject on the same id (F-204).** Inside one process the dedupe keys are `approve:<id>` / `reject:<id>`, so the two paths are not serialized against each other. When an approve runner is slow, a reject resolves the still-executing record to `rejected` **without holding a claim**; the runner may then complete and the write can still land while the audit history reads `rejected` — the write effect, not the audit verdict, is what actually persists (`写效果以实际为准`). `reject` on an executing record reports this and asks you to verify the write state manually. Only reject a write after confirming no approve is in flight, or verify the write effect manually afterwards.
|
|
37
|
+
- **Concurrent approve + reject on the same id (F-204).** Inside one process the dedupe keys are `approve:<id>` / `reject:<id>`, so the two paths are not serialized against each other. When an approve runner is slow, a reject resolves the still-executing record to `rejected` **without holding a claim**; the runner may then complete and the write can still land while the audit history reads `rejected`: the write effect, not the audit verdict, is what actually persists (`写效果以实际为准`). `reject` on an executing record reports this and asks you to verify the write state manually. Only reject a write after confirming no approve is in flight, or verify the write effect manually afterwards.
|
|
40
38
|
- **No staged-content freshness re-validation (F-328).** The staged record stores the `args` snapshot captured at request time and replays exactly those args, but does not record a content hash, so `approve()` does **not** re-check whether the on-disk skill/memory the write targets changed since staging. The write is applied as staged regardless. The pending surface (`/evolution pending --detail`) exposes the staged `args` so you can review what will actually be replayed before approving; there is no automatic drift warning if the target changed in the meantime.
|
|
41
|
-
|
|
42
|
-
**Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-approval",
|
|
3
3
|
"description": "Stage/pending approval service for Hermes-style self-evolution writes (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
30
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
30
|
+
"@lmzhen/dsh-evolution-core": "^0.4.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
34
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.
|
|
35
|
-
"@lmzhen/dsh-evolution-state": "^0.
|
|
34
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.4.0",
|
|
35
|
+
"@lmzhen/dsh-evolution-state": "^0.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
39
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.
|
|
40
|
-
"@lmzhen/dsh-evolution-state": "^0.
|
|
38
|
+
"@lmzhen/dsh-evolution-core": "^0.4.0",
|
|
39
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.4.0",
|
|
40
|
+
"@lmzhen/dsh-evolution-state": "^0.4.0"
|
|
41
41
|
}
|
|
42
42
|
}
|