principles-disciple 2.1.10 → 2.1.12
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.
- package/dist/bundle.js +391 -391
- package/dist/core/signal-collector-host.d.ts +17 -1
- package/dist/core/signal-health.d.ts +15 -0
- package/dist/openclaw.plugin.json +1 -1
- package/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +32 -70
- package/dist/templates/langs/en/skills/pd-control/SKILL.md +50 -0
- package/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -56
- package/dist/templates/langs/en/skills/pd-review/SKILL.md +32 -0
- package/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +32 -65
- package/dist/templates/langs/zh/skills/pd-control/SKILL.md +50 -0
- package/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +29 -48
- package/dist/templates/langs/zh/skills/pd-review/SKILL.md +32 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -3
- package/templates/langs/en/skills/pd-cli-operator/SKILL.md +32 -70
- package/templates/langs/en/skills/pd-control/SKILL.md +50 -0
- package/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -56
- package/templates/langs/en/skills/pd-review/SKILL.md +32 -0
- package/templates/langs/zh/skills/pd-cli-operator/SKILL.md +32 -65
- package/templates/langs/zh/skills/pd-control/SKILL.md +50 -0
- package/templates/langs/zh/skills/pd-pain-signal/SKILL.md +29 -48
- package/templates/langs/zh/skills/pd-review/SKILL.md +32 -0
- package/dist/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
- package/dist/templates/langs/en/skills/pd-mentor/SKILL.md +0 -185
- package/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -86
- package/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
- package/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -185
- package/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -81
- package/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
- package/templates/langs/en/skills/pd-mentor/SKILL.md +0 -185
- package/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -86
- package/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
- package/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -185
- package/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -81
|
@@ -107,10 +107,26 @@ export declare class SignalCollectorHost {
|
|
|
107
107
|
*
|
|
108
108
|
* 只入队"词库命中过的歧义候选":零命中的普通消息体量与噪声不可控,其纠正
|
|
109
109
|
* 语义覆盖由 G3 的词库扩充/earned 解锁承担。
|
|
110
|
+
*
|
|
111
|
+
* AUDIT-P2-01: stage2Queued 计数推迟到微任务执行(本方法可从无 await 的
|
|
112
|
+
* 降级分支同步到达);SQLite 入队本身保持同步——它是可靠性要求,不是旁路
|
|
113
|
+
* 观测,微任务/事件循环淘汰不能承担丢候选的风险。
|
|
110
114
|
*/
|
|
111
115
|
private queueUnconfirmedForBatch;
|
|
112
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* PRI-788 G4: 未经确认就消失的候选计数(旁路,失败不阻塞)。
|
|
118
|
+
* AUDIT-P2-01: 推迟到微任务——本计数可从无 await 的降级分支同步到达,
|
|
119
|
+
* 不能把健康文件读改写留在 before_prompt_build 的同步调用栈上。
|
|
120
|
+
*/
|
|
113
121
|
private countStage2Dropped;
|
|
122
|
+
/** AUDIT-P2-02: 入队计数(旁路),与 countStage2Dropped 同理推迟到微任务。 */
|
|
123
|
+
private countStage2Queued;
|
|
124
|
+
/**
|
|
125
|
+
* AUDIT-P2-02: Stage2 分类调用计数(旁路)。realtime 路径的调用点位于
|
|
126
|
+
* detectSync 的同步调用栈上(async 函数体首个 await 前同步执行),批量路径
|
|
127
|
+
* 虽在后台周期内,也复用同一惯例推迟到微任务,保证两种路径计数语义一致。
|
|
128
|
+
*/
|
|
129
|
+
private countStage2Invocation;
|
|
114
130
|
/**
|
|
115
131
|
* PRI-788 G4: stage1Strong 计数(旁路观测),刻意离开同步检测路径。
|
|
116
132
|
*
|
|
@@ -4,6 +4,20 @@ export interface SignalHealthState {
|
|
|
4
4
|
stage2Confirmed: number;
|
|
5
5
|
stage2Queued: number;
|
|
6
6
|
stage2Dropped: number;
|
|
7
|
+
/**
|
|
8
|
+
* AUDIT-P2-02 (2026-10-21): 当日实际发起的 Stage2 LLM 分类调用次数
|
|
9
|
+
* (realtime detectAsyncAndRoute + 批量确认 confirmPendingSignal 都算——
|
|
10
|
+
* 两者都是花同一个 signal classifier 的钱)。计数时点:真正发起 classifier
|
|
11
|
+
* 调用前;降级/空队列/未配置不计数。跨日归零;旧文件缺失按 0 读。
|
|
12
|
+
*/
|
|
13
|
+
stage2Invocations: number;
|
|
14
|
+
/**
|
|
15
|
+
* AUDIT-P2-02 (2026-10-21): 当日因分类器不可用被整批跳过的批量确认次数。
|
|
16
|
+
* 只在「队列非空但 classifier 解析失败」时 +1(空队列不计数——没有工作被
|
|
17
|
+
* 跳过)。让 Owner 能区分「没检测到信号 / 没调用模型 / 队列没被消费」。
|
|
18
|
+
* 跨日归零;旧文件缺失按 0 读。
|
|
19
|
+
*/
|
|
20
|
+
stage2BatchSkipped: number;
|
|
7
21
|
/** 最近一次刷新的队列深度(非计数) */
|
|
8
22
|
pendingCount: number;
|
|
9
23
|
lastStage2SuccessAt: string | null;
|
|
@@ -16,6 +30,7 @@ export interface SignalHealthState {
|
|
|
16
30
|
}
|
|
17
31
|
/**
|
|
18
32
|
* 读健康状态(doctor 用)。文件缺失/损坏返回 null,由读取方呈现 unknown。
|
|
33
|
+
* 旧格式(无 AUDIT-P2-02 新增计数字段)照常解析,缺省字段读作 0。
|
|
19
34
|
*/
|
|
20
35
|
export declare function readSignalHealth(stateDir: string): SignalHealthState | null;
|
|
21
36
|
/**
|
|
@@ -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.1.
|
|
5
|
+
"version": "2.1.12",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -1,90 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pd-cli-operator
|
|
3
|
-
description: Use
|
|
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.
|
|
4
4
|
disable-model-invocation: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# PD CLI Operator
|
|
8
8
|
|
|
9
|
-
Use the
|
|
9
|
+
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
10
|
|
|
11
|
-
##
|
|
11
|
+
## Workflow
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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.
|
|
14
|
+
2. **Discover actual commands.** Start with `pd --help`, then inspect the target command's `--help`. The installed CLI is authoritative.
|
|
15
|
+
3. **Prefer read-only inspection.** Choose the smallest set of queries that answers the question; do not scan unrelated workspaces.
|
|
16
|
+
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
|
+
5. **Report evidence.** Separate confirmed facts, unknowns, the blocked stage, and next steps. Distinguish command success from business success.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
trajectory evidence, candidates likely gated (`needs_evidence`) by the
|
|
21
|
-
admission threshold — the CLI output warns about this.
|
|
22
|
-
- `--session <id>` is validated up front; a missing session fails with
|
|
23
|
-
`session_not_found` before anything is written. When the binding is
|
|
24
|
-
verified but the trajectory evidence is empty or unreadable, the record
|
|
25
|
-
degrades honestly to bound + evidence-unavailable and the admission gate
|
|
26
|
-
decides — no evidence is fabricated.
|
|
27
|
-
- A successful command returning a `painId` is only a record receipt; whether
|
|
28
|
-
the diagnosis produced candidates and whether they were admitted is decided
|
|
29
|
-
by `candidateIds` / `admissionResults` / `ledgerEntryIds` in the JSON
|
|
30
|
-
output. Activation is a separate stage that follows Owner approval.
|
|
19
|
+
## Common read-only commands
|
|
31
20
|
|
|
32
|
-
|
|
33
|
-
- `status` is `succeeded`
|
|
34
|
-
- candidates are ADMITTED, not merely generated: check `admissionResults` /
|
|
35
|
-
`candidateOutcomes` for `admitted` decisions and non-empty `ledgerEntryIds`
|
|
21
|
+
Confirm that the installed CLI supports a command before running it:
|
|
36
22
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
23
|
+
- Health: `pd health --workspace "<workspace>" --json`
|
|
24
|
+
- Runtime probe: `pd runtime probe --runtime pi-ai --workspace "<workspace>" --json`
|
|
25
|
+
- Flow policy: `pd runtime flow show --workspace "<workspace>" --json`
|
|
26
|
+
- Pain list and admission evidence: `pd pain list --workspace "<workspace>" --json`, `pd pain evidence --workspace "<workspace>" --json`
|
|
27
|
+
- Pain-to-principle trace: `pd runtime trace show --pain-id "<painId>" --workspace "<workspace>" --json`
|
|
28
|
+
- Task and run: `pd task show "<taskId>" --workspace "<workspace>" --json`, `pd run show "<runId>" --workspace "<workspace>"`
|
|
29
|
+
- 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`
|
|
40
30
|
|
|
41
|
-
|
|
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.
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
|
|
46
|
-
```
|
|
33
|
+
## Interpret results correctly
|
|
47
34
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
- A `painId` proves only that pain registration returned a receipt.
|
|
36
|
+
- Task creation does not prove diagnosis completed.
|
|
37
|
+
- Candidate generation does not prove admission; inspect the actual admission decision and corresponding ledger evidence.
|
|
38
|
+
- Admission does not prove Owner approval or activation; opening the Console does not prove a governance decision was made.
|
|
52
39
|
|
|
53
|
-
##
|
|
40
|
+
## Writes and failures
|
|
54
41
|
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
|
|
58
|
-
```
|
|
42
|
+
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
43
|
|
|
60
|
-
|
|
44
|
+
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`.
|
|
61
45
|
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pd activation list --workspace "<workspace>" --json
|
|
65
|
-
```
|
|
46
|
+
## Never
|
|
66
47
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Inspect Runtime V2 Objects
|
|
73
|
-
|
|
74
|
-
Tasks and runs:
|
|
75
|
-
```bash
|
|
76
|
-
pd task show --task-id "<taskId>" --json
|
|
77
|
-
pd run show --run-id "<runId>" --json
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Candidates and artifacts:
|
|
81
|
-
```bash
|
|
82
|
-
pd candidate list --workspace "<workspace>" --json
|
|
83
|
-
pd candidate show --candidate-id "<candidateId>" --workspace "<workspace>" --json
|
|
84
|
-
pd artifact show --artifact-id "<artifactId>" --workspace "<workspace>" --json
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Manual intake:
|
|
88
|
-
```bash
|
|
89
|
-
pd candidate intake --candidate-id "<candidateId>" --workspace "<workspace>" --json
|
|
90
|
-
```
|
|
48
|
+
- Edit the database, ledger, configuration, or internal artifacts directly.
|
|
49
|
+
- Write `.state/.pain_flag` or call legacy `write_pain_flag`.
|
|
50
|
+
- Fabricate runtime evidence or present a hypothesis as a confirmed root cause.
|
|
51
|
+
- Approve, reject, or activate a principle through CLI, scripts, or another skill.
|
|
52
|
+
- Treat exit code 0 as automatic proof of business success.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pd-control
|
|
3
|
+
description: Use when the Owner explicitly requests installation, initialization, disablement, re-enablement, or repair of PD host integration. Use only management entrypoints supported by the current host; do not edit configuration or business state directly.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PD Control
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
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
|
|
14
|
+
|
|
15
|
+
### Install or initialize
|
|
16
|
+
|
|
17
|
+
Only when the Owner explicitly requests installation/initialization, use the documented non-interactive installer:
|
|
18
|
+
|
|
19
|
+
npx create-principles-disciple --yes
|
|
20
|
+
|
|
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
|
+
|
|
23
|
+
### Disable
|
|
24
|
+
|
|
25
|
+
Only when the Owner explicitly requests disablement, run:
|
|
26
|
+
|
|
27
|
+
openclaw plugins disable principles-disciple
|
|
28
|
+
|
|
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
|
+
|
|
31
|
+
### Enable or resume
|
|
32
|
+
|
|
33
|
+
Only when the Owner explicitly requests enablement, run:
|
|
34
|
+
|
|
35
|
+
openclaw plugins enable principles-disciple
|
|
36
|
+
|
|
37
|
+
If the command reports capability consent, allowlist, denylist, or another policy block, do not automatically add `--accept-capabilities` and do not edit `openclaw.json` by hand. Preserve the full receipt and explain the required choice or policy issue to the Owner. Continue with the exact retry command returned by OpenClaw only after the Owner explicitly consents to the requested capabilities.
|
|
38
|
+
|
|
39
|
+
Afterward, inspect `openclaw plugins list --enabled --json`, then run `openclaw plugins inspect principles-disciple --runtime --json` to check registered runtime capabilities. A cold inventory or inspect result alone still does not prove a real Hook is effective; when needed, verify with a safe real host event.
|
|
40
|
+
|
|
41
|
+
## Success criteria
|
|
42
|
+
|
|
43
|
+
Distinguish installer success, host plugin discovery, actual Hook execution, and PD business-pipeline health. Each requires its own receipt or runtime evidence. Plugin presence does not prove it is enabled, and installation does not prove Runtime health.
|
|
44
|
+
|
|
45
|
+
## Never
|
|
46
|
+
|
|
47
|
+
- Edit host configuration or PD state files by hand.
|
|
48
|
+
- Overwrite user configuration or delete business data to disable PD.
|
|
49
|
+
- Approve, reject, or activate principles through CLI, scripts, or another skill.
|
|
50
|
+
- Report an unverified host operation as successful.
|
|
@@ -1,71 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pd-pain-signal
|
|
3
|
-
description:
|
|
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.
|
|
4
4
|
disable-model-invocation: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Pain Signal
|
|
7
|
+
# PD Pain Signal
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
pain recorded without a session is a legal unbound Owner report: it carries no
|
|
11
|
-
trajectory evidence, its diagnosis confidence tends to be low, and its
|
|
12
|
-
candidates are likely gated as `needs_evidence` by the admission gate — the
|
|
13
|
-
Owner's report is stored, but usually nothing is internalized.
|
|
9
|
+
## Purpose
|
|
14
10
|
|
|
15
|
-
|
|
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.
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
occurred:
|
|
13
|
+
## Steps
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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.
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
submits the session's trajectory evidence automatically. You cannot obtain a
|
|
26
|
-
trusted session ID yourself (none is injected into tool executions); never
|
|
27
|
-
guess, scan, or pick the "latest" session.
|
|
23
|
+
## Evidence and success criteria
|
|
28
24
|
|
|
29
|
-
|
|
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.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
## Failure handling
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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.
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
session fails with `session_not_found` before anything is written.
|
|
39
|
-
- When the `--session` binding is verified but the trajectory evidence is
|
|
40
|
-
empty or unreadable (the session is real), the record is submitted as an
|
|
41
|
-
honest bound + evidence-unavailable degrade: no evidence is fabricated and
|
|
42
|
-
the admission gate decides what empty evidence is worth, instead of a hard
|
|
43
|
-
refusal.
|
|
44
|
-
- Recording without `--session` is allowed as an unbound Owner report, but it
|
|
45
|
-
attaches no evidence and its candidates will likely be gated
|
|
46
|
-
(`needs_evidence`) by the admission gate — the CLI output says so explicitly.
|
|
39
|
+
## Never
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- Do not guess, scan for, or infer a session ID. Use `/pd-pain` or an id the Owner provides.
|
|
54
|
-
|
|
55
|
-
## Verify
|
|
56
|
-
|
|
57
|
-
Use:
|
|
58
|
-
```bash
|
|
59
|
-
pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
|
|
60
|
-
pd candidate list --workspace "<workspace>" --json
|
|
61
|
-
pd runtime flow show --workspace "<workspace>" --json
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Success requires admitted candidates, not merely generated ones: check
|
|
65
|
-
`admissionResults` for `admitted` decisions and non-empty `ledgerEntryIds`.
|
|
66
|
-
A successful command returning a `painId` is only a record receipt — it does
|
|
67
|
-
not mean the diagnosis produced candidates or that anything was admitted.
|
|
68
|
-
Candidates reported as `needs_evidence` or `deferred` were NOT internalized —
|
|
69
|
-
if candidates are gated, re-record with `/pd-pain` or `--session` so the
|
|
70
|
-
diagnosis carries real trajectory evidence. Activation is a separate stage
|
|
71
|
-
that follows Owner approval; this flow never activates anything by itself.
|
|
41
|
+
- 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.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pd-review
|
|
3
|
+
description: Use when the Owner wants to inspect PD diagnoses, principle candidates, or governance state, or asks to approve, reject, or activate a principle. Every Owner decision must be completed by the Owner in the official Web Console.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PD Review
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
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
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. Confirm the task concerns PD pain, diagnosis, candidates, or principle governance—not ordinary code review.
|
|
16
|
+
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.
|
|
18
|
+
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
|
+
5. Ask the Owner to inspect the evidence and personally complete approval, rejection, or another governance action in the Console.
|
|
20
|
+
|
|
21
|
+
## State boundaries
|
|
22
|
+
|
|
23
|
+
- A candidate's existence does not mean it was approved.
|
|
24
|
+
- Opening the Console does not mean it was approved.
|
|
25
|
+
- The Owner saying "approve" does not prove the Console action has completed.
|
|
26
|
+
- Approval, activation, and a subsequent behavior change are separate stages and must be verified separately.
|
|
27
|
+
|
|
28
|
+
## Never
|
|
29
|
+
|
|
30
|
+
- Approve, reject, or activate a principle through CLI, scripts, databases, files, or another skill.
|
|
31
|
+
- Fall back to CLI approval when the Console is unavailable.
|
|
32
|
+
- Fabricate an Owner decision or describe candidate generation/admission as activation.
|
|
@@ -1,85 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pd-cli-operator
|
|
3
|
-
description:
|
|
3
|
+
description: 当需要只读检查 PD 运行健康、查询痛苦/任务/运行/候选/工件,或追踪痛苦到原则的证据链时使用。用于 PD CLI 与 Runtime 排障;不用于登记痛苦、Owner 治理审阅或宿主管理。
|
|
4
4
|
disable-model-invocation: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# PD CLI Operator
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
通过现有 PD CLI 查询事实、定位链路断点,并给出基于证据的结论。本技能只负责操作路由,不实现第二套业务逻辑。
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 工作流程
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
1. **确认工作区。** 使用当前 OpenClaw 宿主/插件上下文提供的权威工作区。命令要求 `--workspace` 时传入已确认的绝对路径。无法确定工作区就先报告阻塞,不要从当前目录、最近目录或其他宿主猜测。
|
|
14
|
+
2. **发现真实命令。** 先检查 `pd --help`,再检查目标命令的 `--help`。命令名和参数以当前安装版本为准。
|
|
15
|
+
3. **优先只读检查。** 按问题选择最少的查询命令,不遍历无关工作区。
|
|
16
|
+
4. **逐段追踪。** 分别核实痛苦登记、诊断任务、运行结果、候选、准入和 Owner 治理结果,不由单个状态字段推断整条链路已完成。
|
|
17
|
+
5. **报告证据。** 说明已确认事实、未知部分、阻塞层和下一步;区分命令成功与业务目标成功。
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
候选大概率被准入阈值拦为 `needs_evidence` —— CLI 输出会明确警告。
|
|
20
|
-
- `--session <id>` 会先校验;会话不存在时以 `session_not_found` 失败,
|
|
21
|
-
不会写入任何内容。会话验证通过但轨迹证据为空或不可读时,按
|
|
22
|
-
bound + 证据不可用诚实降级提交,由 admission gate 评判,不会伪造证据。
|
|
23
|
-
- 命令成功返回 `painId` 只代表记录回执;诊断是否产出候选、候选是否被
|
|
24
|
-
准入,以 JSON 输出中的 `candidateIds` / `admissionResults` /
|
|
25
|
-
`ledgerEntryIds` 为准。激活是 Owner 批准之后的独立阶段。
|
|
19
|
+
## 常用只读命令
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
- `status` 是 `succeeded`
|
|
29
|
-
- 候选被**准入**而非仅被生成:检查 `admissionResults` /
|
|
30
|
-
`candidateOutcomes` 中的 `admitted` 决策和 `ledgerEntryIds` 非空
|
|
21
|
+
先确认当前 CLI 支持这些命令,再按需执行:
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
23
|
+
- 健康检查:`pd health --workspace "<workspace>" --json`
|
|
24
|
+
- Runtime 探针:`pd runtime probe --runtime pi-ai --workspace "<workspace>" --json`
|
|
25
|
+
- 流程策略:`pd runtime flow show --workspace "<workspace>" --json`
|
|
26
|
+
- 痛苦列表与准入证据:`pd pain list --workspace "<workspace>" --json`、`pd pain evidence --workspace "<workspace>" --json`
|
|
27
|
+
- 痛苦到原则的追踪:`pd runtime trace show --pain-id "<painId>" --workspace "<workspace>" --json`
|
|
28
|
+
- 任务与运行:`pd task show "<taskId>" --workspace "<workspace>" --json`、`pd run show "<runId>" --workspace "<workspace>"`
|
|
29
|
+
- 候选与工件:`pd candidate list --task-id "<taskId>" --workspace "<workspace>" --json`、`pd candidate show "<candidateId>" --workspace "<workspace>" --json`、`pd artifact show "<artifactId>" --workspace "<workspace>" --json`
|
|
35
30
|
|
|
36
|
-
|
|
31
|
+
OpenClaw 的 `/pd-status` 主要展示 GFI/Pain 词典等宿主状态,不应代替 Runtime 健康检查或具体任务追踪。
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
|
|
41
|
-
```
|
|
33
|
+
## 结果判定
|
|
42
34
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
- `painId` 只证明痛苦登记有回执。
|
|
36
|
+
- 任务创建不等于诊断完成。
|
|
37
|
+
- 候选生成不等于通过准入;必须检查实际 admission 决策及对应账本证据。
|
|
38
|
+
- 准入成功不等于 Owner 已批准或原则已激活;打开 Console 也不等于完成治理决定。
|
|
47
39
|
|
|
48
|
-
##
|
|
40
|
+
## 写操作与失败
|
|
49
41
|
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
|
|
53
|
-
```
|
|
42
|
+
本技能默认只读。若需要重试、恢复、修复或其他有副作用的操作,先确认用户意图、命令帮助、资格条件和影响范围;支持时先 dry-run,执行后读回真实状态。不要盲目重试可能产生副作用的命令。
|
|
54
43
|
|
|
55
|
-
|
|
44
|
+
CLI 不可用时,保留真实错误并区分未安装、工作区未初始化、权限不足与 Runtime 故障。需要安装、初始化、停用或恢复宿主接入时转交 `pd-control`。
|
|
56
45
|
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
pd activation list --workspace "<workspace>" --json
|
|
60
|
-
```
|
|
46
|
+
## 禁止
|
|
61
47
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## 查看 Runtime V2 对象
|
|
68
|
-
|
|
69
|
-
Tasks 和 runs:
|
|
70
|
-
```bash
|
|
71
|
-
pd task show --task-id "<taskId>" --json
|
|
72
|
-
pd run show --run-id "<runId>" --json
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Candidates 和 artifacts:
|
|
76
|
-
```bash
|
|
77
|
-
pd candidate list --workspace "<workspace>" --json
|
|
78
|
-
pd candidate show --candidate-id "<candidateId>" --workspace "<workspace>" --json
|
|
79
|
-
pd artifact show --artifact-id "<artifactId>" --workspace "<workspace>" --json
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
手动 intake:
|
|
83
|
-
```bash
|
|
84
|
-
pd candidate intake --candidate-id "<candidateId>" --workspace "<workspace>" --json
|
|
85
|
-
```
|
|
48
|
+
- 不直接修改数据库、账本、配置或内部工件。
|
|
49
|
+
- 不写 `.state/.pain_flag`,不调用 legacy `write_pain_flag`。
|
|
50
|
+
- 不伪造运行证据或把推测写成已确认根因。
|
|
51
|
+
- 不通过 CLI、脚本或其他技能批准、拒绝或激活原则。
|
|
52
|
+
- 不将命令退出码为 0 自动等同于业务成功。
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pd-control
|
|
3
|
+
description: 当 Owner 明确要求安装、初始化、停用、重新启用或修复 PD 宿主接入时使用。只使用当前宿主正式支持的管理入口;不直接改配置或业务状态。
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PD Control
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
通过正式安装器和宿主管理机制管理 PD 接入。本技能是受限路由入口,不复制安装器逻辑,也不改变原则、候选、任务或账本状态。
|
|
12
|
+
|
|
13
|
+
## OpenClaw 当前支持方式
|
|
14
|
+
|
|
15
|
+
### 安装或重新初始化
|
|
16
|
+
|
|
17
|
+
仅当 Owner 明确要求安装/初始化时,使用仓库公开的非交互式安装入口:
|
|
18
|
+
|
|
19
|
+
npx create-principles-disciple --yes
|
|
20
|
+
|
|
21
|
+
执行前检查当前安装器的帮助和前置条件;不要在缺少授权、网络或依赖条件时声称安装成功。完成后用 `pd-cli-operator` 做只读健康检查。
|
|
22
|
+
|
|
23
|
+
### 停用
|
|
24
|
+
|
|
25
|
+
只有 Owner 明确要求停用时,执行:
|
|
26
|
+
|
|
27
|
+
openclaw plugins disable principles-disciple
|
|
28
|
+
|
|
29
|
+
该命令通过 OpenClaw 正式插件管理入口更改启用状态,不会删除已安装文件。执行后检查 `openclaw plugins list --enabled --json`,确认 `principles-disciple` 不再处于启用列表。若 Gateway 正在运行,命令会通过 Gateway 应用状态变化;仍需区分“开关已关闭”和“此前已启动的任务已全部停止”。
|
|
30
|
+
|
|
31
|
+
### 启用或恢复
|
|
32
|
+
|
|
33
|
+
只有 Owner 明确要求启用时,执行:
|
|
34
|
+
|
|
35
|
+
openclaw plugins enable principles-disciple
|
|
36
|
+
|
|
37
|
+
如果返回 capability consent、allowlist、denylist 或其他策略阻止信息,不要自动添加 `--accept-capabilities`,也不要手工改 `openclaw.json`。保留完整回执,向 Owner 说明需要作出的选择或策略问题;只有 Owner 明确同意相关 capability 后,才按 OpenClaw 返回的准确重试指令继续。
|
|
38
|
+
|
|
39
|
+
执行后先检查 `openclaw plugins list --enabled --json`,再运行 `openclaw plugins inspect principles-disciple --runtime --json` 检查当前插件注册的运行时能力。冷清单或 inspect 结果本身仍不能证明真实 Hook 已生效;需要时用一条安全的真实宿主事件核验。
|
|
40
|
+
|
|
41
|
+
## 成功判定
|
|
42
|
+
|
|
43
|
+
区分安装器执行成功、插件被宿主发现、Hook 实际运行和 PD 业务链路健康。每一步都需要对应的真实回执或运行证据。插件存在不等于已启用,安装成功也不等于 Runtime 健康。
|
|
44
|
+
|
|
45
|
+
## 禁止
|
|
46
|
+
|
|
47
|
+
- 不手工修改宿主配置或 PD 状态文件。
|
|
48
|
+
- 不覆盖用户配置,不删除业务数据来停用 PD。
|
|
49
|
+
- 不通过 CLI、脚本或其他技能批准、拒绝或激活原则。
|
|
50
|
+
- 不将未验证的宿主操作报告为成功。
|