@akagilnc/pi-workflow-roles 0.1.5079 → 0.1.5122
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 +545 -334
- package/dist/atomic-write.js +13 -19
- package/dist/auditor-soul.js +2 -1
- package/dist/doctor-contracts.js +1 -1
- package/dist/gatekeeper-role.js +2 -16
- package/dist/headless-host/production-host.js +577 -366
- package/dist/merger-contracts.js +1 -1
- package/dist/migrate-book-topology.js +18 -14
- 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/package-contracts/fixer-output.js +1 -1
- package/dist/package-contracts/gatekeeper-output.js +1 -1
- package/dist/package-contracts/navigator-output.js +1 -1
- package/dist/package-contracts/terminating-infrastructure.js +3 -3
- package/dist/packaged-role-registry.js +9 -5
- package/dist/public-cli/cli.js +24 -1
- package/dist/public-cli/countersign-run.js +1 -1
- package/dist/public-cli/instruction-seat-run.js +8 -6
- package/dist/public-cli/invocation.js +6 -3
- package/dist/public-cli/main.js +6711 -6523
- package/dist/public-cli/post-admission.js +125 -26
- package/dist/public-cli/settlement.js +48 -5
- package/dist/receipt-delivery-policy.js +9 -2
- package/dist/review-submission.js +3 -3
- 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/diarist-role.ts +2 -2
- package/src/doctor-contracts.ts +1 -1
- package/src/gatekeeper-role.ts +1 -18
- package/src/gleaner-left-role.ts +2 -2
- package/src/inspector-role.ts +1 -1
- package/src/judge-role.ts +1 -1
- 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/package-contracts/fixer-output.ts +1 -1
- package/src/package-contracts/gatekeeper-output.ts +3 -3
- package/src/package-contracts/navigator-output.ts +1 -1
- package/src/package-contracts/terminating-infrastructure.ts +3 -6
- package/src/packaged-role-registry.ts +5 -1
- package/src/public-cli/cli-io.ts +2 -0
- package/src/public-cli/cli.ts +38 -4
- package/src/public-cli/countersign-run.ts +1 -1
- package/src/public-cli/instruction-seat-run.ts +10 -6
- package/src/public-cli/invocation.ts +12 -4
- package/src/public-cli/post-admission.ts +189 -34
- package/src/public-cli/settlement.ts +58 -4
- package/src/receipt-delivery-policy.ts +9 -1
- package/src/review-submission.ts +3 -3
- package/src/reviewer-role.ts +3 -3
- package/src/role-runtime-dependencies.ts +1 -5
- package/src/role-runtime.ts +52 -38
- package/src/secretariat-role.ts +3 -3
- package/src/worker-role.ts +3 -3
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,
|
|
@@ -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"
|
|
@@ -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,7 +25,7 @@ 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]
|
|
@@ -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",
|
package/dist/public-cli/cli.js
CHANGED
|
@@ -13,10 +13,12 @@ import { packagedModelParent } from "../packaged-role-registry.js";
|
|
|
13
13
|
import { seatModelOnly } from "./registry.js";
|
|
14
14
|
import { CliUsageError } from "./cli-errors.js";
|
|
15
15
|
import { runMachineSkillSetup } from "./machine-method-skills.js";
|
|
16
|
+
import { presentLocatedResumeFailure, } from "./post-admission.js";
|
|
16
17
|
import { appendPiSessionCustomEntry } from "../pi/role-turn-host.js";
|
|
17
18
|
import { composeRoleTurnHostAdapters, formatHostSelectionFailure, HostSelectionError, selectRoleTurnHost, } from "./role-turn-host-resolution.js";
|
|
18
19
|
import { parseAnalystArgv, parsePublicSeatArgv, } from "./invocation.js";
|
|
19
20
|
import { createTypedOptionConsumer, optionsForOwner, projectCommandHelp, projectOwnerOptions, PUBLIC_NAVIGATOR_HELP_NOTE, PUBLIC_ROLE_OPTION_OWNERS, renderHumanOwnerOptionLines, } from "./option-definitions.js";
|
|
21
|
+
import { TurnDispatchedFailure } from "./auto-resume.js";
|
|
20
22
|
import { continueParentAfterChild, runPublicInstructionSeat, runPublicInstructionSeatResume } from "./instruction-seat-run.js";
|
|
21
23
|
import { courtDiaristEscalated } from "./countersign-run.js";
|
|
22
24
|
import { runPublicAnalyst } from "./analyst-run.js";
|
|
@@ -727,6 +729,7 @@ export function commandNeedsProcessCancel(argv) {
|
|
|
727
729
|
}
|
|
728
730
|
export async function runAkRole(argv, env) {
|
|
729
731
|
const io = env.io ?? defaultIo();
|
|
732
|
+
let resumeFailureContext;
|
|
730
733
|
try {
|
|
731
734
|
// Select the installed package identity once, before any role-owned Skill,
|
|
732
735
|
// runtime entry, activation argv, or invocation provenance is derived.
|
|
@@ -820,11 +823,16 @@ export async function runAkRole(argv, env) {
|
|
|
820
823
|
// must still exist. Seat and dispatch follow the durable admitted role.
|
|
821
824
|
// #471: unique parser owns {runId, message?}; five role paths only consume it.
|
|
822
825
|
if (parsed.command === "resume") {
|
|
826
|
+
const resumeRequest = parseResumeRequest(parsed.args);
|
|
827
|
+
resumeFailureContext = {
|
|
828
|
+
home,
|
|
829
|
+
runId: resumeRequest.runId,
|
|
830
|
+
authority: env.principalAuthority ?? piDurablePrincipalAuthority,
|
|
831
|
+
};
|
|
823
832
|
const agentDir = resolveAgentDir(env, home);
|
|
824
833
|
const cwd = env.cwd ?? process.cwd();
|
|
825
834
|
const config = await loadAndValidateConfig(home, env.packageRoot);
|
|
826
835
|
const credentials = env.credentials ?? (await loadCredentialProviders(agentDir));
|
|
827
|
-
const resumeRequest = parseResumeRequest(parsed.args);
|
|
828
836
|
const resumeRole = await peekRoleRunRole(home, resumeRequest.runId);
|
|
829
837
|
// Missing durable role keeps the judge seat table. The resume entry
|
|
830
838
|
// itself is one function; it reads the stored run.
|
|
@@ -844,6 +852,11 @@ export async function runAkRole(argv, env) {
|
|
|
844
852
|
&& current.terminal?.roleOutcome.kind === "accepted"
|
|
845
853
|
&& !courtDiaristEscalated(current.terminal.roleOutcome)) {
|
|
846
854
|
const parentRunId = current.admitted.correlationId;
|
|
855
|
+
resumeFailureContext = {
|
|
856
|
+
home,
|
|
857
|
+
runId: parentRunId,
|
|
858
|
+
authority: env.principalAuthority ?? piDurablePrincipalAuthority,
|
|
859
|
+
};
|
|
847
860
|
const parentRole = await peekRoleRunRole(home, parentRunId);
|
|
848
861
|
if (parentRole === undefined)
|
|
849
862
|
break;
|
|
@@ -875,6 +888,16 @@ export async function runAkRole(argv, env) {
|
|
|
875
888
|
throw new CliUsageError(`unknown command: ${parsed.command}`);
|
|
876
889
|
}
|
|
877
890
|
catch (error) {
|
|
891
|
+
// A dispatched turn owns its settlement; only pre-dispatch resume failures
|
|
892
|
+
// fall through to the located-run diagnostic presenter here.
|
|
893
|
+
if (resumeFailureContext !== undefined
|
|
894
|
+
&& !(error instanceof TurnDispatchedFailure)
|
|
895
|
+
&& await presentLocatedResumeFailure(resumeFailureContext.home, resumeFailureContext.runId, resumeFailureContext.authority, io, error)) {
|
|
896
|
+
return {
|
|
897
|
+
exitCode: error instanceof CliUsageError ? 2 : 1,
|
|
898
|
+
...(error instanceof HostSelectionError ? { hostFailure: error.failure } : {}),
|
|
899
|
+
};
|
|
900
|
+
}
|
|
878
901
|
if (error instanceof HostSelectionError) {
|
|
879
902
|
io.stderr(formatCliDiagnostic(formatHostSelectionFailure(error.failure)));
|
|
880
903
|
return { exitCode: 1, hostFailure: error.failure };
|
|
@@ -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,
|
|
@@ -12,7 +12,7 @@ import { packagedAdmitsCountersign, packagedBindsBoardTicket, packagedRebindSour
|
|
|
12
12
|
import { isAuditorSoulRole } from "../auditor-soul.js";
|
|
13
13
|
import { CliUsageError } from "./cli-errors.js";
|
|
14
14
|
import { admitPublicRole, bindAdmittedTicketNumber, bindCourtTicketNumbersOnAdmitted, buildInstructionTransportPrompt, materializeCountersignInvocation, persistAdmittedSourceRunPath, recordAdmittedCorrelation, recordChildDiaristRun, relocateAdmittedRunToTicket, withPreparedAttachments, } from "./invocation.js";
|
|
15
|
-
import { presentControlledFailure, prepareSummonsResumeMaterials, roleTurnOptions, runPostAdmissionOneShot, runPostAdmissionResumable, runPostAdmissionSeatResume, resumeTurnRequestProjectionOptions, } from "./post-admission.js";
|
|
15
|
+
import { presentControlledFailure, prepareSummonsResumeMaterials, roleTurnOptions, runPostAdmissionOneShot, runPostAdmissionResumable, runPostAdmissionSeatResume, showResumeErrorPointer, resumeTurnRequestProjectionOptions, } from "./post-admission.js";
|
|
16
16
|
import { buildAutoResumeContinuationPrompt, loadResumablePublicRole, markRunAdmitted, parentRunPathFromGatePointerInstruction, } from "./run-lifecycle.js";
|
|
17
17
|
import { tryResumeSameTicketSeatRun } from "./seat-ticket-binding.js";
|
|
18
18
|
import { presentStructuralRejection, seatKnownFailureResolver, trySettlePublicSeat, } from "./settlement.js";
|
|
@@ -52,11 +52,11 @@ function isBoardTicketSeat(seat) {
|
|
|
52
52
|
async function bindAndRelocateDiarist(admitted, authority, lease) {
|
|
53
53
|
const boardTicket = await readBoardTicketNumber(admitted.runDirectory);
|
|
54
54
|
if (boardTicket === undefined)
|
|
55
|
-
return;
|
|
55
|
+
return undefined;
|
|
56
56
|
if (admitted.ticketNumber === undefined) {
|
|
57
57
|
await bindAdmittedTicketNumber(admitted, boardTicket);
|
|
58
58
|
}
|
|
59
|
-
await relocateAdmittedRunToTicket(admitted, authority, lease);
|
|
59
|
+
return await relocateAdmittedRunToTicket(admitted, authority, lease);
|
|
60
60
|
}
|
|
61
61
|
function seatAdapters(admitted, env) {
|
|
62
62
|
const record = roleRecord(admitted.role);
|
|
@@ -80,8 +80,8 @@ function seatAdapters(admitted, env) {
|
|
|
80
80
|
},
|
|
81
81
|
afterDispatch: async (seat, lease) => {
|
|
82
82
|
if (!isBoardTicketSeat(seat))
|
|
83
|
-
return;
|
|
84
|
-
await bindAndRelocateDiarist(seat, env.principalAuthority, lease);
|
|
83
|
+
return undefined;
|
|
84
|
+
return await bindAndRelocateDiarist(seat, env.principalAuthority, lease);
|
|
85
85
|
},
|
|
86
86
|
}
|
|
87
87
|
: {}),
|
|
@@ -655,5 +655,7 @@ export async function continueParentAfterChild(parentRunId, child, env, io) {
|
|
|
655
655
|
return { exitCode: 0, admitted, terminal: refresh.terminal };
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
|
|
658
|
+
const result = await dispatchAdmitted(admitted, env, { ...io, omitFailureStderrDiagnostic: true });
|
|
659
|
+
showResumeErrorPointer(io, result.exitCode, result.terminal);
|
|
660
|
+
return result;
|
|
659
661
|
}
|
|
@@ -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
|
}
|