@akagilnc/pi-workflow-roles 0.1.3384 → 0.1.3397
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 +6 -5
- package/README.zh-CN.md +3 -4
- package/dist/grok/production-host.js +4 -40
- package/dist/public-cli/main.js +6681 -6796
- package/package.json +1 -1
- package/src/host-contracts.ts +1 -1
- package/src/public-cli/coder-run.ts +7 -1
- package/src/public-cli/countersign-run.ts +3 -42
- package/src/public-cli/fixer-run.ts +7 -1
- package/src/public-cli/invocation.ts +94 -111
- package/src/public-cli/judge-run.ts +7 -1
- package/src/public-cli/notary-run.ts +1 -2
- package/src/public-cli/option-definitions.ts +2 -30
- package/src/public-cli/run-lifecycle.ts +27 -4
- package/src/public-cli/seat-ticket-binding.ts +56 -0
- package/src/public-cli/settlement.ts +6 -15
- package/src/submission-ledger.ts +2 -21
- package/src/ticket-frontmatter.ts +0 -94
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ pi install npm:@akagilnc/pi-workflow-roles
|
|
|
11
11
|
export PATH="$HOME/.pi/agent/npm/node_modules/.bin:$PATH"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
Four court seats (`coder` / `fixer` / `judge` / `countersign`) resolve an unbound ticket from the instruction via a Hermes labor-engine detour before the turn runs. Keep a working `hermes` executable on `PATH` for those seats; spawn failure, nonzero exit, or unusable 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)). Pi-only installs that never dispatch those seats do not need Hermes.
|
|
15
|
+
|
|
14
16
|
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.
|
|
15
17
|
|
|
16
18
|
### Test channel (`next`)
|
|
@@ -75,7 +77,7 @@ The examples below are usage sketches; option identity, aliases, requiredness, a
|
|
|
75
77
|
|
|
76
78
|
```bash
|
|
77
79
|
# countersign — ticket-court review before work starts; resume continues the exact session
|
|
78
|
-
ak-role countersign --attach ./ticket.md "
|
|
80
|
+
ak-role countersign --attach ./ticket.md "裁:本票 #582 是否足以开工。"
|
|
79
81
|
|
|
80
82
|
# gleaner-left — unanchored pre-merge memorials; resume continues the exact session; --base required; instruction may be empty; callers must not pass directional instruction
|
|
81
83
|
ak-role gleaner-left --base main
|
|
@@ -102,9 +104,8 @@ ak-role doctor --issue 115 "Diagnose this retained case."
|
|
|
102
104
|
# merger — resolve one merge already in conflict (start it with Git's ort first)
|
|
103
105
|
ak-role merger --project /path/to/worktree "Reconcile the active merge."
|
|
104
106
|
|
|
105
|
-
# notary — document-fidelity check on one retained source run;
|
|
107
|
+
# notary — document-fidelity check on one retained source run; ticket key inherited from source-run admitted form
|
|
106
108
|
ak-role notary --source-run <runId@role|path>
|
|
107
|
-
ak-role notary --source-run <runId@role|path> --ticket 582
|
|
108
109
|
|
|
109
110
|
# inspector — direct complexity and test-quality check
|
|
110
111
|
ak-role inspector --attach ./change.patch "Review this material."
|
|
@@ -115,8 +116,8 @@ ak-role gatekeeper --attach ./submission.json "审:这批材料该谁审?"
|
|
|
115
116
|
# navigator — direct route advice (ordered next-role candidates); automatic attendance unchanged
|
|
116
117
|
ak-role navigator "刚完成 coder apply 收敛,下一步?"
|
|
117
118
|
|
|
118
|
-
# countersign — ticket-court five questions;
|
|
119
|
-
ak-role countersign --
|
|
119
|
+
# countersign — ticket-court five questions; ticket recognition via instruction
|
|
120
|
+
ak-role countersign --attach ./ticket.md "裁:本票 #582 是否足以开工。"
|
|
120
121
|
|
|
121
122
|
# analyst — deterministic metrics; bare call = whole book
|
|
122
123
|
ak-role analyst
|
package/README.zh-CN.md
CHANGED
|
@@ -96,9 +96,8 @@ ak-role doctor --issue 115 "Diagnose this retained case."
|
|
|
96
96
|
# 校书郎——调和已在冲突的 merge(先用 Git ort 起动)
|
|
97
97
|
ak-role merger --project /path/to/worktree "Reconcile the active merge."
|
|
98
98
|
|
|
99
|
-
# 符宝郎——文书核验一份留存 source run
|
|
99
|
+
# 符宝郎——文书核验一份留存 source run;票号从 source-run admitted form 继承
|
|
100
100
|
ak-role notary --source-run <runId@role|path>
|
|
101
|
-
ak-role notary --source-run <runId@role|path> --ticket 582
|
|
102
101
|
|
|
103
102
|
# 察院——直调复杂度与测试质量两轴
|
|
104
103
|
ak-role inspector --attach ./change.patch "Review this material."
|
|
@@ -109,8 +108,8 @@ ak-role gatekeeper --attach ./submission.json "审:这批材料该谁审?"
|
|
|
109
108
|
# 游奕使——直调路线建议(有序的下一步角色候选);自动出席不变
|
|
110
109
|
ak-role navigator "刚完成 coder apply 收敛,下一步?"
|
|
111
110
|
|
|
112
|
-
#
|
|
113
|
-
ak-role countersign --
|
|
111
|
+
# 给事中——票庭五问;票号经由 instruction 识别
|
|
112
|
+
ak-role countersign --attach ./ticket.md "裁:本票 #582 是否足以开工。"
|
|
114
113
|
|
|
115
114
|
# 左拾遗——合并前无锚定风闻;可 resume 续同一 session;--base 必填;instruction 可空;调用者不得传方向性 instruction
|
|
116
115
|
ak-role gleaner-left --base main
|
|
@@ -6586,21 +6586,7 @@ var NAVIGATOR_OPTIONS = [
|
|
|
6586
6586
|
];
|
|
6587
6587
|
var COUNTERSIGN_OPTIONS = [
|
|
6588
6588
|
bindOwner("countersign", SHARED_PROJECT_SEMANTICS),
|
|
6589
|
-
bindOwner("countersign", SHARED_ATTACH_SEMANTICS)
|
|
6590
|
-
{
|
|
6591
|
-
id: "ticket",
|
|
6592
|
-
owner: "countersign",
|
|
6593
|
-
canonical: "--ticket",
|
|
6594
|
-
aliases: [],
|
|
6595
|
-
valueMetavar: "number",
|
|
6596
|
-
required: false,
|
|
6597
|
-
repeatable: false,
|
|
6598
|
-
form: "option",
|
|
6599
|
-
description: {
|
|
6600
|
-
en: "Ticket/issue number for court diary (diarist) and ticket-keyed provenance. Overrides attachment frontmatter when both present.",
|
|
6601
|
-
zh: "\u7968\u53F7\uFF1A\u8D77\u5C45\u90CE\u6D41\u6C34\u7EBF\u4E0E\u8D77\u5C45\u5F55\u7968\u952E\u3002\u4E0E\u9644\u4EF6 frontmatter \u5E76\u5B58\u65F6\u4EE5\u672C\u65D7\u4E3A\u51C6\u3002"
|
|
6602
|
-
}
|
|
6603
|
-
}
|
|
6589
|
+
bindOwner("countersign", SHARED_ATTACH_SEMANTICS)
|
|
6604
6590
|
];
|
|
6605
6591
|
var CODER_OPTIONS = [
|
|
6606
6592
|
{
|
|
@@ -6781,20 +6767,6 @@ var NOTARY_OPTIONS = [
|
|
|
6781
6767
|
en: "Required source run locator (runId@role under the book home, or path to that run directory). Zero prompt/attachment projection.",
|
|
6782
6768
|
zh: "\u5FC5\u586B\u6E90 run \u5B9A\u4F4D\u7B26\uFF08\u7C3F\u5185 runId@role\uFF0C\u6216\u8BE5 run \u76EE\u5F55\u8DEF\u5F84\uFF09\u3002\u96F6 prompt/\u9644\u4EF6\u6295\u5F71\u3002"
|
|
6783
6769
|
}
|
|
6784
|
-
},
|
|
6785
|
-
{
|
|
6786
|
-
id: "ticket",
|
|
6787
|
-
owner: "notary",
|
|
6788
|
-
canonical: "--ticket",
|
|
6789
|
-
aliases: [],
|
|
6790
|
-
valueMetavar: "number",
|
|
6791
|
-
required: false,
|
|
6792
|
-
repeatable: false,
|
|
6793
|
-
form: "option",
|
|
6794
|
-
description: {
|
|
6795
|
-
en: "Optional ticket/issue number when Notary reads the court diary (ticket-provenance) for a ticket.",
|
|
6796
|
-
zh: "\u53EF\u9009\u7968\u53F7\uFF1A\u7B26\u5B9D\u90CE\u6309\u7968\u952E\u8C03\u53D6\u8D77\u5C45\u5F55\u65F6\u4F7F\u7528\u3002"
|
|
6797
|
-
}
|
|
6798
6770
|
}
|
|
6799
6771
|
];
|
|
6800
6772
|
var MERGER_OPTIONS = [
|
|
@@ -6842,7 +6814,7 @@ var ROLE_COMMAND_HELP = {
|
|
|
6842
6814
|
summary: "Ticket-court review before work starts; five questions, \u7F72/\u5C01\u9A73/\u4E0A\u5448.",
|
|
6843
6815
|
usage: ["ak-role countersign [options] [instruction]"],
|
|
6844
6816
|
examples: [
|
|
6845
|
-
'ak-role countersign --
|
|
6817
|
+
'ak-role countersign --attach ./ticket.md "\u88C1\uFF1A\u672C\u7968 #582 \u662F\u5426\u8DB3\u4EE5\u5F00\u5DE5\u3002"',
|
|
6846
6818
|
'ak-role countersign --attach ./plan.md --attach ./adr.md "\u88C1\uFF1A\u65B9\u6848\u4E94\u95EE\u3002"'
|
|
6847
6819
|
]
|
|
6848
6820
|
},
|
|
@@ -6936,7 +6908,7 @@ var ROLE_COMMAND_HELP = {
|
|
|
6936
6908
|
usage: ["ak-role notary --source-run <runId@role|path> [options]"],
|
|
6937
6909
|
examples: [
|
|
6938
6910
|
"ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
|
|
6939
|
-
"ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@countersign
|
|
6911
|
+
"ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@countersign"
|
|
6940
6912
|
]
|
|
6941
6913
|
},
|
|
6942
6914
|
analyst: {
|
|
@@ -8612,16 +8584,8 @@ function runIdentity(context) {
|
|
|
8612
8584
|
if (typeof headerId === "string" && headerId.length > 0) return headerId;
|
|
8613
8585
|
throw new Error("\u63D0\u4EA4\u8D26\u9700\u8981\u5DF2\u53D7\u7406\u7684 run \u8EAB\u4EFD");
|
|
8614
8586
|
}
|
|
8615
|
-
function latestUserAttemptId(entries) {
|
|
8616
|
-
const ordered = [...entries];
|
|
8617
|
-
for (let index = ordered.length - 1; index >= 0; index -= 1) {
|
|
8618
|
-
const entry = ordered[index];
|
|
8619
|
-
if (entry?.message?.role === "user" && typeof entry.id === "string") return entry.id;
|
|
8620
|
-
}
|
|
8621
|
-
return void 0;
|
|
8622
|
-
}
|
|
8623
8587
|
function attemptIdentity(context, runId) {
|
|
8624
|
-
return
|
|
8588
|
+
return context.sessionManager.getHeader?.()?.id ?? context.sessionManager.getLeafId?.() ?? `${runId}:initial`;
|
|
8625
8589
|
}
|
|
8626
8590
|
function submissionRecordFile(cwd, runId, home) {
|
|
8627
8591
|
const ledgerHome = resolveActivationLedgerHome(home);
|