principles-disciple 3.2.2 → 4.0.0

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.
Files changed (29) hide show
  1. package/dist/bundle.js +529 -468
  2. package/dist/constants/tools.d.ts +8 -1
  3. package/dist/core/experiment-workspace-guard.d.ts +25 -0
  4. package/dist/core/trajectory-retention-trigger.d.ts +13 -0
  5. package/dist/core/trajectory.d.ts +14 -0
  6. package/dist/hooks/gate-block-helper.d.ts +17 -0
  7. package/dist/hooks/gate.d.ts +6 -1
  8. package/dist/host-runtime/openclaw-host-runtime.d.ts +1 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/openclaw.plugin.json +1 -1
  11. package/dist/rulehost-evidence.js +29 -23
  12. package/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +16 -5
  13. package/dist/templates/langs/en/skills/pd-control/SKILL.md +7 -6
  14. package/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +141 -28
  15. package/dist/templates/langs/en/skills/pd-review/SKILL.md +15 -1
  16. package/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +16 -5
  17. package/dist/templates/langs/zh/skills/pd-control/SKILL.md +7 -6
  18. package/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +142 -29
  19. package/dist/templates/langs/zh/skills/pd-review/SKILL.md +15 -1
  20. package/openclaw.plugin.json +1 -1
  21. package/package.json +4 -4
  22. package/templates/langs/en/skills/pd-cli-operator/SKILL.md +16 -5
  23. package/templates/langs/en/skills/pd-control/SKILL.md +7 -6
  24. package/templates/langs/en/skills/pd-pain-signal/SKILL.md +141 -28
  25. package/templates/langs/en/skills/pd-review/SKILL.md +15 -1
  26. package/templates/langs/zh/skills/pd-cli-operator/SKILL.md +16 -5
  27. package/templates/langs/zh/skills/pd-control/SKILL.md +7 -6
  28. package/templates/langs/zh/skills/pd-pain-signal/SKILL.md +142 -29
  29. package/templates/langs/zh/skills/pd-review/SKILL.md +15 -1
@@ -4,20 +4,34 @@ description: 当 Owner 要查看 PD 诊断结果、原则候选或治理状态
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
+
7
9
  # PD Review
8
10
 
9
11
  ## 目标
10
12
 
11
13
  帮助 Owner 查看真实证据并进入 PD 正式治理界面。技能可以查询、解释和打开 Console,但不能代替 Owner 决策。
12
14
 
15
+ ## 工作区
16
+
17
+ 使用当前 OpenClaw 宿主/插件上下文提供的权威工作区。命令要求 `--workspace` 时传入已确认的绝对路径。无法确定工作区就先报告阻塞,不要从当前目录、最近目录或其他宿主猜测。
18
+
13
19
  ## 流程
14
20
 
15
21
  1. 确认目标是 PD 的痛苦、诊断、候选或原则治理,而不是普通代码评审。
16
22
  2. 使用 `pd-cli-operator` 或已有真实回执核对状态。区分 Owner 原话、宿主轨迹、模型诊断、准入决定和已发生的治理动作。
17
- 3. 使用当前 OpenClaw 宿主确认的工作区打开 Console:`pd console open --workspace "<workspace>"`。不要猜测工作区。
23
+ 3. 按下文「打开 Console」给出的宿主方式启动 Console,不要猜测工作区。
18
24
  4. 只有命令真实返回成功时才报告 Console 已启动。若失败,保留错误并转交 `pd-control` 排查宿主安装。
19
25
  5. 告知 Owner 在 Console 中查看证据并亲自完成批准、拒绝或其他治理操作。
20
26
 
27
+ ## 打开 Console
28
+
29
+ 使用当前 OpenClaw 宿主确认的工作区打开 Console:
30
+
31
+ pd console open --workspace "<workspace>"
32
+
33
+ 不要猜测工作区。
34
+
21
35
  ## 状态边界
22
36
 
23
37
  - 候选存在不代表已批准。
@@ -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": "3.2.2",
5
+ "version": "4.0.0",
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": "3.2.2",
3
+ "version": "4.0.0",
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,8 +76,8 @@
76
76
  "compile-principles": "node scripts/compile-principles.mjs"
77
77
  },
78
78
  "devDependencies": {
79
- "@principles/core": "^7.3.3",
80
- "@principles/host-runtime": "^3.4.1",
79
+ "@principles/core": "^7.5.0",
80
+ "@principles/host-runtime": "^4.0.0",
81
81
  "@types/better-sqlite3": "^9.6.0",
82
82
  "@types/js-yaml": "^4.0.9",
83
83
  "@types/micromatch": "^4.0.10",
@@ -109,5 +109,5 @@
109
109
  "js-yaml": "^5.4.3",
110
110
  "micromatch": "^4.0.8"
111
111
  },
112
- "gitHead": "1851ac671ffc4391a0e732af2bca991e199d483e"
112
+ "gitHead": "95d49f9eae5bf499fc8e4f36fecb0ad5a490f05b"
113
113
  }
@@ -1,21 +1,31 @@
1
1
  ---
2
2
  name: pd-cli-operator
3
- description: Use for read-only PD health checks, querying pains/tasks/runs/candidates/artifacts, tracing pain-to-principle evidence, or diagnosing PD CLI and Runtime issues. Do not use for pain registration, Owner governance review, or host setup/control.
3
+ description: Use for read-only PD health checks, querying pains/tasks/runs/candidates/artifacts, checking governance switches and worker liveness, tracing pain-to-principle evidence, or diagnosing PD CLI and Runtime issues. Do not use for pain registration, Owner governance review, or host setup/control.
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
+
7
9
  # PD CLI Operator
8
10
 
9
11
  Use the existing PD CLI to inspect facts and locate pipeline breaks. This skill routes operations; it does not implement a second business logic path.
10
12
 
13
+ ## Workspace
14
+
15
+ Use the authoritative workspace supplied by the current OpenClaw host/plugin context. When a command requires `--workspace`, pass the confirmed absolute path. If the workspace is unknown, report the blocker instead of guessing from the current directory or another host.
16
+
11
17
  ## Workflow
12
18
 
13
- 1. **Resolve the workspace.** Use the authoritative workspace supplied by the current OpenClaw host/plugin context. When a command requires `--workspace`, pass the confirmed absolute path. If the workspace is unknown, report the blocker instead of guessing from the current directory or another host.
19
+ 1. **Resolve the workspace.** Follow the host rule in the Workspace section above. If the workspace is unknown, report the blocker instead of guessing from the current directory or another host.
14
20
  2. **Discover actual commands.** Start with `pd --help`, then inspect the target command's `--help`. The installed CLI is authoritative.
15
21
  3. **Prefer read-only inspection.** Choose the smallest set of queries that answers the question; do not scan unrelated workspaces.
16
22
  4. **Trace each stage.** Verify pain registration, diagnostic task, run result, candidate, admission, and Owner governance separately. Never infer that the whole chain completed from one status field.
17
23
  5. **Report evidence.** Separate confirmed facts, unknowns, the blocked stage, and next steps. Distinguish command success from business success.
18
24
 
25
+ ## Host integration self-check
26
+
27
+ OpenClaw's `/pd-status` primarily reports host status such as GFI/Pain dictionary; it is not a substitute for Runtime health or tracing a specific task.
28
+
19
29
  ## Common read-only commands
20
30
 
21
31
  Confirm that the installed CLI supports a command before running it:
@@ -28,8 +38,6 @@ Confirm that the installed CLI supports a command before running it:
28
38
  - Task and run: `pd task show "<taskId>" --workspace "<workspace>" --json`, `pd run show "<runId>" --workspace "<workspace>"`
29
39
  - Candidates and artifacts: `pd candidate list --task-id "<taskId>" --workspace "<workspace>" --json`, `pd candidate show "<candidateId>" --workspace "<workspace>" --json`, `pd artifact show "<artifactId>" --workspace "<workspace>" --json`
30
40
 
31
- OpenClaw's `/pd-status` primarily reports host status such as GFI/Pain dictionary; it is not a substitute for Runtime health or tracing a specific task.
32
-
33
41
  ## Recall a principle's historical pains
34
42
 
35
43
  Use `pd pain recall` when the principle text alone is not enough: you are unsure why the principle exists, what its trigger boundary is, or whether the current situation matches the original failure. Do not call it when the principle is already clear or the task is unrelated to its history — it only adds latency.
@@ -52,12 +60,13 @@ Reading the result:
52
60
  - Task creation does not prove diagnosis completed.
53
61
  - Candidate generation does not prove admission; inspect the actual admission decision and corresponding ledger evidence.
54
62
  - Admission does not prove Owner approval or activation; opening the Console does not prove a governance decision was made.
63
+ - A registered worker is not a running worker; an installed plugin is not a loaded skill; a passing health check does not prove that a particular pain was diagnosed.
55
64
 
56
65
  ## Writes and failures
57
66
 
58
67
  This skill is read-only by default. Before any retry, recovery, repair, or other side effect, confirm user intent, command help, eligibility, and impact. Use dry-run first when supported and read back the resulting state afterward. Do not blindly retry commands that may have side effects.
59
68
 
60
- When the CLI is unavailable, preserve the actual error and distinguish missing installation, uninitialized workspace, insufficient permissions, and Runtime failure. Route host installation, initialization, disablement, or recovery to `pd-control`.
69
+ When the CLI is unavailable, preserve the actual error and distinguish missing installation, uninitialized workspace, insufficient permissions, and Runtime failure. Route host installation, initialization, disablement, or recovery to `pd-control`; candidate review to `pd-review`; and Owner feedback registration to `pd-pain-signal`.
61
70
 
62
71
  ## Never
63
72
 
@@ -66,3 +75,5 @@ When the CLI is unavailable, preserve the actual error and distinguish missing i
66
75
  - Fabricate runtime evidence or present a hypothesis as a confirmed root cause.
67
76
  - Approve, reject, or activate a principle through CLI, scripts, or another skill.
68
77
  - Treat exit code 0 as automatic proof of business success.
78
+ - Initialize a project directory or switch to another host's governance store.
79
+ - Describe worker registration or plugin presence as real execution or effective behavior.
@@ -4,15 +4,15 @@ description: Use when the Owner explicitly requests installation, initialization
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
+
7
9
  # PD Control
8
10
 
9
11
  ## Purpose
10
12
 
11
- Manage PD integration through the official installer and host management surface. This skill is a constrained router; it does not duplicate installer logic or mutate principle, candidate, task, or ledger state.
12
-
13
- ## Current OpenClaw support
13
+ Manage PD integration through the official installer and host management surface. This skill is a constrained router; it does not duplicate installer logic or mutate principle, candidate, task, or ledger state. Only perform an operation explicitly requested by the Owner.
14
14
 
15
- ### Install or initialize
15
+ ## Install or initialize
16
16
 
17
17
  Only when the Owner explicitly requests installation/initialization, use the documented non-interactive installer:
18
18
 
@@ -20,7 +20,7 @@ Only when the Owner explicitly requests installation/initialization, use the doc
20
20
 
21
21
  Check the installed version's help and prerequisites first. Do not claim success when authorization, network, or dependency requirements are missing. After installation, use `pd-cli-operator` for a read-only health check.
22
22
 
23
- ### Disable
23
+ ## Disable
24
24
 
25
25
  Only when the Owner explicitly requests disablement, run:
26
26
 
@@ -28,7 +28,7 @@ Only when the Owner explicitly requests disablement, run:
28
28
 
29
29
  This uses OpenClaw's official plugin-management route and does not delete installed files. Then inspect `openclaw plugins list --enabled --json` and confirm `principles-disciple` is no longer enabled. When a Gateway is running, the command applies the state change through that Gateway; distinguish a disabled switch from proof that every previously started task has stopped.
30
30
 
31
- ### Enable or resume
31
+ ## Enable or resume
32
32
 
33
33
  Only when the Owner explicitly requests enablement, run:
34
34
 
@@ -48,3 +48,4 @@ Distinguish installer success, host plugin discovery, actual Hook execution, and
48
48
  - Overwrite user configuration or delete business data to disable PD.
49
49
  - Approve, reject, or activate principles through CLI, scripts, or another skill.
50
50
  - Report an unverified host operation as successful.
51
+ - Describe installation, registration, or configuration presence as PD being actually enabled.
@@ -1,45 +1,158 @@
1
1
  ---
2
2
  name: pd-pain-signal
3
- description: Use when the Owner explicitly asks to record an agent behavior problem, register a pain signal, or trace whether feedback entered the diagnostic pipeline. Automatic pain detection remains the responsibility of existing hooks, host entrypoints, and Runtime.
3
+ description: Register an anchored behavior deviation (Pain) from the current OpenClaw conversation. Use when the Owner explicitly asks to record a concrete behavior problem and you can name the anchor. The anchored write goes through the PD MCP tool pd_submit_pain; never submit in the background and never invent an anchor.
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
- # PD Pain Signal
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
8
 
9
- ## Purpose
9
+ # PD Pain Signal (OpenClaw)
10
10
 
11
- Send the Owner's real behavior feedback through the existing PD pain-registration and diagnosis pipeline while preserving the original statement, source, and available session evidence. This skill does not reimplement detection, deduplication, admission, or diagnosis.
11
+ Pain = a concrete behavior deviation relative to a named anchor. Three elements must hold together:
12
12
 
13
- ## Steps
13
+ 1. **Anchor** — an Owner expectation, an established principle, or an in-force Agent Instruction / Skill requirement.
14
+ 2. **Concrete behavior** — what you actually did or failed to do.
15
+ 3. **Significant deviation** — a describable gap against that anchor.
14
16
 
15
- 1. **Check whether it was already recorded.** The current message may already have been handled by a hook or host entrypoint. If a real receipt exists, reuse its pain/task IDs. Do not submit a duplicate. If registration is not observable, do not claim success or blindly retry.
16
- 2. **Preserve the Owner's words.** Use only a statement the Owner explicitly provided. Do not add a technical root cause, score, or tool-failure fact. Quoted text, tool output, and model paraphrases must not be presented as a new Owner submission.
17
- 3. **Use the trusted host entrypoint.**
18
- - In the OpenClaw session where the issue occurred, when the Owner explicitly requests registration, use the host command `/pd-pain <issue description>`. OpenClaw binds the authenticated current session.
19
- - Outside the session, use the CLI only with a known, validated session: `pd pain record --reason "<reason>" --workspace "<workspace>" --session "<session-id>" --json`.
20
- 4. **Do not guess session IDs.** Never scan the database, pick the "latest" session, or substitute another host's ID. If the required session identity is missing, stop that CLI path and explain why.
21
- 5. **Verify the receipt.** Report registration only when the actual receipt confirms it. Without a receipt, say registration is unconfirmed.
17
+ No proven impact, no repetition and no prior Owner correction are NOT reasons to withhold a submission. They only help the Owner decide attention priority.
22
18
 
23
- ## Evidence and success criteria
19
+ ## Entry 1 — native host entry: `/pd-pain` (Owner-initiated, not yours)
24
20
 
25
- - A real pain ID proves only that registration returned a receipt, not that diagnosis completed.
26
- - Generated candidates are not necessarily admitted.
27
- - Check the actual `admissionResults` / `candidateOutcomes` for an `admitted` decision and its non-empty `ledgerEntryIds`. A non-empty `candidateIds` alone is not success.
28
- - Report `needs_evidence`, `deferred`, and explicit admission rejection honestly. Never bypass the admission gate or fabricate trajectory evidence to increase confidence.
29
- - The Owner's statement, host trajectory, model diagnosis, admission result, Owner approval, and activation state are distinct evidence types.
21
+ The Owner runs:
30
22
 
31
- ## Failure handling
23
+ /pd-pain <description>
32
24
 
33
- - Registration failure: preserve the real error and the host-provided next action.
34
- - Duplicate risk: check existing receipts and idempotency first.
35
- - Missing or untrusted session: stop; never guess.
36
- - CLI/hook unavailable: ask `pd-cli-operator` to inspect status; route installation repair to `pd-control`.
37
- - If the Owner wants to inspect resulting candidates, use `pd-review` to open the Console; do not re-register the same feedback.
25
+ OpenClaw dispatches the plugin command with the authenticated current session and writes the signal itself. Rules:
26
+
27
+ - Do not simulate the command, do not call it on the Owner's behalf, and do not register the same message a second time.
28
+ - If you can see a real receipt, report only the identifiers and status it actually returned.
29
+ - If the Owner asks you to register a signal but did not run the command, use Entry 2 (when the tool is available) or explain why you cannot.
30
+
31
+ ## Entry 2 — anchored submission: MCP tool `pd_submit_pain`
32
+
33
+ Check your tool list first.
34
+
35
+ - If `pd_submit_pain` is available, call it with the four possible arguments below.
36
+ - If it is not in your tool list, the anchored write capability is NOT enabled in this deployment. Stop: do not call a look-alike tool, do not compose a CLI write with guessed lineage, do not claim a submission happened. Tell the Owner the capability is unavailable, and point them at Entry 1 if they still want the signal recorded.
37
+
38
+ | argument | required | contract |
39
+ |---|---|---|
40
+ | `reason` | yes | 1–2000 characters, organized as the six parts below |
41
+ | `anchorType` | yes | `owner_expectation` / `established_principle` / `agent_instruction` |
42
+ | `anchorRef` | yes | 1–300 characters, format depends on anchor type |
43
+ | `painType` | no | `principle_deviation` / `tool_failure` / `subagent_error` / `user_frustration` |
44
+
45
+ The schema is strict. `score`, `severity`, `priority`, `sessionId`, `approved`, file paths and metadata are rejected before anything is written.
46
+
47
+ ## Anchors
48
+
49
+ Pick exactly one type. `anchorRef` must let another reader find the requirement.
50
+
51
+ ### `owner_expectation`
52
+
53
+ The Owner stated it — in this conversation, in an Owner document, or in an approved decision. `anchorRef` names where, e.g. `本次对话 14:02 Owner: "..."` or `docs/xxx.md §2`.
54
+
55
+ - Never submit an Owner expectation you can only recall. If there is no citable location, ask the Owner or do not submit.
56
+
57
+ ### `established_principle`
58
+
59
+ `anchorRef` MUST be `<principleId>@<version>` (e.g. `P-42@1`). Get both from `pd principle list`; never guess or infer the version.
60
+
61
+ The server verifies existence, version and status:
62
+
63
+ - `active` or `probation` → usable as the basis of a deviation.
64
+ `probation` returns an `anchor_probation` warning: the deviation is valid, the principle is still being validated.
65
+ - `candidate`, `archived`, `deprecated` → not usable as a basis; background only.
66
+
67
+ The server checks existence/version/status only. **Scope applicability and priority conflicts are not machine-checkable here.** If you cannot establish that the principle applies to this situation, say "适用性待确认" in `reason` instead of presenting it as settled.
68
+
69
+ ### `agent_instruction`
70
+
71
+ `anchorRef` MUST be `<path>#<section>` and MUST NOT contain spaces, e.g. `AGENTS.md#verification`. It must point at a requirement in force for the current host (AGENTS.md, PRINCIPLES.md, SKILL.md, tool guide).
72
+
73
+ ### No anchor
74
+
75
+ If you cannot classify the anchor into one of the three types, do not submit. Clarify with the Owner first.
76
+
77
+ ## `reason` — six parts, in this order
78
+
79
+ 1. **Anchor** — quote or name it (principle id@version, instruction path#section, Owner statement + location).
80
+ 2. **Anchor source and citation grade** — `verbatim` / `paraphrase` / `recollection` / `inference`. Do not upgrade the grade. A `recollection` or `inference` alone is not enough: confirm the wording with the Owner first.
81
+ 3. **Observed behavior** — specific actions, order, skipped steps, overreach. Not "the quality was poor".
82
+ 4. **Deviation** — the gap against the anchor: not done / done backwards / done but bypassed.
83
+ 5. **Why worth recording** (auxiliary) — helps the Owner prioritize. It is NOT an admission condition and must never be used to reject an otherwise valid Pain.
84
+ 6. **Context** — where and when it happened, bounded.
85
+
86
+ Never hide a conflicting anchor. Never inflate the deviation to make it easier to accept. Never turn part 5 into a threshold.
87
+
88
+ ## Authorization — one submission only
89
+
90
+ Before calling the tool, state to the Owner:
91
+
92
+ 1. the anchor and where it comes from;
93
+ 2. the concrete behavior you observed;
94
+ 3. the deviation between them;
95
+ 4. optionally, why it may matter.
96
+
97
+ Then obtain the Owner's explicit consent **in the current conversation**.
98
+
99
+ - No reply, an ambiguous answer, or a bare "whatever" is NOT authorization.
100
+ - If the Owner edits the content, re-confirm the final version before submitting.
101
+ - The authorization covers this one submission only. Never reuse it for another Pain, another session, or a retry with changed content.
102
+ - Background, scheduled, hook-driven and unattended runs MUST NOT submit on their own.
103
+
104
+ ## Severity and `painType`
105
+
106
+ - Never send a score or severity. The tool has no such parameter, and the system records an omitted severity as **moderate**. You cannot self-elevate; if you think the case is severe, say so inside `reason` for the Owner to judge.
107
+ - Omit `painType` unless you can classify it with confidence. The default is `principle_deviation`.
108
+ - The default is only valid with an `established_principle` anchor: a `principle_deviation` submission without a principle reference is refused (`anchor_invalid`, "principle_deviation requires deviationAnchor{...}"). With `owner_expectation` or `agent_instruction`, pass an explicit and honest pain type (e.g. `tool_failure`); if none fits, say so to the Owner instead of guessing.
109
+ - Never backfill `user_frustration` (or any other type) to make a submission look more urgent.
110
+
111
+ ## Reading the receipt
112
+
113
+ The tool returns one JSON receipt (`pd.pain-submit-receipt.v1`):
114
+
115
+ ```
116
+ status, painId, taskId, workspaceDir, diagnosis, anchor, provenance, warnings, error, nextAction
117
+ ```
118
+
119
+ | status | meaning | what you do |
120
+ |---|---|---|
121
+ | `submitted` | the pain and its diagnosis task were written | report `painId` / `taskId`. `diagnosis.status` is `pending`: diagnosis has NOT run |
122
+ | `refused` | nothing was written (for `task_duplicate`, an equivalent task already existed) | report `error.code` + `nextAction`; do not retry blindly |
123
+ | `failed` | the write failed; this is the only status with `isError: true` | report `error.code` / `error.message` / `nextAction`; a task may or may not exist |
124
+ | `submit_unconfirmed` | the write began and its outcome is unknown (deadline or exception) | never resubmit; run `pd task show <taskId>` and reconcile first |
125
+
126
+ `refused` codes you may see: `invalid_input`, `anchor_invalid`, `anchor_unverifiable` (ledger unreadable), `anchor_not_found` (unknown id/version or empty ledger), `anchor_not_currently_valid`, `task_duplicate`, `ingress_*`.
127
+
128
+ Degraded transports:
129
+
130
+ - `minimal` — the receipt was reduced to `status / painId / taskId / workspaceDir / diagnosis`.
131
+ - `untransportable` — a plain-text statement, or an `isError: true` envelope. An unknown outcome is always reported as UNKNOWN, never as "nothing was written".
132
+
133
+ Report only the identifiers and status the receipt actually returned. Registration is not diagnosis, not candidate admission, not approval, not activation.
134
+
135
+ ## Operator recovery (post-hoc, never the Agent default)
136
+
137
+ When the Owner's turn is already over and a trusted OpenClaw session identity is available, an operator may run:
138
+
139
+ pd pain record --reason "<summary>" --host openclaw --session "<verified session-id>" --workspace "<workspace>" --json
140
+
141
+ - Every CLI record invocation MUST bind `--session`. A record without `--session` carries no trajectory evidence and will be gated by admission (`needs_evidence`).
142
+ - Never guess, scan for, or substitute a session ID, and never pick the "latest" session. If the identity is unverified, stop and say so.
143
+ - Do not present this path as the anchored contract: it carries no `anchorType` / `anchorRef`.
144
+
145
+ ## Verify downstream state
146
+
147
+ Use `pd-cli-operator` to inspect the actual task and evidence chain. If diagnosis produced candidates, verify admission using the actual `admissionResults` / `admitted` decision and the corresponding non-empty `ledgerEntryIds`; a non-empty `candidateIds` alone is not success. Report `needs_evidence` or a rejection honestly. Use `pd-review` to open the Owner Console.
38
148
 
39
149
  ## Never
40
150
 
151
+ - Submit without an explicit Owner request and consent in the current message.
152
+ - Submit from a background, scheduled, hook or unattended run.
153
+ - Invent an anchor, a principle id@version, an Instructions path, or an Owner quote.
154
+ - Send score, severity, priority, session ids or approval tokens.
155
+ - Bypass an unavailable `pd_submit_pain` with a CLI write using guessed lineage, a local switch, or a host matcher.
156
+ - Resubmit after `submit_unconfirmed` without reconciling via `pd task show <taskId>`.
41
157
  - Write `.state/.pain_flag` or call legacy `write_pain_flag`.
42
- - Fabricate the Owner's words, session ID, turn ID, or tool failure.
43
- - Re-submit an event whose registration is confirmed.
44
- - Modify the pain database, candidate ledger, or admission state directly.
45
- - Approve, activate, or edit a principle.
158
+ - Approve, activate or modify a principle.
@@ -4,20 +4,34 @@ description: Use when the Owner wants to inspect PD diagnoses, principle candida
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
+
7
9
  # PD Review
8
10
 
9
11
  ## Purpose
10
12
 
11
13
  Help the Owner inspect real evidence and reach the official PD governance interface. The skill may query, explain, and open the Console, but it cannot make the decision for the Owner.
12
14
 
15
+ ## Workspace
16
+
17
+ Use the authoritative workspace supplied by the current OpenClaw host/plugin context. When a command requires `--workspace`, pass the confirmed absolute path. If the workspace is unknown, report the blocker instead of guessing from the current directory or another host.
18
+
13
19
  ## Workflow
14
20
 
15
21
  1. Confirm the task concerns PD pain, diagnosis, candidates, or principle governance—not ordinary code review.
16
22
  2. Use `pd-cli-operator` or an existing real receipt to verify state. Distinguish the Owner's statement, host trajectory, model diagnosis, admission decision, and completed governance action.
17
- 3. Open the Console using the workspace confirmed by the current OpenClaw host: `pd console open --workspace "<workspace>"`. Never guess the workspace.
23
+ 3. Start the Console through the host method in "Open the Console" below; never guess the workspace.
18
24
  4. Report that the Console started only when the command returns real success. If it fails, preserve the error and route host-installation diagnosis to `pd-control`.
19
25
  5. Ask the Owner to inspect the evidence and personally complete approval, rejection, or another governance action in the Console.
20
26
 
27
+ ## Open the Console
28
+
29
+ Open the Console using the workspace confirmed by the current OpenClaw host:
30
+
31
+ pd console open --workspace "<workspace>"
32
+
33
+ Never guess the workspace.
34
+
21
35
  ## State boundaries
22
36
 
23
37
  - A candidate's existence does not mean it was approved.
@@ -1,21 +1,31 @@
1
1
  ---
2
2
  name: pd-cli-operator
3
- description: 当需要只读检查 PD 运行健康、查询痛苦/任务/运行/候选/工件,或追踪痛苦到原则的证据链时使用。用于 PD CLI 与 Runtime 排障;不用于登记痛苦、Owner 治理审阅或宿主管理。
3
+ description: 当需要只读检查 PD 运行健康、查询痛苦/任务/运行/候选/工件,检查治理开关与 worker 活性,或追踪痛苦到原则的证据链时使用。用于 PD CLI 与 Runtime 排障;不用于登记痛苦、Owner 治理审阅或宿主管理。
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
+
7
9
  # PD CLI Operator
8
10
 
9
11
  通过现有 PD CLI 查询事实、定位链路断点,并给出基于证据的结论。本技能只负责操作路由,不实现第二套业务逻辑。
10
12
 
13
+ ## 工作区
14
+
15
+ 使用当前 OpenClaw 宿主/插件上下文提供的权威工作区。命令要求 `--workspace` 时传入已确认的绝对路径。无法确定工作区就先报告阻塞,不要从当前目录、最近目录或其他宿主猜测。
16
+
11
17
  ## 工作流程
12
18
 
13
- 1. **确认工作区。** 使用当前 OpenClaw 宿主/插件上下文提供的权威工作区。命令要求 `--workspace` 时传入已确认的绝对路径。无法确定工作区就先报告阻塞,不要从当前目录、最近目录或其他宿主猜测。
19
+ 1. **确认工作区。** 按上文「工作区」一节的宿主规则取权威工作区。无法确定工作区就先报告阻塞,不要从当前目录、最近目录或其他宿主猜测。
14
20
  2. **发现真实命令。** 先检查 `pd --help`,再检查目标命令的 `--help`。命令名和参数以当前安装版本为准。
15
21
  3. **优先只读检查。** 按问题选择最少的查询命令,不遍历无关工作区。
16
22
  4. **逐段追踪。** 分别核实痛苦登记、诊断任务、运行结果、候选、准入和 Owner 治理结果,不由单个状态字段推断整条链路已完成。
17
23
  5. **报告证据。** 说明已确认事实、未知部分、阻塞层和下一步;区分命令成功与业务目标成功。
18
24
 
25
+ ## 宿主接入自检
26
+
27
+ OpenClaw 的 `/pd-status` 主要展示 GFI/Pain 词典等宿主状态,不应代替 Runtime 健康检查或具体任务追踪。
28
+
19
29
  ## 常用只读命令
20
30
 
21
31
  先确认当前 CLI 支持这些命令,再按需执行:
@@ -28,8 +38,6 @@ disable-model-invocation: false
28
38
  - 任务与运行:`pd task show "<taskId>" --workspace "<workspace>" --json`、`pd run show "<runId>" --workspace "<workspace>"`
29
39
  - 候选与工件:`pd candidate list --task-id "<taskId>" --workspace "<workspace>" --json`、`pd candidate show "<candidateId>" --workspace "<workspace>" --json`、`pd artifact show "<artifactId>" --workspace "<workspace>" --json`
30
40
 
31
- OpenClaw 的 `/pd-status` 主要展示 GFI/Pain 词典等宿主状态,不应代替 Runtime 健康检查或具体任务追踪。
32
-
33
41
  ## 按需召回原则的历史痛苦
34
42
 
35
43
  当原则文本本身不够用——不确定它为何存在、触发边界是什么、或当前情况是否与当初的失败相似——使用 `pd pain recall`。原则已经清楚或任务与其历史无关时不要调用,那只会增加延迟。
@@ -52,12 +60,13 @@ OpenClaw 的 `/pd-status` 主要展示 GFI/Pain 词典等宿主状态,不应
52
60
  - 任务创建不等于诊断完成。
53
61
  - 候选生成不等于通过准入;必须检查实际 admission 决策及对应账本证据。
54
62
  - 准入成功不等于 Owner 已批准或原则已激活;打开 Console 也不等于完成治理决定。
63
+ - worker 已注册不等于 worker 正在运行;插件存在不等于技能已加载;健康检查通过不等于某条痛苦已经完成诊断。
55
64
 
56
65
  ## 写操作与失败
57
66
 
58
67
  本技能默认只读。若需要重试、恢复、修复或其他有副作用的操作,先确认用户意图、命令帮助、资格条件和影响范围;支持时先 dry-run,执行后读回真实状态。不要盲目重试可能产生副作用的命令。
59
68
 
60
- CLI 不可用时,保留真实错误并区分未安装、工作区未初始化、权限不足与 Runtime 故障。需要安装、初始化、停用或恢复宿主接入时转交 `pd-control`。
69
+ CLI 不可用时,保留真实错误并区分未安装、工作区未初始化、权限不足与 Runtime 故障。需要安装、初始化、停用或恢复宿主接入时转交 `pd-control`;需要审阅候选时转交 `pd-review`;需要登记 Owner 反馈时转交 `pd-pain-signal`。
61
70
 
62
71
  ## 禁止
63
72
 
@@ -66,3 +75,5 @@ CLI 不可用时,保留真实错误并区分未安装、工作区未初始化
66
75
  - 不伪造运行证据或把推测写成已确认根因。
67
76
  - 不通过 CLI、脚本或其他技能批准、拒绝或激活原则。
68
77
  - 不将命令退出码为 0 自动等同于业务成功。
78
+ - 不初始化项目目录,不切换到其他宿主的治理库。
79
+ - 不将 worker 注册或插件存在描述为真实运行或行为生效。
@@ -4,15 +4,15 @@ description: 当 Owner 明确要求安装、初始化、停用、重新启用或
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
7
+ <!-- generated by @principles/pd-skills; edit packages/pd-skills/skills/** -->
8
+
7
9
  # PD Control
8
10
 
9
11
  ## 目标
10
12
 
11
- 通过正式安装器和宿主管理机制管理 PD 接入。本技能是受限路由入口,不复制安装器逻辑,也不改变原则、候选、任务或账本状态。
12
-
13
- ## OpenClaw 当前支持方式
13
+ 通过正式安装器和宿主管理机制管理 PD 接入。本技能是受限路由入口,不复制安装器逻辑,也不改变原则、候选、任务或账本状态。只执行 Owner 明确要求的操作。
14
14
 
15
- ### 安装或重新初始化
15
+ ## 安装或初始化
16
16
 
17
17
  仅当 Owner 明确要求安装/初始化时,使用仓库公开的非交互式安装入口:
18
18
 
@@ -20,7 +20,7 @@ disable-model-invocation: false
20
20
 
21
21
  执行前检查当前安装器的帮助和前置条件;不要在缺少授权、网络或依赖条件时声称安装成功。完成后用 `pd-cli-operator` 做只读健康检查。
22
22
 
23
- ### 停用
23
+ ## 停用
24
24
 
25
25
  只有 Owner 明确要求停用时,执行:
26
26
 
@@ -28,7 +28,7 @@ disable-model-invocation: false
28
28
 
29
29
  该命令通过 OpenClaw 正式插件管理入口更改启用状态,不会删除已安装文件。执行后检查 `openclaw plugins list --enabled --json`,确认 `principles-disciple` 不再处于启用列表。若 Gateway 正在运行,命令会通过 Gateway 应用状态变化;仍需区分“开关已关闭”和“此前已启动的任务已全部停止”。
30
30
 
31
- ### 启用或恢复
31
+ ## 启用或恢复
32
32
 
33
33
  只有 Owner 明确要求启用时,执行:
34
34
 
@@ -48,3 +48,4 @@ disable-model-invocation: false
48
48
  - 不覆盖用户配置,不删除业务数据来停用 PD。
49
49
  - 不通过 CLI、脚本或其他技能批准、拒绝或激活原则。
50
50
  - 不将未验证的宿主操作报告为成功。
51
+ - 不将安装、注册或配置存在描述为 PD 已实际启用。