@akagilnc/pi-workflow-roles 0.1.5462 → 0.1.5478
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/CLAUDE.md +1 -1
- package/README.md +42 -55
- package/README.zh-CN.md +59 -73
- package/THIRD_PARTY_NOTICES.md +4 -7
- package/dist/acp-host/description.js +8 -5
- package/dist/acp-host/production-host.js +17 -9
- package/dist/collector-tool-schemas.js +1 -1
- package/dist/headless-host/production-host.js +10 -5
- package/dist/host-descriptions.js +8 -3
- package/dist/migrate-book-topology.js +10 -5
- package/dist/public-cli/main.js +10 -5
- package/dist/public-cli/option-definitions.js +1 -1
- package/package.json +1 -1
- package/packets/fixer-repair.md +3 -1
- package/packets/judge-apply.md +7 -16
- package/packets/judge-authority.md +7 -17
- package/packets/judge-plan.md +7 -18
- package/packets/judge-review.md +8 -22
- package/packets/judge-submission.md +4 -7
- package/resources/collector-bot-handbook.md +2 -2
- package/resources/diarist-collect.md +2 -2
- package/resources/engine-dispatch.md +2 -2
- package/resources/navigator-route-playbook.md +1 -1
- package/resources/secretariat-ticket-identity.md +1 -1
- package/souls/coder-output-guide.md +3 -3
- package/souls/coder.md +2 -3
- package/souls/doctor-auditor.md +0 -3
- package/souls/fixer-auditor.md +0 -2
- package/souls/fixer-output-guide.md +3 -3
- package/souls/fixer.md +2 -2
- package/souls/gate-output-guide.md +1 -1
- package/souls/quality-law.md +2 -0
- package/src/acp-host/description.ts +19 -8
- package/src/acp-host/production-host.ts +1 -0
- package/src/acp-host/role-turn-host.ts +8 -5
- package/src/collector-tool-schemas.ts +1 -1
- package/src/host-descriptions.ts +8 -3
- package/src/package-contracts/gatekeeper-output.ts +1 -1
- package/src/package-contracts/navigator-output.ts +1 -1
- package/src/package-contracts/terminating-infrastructure.ts +1 -1
- package/src/public-cli/option-definitions.ts +1 -1
package/CLAUDE.md
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
向 Soul 增加一句话前,依次问:
|
|
37
37
|
|
|
38
38
|
1. 没有它,角色是否会缺失一项不可约的专业判断能力?
|
|
39
|
-
2. 它能否由 schema 或 runtime
|
|
39
|
+
2. 它能否由 schema 或 runtime **合法且**更准确地表达或强制?(本文件开篇禁止的形状拒收不算「能」)
|
|
40
40
|
3. 它是否只是字段、CLI、transport、阶段装配或错误处理说明?
|
|
41
41
|
4. 它是否只属于某个任务、仓库或业务域?
|
|
42
42
|
5. 能否删除、合并或缩成更短的原则而不损失角色能力?
|
package/README.md
CHANGED
|
@@ -4,157 +4,144 @@ Packaged workflow roles for [Pi](https://pi.dev): `judge`, `countersign`, `secre
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Installation policy: [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md). Example:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
pi install npm:@akagilnc/pi-workflow-roles
|
|
11
11
|
export PATH="$HOME/.pi/agent/npm/node_modules/.bin:$PATH"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Update
|
|
14
|
+
Update example: `pi update npm:@akagilnc/pi-workflow-roles`. Inspect with `ak-role roles` and `ak-role help <role>`; seat and Gate-officer configuration lives under Reading results below.
|
|
15
15
|
|
|
16
|
-
Publish routing
|
|
16
|
+
Publish routing: [registry workflow](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/.github/workflows/publish-registry.yml).
|
|
17
17
|
|
|
18
18
|
## Reading results
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Public entry and result delivery: [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md). Example:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
ak-role judge --model <provider/model[:thinking]> --attach ./plan.md "Review this plan." > result.txt
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Exit status
|
|
26
|
+
Exit status and Terminal semantics: [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md), [Terminal implementation](src/public-cli/terminal.ts).
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Manual continuation and flag placement: `ak-role help resume`; model / host resolution: `ak-role help`; engine configuration: `ak-role help config`. Audit continuation: [ADR 0003](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0003-per-role-submission-tools.md). Host switching and prior-record delivery: [ADR 0086](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0086-host-dossier-is-native-file-copy-sitian-append-only.md). Resume failure handling: [public execution seam](src/public-cli/post-admission.ts).
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Automatic retry behavior: [auto-resume implementation](src/public-cli/auto-resume.ts); configuration usage: `ak-role help config`; effective limit: `ak-role config show`.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Receipt re-requests and delivery accounting (#1132): [role runtime](src/role-runtime.ts), [receipt delivery policy](src/receipt-delivery-policy.ts), [external host loop](src/external-host-turn-loop.ts). Unfinished-reason handling: [ADR 0050](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0050-unfinished-terminal-state-reports-fact-not-diagnosis.md).
|
|
33
33
|
|
|
34
34
|
Seat and Gate-officer configuration:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
ak-role config set judge <provider/model[:thinking]>
|
|
38
38
|
ak-role config set navigator <provider/model[:thinking]>
|
|
39
|
-
# Gate
|
|
39
|
+
# Gate-officer configuration examples
|
|
40
40
|
ak-role config set gatekeeper <provider/model[:thinking]>
|
|
41
41
|
ak-role config set inspector <provider/model[:thinking]>
|
|
42
42
|
ak-role config set notary <provider/model[:thinking]>
|
|
43
43
|
ak-role config unset gatekeeper
|
|
44
|
-
#
|
|
45
|
-
# optional model id is a separate coordinate from the CLI engine name
|
|
44
|
+
# Engine configuration examples
|
|
46
45
|
ak-role config set-engine judge claude-code
|
|
47
46
|
ak-role config set-engine coder cursor cursor-grok-4.6-high
|
|
48
47
|
ak-role config set-engine-model coder cursor-grok-4.6-high
|
|
49
48
|
ak-role config unset-engine-model coder
|
|
50
49
|
ak-role config unset-engine judge
|
|
51
|
-
#
|
|
50
|
+
# Host configuration examples
|
|
52
51
|
ak-role config set-host judge grok-build
|
|
53
52
|
ak-role config unset-host judge
|
|
54
53
|
ak-role config set-auto-resume-limit 3
|
|
55
54
|
```
|
|
56
55
|
|
|
57
|
-
**Host axis
|
|
56
|
+
**Host axis:** `ak-role help`; institutional boundaries: [ADR 0082](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0082-three-layer-runtime-role-host-face.md). Host recommendations and native compaction configuration: [#971](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/971).
|
|
58
57
|
|
|
59
|
-
**
|
|
58
|
+
**Host providers:** `ak-role help` and [provider resolution](src/public-cli/host-providers.ts); table inspection: `ak-role config show`.
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
| --- | --- | --- |
|
|
63
|
-
| judge, countersign | `codex` | `~/.codex/config.toml`: `model_auto_compact_token_limit` |
|
|
64
|
-
| coder, fixer | `grok-build` | `~/.grok/config.toml`: `[model."<id>"] auto_compact_threshold_percent` |
|
|
65
|
-
| all other LLM seats (the analyst is deterministic and has no host) | `pi` (package default) | `~/.pi/agent/settings.json`: `compaction.reserveTokens` (trigger = model window − this value; needs pi ≥ 0.85.1) |
|
|
60
|
+
**Machine method Skills:** run `ak-role setup`; installation behavior: [machine Skill setup](src/public-cli/machine-method-skills.ts), [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md); host capabilities: [Pi Skill delivery](src/pi/role-turn-host.ts) and [external host descriptions](src/host-descriptions.ts).
|
|
66
61
|
|
|
67
|
-
|
|
62
|
+
**Gate-officer resolution:** [institutional resolution](src/institutional-resolution.ts); configuration usage: `ak-role help config`; persisted-file reading: [config implementation](src/public-cli/config.ts).
|
|
68
63
|
|
|
69
|
-
**
|
|
64
|
+
**Receipts:** [exported contracts](src/package-contracts/); Navigator's output face: `ak-role help navigator`. Composition and stopping: [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md).
|
|
70
65
|
|
|
71
|
-
**
|
|
72
|
-
|
|
73
|
-
For Gate officers (`gatekeeper` / `inspector` / `notary`) resolution is officer pin → province (`gatekeeper`) pin → inherit parent session; an explicit selection that fails is loud and does not fall back. Configuration usage and refusal text are owned by `ak-role config` / `ak-role help config`. The persistent file is machine-wide and shared across CLI builds: seat keys this build does not know are skipped on read (not an error); unknown field-level keys on known seats keep their existing tolerance.
|
|
74
|
-
|
|
75
|
-
Receipts are typed by default so callers compose roles without parsing prose; navigator is the prose-exit exception ([#959](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/959)) — its final words are presented as-is. Ordering and stopping stay caller-owned ([ADR 0010](docs/adr/0010-callers-own-role-composition-and-repetition.md)). Programmatic consumers derive contracts from the exported schemas in `src/package-contracts/`, not from this guide.
|
|
76
|
-
|
|
77
|
-
Gate submission gate: on DONE-side submissions (`completed` / `partially_completed`) the package summons the subject officer directly (`inspector` for worker completion; `notary` for judge draft / countersign verdict) — it does not spawn a Gatekeeper child to choose the seat; the officer is summoned only after the submission tool call has ended; a pass settles without returning to the submitting seat, and a bounce resumes the submitting seat to submit again until every officer passes—not role failure; `planned` / `refused` / `unfinished` skip the officer summons and settle; `ak-role gatekeeper` remains available for independent province dispatch/pass; read gate history from the typed gate section of the receipt, never from session prose. Pointers: [ADR 0067](docs/adr/0067-menxia-province-founding-jishizhong-fubaolang.md), [ADR 0072](docs/adr/0072-menxia-pre-pr-submission-hooks.md), [ADR 0079](docs/adr/0079-direct-officer-summons-ticket-memory-pointer-input.md). A labor-engine detour that fails to spawn, exits nonzero, or produces no usable output stops the run through the existing infrastructure-failure path with the original cause visible ([ADR 0071](docs/adr/0071-engine-detour-failure-seat-fallback-declaration.md)). Runtime fact `decisiveFacts.engineDetourToolUsage` (#537) counts only the package tool `ak_engine_detour`; the bash/CLI ordinary path is a permanent blind spot and must not be read as "this seat did not use an engine".
|
|
66
|
+
**Submission gates:** [ADR 0079](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0079-direct-officer-summons-ticket-memory-pointer-input.md), [submission gate](src/submission-gate.ts), [role gate composition](src/worker-role.ts) and [judge gates](src/judge-role.ts). Labor-engine failure policy: [ADR 0071](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0071-engine-detour-failure-seat-fallback-declaration.md). Engine usage measurement: [usage fact owner](src/engine-detour-usage.ts).
|
|
78
67
|
|
|
79
68
|
## Call the roles
|
|
80
69
|
|
|
81
70
|
The examples below are usage sketches; option identity, aliases, requiredness, and mode faces are owned by `ak-role help <command>`, not by a second flag contract here.
|
|
82
71
|
|
|
83
72
|
```bash
|
|
84
|
-
#
|
|
85
|
-
# ak-role config set <seat> <provider/model[:thinking]>
|
|
86
|
-
# …or pass --model on the call (shown below). No package default model.
|
|
73
|
+
# Model usage: ak-role help
|
|
87
74
|
|
|
88
|
-
# countersign
|
|
75
|
+
# countersign
|
|
89
76
|
ak-role countersign --model <provider/model[:thinking]> --attach ./ticket.md "裁:本票 #582 是否足以开工。"
|
|
90
77
|
|
|
91
|
-
# secretariat
|
|
78
|
+
# secretariat
|
|
92
79
|
ak-role secretariat --model <provider/model[:thinking]> "整理 #924 票面并送庭。"
|
|
93
80
|
|
|
94
|
-
# gleaner-left
|
|
81
|
+
# gleaner-left
|
|
95
82
|
ak-role gleaner-left --model <provider/model[:thinking]> --base main
|
|
96
83
|
|
|
97
|
-
# judge
|
|
84
|
+
# judge
|
|
98
85
|
ak-role judge --model <provider/model[:thinking]> --attach ./findings.md --attach ./adr.md "Adjudicate every finding."
|
|
99
86
|
|
|
100
|
-
# coder
|
|
87
|
+
# coder
|
|
101
88
|
ak-role coder --model <provider/model[:thinking]> plan "Propose the first implementation plan."
|
|
102
89
|
ak-role coder --model <provider/model[:thinking]> apply --attach ./plan.md "Implement the approved slice."
|
|
103
90
|
|
|
104
|
-
# reviewer
|
|
91
|
+
# reviewer
|
|
105
92
|
ak-role reviewer --model <provider/model[:thinking]> --base main --authority-ref docs/adr/0001-roles-grow-by-demand.md "Review the branch."
|
|
106
93
|
# optional single-lens override
|
|
107
94
|
ak-role reviewer --model <provider/model[:thinking]> --base main --lens correctness --authority-ref CLAUDE.md
|
|
108
95
|
|
|
109
|
-
# collector
|
|
96
|
+
# collector
|
|
110
97
|
ak-role collector --model <provider/model[:thinking]> --pr 42 --repo owner/repository "Collect findings for the assigned issue."
|
|
111
98
|
ak-role collector --model <provider/model[:thinking]> --repo owner/repository "Collect findings for #42"
|
|
112
99
|
ak-role collector --model <provider/model[:thinking]> --pr 42 --request-manifest ./requests.json "Collect with named request bodies."
|
|
113
100
|
|
|
114
|
-
# fixer
|
|
101
|
+
# fixer
|
|
115
102
|
ak-role fixer --model <provider/model[:thinking]> --attach ./findings.md --prerequisites ./prereqs.json "Repair the findings."
|
|
116
103
|
|
|
117
|
-
# doctor
|
|
104
|
+
# doctor
|
|
118
105
|
ak-role doctor --model <provider/model[:thinking]> --issue 115 "Diagnose this retained case."
|
|
119
106
|
|
|
120
|
-
# merger
|
|
107
|
+
# merger
|
|
121
108
|
ak-role merger --model <provider/model[:thinking]> --project /path/to/worktree "Reconcile the merge."
|
|
122
109
|
|
|
123
|
-
# notary —
|
|
110
|
+
# notary — direct summons with a source-run locator; duties are in souls/notary.md
|
|
124
111
|
ak-role notary --model <provider/model[:thinking]> --source-run <runId@role|path>
|
|
125
112
|
|
|
126
|
-
# inspector
|
|
113
|
+
# inspector
|
|
127
114
|
ak-role inspector --model <provider/model[:thinking]> --attach ./change.patch "Review this material."
|
|
128
115
|
|
|
129
|
-
# gatekeeper
|
|
116
|
+
# gatekeeper
|
|
130
117
|
ak-role gatekeeper --model <provider/model[:thinking]> --attach ./submission.json "审:这批材料该谁审?"
|
|
131
118
|
|
|
132
|
-
# navigator
|
|
119
|
+
# navigator
|
|
133
120
|
ak-role navigator --model <provider/model[:thinking]> "刚完成 coder apply 收敛,下一步?"
|
|
134
121
|
|
|
135
|
-
# diarist
|
|
122
|
+
# diarist
|
|
136
123
|
ak-role diarist --model <provider/model[:thinking]> "整理 #708 的本案依据。"
|
|
137
124
|
|
|
138
|
-
#
|
|
125
|
+
# Additional diarist request examples; method: resources/diarist-collect.md
|
|
139
126
|
ak-role diarist --model <provider/model[:thinking]> "整理 #582 自上次成录以来的御话。"
|
|
140
|
-
#
|
|
127
|
+
# Multi-ticket request example
|
|
141
128
|
ak-role diarist --model <provider/model[:thinking]> "整理 #582、#583 自上次成录以来的御话,分别成录。"
|
|
142
|
-
# countersign
|
|
129
|
+
# countersign request example
|
|
143
130
|
ak-role countersign --model <provider/model[:thinking]> --attach ./ticket.md "裁:本票 #582 是否足以开工。"
|
|
144
131
|
|
|
145
|
-
# analyst
|
|
132
|
+
# analyst
|
|
146
133
|
ak-role analyst
|
|
147
134
|
|
|
148
|
-
#
|
|
135
|
+
# Resume request example; audit continuation: ADR 0003
|
|
149
136
|
ak-role --model <provider/model[:thinking]> resume <runId> "<ruling>"
|
|
150
137
|
```
|
|
151
138
|
|
|
152
139
|
## Names
|
|
153
140
|
|
|
154
|
-
|
|
141
|
+
Roster: [README.zh-CN.md](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/README.zh-CN.md). Naming rule: [ADR 0051](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0051-roles-are-named-after-tang-song-offices.md).
|
|
155
142
|
|
|
156
143
|
## Normative pointers
|
|
157
144
|
|
|
158
|
-
- Command usage and refusal text: `ak-role help <command>`, `ak-role help config` (sole authority).
|
|
159
|
-
- Decisions and rationale:
|
|
160
|
-
- Glossary: [CONTEXT.md](CONTEXT.md). Programmatic contracts: `src/package-contracts/` exports.
|
|
145
|
+
- Command usage, resolution, and refusal text: `ak-role help`, `ak-role help <command>`, `ak-role help config` (sole authority).
|
|
146
|
+
- Decisions and rationale: [docs/adr/](https://github.com/Akagilnc/ak-pi-workflow-roles/tree/main/docs/adr) (composition ADR 0010, public CLI face ADR 0052, submission gates ADR 0066/0067/0070/0072, labor engines ADR 0069/0071, court diary ADR 0075, among others; not exhaustive).
|
|
147
|
+
- Glossary: [CONTEXT.md](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/CONTEXT.md). Programmatic contracts: `src/package-contracts/` exports.
|
package/README.zh-CN.md
CHANGED
|
@@ -4,175 +4,161 @@
|
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
安装约定见 [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md)。操作示例:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
pi install npm:@akagilnc/pi-workflow-roles
|
|
11
11
|
export PATH="$HOME/.pi/agent/npm/node_modules/.bin:$PATH"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
更新示例:`pi update npm:@akagilnc/pi-workflow-roles`。查看能力:`ak-role roles`、`ak-role help <role>`;席位与官席配置见下方「读结果」。
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
发布路由见 [registry workflow](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/.github/workflows/publish-registry.yml)。
|
|
17
17
|
|
|
18
18
|
## 读结果
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
公开入口与结果交付见 [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md)。重定向示例:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
ak-role judge --model <provider/model[:thinking]> --attach ./plan.md "Review this plan." > result.txt
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
退出码与 Terminal 语义见 [ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md)、[Terminal 实现](src/public-cli/terminal.ts)。
|
|
27
27
|
|
|
28
|
-
`ak-role resume
|
|
28
|
+
手动续跑用法与旗位见 `ak-role help resume`;model / host 解析见 `ak-role help`,engine 配置见 `ak-role help config`。审核续跑归属见 [ADR 0003](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0003-per-role-submission-tools.md)。换宿主与先前记录递送见 [ADR 0086](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0086-host-dossier-is-native-file-copy-sitian-append-only.md)。续跑失败处置见 [公开执行接缝](src/public-cli/post-admission.ts)。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
自动续跑行为见 [auto-resume 实现](src/public-cli/auto-resume.ts);配置用法见 `ak-role help config`,有效上限用 `ak-role config show` 查看。
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
催交与实发次数记账(#1132)见 [角色运行时](src/role-runtime.ts)、[回执递送策略](src/receipt-delivery-policy.ts)、[外部宿主循环](src/external-host-turn-loop.ts)。unfinished 缺理由处置见 [ADR 0050](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0050-unfinished-terminal-state-reports-fact-not-diagnosis.md)。
|
|
33
33
|
|
|
34
34
|
席位与官席配置:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
ak-role config set judge <provider/model[:thinking]>
|
|
38
38
|
ak-role config set navigator <provider/model[:thinking]>
|
|
39
|
-
#
|
|
39
|
+
# 官席配置示例
|
|
40
40
|
ak-role config set gatekeeper <provider/model[:thinking]>
|
|
41
41
|
ak-role config set inspector <provider/model[:thinking]>
|
|
42
42
|
ak-role config set notary <provider/model[:thinking]>
|
|
43
43
|
ak-role config unset gatekeeper
|
|
44
|
-
#
|
|
45
|
-
# 可选型号是独立坐标,与 CLI 引擎名分开指定
|
|
44
|
+
# 引擎配置示例
|
|
46
45
|
ak-role config set-engine judge claude-code
|
|
47
46
|
ak-role config set-engine coder cursor cursor-grok-4.6-high
|
|
48
47
|
ak-role config set-engine-model coder cursor-grok-4.6-high
|
|
49
48
|
ak-role config unset-engine-model coder
|
|
50
49
|
ak-role config unset-engine judge
|
|
51
|
-
#
|
|
50
|
+
# 宿主配置示例
|
|
52
51
|
ak-role config set-host judge grok-build
|
|
53
52
|
ak-role config unset-host judge
|
|
54
53
|
ak-role config set-auto-resume-limit 3
|
|
55
54
|
```
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
**宿主轴:** 用法与解析见 `ak-role help`;机构边界见 [ADR 0082](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0082-three-layer-runtime-role-host-face.md)。宿主推荐与原生压缩配置见 [#971](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/971)。
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
**宿主 provider:** 见 `ak-role help` 与 [provider 解析](src/public-cli/host-providers.ts);表内容用 `ak-role config show` 查看。
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
| --- | --- | --- |
|
|
63
|
-
| 大理寺(judge)、给事中(countersign) | `codex` | `~/.codex/config.toml`:`model_auto_compact_token_limit` |
|
|
64
|
-
| 将作监(coder)、修内司(fixer) | `grok-build` | `~/.grok/config.toml`:`[model."<id>"] auto_compact_threshold_percent` |
|
|
65
|
-
| 其余 LLM 席位(太史是确定性机制,无宿主) | `pi`(包默认) | `~/.pi/agent/settings.json`:`compaction.reserveTokens`(触发线=模型窗口−该值;需 pi ≥ 0.85.1) |
|
|
66
|
-
|
|
67
|
-
配席:`ak-role config set-host <seat> <host>`;单次改道仍用 `--host`。换宿主前先确认该席的 model 是该宿主跑得了的(例如 `codex` 只跑 OpenAI 系模型),否则先 `ak-role config set <seat> <provider/model[:thinking]>`。
|
|
68
|
-
|
|
69
|
-
**宿主 provider 表(#788):** 席位行只写一份 provider 名。owner 手改 `~/.ak-roles/host-providers.json`(形如 `{ "hermes": { "xai": "xai-oauth" } }`);代码只读。表里没有的问宿主目录(本票 hermes):唯一即用,零个或多个响亮失败。优先级:表 > 唯一 > 失败,代码无裁量。`config show` 原样打印该表。
|
|
60
|
+
**机器方法 Skill:** 运行 `ak-role setup`;安装行为见 [机器 Skill setup](src/public-cli/machine-method-skills.ts)、[ADR 0052](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0052-public-cli-is-the-only-supported-external-role-interface.md);宿主能力见 [Pi Skill 递送](src/pi/role-turn-host.ts)、[外部 host 描述](src/host-descriptions.ts)。
|
|
70
61
|
|
|
71
|
-
|
|
62
|
+
**官席解析:** 见 [机构解析](src/institutional-resolution.ts);配置用法见 `ak-role help config`,持久文件读取见 [config 实现](src/public-cli/config.ts)。
|
|
72
63
|
|
|
73
|
-
|
|
64
|
+
**回执:** 见 [导出契约](src/package-contracts/);游奕使出口见 `ak-role help navigator`。组合与停止见 [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md)。
|
|
74
65
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
门下省交卷闸:DONE 侧交卷(`completed`/`partially_completed`)时包按受审物直接传召官(将作监/修内司→`inspector`;大理寺判牒/给事中署章→`notary`),不再起门下省子 session 选席;交卷工具调用结束后才传召审核官;放行即结算、不回被审席,封驳则续跑被审席重交,直至各审核官放行,不是角色失败;`planned`/`refused`/`unfinished` 不传召官、直接结算;`ak-role gatekeeper` 仍可独立 dispatch/pass;闸史读回执 typed gate 段,勿刮 session 散文。指针:[ADR 0067](docs/adr/0067-menxia-province-founding-jishizhong-fubaolang.md)、[ADR 0072](docs/adr/0072-menxia-pre-pr-submission-hooks.md)、[ADR 0079](docs/adr/0079-direct-officer-summons-ticket-memory-pointer-input.md)。劳务引擎绕行失败沿既有基础设施故障路径停止、真因可见([ADR 0071](docs/adr/0071-engine-detour-failure-seat-fallback-declaration.md))。运行时事实 `decisiveFacts.engineDetourToolUsage`(#537)只计 package 工具 `ak_engine_detour`;bash/CLI ordinary path 是永久观测盲区,不得读成「该腿没用引擎」。
|
|
66
|
+
**交卷闸:** 见 [ADR 0079](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0079-direct-officer-summons-ticket-memory-pointer-input.md)、[交卷闸实现](src/submission-gate.ts)、[worker 审核组合](src/worker-role.ts)、[judge 审核组合](src/judge-role.ts)。劳务引擎失败处置见 [ADR 0071](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0071-engine-detour-failure-seat-fallback-declaration.md),使用量观测见 [usage fact 真源](src/engine-detour-usage.ts)。
|
|
78
67
|
|
|
79
68
|
## 调用百官
|
|
80
69
|
|
|
81
70
|
下例只是用法速写;option 身份、别名、必填性与 mode 面以 `ak-role help <command>` 为准,不另立第二份旗标合同。
|
|
82
71
|
|
|
83
72
|
```bash
|
|
84
|
-
# model
|
|
85
|
-
# 配席,或如下逐次带 `--model`。无包内默认模型。
|
|
73
|
+
# model 用法见 ak-role help
|
|
86
74
|
|
|
87
|
-
#
|
|
75
|
+
# 大理寺
|
|
88
76
|
ak-role judge --model <provider/model[:thinking]> --attach ./findings.md --attach ./adr.md "Adjudicate every finding."
|
|
89
77
|
|
|
90
|
-
#
|
|
78
|
+
# 将作监
|
|
91
79
|
ak-role coder --model <provider/model[:thinking]> plan "Propose the first implementation plan."
|
|
92
80
|
ak-role coder --model <provider/model[:thinking]> apply --attach ./plan.md "Implement the approved slice."
|
|
93
81
|
|
|
94
|
-
#
|
|
82
|
+
# 御史台
|
|
95
83
|
ak-role reviewer --model <provider/model[:thinking]> --base main --authority-ref docs/adr/0001-roles-grow-by-demand.md "Review the branch."
|
|
96
84
|
# 可选单 lens 覆盖
|
|
97
85
|
ak-role reviewer --model <provider/model[:thinking]> --base main --lens correctness --authority-ref CLAUDE.md
|
|
98
86
|
|
|
99
|
-
#
|
|
87
|
+
# 通进司
|
|
100
88
|
ak-role collector --model <provider/model[:thinking]> --pr 42 --repo owner/repository "为所指 issue 收证。"
|
|
101
89
|
ak-role collector --model <provider/model[:thinking]> --repo owner/repository "为 #42 收证。"
|
|
102
90
|
ak-role collector --model <provider/model[:thinking]> --pr 42 --request-manifest ./requests.json "带具名请求正文收证。"
|
|
103
91
|
|
|
104
|
-
#
|
|
92
|
+
# 修内司
|
|
105
93
|
ak-role fixer --model <provider/model[:thinking]> --attach ./findings.md --prerequisites ./prereqs.json "Repair the findings."
|
|
106
94
|
|
|
107
|
-
#
|
|
95
|
+
# 太医署
|
|
108
96
|
ak-role doctor --model <provider/model[:thinking]> --issue 115 "Diagnose this retained case."
|
|
109
97
|
|
|
110
|
-
#
|
|
98
|
+
# 校书郎
|
|
111
99
|
ak-role merger --model <provider/model[:thinking]> --project /path/to/worktree "Reconcile the merge."
|
|
112
100
|
|
|
113
|
-
#
|
|
101
|
+
# 符宝郎——以 source-run locator 直调;职掌见 souls/notary.md
|
|
114
102
|
ak-role notary --model <provider/model[:thinking]> --source-run <runId@role|path>
|
|
115
103
|
|
|
116
|
-
#
|
|
104
|
+
# 台院
|
|
117
105
|
ak-role inspector --model <provider/model[:thinking]> --attach ./change.patch "Review this material."
|
|
118
106
|
|
|
119
|
-
#
|
|
107
|
+
# 门下省
|
|
120
108
|
ak-role gatekeeper --model <provider/model[:thinking]> --attach ./submission.json "审:这批材料该谁审?"
|
|
121
109
|
|
|
122
|
-
#
|
|
110
|
+
# 游奕使
|
|
123
111
|
ak-role navigator --model <provider/model[:thinking]> "刚完成 coder apply 收敛,下一步?"
|
|
124
112
|
|
|
125
|
-
#
|
|
113
|
+
# 起居郎请求示例;方法见 resources/diarist-collect.md
|
|
126
114
|
ak-role diarist --model <provider/model[:thinking]> "整理 #582 自上次成录以来的御话。"
|
|
127
|
-
#
|
|
115
|
+
# 多票请求示例
|
|
128
116
|
ak-role diarist --model <provider/model[:thinking]> "整理 #582、#583 自上次成录以来的御话,分别成录。"
|
|
129
|
-
#
|
|
117
|
+
# 给事中
|
|
130
118
|
ak-role countersign --model <provider/model[:thinking]> --attach ./ticket.md "裁:本票 #582 是否足以开工。"
|
|
131
119
|
|
|
132
|
-
#
|
|
120
|
+
# 中书省
|
|
133
121
|
ak-role secretariat --model <provider/model[:thinking]> "整理 #924 票面并送庭。"
|
|
134
122
|
|
|
135
|
-
#
|
|
123
|
+
# 左拾遗
|
|
136
124
|
ak-role gleaner-left --model <provider/model[:thinking]> --base main
|
|
137
125
|
|
|
138
|
-
#
|
|
126
|
+
# 太史
|
|
139
127
|
ak-role analyst
|
|
140
128
|
|
|
141
|
-
#
|
|
129
|
+
# 续跑请求示例;审核续跑归属见 ADR 0003
|
|
142
130
|
ak-role --model <provider/model[:thinking]> resume <runId> "<裁定>"
|
|
143
131
|
```
|
|
144
132
|
|
|
145
133
|
## 班子(唐宋官署命名)
|
|
146
134
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
**只是名字。** `ak-role <name>` 的角色标识符以及工具名与 schema 字段一律使用下表席位列的英文名;中文名只是呈现层称谓。
|
|
135
|
+
名号判据、朝廷对应与机器键边界见 [ADR 0051](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0051-roles-are-named-after-tang-song-offices.md)。下表为名号索引。
|
|
150
136
|
|
|
151
137
|
| 名号 | 席位 | 职掌 |
|
|
152
138
|
| --- | --- | --- |
|
|
153
|
-
| **将作监** | coder |
|
|
154
|
-
| **修内司** | fixer |
|
|
155
|
-
| **御史台** | reviewer |
|
|
156
|
-
| **大理寺** | judge |
|
|
157
|
-
| **审刑院** | judge-auditor/doctor-auditor
|
|
158
|
-
| **门下省** | gatekeeper
|
|
159
|
-
| **中书省** | secretariat
|
|
160
|
-
| **给事中** | countersign
|
|
161
|
-
| **左拾遗** | gleaner-left
|
|
162
|
-
| **台院** | inspector |
|
|
163
|
-
| **符宝郎** | notary |
|
|
164
|
-
| **通进司** | collector |
|
|
165
|
-
| **校书郎** | merger |
|
|
166
|
-
| **游奕使** | navigator
|
|
167
|
-
| **起居郎** | diarist
|
|
139
|
+
| **将作监** | coder | 职掌见 [Soul](souls/coder.md)。 |
|
|
140
|
+
| **修内司** | fixer | 职掌见 [Soul](souls/fixer.md)。 |
|
|
141
|
+
| **御史台** | reviewer | 职掌见 [Soul](souls/reviewer.md);调用面见 `ak-role help reviewer`。 |
|
|
142
|
+
| **大理寺** | judge | 职掌见 [Soul](souls/judge.md)。 |
|
|
143
|
+
| **审刑院** | auditor(调用面见 `ak-role help auditor`) | 依受审对象读取 [大理寺审计 Soul](souls/judge-auditor.md)/[太医署审计 Soul](souls/doctor-auditor.md)。 |
|
|
144
|
+
| **门下省** | gatekeeper | 职掌见 [Soul](souls/gatekeeper.md);独立调用见 `ak-role help gatekeeper`,交卷闸关系见 [ADR 0079](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0079-direct-officer-summons-ticket-memory-pointer-input.md)。 |
|
|
145
|
+
| **中书省** | secretariat | 职掌见 [Soul](souls/secretariat.md);调用面见 `ak-role help secretariat`。 |
|
|
146
|
+
| **给事中** | countersign | 职掌见 [Soul](souls/countersign.md);调用面见 `ak-role help countersign`。 |
|
|
147
|
+
| **左拾遗** | gleaner-left | 职掌见 [Soul](souls/gleaner-left.md);调用面见 `ak-role help gleaner-left`。 |
|
|
148
|
+
| **台院** | inspector | 职掌见 [Soul](souls/inspector.md);调用面见 `ak-role help inspector`,名号沿革见 [ADR 0074](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0074-gate-province-reorg-jishizhong-chaiyuan-split.md) 与 [#584](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/584)。 |
|
|
149
|
+
| **符宝郎** | notary | 职掌见 [Soul](souls/notary.md);调用面见 `ak-role help notary`。 |
|
|
150
|
+
| **通进司** | collector | 职掌见 [Soul](souls/collector.md)。 |
|
|
151
|
+
| **校书郎** | merger | 职掌见 [Soul](souls/merger.md)。 |
|
|
152
|
+
| **游奕使** | navigator | 职掌见 [Soul](souls/navigator.md);调用面见 `ak-role help navigator`。 |
|
|
153
|
+
| **起居郎** | diarist | 职掌见 [Soul](souls/diarist.md);调用面见 `ak-role help diarist`。 |
|
|
168
154
|
|
|
169
155
|
其余席位:
|
|
170
156
|
|
|
171
157
|
| 席位 | 名 | 职掌 | 状态 |
|
|
172
158
|
| --- | --- | --- | --- |
|
|
173
|
-
| doctor | **太医署** |
|
|
174
|
-
| analyst | **太史** |
|
|
175
|
-
| — | **司天台** |
|
|
159
|
+
| doctor | **太医署** | 职掌见 [Soul](souls/doctor.md);调用面见 `ak-role help doctor`。 | 已建 |
|
|
160
|
+
| analyst | **太史** | 职掌见 [ADR 0068](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0068-taishi-analysis-seat-reads-records-writes-sibling-home.md);调用面见 `ak-role help analyst`。 | 已建([ADR 0068](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0068-taishi-analysis-seat-reads-records-writes-sibling-home.md);机器面键 `analyst`,[#445](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/445) 拼音清零) |
|
|
161
|
+
| — | **司天台** | 职掌见 [ADR 0047](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0047-sitian-phase-one-mechanism-not-role.md)、[ADR 0065](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0065-sitian-phase-two-records-have-one-entry.md)。 | **一期不是角色**([ADR 0047](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0047-sitian-phase-one-mechanism-not-role.md):确定性机制;两面对账已删 [#855](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/855));分析席已由太史承担;起居录见 [ADR 0075](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0075-ticket-provenance-diarist-pipeline.md);机器面键 `archivist`([#445](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/445)) |
|
|
176
162
|
| marshal | **尚书省** | 审→判→修 质量收敛环的省部级驱动角色:调用方递票号与 baseline,尚书省驱动御史台/大理寺/修内司滚到收敛(converged 唯庭可判)或 escalate 上呈,交回 typed 报告;不弹、不判、不修,只让链条转到收敛 | 已定名(#145);席位待落地(#146) |
|
|
177
163
|
| — | **殿院** | [#560](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/560) 机械定点测试巡查件(产物 kind `test-report`) | 在建/待落地,非席位,不占机器键 |
|
|
178
164
|
| — | **察院** | 巡按层名号占位 | 悬置,仅保留名号,巡按机制未建 |
|
|
@@ -182,12 +168,12 @@ ak-role --model <provider/model[:thinking]> resume <runId> "<裁定>"
|
|
|
182
168
|
|
|
183
169
|
**merge 按钮归调用者**,没有任何角色握不可逆权限:通进司把收证这件苦活做完并报收集终态,人(或 AI)自己判断、自己点,点完想调主簿就调、不调也可以。
|
|
184
170
|
|
|
185
|
-
|
|
171
|
+
角色组合、调用顺序、停止与内审关联见 [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md);通进司职责见 [Soul](souls/collector.md)。
|
|
186
172
|
|
|
187
173
|
`拾遗补阙` 成对留档,待将来出现第二个进言席再启用。
|
|
188
174
|
|
|
189
175
|
## 规范指针
|
|
190
176
|
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
- 术语表:[CONTEXT.md](CONTEXT.md)。编程契约:`src/package-contracts/` 导出。
|
|
177
|
+
- 命令用法、解析与拒绝文案:`ak-role help`、`ak-role help <command>`、`ak-role help config`(唯一权威)。
|
|
178
|
+
- 决策与法理:[docs/adr/](https://github.com/Akagilnc/ak-pi-workflow-roles/tree/main/docs/adr)(组合与顺序 ADR 0010、公开 CLI 面 ADR 0052、交卷闸 ADR 0066/0067/0070/0072、劳务引擎 ADR 0069/0071、起居录 ADR 0075 等,未尽举)。
|
|
179
|
+
- 术语表:[CONTEXT.md](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/CONTEXT.md)。编程契约:`src/package-contracts/` 导出。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
# Third-Party Notices
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
The notices below are **third-party** licenses and are **not** the project
|
|
5
|
-
license authority. Do not treat them as dual-licensing the package.
|
|
3
|
+
Project license: [LICENSE](LICENSE). The notices below cover third-party provenance.
|
|
6
4
|
|
|
7
5
|
## mattpocock/skills (MIT)
|
|
8
6
|
|
|
9
7
|
Upstream provenance: [mattpocock/skills](https://github.com/mattpocock/skills).
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
package carries copies of them.
|
|
9
|
+
Acquisition and installation: [machine Skill setup](src/public-cli/machine-method-skills.ts).
|
|
10
|
+
Attributed methods:
|
|
14
11
|
|
|
15
12
|
- `tdd`
|
|
16
13
|
- `diagnosing-bugs`
|
|
@@ -44,7 +41,7 @@ SOFTWARE.
|
|
|
44
41
|
|
|
45
42
|
## First-party method (not third-party)
|
|
46
43
|
|
|
47
|
-
- `ak-cross-m-review` —
|
|
44
|
+
- `ak-cross-m-review` — provenance:
|
|
48
45
|
[Akagilnc/ak-cross-m-review](https://github.com/Akagilnc/ak-cross-m-review)
|
|
49
46
|
(MIT, Copyright (c) 2026 Akagi). This is first-party material owned by the
|
|
50
47
|
same author line, not a third-party skill.
|
|
@@ -12,12 +12,15 @@ export function acpStdioArgs(description, model, seat) {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* The modelId the host addresses the seat model by.
|
|
15
|
-
* "argv" hosts
|
|
16
|
-
*
|
|
17
|
-
* alias projection
|
|
15
|
+
* "argv" hosts use the bare model on the CLI flag. "set_model" hosts use the
|
|
16
|
+
* host-native catalog form in `setModelId` (hermes `provider:model` after seat
|
|
17
|
+
* provider / host-alias projection; grok bare model — never a package map).
|
|
18
18
|
*/
|
|
19
|
-
export function acpModelId(
|
|
19
|
+
export function acpModelId(description, model) {
|
|
20
20
|
if (model?.model === undefined)
|
|
21
21
|
return undefined;
|
|
22
|
-
|
|
22
|
+
if (description.modelPassing !== "set_model")
|
|
23
|
+
return model.model;
|
|
24
|
+
const form = description.setModelId ?? "provider:model";
|
|
25
|
+
return form === "bare" ? model.model : `${model.provider}:${model.model}`;
|
|
23
26
|
}
|