@akagilnc/pi-workflow-roles 0.1.5845 → 0.1.5853
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 +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/acp-host/production-host.js +348 -1254
- package/dist/acp-host/role-turn-host.js +4 -98
- package/dist/headless-host/production-host.js +15731 -16582
- package/dist/headless-host/role-turn-host.js +6 -31
- package/dist/migrate-book-topology.js +31 -16
- package/dist/navigator-attendance.js +54 -404
- package/dist/navigator-invocation-identity.js +0 -2
- package/dist/navigator-lookup-host.js +41 -0
- package/dist/navigator-lookup.js +68 -0
- package/dist/navigator-route-table.js +42 -0
- package/dist/package-contracts/navigator-output.js +3 -11
- package/dist/packaged-role-registry.js +3 -27
- package/dist/public-cli/instruction-seat-run.js +4 -1
- package/dist/public-cli/invocation.js +13 -26
- package/dist/public-cli/main.js +286 -114
- package/dist/public-cli/option-definitions.js +24 -4
- package/dist/public-cli/post-admission.js +0 -9
- package/dist/public-cli/role-seat-runtime.js +14 -0
- package/dist/public-cli/settlement.js +14 -40
- package/dist/public-cli/terminal.js +1 -8
- package/dist/public-cli/turn-request.js +0 -3
- package/dist/public-role-summons.js +0 -1
- package/dist/receipt-delivery-policy.js +0 -23
- package/dist/role-runtime-dependencies.js +4 -11
- package/dist/role-runtime.js +18 -194
- package/dist/submission-ledger.js +19 -15
- package/dist/ticket-progress.js +23 -5
- package/extensions/role-runtime.ts +0 -16
- package/package.json +1 -1
- package/scripts/build-package.mjs +3 -7
- package/src/acp-host/role-turn-host.ts +8 -97
- package/src/headless-host/description.ts +0 -2
- package/src/headless-host/role-turn-host.ts +7 -32
- package/src/host-contracts.ts +5 -7
- package/src/navigator-attendance.ts +86 -549
- package/src/navigator-invocation-identity.ts +0 -2
- package/src/navigator-lookup-host.ts +45 -0
- package/src/navigator-lookup.ts +98 -0
- package/src/navigator-route-table.ts +92 -0
- package/src/package-contracts/navigator-output.ts +4 -15
- package/src/packaged-role-registry.ts +3 -32
- package/src/public-cli/instruction-seat-run.ts +3 -0
- package/src/public-cli/invocation.ts +18 -30
- package/src/public-cli/option-definitions.ts +25 -4
- package/src/public-cli/post-admission.ts +0 -11
- package/src/public-cli/role-seat-runtime.ts +14 -0
- package/src/public-cli/settlement.ts +23 -51
- package/src/public-cli/terminal.ts +3 -18
- package/src/public-cli/turn-request.ts +0 -5
- package/src/public-role-summons.ts +0 -8
- package/src/receipt-delivery-policy.ts +0 -21
- package/src/role-runtime-dependencies.ts +4 -11
- package/src/role-runtime.ts +19 -210
- package/src/submission-ledger.ts +23 -16
- package/src/ticket-progress.ts +32 -5
- package/dist/navigator-public-session.js +0 -205
- package/dist/navigator-role.js +0 -6
- package/dist/navigator-session-contracts.js +0 -227
- package/dist/navigator-work-context.js +0 -72
- package/resources/navigator-route-playbook.md +0 -33
- package/src/navigator-public-session.ts +0 -305
- package/src/navigator-role.ts +0 -15
- package/src/navigator-session-contracts.ts +0 -320
- package/src/navigator-work-context.ts +0 -97
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const NAVIGATOR_ADVICE_MAX_CHARS = 20;
|
|
2
|
+
const DISPOSE_BY_VERDICT = "按判词处置";
|
|
3
|
+
const ESCALATE_TO_OWNER = "呈陛下裁决";
|
|
4
|
+
const DISPATCH_WORKER = "派将作监开工";
|
|
5
|
+
const SETTLED_TO_JUDGE = "可送大理寺审计";
|
|
6
|
+
const RESUME_SAME_WORKER = "续修,勿送大理寺";
|
|
7
|
+
const ROUTE_ROWS = {
|
|
8
|
+
secretariat: { converged: DISPATCH_WORKER, escalate: ESCALATE_TO_OWNER },
|
|
9
|
+
countersign: { converged: DISPATCH_WORKER, continue: DISPOSE_BY_VERDICT, escalate: ESCALATE_TO_OWNER },
|
|
10
|
+
notary: { converged: "按流程进下一站", continue: DISPOSE_BY_VERDICT, escalate: ESCALATE_TO_OWNER },
|
|
11
|
+
inspector: { converged: "按流程进下一站", continue: DISPOSE_BY_VERDICT, escalate: ESCALATE_TO_OWNER },
|
|
12
|
+
coder: {
|
|
13
|
+
completed: "派御史台",
|
|
14
|
+
partially_completed: SETTLED_TO_JUDGE,
|
|
15
|
+
refused: SETTLED_TO_JUDGE,
|
|
16
|
+
unfinished: RESUME_SAME_WORKER,
|
|
17
|
+
},
|
|
18
|
+
fixer: {
|
|
19
|
+
completed: "直回大理寺复审",
|
|
20
|
+
partially_completed: SETTLED_TO_JUDGE,
|
|
21
|
+
refused: SETTLED_TO_JUDGE,
|
|
22
|
+
unfinished: RESUME_SAME_WORKER,
|
|
23
|
+
},
|
|
24
|
+
reviewer: { completed: "派大理寺裁决", refused: "呈调用者处置" },
|
|
25
|
+
judge: {
|
|
26
|
+
converged: "调用者合并、关票",
|
|
27
|
+
continue: DISPOSE_BY_VERDICT,
|
|
28
|
+
escalate: ESCALATE_TO_OWNER,
|
|
29
|
+
},
|
|
30
|
+
gatekeeper: { dispatch: "召所点名的官员", pass: "放行,进下一站" },
|
|
31
|
+
merger: { completed: "调用者收尾、关票", escalate: ESCALATE_TO_OWNER },
|
|
32
|
+
diarist: { completed: "继续后续衙门", escalate: ESCALATE_TO_OWNER },
|
|
33
|
+
};
|
|
34
|
+
export const NAVIGATOR_ROUTE_TABLE = ROUTE_ROWS;
|
|
35
|
+
/** 某衙门的全部行;表中无此衙门时为空对象。 */
|
|
36
|
+
export function navigatorRowsForRole(role) {
|
|
37
|
+
return NAVIGATOR_ROUTE_TABLE[role] ?? {};
|
|
38
|
+
}
|
|
39
|
+
/** 整表:衙门 → (status → 建议)。 */
|
|
40
|
+
export function navigatorFullTable() {
|
|
41
|
+
return NAVIGATOR_ROUTE_TABLE;
|
|
42
|
+
}
|
|
@@ -9,6 +9,9 @@ const navigatorAdviceFields = {
|
|
|
9
9
|
}),
|
|
10
10
|
byStatus: Type.Unknown({
|
|
11
11
|
description: "\u6309\u4E3B\u8859\u95E8\u7ED3\u5C40 status \u9884\u5199\u7684\u6563\u6587\u5EFA\u8BAE\u3002\u952E\u4E3A status \u5B57\u9762\u91CF\uFF0C\u503C\u4E3A\u5EFA\u8BAE\u6B63\u6587\u3002\u7ED3\u7B97\u65F6\u4EE3\u7801\u53EA\u6309\u5B9E\u9645 status \u53D6\u5BF9\u5E94\u539F\u6587\uFF0C\u4E0D\u89E3\u6790\u5EFA\u8BAE\u8BED\u4E49\u3002"
|
|
12
|
+
}),
|
|
13
|
+
byRole: Type.Unknown({
|
|
14
|
+
description: "\u6574\u5F20\u8DEF\u7EBF\u8868\uFF1A\u952E\u4E3A\u8859\u95E8\u89D2\u8272\uFF0C\u503C\u4E3A\u8BE5\u8859\u95E8 status \u2192 \u5EFA\u8BAE\u3002\u76F4\u63A5\u5165\u53E3\u4E0D\u7ED9\u89D2\u8272\u65F6\u4F7F\u7528\u3002"
|
|
12
15
|
})
|
|
13
16
|
};
|
|
14
17
|
const navigatorAdviceBodySchema = openToolObject(Type.Object(navigatorAdviceFields));
|
|
@@ -41,9 +44,6 @@ function byStatusFromUnknown(value) {
|
|
|
41
44
|
}
|
|
42
45
|
return out;
|
|
43
46
|
}
|
|
44
|
-
function byStatusToPlainObject(byStatus) {
|
|
45
|
-
return Object.fromEntries(byStatus);
|
|
46
|
-
}
|
|
47
47
|
function projectLawfulNavigatorOutput(value) {
|
|
48
48
|
if (value === void 0 || value === null) return void 0;
|
|
49
49
|
if (typeof value === "string") return { prose: value };
|
|
@@ -66,12 +66,6 @@ function validateRecordedNavigatorOutput(value) {
|
|
|
66
66
|
}
|
|
67
67
|
return projected;
|
|
68
68
|
}
|
|
69
|
-
function navigatorProseFromUnknown(value) {
|
|
70
|
-
const projected = projectLawfulNavigatorOutput(value);
|
|
71
|
-
if (projected === void 0) return void 0;
|
|
72
|
-
const trimmed = projected.prose.trim();
|
|
73
|
-
return trimmed === "" ? void 0 : projected.prose;
|
|
74
|
-
}
|
|
75
69
|
function preparedAdviceFromUnknown(value) {
|
|
76
70
|
if (value === void 0 || value === null) return void 0;
|
|
77
71
|
if (typeof value === "string") {
|
|
@@ -125,12 +119,10 @@ function pickPreparedProse(prepared, status) {
|
|
|
125
119
|
}
|
|
126
120
|
export {
|
|
127
121
|
NAVIGATOR_OUTPUT_TOOL_NAME,
|
|
128
|
-
byStatusToPlainObject,
|
|
129
122
|
mergePreparedAdvice,
|
|
130
123
|
navigatorAdviceBodySchema,
|
|
131
124
|
navigatorAdviceFields,
|
|
132
125
|
navigatorOutputSchema,
|
|
133
|
-
navigatorProseFromUnknown,
|
|
134
126
|
pickPreparedProse,
|
|
135
127
|
preparedAdviceFromUnknown,
|
|
136
128
|
projectLawfulNavigatorOutput,
|
|
@@ -61,8 +61,6 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
61
61
|
settlement: "sealed",
|
|
62
62
|
/** Factory board: court until another station has started, then marshal. */
|
|
63
63
|
boardPlacement: "judge-history",
|
|
64
|
-
/** Navigator subject is the public admitted instruction when the run is bound. */
|
|
65
|
-
navigatorSubject: "public-instruction",
|
|
66
64
|
activationStage: "load-and-install",
|
|
67
65
|
receiptStatusKey: "status",
|
|
68
66
|
sessionMaterials: [
|
|
@@ -91,8 +89,6 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
91
89
|
reportPhase: true
|
|
92
90
|
},
|
|
93
91
|
boardPlacement: "marshal",
|
|
94
|
-
/** #1168: dispatch is first message; navigator reads admitted instruction. */
|
|
95
|
-
navigatorSubject: "public-instruction",
|
|
96
92
|
activationFlags: [
|
|
97
93
|
{ field: "phase", flag: "ak-fixer-phase", binds: "phase" }
|
|
98
94
|
],
|
|
@@ -121,8 +117,6 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
121
117
|
artifactFace: {
|
|
122
118
|
reportPhase: true
|
|
123
119
|
},
|
|
124
|
-
/** #1168: dispatch is first message; navigator reads admitted instruction. */
|
|
125
|
-
navigatorSubject: "public-instruction",
|
|
126
120
|
activationFlags: [
|
|
127
121
|
{ field: "phase", flag: "ak-coder-phase", binds: "phase" }
|
|
128
122
|
],
|
|
@@ -216,8 +210,6 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
216
210
|
artifactFace: {
|
|
217
211
|
doctorReportFacts: true
|
|
218
212
|
},
|
|
219
|
-
/** Navigator subject is the doctor case, not the case-path file bytes. */
|
|
220
|
-
navigatorSubject: "case",
|
|
221
213
|
activationFlags: [
|
|
222
214
|
{ field: "casePath", from: "caseRunsPath", flag: "ak-doctor-case", binds: "input" }
|
|
223
215
|
],
|
|
@@ -272,8 +264,6 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
272
264
|
gateStageLabel: "\u7B26\u5B9D\u90CE",
|
|
273
265
|
/** Gate summon binds --source-run and keeps dialogue off the argv. */
|
|
274
266
|
gateSummon: "source-run",
|
|
275
|
-
/** Navigator subject is the source-run locator, not the path file bytes. */
|
|
276
|
-
navigatorSubject: "source-run",
|
|
277
267
|
activationFlags: [
|
|
278
268
|
{ field: "sourceRun", from: "sourceRunPath", flag: "ak-notary-source-run", binds: "input" },
|
|
279
269
|
{ field: "ticketNumber", flag: "ak-notary-ticket-number" }
|
|
@@ -411,12 +401,14 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
411
401
|
role: "navigator",
|
|
412
402
|
inCallAutoResume: false,
|
|
413
403
|
presentSettled: "always",
|
|
414
|
-
summonResume:
|
|
404
|
+
summonResume: false,
|
|
415
405
|
admission: "instruction",
|
|
416
406
|
sameParent: "none",
|
|
417
407
|
phases: [null],
|
|
418
408
|
outputTool: NAVIGATOR_OUTPUT_TOOL_NAME,
|
|
419
409
|
settlement: "accepted",
|
|
410
|
+
/** #1192: structured target seat for the lookup run; no host flag (no host runs it). */
|
|
411
|
+
activationFlags: [{ field: "forRole" }],
|
|
420
412
|
activationStage: "load-and-install",
|
|
421
413
|
sessionMaterials: ["CLAUDE.md", "souls/navigator.md"]
|
|
422
414
|
},
|
|
@@ -506,9 +498,6 @@ function packagedRoleActivationFlags(role) {
|
|
|
506
498
|
if (record === void 0 || !("activationFlags" in record)) return [];
|
|
507
499
|
return record.activationFlags;
|
|
508
500
|
}
|
|
509
|
-
function packagedRoleInputFlag(role) {
|
|
510
|
-
return packagedRoleActivationFlags(role).find((spec) => spec.binds === "input")?.flag;
|
|
511
|
-
}
|
|
512
501
|
function packagedRolePhaseFlag(role) {
|
|
513
502
|
return packagedRoleActivationFlags(role).find((spec) => spec.binds === "phase")?.flag;
|
|
514
503
|
}
|
|
@@ -564,11 +553,6 @@ function packagedAuditToolName(role) {
|
|
|
564
553
|
if (record === void 0 || !("auditTool" in record)) return void 0;
|
|
565
554
|
return record.auditTool;
|
|
566
555
|
}
|
|
567
|
-
function packagedPublicInstructionSubject(role) {
|
|
568
|
-
return typeof role === "string" && PUBLIC_ROLE_RECORDS.some(
|
|
569
|
-
(record) => "navigatorSubject" in record && record.navigatorSubject === "public-instruction" && record.role === role
|
|
570
|
-
);
|
|
571
|
-
}
|
|
572
556
|
function packagedResumeSourcePath(role) {
|
|
573
557
|
const record = packagedRoleMetadata(role);
|
|
574
558
|
return record !== void 0 && "resumeSourcePath" in record && record.resumeSourcePath === true;
|
|
@@ -577,11 +561,6 @@ function packagedProjectsTargetBindRejection(role) {
|
|
|
577
561
|
const record = packagedRoleMetadata(role);
|
|
578
562
|
return record !== void 0 && "projectTargetBindRejection" in record && record.projectTargetBindRejection === true;
|
|
579
563
|
}
|
|
580
|
-
function packagedNavigatorSubject(role) {
|
|
581
|
-
const record = packagedRoleMetadata(role);
|
|
582
|
-
if (record !== void 0 && "navigatorSubject" in record) return record.navigatorSubject;
|
|
583
|
-
return "file";
|
|
584
|
-
}
|
|
585
564
|
function packagedBoardPlacement(role) {
|
|
586
565
|
const record = packagedRoleMetadata(role);
|
|
587
566
|
if (record === void 0 || !("boardPlacement" in record)) return void 0;
|
|
@@ -631,15 +610,12 @@ export {
|
|
|
631
610
|
packagedGateSummon,
|
|
632
611
|
packagedMethodSkillNames,
|
|
633
612
|
packagedModelParent,
|
|
634
|
-
packagedNavigatorSubject,
|
|
635
613
|
packagedProjectsTargetBindRejection,
|
|
636
614
|
packagedProvinceConfig,
|
|
637
|
-
packagedPublicInstructionSubject,
|
|
638
615
|
packagedRebindSourceOnResume,
|
|
639
616
|
packagedResumeSourcePath,
|
|
640
617
|
packagedRoleAcceptedOutputTool,
|
|
641
618
|
packagedRoleActivationFlags,
|
|
642
|
-
packagedRoleInputFlag,
|
|
643
619
|
packagedRoleMetadata,
|
|
644
620
|
packagedRoleOutputTool,
|
|
645
621
|
packagedRolePhaseFlag,
|
|
@@ -23,7 +23,7 @@ import { summonPublicRole } from "../public-role-summons.js";
|
|
|
23
23
|
import { latestQueuePayload, latestQueueStatus, } from "../submission-gate.js";
|
|
24
24
|
import { isSafePositiveTicketNumber, readBoardTicketNumber, } from "../run-ticket-number.js";
|
|
25
25
|
import { NotarySourceRunError, resolveNotarySourceRunLocator } from "../notary-source-run.js";
|
|
26
|
-
import { packagedAdmitsCountersign, packagedBindsBoardTicket, packagedRebindSourceOnResume, packagedRoleMetadata, } from "../packaged-role-registry.js";
|
|
26
|
+
import { packagedAdmitsCountersign, isNavigatorSeat, packagedBindsBoardTicket, packagedRebindSourceOnResume, packagedRoleMetadata, } from "../packaged-role-registry.js";
|
|
27
27
|
import { readAuditorResumeBinding } from "../auditor-soul.js";
|
|
28
28
|
import { CliUsageError } from "./cli-errors.js";
|
|
29
29
|
import { admitPublicRole, admittedSourceRunPath, bindAdmittedTicketNumber, appendCallerFileFlagPaths, buildInstructionTransportPrompt, materializeCountersignInvocation, persistAdmittedAuditedSubmissionToolCallId, persistAdmittedSourceRunPath, readAdmittedAuditedSubmissionToolCallId, recordAdmittedCorrelation, recordChildDiaristRun, relocateAdmittedRunToTicket, } from "./invocation.js";
|
|
@@ -267,6 +267,9 @@ async function reaskUnreadablePostSubmissionStatus(admitted, terminal, env, io,
|
|
|
267
267
|
async function reaskMissingTicketOnce(admitted, terminal, env, io) {
|
|
268
268
|
if ((env.ticketReasksSpent ?? 0) >= 1)
|
|
269
269
|
return { kind: "none" };
|
|
270
|
+
// #1192: a table lookup has no one to ask, and a second turn would re-seal.
|
|
271
|
+
if (isNavigatorSeat(admitted.role))
|
|
272
|
+
return { kind: "none" };
|
|
270
273
|
if (admitted.ticketNumber !== undefined)
|
|
271
274
|
return { kind: "none" };
|
|
272
275
|
if (!isUnboundRunDirectory(admitted.runDirectory))
|
|
@@ -10,7 +10,7 @@ import { activationBookDirectory, ensureRealDirectoryTree, homeFromRunDirectory,
|
|
|
10
10
|
import { resolveBookKeyFromGit } from "../activation-ledger-git.js";
|
|
11
11
|
import { ensureRoleRunDirectory, ensureRoleRunPlacement, isUnboundRunDirectory, listBookRunDirectories, roleRunPlacement, sessionDirectoryOf, sessionFileIn, } from "../role-run-placement.js";
|
|
12
12
|
import { relocateTicketProgressForLeg } from "../ticket-progress.js";
|
|
13
|
-
import { packagedAdmittedSubject, packagedArgvResult, packagedBareToken, packagedBaseIsRevision, packagedEmitsAuthorityRefs,
|
|
13
|
+
import { packagedAdmittedSubject, packagedArgvResult, packagedBareToken, packagedBaseIsRevision, packagedEmitsAuthorityRefs, packagedRoleMetadata, packagedStoresSourceRunRaw, packagedSubjectChoices, } from "../packaged-role-registry.js";
|
|
14
14
|
import { isSafePositiveTicketNumber, parseTicketNumber, readBoardTicketNumber, requireSafePositiveTicketNumber, } from "../run-ticket-number.js";
|
|
15
15
|
import { rewriteAdmittedRoleRunPage, } from "../role-run-relocation.js";
|
|
16
16
|
import { readPageSync, renderCurrentSync, updateSectionSync, writeSectionSync } from "../run-dossier.js";
|
|
@@ -26,6 +26,7 @@ import {} from "../notary-contracts.js";
|
|
|
26
26
|
import { NotarySourceRunError, resolveNotarySourceRunLocator, } from "../notary-source-run.js";
|
|
27
27
|
import { CliUsageError } from "./cli-errors.js";
|
|
28
28
|
import { REJECTED_PUBLIC_SPELLINGS, createTypedOptionConsumer, evaluateAnalystModeOptionContract, optionsForOwner, resolveAnalystMode, } from "./option-definitions.js";
|
|
29
|
+
import { PUBLIC_CALLABLE_ROLES } from "./registry.js";
|
|
29
30
|
import { errorText, isRecord } from "../unknown-value.js";
|
|
30
31
|
/** Nonblank admitted source path, preserving its original bytes. */
|
|
31
32
|
export function admittedSourceRunPath(admitted) {
|
|
@@ -490,6 +491,15 @@ function assignPublicSeatOption(owner, taken, fields) {
|
|
|
490
491
|
fields.subject = subject;
|
|
491
492
|
return;
|
|
492
493
|
}
|
|
494
|
+
case "role": {
|
|
495
|
+
const raw = typeof value === "string" ? value.trim() : "";
|
|
496
|
+
const known = PUBLIC_CALLABLE_ROLES.find((role) => role === raw);
|
|
497
|
+
if (known === undefined) {
|
|
498
|
+
throw new CliUsageError(`${owner} --role must be one of ${PUBLIC_CALLABLE_ROLES.join("|")}, got ${value ?? "(missing)"}`);
|
|
499
|
+
}
|
|
500
|
+
fields.forRole = known;
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
493
503
|
case "source-run": {
|
|
494
504
|
const text = typeof value === "string" ? value : "";
|
|
495
505
|
if (text.trim() === "") {
|
|
@@ -623,6 +633,7 @@ export function parsePublicSeatArgv(owner, args) {
|
|
|
623
633
|
...(fields.lens === undefined ? {} : { lens: fields.lens }),
|
|
624
634
|
...(packagedEmitsAuthorityRefs(owner) ? { authorityRefs: fields.authorityRefs } : {}),
|
|
625
635
|
...(fields.subject === undefined ? {} : { subject: fields.subject }),
|
|
636
|
+
...(fields.forRole === undefined ? {} : { forRole: fields.forRole }),
|
|
626
637
|
};
|
|
627
638
|
}
|
|
628
639
|
/** Reject missing/blank path values so empty overrides cannot silently degrade. */
|
|
@@ -780,6 +791,7 @@ export async function admitPublicRole(role, parsed, env, override) {
|
|
|
780
791
|
instruction,
|
|
781
792
|
attachmentPaths,
|
|
782
793
|
...project,
|
|
794
|
+
...(parsed.forRole === undefined ? {} : { admittedFields: { forRole: parsed.forRole } }),
|
|
783
795
|
});
|
|
784
796
|
case "court-materials":
|
|
785
797
|
return admitStandardMaterialInvocation("countersign", {
|
|
@@ -1249,31 +1261,6 @@ export async function materializeCountersignInvocation(admitted, options) {
|
|
|
1249
1261
|
});
|
|
1250
1262
|
await writeRoleInvocationLedger({ ...admitted, sessionDirectory: placement.sessionDirectory, sessionFile: placement.sessionFile }, admitted.role, options.model);
|
|
1251
1263
|
}
|
|
1252
|
-
/**
|
|
1253
|
-
* Load the admitted section written at admission (Navigator work-context seam).
|
|
1254
|
-
* Missing / wrong-shape → undefined. Control-plane read faults propagate (#1187 F2).
|
|
1255
|
-
*/
|
|
1256
|
-
export async function loadAdmittedJudgeRequest(runDirectory) {
|
|
1257
|
-
const record = readPageSync(runDirectory, "admitted");
|
|
1258
|
-
if (record === undefined)
|
|
1259
|
-
return undefined;
|
|
1260
|
-
if (!packagedPublicInstructionSubject(record.role))
|
|
1261
|
-
return undefined;
|
|
1262
|
-
if (typeof record.instruction !== "string")
|
|
1263
|
-
return undefined;
|
|
1264
|
-
if (typeof record.instructionEmpty !== "boolean")
|
|
1265
|
-
return undefined;
|
|
1266
|
-
if (!Array.isArray(record.attachments))
|
|
1267
|
-
return undefined;
|
|
1268
|
-
const attachments = record.attachments
|
|
1269
|
-
.map((item) => normalizeAdmittedAttachment(item))
|
|
1270
|
-
.filter((item) => item !== undefined);
|
|
1271
|
-
return {
|
|
1272
|
-
instruction: record.instruction,
|
|
1273
|
-
instructionEmpty: record.instructionEmpty,
|
|
1274
|
-
attachments,
|
|
1275
|
-
};
|
|
1276
|
-
}
|
|
1277
1264
|
function parsePositivePrOption(raw) {
|
|
1278
1265
|
if (raw === undefined || raw.trim() === "")
|
|
1279
1266
|
throw new CliUsageError("--pr requires a positive pull request number");
|