principles-disciple 1.145.1 → 1.145.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.
@@ -78,15 +78,11 @@ export function recordGateBlockAndReturn(wctx, blockCtx, logger) {
78
78
  // so one mild block does not start a long diagnostician run.
79
79
  if (sessionId) {
80
80
  const GATE_BLOCK_PAIN_SCORE = 45; // Must be >= pain_trigger (40) so single gate block can trigger diagnosis (PRI-274)
81
- // Record to trajectory (fire-and-forget, no .pain_flag file needed)
82
- wctx.trajectory?.recordPainEvent?.({
83
- sessionId,
84
- source: 'gate_blocked',
85
- score: GATE_BLOCK_PAIN_SCORE,
86
- reason: `Gate blocked ${toolName} on ${filePath}: ${reason}`,
87
- severity: 'mild',
88
- origin: 'system_infer',
89
- });
81
+ // PRI-453: Generate painId early. SDK observability path (emitPainDetectedEvent
82
+ // with default recordObservability: true) handles all writes: events_*.jsonl +
83
+ // evolution.jsonl + trajectory.db (with canonicalPainId for dedup). No separate
84
+ // legacy recordPainEvent call needed — avoids double-write to trajectory.db.
85
+ const gatePainId = `gate_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`;
90
86
  // PEAT-B1: Evidence triage (feature-flagged)
91
87
  let triageAdmitted = true;
92
88
  const gateBlockTriageFlag = loadFeatureFlagFromConfig(wctx.workspaceDir, 'painEvidenceAdmission');
@@ -142,7 +138,7 @@ export function recordGateBlockAndReturn(wctx, blockCtx, logger) {
142
138
  ts: new Date().toISOString(),
143
139
  type: 'pain_detected',
144
140
  data: {
145
- painId: `gate_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`,
141
+ painId: gatePainId,
146
142
  painType: 'user_frustration',
147
143
  source: 'gate_blocked',
148
144
  reason: `Gate blocked ${toolName} on ${filePath}: ${reason}`,
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
5
- "version": "1.145.1",
5
+ "version": "1.145.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.145.1",
3
+ "version": "1.145.3",
4
4
  "description": "Native OpenClaw plugin for Principles Disciple",
5
5
  "type": "module",
6
6
  "main": "./dist/bundle.js",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pd-cli-operator
3
- description: Use this skill when operating the Principles Disciple `pd` CLI: probing runtime health, manually recording pain, inspecting tasks/runs/candidates/artifacts, intaking candidates, viewing flow policy, or cleaning legacy state. It routes CLI commands safely and forbids direct `.state/.pain_flag` writes.
3
+ description: Use this skill when operating the Principles Disciple `pd` CLI: probing runtime health, manually recording pain, inspecting tasks/runs/candidates/artifacts, intaking candidates, viewing flow policy, or tracing pain-to-ledger chains. It routes CLI commands safely and forbids direct `.state/.pain_flag` writes.
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
@@ -36,6 +36,25 @@ Flow policy:
36
36
  pd runtime flow show --workspace "<workspace>" --json
37
37
  ```
38
38
 
39
+ ## Trace Pain-To-Ledger Chain (PRI-455 promoted)
40
+
41
+ Trace the full evidence chain from pain signal to principle ledger:
42
+ ```bash
43
+ pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
44
+ ```
45
+
46
+ ## Activation Management (PRI-455 promoted)
47
+
48
+ List active activations:
49
+ ```bash
50
+ pd activation list --workspace "<workspace>" --json
51
+ ```
52
+
53
+ Deactivate (rollback) an activation:
54
+ ```bash
55
+ pd activation deactivate --activation-id "<activationId>" --workspace "<workspace>" --json
56
+ ```
57
+
39
58
  ## Inspect Runtime V2 Objects
40
59
 
41
60
  Tasks and runs:
@@ -55,13 +74,3 @@ Manual intake:
55
74
  ```bash
56
75
  pd candidate intake --candidate-id "<candidateId>" --workspace "<workspace>" --json
57
76
  ```
58
-
59
- ## Legacy Admin
60
-
61
- Only when explicitly cleaning old state:
62
- ```bash
63
- pd legacy cleanup --workspace "<workspace>" --dry-run
64
- pd legacy cleanup --workspace "<workspace>" --apply
65
- ```
66
-
67
- Never use legacy cleanup as a diagnosis trigger.
@@ -38,6 +38,16 @@ Flow policy:
38
38
  pd runtime flow show --workspace "<workspace>" --json
39
39
  ```
40
40
 
41
+ Trace pain-to-ledger chain (PRI-455 promoted):
42
+ ```bash
43
+ pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
44
+ ```
45
+
46
+ Activation status (PRI-455 promoted):
47
+ ```bash
48
+ pd activation list --workspace "<workspace>" --json
49
+ ```
50
+
41
51
  Candidates:
42
52
  ```bash
43
53
  pd candidate list --workspace "<workspace>" --json
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pd-cli-operator
3
- description: 操作 Principles Disciple `pd` CLI 时使用:运行时健康检查、手动记录痛苦、查看 task/run/candidate/artifact、intake candidate、查看 flow policy、清理 legacy state。本技能提供安全 CLI 路由,并禁止直接写 `.state/.pain_flag`。
3
+ description: 操作 Principles Disciple `pd` CLI 时使用:运行时健康检查、手动记录痛苦、查看 task/run/candidate/artifact、intake candidate、查看 flow policy、追踪痛苦到原则的证据链。本技能提供安全 CLI 路由,并禁止直接写 `.state/.pain_flag`。
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
@@ -36,6 +36,25 @@ pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
36
36
  pd runtime flow show --workspace "<workspace>" --json
37
37
  ```
38
38
 
39
+ ## 追踪痛苦到原则链(PRI-455 提升)
40
+
41
+ 追踪从痛苦信号到原则账本的完整证据链:
42
+ ```bash
43
+ pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
44
+ ```
45
+
46
+ ## 激活管理(PRI-455 提升)
47
+
48
+ 列出当前激活:
49
+ ```bash
50
+ pd activation list --workspace "<workspace>" --json
51
+ ```
52
+
53
+ 停用(回滚)激活:
54
+ ```bash
55
+ pd activation deactivate --activation-id "<activationId>" --workspace "<workspace>" --json
56
+ ```
57
+
39
58
  ## 查看 Runtime V2 对象
40
59
 
41
60
  Tasks 和 runs:
@@ -55,13 +74,3 @@ pd artifact show --artifact-id "<artifactId>" --workspace "<workspace>" --json
55
74
  ```bash
56
75
  pd candidate intake --candidate-id "<candidateId>" --workspace "<workspace>" --json
57
76
  ```
58
-
59
- ## Legacy 管理
60
-
61
- 只有在明确清理旧状态时使用:
62
- ```bash
63
- pd legacy cleanup --workspace "<workspace>" --dry-run
64
- pd legacy cleanup --workspace "<workspace>" --apply
65
- ```
66
-
67
- 不要把 legacy cleanup 当作诊断触发入口。
@@ -38,6 +38,16 @@ pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
38
38
  pd runtime flow show --workspace "<workspace>" --json
39
39
  ```
40
40
 
41
+ 追踪痛苦到原则链(PRI-455 提升):
42
+ ```bash
43
+ pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
44
+ ```
45
+
46
+ 激活状态(PRI-455 提升):
47
+ ```bash
48
+ pd activation list --workspace "<workspace>" --json
49
+ ```
50
+
41
51
  候选原则:
42
52
  ```bash
43
53
  pd candidate list --workspace "<workspace>" --json