@lmzhen/dsh-evolution-approval 0.1.0-rc.45 → 0.1.0-rc.47
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/lib/index.js +11 -0
- package/lib/types/index.d.ts +8 -0
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -41,6 +41,16 @@ var EvolutionApproval = class extends Service {
|
|
|
41
41
|
if (this.runners.get(kind) === runner) this.runners.delete(kind);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether a replay runner is registered for `kind` (rc.42 audit P1-9
|
|
46
|
+
* pre-check surface): callers that can execute a write directly (the review
|
|
47
|
+
* pipeline) use it to avoid staging a pending record that no runner could
|
|
48
|
+
* ever replay. `capability` records are answerable without a runner by
|
|
49
|
+
* design, so they are exempt from the staging pre-check.
|
|
50
|
+
*/
|
|
51
|
+
hasRunner(kind) {
|
|
52
|
+
return this.runners.has(kind);
|
|
53
|
+
}
|
|
44
54
|
/** Trusted plan-executor entry point: replay a write through the registered runner exactly once. */
|
|
45
55
|
async run(kind, args) {
|
|
46
56
|
const runner = this.runners.get(kind);
|
|
@@ -62,6 +72,7 @@ var EvolutionApproval = class extends Service {
|
|
|
62
72
|
message: "Session approval policy is \"never\"; write allowed without staging."
|
|
63
73
|
};
|
|
64
74
|
if (input.origin === "background_review" || this.stageForeground) {
|
|
75
|
+
if (input.kind !== "capability" && !this.runners.has(input.kind)) this.ctx.logger.warn(`evolution-approval: staging "${input.kind}" write with no replay runner registered - it will not be approvable`);
|
|
65
76
|
const record = {
|
|
66
77
|
id: randomUUID(),
|
|
67
78
|
kind: input.kind,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -60,6 +60,14 @@ export declare class EvolutionApproval extends Service {
|
|
|
60
60
|
/** Fail-closed capability adapters need to distinguish "allowed" from "enabled". */
|
|
61
61
|
get isEnabled(): boolean;
|
|
62
62
|
registerRunner(kind: PendingKind, runner: WriteRunner): () => void;
|
|
63
|
+
/**
|
|
64
|
+
* Whether a replay runner is registered for `kind` (rc.42 audit P1-9
|
|
65
|
+
* pre-check surface): callers that can execute a write directly (the review
|
|
66
|
+
* pipeline) use it to avoid staging a pending record that no runner could
|
|
67
|
+
* ever replay. `capability` records are answerable without a runner by
|
|
68
|
+
* design, so they are exempt from the staging pre-check.
|
|
69
|
+
*/
|
|
70
|
+
hasRunner(kind: PendingKind): boolean;
|
|
63
71
|
/** Trusted plan-executor entry point: replay a write through the registered runner exactly once. */
|
|
64
72
|
run(kind: PendingKind, args: unknown): Promise<{
|
|
65
73
|
ok: boolean;
|
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.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.47",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.
|
|
41
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
40
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.47",
|
|
41
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.47"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
45
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.
|
|
46
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
47
|
-
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.
|
|
48
|
-
"@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.
|
|
49
|
-
"@lmzhen/dsh-evolution-state-json": "^0.1.0-rc.
|
|
45
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.47",
|
|
46
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.47",
|
|
47
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.47",
|
|
48
|
+
"@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.47",
|
|
49
|
+
"@lmzhen/dsh-evolution-state-json": "^0.1.0-rc.47"
|
|
50
50
|
}
|
|
51
51
|
}
|