principles-disciple 2.2.3 → 2.2.4

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.
@@ -1,5 +1,4 @@
1
- import type { PainIngressDecision } from '@principles/host-runtime';
2
- import type { PainEvidenceEntry } from '@principles/core/runtime-v2';
1
+ import type { PainEvidenceEntry, PainIngressDecision } from '@principles/core/runtime-v2';
3
2
  import type { WorkspaceContext } from '../core/workspace-context.js';
4
3
  export interface PluginIngressInput {
5
4
  wctx: WorkspaceContext;
@@ -9,7 +9,9 @@
9
9
  * - Knows about OpenClaw hook conventions (sessionId, toolName, etc.)
10
10
  *
11
11
  * PRI-651-B1: hooks are Gate B only — this adapter feeds TriggerController.
12
- * Gate A (evaluatePainDiagnosticGate) retired from runtime; remains archived.
12
+ * Gate A (evaluatePainDiagnosticGate) was retired from runtime; its archived
13
+ * plugin adapter and core policy were removed on 2026-10-27. Gate B
14
+ * (TriggerController) is the only admission authority.
13
15
  * Core only sees SourceKind and TriageResult.
14
16
  *
15
17
  * ERR checklist:
@@ -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": "2.2.3",
5
+ "version": "2.2.4",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
@@ -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": "2.2.3",
5
+ "version": "2.2.4",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
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",
@@ -76,7 +76,7 @@
76
76
  "sync-plugin": "node scripts/sync-plugin.mjs"
77
77
  },
78
78
  "devDependencies": {
79
- "@principles/host-runtime": "^0.13.3",
79
+ "@principles/host-runtime": "^0.13.4",
80
80
  "@types/better-sqlite3": "^9.6.0",
81
81
  "@types/js-yaml": "^4.0.9",
82
82
  "@types/micromatch": "^4.0.10",
@@ -102,7 +102,7 @@
102
102
  }
103
103
  },
104
104
  "dependencies": {
105
- "@principles/core": "^1.297.1",
105
+ "@principles/core": "^1.297.2",
106
106
  "@sinclair/typebox": "^0.34.52",
107
107
  "better-sqlite3": "^13.0.3",
108
108
  "commander": "^12.0.0",
@@ -1,47 +0,0 @@
1
- /**
2
- * Pain Diagnostic Gate — PRI-446 thin adapter
3
- *
4
- * @deprecated PRI-454 — Gate A (PainDiagnosticGate) is superseded by Gate B
5
- * (TriggerController + EvidenceTriage). Do not add new callers. New admission
6
- * logic must use `evaluateTriggerController` from runtime-v2/evidence-triage.
7
- *
8
- * Reality note (PRI-763, 2026-09-12): the `painEvidenceAdmission` /
9
- * `painEvidenceAdmissionDefault` flags were RETIRED and REMOVED from the
10
- * registry (PRI-763) — they never re-activated this module and had zero
11
- * executable consumers (PRI-651-B1 / PRI-752 / PRI-762). Gate B
12
- * (TriggerController) is the only admission authority. This adapter keeps
13
- * ZERO production importers; only tests import it. The module itself is left
14
- * archived (Phase 5 discipline: core export surface and plugin shim are not
15
- * removed in the flag-contract PR — retirement of this module is a separate
16
- * Owner decision).
17
- *
18
- * The pure decision logic (threshold tree, cooldown comparison, episode-key
19
- * construction) now lives in principles-core
20
- * (runtime-v2/pain-gate/pain-diagnostic-gate-policy.ts). This file is the
21
- * stateful adapter that owns:
22
- * - the cooldown Map (lastDiagnosedAtByEpisode)
23
- * - Date.now() injection
24
- * - SystemLogger for unknown-source telemetry
25
- *
26
- * It preserves the original export names (evaluatePainDiagnosticGate,
27
- * isCooldownActiveForEpisode, resetPainDiagnosticGateForTest) for the
28
- * remaining test consumers (auto-entry-gate, characterization, mocks).
29
- *
30
- * ERR checklist:
31
- * - ERR-011: this is a stateful adapter delegating to core pure logic.
32
- */
33
- import { type PainDiagnosticSource, type PainDiagnosticGateReason, type PainDiagnosticGateInput, type PainDiagnosticGateDecision } from '@principles/core/runtime-v2';
34
- export type { PainDiagnosticSource, PainDiagnosticGateReason, PainDiagnosticGateInput, PainDiagnosticGateDecision, };
35
- export declare function resetPainDiagnosticGateForTest(): void;
36
- /**
37
- * Check whether cooldown is currently active for a given episode.
38
- * Used by the trigger controller (PEAT-B2) to align its cooldown decision
39
- * with the PainDiagnosticGate's cooldown state.
40
- */
41
- export declare function isCooldownActiveForEpisode(source: string, sessionId: string | undefined, errorHash: string | undefined, cooldownMs?: number): boolean;
42
- /**
43
- * Evaluate the pain diagnostic gate. Delegates the pure decision to core and,
44
- * when the decision is to diagnose, records the current time against the
45
- * episode so subsequent calls within the cooldown window are suppressed.
46
- */
47
- export declare function evaluatePainDiagnosticGate(input: PainDiagnosticGateInput): PainDiagnosticGateDecision;
@@ -1,33 +0,0 @@
1
- /**
2
- * Thinking OS XML Parser
3
- *
4
- * Parses THINKING_OS.md to extract directive definitions.
5
- * The Core Principle Registry in @principles/core (core-principle-registry.ts)
6
- * is the single source of truth for directive ids/names; THINKING_OS.md
7
- * templates mirror it and the drift test enforces alignment (PRI-607).
8
- *
9
- * XML structure:
10
- * <directive id="T-01" name="Survey Before Acting">
11
- * <trigger>...</trigger>
12
- * <must>...</must>
13
- * <forbidden>...</forbidden>
14
- * </directive>
15
- */
16
- export interface ThinkingOsDirective {
17
- id: string;
18
- name: string;
19
- layer: string;
20
- trigger: string;
21
- must: string;
22
- forbidden: string;
23
- }
24
- /**
25
- * Parse THINKING_OS.md content and extract all <directive> blocks.
26
- * Returns empty array if no directives found.
27
- */
28
- export declare function parseThinkingOsMd(content: string): ThinkingOsDirective[];
29
- /**
30
- * Load THINKING_OS.md from the plugin templates for a given language.
31
- * Falls back to the workspace THINKING_OS.md if it exists.
32
- */
33
- export declare function loadThinkingOsFromWorkspace(workspaceDir: string, language?: string): ThinkingOsDirective[];
@@ -1,72 +0,0 @@
1
- /**
2
- * WorkflowFunnelLoader — Loads and watches workflows.yaml as the SSOT
3
- * for WORKFLOW_FUNNELS definition table.
4
- *
5
- * D-01: workflows.yaml is the single source of truth (SSOT).
6
- * D-02: workflows.yaml lives in .state/ directory per workspace.
7
- * D-03: Developers manually maintain workflows.yaml (no auto-registration).
8
- * D-04: Code only reads YAML, never writes it.
9
- */
10
- /**
11
- * A single stage in a workflow funnel.
12
- * Policy fields are optional — existing stages without policy fields remain valid.
13
- */
14
- export interface WorkflowStage {
15
- name: string;
16
- eventType: string;
17
- eventCategory: string;
18
- statsField: string;
19
- timeoutMs?: number;
20
- successCriteria?: string;
21
- legacyDisabled?: boolean;
22
- observability?: {
23
- enabled?: boolean;
24
- emitEvents?: string[];
25
- };
26
- }
27
- /**
28
- * Funnel-level policy that applies to all stages unless overridden per-stage.
29
- */
30
- export interface FunnelPolicy {
31
- timeoutMs?: number;
32
- stageOrder?: 'strict' | 'relaxed';
33
- legacyDisabled?: boolean;
34
- observability?: {
35
- enabled?: boolean;
36
- emitEvents?: string[];
37
- logLevel?: 'debug' | 'info' | 'warn' | 'error';
38
- };
39
- }
40
- /**
41
- * A workflow funnel definition.
42
- */
43
- export interface WorkflowFunnel {
44
- workflowId: string;
45
- stages: WorkflowStage[];
46
- policy?: FunnelPolicy;
47
- }
48
- /**
49
- * Root of workflows.yaml schema.
50
- */
51
- export interface WorkflowFunnelConfig {
52
- version: string;
53
- funnels: WorkflowFunnel[];
54
- }
55
- export declare class WorkflowFunnelLoader {
56
- private readonly funnels;
57
- private readonly fullFunnels;
58
- private readonly configPath;
59
- private watchHandle?;
60
- private readonly warnings;
61
- constructor(stateDir: string);
62
- load(): void;
63
- watch(): void;
64
- dispose(): void;
65
- getStages(workflowId: string): WorkflowStage[];
66
- getFunnel(workflowId: string): WorkflowFunnel | undefined;
67
- getAllFunnels(): Map<string, WorkflowStage[]>;
68
- getAllFunnelsWithPolicy(): Map<string, WorkflowFunnel>;
69
- getWarnings(): string[];
70
- getConfigPath(): string;
71
- private cloneFunnel;
72
- }