@akagilnc/pi-workflow-roles 0.1.3280 → 0.1.3353
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 +5 -5
- package/README.zh-CN.md +5 -5
- package/dist/audit-escalation.js +31 -4
- package/dist/gatekeeper-role.js +25 -4
- package/dist/grok/production-host.js +1167 -862
- package/dist/inspector-contracts.js +5 -2
- package/dist/notary-contracts.js +16 -5
- package/dist/packaged-role-registry.js +0 -7
- package/dist/public-cli/main.js +867 -757
- package/package.json +1 -1
- package/src/audit-escalation.ts +52 -8
- package/src/collector-ledger.ts +309 -74
- package/src/collector-receipt.ts +0 -1
- package/src/collector-role.ts +21 -14
- package/src/diarist-mechanical.ts +16 -5
- package/src/gatekeeper-role.ts +33 -4
- package/src/grok/role-envelope.ts +68 -52
- package/src/inspector-contracts.ts +6 -3
- package/src/inspector-role.ts +5 -2
- package/src/notary-contracts.ts +20 -5
- package/src/notary-role.ts +2 -2
- package/src/packaged-role-registry.ts +0 -12
- package/src/public-cli/cli.ts +50 -125
- package/src/public-cli/coder-run.ts +5 -19
- package/src/public-cli/collector-run.ts +65 -21
- package/src/public-cli/countersign-run.ts +14 -40
- package/src/public-cli/doctor-run.ts +50 -6
- package/src/public-cli/fixer-run.ts +5 -19
- package/src/public-cli/gleaner-left-run.ts +14 -40
- package/src/public-cli/inspector-run.ts +51 -7
- package/src/public-cli/instruction-seat-run.ts +27 -0
- package/src/public-cli/judge-run.ts +11 -36
- package/src/public-cli/merger-run.ts +5 -19
- package/src/public-cli/notary-run.ts +54 -5
- package/src/public-cli/option-definitions.ts +3 -3
- package/src/public-cli/post-admission.ts +76 -0
- package/src/public-cli/reviewer-run.ts +5 -19
- package/src/public-cli/run-lifecycle.ts +342 -107
- package/src/public-cli/settlement.ts +134 -71
- package/src/role-runtime.ts +18 -1
- package/src/submission-ledger.ts +55 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public Inspector (察院) terminating receipt contracts.
|
|
3
|
-
* Lawful explicit releases: pass | bounce.
|
|
3
|
+
* Lawful explicit releases: pass | bounce | escalate.
|
|
4
4
|
* Dual path: gate-dispatched and independently callable (#568 / ADR 0074).
|
|
5
5
|
*/
|
|
6
6
|
export const INSPECTOR_OUTPUT_TOOL_NAME = "ak_inspector_output";
|
|
@@ -16,7 +16,7 @@ export function validateRecordedInspectorOutput(value) {
|
|
|
16
16
|
catch {
|
|
17
17
|
throw new Error("Inspector output has no execution discriminator");
|
|
18
18
|
}
|
|
19
|
-
if (status === "pass" || status === "bounce") {
|
|
19
|
+
if (status === "pass" || status === "bounce" || status === "escalate") {
|
|
20
20
|
return value;
|
|
21
21
|
}
|
|
22
22
|
throw new Error("Inspector output has no execution discriminator");
|
|
@@ -27,5 +27,8 @@ export function inspectorDecisiveFacts(output) {
|
|
|
27
27
|
const findings = output.findings;
|
|
28
28
|
if (findings !== undefined)
|
|
29
29
|
facts.findings = findings;
|
|
30
|
+
const reason = output.reason;
|
|
31
|
+
if (reason !== undefined)
|
|
32
|
+
facts.reason = reason;
|
|
30
33
|
return facts;
|
|
31
34
|
}
|
package/dist/notary-contracts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public Notary (符宝郎) terminating receipt contracts.
|
|
3
|
-
* Lawful explicit releases: pass | bounce.
|
|
3
|
+
* Lawful explicit releases: pass | bounce | escalate.
|
|
4
4
|
* No usable result is infrastructure failure via public settlement, not a judgment status (#475).
|
|
5
5
|
*/
|
|
6
6
|
import { Type } from "typebox";
|
|
@@ -27,11 +27,14 @@ export const NOTARY_TICKET_FLAG = {
|
|
|
27
27
|
export const NOTARY_FIXED_KICKOFF = "符宝郎案卷已受理;来源 run 定位见会话材料。";
|
|
28
28
|
export const notaryOutputSchema = withInfrastructureFailureDeclaration(openToolObject(Type.Object({
|
|
29
29
|
status: Type.Unknown({
|
|
30
|
-
description: "pass | bounce — 形状指引,非 schema 闸",
|
|
30
|
+
description: "pass | bounce | escalate — 形状指引,非 schema 闸",
|
|
31
31
|
}),
|
|
32
32
|
findings: Type.Unknown({
|
|
33
|
-
description: "string[] findings,随 pass 或
|
|
33
|
+
description: "string[] findings,随 pass、bounce 或 escalate 留存",
|
|
34
34
|
}),
|
|
35
|
+
reason: Type.Optional(Type.Unknown({
|
|
36
|
+
description: "status 为 escalate 时的上呈理由",
|
|
37
|
+
})),
|
|
35
38
|
})));
|
|
36
39
|
function isRecord(value) {
|
|
37
40
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -42,7 +45,7 @@ function asStringArray(value) {
|
|
|
42
45
|
return value.filter((item) => typeof item === "string");
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
|
-
* Project one lawful explicit Notary release (pass | bounce).
|
|
48
|
+
* Project one lawful explicit Notary release (pass | bounce | escalate).
|
|
46
49
|
* No throw on shape — ADR 0055 / 第 0 条: already-submitted params are retained as-is;
|
|
47
50
|
* public-terminal projects non-usable releases via typed failure cause.
|
|
48
51
|
*/
|
|
@@ -64,6 +67,9 @@ export function projectLawfulNotaryOutput(value) {
|
|
|
64
67
|
clone.findings = asStringArray(clone.findings);
|
|
65
68
|
return clone;
|
|
66
69
|
}
|
|
70
|
+
if (status === "escalate") {
|
|
71
|
+
return structuredClone(value);
|
|
72
|
+
}
|
|
67
73
|
return undefined;
|
|
68
74
|
}
|
|
69
75
|
/** Retain submitted Notary params as-is for the failure channel (no shape rewrite). */
|
|
@@ -78,7 +84,7 @@ export function retainNotarySubmission(value) {
|
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
86
|
/**
|
|
81
|
-
* Settlement/recording path: only lawful recorded pass/bounce.
|
|
87
|
+
* Settlement/recording path: only lawful recorded pass/bounce/escalate.
|
|
82
88
|
* Does not gate role admission — callers must not use this to reject a submission.
|
|
83
89
|
*/
|
|
84
90
|
export function validateRecordedNotaryOutput(value) {
|
|
@@ -98,5 +104,10 @@ export function notaryDecisiveFacts(output) {
|
|
|
98
104
|
if (status === "bounce") {
|
|
99
105
|
facts.disposition = "rewrite";
|
|
100
106
|
}
|
|
107
|
+
if (status === "escalate") {
|
|
108
|
+
const reason = output.reason;
|
|
109
|
+
if (reason !== undefined)
|
|
110
|
+
facts.reason = reason;
|
|
111
|
+
}
|
|
101
112
|
return facts;
|
|
102
113
|
}
|
|
@@ -177,12 +177,6 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
177
177
|
sessionMaterials: ["CLAUDE.md", "souls/navigator.md"]
|
|
178
178
|
}
|
|
179
179
|
];
|
|
180
|
-
const ONE_SHOT_ROLES = [
|
|
181
|
-
"collector",
|
|
182
|
-
"doctor",
|
|
183
|
-
"notary",
|
|
184
|
-
"inspector"
|
|
185
|
-
];
|
|
186
180
|
const PACKAGED_ROLE_REGISTRY = PUBLIC_ROLE_RECORDS.map(({ sessionMaterials: _omit, ...metadata }) => metadata);
|
|
187
181
|
function packagedRoleMetadata(role) {
|
|
188
182
|
return PACKAGED_ROLE_REGISTRY.find((entry) => entry.role === role);
|
|
@@ -199,7 +193,6 @@ function packagedRoleOutputTool(role) {
|
|
|
199
193
|
export {
|
|
200
194
|
INSPECTOR_SESSION_MATERIALS,
|
|
201
195
|
NOTARY_SESSION_MATERIALS,
|
|
202
|
-
ONE_SHOT_ROLES,
|
|
203
196
|
PACKAGED_ROLE_REGISTRY,
|
|
204
197
|
PUBLIC_ROLE_RECORDS,
|
|
205
198
|
packagedRoleInputFlag,
|