@akagilnc/pi-workflow-roles 0.1.5462 → 0.1.5475

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 CHANGED
@@ -36,7 +36,7 @@
36
36
  向 Soul 增加一句话前,依次问:
37
37
 
38
38
  1. 没有它,角色是否会缺失一项不可约的专业判断能力?
39
- 2. 它能否由 schema 或 runtime **合法且**更准确地表达或强制?(第 0 条禁止的形状拒收不算「能」)
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
- Install through Pi so the CLI and runtime come from the same package copy, and add Pi's private npm bin to `PATH` once:
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 with `pi update npm:@akagilnc/pi-workflow-roles`—never a second global `npm install -g`. Inspect with `ak-role roles` and `ak-role help <role>`; seat and Gate-officer configuration lives under Reading results below.
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 (Actions, not local stamp): successful `ci` push on the repository default branch → `latest`. Non-default-branch CI completions, PR completions, and failed CI never publish.
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
- `ak-role` is the only supported way to call the package. Every run writes its complete Terminal result to stdout—read or redirect it there, never scrape Pi session files:
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 reports lifecycle honesty, not business success: every lawful typed result (including `audit_escalation`) exits zero; a failure without a lawful result exits nonzero, and its Terminal preserves the original cause instead of a fabricated receipt. An Error Artifact ref is included only when publication succeeds; publication failures are recorded separately and do not replace the original report.
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
- `ak-role resume <runId> [message]` reopens that run under the **current seat table** for model / host / engine — the same resolution as starting a new leg (model: `--model` → persistent seat → officer inherit; still none → error. host: `--host` → persistent seat host → package default `pi`). Configure seats first with `ak-role config set <seat> <provider/model[:thinking]>` or pass `--model` per invocation. Standard chain after a role `escalate`s: take the owner ruling and feed it back with `ak-role resume <runId> "<ruling>"` so the same run continues to a terminal. When an audit officer escalates, resume that officer's `runId`: escalation pauses only that seat, and the remaining gates continue after it. For every callable seat, including Notary/符宝郎, the optional `message` after `runId` is passed through unchanged as the continuation prompt (opaque: not parsed as flags); when omitted, the package adds no continuation text. Notary's separate explicit `new` command still accepts only its source-run locator, not a caller prompt. Global `--model` / `--thinking` / `--host` / `--engine` override the table for that resume only — place them before `<runId>` (either before `resume` or between `resume` and `<runId>`, e.g. `ak-role --model xai/grok-4.5 resume 01abc…` or `ak-role resume --model xai/grok-4.5 01abc…`); the one argv after `<runId>` is always the opaque message, never a flag (#471). On a host switch, the package does not inject prior record paths or dossier content; the role reads prior native copies through its ticket provenance. Native dossier copying and 司天台 (Sitian) logging follow [ADR 0086](docs/adr/0086-host-dossier-is-native-file-copy-sitian-append-only.md); copy failures are recorded separately and do not change the turn outcome. Whether to resume is the caller's decision: the command does not require a typed HTTP 429 or a `resumable` state. Unknown run IDs are rejected. When a resume failure has a published error record, stderr points to it (`续跑失败,当次错误记录:<path>`). If publication fails, the original failure and publication error are reported without claiming that a file was delivered. Every callable role accepts manual resume; Countersign and Gleaner-Left gained it in #599, Collector, Doctor, Notary, and Inspector in #633.
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
- All callable roles also retry a non-lawful LLM call in place (same `runId` and session) up to `autoResumeLimit` times. Unset defaults to 2; `ak-role config set-auto-resume-limit <N>` writes the ceiling (`0` disables). Lawful typed terminals (`accepted`, `audit_escalation`, `no_receipt`) stop immediately. Manual `ak-role resume` stays available.
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
- `autoResumeLimit` is the single ceiling for the runtime's automatic re-requests (#1132). A role turn that ends normally without submitting is **not** settled straight to `no_receipt`: the runtime first asks the same run's own host session to submit again, over that same value, counting only the requests it actually sent — `no_receipt` is recorded once the budget is spent, and `deliveryTurns` reports what really went out (zero stays zero). A receipt obtained that way goes on to audit in the usual order. The same value bounds the `unfinished`-without-reason reminder (ADR 0050) and the external host's own re-ask rounds; the first turn of each loop never counts as a re-request. The one-shot soft reminders (ADR 0066 / 0070) and the uncapped auditor re-submission (ADR 0007) are unchanged.
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 officers (direct summons on DONE submissions; province remains independently callable)
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
- # persistent labor engine (callable roles); one-shot override remains --engine
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
- # persistent main-session host (callable roles); one-shot override remains --host
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 (invocation-insensible after default):** `--host` is a global public option on every callable role and on `resume`. Resolution is invocation `--host` → persistent seat host (`config set-host`) → package default (`pi`). After `config set-host <seat> <name>`, the same command face used with Pi runs that seat on the named host with zero extra flags and zero caller-side changes; bare `resume` follows the same table. Public callable roles and their institutional sub-legs (soul audit, doctor audit) use the selected host's CLI seam.
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
- **Recommended hosts (token saving, [#971](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/971)):** long legs are capped by each host's own auto-compaction; the threshold lives in that host's own config. This package neither writes those files nor adds a compaction mechanism of its own.
58
+ **Host providers:** `ak-role help` and [provider resolution](src/public-cli/host-providers.ts); table inspection: `ak-role config show`.
60
59
 
61
- | Seat | Recommended host | Where that host's compaction threshold lives (default path; each host's own home override applies) |
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
- Set a seat with `ak-role config set-host <seat> <host>`; use `--host` for a one-off. Before moving a seat, make sure its model is one that host can run (for example `codex` only runs OpenAI-family models); otherwise set it first with `ak-role config set <seat> <provider/model[:thinking]>`.
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
- **Host providers (#788):** seat rows keep one provider name. Owner edits `~/.ak-roles/host-providers.json` (`{ "hermes": { "xai": "xai-oauth" } }`); code only reads it. Missing table entries ask the host directory (hermes this ticket): unique match wins, zero or many fail loud. Priority is table > unique > fail — no package discretion. `config show` prints the table as written.
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
- **Machine method Skills:** Run `ak-role setup` to install missing required Skills under `~/.agents/skills` and update those names through the Skills CLI (`skills update -g`). An occupied path is warned and left untouched. Setup adds links for installed Claude Code and Hermes when needed. This directory is the sole machine installation source. Roles warn on stdout when their required Skill is missing and continue. Pi receives paths from that directory through native `--skill`. Claude Code and Codex use native Skill discovery; Hermes ACP and Grok ACP cannot force Skills through their current harnesses. The package does not prepend or strip Skill commands in role requests, or modify host trust or configuration.
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
- # model axis (#178): caller specifies — either configure the seat once…
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 — ticket-court review before work starts; does not summon the diarist; resume continues the exact session
75
+ # countersign
89
76
  ak-role countersign --model <provider/model[:thinking]> --attach ./ticket.md "裁:本票 #582 是否足以开工。"
90
77
 
91
- # secretariat — rewrite ticket per 票面法; submission routes converged verdicts through the shared countersign gate (#924, #1021)
78
+ # secretariat
92
79
  ak-role secretariat --model <provider/model[:thinking]> "整理 #924 票面并送庭。"
93
80
 
94
- # gleaner-left — unanchored pre-merge memorials; resume continues the exact session; --base required; instruction may be empty; callers must not pass directional instruction
81
+ # gleaner-left
95
82
  ak-role gleaner-left --model <provider/model[:thinking]> --base main
96
83
 
97
- # judge — adjudicate the supplied materials
84
+ # judge
98
85
  ak-role judge --model <provider/model[:thinking]> --attach ./findings.md --attach ./adr.md "Adjudicate every finding."
99
86
 
100
- # coder — first implementation
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 — fixed-target parallel completeness + correctness review; completed ≠ approved, read the findings
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 — GitHub PR review evidence (LLM gathers via host CLI; optional request-manifest materials)
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 — repair the assigned findings
101
+ # fixer
115
102
  ak-role fixer --model <provider/model[:thinking]> --attach ./findings.md --prerequisites ./prereqs.json "Repair the findings."
116
103
 
117
- # doctor — diagnose one retained case
104
+ # doctor
118
105
  ak-role doctor --model <provider/model[:thinking]> --issue 115 "Diagnose this retained case."
119
106
 
120
- # merger — reconcile merge materials (role escalates when nothing is in progress)
107
+ # merger
121
108
  ak-role merger --model <provider/model[:thinking]> --project /path/to/worktree "Reconcile the merge."
122
109
 
123
- # notary — document-fidelity check on one retained source run; ticket key inherited from source-run admitted form
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 — direct complexity and test-quality check
113
+ # inspector
127
114
  ak-role inspector --model <provider/model[:thinking]> --attach ./change.patch "Review this material."
128
115
 
129
- # gatekeeper — direct Gate province review; dispatch an officer or pass
116
+ # gatekeeper
130
117
  ak-role gatekeeper --model <provider/model[:thinking]> --attach ./submission.json "审:这批材料该谁审?"
131
118
 
132
- # navigator — direct free-form prose route advice; attends automatically on top-level public entry legs only
119
+ # navigator
133
120
  ak-role navigator --model <provider/model[:thinking]> "刚完成 coder apply 收敛,下一步?"
134
121
 
135
- # diarist — gather this case's decisions into per-ticket 起居录; secretariat summons it before drafting a new ticket
122
+ # diarist
136
123
  ak-role diarist --model <provider/model[:thinking]> "整理 #708 的本案依据。"
137
124
 
138
- # before a countersign court, call the diarist only if the owner has said something new about the ticket since its last record; otherwise open or resume the court directly
125
+ # Additional diarist request examples; method: resources/diarist-collect.md
139
126
  ak-role diarist --model <provider/model[:thinking]> "整理 #582 自上次成录以来的御话。"
140
- # for a multi-ticket court, summon once with all ticket numbers; the diarist records each ticket separately
127
+ # Multi-ticket request example
141
128
  ak-role diarist --model <provider/model[:thinking]> "整理 #582、#583 自上次成录以来的御话,分别成录。"
142
- # countersign reports ticketNumber itself: use an existing diary's ticket number first; without a diary the officer identifies it
129
+ # countersign request example
143
130
  ak-role countersign --model <provider/model[:thinking]> --attach ./ticket.md "裁:本票 #582 是否足以开工。"
144
131
 
145
- # analyst — deterministic metrics; bare call = whole book (no model seat)
132
+ # analyst
146
133
  ak-role analyst
147
134
 
148
- # after escalate: feed the owner ruling into the same session (standard chain)
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
- Roles are named after Tang/Song offices; the full roster and naming rule live in [README.zh-CN.md](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/README.zh-CN.md).
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: `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).
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
- 经 Pi 安装,令 CLI 与运行时同出一份包副本;把 Pi 私有 npm bin 加进 `PATH`(一次):
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
- 更新用 `pi update npm:@akagilnc/pi-workflow-roles`——勿另起全局 `npm install -g`。查看能力:`ak-role roles`、`ak-role help <role>`;席位与官席配置见下方「读结果」。
14
+ 更新示例:`pi update npm:@akagilnc/pi-workflow-roles`。查看能力:`ak-role roles`、`ak-role help <role>`;席位与官席配置见下方「读结果」。
15
15
 
16
- 发布路由(Actions 真入口,非本地 stamp):`ci` 在仓库默认分支上成功 push → `latest`。非默认分支的 CI completion、PR completion 与失败 CI 不发布。
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
- `ak-role` 是唯一受支持的调用方式。每次运行的完整 Terminal 结果写在 stdout——从那里读或正常重定向,不要刮 Pi session 文件:
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
- 退出码报的是生命周期诚实,不是业务成败:一切合法 typed 终态(含 `audit_escalation`)退出零;无合法终态的失败退出非零,其 Terminal 保留原始原因,不伪造回执。Error Artifact 发布成功时才携带引用;发布失败独立留痕,不替换宿主原报。
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 <runId> [message]` 按**现行席位表**的 model / host / engine 续跑该次运行——与新起角色腿同一解析(model:`--model` → 席位持久 → 官席继承;仍无则报错。host:`--host` → 席位持久 host → 包默认 `pi`)。先 `ak-role config set <seat> <provider/model[:thinking]>` 配席,或逐次带 `--model`。角色 `escalate`(直通御前)后拿到 owner 裁定,标准续跑是 `ak-role resume <runId> "<裁定>"`——把裁定喂回同一 run,角色继续走到终局。上呈的是审核官时,resume 该官的 runId:上呈只暂停这一席,其后的闸照常接着走。所有可调用席位(包括 Notary/符宝郎)都会将 `runId` 后可选的 `message` 原样作为续跑 prompt(opaque:不进全局旗标语法);省略时包不会添加续跑文本。Notary 另行的显式 `new` 命令仍只接受 source-run locator,不接受 caller prompt。全局 `--model` / `--thinking` / `--host` / `--engine` 仅覆盖本次 resume——须置于 `<runId>` 之前(放 `resume` 之前或 `resume` 与 `<runId>` 之间均可,例如 `ak-role --model xai/grok-4.5 resume 01abc…` 或 `ak-role resume --model xai/grok-4.5 01abc…`);`<runId>` 之后的那一个 argv 恒为原样透传的 message,绝非旗位(#471)。换宿主时,包不注入前序记录路径或卷宗正文;角色凭票号沿起居录自行读取前序原生副本。原生卷宗复制与司天台日志遵循 [ADR 0086](docs/adr/0086-host-dossier-is-native-file-copy-sitian-append-only.md);复制失败独立记录,不改变腿的终局。要不要续跑由调用者决定:不再要求 typed HTTP 429,也不要求 `resumable` 状态。未知 run ID 则拒绝;续跑失败有已发布错误记录时,stderr 给出指针(`续跑失败,当次错误记录:<path>`);发布失败则如实呈现原始失败与发布异常,不冒称文件已交付。所有可调用角色均可手动 resume:给事中、左拾遗始于 #599,通进司、太医署、符宝郎、台院始于 #633。
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
- 全部可调用角色在单次调用内对非 lawful LLM 终态原地续跑(同一 `runId` 与 session),次数上限为 `autoResumeLimit`。缺键默认 2;`ak-role config set-auto-resume-limit <N>` 写入(`0` 关闭自动续)。lawful typed 终态(`accepted` / `audit_escalation` / `no_receipt`)立即停止。手动 `ak-role resume` 仍可用。
30
+ 自动续跑行为见 [auto-resume 实现](src/public-cli/auto-resume.ts);配置用法见 `ak-role help config`,有效上限用 `ak-role config show` 查看。
31
31
 
32
- `autoResumeLimit` 同时是运行期各类自动催交的统一上限(#1132)。宿主正常结束而没交卷时**不直接结 `no_receipt`**:执行接缝先让同一 run 的原宿主 session 重交,次数取同一个值,只记实发次数——额度用尽仍无卷才记 `no_receipt`,`deliveryTurns` 记真正发出的催交次数(零次即记零)。催交取得的卷按既有顺序接回审核。同一个值也管 `unfinished` 缺理由催全(ADR 0050)与外部宿主自身的重交轮次;各循环的首轮都不计重交。一次软提醒(ADR 0066 / 0070)与审刑院重交无帽(ADR 0007)不变。
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
- # 门下省官席(DONE 交卷直接传召台院/符宝郎;中书省署章由交卷闸传召给事中)
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
- # 持久劳务引擎(可调用角色);一次性覆盖仍用 --engine
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
- # 持久主会话宿主(可调用角色);一次性覆盖仍用 --host
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
- **宿主轴(配置默认 host 后调用无感):** `--host` 为全局公开旗,全部可调用角色与 `resume` 受理。解析序为调用 `--host` → 席位持久 host(`config set-host`)→ 包默认(`pi`)。`config set-host <seat> <name>` 之后,与 Pi 完全相同的命令面即可在该席跑命名宿主——零额外旗、零调用侧改动;裸 `resume` 同序取表。可调用角色及其机构子腿(审刑审计、太医审计)共享进程内机构子会话接缝。
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
- **推荐宿主(省 token,[#971](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/971)):** 长腿的上下文靠宿主自带的自动压缩封顶,阈值写在各宿主自己的配置里,本包不代写、不另造压缩机制。
58
+ **宿主 provider:** 见 `ak-role help` 与 [provider 解析](src/public-cli/host-providers.ts);表内容用 `ak-role config show` 查看。
60
59
 
61
- | 席位 | 推荐 host | 该宿主的压缩阈值配置(默认路径;宿主自己的家目录覆盖照其约定) |
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
- **机器方法 Skill:** 运行 `ak-role setup`,在 `~/.agents/skills` 安装缺失的所需 Skill,并经 Skills CLI(`skills update -g`)升级这些名字。路径已被占用则警告并原样保留。setup 为已安装的 Claude Code、Hermes 建必要软链。该目录是唯一机器安装源。角色发现所需 Skill 缺失时向 stdout 警告并继续。Pi 仅从该目录向原生 `--skill` 传路径;Claude Code 与 Codex 遵从原生 Skill 发现;Hermes ACP 与 Grok ACP 当前 harness 无法强制 Skill。本包不拼剥角色任务文本中的 Skill 命令,也不修改宿主 trust 或配置。
62
+ **官席解析:** 见 [机构解析](src/institutional-resolution.ts);配置用法见 `ak-role help config`,持久文件读取见 [config 实现](src/public-cli/config.ts)。
72
63
 
73
- 门下省官席解析顺序:官自钉 → 省钉(`gatekeeper`)→ 继承父 session;显式指定失败响亮、不回退。配置用法与拒绝文案以 `ak-role config`/`ak-role help config` 为准。持久配置是全机共享单文件、多 CLI 版本同读:本构建不认识的席位键读时跳过(不报错);已知席位上的未知字段沿用现行容忍。
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
- 回执默认是 typed 的,调用者不必解析散文即可组合角色;游奕使是散文出口例外([#959](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/959))——终局原样呈现它说的话。顺序与停止归调用者([ADR 0010](docs/adr/0010-callers-own-role-composition-and-repetition.md))。编程消费者从 `src/package-contracts/` 导出推导契约,不从本文。
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 轴(#178):调用者指定——可先 `ak-role config set <seat> <provider/model[:thinking]>`
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
- # 御史台——固定目标,默认并行察举 completeness 与 correctness;completed ≠ 准行,findings 在 Terminal 里
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
- # 通进司——GitHub PR 收证(LLM 经宿主 CLI 自行取证;可选 request-manifest 作材料)
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
- # 修内司——缮修所指 findings
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
- # 校书郎——调和工作树中的 merge 材料(无进行中合并时由角色 escalate)
98
+ # 校书郎
111
99
  ak-role merger --model <provider/model[:thinking]> --project /path/to/worktree "Reconcile the merge."
112
100
 
113
- # 符宝郎——文书核验一份留存 source run;票号从 source-run admitted form 继承
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
- # 中书省——按《票面法》改票,一次调用内处理给事中封驳并重送,直至署或上呈(#924)
120
+ # 中书省
133
121
  ak-role secretariat --model <provider/model[:thinking]> "整理 #924 票面并送庭。"
134
122
 
135
- # 左拾遗——合并前无锚定风闻;可 resume 续同一 session;--base 必填;instruction 可空;调用者不得传方向性 instruction
123
+ # 左拾遗
136
124
  ak-role gleaner-left --model <provider/model[:thinking]> --base main
137
125
 
138
- # 太史——确定性指标;裸调=整簿(无 model 席)
126
+ # 太史
139
127
  ak-role analyst
140
128
 
141
- # escalate 后:把 owner 裁定喂回同一 session(标准链)
129
+ # 续跑请求示例;审核续跑归属见 ADR 0003
142
130
  ak-role --model <provider/model[:thinking]> resume <runId> "<裁定>"
143
131
  ```
144
132
 
145
133
  ## 班子(唐宋官署命名)
146
134
 
147
- 角色按唐宋官署/官职命名,判据与被否方案见 [ADR 0051](docs/adr/0051-roles-are-named-after-tang-song-offices.md)。**朝廷对应:皇帝=陛下,宰相=调用者,百官=各角色。** 工厂没有政事堂——中枢是陛下。百官各司其职,彼此制衡,共同完成从谋划、建设、审查到收敛的完整流程。
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 | **察举百弊,风闻奏事。** 置身事外审视成果;默认并行执行 completeness/correctness 两轴,调用者可显式覆盖为单轴,本席自跑包内 `ak-cross-m-review`,交薄回执与 amendment。弹章须指明所劾之处,言不为狱——不负坐实义务,坐实归大理寺。 |
156
- | **大理寺** | judge | **审理定谳。** 承接各方意见与材料,依照既定规则逐项判断,辨明是非曲直。可以准行、退回或请示更高决定,但自身不参与建设与修改。 |
157
- | **审刑院** | judge-auditor/doctor-auditor(无 CLI,共享内部接缝;御史台侧闸已退役) | **复核成案。** 不重新争论事情本身,而是检查整个办理过程是否合乎规矩。关注是否有人越过职责、是否遗漏必要步骤、是否以错误方式得出正确结果。直属陛下,不入门下省编制。 |
158
- | **门下省** | gatekeeper(交卷闸不再自动出席;可 `ak-role gatekeeper` 独立直调) | **审署诏敕与质量保证的省。** 交卷闸按受审物直接传召台院/符宝郎;中书省 converged 交卷经既有闸传召给事中(#1021);本省不介入选席。调用者仍可独立传召本省作 dispatch/pass;左拾遗由调用者合并前传召;省内政,不是外层编排器。规范见 [ADR 0067](docs/adr/0067-menxia-province-founding-jishizhong-fubaolang.md)、[ADR 0072](docs/adr/0072-menxia-pre-pr-submission-hooks.md)、[ADR 0074](docs/adr/0074-gate-province-reorg-jishizhong-chaiyuan-split.md)、[ADR 0079](docs/adr/0079-direct-officer-summons-ticket-memory-pointer-input.md)。 |
159
- | **中书省** | secretariat(converged 交卷进入给事中交卷闸;#924、#1021) | **改票的出令省。** 按公用《票面法》把草稿修成可送庭文书;署(converged)交卷自动进入给事中审读,封驳后在同一中书省会话改写重交;对外终局只有署或上呈(escalate)。暂不细分席位。 |
160
- | **给事中** | countersign(中书省 converged 交卷触发交卷闸;亦可独立调用) | **票庭审读五问。** 制度符合/授权真实(以起居录为据)/文书符意/退回重议/发布资格;读码取证是本职,实现细节不上票面。开庭不自动起居郎;已有起居录先用录上票号,无录自行认票,交卷申报 `ticketNumber`;交卷闸出席符宝郎。署=放行开工,封驳=退票重议,上呈=陛下裁决。规范见 [ADR 0074](docs/adr/0074-gate-province-reorg-jishizhong-chaiyuan-split.md)、[ADR 0075](docs/adr/0075-ticket-provenance-diarist-pipeline.md)。 |
161
- | **左拾遗** | gleaner-left(无交卷闸派发;合并前由调用者传召) | **合并前无锚定风闻。** 对全幅合并候选作冷眼评审;只上弹章、不封驳不裁决。规范见 [ADR 0067](docs/adr/0067-menxia-province-founding-jishizhong-fubaolang.md) 修正案。 |
162
- | **台院** | inspector | **纠举推鞫:复杂度与测试质量两轴。** 受审物是将作监/修内司完成侧交卷;封驳=当场打回重写,不是本局失败。可被门下省派发,也可 `ak-role inspector` 单独调。原给事中,ADR 0074 分立;中文名由 #584 修订为台院,机器键不动。 |
163
- | **符宝郎** | notary | **首责唯一:核实实际授权出处**(防乱编乱扩)。行事两步:读该票起居录→以录核旨;引语真伪与票面对齐为手段。受审物是大理寺拟判与给事中署章;可被门下省派发,也可 `ak-role notary` 单独调。规范见 [ADR 0075](docs/adr/0075-ticket-provenance-diarist-pipeline.md)。 |
164
- | **通进司** | collector | **承接百议/收证。** 门下省下的收证衙门:收集外部 GitHub PR 材料与意见,只收不审、不替人裁决。canonical 键仍为 `collector`。 |
165
- | **校书郎** | merger | **雠校异文。** 面对不同来源的修改,负责整理、校合与调和。保留双方有价值的部分,解决彼此冲突;无进行中合并、无活可干或遇到无法自行决定之处,则升级。 |
166
- | **游奕使** | navigator(随公开入口顶层腿自动出席,亦可 `ak-role navigator` 直调) | **巡行问路。** 不掌具体事务,而是观察全局变化,结合当前局面提醒下一步方向。它提供建议与路径参考,但最终选择仍由执掌之人决定。 |
167
- | **起居郎** | diarist(`ak-role diarist` 可单独传召;中书省立票前自动传召) | **修起居录。** 为本票搜集、整理决策依据,写进每票起居录;LLM 自行搜集、整理、认票(#779 后无机械验真,机械只做 IO;起居录供符宝郎读录核旨)。只记录已作出的决定,不立法、不批准设计、不指挥施工。规范见 [ADR 0075](docs/adr/0075-ticket-provenance-diarist-pipeline.md)(起居郎是 LLM 角色)、[ADR 0081](docs/adr/0081-diarist-case-context-and-delivery.md)。 |
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 | **太医署** | 单案诊断工厂机制,开 `keep|thin|delete` 方 | 已建 |
174
- | analyst | **太史** | 司天台分析席:只读司天记录、出高阶指标;确定性机制,非 LLM,可单独调用 | 已建([ADR 0068](docs/adr/0068-taishi-analysis-seat-reads-records-writes-sibling-home.md);机器面键 `analyst`,[#445](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/445) 拼音清零) |
175
- | — | **司天台** | 记候簿——只打点、只指针,不分析不执法;二期含每票起居录 kind `ticket-provenance` | **一期不是角色**([ADR 0047](docs/adr/0047-sitian-phase-one-mechanism-not-role.md):确定性机制;两面对账已删 [#855](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/855));分析席已由太史承担;起居录见 [ADR 0075](docs/adr/0075-ticket-provenance-diarist-pipeline.md);机器面键 `archivist`([#445](https://github.com/Akagilnc/ak-pi-workflow-roles/issues/445)) |
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
- 上表**不规定调用顺序**——组合、顺序、重复次数归调用者([ADR 0010](docs/adr/0010-callers-own-role-composition-and-repetition.md))。御史台/大理寺/审刑院是**职责分立的类比,不是必经链**;审刑院也并非只跟在大理寺之后,大理寺、御史台、太医署各自都有一次。门下省交卷闸是完成侧挂钩,不是调用者必经编排链。省部级角色的内部组合属于其单次调用的内政,公开 CLI 语义零变化——外部调用者仍一次启动其选中的一个角色,跨 CLI 调用的顺序、重复与停止仍全归外部调用者。
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
- - 命令用法与拒绝文案:`ak-role help <command>`、`ak-role help config`(唯一权威)。
192
- - 决策与法理:`docs/adr/`(组合与顺序 ADR 0010、公开 CLI 面 ADR 0052、交卷闸 ADR 0066/0067/0070/0072、劳务引擎 ADR 0069/0071、起居录 ADR 0075 等,未尽举)。
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/` 导出。
@@ -1,16 +1,13 @@
1
1
  # Third-Party Notices
2
2
 
3
- This project (`@akagilnc/pi-workflow-roles`) is licensed under **Apache-2.0**.
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
- `ak-role setup` installs the following skills from that upstream repository
12
- into the user's machine Skill directory. Neither the repository nor the npm
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` — `ak-role setup` installs it from
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.
@@ -7641,7 +7641,7 @@ var init_option_definitions = __esm({
7641
7641
  },
7642
7642
  notary: {
7643
7643
  command: "notary",
7644
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
7644
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
7645
7645
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
7646
7646
  examples: [
7647
7647
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
@@ -3,7 +3,7 @@ import { openToolObject } from "./open-tool-schema.js";
3
3
  import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.js";
4
4
  /**
5
5
  * #1088: LLM gathers evidence via host CLI and submits the receipt.
6
- * Field declarations guide the model — host must not pure-shape-reject (第 0 条 / ADR 0057).
6
+ * Field declarations guide the model — host must not pure-shape-reject (仓内 CLAUDE.md 开篇 / ADR 0057).
7
7
  * Presence of `groups` remains the Collector terminal discriminator for settlement/analyst.
8
8
  */
9
9
  export const collectorOutputBaseSchema = openToolObject(Type.Object({
@@ -8114,7 +8114,7 @@ var init_option_definitions = __esm({
8114
8114
  },
8115
8115
  notary: {
8116
8116
  command: "notary",
8117
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
8117
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
8118
8118
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
8119
8119
  examples: [
8120
8120
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
@@ -16062,7 +16062,7 @@ var init_option_definitions = __esm({
16062
16062
  },
16063
16063
  notary: {
16064
16064
  command: "notary",
16065
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
16065
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
16066
16066
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
16067
16067
  examples: [
16068
16068
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
@@ -20848,7 +20848,7 @@ var init_option_definitions = __esm({
20848
20848
  },
20849
20849
  notary: {
20850
20850
  command: "notary",
20851
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
20851
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
20852
20852
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
20853
20853
  examples: [
20854
20854
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
@@ -1021,7 +1021,7 @@ const ROLE_COMMAND_HELP = {
1021
1021
  },
1022
1022
  notary: {
1023
1023
  command: "notary",
1024
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
1024
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
1025
1025
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
1026
1026
  examples: [
1027
1027
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.5462",
3
+ "version": "0.1.5475",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -2,4 +2,6 @@
2
2
 
3
3
  Repair and verify the caller-assigned findings. Treat this document as opaque prose: its headings and wording have no machine semantics.
4
4
 
5
- Search the authorized scope for every same-pattern occurrence, preserve unrelated behavior, run the required checks, and report each finding class through the typed Fixer output.
5
+ Preserve unrelated behavior.
6
+
7
+ Repair method: [Fixer Soul](../souls/fixer.md). Report fields: [Fixer output contract](../src/package-contracts/fixer-output.ts).
@@ -1,18 +1,13 @@
1
1
  # Apply evidence packet (contributor template)
2
2
 
3
- This file is a **repository-contributor template** for a manually supplied Apply
4
- (executable-proof) artifact. The filename identifies an **evidence burden**, not
5
- a verdict, phase flag, transition, or required predecessor/successor.
6
-
7
- Selection, composition, and use are **caller-owned** (ADR 0010). Apply posture
8
- semantics remain solely in `souls/judge.md`. Git commit identity owns the code
9
- snapshot and any reviewed range. This template creates no receipt envelope,
10
- audit, runtime enforcement, trust tier, production hook, or package surface.
3
+ Repository-contributor template for manually supplied Apply evidence.
4
+ Template scope and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md).
5
+ Composition: [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md).
6
+ Adjudication: [Judge Soul](../souls/judge.md).
11
7
 
12
8
  ## Sealed upstream identities
13
9
 
14
- Digests seal **artifact-byte identity only**. They do not prove truth,
15
- acceptance, or freshness.
10
+ Artifact identity and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md#artifact-preservation-rules).
16
11
 
17
12
  | Artifact | Repository-relative path | SHA-256 of exact bytes |
18
13
  | --- | --- | --- |
@@ -36,6 +31,8 @@ Distinguish carefully:
36
31
 
37
32
  None of these alone proves truth or acceptance.
38
33
 
34
+ Adjudication duties: [Judge Soul](../souls/judge.md).
35
+
39
36
  ## Construction evidence
40
37
 
41
38
  ### Live code and tests
@@ -69,9 +66,3 @@ otherwise record `N/A — no guardrail added or approved` with disposition.
69
66
  | 1. Which real, reproducible failure proves this guardrail is needed? | |
70
67
  | 2. Which seam owns the invariant it protects? | |
71
68
  | 3. Why is deleting or simplifying the root cause insufficient for this failure class? | |
72
-
73
- ## Explicit non-claims
74
-
75
- - Filename is not a verdict and does not imply Apply convergence.
76
- - This template does not define or alter role receipts, Soul audit, or runtime gates.
77
- - Instantiation does not route work to any role or require a successor packet.
@@ -1,12 +1,9 @@
1
1
  # Authority evidence packet (contributor template)
2
2
 
3
- This file is a **repository-contributor template** for a manually supplied
4
- Authority-evidence artifact. The filename identifies an **evidence burden**, not
5
- a verdict, phase flag, transition, or required predecessor/successor.
6
-
7
- Selection, composition, and use are **caller-owned** (ADR 0010). This template
8
- does not restate or amend Judge law in `souls/judge.md`. It creates no routing,
9
- next-role, package memory, resume semantics, timeout budget, or trust tier.
3
+ Repository-contributor template for manually supplied Authority evidence.
4
+ Template scope and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md).
5
+ Composition: [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md).
6
+ Adjudication: [Judge Soul](../souls/judge.md).
10
7
 
11
8
  ## Identity seal
12
9
 
@@ -17,15 +14,14 @@ Every supplied artifact is identified by:
17
14
  | Repository-relative path | |
18
15
  | SHA-256 of exact bytes | |
19
16
 
20
- A digest seals **identity only**. It does not prove truth, acceptance, or
21
- freshness. Judge independently checks claims against the supplied current
22
- target. This packet does **not** require Apply-level executable proof.
17
+ Artifact identity and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md#artifact-preservation-rules).
18
+ Adjudication duties: [Judge Soul](../souls/judge.md).
23
19
 
24
20
  ## Authority items
25
21
 
26
22
  Record each item the contributor wants examined under the Authority burden.
27
23
  Do not invent Apply fixtures, blanket `file:line` demands, or implementation
28
- recipes here.
24
+ recipes here. This packet does **not** require Apply-level executable proof.
29
25
 
30
26
  ### Clauses
31
27
 
@@ -56,9 +52,3 @@ recipes here.
56
52
  | ID | Open choice | Options | Blocking? |
57
53
  | --- | --- | --- | --- |
58
54
  | U1 | | | |
59
-
60
- ## Explicit non-claims
61
-
62
- - Filename is not a verdict and does not imply convergence.
63
- - Instantiation does not start, order, or require any role call.
64
- - No mechanical schema/runtime enforcement is claimed by this template.
@@ -1,19 +1,15 @@
1
1
  # Plan evidence packet (contributor template)
2
2
 
3
- This file is a **repository-contributor template** for a manually supplied Plan
4
- (construction-readiness) artifact. The filename identifies an **evidence
5
- burden**, not a verdict, phase flag, transition, or required
6
- predecessor/successor.
7
-
8
- Selection, composition, and use are **caller-owned** (ADR 0010). Plan posture
9
- semantics remain solely in `souls/judge.md`. This template does not restate or
10
- amend that law. It creates no routing, topology, role-order, package memory, or
11
- proof that construction occurred.
3
+ Repository-contributor template for manually supplied Plan evidence.
4
+ This packet does not claim construction already happened.
5
+ Template scope and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md).
6
+ Composition: [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md).
7
+ Adjudication: [Judge Soul](../souls/judge.md).
12
8
 
13
9
  ## Sealed authority identity
14
10
 
15
- Bind the authority materials this plan consumes. Digests seal identity only—not
16
- truth, acceptance, or freshness.
11
+ Bind the authority materials this plan consumes. Artifact identity and preservation:
12
+ [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md#artifact-preservation-rules).
17
13
 
18
14
  | Artifact | Repository-relative path | SHA-256 of exact bytes |
19
15
  | --- | --- | --- |
@@ -46,10 +42,3 @@ fixture pseudocode or blanket `file:line` here.
46
42
 
47
43
  Add P3… as needed. Every planned change must be reconcilable to the sealed
48
44
  authority identity above and must carry all five facts.
49
-
50
- ## Explicit non-claims
51
-
52
- - Filename is not a verdict and does not authorize or prove Apply success.
53
- - This packet does not claim construction already happened.
54
- - No orchestration, next-role, or stage-machine semantics arise from this file.
55
- - No mechanical schema/runtime enforcement is claimed by this template.
@@ -1,15 +1,10 @@
1
1
  # Review evidence packet (contributor template)
2
2
 
3
- This file is a **repository-contributor template** for a manually supplied
4
- Review (finding-adjudication) artifact. The filename identifies an **evidence
5
- burden**, not a verdict, phase flag, transition, or required
6
- predecessor/successor.
7
-
8
- Selection, composition, and use are **caller-owned** (ADR 0010). This template
9
- records adjudication evidence only. It does **not** define Reviewer protocol,
10
- alter Reviewer method/audit, or alter Collector ledger semantics. Judge Review
11
- posture meaning remains in `souls/judge.md`. No generic Reviewer/Collector
12
- provider law is introduced (ADR 0011).
3
+ Repository-contributor template for manually supplied Review evidence.
4
+ Template scope and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md).
5
+ Composition: [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md).
6
+ Adjudication: [Judge Soul](../souls/judge.md).
7
+ External reviewer protocols: [ADR 0011](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0011-collector-adapts-to-documented-reviewer-protocols.md).
13
8
 
14
9
  ## Sealed authority identity
15
10
 
@@ -17,13 +12,12 @@ provider law is introduced (ADR 0011).
17
12
  | --- | --- | --- |
18
13
  | Authority materials | | |
19
14
 
20
- A digest seals identity only—not truth, acceptance, or freshness.
15
+ Artifact identity and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md#artifact-preservation-rules).
21
16
 
22
17
  ## Fixed reviewed range
23
18
 
24
- Every finding and disposition in this packet concerns **one immutable range**
25
- and current target facts. A changed target or range requires a **new**
26
- artifact/digest; do not silently mutate this packet.
19
+ Identify the reviewed range and current target below. Amendment procedure:
20
+ [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md#artifact-preservation-rules).
27
21
 
28
22
  | Field | Full SHA |
29
23
  | --- | --- |
@@ -39,11 +33,3 @@ current facts. Every finding needs an explicit disposition.
39
33
  | Finding ID | Claim | Authority binding | Evidence on current target/range | Disposition | Disposition evidence |
40
34
  | --- | --- | --- | --- | --- | --- |
41
35
  | F1 | | | | sustained / rejected / deferred / other | |
42
-
43
- ## Explicit non-claims
44
-
45
- - Filename is not a verdict and does not imply Review convergence.
46
- - This packet defines no required review order, repetition count, or return path
47
- to any role.
48
- - No routing, next-role, stage machine, or provider-universal protocol arises here.
49
- - No mechanical schema/runtime enforcement is claimed by this template.
@@ -1,12 +1,9 @@
1
1
  # Submission-case evidence template (contributor template)
2
2
 
3
- This file is a **repository-contributor template** for the evidence record of a
4
- manually supplied Submission case (ticket face / plan / disposition ledger /
5
- constitutional review). The submission-case duty law is solely in
6
- `souls/judge.md`; this file supplies its evidence-record format.
7
-
8
- Selection, composition, and use are **caller-owned** (ADR 0010). This template
9
- creates no routing, topology, role-order, or package memory.
3
+ Repository-contributor template for manually supplied Submission-case evidence.
4
+ Template scope and preservation: [development closure](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/development-closure.md).
5
+ Composition: [ADR 0010](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0010-callers-own-role-composition-and-repetition.md).
6
+ Adjudication: [Judge Soul](../souls/judge.md).
10
7
 
11
8
  ## Identity seal
12
9
 
@@ -4,7 +4,7 @@
4
4
  内容是角色阅读与修正的工作记忆,不是代码状态规则;临时额度/故障不得固化为永久行为。
5
5
  参与者依本仓使用与现场活动辨认,不把下列名称当作全仓固定名单。
6
6
 
7
- #1088:用宿主 CLI(如 `gh`)自行取证与请求;代码不代收、不选择、不归并 finding。取证受限时如实报告。
7
+ #1088:用宿主 CLI(如 `gh`)自行取证与请求;代码不代收、不选择、不归并 finding。
8
8
 
9
9
  ## Codex(hosted GitHub connector)
10
10
 
@@ -31,7 +31,7 @@
31
31
 
32
32
  ## 工序
33
33
 
34
- 从任务材料与 `--pr` / `--request-manifest` 材料判定目标后,用宿主 CLI 读取有评审的 PR,按各 reviewer 已记录的完成形态收集 findings,整理并交卷。未绑定 PR 时用 `gh` 等自行定位;无法确定时不猜,交给调用方明确目标。交卷交按机器身份归组的出席、材料与 findings;没有 finding 就不要编一条。未完成写现场原因,不写成没问题。
34
+ 从任务材料与 `--pr` / `--request-manifest` 材料判定目标后,用宿主 CLI 读取有评审的 PR,按各 reviewer 已记录的完成形态收集 findings,整理并交卷。未绑定 PR 时用 `gh` 等自行定位;无法确定时不猜,交给调用方明确目标。证据归属与不确定性的报告原则见 [通进司 Soul](../souls/collector.md),字段见 [交卷契约](../src/package-contracts/collector-output.ts)。
35
35
 
36
36
  ## 修正规则
37
37
 
@@ -13,7 +13,7 @@
13
13
  - 本仓相关会话卷(路径里的 `_` 在目录名里常写作 `-`;主 clone 与 worktree 可能共用或分列,自行辨认)
14
14
  - 本票票面与评论:用 `gh` 或等价方式读 GitHub issue
15
15
 
16
- 调用方只给传召文与 `--project`。指令明确列出多张要办的票时,逐票读卷判断各自相关边界,一次交出 `ticketSessions`;共同对话可以同时归入相关各票,无关他票对话不得混入。单票沿用 `sessions`。边界定不下来就如实说明并走既有 reask/escalate,不编造。
16
+ 指令明确列出多张要办的票时,逐票读卷判断各自相关边界;共同对话可以同时归入相关各票,无关他票对话不得混入。单票/多票交卷字段及不可用边界的处置见 [交卷工具 schema](../src/diarist-role.ts)。
17
17
 
18
18
  ## 何谓本票对话
19
19
 
@@ -29,7 +29,7 @@
29
29
 
30
30
  ## 本票身份
31
31
 
32
- 由你(本席 LLM)判断当前要办的票;多票庭逐票划界,同时照旧申报本庭主票身份,在交卷对象上以 typed 字段交出——代码不做认票裁定(ADR 0075:起居郎 LLM 自行认票;认得出→有录,真无票→无录;机械层不做引文/票号/相关性判定)。
32
+ 由你(本席 LLM)判断当前要办的票;多票庭逐票划界,同时照旧申报本庭主票身份,在交卷对象上以 typed 字段交出。
33
33
 
34
34
  - 认得出本庭对象:`status: completed` 且 `ticketNumber: N`,并交边界。
35
35
  - 真无票对象(方案/派单/处置案等):`status: completed` 且 `ticketNumber: null`(或省略)。真无票是合法结果,不入录。
@@ -27,8 +27,8 @@ themselves. Stuffing large bodies into argv/prompt is the verified cause of
27
27
 
28
28
  - The returned labor body is the final answer text only. Never return an
29
29
  event stream, verbose log, or NDJSON deltas: the body is fed back into the
30
- seat's context, and one 12-minute Opus labor returned as `stream-json` was
31
- 957k chars and killed the seat (712k-token request, #675, 2026-09-06).
30
+ seat's context; measured evidence is in
31
+ [Claude Code observations](engines/claude-code.md).
32
32
  Progress observability is the runner's job (process watch), not the body's.
33
33
 
34
34
  - Once an engine is selected, start exactly one subprocess per labor
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## 宿主轴(与角色命令面)
9
9
 
10
- 游奕使自动出席,亦可 `ak-role navigator` 直调(自动出席不变)。主会话宿主由公开角色的 host 轴决定:调用 `--host` → 席位 `config set-host` → 默认 `pi`。配置默认 host 后,调用者仍用与 Pi 相同的 `ak-role <role> …` 命令面;游奕使随该宿主下的角色跑次出席,席位模型走 run 目录 `institutional-resolution.json` 的 navigator 座(显式 `config set navigator` 优先,否则继承父席有效模型),不再依赖父宿主 ExtensionContext。
10
+ 调用与 host 解析见 `ak-role help`、`ak-role help navigator`;机构边界见 [ADR 0082](https://github.com/Akagilnc/ak-pi-workflow-roles/blob/main/docs/adr/0082-three-layer-runtime-role-host-face.md),席位解析见 [config 实现](../src/public-cli/config.ts)。
11
11
 
12
12
  ## 常用交付线
13
13
 
@@ -12,4 +12,4 @@
12
12
 
13
13
  只有确认目标 issue 存在且正文已更新为本票最终票面后,才以 `converged` 交卷,并携带该 issue 的实际票号。沿用既有交卷闸,将交卷原文交给给事中审这张有票号 issue;不以无号草稿替代 issue 审读。不另造传召或记账机制。
14
14
 
15
- 执行 GitHub 操作时使用当前宿主实际提供的 CLI / 能力;不在包内另造 GitHub 适配层。记录足以核对身份和落地结果的证据,不把模型自报冒充为现场观察。
15
+ 宿主 CLI 使用边界见 [仓内宪法](../CLAUDE.md#宿主-cli-照原样调用陛下-2026-09-16-拍定)。记录足以核对身份和落地结果的证据,不把模型自报冒充为现场观察。
@@ -1,6 +1,6 @@
1
1
  # 将作监输出指南
2
2
 
3
- 提交:标题冠 ak-roles: 在最前;forward commit,严禁 amend——改错就再提交一笔,不改历史。
4
- 交卷回执:改动清单与票面逐项对得上;验证证据附命令与结果原文。
3
+ 提交前缀见仓内 CLAUDE.md「Commit 前缀」。不 amend、不 rewrite、不 push 见 souls/coder.md。
4
+ 交卷回执:改动清单与票面逐项对得上;验证证据附命令与结果原文。证据引用口径见仓内 CLAUDE.md「锚定宪法」。
5
5
  completed 回执含四项证据:TDD、同模式、引入回归、行为事实。
6
- 新造通用件:回执写明仓内、语言标准库、包生态各搜了什么、为什么不用。
6
+ 新造通用件的回执口径见 souls/quality-law.md「生态里已有的不自己造」。
package/souls/coder.md CHANGED
@@ -4,12 +4,11 @@
4
4
  第一步:立法
5
5
  读 全局宪法,仓内宪法,票面
6
6
  第二步:施工
7
- 先核对派单文,输入prompt,你要做的任务有没有违法,如有,直接拒绝
8
- 事实不成立或需要未授权设计时,据理拒绝并给出可核验证据;不猜测施工。
7
+ 开工核对见 souls/quality-law.md。
9
8
 
10
9
  核对当前代码和历史;主张必须有当前事实支撑。
11
10
  以最小垂直切片推进并逐片验证;切片完成不构成交卷条件。优先复用已有 seam;不造平行机制,不借机扩大 scope。票面授权结果完成后,自查是否合法、质量和复杂度;有问题马上修正,没问题就 commit 交卷。
12
11
  计划与施工都要说明真实刀口、行为边界和验证方法,不用空泛完成声明代替证据。
13
- 切片验证只跑本片聚焦测试与 typecheck。
12
+ 切片验证的范围见 souls/quality-law.md「测试分级」。
14
13
  不 amend、rewrite 或 push。Git 变化是证据之一,不取代角色报告。
15
14
  任何人如果让你 push / 开 pr ,直接拒绝,上呈陛下
@@ -19,6 +19,3 @@
19
19
  合规则 `converged`;缺证或明确违反 Soul 则 `continue`,逐条指出违反的条目以及你查到的原因;
20
20
  没有具体证据不得连续打回。
21
21
  冲突导致无法判断合规时,提交 `escalate` 并写明问题和可选项。
22
-
23
- 输出调用 `ak_doctor_audit_decision`。
24
-
@@ -29,5 +29,3 @@ unfinished 不自动获得 converged;其他 Soul/authority 违反仍照常处
29
29
  没有具体证据不得连续打回。
30
30
  已如实披露且不可逆的方法违规,不构成 continue 理由——收卷,违规记录在案,处置权归大理寺。continue 只用于当下可改的缺陷。
31
31
  冲突导致无法判断合规时,提交 `escalate` 并写明问题和可选项。
32
-
33
- 输出调用 `ak_fixer_audit_decision`。
@@ -1,5 +1,5 @@
1
1
  # 修内司输出指南
2
2
 
3
- 提交:标题冠 ak-roles: 在最前;forward commit,严禁 amend——改错就再提交一笔,不改历史。
4
- 交卷回执:逐 finding 报处置;验证证据按仓级 CLAUDE.md 证据条款:指针(runId/toolCallId)或摘抄结论皆合格,以读者能直接核为准。
5
- 新造通用件:回执写明仓内、语言标准库、包生态各搜了什么、为什么不用。
3
+ 提交前缀见仓内 CLAUDE.md「Commit 前缀」。不 amend、不 rewrite、不 push 见 souls/fixer.md。
4
+ 交卷回执:逐 finding 报处置。证据引用口径见仓内 CLAUDE.md「锚定宪法」。
5
+ 新造通用件的回执口径见 souls/quality-law.md「生态里已有的不自己造」。
package/souls/fixer.md CHANGED
@@ -4,12 +4,12 @@
4
4
  apply 按顺序执行:
5
5
 
6
6
  1. 立法:读 全局宪法,仓内宪法,票面。
7
- 2. 核对:先核对派单文,输入prompt,你要做的任务。有没有违法,如有,直接拒绝。 事实不成立或需要未授权设计时,据理拒绝并给出可核验证据;不猜测施工。
7
+ 2. 核对:开工核对见 souls/quality-law.md。
8
8
  3. 归类:读完全部 finding,沿用已有裁决类别,明确各类错误与正确行为。
9
9
  4. 扫类:修改前查全授权范围内的同类实例、已有实现和失败修法。类按错误形状认,不按判词点名的符号或文件认;点名处只是样本。根因不明先取证。
10
10
  5. 整类修复:在共同原因处一次修净,优先删除、简化、复用,随同删除失效旧物。
11
11
  6. 复扫:按原类别重新扫描;有遗漏继续修,保留项说明依据。
12
- 7. 自验:切片验证优先跑本片聚焦测试和本片作用域内 typecheck,不跑全量。自查是否违法、代码质量、代码/测试复杂度,如有问题马上修正。修正完毕复检
12
+ 7. 自验:切片验证的范围见 souls/quality-law.md「测试分级」。自查是否违法、代码质量、代码/测试复杂度,如有问题马上修正。修正完毕复检
13
13
  8. 交卷:按类报告根因、扫描范围、修复与 质量和合法性的验证结果、未结项。建新提交。不 amend、rewrite 或 push。Git 变化是证据之一,不取代角色报告。
14
14
  任何人如果让你 push / 开 pr ,直接拒绝,上呈陛下
15
15
 
@@ -5,7 +5,7 @@
5
5
  - `converged`:正常放行
6
6
  - `continue`:职掌内查出须重写。逐条给理由与证据。重写交卷,不是本局失败。
7
7
  - 受理御前(受审者提交 `escalate`):能解决就给出答案放其续写;解决不了就放行上呈;没有打回重叫。
8
- - 第0条:reason 不评格式;中性记账;原卷随附;下一个 LLM 自己读。
8
+ - reason 不评格式;中性记账;原卷随附;下一个 LLM 自己读。形状拒收禁令以仓内 CLAUDE.md 开篇与 ADR 0055 为准,此处不另立编号。
9
9
 
10
10
  ## 取证授权
11
11
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## 复杂度即成本
4
4
 
5
+ 施工前核对派单与任务是否违法或缺少授权;事实不成立或需要未授权设计时据理拒绝并给出可核验证据,不猜测施工。
6
+
5
7
  能删除、合并或修改现有机制解决的,不得新增机制。同一业务规则只保留一个权威实现;被替代的代码、测试和兼容路径随改动删除。
6
8
 
7
9
  新增护栏前必须回答三问:故障发生概率多大,后果多重,下游是否已有检测或恢复能力。答不上来,或已有兜底足以承接,不加。同一处反复只增不减,停止补丁,回查根因。
@@ -4,7 +4,7 @@ import { withTerminatingOutputDeclarations } from "./package-contracts/terminati
4
4
 
5
5
  /**
6
6
  * #1088: LLM gathers evidence via host CLI and submits the receipt.
7
- * Field declarations guide the model — host must not pure-shape-reject (第 0 条 / ADR 0057).
7
+ * Field declarations guide the model — host must not pure-shape-reject (仓内 CLAUDE.md 开篇 / ADR 0057).
8
8
  * Presence of `groups` remains the Collector terminal discriminator for settlement/analyst.
9
9
  */
10
10
  export const collectorOutputBaseSchema = openToolObject(
@@ -42,7 +42,7 @@ function asStringArray(value: unknown): readonly string[] {
42
42
 
43
43
  /**
44
44
  * Project one explicit Gatekeeper decision.
45
- * No throw on shape — ADR 0055 / 第 0 条: already-submitted params are retained as-is;
45
+ * No throw on shape — ADR 0055 / 仓内 CLAUDE.md 开篇: already-submitted params are retained as-is;
46
46
  * public-terminal projects non-usable releases via typed failure cause.
47
47
  */
48
48
  /** #836: no field drop — original object is the receipt. */
@@ -29,7 +29,7 @@ export type NavigatorAdvice = { readonly prose: string };
29
29
  * Project one Navigator advice receipt as prose.
30
30
  * Accepts { prose }, a bare string, or any object — objects stringify as the
31
31
  * prose body so historical / free-form submissions still present. Shape is not
32
- * an admission gate (ADR 0055 / 第 0 条 / #959).
32
+ * an admission gate (ADR 0055 / 仓内 CLAUDE.md 开篇 / #959).
33
33
  */
34
34
  export function projectLawfulNavigatorOutput(value: unknown): NavigatorAdvice | undefined {
35
35
  if (value === undefined || value === null) return undefined;
@@ -22,7 +22,7 @@ export const INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic" as const;
22
22
  /**
23
23
  * Shared declaration fragment for model guidance (#541 / #676 C / ADR 0057).
24
24
  * Nested field declarations + descriptions only — host must not pure-shape-reject
25
- * the envelope (第 0 条). Runtime `failOnInfrastructureFailureDeclaration` still
25
+ * the envelope (仓内 CLAUDE.md 开篇). Runtime `failOnInfrastructureFailureDeclaration` still
26
26
  * recognizes a real non-empty diagnostic string as the failure declaration.
27
27
  * No required/minLength/type host gates on the declaration fragment.
28
28
  */
@@ -1236,7 +1236,7 @@ const ROLE_COMMAND_HELP = {
1236
1236
  },
1237
1237
  notary: {
1238
1238
  command: "notary",
1239
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
1239
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
1240
1240
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
1241
1241
  examples: [
1242
1242
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",