@akagilnc/pi-workflow-roles 0.1.5068 → 0.1.5079
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/dist/acp-host/production-host.js +82 -83
- package/dist/compliance-transport.js +3 -2
- package/dist/countersign-contracts.js +2 -2
- package/dist/gatekeeper-role.js +12 -19
- package/dist/headless-host/production-host.js +82 -83
- package/dist/inspector-contracts.js +5 -2
- package/dist/migrate-book-topology.js +32 -20
- package/dist/open-tool-schema.js +4 -1
- package/dist/package-contracts/judge-output.js +2 -2
- package/dist/package-contracts/terminating-infrastructure.js +4 -1
- package/dist/public-cli/main.js +33 -20
- package/dist/review-submission.js +19 -8
- package/dist/submission-errors.js +17 -0
- package/dist/submission-ledger.js +18 -6
- package/package.json +1 -1
- package/src/compliance-transport.ts +3 -2
- package/src/countersign-contracts.ts +2 -2
- package/src/countersign-role.ts +3 -7
- package/src/gatekeeper-role.ts +14 -18
- package/src/inspector-contracts.ts +5 -2
- package/src/judge-role.ts +13 -21
- package/src/open-tool-schema.ts +9 -4
- package/src/package-contracts/judge-output.ts +2 -4
- package/src/package-contracts/terminating-infrastructure.ts +9 -4
- package/src/review-submission.ts +24 -10
- package/src/role-runtime.ts +9 -25
- package/src/submission-errors.ts +16 -0
- package/src/submission-gate.ts +2 -1
- package/src/submission-ledger.ts +23 -11
- package/src/worker-role.ts +4 -6
package/src/submission-ledger.ts
CHANGED
|
@@ -20,7 +20,8 @@ import type { SitianRecord } from "./sitian-contracts.ts";
|
|
|
20
20
|
import { findRunDirectoryById } from "./public-cli/run-lifecycle.ts";
|
|
21
21
|
import type { TerminalRoleName } from "./public-cli/terminal.ts";
|
|
22
22
|
import { isCorrectableExecuteError } from "./submission-correctable-error.ts";
|
|
23
|
-
import { failOnInfrastructureFailureDeclaration } from "./package-contracts/terminating-infrastructure.ts";
|
|
23
|
+
import { failOnInfrastructureFailureDeclaration, infrastructureFailureDiagnostic } from "./package-contracts/terminating-infrastructure.ts";
|
|
24
|
+
import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "./review-submission.ts";
|
|
24
25
|
|
|
25
26
|
export type SubmissionCall = { readonly id: string; readonly name: string };
|
|
26
27
|
export type SubmissionOutcomeKind = "correctable-rejection" | "audit-escalation" | "infrastructure";
|
|
@@ -678,17 +679,28 @@ export function createSubmissionLedgerHost(
|
|
|
678
679
|
});
|
|
679
680
|
let result: HostToolResult<unknown>;
|
|
680
681
|
try {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
682
|
+
// A review escalate that carries the failure declaration is the
|
|
683
|
+
// seat's own submission. Every other declaration stays on the
|
|
684
|
+
// host-failure seam. Tool identity comes from the registry map.
|
|
685
|
+
const reviewEscalate = tool.name === REVIEW_SUBMISSION_OUTPUT_TOOL_NAME
|
|
686
|
+
&& infrastructureFailureDiagnostic(params) !== undefined
|
|
687
|
+
&& params !== null
|
|
688
|
+
&& typeof params === "object"
|
|
689
|
+
&& !Array.isArray(params)
|
|
690
|
+
&& (params as Record<string, unknown>).status === "escalate";
|
|
691
|
+
if (!reviewEscalate) {
|
|
692
|
+
failOnInfrastructureFailureDeclaration(
|
|
693
|
+
params,
|
|
694
|
+
{
|
|
695
|
+
failInfrastructure(error, ctx) {
|
|
696
|
+
failInfrastructure(error, ctx);
|
|
697
|
+
},
|
|
686
698
|
},
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
699
|
+
context,
|
|
700
|
+
toolCallId,
|
|
701
|
+
tool.bounceInfrastructureDeclaration,
|
|
702
|
+
);
|
|
703
|
+
}
|
|
692
704
|
result = await tool.execute(toolCallId, params, signal, update, context);
|
|
693
705
|
} catch (error) {
|
|
694
706
|
if (isCorrectableExecuteError(error)) {
|
package/src/worker-role.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { withTerminatingOutputDeclarations } from "./package-contracts/terminati
|
|
|
5
5
|
|
|
6
6
|
import { readableGateItem } from "./readable-gate-item.ts";
|
|
7
7
|
import { projectGatekeeperEscalation } from "./audit-escalation.ts";
|
|
8
|
-
import { GatekeeperDecisionError, ParentQueueReaskError } from "./submission-errors.ts";
|
|
8
|
+
import { GatekeeperDecisionError, ParentQueueReaskError, unreadableDiscriminatorNotice } from "./submission-errors.ts";
|
|
9
9
|
import {
|
|
10
10
|
CODER_OUTPUT_TOOL_NAME,
|
|
11
11
|
FIXER_OUTPUT_TOOL_NAME,
|
|
@@ -44,8 +44,8 @@ export type { WorkerOutput };
|
|
|
44
44
|
// no code branches on their length. `reason` alone keeps minLength: the worker
|
|
45
45
|
// gate reads `reason.trim().length > 0` to pick typed-reminder-bounce vs accept
|
|
46
46
|
// (src/worker-submission-gates.ts:159-163,297-302).
|
|
47
|
-
//
|
|
48
|
-
//
|
|
47
|
+
// Worker status is not the review three-state field (#1055): schema stays open.
|
|
48
|
+
// One shared description across every variant
|
|
49
49
|
// so openToolObjectFromUnion's identical-declaration collapse drops none of it.
|
|
50
50
|
const CODER_STATUS_DESCRIPTION =
|
|
51
51
|
"planned | completed | refused | partially_completed | unfinished — 形状指引,非 schema 闸;completed 回执含 TDD、同模式、引入回归、行为事实四项证据;unfinished 缺前置或违宪约束致本局未完成时可用,缺待决 owner 决定或答复属缺前置。" as const;
|
|
@@ -135,8 +135,6 @@ const WORKER_ROUTING_STATUSES = new Set([
|
|
|
135
135
|
"partially_completed",
|
|
136
136
|
"unfinished",
|
|
137
137
|
]);
|
|
138
|
-
const WORKER_STATUS_REASK =
|
|
139
|
-
"status 不是 planned、completed、refused、partially_completed、unfinished 之一。请重新交卷,status 写明其一。" as const;
|
|
140
138
|
|
|
141
139
|
/** Read only the field that selects the worker's next package-owned path. */
|
|
142
140
|
function workerStatusOf(output: WorkerOutput): string | undefined {
|
|
@@ -148,7 +146,7 @@ function workerStatusOf(output: WorkerOutput): string | undefined {
|
|
|
148
146
|
function requireReadableWorkerStatus(output: WorkerOutput): string {
|
|
149
147
|
const status = workerStatusOf(output);
|
|
150
148
|
if (status === undefined || !WORKER_ROUTING_STATUSES.has(status)) {
|
|
151
|
-
throw new ParentQueueReaskError(
|
|
149
|
+
throw new ParentQueueReaskError(unreadableDiscriminatorNotice("status", isRecord(output) ? output.status : undefined));
|
|
152
150
|
}
|
|
153
151
|
return status;
|
|
154
152
|
}
|