@akagilnc/pi-workflow-roles 0.1.3262 → 0.1.3287
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/README.md +8 -122
- package/README.zh-CN.md +9 -123
- package/dist/gatekeeper-role.js +22 -16
- package/dist/grok/production-host.js +745 -571
- package/dist/package-contracts/gatekeeper-output.js +71 -0
- package/dist/package-contracts/navigator-output.js +48 -0
- package/dist/package-contracts/terminating-tools.js +18 -2
- package/dist/packaged-role-registry.js +24 -0
- package/dist/public-cli/config.js +7 -21
- package/dist/public-cli/main.js +693 -366
- package/dist/public-cli/registry.js +2 -14
- package/dist/session-opening-materials.js +6 -11
- package/extensions/role-runtime.ts +3 -1
- package/package.json +1 -1
- package/resources/navigator-route-playbook.md +1 -1
- package/src/diarist-mechanical.ts +16 -5
- package/src/gatekeeper-role.ts +32 -17
- package/src/grok/production-host.ts +3 -1
- package/src/host-contracts.ts +3 -1
- package/src/navigator-role.ts +17 -0
- package/src/package-contracts/gatekeeper-output.ts +89 -0
- package/src/package-contracts/navigator-output.ts +59 -0
- package/src/package-contracts/terminating-tools.ts +24 -2
- package/src/packaged-role-registry.ts +25 -2
- package/src/pi/role-turn-host.ts +4 -0
- package/src/public-cli/cli.ts +37 -10
- package/src/public-cli/config.ts +6 -30
- package/src/public-cli/instruction-seat-run.ts +147 -0
- package/src/public-cli/invocation.ts +47 -3
- package/src/public-cli/option-definitions.ts +36 -3
- package/src/public-cli/registry.ts +3 -26
- package/src/public-cli/run-lifecycle.ts +8 -2
- package/src/public-cli/settlement.ts +115 -3
- package/src/public-cli/terminal.ts +3 -1
- package/src/role-runtime.ts +64 -1
- package/src/session-opening-materials.ts +6 -11
package/README.md
CHANGED
|
@@ -47,12 +47,12 @@ Seat and Gate-officer configuration:
|
|
|
47
47
|
```bash
|
|
48
48
|
ak-role config set judge <provider/model[:thinking]>
|
|
49
49
|
ak-role config set navigator <provider/model[:thinking]>
|
|
50
|
-
# Gate officers (automatic on submission;
|
|
50
|
+
# Gate officers (automatic on submission; direct commands available)
|
|
51
51
|
ak-role config set gatekeeper <provider/model[:thinking]>
|
|
52
52
|
ak-role config set inspector <provider/model[:thinking]>
|
|
53
53
|
ak-role config set notary <provider/model[:thinking]>
|
|
54
54
|
ak-role config unset gatekeeper
|
|
55
|
-
# persistent labor engine (callable roles
|
|
55
|
+
# persistent labor engine (callable roles); one-shot override remains --engine
|
|
56
56
|
ak-role config set-engine judge opus
|
|
57
57
|
ak-role config unset-engine judge
|
|
58
58
|
# persistent main-session host (callable roles); one-shot override remains --host
|
|
@@ -109,6 +109,12 @@ ak-role notary --source-run <runId@role|path> --ticket 582
|
|
|
109
109
|
# inspector — direct complexity and test-quality check; one-shot
|
|
110
110
|
ak-role inspector --attach ./change.patch "Review this material."
|
|
111
111
|
|
|
112
|
+
# gatekeeper — direct Gate province review; dispatch an officer or pass
|
|
113
|
+
ak-role gatekeeper --attach ./submission.json "审:这批材料该谁审?"
|
|
114
|
+
|
|
115
|
+
# navigator — direct route advice (ordered next-role candidates); automatic attendance unchanged
|
|
116
|
+
ak-role navigator "刚完成 coder apply 收敛,下一步?"
|
|
117
|
+
|
|
112
118
|
# countersign — ticket-court five questions; optional --ticket (diarist pipeline refreshes court diary first)
|
|
113
119
|
ak-role countersign --ticket 582 --attach ./ticket.md "裁:本票是否足以开工。"
|
|
114
120
|
|
|
@@ -127,126 +133,6 @@ Roles are named after Tang/Song offices; the full roster and naming rule live in
|
|
|
127
133
|
|
|
128
134
|
Enable fast tier with `echo "fast_mode = on" > ~/.pi-codex-fast`; disable it with `echo "fast_mode = off" > ~/.pi-codex-fast` (or delete the file). The change takes effect on the next request without a restart. Fast tier costs more than the default tier.
|
|
129
135
|
|
|
130
|
-
<!-- BEGIN GENERATED: public-cli-options -->
|
|
131
|
-
## Public CLI options (generated)
|
|
132
|
-
|
|
133
|
-
Generated from `src/public-cli/option-definitions.ts`. Prefer `ak-role help <command>`. Do not hand-edit this section.
|
|
134
|
-
|
|
135
|
-
### `global`
|
|
136
|
-
|
|
137
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
138
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
139
|
-
| `--model` | — | `provider/model` | no | no | option | — | Override the effective seat model for this invocation (before or after the command). |
|
|
140
|
-
| `--thinking` | — | `level` | no | no | option | — | Override thinking level: off\|minimal\|low\|medium\|high\|xhigh\|max. |
|
|
141
|
-
| `--engine` | — | `name` | no | no | option | — | Labor engine for this invocation (owner pool-directive name; packaged notes attached when present; any role). |
|
|
142
|
-
| `--host` | — | `name` | no | no | option | — | Select the named main-session host adapter for this invocation. |
|
|
143
|
-
| `--help` | `-h` | — | no | no | option | — | Show public CLI help and exit. |
|
|
144
|
-
|
|
145
|
-
### `judge`
|
|
146
|
-
|
|
147
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
148
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
149
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
150
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
151
|
-
|
|
152
|
-
### `coder`
|
|
153
|
-
|
|
154
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
155
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
156
|
-
| `plan\|apply` | `plan`, `apply` | — | no | no | positional | phases=plan\|apply; default=apply | Optional phase token before the instruction; defaults to apply. |
|
|
157
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
158
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
159
|
-
|
|
160
|
-
### `fixer`
|
|
161
|
-
|
|
162
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
163
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
164
|
-
| `plan\|apply` | `plan`, `apply` | — | no | no | positional | phases=plan\|apply; default=apply | Optional phase token before the instruction; defaults to apply. |
|
|
165
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
166
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
167
|
-
| `--prerequisites` | — | `path` | no | no | option | — | JSON array of {id, requirement} prerequisite objects. |
|
|
168
|
-
|
|
169
|
-
### `reviewer`
|
|
170
|
-
|
|
171
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
172
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
173
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
174
|
-
| `--base` | — | `revision` | yes | no | option | — | Required fixed-point revision for the pinned review target. |
|
|
175
|
-
| `--authority-ref` | — | `ref` | no | yes | option | — | Durable authority reference/URL (repeatable; refs only, not inline prose). |
|
|
176
|
-
|
|
177
|
-
### `collector`
|
|
178
|
-
|
|
179
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
180
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
181
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
182
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
183
|
-
| `--pr` | — | `number` | yes | no | option | — | Required positive GitHub pull request number. |
|
|
184
|
-
| `--repo` | — | `owner/repo` | no | no | option | — | GitHub owner/repo override (defaults from origin when github.com). |
|
|
185
|
-
| `--request-manifest` | — | `path` | no | no | option | — | Optional request manifest JSON path ({requests:[{id,body}]}). |
|
|
186
|
-
|
|
187
|
-
### `doctor`
|
|
188
|
-
|
|
189
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
190
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
191
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
192
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
193
|
-
| `--issue` | — | `number` | yes | no | option | — | Required positive issue number for the retained case. |
|
|
194
|
-
| `--runs` | — | `path` | no | no | option | — | Optional project-relative .ak-roles/books/<book>/issues/<n>/runs override matching --issue. |
|
|
195
|
-
|
|
196
|
-
### `merger`
|
|
197
|
-
|
|
198
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
199
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
200
|
-
| `--project` | — | `path` | no | no | option | — | Project root with one ordinary in-progress merge (defaults to cwd). |
|
|
201
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
202
|
-
|
|
203
|
-
### `inspector`
|
|
204
|
-
|
|
205
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
206
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
207
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
208
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
209
|
-
|
|
210
|
-
### `notary`
|
|
211
|
-
|
|
212
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
213
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
214
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
215
|
-
| `--source-run` | — | `runId@role\|path` | yes | no | option | — | Required source run locator (runId@role under the book home, or path to that run directory). Zero prompt/attachment projection. |
|
|
216
|
-
| `--ticket` | — | `number` | no | no | option | — | Optional ticket/issue number when Notary reads the court diary (ticket-provenance) for a ticket. |
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
### `countersign`
|
|
220
|
-
|
|
221
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
222
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
223
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
224
|
-
| `--attach` | — | `path` | no | yes | option | — | Attach a regular file; frozen at admission (repeatable). |
|
|
225
|
-
| `--ticket` | — | `number` | no | no | option | — | Ticket/issue number for court diary (diarist) and ticket-keyed provenance. Overrides attachment frontmatter when both present. |
|
|
226
|
-
|
|
227
|
-
### `gleaner-left`
|
|
228
|
-
|
|
229
|
-
Optional free positional `instruction` may be empty. Callers must not pass directional instruction; the seat self-fetches the merge-candidate diff against `--base`.
|
|
230
|
-
|
|
231
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
232
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
233
|
-
| `--project` | — | `path` | no | no | option | — | Project root for ledger identity (defaults to process cwd). |
|
|
234
|
-
| `--base` | — | `revision` | yes | no | option | — | Required comparison-base revision for the unanchored merge-candidate diff. |
|
|
235
|
-
|
|
236
|
-
### `analyst`
|
|
237
|
-
|
|
238
|
-
| Spelling | Aliases | Value | Required | Repeatable | Form | Modes/Phases | Description |
|
|
239
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
240
|
-
| `sweep` | — | — | no | no | positional | modes=sweep | Optional sweep mode token (at most once; no other positionals). |
|
|
241
|
-
| `--ticket` | — | `number` | no | no | option | modes=issue | Ticket/issue number; live filter by invocation.ticketNumber inside the cwd book (git common-dir). Bare call = whole book. No library-index bootstrap. |
|
|
242
|
-
| `--attach` | — | `path` | when:sweep | yes | option | modes=sweep; max=sweep:1 | Sweep-mode attachment path; required exactly once in sweep; payload is the attachment body. |
|
|
243
|
-
| `--cohort` | — | — | no | no | option | modes=cohort | Select cohort mode. |
|
|
244
|
-
| `--group-a-label` | — | `label` | when:cohort | no | option | modes=cohort | Cohort group A label (required in cohort mode). |
|
|
245
|
-
| `--group-a-issues` | — | `N\|book:N[,...]` | when:cohort | no | option | modes=cohort | Cohort group A issues: bare N joins cwd book; book:N selects another book; escape a literal comma/backslash in a book key as \, / \\ (required in cohort mode). |
|
|
246
|
-
| `--group-b-label` | — | `label` | when:cohort | no | option | modes=cohort | Cohort group B label (required in cohort mode). |
|
|
247
|
-
| `--group-b-issues` | — | `N\|book:N[,...]` | when:cohort | no | option | modes=cohort | Cohort group B issues: bare N joins cwd book; book:N selects another book; escape a literal comma/backslash in a book key as \, / \\ (required in cohort mode). |
|
|
248
|
-
<!-- END GENERATED: public-cli-options -->
|
|
249
|
-
|
|
250
136
|
## Normative pointers
|
|
251
137
|
|
|
252
138
|
- Command usage and refusal text: `ak-role help <command>`, `ak-role help config` (sole authority).
|
package/README.zh-CN.md
CHANGED
|
@@ -52,7 +52,7 @@ ak-role config set gatekeeper <provider/model[:thinking]>
|
|
|
52
52
|
ak-role config set inspector <provider/model[:thinking]>
|
|
53
53
|
ak-role config set notary <provider/model[:thinking]>
|
|
54
54
|
ak-role config unset gatekeeper
|
|
55
|
-
#
|
|
55
|
+
# 持久劳务引擎(可调用角色);一次性覆盖仍用 --engine
|
|
56
56
|
ak-role config set-engine judge opus
|
|
57
57
|
ak-role config unset-engine judge
|
|
58
58
|
# 持久主会话宿主(可调用角色);一次性覆盖仍用 --host
|
|
@@ -103,6 +103,12 @@ ak-role notary --source-run <runId@role|path> --ticket 582
|
|
|
103
103
|
# 察院——直调复杂度与测试质量两轴;一次性
|
|
104
104
|
ak-role inspector --attach ./change.patch "Review this material."
|
|
105
105
|
|
|
106
|
+
# 门下省——直调省审:派官或放行
|
|
107
|
+
ak-role gatekeeper --attach ./submission.json "审:这批材料该谁审?"
|
|
108
|
+
|
|
109
|
+
# 游奕使——直调路线建议(有序的下一步角色候选);自动出席不变
|
|
110
|
+
ak-role navigator "刚完成 coder apply 收敛,下一步?"
|
|
111
|
+
|
|
106
112
|
# 给事中——票庭五问;可选 --ticket(起居郎流水线前序工序按票刷新起居录)
|
|
107
113
|
ak-role countersign --ticket 582 --attach ./ticket.md "裁:本票是否足以开工。"
|
|
108
114
|
|
|
@@ -129,14 +135,14 @@ ak-role resume <runId> "<裁定>"
|
|
|
129
135
|
| **御史台** | reviewer | **察举百弊,风闻奏事。** 置身事外审视成果;Standards/Spec 两条取证腿由 runtime 代跑,本席收腿报告出薄回执与 amendment。弹章须指明所劾之处,言不为狱——不负坐实义务,坐实归大理寺。 |
|
|
130
136
|
| **大理寺** | judge | **审理定谳。** 承接各方意见与材料,依照既定规则逐项判断,辨明是非曲直。可以准行、退回或请示更高决定,但自身不参与建设与修改。 |
|
|
131
137
|
| **审刑院** | judge-auditor/doctor-auditor(无 CLI,共享内部接缝;御史台侧闸已退役) | **复核成案。** 不重新争论事情本身,而是检查整个办理过程是否合乎规矩。关注是否有人越过职责、是否遗漏必要步骤、是否以错误方式得出正确结果。直属陛下,不入门下省编制。 |
|
|
132
|
-
| **门下省** | gatekeeper
|
|
138
|
+
| **门下省** | gatekeeper(交卷自动出席,亦可 `ak-role gatekeeper` 直调) | **审署诏敕与质量保证的省。** 交卷时判断受审物、够不够审、该谁审,派察院或符宝郎;给事中票庭由调用者开工前传召;左拾遗由调用者合并前传召(皆非闸派);省内政,不是外层编排器。规范见 [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)。 |
|
|
133
139
|
| **给事中** | countersign(无交卷闸派发;开工前由调用者传召) | **票庭审读五问。** 制度符合/授权真实(以起居录为据)/文书符意/退回重议/发布资格;读码取证是本职,实现细节不上票面。票庭流水线在本席 turn 前跑起居郎工序(调用者无感);交卷闸出席符宝郎。署=放行开工,封驳=退票重议,上呈=陛下裁决。规范见 [ADR 0074](docs/adr/0074-gate-province-reorg-jishizhong-chaiyuan-split.md)、[ADR 0075](docs/adr/0075-ticket-provenance-diarist-pipeline.md)。 |
|
|
134
140
|
| **左拾遗** | gleaner-left(无交卷闸派发;合并前由调用者传召) | **合并前无锚定风闻。** 对全幅合并候选作冷眼评审;只上弹章、不封驳不裁决。规范见 [ADR 0067](docs/adr/0067-menxia-province-founding-jishizhong-fubaolang.md) 修正案。 |
|
|
135
141
|
| **察院** | inspector | **事后察举:复杂度与测试质量两轴。** 受审物是将作监/修内司完成侧交卷;封驳=当场打回重写,不是本局失败。可被门下省派发,也可 `ak-role inspector` 单独调。原给事中,ADR 0074 分立。 |
|
|
136
142
|
| **符宝郎** | notary | **首责唯一:核实实际授权出处**(防乱编乱扩)。行事两步:读该票起居录→以录核旨;引语真伪与票面对齐为手段。受审物是大理寺拟判与给事中署章;可被门下省派发,也可 `ak-role notary` 单独调。规范见 [ADR 0075](docs/adr/0075-ticket-provenance-diarist-pipeline.md)。 |
|
|
137
143
|
| **通进司** | collector | **承接百议/收证。** 门下省下的收证衙门:收集外部 GitHub PR 材料与意见,只收不审、不替人裁决。canonical 键仍为 `collector`。 |
|
|
138
144
|
| **校书郎** | merger | **雠校异文。** 面对不同来源的修改,负责整理、校合与调和。保留双方有价值的部分,解决彼此冲突;遇到无法自行决定之处,则留待重新裁量。 |
|
|
139
|
-
| **游奕使** | navigator
|
|
145
|
+
| **游奕使** | navigator(自动出席,亦可 `ak-role navigator` 直调) | **巡行问路。** 不掌具体事务,而是观察全局变化,结合当前局面提醒下一步方向。它提供建议与路径参考,但最终选择仍由执掌之人决定。 |
|
|
140
146
|
|
|
141
147
|
其余席位:
|
|
142
148
|
|
|
@@ -161,126 +167,6 @@ ak-role resume <runId> "<裁定>"
|
|
|
161
167
|
|
|
162
168
|
开启:`echo "fast_mode = on" > ~/.pi-codex-fast`;关闭:`echo "fast_mode = off" > ~/.pi-codex-fast`(或删文件)。修改后无需重启,下一个请求即生效。Fast 档价格高于默认档。
|
|
163
169
|
|
|
164
|
-
<!-- BEGIN GENERATED: public-cli-options -->
|
|
165
|
-
## 公开 CLI 选项(生成)
|
|
166
|
-
|
|
167
|
-
本表由 `src/public-cli/option-definitions.ts` 生成;以 `ak-role help <command>` 为准。勿手改本区。
|
|
168
|
-
|
|
169
|
-
### `global`
|
|
170
|
-
|
|
171
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
172
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
173
|
-
| `--model` | — | `provider/model` | 否 | 否 | option | — | 覆盖本调用有效席位模型(可置于子命令前或后)。 |
|
|
174
|
-
| `--thinking` | — | `level` | 否 | 否 | option | — | 覆盖 thinking 档位:off\|minimal\|low\|medium\|high\|xhigh\|max。 |
|
|
175
|
-
| `--engine` | — | `name` | 否 | 否 | option | — | 本调用劳动引擎(池令名字;有包内调法笔记则附卷;全部角色可用)。 |
|
|
176
|
-
| `--host` | — | `name` | 否 | 否 | option | — | 为本调用选择具名主会话宿主适配器。 |
|
|
177
|
-
| `--help` | `-h` | — | 否 | 否 | option | — | 显示公开 CLI 帮助并退出。 |
|
|
178
|
-
|
|
179
|
-
### `judge`
|
|
180
|
-
|
|
181
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
182
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
183
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
184
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
185
|
-
|
|
186
|
-
### `coder`
|
|
187
|
-
|
|
188
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
189
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
190
|
-
| `plan\|apply` | `plan`, `apply` | — | 否 | 否 | positional | phases=plan\|apply; default=apply | 指令前可选 phase 词元;默认 apply。 |
|
|
191
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
192
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
193
|
-
|
|
194
|
-
### `fixer`
|
|
195
|
-
|
|
196
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
197
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
198
|
-
| `plan\|apply` | `plan`, `apply` | — | 否 | 否 | positional | phases=plan\|apply; default=apply | 指令前可选 phase 词元;默认 apply。 |
|
|
199
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
200
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
201
|
-
| `--prerequisites` | — | `path` | 否 | 否 | option | — | {id, requirement} 前置条件 JSON 数组路径。 |
|
|
202
|
-
|
|
203
|
-
### `reviewer`
|
|
204
|
-
|
|
205
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
206
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
207
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
208
|
-
| `--base` | — | `revision` | 是 | 否 | option | — | 必填;钉住审查目标的 fixed-point revision。 |
|
|
209
|
-
| `--authority-ref` | — | `ref` | 否 | 是 | option | — | 持久 authority 引用/URL(可重复;仅 ref,非内联散文)。 |
|
|
210
|
-
|
|
211
|
-
### `collector`
|
|
212
|
-
|
|
213
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
214
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
215
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
216
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
217
|
-
| `--pr` | — | `number` | 是 | 否 | option | — | 必填;正整数 GitHub PR 号。 |
|
|
218
|
-
| `--repo` | — | `owner/repo` | 否 | 否 | option | — | GitHub owner/repo 覆盖(默认取 github.com origin)。 |
|
|
219
|
-
| `--request-manifest` | — | `path` | 否 | 否 | option | — | 可选 request manifest JSON 路径({requests:[{id,body}]})。 |
|
|
220
|
-
|
|
221
|
-
### `doctor`
|
|
222
|
-
|
|
223
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
224
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
225
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
226
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
227
|
-
| `--issue` | — | `number` | 是 | 否 | option | — | 必填;留存病例的正整数 issue 号。 |
|
|
228
|
-
| `--runs` | — | `path` | 否 | 否 | option | — | 可选项目相对 .ak-roles/books/<book>/issues/<n>/runs 覆盖,且须匹配 --issue。 |
|
|
229
|
-
|
|
230
|
-
### `merger`
|
|
231
|
-
|
|
232
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
233
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
234
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 已有进行中 ordinary merge 的项目根(默认 cwd)。 |
|
|
235
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
236
|
-
|
|
237
|
-
### `inspector`
|
|
238
|
-
|
|
239
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
240
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
241
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
242
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附加普通文件;受理即冻结(可重复)。 |
|
|
243
|
-
|
|
244
|
-
### `notary`
|
|
245
|
-
|
|
246
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
247
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
248
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份用的项目根(默认进程 cwd)。 |
|
|
249
|
-
| `--source-run` | — | `runId@role\|path` | 是 | 否 | option | — | 必填源 run 定位符(簿内 runId@role,或该 run 目录路径)。零 prompt/附件投影。 |
|
|
250
|
-
| `--ticket` | — | `number` | 否 | 否 | option | — | 可选票号:符宝郎按票键调取起居录时使用。 |
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
### `countersign`
|
|
254
|
-
|
|
255
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
256
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
257
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份的项目根(默认 process cwd)。 |
|
|
258
|
-
| `--attach` | — | `path` | 否 | 是 | option | — | 附卷普通文件;受理时冻结(可重复)。 |
|
|
259
|
-
| `--ticket` | — | `number` | 否 | 否 | option | — | 票号:起居郎流水线与起居录票键。与附件 frontmatter 并存时以本旗为准。 |
|
|
260
|
-
|
|
261
|
-
### `gleaner-left`
|
|
262
|
-
|
|
263
|
-
可选自由 positional `instruction` 可空。调用者不得传方向性 instruction;本席按 `--base` 自取合并候选 diff。
|
|
264
|
-
|
|
265
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
266
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
267
|
-
| `--project` | — | `path` | 否 | 否 | option | — | 卷宗身份的项目根(默认 process cwd)。 |
|
|
268
|
-
| `--base` | — | `revision` | 是 | 否 | option | — | 必填;无锚定合并候选 diff 的比较基线 revision。 |
|
|
269
|
-
|
|
270
|
-
### `analyst`
|
|
271
|
-
|
|
272
|
-
| 拼写 | 别名 | 值 | 必填 | 可重复 | 形式 | 模式/阶段 | 说明 |
|
|
273
|
-
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
274
|
-
| `sweep` | — | — | 否 | 否 | positional | modes=sweep | 可选 sweep 模式词元(至多一次;不得夹带其他 positional)。 |
|
|
275
|
-
| `--ticket` | — | `number` | 否 | 否 | option | modes=issue | 票号;在 cwd 候簿(git common-dir)内按 invocation.ticketNumber 现取现算。裸调用=整簿。不依赖 library-index 自举。 |
|
|
276
|
-
| `--attach` | — | `path` | 条件:sweep | 是 | option | modes=sweep; max=sweep:1 | sweep 模式附件路径;sweep 必填且恰一次;载荷为附件正文。 |
|
|
277
|
-
| `--cohort` | — | — | 否 | 否 | option | modes=cohort | 选择 cohort 模式。 |
|
|
278
|
-
| `--group-a-label` | — | `label` | 条件:cohort | 否 | option | modes=cohort | cohort A 组标签(cohort 模式必填)。 |
|
|
279
|
-
| `--group-a-issues` | — | `N\|book:N[,...]` | 条件:cohort | 否 | option | modes=cohort | cohort A 组 issue:裸 N 归属 cwd 簿;book:N 显式跨簿;簿键中的逗号/反斜杠用 \, / \\ 转义(cohort 模式必填)。 |
|
|
280
|
-
| `--group-b-label` | — | `label` | 条件:cohort | 否 | option | modes=cohort | cohort B 组标签(cohort 模式必填)。 |
|
|
281
|
-
| `--group-b-issues` | — | `N\|book:N[,...]` | 条件:cohort | 否 | option | modes=cohort | cohort B 组 issue:裸 N 归属 cwd 簿;book:N 显式跨簿;簿键中的逗号/反斜杠用 \, / \\ 转义(cohort 模式必填)。 |
|
|
282
|
-
<!-- END GENERATED: public-cli-options -->
|
|
283
|
-
|
|
284
170
|
## 规范指针
|
|
285
171
|
|
|
286
172
|
- 命令用法与拒绝文案:`ak-role help <command>`、`ak-role help config`(唯一权威)。
|
package/dist/gatekeeper-role.js
CHANGED
|
@@ -4,7 +4,7 @@ import { openToolObject } from "./open-tool-schema.js";
|
|
|
4
4
|
import { loadGatekeeperSessionMaterials } from "./session-opening-materials.js";
|
|
5
5
|
import { GatekeeperDecisionError } from "./submission-errors.js";
|
|
6
6
|
import { INSPECTOR_OUTPUT_TOOL_NAME } from "./inspector-contracts.js";
|
|
7
|
-
|
|
7
|
+
import { GATEKEEPER_OUTPUT_TOOL_NAME, gatekeeperDecisionSchema, gatekeeperOutputSchema, projectLawfulGatekeeperOutput, } from "./package-contracts/gatekeeper-output.js";
|
|
8
8
|
export const INSPECTOR_OUTPUT_TOOL = INSPECTOR_OUTPUT_TOOL_NAME;
|
|
9
9
|
export const NOTARY_OUTPUT_TOOL = "ak_notary_output";
|
|
10
10
|
const SUBJECT_TOOL = "ak_gatekeeper_subject";
|
|
@@ -25,11 +25,18 @@ const officerDecisionSchema = openToolObject(Type.Object({
|
|
|
25
25
|
status: Type.Unknown({ description: "pass | bounce — 形状指引,非 schema 闸" }),
|
|
26
26
|
findings: Type.Unknown({ description: "string[] findings,随 pass 或 bounce 留存" }),
|
|
27
27
|
}));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Direct-seat decision tool spec (#639). Lifecycle assembly stays on the
|
|
30
|
+
* registration envelope — src/role-runtime.ts (ADR 0018). Schema authority is
|
|
31
|
+
* the shared contract module (with infrastructure-failure declaration).
|
|
32
|
+
*/
|
|
33
|
+
export const GATEKEEPER_TOOL_SPEC = {
|
|
34
|
+
name: GATEKEEPER_OUTPUT_TOOL_NAME,
|
|
35
|
+
label: "门下省决议",
|
|
36
|
+
description: "门下省终局决议,状态为 dispatch 或 pass。",
|
|
37
|
+
promptSnippet: "门下省决议",
|
|
38
|
+
parameters: gatekeeperOutputSchema,
|
|
39
|
+
};
|
|
33
40
|
function result(content, details) {
|
|
34
41
|
return { content: [{ type: "text", text: content }], details };
|
|
35
42
|
}
|
|
@@ -50,10 +57,10 @@ export function createOfficerDecisionTool(name) {
|
|
|
50
57
|
async execute(_id, args) { return result(`已收 ${String(args?.status)}`, args); },
|
|
51
58
|
};
|
|
52
59
|
}
|
|
53
|
-
/** Gatekeeper province decision tool — open transport; projection owns legality. */
|
|
60
|
+
/** Gatekeeper province decision tool — open transport; package-contract projection owns legality. */
|
|
54
61
|
export function createGatekeeperOutputTool() {
|
|
55
62
|
return {
|
|
56
|
-
name:
|
|
63
|
+
name: GATEKEEPER_OUTPUT_TOOL_NAME,
|
|
57
64
|
description: "提交门下省派官决定。",
|
|
58
65
|
parameters: gatekeeperDecisionSchema,
|
|
59
66
|
async execute(_id, args) { return result(`已收 ${String(args?.status)}`, args); },
|
|
@@ -104,18 +111,17 @@ function readRecord(value) {
|
|
|
104
111
|
return value;
|
|
105
112
|
}
|
|
106
113
|
function projectProvinceDecision(decision) {
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
// Lawful dispatch/pass discriminant is owned by package-contracts; province
|
|
115
|
+
// wraps undefined into transport_failure while retaining the submission.
|
|
116
|
+
const projected = projectLawfulGatekeeperOutput(decision);
|
|
117
|
+
if (projected === undefined)
|
|
109
118
|
return noUsableReleaseFailure("gatekeeper", decision);
|
|
110
|
-
if (
|
|
111
|
-
return { status: "dispatch", officer:
|
|
119
|
+
if (projected.status === "dispatch") {
|
|
120
|
+
return { status: "dispatch", officer: projected.officer };
|
|
112
121
|
}
|
|
113
122
|
// Lawful non-dispatch release — province may pass without dispatching an officer
|
|
114
123
|
// (ADR 0074 gate-non-mandatory; gate-output-guide pass = 正常放行; #597).
|
|
115
|
-
|
|
116
|
-
return { status: "pass", findings: asStringArray(record.findings) };
|
|
117
|
-
}
|
|
118
|
-
return noUsableReleaseFailure("gatekeeper", decision);
|
|
124
|
+
return { status: "pass", findings: projected.findings ?? [] };
|
|
119
125
|
}
|
|
120
126
|
function projectOfficerDecision(officer, decision) {
|
|
121
127
|
const record = readRecord(decision);
|