principles-disciple 1.222.0 → 1.222.2

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.
@@ -15,7 +15,14 @@ import type { PluginHookBeforeToolCallResult } from '../openclaw-sdk.js';
15
15
  * Block context containing all information needed for block persistence
16
16
  */
17
17
  export interface BlockContext {
18
- filePath: string;
18
+ /**
19
+ * Target path. Nullable by contract (PRI-569 round 3): the shared
20
+ * host-runtime path may deny a call whose path cannot be normalized, and
21
+ * trajectory.db accepts a null file_path — a deny is always accounted,
22
+ * never dropped for lack of a path. Display-only contexts use
23
+ * `<unresolved>` via the caller-side displayPath coercion.
24
+ */
25
+ filePath: string | null;
19
26
  reason: string;
20
27
  toolName: string;
21
28
  sessionId?: string;
@@ -26,6 +33,23 @@ export interface BlockContext {
26
33
  /** Principle id from the rule result — enables PRI-530 receipt copy attribution */
27
34
  principleId?: string;
28
35
  }
36
+ /**
37
+ * Authoritative persistence core for ONE gate-block decision.
38
+ *
39
+ * Shared by BOTH enforcement paths (PRI-569): recordGateBlockAndReturn
40
+ * (legacy hook path) and handleSharedRuleHostResult's deny branch (shared
41
+ * host-runtime path). Before PRI-569 the shared path recorded only EventLog
42
+ * JSONL rows, so trajectory.db gate_blocks stayed empty and Wave-4's
43
+ * "blocks today" metric read 0 despite live blocks.
44
+ *
45
+ * None of the steps throws into the caller; degradation is observable via
46
+ * reasonCode-carrying warnings, and trajectory write failures schedule the
47
+ * bounded retry chain.
48
+ */
49
+ export declare function persistGateBlock(wctx: WorkspaceContext, blockCtx: BlockContext, logger: {
50
+ warn?: (_message: string) => void;
51
+ error?: (_message: string) => void;
52
+ }): void;
29
53
  /**
30
54
  * Single authoritative block helper.
31
55
  *
@@ -42,3 +42,25 @@ export declare function handleSharedRuleHostResult(event: PluginHookBeforeToolCa
42
42
  workspaceDir: string;
43
43
  logger?: Partial<PluginLogger>;
44
44
  }, result: HostEventResult): void;
45
+ /**
46
+ * Authoritative accounting for ONE shared-path deny decision (PRI-569).
47
+ *
48
+ * Both shared-handler deny branches (resolvable and unresolved target path)
49
+ * funnel here: receipt-ledger effect row (flag-gated, failure-degrading —
50
+ * parity with the legacy hook path) plus persistGateBlock (session GFI,
51
+ * EventLog gate_block, trajectory gate_blocks with bounded retry). A null
52
+ * filePath is accounted with a null trajectory file_path; the EventLog copy
53
+ * carries an '<unresolved>' placeholder. Never throws into the caller;
54
+ * every skip/failure warns with a reasonCode (rc-9).
55
+ */
56
+ export declare function accountSharedDeny(wctx: WorkspaceContext, accounting: {
57
+ sessionId?: string;
58
+ toolName: string;
59
+ filePath: string | null;
60
+ reason: string;
61
+ ruleId?: string;
62
+ principleId?: string;
63
+ }, logger: {
64
+ warn?: (_message: string) => void;
65
+ error?: (_message: string) => void;
66
+ }): void;
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
- "version": "1.222.0",
5
+ "version": "1.222.2",
6
6
  "activation": {
7
7
  "onCapabilities": [
8
8
  "hook"
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
- "version": "1.222.0",
5
+ "version": "1.222.2",
6
6
  "activation": {
7
7
  "onCapabilities": [
8
8
  "hook"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "1.222.0",
3
+ "version": "1.222.2",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",