@akagilnc/pi-workflow-roles 0.1.5068 → 0.1.5096
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 +429 -383
- package/dist/atomic-write.js +13 -19
- package/dist/auditor-soul.js +2 -1
- package/dist/compliance-transport.js +3 -2
- package/dist/countersign-contracts.js +2 -2
- package/dist/doctor-contracts.js +1 -1
- package/dist/gatekeeper-role.js +14 -35
- package/dist/headless-host/production-host.js +461 -415
- package/dist/inspector-contracts.js +5 -2
- package/dist/merger-contracts.js +1 -1
- package/dist/migrate-book-topology.js +49 -33
- package/dist/navigator-attendance.js +28 -143
- package/dist/navigator-invocation-identity.js +2 -0
- package/dist/navigator-public-session.js +13 -1
- package/dist/navigator-work-base.js +113 -0
- package/dist/notary-contracts.js +0 -2
- package/dist/open-tool-schema.js +4 -1
- package/dist/package-contracts/fixer-output.js +1 -1
- package/dist/package-contracts/gatekeeper-output.js +1 -1
- package/dist/package-contracts/judge-output.js +2 -2
- package/dist/package-contracts/navigator-output.js +1 -1
- package/dist/package-contracts/terminating-infrastructure.js +7 -4
- package/dist/packaged-role-registry.js +9 -5
- package/dist/public-cli/countersign-run.js +1 -1
- package/dist/public-cli/invocation.js +6 -3
- package/dist/public-cli/main.js +78 -41
- package/dist/public-cli/settlement.js +20 -1
- package/dist/receipt-delivery-policy.js +9 -2
- package/dist/review-submission.js +19 -8
- package/dist/submission-errors.js +17 -0
- package/dist/submission-ledger.js +18 -6
- package/docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md +9 -0
- package/extensions/role-runtime.ts +0 -27
- package/package.json +2 -1
- package/resources/836-deleted-machine-instruction-inventory.md +3 -3
- package/resources/collector-bot-handbook.md +4 -0
- package/resources/navigator-route-playbook.md +4 -6
- package/scripts/build-package.mjs +4 -0
- package/souls/coder-output-guide.md +1 -0
- package/src/auditor-soul.ts +2 -1
- package/src/collector-role.ts +6 -7
- package/src/collector-tool-schemas.ts +5 -5
- package/src/compliance-transport.ts +3 -2
- package/src/countersign-contracts.ts +2 -2
- package/src/countersign-role.ts +3 -7
- package/src/diarist-role.ts +2 -2
- package/src/doctor-contracts.ts +1 -1
- package/src/gatekeeper-role.ts +15 -36
- package/src/gleaner-left-role.ts +2 -2
- package/src/inspector-contracts.ts +5 -2
- package/src/inspector-role.ts +1 -1
- package/src/judge-role.ts +14 -22
- package/src/merger-contracts.ts +1 -1
- package/src/navigator-attendance.ts +38 -164
- package/src/navigator-invocation-identity.ts +2 -0
- package/src/navigator-public-session.ts +17 -1
- package/src/navigator-role.ts +4 -0
- package/src/navigator-session-contracts.ts +2 -0
- package/src/navigator-work-base.ts +123 -0
- package/src/notary-contracts.ts +0 -4
- package/src/open-tool-schema.ts +9 -4
- package/src/package-contracts/fixer-output.ts +1 -1
- package/src/package-contracts/gatekeeper-output.ts +3 -3
- package/src/package-contracts/judge-output.ts +2 -4
- package/src/package-contracts/navigator-output.ts +1 -1
- package/src/package-contracts/terminating-infrastructure.ts +12 -10
- package/src/packaged-role-registry.ts +5 -1
- package/src/public-cli/countersign-run.ts +1 -1
- package/src/public-cli/invocation.ts +6 -3
- package/src/public-cli/settlement.ts +21 -0
- package/src/receipt-delivery-policy.ts +9 -1
- package/src/review-submission.ts +24 -10
- package/src/reviewer-role.ts +3 -3
- package/src/role-runtime-dependencies.ts +1 -5
- package/src/role-runtime.ts +61 -63
- package/src/secretariat-role.ts +3 -3
- 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 +7 -9
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
4
|
+
import { writeFileAtomically } from "./atomic-write.js";
|
|
5
|
+
const NAVIGATOR_WORK_CONTEXT_BASENAME = "work-context.json";
|
|
6
|
+
function navigatorWorkContextFile(sessionDir) {
|
|
7
|
+
return join(sessionDir, NAVIGATOR_WORK_CONTEXT_BASENAME);
|
|
8
|
+
}
|
|
9
|
+
function isNavigatorWorkContextFile(path) {
|
|
10
|
+
const resolved = resolve(path);
|
|
11
|
+
if (basename(resolved) !== NAVIGATOR_WORK_CONTEXT_BASENAME) return false;
|
|
12
|
+
const nest = dirname(resolved);
|
|
13
|
+
if (!/^[0-9a-f]{32}$/.test(basename(nest))) return false;
|
|
14
|
+
return basename(dirname(nest)) === "navigator";
|
|
15
|
+
}
|
|
16
|
+
function canonicalNavigatorWorkContextFile(path) {
|
|
17
|
+
if (!isNavigatorWorkContextFile(path)) return void 0;
|
|
18
|
+
try {
|
|
19
|
+
const real = realpathSync(path);
|
|
20
|
+
return isNavigatorWorkContextFile(real) ? real : void 0;
|
|
21
|
+
} catch {
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function persistNavigatorWorkBase(sessionDir, body) {
|
|
26
|
+
if (sessionDir.trim() === "" || !existsSync(sessionDir)) return void 0;
|
|
27
|
+
if (body.authority.trim() === "") return void 0;
|
|
28
|
+
const path = navigatorWorkContextFile(sessionDir);
|
|
29
|
+
const next = `${JSON.stringify({ subject: body.subject, authority: body.authority })}
|
|
30
|
+
`;
|
|
31
|
+
try {
|
|
32
|
+
const current = await readFile(path, "utf8");
|
|
33
|
+
if (current === next) return path;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
await writeFileAtomically(path, next);
|
|
40
|
+
return path;
|
|
41
|
+
}
|
|
42
|
+
async function readNavigatorWorkBase(path) {
|
|
43
|
+
const canonical = canonicalNavigatorWorkContextFile(path);
|
|
44
|
+
if (canonical === void 0) return void 0;
|
|
45
|
+
let text;
|
|
46
|
+
try {
|
|
47
|
+
text = await readFile(canonical, "utf8");
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
let parsed;
|
|
55
|
+
try {
|
|
56
|
+
parsed = JSON.parse(text);
|
|
57
|
+
} catch {
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
|
|
61
|
+
const record = parsed;
|
|
62
|
+
if (typeof record.subject !== "string" || typeof record.authority !== "string") return void 0;
|
|
63
|
+
if (record.authority.trim() === "") return void 0;
|
|
64
|
+
return { subject: record.subject, authority: record.authority };
|
|
65
|
+
}
|
|
66
|
+
function jsonObjectFromPrompt(prompt) {
|
|
67
|
+
const head = prompt.trimStart().split("\n\n", 1)[0] ?? "";
|
|
68
|
+
if (!head.startsWith("{")) return void 0;
|
|
69
|
+
try {
|
|
70
|
+
const parsed = JSON.parse(head);
|
|
71
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
|
|
72
|
+
return parsed;
|
|
73
|
+
} catch {
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function workContextPathFromPrompt(prompt) {
|
|
78
|
+
const record = jsonObjectFromPrompt(prompt);
|
|
79
|
+
const path = record?.workContextPath;
|
|
80
|
+
if (typeof path !== "string" || path.trim() === "") return void 0;
|
|
81
|
+
return isNavigatorWorkContextFile(path) ? path : void 0;
|
|
82
|
+
}
|
|
83
|
+
function attachWorkContextPointer(text, workContextPath) {
|
|
84
|
+
const record = jsonObjectFromPrompt(text);
|
|
85
|
+
if (record === void 0) return text;
|
|
86
|
+
if (typeof record.workContextPath === "string" && record.workContextPath.trim() !== "") return text;
|
|
87
|
+
const head = text.trimStart().split("\n\n", 1)[0] ?? "";
|
|
88
|
+
const rest = text.trimStart().slice(head.length);
|
|
89
|
+
return `${JSON.stringify({ ...record, workContextPath })}${rest}`;
|
|
90
|
+
}
|
|
91
|
+
async function loadNavigatorWorkBaseSuffix(prompt) {
|
|
92
|
+
const path = workContextPathFromPrompt(prompt);
|
|
93
|
+
if (path === void 0) return void 0;
|
|
94
|
+
const body = await readNavigatorWorkBase(path);
|
|
95
|
+
if (body === void 0) return void 0;
|
|
96
|
+
return `<work_subject>
|
|
97
|
+
${body.subject}
|
|
98
|
+
</work_subject>
|
|
99
|
+
|
|
100
|
+
<controlling_authority>
|
|
101
|
+
${body.authority}
|
|
102
|
+
</controlling_authority>`;
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
NAVIGATOR_WORK_CONTEXT_BASENAME,
|
|
106
|
+
attachWorkContextPointer,
|
|
107
|
+
isNavigatorWorkContextFile,
|
|
108
|
+
loadNavigatorWorkBaseSuffix,
|
|
109
|
+
navigatorWorkContextFile,
|
|
110
|
+
persistNavigatorWorkBase,
|
|
111
|
+
readNavigatorWorkBase,
|
|
112
|
+
workContextPathFromPrompt
|
|
113
|
+
};
|
package/dist/notary-contracts.js
CHANGED
|
@@ -14,7 +14,6 @@ const NOTARY_TICKET_FLAG = {
|
|
|
14
14
|
type: "string"
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
const NOTARY_FIXED_KICKOFF = "\u7B26\u5B9D\u90CE\u6848\u5377\u5DF2\u53D7\u7406\uFF1B\u6765\u6E90 run \u5B9A\u4F4D\u89C1\u4F1A\u8BDD\u6750\u6599\u3002";
|
|
18
17
|
const notaryOutputSchema = reviewSubmissionSchema;
|
|
19
18
|
function isRecord(value) {
|
|
20
19
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -37,7 +36,6 @@ function validateRecordedNotaryOutput(value) {
|
|
|
37
36
|
return value;
|
|
38
37
|
}
|
|
39
38
|
export {
|
|
40
|
-
NOTARY_FIXED_KICKOFF,
|
|
41
39
|
NOTARY_OUTPUT_TOOL_NAME,
|
|
42
40
|
NOTARY_SOURCE_RUN_FLAG,
|
|
43
41
|
NOTARY_TICKET_FLAG,
|
package/dist/open-tool-schema.js
CHANGED
|
@@ -28,7 +28,10 @@ function openToolObjectFromUnion(schema) {
|
|
|
28
28
|
}
|
|
29
29
|
function openToolObject(schema) {
|
|
30
30
|
const object = Type.Object(
|
|
31
|
-
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
31
|
+
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
32
|
+
name,
|
|
33
|
+
Type.Optional(described(name, declaration))
|
|
34
|
+
])),
|
|
32
35
|
{ additionalProperties: true }
|
|
33
36
|
);
|
|
34
37
|
object.required = [];
|
|
@@ -27,7 +27,7 @@ const refusedClassResultSchema = Type.Object({
|
|
|
27
27
|
});
|
|
28
28
|
const classResultSchema = Type.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
29
29
|
const completedClassResultsSchema = Type.Array(completedClassResultSchema);
|
|
30
|
-
const FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed
|
|
30
|
+
const FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002";
|
|
31
31
|
const fixerOutputVariants = Type.Union([
|
|
32
32
|
Type.Object({ status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }),
|
|
33
33
|
Type.Object({ status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), remainingScope: Type.String({ description: "\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u5DE5\u4F5C\u8303\u56F4" }), blocker: Type.Unsafe({ ...blockerSchema, description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker" }) }),
|
|
@@ -5,7 +5,7 @@ const GATEKEEPER_OUTPUT_TOOL_NAME = "ak_gatekeeper_output";
|
|
|
5
5
|
const gatekeeperDecisionSchema = openToolObject(
|
|
6
6
|
Type.Object({
|
|
7
7
|
status: Type.Unknown({
|
|
8
|
-
description: "dispatch | pass
|
|
8
|
+
description: "dispatch | pass"
|
|
9
9
|
}),
|
|
10
10
|
officer: Type.Unknown({
|
|
11
11
|
description: "status \u4E3A dispatch \u65F6\u4E3A inspector | notary"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "../review-submission.js";
|
|
1
|
+
import { REVIEW_QUEUE_STATUSES, REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "../review-submission.js";
|
|
2
2
|
const JUDGE_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
3
3
|
function validateAcceptedJudgeDetails(verdict) {
|
|
4
4
|
if (verdict === null || typeof verdict !== "object" || Array.isArray(verdict)) throw new Error("Judge verdict has no execution discriminator");
|
|
@@ -11,7 +11,7 @@ function validateAcceptedJudgeDetails(verdict) {
|
|
|
11
11
|
if (typeof status !== "string") {
|
|
12
12
|
throw new Error("Judge verdict has no execution discriminator");
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
14
|
+
if (REVIEW_QUEUE_STATUSES.has(status)) {
|
|
15
15
|
return verdict;
|
|
16
16
|
}
|
|
17
17
|
throw new Error("Judge verdict has no execution discriminator");
|
|
@@ -6,7 +6,7 @@ const navigatorOutputSchema = withTerminatingOutputDeclarations(
|
|
|
6
6
|
openToolObject(
|
|
7
7
|
Type.Object({
|
|
8
8
|
prose: Type.Unknown({
|
|
9
|
-
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002
|
|
9
|
+
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002"
|
|
10
10
|
})
|
|
11
11
|
})
|
|
12
12
|
)
|
|
@@ -4,12 +4,12 @@ const INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic";
|
|
|
4
4
|
const infrastructureFailureNested = Type.Object(
|
|
5
5
|
{
|
|
6
6
|
[INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: Type.Unknown({
|
|
7
|
-
description: "\
|
|
7
|
+
description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
|
|
8
8
|
})
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
additionalProperties: true,
|
|
12
|
-
description: "\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\
|
|
12
|
+
description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
infrastructureFailureNested.required = [];
|
|
@@ -25,13 +25,15 @@ function withTerminatingOutputDeclarations(schema) {
|
|
|
25
25
|
...baseProperties ?? {},
|
|
26
26
|
...baseProperties?.ticketNumber === void 0 ? {
|
|
27
27
|
ticketNumber: Type.Unknown({
|
|
28
|
-
description: "\u53EF\u9009\u672C\u7968\u53F7\
|
|
28
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\u3002\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\u3002"
|
|
29
29
|
})
|
|
30
30
|
} : {},
|
|
31
31
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
32
32
|
};
|
|
33
33
|
const object = Type.Object(properties, { additionalProperties: true });
|
|
34
|
-
|
|
34
|
+
const incoming = schema.required;
|
|
35
|
+
const preserved = Array.isArray(incoming) ? incoming.filter((key) => typeof key === "string" && Object.hasOwn(properties, key)) : [];
|
|
36
|
+
object.required = preserved;
|
|
35
37
|
return object;
|
|
36
38
|
}
|
|
37
39
|
function isInfrastructureFailureDeclaration(parameters) {
|
|
@@ -75,5 +77,6 @@ export {
|
|
|
75
77
|
INFRASTRUCTURE_FAILURE_DECLARATION_KEY,
|
|
76
78
|
INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY,
|
|
77
79
|
failOnInfrastructureFailureDeclaration,
|
|
80
|
+
infrastructureFailureDiagnostic,
|
|
78
81
|
withTerminatingOutputDeclarations
|
|
79
82
|
};
|
|
@@ -27,21 +27,24 @@ const NOTARY_SESSION_MATERIALS = [
|
|
|
27
27
|
"souls/notary.md",
|
|
28
28
|
"souls/audit-law.md",
|
|
29
29
|
"souls/ticket-law.md",
|
|
30
|
-
"souls/gate-output-guide.md"
|
|
30
|
+
"souls/gate-output-guide.md",
|
|
31
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
31
32
|
];
|
|
32
33
|
const INSPECTOR_SESSION_MATERIALS = [
|
|
33
34
|
"CLAUDE.md",
|
|
34
35
|
"souls/inspector.md",
|
|
35
36
|
"souls/audit-law.md",
|
|
36
37
|
"souls/quality-law.md",
|
|
37
|
-
"souls/gate-output-guide.md"
|
|
38
|
+
"souls/gate-output-guide.md",
|
|
39
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
38
40
|
];
|
|
39
41
|
const AUDITOR_PUBLIC_SESSION_MATERIALS = [
|
|
40
42
|
"CLAUDE.md",
|
|
41
43
|
"souls/judge-auditor.md",
|
|
42
44
|
"souls/doctor-auditor.md",
|
|
43
45
|
"souls/audit-law.md",
|
|
44
|
-
"souls/quality-law.md"
|
|
46
|
+
"souls/quality-law.md",
|
|
47
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
45
48
|
];
|
|
46
49
|
const PUBLIC_ROLE_RECORDS = [
|
|
47
50
|
{
|
|
@@ -69,7 +72,8 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
69
72
|
"souls/judge.md",
|
|
70
73
|
"souls/audit-law.md",
|
|
71
74
|
"souls/quality-law.md",
|
|
72
|
-
"souls/judge-output-guide.md"
|
|
75
|
+
"souls/judge-output-guide.md",
|
|
76
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
73
77
|
]
|
|
74
78
|
},
|
|
75
79
|
{
|
|
@@ -347,7 +351,7 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
347
351
|
activationStage: "load-and-install",
|
|
348
352
|
receiptStatusKey: "status",
|
|
349
353
|
// #924: 公用《票面法》三席同装
|
|
350
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md"]
|
|
354
|
+
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
351
355
|
},
|
|
352
356
|
{
|
|
353
357
|
role: "secretariat",
|
|
@@ -234,7 +234,7 @@ export async function runCountersignCourtDiaristStation(admitted, env, io, after
|
|
|
234
234
|
const completedIndex = afterTicketNumber === undefined ? -1 : refreshTickets.indexOf(afterTicketNumber);
|
|
235
235
|
for (const ticketNumber of refreshTickets.slice(completedIndex + 1)) {
|
|
236
236
|
const outcome = await invokeCourtDiarist({
|
|
237
|
-
instruction:
|
|
237
|
+
instruction: admitted.instruction,
|
|
238
238
|
projectRoot: admitted.projectRoot,
|
|
239
239
|
failureLabel: `ticket #${ticketNumber}`,
|
|
240
240
|
correlationId: admitted.runId,
|
|
@@ -24,7 +24,7 @@ import { validateMergerInput, } from "../merger-contracts.js";
|
|
|
24
24
|
import { sha256Hex } from "../sha256.js";
|
|
25
25
|
import { rehomeUnboundTicketProvenance } from "../ticket-provenance.js";
|
|
26
26
|
import { uuidv7 } from "../uuidv7.js";
|
|
27
|
-
import {
|
|
27
|
+
import {} from "../notary-contracts.js";
|
|
28
28
|
import { NotarySourceRunError, resolveNotarySourceRunLocator, } from "../notary-source-run.js";
|
|
29
29
|
import { appendEngineSessionMaterial, } from "../package-resources/engine-material.js";
|
|
30
30
|
import { CliUsageError } from "./cli-errors.js";
|
|
@@ -1293,13 +1293,16 @@ function admittedTransportPromptKind(admitted) {
|
|
|
1293
1293
|
export function buildInstructionTransportPrompt(admitted, engineMaterial) {
|
|
1294
1294
|
const kind = admittedTransportPromptKind(admitted);
|
|
1295
1295
|
if (kind === "fixed-kickoff") {
|
|
1296
|
-
|
|
1296
|
+
if (admitted.sourceRunPath === undefined || admitted.sourceRunPath.trim() === "") {
|
|
1297
|
+
throw new Error("fixed-kickoff transport prompt is missing the source run pointer");
|
|
1298
|
+
}
|
|
1299
|
+
return appendEngineSessionMaterial([admitted.sourceRunPath], engineMaterial).join("\n");
|
|
1297
1300
|
}
|
|
1298
1301
|
if (kind === "baseline") {
|
|
1299
1302
|
if (admitted.baseRevision === undefined) {
|
|
1300
1303
|
throw new Error("baseline transport prompt is missing the bound revision");
|
|
1301
1304
|
}
|
|
1302
|
-
const lines = [
|
|
1305
|
+
const lines = [admitted.baseRevision];
|
|
1303
1306
|
if (!admitted.instructionEmpty) {
|
|
1304
1307
|
lines.push("", admitted.instruction);
|
|
1305
1308
|
}
|
package/dist/public-cli/main.js
CHANGED
|
@@ -8775,7 +8775,10 @@ function openToolObjectFromUnion(schema) {
|
|
|
8775
8775
|
}
|
|
8776
8776
|
function openToolObject(schema) {
|
|
8777
8777
|
const object = typebox_exports.Object(
|
|
8778
|
-
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
8778
|
+
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
8779
|
+
name,
|
|
8780
|
+
typebox_exports.Optional(described(name, declaration))
|
|
8781
|
+
])),
|
|
8779
8782
|
{ additionalProperties: true }
|
|
8780
8783
|
);
|
|
8781
8784
|
object.required = [];
|
|
@@ -8795,13 +8798,15 @@ function withTerminatingOutputDeclarations(schema) {
|
|
|
8795
8798
|
...baseProperties ?? {},
|
|
8796
8799
|
...baseProperties?.ticketNumber === void 0 ? {
|
|
8797
8800
|
ticketNumber: typebox_exports.Unknown({
|
|
8798
|
-
description: "\u53EF\u9009\u672C\u7968\u53F7\
|
|
8801
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\u3002\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\u3002"
|
|
8799
8802
|
})
|
|
8800
8803
|
} : {},
|
|
8801
8804
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
8802
8805
|
};
|
|
8803
8806
|
const object = typebox_exports.Object(properties, { additionalProperties: true });
|
|
8804
|
-
|
|
8807
|
+
const incoming = schema.required;
|
|
8808
|
+
const preserved = Array.isArray(incoming) ? incoming.filter((key) => typeof key === "string" && Object.hasOwn(properties, key)) : [];
|
|
8809
|
+
object.required = preserved;
|
|
8805
8810
|
return object;
|
|
8806
8811
|
}
|
|
8807
8812
|
var INFRASTRUCTURE_FAILURE_DECLARATION_KEY, INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY, infrastructureFailureNested, infrastructureFailureDeclarationSchema;
|
|
@@ -8814,12 +8819,12 @@ var init_terminating_infrastructure = __esm({
|
|
|
8814
8819
|
infrastructureFailureNested = typebox_exports.Object(
|
|
8815
8820
|
{
|
|
8816
8821
|
[INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: typebox_exports.Unknown({
|
|
8817
|
-
description: "\
|
|
8822
|
+
description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
|
|
8818
8823
|
})
|
|
8819
8824
|
},
|
|
8820
8825
|
{
|
|
8821
8826
|
additionalProperties: true,
|
|
8822
|
-
description: "\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\
|
|
8827
|
+
description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
|
|
8823
8828
|
}
|
|
8824
8829
|
);
|
|
8825
8830
|
infrastructureFailureNested.required = [];
|
|
@@ -8844,7 +8849,7 @@ var init_gatekeeper_output = __esm({
|
|
|
8844
8849
|
gatekeeperDecisionSchema = openToolObject(
|
|
8845
8850
|
typebox_exports.Object({
|
|
8846
8851
|
status: typebox_exports.Unknown({
|
|
8847
|
-
description: "dispatch | pass
|
|
8852
|
+
description: "dispatch | pass"
|
|
8848
8853
|
}),
|
|
8849
8854
|
officer: typebox_exports.Unknown({
|
|
8850
8855
|
description: "status \u4E3A dispatch \u65F6\u4E3A inspector | notary"
|
|
@@ -8873,7 +8878,7 @@ var init_navigator_output = __esm({
|
|
|
8873
8878
|
openToolObject(
|
|
8874
8879
|
typebox_exports.Object({
|
|
8875
8880
|
prose: typebox_exports.Unknown({
|
|
8876
|
-
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002
|
|
8881
|
+
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002"
|
|
8877
8882
|
})
|
|
8878
8883
|
})
|
|
8879
8884
|
)
|
|
@@ -8882,31 +8887,37 @@ var init_navigator_output = __esm({
|
|
|
8882
8887
|
});
|
|
8883
8888
|
|
|
8884
8889
|
// src/review-submission.ts
|
|
8885
|
-
var REVIEW_SUBMISSION_OUTPUT_TOOL_NAME, reviewSubmissionSchema;
|
|
8890
|
+
var REVIEW_SUBMISSION_OUTPUT_TOOL_NAME, REVIEW_QUEUE_WORDS, REVIEW_QUEUE_STATUSES, reviewSubmissionSchema;
|
|
8886
8891
|
var init_review_submission = __esm({
|
|
8887
8892
|
"src/review-submission.ts"() {
|
|
8888
8893
|
"use strict";
|
|
8889
8894
|
init_build();
|
|
8890
|
-
init_open_tool_schema();
|
|
8891
8895
|
init_terminating_infrastructure();
|
|
8892
8896
|
REVIEW_SUBMISSION_OUTPUT_TOOL_NAME = "ak_submission_output";
|
|
8897
|
+
REVIEW_QUEUE_WORDS = ["converged", "continue", "escalate"];
|
|
8898
|
+
REVIEW_QUEUE_STATUSES = new Set(REVIEW_QUEUE_WORDS);
|
|
8893
8899
|
reviewSubmissionSchema = withTerminatingOutputDeclarations(
|
|
8894
|
-
|
|
8895
|
-
typebox_exports.
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
})
|
|
8909
|
-
|
|
8900
|
+
typebox_exports.Object({
|
|
8901
|
+
status: typebox_exports.Union(
|
|
8902
|
+
[
|
|
8903
|
+
typebox_exports.Literal(REVIEW_QUEUE_WORDS[0]),
|
|
8904
|
+
typebox_exports.Literal(REVIEW_QUEUE_WORDS[1]),
|
|
8905
|
+
typebox_exports.Literal(REVIEW_QUEUE_WORDS[2])
|
|
8906
|
+
],
|
|
8907
|
+
{
|
|
8908
|
+
description: "\u5BA1\u6838\u5E2D\u672C\u8F6E\u88C1\u51B3\u7684\u5224\u522B\u72B6\u6001\u3002"
|
|
8909
|
+
}
|
|
8910
|
+
),
|
|
8911
|
+
findings: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u5BA1\u6838\u53D1\u73B0\uFF0C\u539F\u6837\u7559\u5B58" })),
|
|
8912
|
+
reason: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u4E0A\u5448\u7406\u7531" })),
|
|
8913
|
+
violations: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u8FDD\u89C4\u6761\u76EE" })),
|
|
8914
|
+
conflicts: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u5F85\u51B3\u51B2\u7A81" })),
|
|
8915
|
+
fix: typebox_exports.Optional(typebox_exports.Unknown({ description: "continue \u65F6\u7684\u8865\u6551\u8BF4\u660E\uFF1B\u53EF\u5199 summary \u6458\u8981\uFF0C\u5176\u4F59\u5185\u5BB9\u539F\u6837\u7559\u5B58" })),
|
|
8916
|
+
classes: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u5DF2\u88C1\u51B3 finding \u7C7B\uFF1B\u53EF\u8BF4\u660E name\u3001owner\u3001boundary\u3001disposition\uFF0C\u539F\u6837\u7559\u5B58" })),
|
|
8917
|
+
note: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u88C1\u51B3\u9644\u6CE8" })),
|
|
8918
|
+
evidence: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u7559\u5B58\u8BC1\u636E" })),
|
|
8919
|
+
decisionGate: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u9700\u4EBA\u6743\u5A01\u5904\u7F6E\u7684\u95EE\u9898\u4E0E\u9009\u9879\uFF1B\u53EF\u8BF4\u660E question\u3001options\uFF0C\u539F\u6837\u7559\u5B58" }))
|
|
8920
|
+
}, { additionalProperties: true })
|
|
8910
8921
|
);
|
|
8911
8922
|
}
|
|
8912
8923
|
});
|
|
@@ -8964,7 +8975,7 @@ var init_fixer_output = __esm({
|
|
|
8964
8975
|
});
|
|
8965
8976
|
classResultSchema = typebox_exports.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
8966
8977
|
completedClassResultsSchema = typebox_exports.Array(completedClassResultSchema);
|
|
8967
|
-
FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed
|
|
8978
|
+
FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002";
|
|
8968
8979
|
fixerOutputVariants = typebox_exports.Union([
|
|
8969
8980
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }),
|
|
8970
8981
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), remainingScope: typebox_exports.String({ description: "\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u5DE5\u4F5C\u8303\u56F4" }), blocker: typebox_exports.Unsafe({ ...blockerSchema, description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker" }) }),
|
|
@@ -15021,7 +15032,7 @@ var init_doctor_contracts = __esm({
|
|
|
15021
15032
|
typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), assetEvidence: typebox_exports.Optional(typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), evidenceId: nonblank }, { additionalProperties: true })), ...findingBody }, { additionalProperties: true })
|
|
15022
15033
|
]);
|
|
15023
15034
|
caseIdentity = typebox_exports.Object({ issueNumber: typebox_exports.Optional(typebox_exports.Integer()), runsPath: nonblank }, { additionalProperties: true });
|
|
15024
|
-
DOCTOR_STATUS_DESCRIPTION = "completed | refused
|
|
15035
|
+
DOCTOR_STATUS_DESCRIPTION = "completed | refused\u3002completed \u5141\u8BB8\u7A7A findings\uFF1Brefused \u4EC5\u5F53\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD";
|
|
15025
15036
|
doctorSubmissionVariants = typebox_exports.Union([
|
|
15026
15037
|
typebox_exports.Object({
|
|
15027
15038
|
status: typebox_exports.Unknown({ description: DOCTOR_STATUS_DESCRIPTION }),
|
|
@@ -15101,7 +15112,7 @@ var init_merger_contracts = __esm({
|
|
|
15101
15112
|
resolutionScope: typebox_exports.Array(typebox_exports.String(), { description: "\u6750\u6599\uFF1A\u89E3\u6790\u8303\u56F4\u63D0\u793A\uFF1B\u53EF\u7A7A" }),
|
|
15102
15113
|
authorizedChecks: typebox_exports.Array(checkSchema)
|
|
15103
15114
|
}, { additionalProperties: false });
|
|
15104
|
-
MERGER_STATUS_DESCRIPTION = "completed | escalate
|
|
15115
|
+
MERGER_STATUS_DESCRIPTION = "completed | escalate";
|
|
15105
15116
|
mergerOutputVariants = typebox_exports.Union([
|
|
15106
15117
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: typebox_exports.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), mergeCommitId: typebox_exports.String({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }) }, { additionalProperties: false }),
|
|
15107
15118
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: typebox_exports.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), diagnosis: typebox_exports.String({ description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09" }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }, { additionalProperties: false })
|
|
@@ -15122,13 +15133,12 @@ var init_merger_contracts = __esm({
|
|
|
15122
15133
|
});
|
|
15123
15134
|
|
|
15124
15135
|
// src/notary-contracts.ts
|
|
15125
|
-
var NOTARY_OUTPUT_TOOL_NAME
|
|
15136
|
+
var NOTARY_OUTPUT_TOOL_NAME;
|
|
15126
15137
|
var init_notary_contracts = __esm({
|
|
15127
15138
|
"src/notary-contracts.ts"() {
|
|
15128
15139
|
"use strict";
|
|
15129
15140
|
init_review_submission();
|
|
15130
15141
|
NOTARY_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
15131
|
-
NOTARY_FIXED_KICKOFF = "\u7B26\u5B9D\u90CE\u6848\u5377\u5DF2\u53D7\u7406\uFF1B\u6765\u6E90 run \u5B9A\u4F4D\u89C1\u4F1A\u8BDD\u6750\u6599\u3002";
|
|
15132
15142
|
}
|
|
15133
15143
|
});
|
|
15134
15144
|
|
|
@@ -15512,21 +15522,24 @@ var init_packaged_role_registry = __esm({
|
|
|
15512
15522
|
"souls/notary.md",
|
|
15513
15523
|
"souls/audit-law.md",
|
|
15514
15524
|
"souls/ticket-law.md",
|
|
15515
|
-
"souls/gate-output-guide.md"
|
|
15525
|
+
"souls/gate-output-guide.md",
|
|
15526
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15516
15527
|
];
|
|
15517
15528
|
INSPECTOR_SESSION_MATERIALS = [
|
|
15518
15529
|
"CLAUDE.md",
|
|
15519
15530
|
"souls/inspector.md",
|
|
15520
15531
|
"souls/audit-law.md",
|
|
15521
15532
|
"souls/quality-law.md",
|
|
15522
|
-
"souls/gate-output-guide.md"
|
|
15533
|
+
"souls/gate-output-guide.md",
|
|
15534
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15523
15535
|
];
|
|
15524
15536
|
AUDITOR_PUBLIC_SESSION_MATERIALS = [
|
|
15525
15537
|
"CLAUDE.md",
|
|
15526
15538
|
"souls/judge-auditor.md",
|
|
15527
15539
|
"souls/doctor-auditor.md",
|
|
15528
15540
|
"souls/audit-law.md",
|
|
15529
|
-
"souls/quality-law.md"
|
|
15541
|
+
"souls/quality-law.md",
|
|
15542
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15530
15543
|
];
|
|
15531
15544
|
PUBLIC_ROLE_RECORDS = [
|
|
15532
15545
|
{
|
|
@@ -15554,7 +15567,8 @@ var init_packaged_role_registry = __esm({
|
|
|
15554
15567
|
"souls/judge.md",
|
|
15555
15568
|
"souls/audit-law.md",
|
|
15556
15569
|
"souls/quality-law.md",
|
|
15557
|
-
"souls/judge-output-guide.md"
|
|
15570
|
+
"souls/judge-output-guide.md",
|
|
15571
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15558
15572
|
]
|
|
15559
15573
|
},
|
|
15560
15574
|
{
|
|
@@ -15832,7 +15846,7 @@ var init_packaged_role_registry = __esm({
|
|
|
15832
15846
|
activationStage: "load-and-install",
|
|
15833
15847
|
receiptStatusKey: "status",
|
|
15834
15848
|
// #924: 公用《票面法》三席同装
|
|
15835
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md"]
|
|
15849
|
+
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
15836
15850
|
},
|
|
15837
15851
|
{
|
|
15838
15852
|
role: "secretariat",
|
|
@@ -18131,6 +18145,7 @@ var init_compliance_transport = __esm({
|
|
|
18131
18145
|
"use strict";
|
|
18132
18146
|
init_auditor_dossier_tool();
|
|
18133
18147
|
init_gatekeeper_role();
|
|
18148
|
+
init_submission_errors();
|
|
18134
18149
|
init_terminal();
|
|
18135
18150
|
init_readable_gate_item();
|
|
18136
18151
|
AUDITOR_PARENT_ATTEMPT_BINDING_ENTRY_TYPE = "ak_auditor_parent_attempt_binding";
|
|
@@ -22713,13 +22728,16 @@ function admittedTransportPromptKind(admitted) {
|
|
|
22713
22728
|
function buildInstructionTransportPrompt(admitted, engineMaterial) {
|
|
22714
22729
|
const kind = admittedTransportPromptKind(admitted);
|
|
22715
22730
|
if (kind === "fixed-kickoff") {
|
|
22716
|
-
|
|
22731
|
+
if (admitted.sourceRunPath === void 0 || admitted.sourceRunPath.trim() === "") {
|
|
22732
|
+
throw new Error("fixed-kickoff transport prompt is missing the source run pointer");
|
|
22733
|
+
}
|
|
22734
|
+
return appendEngineSessionMaterial([admitted.sourceRunPath], engineMaterial).join("\n");
|
|
22717
22735
|
}
|
|
22718
22736
|
if (kind === "baseline") {
|
|
22719
22737
|
if (admitted.baseRevision === void 0) {
|
|
22720
22738
|
throw new Error("baseline transport prompt is missing the bound revision");
|
|
22721
22739
|
}
|
|
22722
|
-
const lines2 = [
|
|
22740
|
+
const lines2 = [admitted.baseRevision];
|
|
22723
22741
|
if (!admitted.instructionEmpty) {
|
|
22724
22742
|
lines2.push("", admitted.instruction);
|
|
22725
22743
|
}
|
|
@@ -23447,9 +23465,10 @@ var init_auditor_soul = __esm({
|
|
|
23447
23465
|
"CLAUDE.md",
|
|
23448
23466
|
"souls/judge-auditor.md",
|
|
23449
23467
|
"souls/audit-law.md",
|
|
23450
|
-
"souls/quality-law.md"
|
|
23468
|
+
"souls/quality-law.md",
|
|
23469
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
23451
23470
|
],
|
|
23452
|
-
doctor: ["CLAUDE.md", "souls/doctor-auditor.md"]
|
|
23471
|
+
doctor: ["CLAUDE.md", "souls/doctor-auditor.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
23453
23472
|
};
|
|
23454
23473
|
}
|
|
23455
23474
|
});
|
|
@@ -23654,6 +23673,7 @@ var init_submission_ledger = __esm({
|
|
|
23654
23673
|
init_run_lifecycle();
|
|
23655
23674
|
init_submission_correctable_error();
|
|
23656
23675
|
init_terminating_infrastructure();
|
|
23676
|
+
init_review_submission();
|
|
23657
23677
|
}
|
|
23658
23678
|
});
|
|
23659
23679
|
|
|
@@ -24497,7 +24517,7 @@ function findLatestDurablePackagedRoleTerminal(entries) {
|
|
|
24497
24517
|
}
|
|
24498
24518
|
return void 0;
|
|
24499
24519
|
}
|
|
24500
|
-
var NAVIGATOR_INVOCATION_ENTRY, NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND, NAVIGATOR_INFRASTRUCTURE_FAILURE_KEYS, PACKAGED_ROLE_OUTPUT_TOOLS;
|
|
24520
|
+
var NAVIGATOR_INVOCATION_ENTRY, NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY, NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND, NAVIGATOR_INFRASTRUCTURE_FAILURE_KEYS, PACKAGED_ROLE_OUTPUT_TOOLS;
|
|
24501
24521
|
var init_navigator_invocation_identity = __esm({
|
|
24502
24522
|
"src/navigator-invocation-identity.ts"() {
|
|
24503
24523
|
"use strict";
|
|
@@ -24505,6 +24525,7 @@ var init_navigator_invocation_identity = __esm({
|
|
|
24505
24525
|
init_uuidv7();
|
|
24506
24526
|
init_work_subject_identity();
|
|
24507
24527
|
NAVIGATOR_INVOCATION_ENTRY = "ak-navigator-invocation";
|
|
24528
|
+
NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY = "ak-navigator-route-playbook-failure";
|
|
24508
24529
|
NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND = "role_infrastructure_failure";
|
|
24509
24530
|
NAVIGATOR_INFRASTRUCTURE_FAILURE_KEYS = [
|
|
24510
24531
|
"kind",
|
|
@@ -25680,7 +25701,23 @@ async function withOptionalGateProjection(base, sessionDirectory, gateContext =
|
|
|
25680
25701
|
}
|
|
25681
25702
|
return attachEngineDetourToolUsage(next, sessionDirectory, gateContext);
|
|
25682
25703
|
}
|
|
25704
|
+
function routePlaybookFailureMessage(entries) {
|
|
25705
|
+
for (let i = entries.length - 1; i >= 0; i -= 1) {
|
|
25706
|
+
const entry = entries[i];
|
|
25707
|
+
if (entry?.type !== "custom" || entry.customType !== NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY) continue;
|
|
25708
|
+
const data = entry.data;
|
|
25709
|
+
if (!isRecord9(data) || typeof data.message !== "string" || data.message.trim() === "") return void 0;
|
|
25710
|
+
return data.message;
|
|
25711
|
+
}
|
|
25712
|
+
return void 0;
|
|
25713
|
+
}
|
|
25683
25714
|
function extractNavigatorFact(entries) {
|
|
25715
|
+
const fact = extractNavigatorAttendanceFact(entries);
|
|
25716
|
+
if (fact.advisoryDiagnostic !== void 0) return fact;
|
|
25717
|
+
const message = routePlaybookFailureMessage(entries);
|
|
25718
|
+
return message === void 0 ? fact : { ...fact, advisoryDiagnostic: message };
|
|
25719
|
+
}
|
|
25720
|
+
function extractNavigatorAttendanceFact(entries) {
|
|
25684
25721
|
const terminal = findLatestDurablePackagedRoleTerminal(entries);
|
|
25685
25722
|
if (terminal === void 0) {
|
|
25686
25723
|
return {
|
|
@@ -28691,7 +28728,7 @@ async function runCountersignCourtDiaristStation(admitted, env, io, afterTicketN
|
|
|
28691
28728
|
for (const ticketNumber of refreshTickets.slice(completedIndex + 1)) {
|
|
28692
28729
|
const outcome = await invokeCourtDiarist(
|
|
28693
28730
|
{
|
|
28694
|
-
instruction:
|
|
28731
|
+
instruction: admitted.instruction,
|
|
28695
28732
|
projectRoot: admitted.projectRoot,
|
|
28696
28733
|
failureLabel: `ticket #${ticketNumber}`,
|
|
28697
28734
|
correlationId: admitted.runId,
|