@akagilnc/pi-workflow-roles 0.1.3932 → 0.1.3975
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/CLAUDE.md +1 -1
- package/dist/acp-host/production-host.js +2389 -6018
- package/dist/analyst-gate-cycles-read.js +15 -19
- package/dist/audit-escalation.js +16 -46
- package/dist/auditor-dossier-tool.js +7 -62
- package/dist/collector-identity.js +0 -157
- package/dist/collector-ledger.js +2 -42
- package/dist/compliance-transport.js +40 -14
- package/dist/diarist-contracts.js +2 -40
- package/dist/doctor-contracts.js +39 -108
- package/dist/doctor-evidence.js +1 -5
- package/dist/engine-detour-tool.js +1 -1
- package/dist/gatekeeper-role.js +49 -38
- package/dist/headless-host/production-host.js +4814 -8450
- package/dist/host-contracts.js +0 -5
- package/dist/merger-contracts.js +4 -6
- package/dist/navigator-attendance.js +30 -52
- package/dist/navigator-invocation-identity.js +0 -1
- package/dist/navigator-public-session.js +2 -1
- package/dist/notary-contracts.js +4 -10
- package/dist/package-contracts/auditor-output.js +5 -23
- package/dist/package-contracts/fixer-output.js +25 -49
- package/dist/package-contracts/gatekeeper-output.js +3 -13
- package/dist/package-contracts/navigator-output.js +4 -7
- package/dist/package-contracts/reviewer-output.js +1 -95
- package/dist/package-contracts/terminating-tools.js +33 -144
- package/dist/package-contracts/worker-output.js +1 -3
- package/dist/public-cli/auto-resume.js +30 -68
- package/dist/public-cli/case-dossier-delivery.js +5 -17
- package/dist/public-cli/diarist-run.js +9 -4
- package/dist/public-cli/inspector-run.js +2 -8
- package/dist/public-cli/instruction-seat-run.js +3 -7
- package/dist/public-cli/invocation.js +5 -2
- package/dist/public-cli/main.js +6068 -6964
- package/dist/public-cli/notary-run.js +1 -8
- package/dist/public-cli/post-admission.js +314 -113
- package/dist/public-cli/run-lifecycle.js +14 -38
- package/dist/public-cli/settlement.js +209 -390
- package/dist/public-cli/terminal.js +51 -45
- package/dist/public-role-summons.js +1 -12
- package/dist/reviewer-dispatch.js +12 -258
- package/dist/submission-correctable-error.js +0 -12
- package/dist/submission-errors.js +6 -1
- package/dist/submission-ledger.js +125 -168
- package/dist/ticket-provenance-contracts.js +2 -49
- package/dist/ticket-provenance.js +82 -31
- package/extensions/role-runtime.ts +1 -6
- package/package.json +1 -1
- package/resources/836-deleted-machine-instruction-inventory.md +18 -0
- package/src/acp-host/role-turn-host.ts +8 -3
- package/src/analyst-gate-cycles-read.ts +17 -29
- package/src/audit-escalation.ts +20 -50
- package/src/auditor-dossier-tool.ts +5 -103
- package/src/canonical-skill-binding.ts +3 -2
- package/src/collector-identity.ts +0 -179
- package/src/collector-ledger.ts +3 -46
- package/src/collector-role.ts +32 -61
- package/src/collector-tool-schemas.ts +20 -14
- package/src/compliance-transport.ts +55 -17
- package/src/countersign-role.ts +17 -8
- package/src/diarist-contracts.ts +3 -36
- package/src/diarist-role.ts +13 -7
- package/src/diarist.ts +4 -16
- package/src/doctor-contracts.ts +73 -94
- package/src/doctor-evidence.ts +1 -1
- package/src/doctor-role.ts +3 -3
- package/src/engine-detour-tool.ts +4 -1
- package/src/external-host-turn-loop.ts +9 -3
- package/src/gatekeeper-pass-envelope.ts +7 -12
- package/src/gatekeeper-role.ts +56 -50
- package/src/gleaner-left-role.ts +4 -2
- package/src/headless-host/role-turn-host.ts +4 -5
- package/src/host-contracts.ts +3 -8
- package/src/judge-role.ts +19 -13
- package/src/merger-contracts.ts +10 -6
- package/src/merger-role.ts +1 -5
- package/src/navigator-attendance.ts +37 -74
- package/src/navigator-invocation-identity.ts +0 -6
- package/src/navigator-public-session.ts +2 -1
- package/src/notary-contracts.ts +7 -10
- package/src/package-contracts/auditor-output.ts +4 -21
- package/src/package-contracts/fixer-output.ts +34 -52
- package/src/package-contracts/gatekeeper-output.ts +5 -22
- package/src/package-contracts/navigator-output.ts +7 -7
- package/src/package-contracts/reviewer-output.ts +2 -150
- package/src/package-contracts/terminating-tools.ts +32 -147
- package/src/package-contracts/worker-output.ts +0 -1
- package/src/pi/adapter.ts +3 -8
- package/src/public-cli/auto-resume.ts +41 -94
- package/src/public-cli/case-dossier-delivery.ts +5 -15
- package/src/public-cli/countersign-run.ts +14 -6
- package/src/public-cli/diarist-run.ts +11 -9
- package/src/public-cli/inspector-run.ts +2 -18
- package/src/public-cli/instruction-seat-run.ts +3 -17
- package/src/public-cli/invocation.ts +5 -2
- package/src/public-cli/merger-run.ts +1 -1
- package/src/public-cli/notary-run.ts +1 -18
- package/src/public-cli/post-admission.ts +385 -115
- package/src/public-cli/run-lifecycle.ts +13 -44
- package/src/public-cli/settlement.ts +314 -562
- package/src/public-cli/terminal.ts +66 -72
- package/src/public-role-summons.ts +5 -30
- package/src/reviewer-dispatch.ts +29 -331
- package/src/reviewer-role.ts +16 -83
- package/src/role-envelope.ts +16 -24
- package/src/role-runtime-dependencies.ts +1 -6
- package/src/role-runtime.ts +65 -201
- package/src/submission-correctable-error.ts +0 -14
- package/src/submission-errors.ts +6 -1
- package/src/submission-ledger.ts +187 -187
- package/src/ticket-provenance-contracts.ts +4 -60
- package/src/ticket-provenance.ts +98 -32
- package/src/worker-role.ts +35 -36
- package/dist/activation-ledger-session.js +0 -105
- package/dist/activation-ledger.js +0 -139
- package/dist/activation-trace.js +0 -33
- package/dist/atomic-write.js +0 -23
- package/dist/auditor-role.js +0 -12
- package/dist/canonical-skill-binding.js +0 -61
- package/dist/collector-handbook.js +0 -142
- package/dist/collector-receipt.js +0 -107
- package/dist/collector-role.js +0 -566
- package/dist/collector-tool-schemas.js +0 -107
- package/dist/countersign-role.js +0 -28
- package/dist/diarist-role.js +0 -44
- package/dist/diarist.js +0 -66
- package/dist/doctor-role.js +0 -75
- package/dist/fixer-bash-seatbelt.js +0 -13
- package/dist/gatekeeper-pass-envelope.js +0 -77
- package/dist/gleaner-left-role.js +0 -26
- package/dist/inspector-role.js +0 -29
- package/dist/judge-role.js +0 -104
- package/dist/merger-role.js +0 -55
- package/dist/navigator-role.js +0 -12
- package/dist/notary-role.js +0 -134
- package/dist/oauth-keepalive.js +0 -158
- package/dist/pi/adapter.js +0 -223
- package/dist/reviewer-agent.js +0 -122
- package/dist/reviewer-child-executor.js +0 -194
- package/dist/reviewer-construction.js +0 -103
- package/dist/reviewer-execution-ledger.js +0 -166
- package/dist/reviewer-failure-diagnostic.js +0 -17
- package/dist/reviewer-role.js +0 -159
- package/dist/reviewer-scope-prompt.js +0 -21
- package/dist/reviewer-settlement.js +0 -66
- package/dist/reviewer-workspace.js +0 -132
- package/dist/role-runtime.js +0 -1604
- package/dist/stderr-jsonl.js +0 -26
- package/dist/tool-execution-observation.js +0 -141
- package/dist/worker-role.js +0 -345
- package/dist/worker-submission-gates.js +0 -305
- package/src/collector-receipt.ts +0 -140
- package/src/diagnostic-tail.ts +0 -18
- package/src/reviewer-agent.ts +0 -135
- package/src/reviewer-child-executor.ts +0 -252
- package/src/reviewer-construction.ts +0 -195
- package/src/reviewer-execution-ledger.ts +0 -212
- package/src/reviewer-failure-diagnostic.ts +0 -18
- package/src/reviewer-scope-prompt.ts +0 -24
- package/src/reviewer-settlement.ts +0 -74
- package/src/reviewer-workspace.ts +0 -105
- package/src/shape-unreadable-failure.ts +0 -49
|
@@ -44,18 +44,6 @@ export type TerminalRoleName =
|
|
|
44
44
|
| "auditor"
|
|
45
45
|
| "diarist";
|
|
46
46
|
|
|
47
|
-
/** Merger/Collector residual only — Notary/audit residual abolished (#475). */
|
|
48
|
-
export type ResidualIncompleteTerminalOutcome = {
|
|
49
|
-
kind: "incomplete";
|
|
50
|
-
role: "merger" | "collector";
|
|
51
|
-
status: "incomplete";
|
|
52
|
-
decision: "no-usable-result";
|
|
53
|
-
candidate: unknown;
|
|
54
|
-
diagnostic: string;
|
|
55
|
-
acceptedReceipt: false;
|
|
56
|
-
decisiveFacts: Readonly<Record<string, unknown>>;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
47
|
export type NoReceiptTerminalOutcome = NoReceiptLifecycleFacts & {
|
|
60
48
|
kind: "no_receipt";
|
|
61
49
|
role: TerminalRoleName;
|
|
@@ -67,17 +55,20 @@ export type TerminalRoleOutcome =
|
|
|
67
55
|
| {
|
|
68
56
|
kind: "accepted";
|
|
69
57
|
role: TerminalRoleName;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
/** Original role payloads in ledger order — this is the role-result block (#836 / ADR 0052). */
|
|
59
|
+
payloads?: readonly unknown[];
|
|
60
|
+
/** Fixture/compat leaf only — settlement does not write a selected status. */
|
|
61
|
+
status?: string;
|
|
62
|
+
decisiveFacts?: Readonly<Record<string, unknown>>;
|
|
73
63
|
}
|
|
74
64
|
| {
|
|
75
65
|
kind: "audit_escalation";
|
|
76
66
|
role: TerminalRoleName;
|
|
77
67
|
status: "audit_escalation";
|
|
78
|
-
|
|
68
|
+
/** Original role payloads in ledger order (#836). */
|
|
69
|
+
payloads?: readonly unknown[];
|
|
70
|
+
decisiveFacts?: Readonly<Record<string, unknown>>;
|
|
79
71
|
}
|
|
80
|
-
| ResidualIncompleteTerminalOutcome
|
|
81
72
|
| NoReceiptTerminalOutcome
|
|
82
73
|
| {
|
|
83
74
|
kind: "failure";
|
|
@@ -87,6 +78,8 @@ export type TerminalRoleOutcome =
|
|
|
87
78
|
/** Original diagnostic identity retained for the caller. */
|
|
88
79
|
diagnostic: string;
|
|
89
80
|
decisiveFacts: Readonly<Record<string, unknown>>;
|
|
81
|
+
/** Already-recorded original payloads, coexist with host failure (#836 A3). */
|
|
82
|
+
payloads?: readonly unknown[];
|
|
90
83
|
};
|
|
91
84
|
|
|
92
85
|
/** Lawful typed terminal results exit zero (including audit_escalation). */
|
|
@@ -102,28 +95,6 @@ export function exitCodeForTerminalOutcome(
|
|
|
102
95
|
return isLawfulTypedTerminalOutcome(outcome) ? 0 : 1;
|
|
103
96
|
}
|
|
104
97
|
|
|
105
|
-
export function buildResidualIncompleteTerminalOutcome(input: {
|
|
106
|
-
role: "merger" | "collector";
|
|
107
|
-
candidate: unknown;
|
|
108
|
-
diagnostic: string;
|
|
109
|
-
}): ResidualIncompleteTerminalOutcome {
|
|
110
|
-
return {
|
|
111
|
-
kind: "incomplete",
|
|
112
|
-
role: input.role,
|
|
113
|
-
status: "incomplete",
|
|
114
|
-
decision: "no-usable-result",
|
|
115
|
-
candidate: input.candidate,
|
|
116
|
-
diagnostic: input.diagnostic,
|
|
117
|
-
acceptedReceipt: false,
|
|
118
|
-
decisiveFacts: {
|
|
119
|
-
decision: "no-usable-result",
|
|
120
|
-
candidate: input.candidate,
|
|
121
|
-
diagnostic: input.diagnostic,
|
|
122
|
-
acceptedReceipt: false,
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
98
|
export type TerminalNavigatorFact =
|
|
128
99
|
| {
|
|
129
100
|
disposition: "recommendation";
|
|
@@ -168,7 +139,7 @@ export type TerminalGateDispatch =
|
|
|
168
139
|
export type TerminalGateOfficerReport = {
|
|
169
140
|
readonly seat: "inspector" | "notary";
|
|
170
141
|
readonly status: string;
|
|
171
|
-
readonly findings: readonly
|
|
142
|
+
readonly findings: readonly unknown[];
|
|
172
143
|
};
|
|
173
144
|
|
|
174
145
|
/** One direct or historical paired gate round on the public Terminal. */
|
|
@@ -189,19 +160,6 @@ export type TerminalGateFact = {
|
|
|
189
160
|
readonly rounds: readonly TerminalGateRound[];
|
|
190
161
|
};
|
|
191
162
|
|
|
192
|
-
/** Public free-text stand-in when an exact Role run ID is stripped outside resume.command. */
|
|
193
|
-
export const REDACTED_RUN_ID_TOKEN = "[run-id]" as const;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Remove an exact Role run ID from untrusted free text at the public Terminal boundary.
|
|
197
|
-
* Private durable artifacts keep the original bytes; only resume.command may disclose it.
|
|
198
|
-
*/
|
|
199
|
-
export function redactExactRunId(text: string, runId: string): string {
|
|
200
|
-
if (runId.length === 0) return text;
|
|
201
|
-
if (!text.includes(runId)) return text;
|
|
202
|
-
return text.split(runId).join(REDACTED_RUN_ID_TOKEN);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
163
|
/**
|
|
206
164
|
* One admitted Role run's typed Terminal aggregate.
|
|
207
165
|
* Resumable failures carry `resume` and must not re-disclose the run ID via
|
|
@@ -210,10 +168,35 @@ export function redactExactRunId(text: string, runId: string): string {
|
|
|
210
168
|
* auto-resumes occurred during this single LLM call; it is not persisted to
|
|
211
169
|
* run-state.json and does not participate in limit decisions.
|
|
212
170
|
*/
|
|
171
|
+
/** Original payloads on a terminal — role result for accepted/audit; coexist on failure. */
|
|
172
|
+
export function roleResultPayloads(outcome: TerminalRoleOutcome): readonly unknown[] {
|
|
173
|
+
if (outcome.kind === "accepted" || outcome.kind === "audit_escalation") return outcome.payloads ?? [];
|
|
174
|
+
if (outcome.kind === "failure") return outcome.payloads ?? [];
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Last object payload the role actually wrote. No field remapping. */
|
|
179
|
+
export function lastRolePayloadRecord(
|
|
180
|
+
payloads: readonly unknown[],
|
|
181
|
+
): Record<string, unknown> | undefined {
|
|
182
|
+
for (let index = payloads.length - 1; index >= 0; index -= 1) {
|
|
183
|
+
const payload = payloads[index];
|
|
184
|
+
if (typeof payload === "object" && payload !== null && !Array.isArray(payload)) {
|
|
185
|
+
return payload as Record<string, unknown>;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
|
|
213
191
|
export type TerminalResult = {
|
|
214
192
|
roleOutcome: TerminalRoleOutcome;
|
|
215
193
|
navigator: TerminalNavigatorFact;
|
|
216
194
|
artifacts: readonly TerminalArtifactRef[];
|
|
195
|
+
/**
|
|
196
|
+
* Mirror of recorded original payloads (same bytes as roleOutcome.payloads).
|
|
197
|
+
* Kept so officer/compliance readers share one array with the role-result block.
|
|
198
|
+
*/
|
|
199
|
+
submissions?: readonly unknown[];
|
|
217
200
|
/**
|
|
218
201
|
* Optional gate facts (#478). Present when accepted direct or historical
|
|
219
202
|
* paired rounds exist under session/auditor-roles; omitted on no-gate runs.
|
|
@@ -234,26 +217,22 @@ export type TerminalResult = {
|
|
|
234
217
|
);
|
|
235
218
|
|
|
236
219
|
/**
|
|
237
|
-
* Build a recommendation navigator fact.
|
|
238
|
-
*
|
|
220
|
+
* Build a recommendation navigator fact. Model command is kept when present;
|
|
221
|
+
* registry render is fallback only. Unknown seats stay recommendations (#836 B4.1).
|
|
239
222
|
*/
|
|
240
223
|
export function recommendationNavigatorFact(input: {
|
|
241
224
|
next: { role: string; phase: NavigatorPhase };
|
|
242
225
|
reason: string;
|
|
243
226
|
route?: ReadonlyArray<{ role: string; phase: NavigatorPhase }>;
|
|
244
227
|
advisoryDiagnostic?: string;
|
|
245
|
-
/** Ignored — retained only so callers can pass through raw attendance without using it. */
|
|
246
228
|
modelCommand?: string;
|
|
247
229
|
}): TerminalNavigatorFact {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
const command = renderPublicAkRoleCommand(input.next);
|
|
230
|
+
const command =
|
|
231
|
+
typeof input.modelCommand === "string" && input.modelCommand.trim() !== ""
|
|
232
|
+
? input.modelCommand
|
|
233
|
+
: isPublicCallableRole(input.next.role)
|
|
234
|
+
? renderPublicAkRoleCommand(input.next)
|
|
235
|
+
: undefined;
|
|
257
236
|
return {
|
|
258
237
|
disposition: "recommendation",
|
|
259
238
|
next: input.next,
|
|
@@ -275,7 +254,9 @@ export function formatTerminalResult(result: TerminalResult): string {
|
|
|
275
254
|
const outcomeStatus =
|
|
276
255
|
result.roleOutcome.kind === "failure"
|
|
277
256
|
? result.roleOutcome.cause
|
|
278
|
-
: result.roleOutcome.
|
|
257
|
+
: result.roleOutcome.kind === "accepted"
|
|
258
|
+
? "accepted"
|
|
259
|
+
: result.roleOutcome.status;
|
|
279
260
|
lines.push(
|
|
280
261
|
`${result.roleOutcome.role}\t${result.roleOutcome.kind}\t${encodeTerminalField(outcomeStatus)}`,
|
|
281
262
|
);
|
|
@@ -284,12 +265,14 @@ export function formatTerminalResult(result: TerminalResult): string {
|
|
|
284
265
|
`diagnostic\t${encodeTerminalField(result.roleOutcome.diagnostic)}`,
|
|
285
266
|
);
|
|
286
267
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
268
|
+
if (result.roleOutcome.kind === "failure" || result.roleOutcome.kind === "no_receipt") {
|
|
269
|
+
const facts = result.roleOutcome.decisiveFacts;
|
|
270
|
+
for (const [key, value] of Object.entries(facts)) {
|
|
271
|
+
if (value === undefined) continue;
|
|
272
|
+
const rendered =
|
|
273
|
+
typeof value === "string" ? value : JSON.stringify(value);
|
|
274
|
+
lines.push(`fact\t${encodeTerminalField(key)}\t${encodeTerminalField(rendered)}`);
|
|
275
|
+
}
|
|
293
276
|
}
|
|
294
277
|
lines.push(`navigator\t${result.navigator.disposition}`);
|
|
295
278
|
if (result.navigator.advisoryDiagnostic !== undefined) {
|
|
@@ -337,5 +320,16 @@ export function formatTerminalResult(result: TerminalResult): string {
|
|
|
337
320
|
if (result.autoResumeCount !== undefined) {
|
|
338
321
|
lines.push(`autoResumeCount\t${encodeTerminalField(String(result.autoResumeCount))}`);
|
|
339
322
|
}
|
|
323
|
+
// Role-result block: original payloads in ledger order (#836 / ADR 0052).
|
|
324
|
+
const payloads =
|
|
325
|
+
result.roleOutcome.kind === "accepted" || result.roleOutcome.kind === "audit_escalation"
|
|
326
|
+
? result.roleOutcome.payloads ?? result.submissions ?? []
|
|
327
|
+
: result.roleOutcome.kind === "failure"
|
|
328
|
+
? result.roleOutcome.payloads ?? result.submissions ?? []
|
|
329
|
+
: result.submissions ?? [];
|
|
330
|
+
for (const payload of payloads) {
|
|
331
|
+
const rendered = typeof payload === "string" ? payload : JSON.stringify(payload);
|
|
332
|
+
lines.push(`submission\t${encodeTerminalField(rendered)}`);
|
|
333
|
+
}
|
|
340
334
|
return `${lines.join("\n")}\n`;
|
|
341
335
|
}
|
|
@@ -61,12 +61,6 @@ export type PublicSummonRequest = {
|
|
|
61
61
|
* summons.instruction. Never folded into argv / parent-run lookup keys.
|
|
62
62
|
*/
|
|
63
63
|
readonly reviewReask?: string;
|
|
64
|
-
/**
|
|
65
|
-
* #786 same-parent re-summons: verbatim parent-submission body for the gate officer.
|
|
66
|
-
* Rides summons.instruction when reviewReask is absent. Fresh mint ignores it.
|
|
67
|
-
* Never folded into argv / parent-run lookup keys (ADR 0079 卷宗指针 stays pure).
|
|
68
|
-
*/
|
|
69
|
-
readonly gateReviewInstruction?: string;
|
|
70
64
|
/**
|
|
71
65
|
* Pi-adapter inject (tests). Used only as the `pi` row when composing the
|
|
72
66
|
* adapter table — never as an override of the child seat's selected host.
|
|
@@ -304,10 +298,6 @@ export async function summonPublicRole(
|
|
|
304
298
|
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
305
299
|
// #753: reask rides the existing notary same-ticket resume summons.instruction.
|
|
306
300
|
...(options.reviewReask === undefined ? {} : { reviewReask: options.reviewReask }),
|
|
307
|
-
// #786: verbatim submission body on same-parent resume (not conclusion re-ask).
|
|
308
|
-
...(options.gateReviewInstruction === undefined
|
|
309
|
-
? {}
|
|
310
|
-
: { gateReviewInstruction: options.gateReviewInstruction }),
|
|
311
301
|
...(options.boundTicketNumber === undefined
|
|
312
302
|
? {}
|
|
313
303
|
: { boundTicketNumber: options.boundTicketNumber }),
|
|
@@ -436,11 +426,6 @@ export async function summonGateOfficer(options: {
|
|
|
436
426
|
* Never concatenated into argv (inspector parentRunPath is the pure 卷宗指针).
|
|
437
427
|
*/
|
|
438
428
|
readonly reask?: string;
|
|
439
|
-
/**
|
|
440
|
-
* In-flight parent 交卷 body (tool-call arguments). Relayed verbatim on resume
|
|
441
|
-
* when reask is absent (#786). Never a path pointer substitute.
|
|
442
|
-
*/
|
|
443
|
-
readonly submission?: unknown;
|
|
444
429
|
/** Pi-adapter inject — forwarded to summonPublicRole (not a parent-host override). */
|
|
445
430
|
readonly roleTurnHost?: RoleTurnHost;
|
|
446
431
|
readonly hostAdapters?: readonly NamedRoleTurnHostAdapter[];
|
|
@@ -453,17 +438,10 @@ export async function summonGateOfficer(options: {
|
|
|
453
438
|
// Hard path resolve: fail loud — never fall through to packageMachineHome (#604 / #675).
|
|
454
439
|
home = homeFromRunDirectory(options.sourceRunDirectory);
|
|
455
440
|
}
|
|
456
|
-
// Conclusion re-ask keeps sole ownership of reviewReask. New-submission body
|
|
457
|
-
// rides a separate field so first mint never fails the "reask requires prior" gate.
|
|
458
|
-
let gateReviewInstruction: string | undefined;
|
|
459
|
-
if (options.reask === undefined && options.submission !== undefined) {
|
|
460
|
-
const { buildGateOfficerReviewInstruction } = await import("./auditor-dossier-tool.ts");
|
|
461
|
-
gateReviewInstruction = buildGateOfficerReviewInstruction({
|
|
462
|
-
submission: options.submission,
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
441
|
// Officer host is seat-owned only (#821). Parent invocation.json.host stays a
|
|
466
442
|
// hostTransition consumer in post-admission — not an officer override channel.
|
|
443
|
+
// #836: officers get the whole parent run directory pointer; code does not
|
|
444
|
+
// inject a picked toolCall leaf as the resume instruction.
|
|
467
445
|
const common = {
|
|
468
446
|
cwd: options.cwd,
|
|
469
447
|
...(home === undefined ? {} : { home }),
|
|
@@ -471,9 +449,6 @@ export async function summonGateOfficer(options: {
|
|
|
471
449
|
...(options.io === undefined ? {} : { io: options.io }),
|
|
472
450
|
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
473
451
|
...(options.reask === undefined ? {} : { reviewReask: options.reask }),
|
|
474
|
-
...(gateReviewInstruction === undefined
|
|
475
|
-
? {}
|
|
476
|
-
: { gateReviewInstruction }),
|
|
477
452
|
...(options.roleTurnHost === undefined ? {} : { roleTurnHost: options.roleTurnHost }),
|
|
478
453
|
...(options.hostAdapters === undefined ? {} : { hostAdapters: options.hostAdapters }),
|
|
479
454
|
...(options.createRunId === undefined ? {} : { createRunId: options.createRunId }),
|
|
@@ -489,8 +464,7 @@ export async function summonGateOfficer(options: {
|
|
|
489
464
|
}
|
|
490
465
|
if (options.officer === "auditor") {
|
|
491
466
|
// #756: judge compliance path — same queue law as notary/inspector.
|
|
492
|
-
//
|
|
493
|
-
const { AUDITOR_DOSSIER_PROMPT } = await import("./compliance-transport.ts");
|
|
467
|
+
// #836: auditor kickoff is path pointer (同察院), not「本 run 卷宗已就绪」.
|
|
494
468
|
return summonPublicRole({
|
|
495
469
|
role: "auditor",
|
|
496
470
|
argv: [
|
|
@@ -498,12 +472,13 @@ export async function summonGateOfficer(options: {
|
|
|
498
472
|
"judge",
|
|
499
473
|
"--source-run",
|
|
500
474
|
options.sourceRunDirectory,
|
|
501
|
-
|
|
475
|
+
`卷宗指针:${options.sourceRunDirectory}`,
|
|
502
476
|
],
|
|
503
477
|
...common,
|
|
504
478
|
});
|
|
505
479
|
}
|
|
506
480
|
// Inspector: argv stays pure 卷宗指针 (#747 parentRunPath); reask rides env only.
|
|
481
|
+
// #836 resume 请重读 is added on the resume projection face, not here.
|
|
507
482
|
return summonPublicRole({
|
|
508
483
|
role: "inspector",
|
|
509
484
|
argv: [`卷宗指针:${options.sourceRunDirectory}`],
|