principles-disciple 1.222.1 → 1.222.3

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.
@@ -27,6 +27,16 @@ export declare function alignActivationIds(principles: ReadonlyArray<{
27
27
  principleId: string;
28
28
  activationId?: string;
29
29
  }>, injectedIds: ReadonlySet<string>): string[];
30
+ /**
31
+ * Filter a candidate list down to the actually-injected subset, deduped by
32
+ * principleId in first-occurrence order (PRI-537). Callers derive every
33
+ * paired field (principleId/activationId/artifactId) from this single list,
34
+ * so index alignment cannot drift between them. Supersedes per-field helpers
35
+ * like alignActivationIds for new call sites.
36
+ */
37
+ export declare function alignInjectedPrinciples<T extends {
38
+ principleId: string;
39
+ }>(principles: ReadonlyArray<T>, injectedIds: ReadonlySet<string>): T[];
30
40
  /**
31
41
  * Presence rows for a prompt injection event — one per principle, deduped per
32
42
  * session×principle by the partial unique index (restarts included).
@@ -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;
@@ -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.1",
5
+ "version": "1.222.3",
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.1",
5
+ "version": "1.222.3",
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.1",
3
+ "version": "1.222.3",
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",