@akagilnc/pi-workflow-roles 0.1.5762 → 0.1.5775

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.
@@ -2677,9 +2677,8 @@ var init_packaged_role_registry = __esm({
2677
2677
  bareCommand: false,
2678
2678
  outputTool: NOTARY_OUTPUT_TOOL_NAME,
2679
2679
  settlement: "accepted",
2680
- /** Court reask replaces the initial prompt. Otherwise the fixed kickoff. */
2680
+ /** Dialogue via shared resolveReviewSeatDialogueBody (review = fixed dispatch). */
2681
2681
  reaskPrompt: true,
2682
- transportPrompt: "fixed-kickoff",
2683
2682
  gateStageLabel: "\u7B26\u5B9D\u90CE",
2684
2683
  /** Gate summon binds --source-run and keeps dialogue off the argv. */
2685
2684
  gateSummon: "source-run",
@@ -2702,6 +2701,8 @@ var init_packaged_role_registry = __esm({
2702
2701
  phases: [null],
2703
2702
  outputTool: COUNTERSIGN_OUTPUT_TOOL_NAME,
2704
2703
  settlement: "accepted",
2704
+ /** Same shared dialogue resolver as other review seats (#1208 C1). */
2705
+ reaskPrompt: true,
2705
2706
  gateStageLabel: "\u7ED9\u4E8B\u4E2D",
2706
2707
  /** Gate summon carries the parent payload as the instruction and a parent run id. */
2707
2708
  gateSummon: "parent-instruction",
@@ -4920,7 +4921,6 @@ var run_terminal_artifacts_exports = {};
4920
4921
  __export(run_terminal_artifacts_exports, {
4921
4922
  ATTEMPT_HISTORY_IDENTITY_FIELD: () => ATTEMPT_HISTORY_IDENTITY_FIELD,
4922
4923
  TERMINAL_COURT_ATTEMPT_FIELD: () => TERMINAL_COURT_ATTEMPT_FIELD,
4923
- isTicketCourtCountersignSource: () => isTicketCourtCountersignSource,
4924
4924
  readRunTerminal: () => readRunTerminal,
4925
4925
  roleFromRunDirectory: () => roleFromRunDirectory,
4926
4926
  runIdFromRunDirectory: () => runIdFromRunDirectory,
@@ -4981,9 +4981,6 @@ function runIdFromRunDirectory(runDirectory) {
4981
4981
  function roleFromRunDirectory(runDirectory) {
4982
4982
  return parseRunLeaf(basename6(runDirectory))?.role;
4983
4983
  }
4984
- function isTicketCourtCountersignSource(runDirectory) {
4985
- return roleFromRunDirectory(runDirectory) === "countersign";
4986
- }
4987
4984
  var ATTEMPT_HISTORY_IDENTITY_FIELD, TERMINAL_COURT_ATTEMPT_FIELD;
4988
4985
  var init_run_terminal_artifacts = __esm({
4989
4986
  "src/run-terminal-artifacts.ts"() {
@@ -7153,8 +7150,8 @@ var init_option_definitions = __esm({
7153
7150
  repeatable: false,
7154
7151
  form: "option",
7155
7152
  description: {
7156
- en: "Required source run locator (runId@role under the book home, or path to that run directory). Zero prompt/attachment projection.",
7157
- zh: "\u5FC5\u586B\u6E90 run \u5B9A\u4F4D\u7B26\uFF08\u7C3F\u5185 runId@role\uFF0C\u6216\u8BE5 run \u76EE\u5F55\u8DEF\u5F84\uFF09\u3002\u96F6 prompt/\u9644\u4EF6\u6295\u5F71\u3002"
7153
+ en: "Required source run locator (runId@role under the book home, or path to that run directory). Binds the audited identity; review dialogue is the fixed Notary dispatch (verdict stays in the ledger). Missing-ticket and unreadable-status reasks keep their existing diagnostic text.",
7154
+ zh: "\u5FC5\u586B\u6E90 run \u5B9A\u4F4D\u7B26\uFF08\u7C3F\u5185 runId@role\uFF0C\u6216\u8BE5 run \u76EE\u5F55\u8DEF\u5F84\uFF09\u3002\u7ED1\u5B9A\u53D7\u5BA1\u8EAB\u4EFD\uFF1B\u5BA1\u7A3F\u5BF9\u8BDD\u4E3A\u7B26\u5B9D\u90CE\u56FA\u5B9A\u6D3E\u5355\u6587\uFF08\u5224\u8BCD\u7559\u5728\u5377\u5B97\u81EA\u884C\u8BFB\u53D6\uFF09\u3002\u7F3A\u7968\u53F7\u4E0E\u8BFB\u4E0D\u51FA status \u7684\u91CD\u4EA4\u4ECD\u9012\u65E2\u6709\u8BCA\u65AD\u539F\u6587\u3002"
7158
7155
  }
7159
7156
  }
7160
7157
  ];
@@ -7489,7 +7486,7 @@ var init_option_definitions = __esm({
7489
7486
  },
7490
7487
  notary: {
7491
7488
  command: "notary",
7492
- summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
7489
+ summary: "Direct Notary summons; duties: souls/notary.md. Review uses fixed dispatch \u2014 binds --source-run identity; does not accept caller review prompt; verdict stays in the ledger. Missing-ticket (#1171) and unreadable-status reasks deliver their existing diagnostic text on the same seat, not the review sentence.",
7493
7490
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
7494
7491
  examples: [
7495
7492
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
@@ -7550,7 +7547,7 @@ var init_option_definitions = __esm({
7550
7547
  },
7551
7548
  resume: {
7552
7549
  command: "resume",
7553
- summary: "Resume a role run under the live seat table (model/host/engine); session principal must still exist. Every callable seat, including Notary/\u7B26\u5B9D\u90CE, accepts the optional caller message and passes it through unchanged as the continuation prompt. Notary explicit new still accepts only its source-run locator, not a caller prompt. Global --model/--thinking/--host/--engine must be placed before <runId> (either before `resume` or between `resume` and <runId>); the one argv after <runId> is the opaque message, not a flag position (#471).",
7550
+ summary: "Resume a role run under the live seat table (model/host/engine); session principal must still exist. Every callable seat accepts the optional caller message and passes it through unchanged as the continuation prompt. Notary new/direct review calls use only --source-run plus the fixed review dispatch (no caller review prompt); public manual resume still passes the caller message. Global --model/--thinking/--host/--engine must be placed before <runId> (either before `resume` or between `resume` and <runId>); the one argv after <runId> is the opaque message, not a flag position (#471).",
7554
7551
  usage: ["ak-role resume <runId> [message]"],
7555
7552
  examples: [
7556
7553
  "ak-role resume 01abc\u2026",
@@ -8536,9 +8533,6 @@ function appendCallerFileFlagPaths(body, attachments, requestManifestPath, prere
8536
8533
  }
8537
8534
  function buildInstructionTransportPrompt(admitted) {
8538
8535
  const kind = admittedTransportPromptKind(admitted);
8539
- if (kind === "fixed-kickoff") {
8540
- return "";
8541
- }
8542
8536
  if (kind === "baseline") {
8543
8537
  if (admitted.baseRevision === void 0) {
8544
8538
  throw new Error("baseline transport prompt is missing the bound revision");
@@ -13055,10 +13049,7 @@ function buildReceiptDeliveryRequest(input) {
13055
13049
  ...request,
13056
13050
  continuation: {
13057
13051
  kind: "resume",
13058
- prompt: JSON.stringify({
13059
- ...receiptDelivery.deliveryState(),
13060
- deliveryTurns: receiptDelivery.issuedDeliveryRequests() + 1
13061
- })
13052
+ prompt: request.continuation.prompt
13062
13053
  },
13063
13054
  deliveryRequestLimit: receiptDelivery.limit
13064
13055
  };
@@ -13821,7 +13812,7 @@ async function runPostAdmissionSeatResume(input) {
13821
13812
  ...firstTurn,
13822
13813
  continuation: {
13823
13814
  kind: "resume",
13824
- prompt: RESUME_TRANSPORT_ENVELOPE
13815
+ prompt: firstTurn.continuation.prompt
13825
13816
  }
13826
13817
  };
13827
13818
  }
@@ -13940,7 +13931,7 @@ async function runPostAdmissionOneShot(input) {
13940
13931
  ...input.request,
13941
13932
  continuation: {
13942
13933
  kind: "resume",
13943
- prompt: buildAutoResumeContinuationPrompt()
13934
+ prompt: input.request.continuation.prompt
13944
13935
  }
13945
13936
  }),
13946
13937
  adapters: input.adapters,
@@ -14161,6 +14152,7 @@ __export(instruction_seat_run_exports, {
14161
14152
  NOTARY_FIXED_DISPATCH: () => NOTARY_FIXED_DISPATCH,
14162
14153
  buildInstructionSeatTurnRequest: () => buildInstructionSeatTurnRequest,
14163
14154
  continueParentAfterChild: () => continueParentAfterChild,
14155
+ resolveReviewSeatDialogueBody: () => resolveReviewSeatDialogueBody,
14164
14156
  runPublicInstructionSeat: () => runPublicInstructionSeat,
14165
14157
  runPublicInstructionSeatResume: () => runPublicInstructionSeatResume
14166
14158
  });
@@ -14231,7 +14223,8 @@ async function reaskUnreadablePostSubmissionStatus(admitted, terminal, env, io,
14231
14223
  {
14232
14224
  runId: admitted.runId,
14233
14225
  runDirectory: admitted.runDirectory,
14234
- summons: { instruction: message }
14226
+ message,
14227
+ summons: { instructionEmpty: true }
14235
14228
  },
14236
14229
  next,
14237
14230
  io
@@ -14258,7 +14251,8 @@ async function reaskMissingTicketOnce(admitted, terminal, env, io) {
14258
14251
  {
14259
14252
  runId: admitted.runId,
14260
14253
  runDirectory: admitted.runDirectory,
14261
- summons: { instruction }
14254
+ message: instruction,
14255
+ summons: { instructionEmpty: true }
14262
14256
  },
14263
14257
  softReaskEnv,
14264
14258
  io
@@ -14371,26 +14365,26 @@ async function loadLedgerPeerBody(sourceRunDirectory, projectRoot, home) {
14371
14365
  return readableGateItem(latest.accepted);
14372
14366
  }
14373
14367
  async function resolveReviewSeatDialogueBody(input) {
14374
- const reask = input.reask;
14375
- if (reask !== void 0 && reask.length > 0) return reask;
14368
+ if (input.role === "notary") {
14369
+ if (input.reviewReask !== void 0) return input.reviewReask;
14370
+ return NOTARY_FIXED_DISPATCH;
14371
+ }
14372
+ const preferred = input.reviewReask ?? input.gateReviewInstruction;
14373
+ if (preferred !== void 0 && preferred.length > 0) return preferred;
14376
14374
  const caller = input.callerInstruction ?? "";
14377
14375
  if (caller.length > 0) return caller;
14378
14376
  const sourceRunPath = admittedSourceRunPath(input)?.trim();
14379
14377
  if (sourceRunPath === void 0) return void 0;
14380
- if (input.role === "notary") {
14381
- const { isTicketCourtCountersignSource: isTicketCourtCountersignSource2 } = await Promise.resolve().then(() => (init_run_terminal_artifacts(), run_terminal_artifacts_exports));
14382
- if (isTicketCourtCountersignSource2(sourceRunPath)) return NOTARY_FIXED_DISPATCH;
14383
- }
14384
14378
  return await loadLedgerPeerBody(sourceRunPath, input.projectRoot, input.home);
14385
14379
  }
14386
14380
  async function resolveInitialPrompt(admitted, env) {
14387
14381
  const record = roleRecord(admitted.role);
14388
14382
  if ("reaskPrompt" in record && record.reaskPrompt === true) {
14389
14383
  const sourceRunPath = admittedSourceRunPath(admitted);
14390
- const reask = env.reviewReask ?? env.gateReviewInstruction;
14391
14384
  const body = await resolveReviewSeatDialogueBody({
14392
14385
  role: admitted.role,
14393
- ...reask === void 0 ? {} : { reask },
14386
+ ...env.reviewReask === void 0 ? {} : { reviewReask: env.reviewReask },
14387
+ ...env.gateReviewInstruction === void 0 ? {} : { gateReviewInstruction: env.gateReviewInstruction },
14394
14388
  callerInstruction: admitted.instruction,
14395
14389
  ...sourceRunPath === void 0 ? {} : { sourceRunPath },
14396
14390
  projectRoot: admitted.projectRoot,
@@ -14498,7 +14492,7 @@ async function dispatchAdmitted(admitted, env, io) {
14498
14492
  admitted,
14499
14493
  roleTurnOptions(activeEnv, admitted, {
14500
14494
  kind: "resume",
14501
- prompt: buildAutoResumeContinuationPrompt()
14495
+ prompt: initialPromptText
14502
14496
  })
14503
14497
  ),
14504
14498
  adapters,
@@ -14598,22 +14592,26 @@ function resumeSameParentInstructionSeat(input) {
14598
14592
  ...input.ticketNumber === void 0 ? {} : { ticketNumber: input.ticketNumber },
14599
14593
  freshSummons: input.env.freshSummons,
14600
14594
  summons: input.summons,
14601
- resume: (runId, materials, runDirectory) => runPublicInstructionSeatResume(
14602
- {
14603
- runId,
14604
- runDirectory,
14605
- ...materials === void 0 ? {} : { summons: materials }
14606
- },
14607
- input.env,
14608
- input.io
14609
- )
14595
+ resume: (runId, materials, runDirectory) => {
14596
+ const reask = input.env.reviewReask;
14597
+ return runPublicInstructionSeatResume(
14598
+ {
14599
+ runId,
14600
+ runDirectory,
14601
+ ...reask === void 0 ? {} : { message: reask },
14602
+ ...materials === void 0 ? {} : { summons: materials }
14603
+ },
14604
+ input.env,
14605
+ input.io
14606
+ );
14607
+ }
14610
14608
  });
14611
14609
  }
14612
14610
  async function sameParentDialogue(env, fallback, sourceRunPath, projectRoot, role) {
14613
- const reask = env.reviewReask ?? env.gateReviewInstruction;
14614
14611
  const body = await resolveReviewSeatDialogueBody({
14615
14612
  role,
14616
- ...reask === void 0 ? {} : { reask },
14613
+ ...env.reviewReask === void 0 ? {} : { reviewReask: env.reviewReask },
14614
+ ...env.gateReviewInstruction === void 0 ? {} : { gateReviewInstruction: env.gateReviewInstruction },
14617
14615
  callerInstruction: fallback.instruction,
14618
14616
  sourceRunPath,
14619
14617
  projectRoot,
@@ -14625,20 +14623,30 @@ async function sameParentDialogue(env, fallback, sourceRunPath, projectRoot, rol
14625
14623
  return fallback;
14626
14624
  }
14627
14625
  async function runCountersignBody(parsed, env, io) {
14626
+ const projectRoot = resolve12(parsed.project ?? env.cwd);
14628
14627
  const gateParentRunPath = typeof env.parentRunPath === "string" && env.parentRunPath.trim() !== "" ? env.parentRunPath : void 0;
14629
14628
  if (gateParentRunPath !== void 0) {
14630
- const resumeInstruction = env.reviewReask ?? env.gateReviewInstruction ?? parsed.instruction ?? "";
14629
+ const dialogue = await sameParentDialogue(
14630
+ env,
14631
+ {
14632
+ instruction: parsed.instruction ?? "",
14633
+ instructionEmpty: (parsed.instruction ?? "").length === 0
14634
+ },
14635
+ gateParentRunPath,
14636
+ projectRoot,
14637
+ "countersign"
14638
+ );
14631
14639
  const resumed = await resumeSameParentInstructionSeat({
14632
14640
  env,
14633
14641
  io,
14634
- projectRoot: resolve12(parsed.project ?? env.cwd),
14642
+ projectRoot,
14635
14643
  role: "countersign",
14636
14644
  parentRunPath: gateParentRunPath,
14637
14645
  ...isSafePositiveTicketNumber(env.boundTicketNumber) ? { ticketNumber: env.boundTicketNumber } : {},
14638
14646
  summons: {
14639
14647
  sourceRunPath: gateParentRunPath,
14640
- instruction: resumeInstruction,
14641
- instructionEmpty: resumeInstruction.length === 0,
14648
+ instruction: dialogue.instruction,
14649
+ instructionEmpty: dialogue.instructionEmpty,
14642
14650
  // #1166 J11: same-parent resume delivers this call's file-flag paths
14643
14651
  // through the shared summons → appendCallerFileFlagPaths rule.
14644
14652
  attachmentPaths: parsed.attachmentPaths ?? []
@@ -14673,10 +14681,9 @@ async function runCountersignBody(parsed, env, io) {
14673
14681
  await persistAdmittedSourceRunPath(admitted, gateParentRunPath);
14674
14682
  admitted = { ...admitted, sourceRunPath: gateParentRunPath };
14675
14683
  }
14676
- const reviewBody = env.reviewReask ?? env.gateReviewInstruction;
14677
14684
  const turnProjection = roleTurnOptions(env, admitted, {
14678
14685
  kind: "initial",
14679
- prompt: reviewBody !== void 0 ? appendCallerFileFlagPaths(reviewBody, admitted.attachments) : buildInstructionTransportPrompt(admitted)
14686
+ prompt: await resolveInitialPrompt(admitted, env)
14680
14687
  });
14681
14688
  const turnRequest = buildInstructionSeatTurnRequest(admitted, turnProjection);
14682
14689
  const result = await runPostAdmissionOneShot({
@@ -14887,6 +14894,7 @@ async function runPublicInstructionSeat(argv, env, io, role, parseArgv2) {
14887
14894
  await persistAdmittedSourceRunPath(admitted, auditorSource, auditorSubject);
14888
14895
  admitted = { ...admitted, sourceRunPath: auditorSource };
14889
14896
  }
14897
+ admitted = await inheritKnownTicketFromSource(admitted, env.principalAuthority);
14890
14898
  const runAdmitted = async () => {
14891
14899
  await markRunAdmitted(admitted, env.principalAuthority);
14892
14900
  if (role === "secretariat") {
@@ -14949,6 +14957,16 @@ async function runPublicInstructionSeat(argv, env, io, role, parseArgv2) {
14949
14957
  }
14950
14958
  return runAdmitted();
14951
14959
  }
14960
+ async function inheritKnownTicketFromSource(admitted, authority) {
14961
+ if (admitted.ticketNumber !== void 0) return admitted;
14962
+ const sourcePath = admittedSourceRunPath(admitted);
14963
+ if (sourcePath === void 0) return admitted;
14964
+ const sourceTicket = await readBoardTicketNumber(sourcePath);
14965
+ if (sourceTicket === void 0) return admitted;
14966
+ await bindAdmittedTicketNumber(admitted, sourceTicket);
14967
+ await relocateAdmittedRunToTicket(admitted, authority);
14968
+ return admitted;
14969
+ }
14952
14970
  async function runPublicInstructionSeatResume(request, env, io) {
14953
14971
  let selectedRequest = request;
14954
14972
  const resume = async () => {
@@ -14968,26 +14986,45 @@ async function runPublicInstructionSeatResume(request, env, io) {
14968
14986
  env.principalAuthority,
14969
14987
  effective.runDirectory === void 0 ? void 0 : { runDirectory: effective.runDirectory }
14970
14988
  );
14971
- if (packagedRebindSourceOnResume(loaded.admitted.role) && effective.summons?.sourceRunPath !== void 0 && effective.summons.sourceRun !== void 0) {
14972
- return {
14973
- ...loaded,
14974
- admitted: {
14975
- ...loaded.admitted,
14976
- sourceRunPath: effective.summons.sourceRunPath,
14977
- sourceRun: effective.summons.sourceRun
14978
- }
14989
+ let admitted = loaded.admitted;
14990
+ if (packagedRebindSourceOnResume(admitted.role) && effective.summons?.sourceRunPath !== void 0 && effective.summons.sourceRun !== void 0) {
14991
+ admitted = {
14992
+ ...admitted,
14993
+ sourceRunPath: effective.summons.sourceRunPath,
14994
+ sourceRun: effective.summons.sourceRun
14979
14995
  };
14980
14996
  }
14981
- return loaded;
14997
+ admitted = await inheritKnownTicketFromSource(admitted, env.principalAuthority);
14998
+ return { ...loaded, admitted };
14982
14999
  },
14983
15000
  buildTurnRequest: async (admitted, effective) => {
14984
15001
  const summonsPrepared = await prepareSummonsResumeMaterials(admitted.runDirectory, effective.summons);
14985
- return buildInstructionSeatTurnRequest(
15002
+ const projection = resumeTurnRequestProjectionOptions(
14986
15003
  admitted,
14987
- {
14988
- ...resumeTurnRequestProjectionOptions(admitted, effective, env, summonsPrepared)
14989
- }
15004
+ effective,
15005
+ env,
15006
+ summonsPrepared
14990
15007
  );
15008
+ if (effective.summons === void 0 || effective.message !== void 0) {
15009
+ return buildInstructionSeatTurnRequest(admitted, { ...projection });
15010
+ }
15011
+ const sourceRunPath = admittedSourceRunPath(admitted);
15012
+ const body = await resolveReviewSeatDialogueBody({
15013
+ role: admitted.role,
15014
+ callerInstruction: summonsPrepared?.instruction ?? "",
15015
+ ...sourceRunPath === void 0 ? {} : { sourceRunPath },
15016
+ projectRoot: admitted.projectRoot,
15017
+ home: env.home
15018
+ });
15019
+ if (body === void 0) {
15020
+ return buildInstructionSeatTurnRequest(admitted, { ...projection });
15021
+ }
15022
+ const fileFlags = summonsPrepared?.attachments ?? [];
15023
+ const prompt = fileFlags.length === 0 ? body : appendCallerFileFlagPaths(body, fileFlags);
15024
+ return buildInstructionSeatTurnRequest(admitted, {
15025
+ ...projection,
15026
+ continuation: { kind: "resume", prompt }
15027
+ });
14991
15028
  },
14992
15029
  adapters: {
14993
15030
  trySettle: async () => void 0
@@ -15182,7 +15219,8 @@ async function auditSubmittedRole(turn, env, io, resumedOfficer, passedReceipt)
15182
15219
  return runPublicInstructionSeatResume({
15183
15220
  runId: admitted.runId,
15184
15221
  runDirectory: admitted.runDirectory,
15185
- summons: { instruction: SECRETARIAT_STATUS_REASK }
15222
+ message: SECRETARIAT_STATUS_REASK,
15223
+ summons: { instructionEmpty: true }
15186
15224
  }, next, io);
15187
15225
  }
15188
15226
  if (admitted.role === "countersign" && (typeof status !== "string" || !REVIEW_QUEUE_STATUSES.has(status))) {
@@ -15196,7 +15234,8 @@ async function auditSubmittedRole(turn, env, io, resumedOfficer, passedReceipt)
15196
15234
  return runPublicInstructionSeatResume({
15197
15235
  runId: admitted.runId,
15198
15236
  runDirectory: admitted.runDirectory,
15199
- summons: { instruction: officerConclusionReask(status) }
15237
+ message: officerConclusionReask(status),
15238
+ summons: { instructionEmpty: true }
15200
15239
  }, next, io);
15201
15240
  }
15202
15241
  const selfEscalationSkipsAudit = status === "escalate" && (admitted.role === "judge" || admitted.role === "secretariat" || admitted.role === "countersign");
@@ -15451,6 +15490,20 @@ var init_instruction_seat_run = __esm({
15451
15490
  judge: {
15452
15491
  statuses: REVIEW_QUEUE_STATUSES
15453
15492
  },
15493
+ // #1208 C1 / ADR 0055: every review-queue seat uses the shared
15494
+ // unreadable-status seam (officerConclusionReask). Independent public
15495
+ // entry for notary/auditor/inspector was the same miss — route here, do
15496
+ // not invent a parallel loop. Gate summons still own the outer budget
15497
+ // via nestedIncomplete when this seat exhausts unsettled.
15498
+ notary: {
15499
+ statuses: REVIEW_QUEUE_STATUSES
15500
+ },
15501
+ auditor: {
15502
+ statuses: REVIEW_QUEUE_STATUSES
15503
+ },
15504
+ inspector: {
15505
+ statuses: REVIEW_QUEUE_STATUSES
15506
+ },
15454
15507
  coder: {
15455
15508
  statuses: WORKER_ROUTING_STATUSES,
15456
15509
  reask: WORKER_STATUS_REASK
@@ -19179,13 +19232,9 @@ async function summonGateOfficer(options) {
19179
19232
  home = homeFromRunDirectory2(options.sourceRunDirectory);
19180
19233
  }
19181
19234
  let gateReviewInstruction;
19182
- if (options.reask === void 0 && options.submission !== void 0) {
19183
- const { isTicketCourtCountersignSource: isTicketCourtCountersignSource2 } = await Promise.resolve().then(() => (init_run_terminal_artifacts(), run_terminal_artifacts_exports));
19184
- const blindTicketCourt = options.officer === "notary" && isTicketCourtCountersignSource2(options.sourceRunDirectory);
19185
- if (!blindTicketCourt) {
19186
- const { readableGateItem: readableGateItem2 } = await Promise.resolve().then(() => (init_readable_gate_item(), readable_gate_item_exports));
19187
- gateReviewInstruction = readableGateItem2(options.submission);
19188
- }
19235
+ if (options.reask === void 0 && options.submission !== void 0 && options.officer !== "notary") {
19236
+ const { readableGateItem: readableGateItem2 } = await Promise.resolve().then(() => (init_readable_gate_item(), readable_gate_item_exports));
19237
+ gateReviewInstruction = readableGateItem2(options.submission);
19189
19238
  }
19190
19239
  const { runIdFromRunDirectory: runIdFromRunDirectory2 } = await Promise.resolve().then(() => (init_run_terminal_artifacts(), run_terminal_artifacts_exports));
19191
19240
  const parentRunId = runIdFromRunDirectory2(options.sourceRunDirectory);
@@ -19236,7 +19285,14 @@ async function summonGateOfficer(options) {
19236
19285
  const parentTicket = await readBoardTicketNumber2(options.sourceRunDirectory);
19237
19286
  const submittedTicket = isRecord(options.submission) ? options.submission.ticketNumber : void 0;
19238
19287
  const courtTicket = isSafePositiveTicketNumber3(submittedTicket) ? submittedTicket : parentTicket;
19239
- const instruction = options.reask ?? gateReviewInstruction ?? "";
19288
+ const { resolveReviewSeatDialogueBody: resolveReviewSeatDialogueBody2 } = await Promise.resolve().then(() => (init_instruction_seat_run(), instruction_seat_run_exports));
19289
+ const instruction = await resolveReviewSeatDialogueBody2({
19290
+ role: options.officer,
19291
+ ...options.reask === void 0 ? {} : { reviewReask: options.reask },
19292
+ ...gateReviewInstruction === void 0 ? {} : { gateReviewInstruction },
19293
+ projectRoot: options.cwd,
19294
+ home
19295
+ }) ?? "";
19240
19296
  return summonPublicRole({
19241
19297
  role: options.officer,
19242
19298
  argv: ["--project", options.cwd, "--", instruction],
@@ -19447,11 +19503,9 @@ var init_role_run_relocation = __esm({
19447
19503
  var run_lifecycle_exports = {};
19448
19504
  __export(run_lifecycle_exports, {
19449
19505
  AUTO_RESUME_LIMIT: () => AUTO_RESUME_LIMIT,
19450
- RESUME_TRANSPORT_ENVELOPE: () => RESUME_TRANSPORT_ENVELOPE,
19451
19506
  RunWriterLeaseHeldError: () => RunWriterLeaseHeldError,
19452
19507
  acquireRunWriterLease: () => acquireRunWriterLease,
19453
19508
  autopsyWriterLock: () => autopsyWriterLock,
19454
- buildAutoResumeContinuationPrompt: () => buildAutoResumeContinuationPrompt,
19455
19509
  clearCurrentCourt: () => clearCurrentCourt,
19456
19510
  describeErrorIdentity: () => describeErrorIdentity,
19457
19511
  findLatestRunForSeatTicket: () => findLatestRunForSeatTicket,
@@ -19473,9 +19527,6 @@ __export(run_lifecycle_exports, {
19473
19527
  import { existsSync as existsSync12 } from "node:fs";
19474
19528
  import { chmod, lstat as lstat3, open as open2, readdir as readdir4, readFile as readFile14, unlink as unlink2 } from "node:fs/promises";
19475
19529
  import { basename as basename12, join as join28 } from "node:path";
19476
- function buildAutoResumeContinuationPrompt() {
19477
- return RESUME_TRANSPORT_ENVELOPE;
19478
- }
19479
19530
  async function writeRoleRunState(runDirectory, record) {
19480
19531
  const payload = { ...record, runDirectory };
19481
19532
  writeSectionSync(runDirectory, "runState", { ...payload });
@@ -20406,7 +20457,7 @@ function resumedWorkerPhase(phase, phases, role, runId) {
20406
20457
  }
20407
20458
  throw new CliUsageError(`role run admitted ${role} phase is missing: ${runId}`);
20408
20459
  }
20409
- var AUTO_RESUME_LIMIT, RESUME_TRANSPORT_ENVELOPE, WRITER_LOCK_FILE, RunWriterLeaseHeldError, WRITER_LEASE_RECLAIM_ROUNDS;
20460
+ var AUTO_RESUME_LIMIT, WRITER_LOCK_FILE, RunWriterLeaseHeldError, WRITER_LEASE_RECLAIM_ROUNDS;
20410
20461
  var init_run_lifecycle = __esm({
20411
20462
  "src/public-cli/run-lifecycle.ts"() {
20412
20463
  "use strict";
@@ -20421,7 +20472,6 @@ var init_run_lifecycle = __esm({
20421
20472
  init_run_dossier();
20422
20473
  init_unknown_value();
20423
20474
  AUTO_RESUME_LIMIT = 2;
20424
- RESUME_TRANSPORT_ENVELOPE = "\u7EE7\u7EED\u3002";
20425
20475
  WRITER_LOCK_FILE = "writer.lock";
20426
20476
  RunWriterLeaseHeldError = class extends Error {
20427
20477
  code = "AK_RUN_WRITER_LEASE_HELD";
@@ -21067,7 +21117,7 @@ function createNavigatorAttendance(options) {
21067
21117
  await promptAllowingRejectedPrepare(request);
21068
21118
  while (output === void 0 && prepareBatchRejected && delivery.nextAction() === "request-delivery") {
21069
21119
  delivery.recordDeliveryRequest();
21070
- await promptAllowingRejectedPrepare(JSON.stringify(delivery.deliveryState()));
21120
+ await promptAllowingRejectedPrepare(request);
21071
21121
  }
21072
21122
  if (output === void 0 && delivery.nextAction() === "request-delivery") {
21073
21123
  delivery.closeBudget();
@@ -23139,6 +23189,7 @@ function createRoleRuntimeExtension(dependencies, deliveryRequestLimit) {
23139
23189
  let engineDetourRegistered = false;
23140
23190
  let receiptDelivery = createReceiptDeliveryPolicy(deliveryLimit);
23141
23191
  let noReceiptRecorded = false;
23192
+ let turnDialoguePrompt;
23142
23193
  const disposeNavigatorAttendanceNonBlocking = (attendance) => {
23143
23194
  if (attendance === void 0) return;
23144
23195
  const recordDisposeFailure = (error) => {
@@ -23225,6 +23276,7 @@ function createRoleRuntimeExtension(dependencies, deliveryRequestLimit) {
23225
23276
  roleHost.on("before_agent_start", async (event, ctx) => {
23226
23277
  const role = roleHost.getFlag(ROLE_FLAG.name);
23227
23278
  const prompt = event.prompt;
23279
+ if (typeof prompt === "string") turnDialoguePrompt = prompt;
23228
23280
  if (role === void 0) return;
23229
23281
  if (!admitted || selectedRole !== role) {
23230
23282
  failInfrastructure(new ActivationBarrierError(role), ctx);
@@ -23385,7 +23437,7 @@ function createRoleRuntimeExtension(dependencies, deliveryRequestLimit) {
23385
23437
  });
23386
23438
  envelopeHost.sendMessage({
23387
23439
  customType: "ak-receipt-delivery-prompt",
23388
- content: JSON.stringify(receiptDelivery.deliveryState()),
23440
+ content: turnDialoguePrompt ?? "",
23389
23441
  display: false
23390
23442
  }, { triggerTurn: true, deliverAs: "followUp" });
23391
23443
  } else if (receiptDelivery.nextAction() === "no-receipt" && !noReceiptRecorded) {
@@ -23625,6 +23677,7 @@ function createRoleRuntimeExtension(dependencies, deliveryRequestLimit) {
23625
23677
  activeCollector = void 0;
23626
23678
  receiptDelivery = createReceiptDeliveryPolicy(deliveryLimit);
23627
23679
  noReceiptRecorded = false;
23680
+ turnDialoguePrompt = void 0;
23628
23681
  pendingNavigatorPresentation = void 0;
23629
23682
  navigatorActivation += 1;
23630
23683
  navigatorDeliveryClosed = false;
@@ -9455,9 +9455,8 @@ var init_packaged_role_registry = __esm({
9455
9455
  bareCommand: false,
9456
9456
  outputTool: NOTARY_OUTPUT_TOOL_NAME,
9457
9457
  settlement: "accepted",
9458
- /** Court reask replaces the initial prompt. Otherwise the fixed kickoff. */
9458
+ /** Dialogue via shared resolveReviewSeatDialogueBody (review = fixed dispatch). */
9459
9459
  reaskPrompt: true,
9460
- transportPrompt: "fixed-kickoff",
9461
9460
  gateStageLabel: "\u7B26\u5B9D\u90CE",
9462
9461
  /** Gate summon binds --source-run and keeps dialogue off the argv. */
9463
9462
  gateSummon: "source-run",
@@ -9480,6 +9479,8 @@ var init_packaged_role_registry = __esm({
9480
9479
  phases: [null],
9481
9480
  outputTool: COUNTERSIGN_OUTPUT_TOOL_NAME,
9482
9481
  settlement: "accepted",
9482
+ /** Same shared dialogue resolver as other review seats (#1208 C1). */
9483
+ reaskPrompt: true,
9483
9484
  gateStageLabel: "\u7ED9\u4E8B\u4E2D",
9484
9485
  /** Gate summon carries the parent payload as the instruction and a parent run id. */
9485
9486
  gateSummon: "parent-instruction",
@@ -10772,8 +10773,8 @@ var init_option_definitions = __esm({
10772
10773
  repeatable: false,
10773
10774
  form: "option",
10774
10775
  description: {
10775
- en: "Required source run locator (runId@role under the book home, or path to that run directory). Zero prompt/attachment projection.",
10776
- zh: "\u5FC5\u586B\u6E90 run \u5B9A\u4F4D\u7B26\uFF08\u7C3F\u5185 runId@role\uFF0C\u6216\u8BE5 run \u76EE\u5F55\u8DEF\u5F84\uFF09\u3002\u96F6 prompt/\u9644\u4EF6\u6295\u5F71\u3002"
10776
+ en: "Required source run locator (runId@role under the book home, or path to that run directory). Binds the audited identity; review dialogue is the fixed Notary dispatch (verdict stays in the ledger). Missing-ticket and unreadable-status reasks keep their existing diagnostic text.",
10777
+ zh: "\u5FC5\u586B\u6E90 run \u5B9A\u4F4D\u7B26\uFF08\u7C3F\u5185 runId@role\uFF0C\u6216\u8BE5 run \u76EE\u5F55\u8DEF\u5F84\uFF09\u3002\u7ED1\u5B9A\u53D7\u5BA1\u8EAB\u4EFD\uFF1B\u5BA1\u7A3F\u5BF9\u8BDD\u4E3A\u7B26\u5B9D\u90CE\u56FA\u5B9A\u6D3E\u5355\u6587\uFF08\u5224\u8BCD\u7559\u5728\u5377\u5B97\u81EA\u884C\u8BFB\u53D6\uFF09\u3002\u7F3A\u7968\u53F7\u4E0E\u8BFB\u4E0D\u51FA status \u7684\u91CD\u4EA4\u4ECD\u9012\u65E2\u6709\u8BCA\u65AD\u539F\u6587\u3002"
10777
10778
  }
10778
10779
  }
10779
10780
  ];
@@ -11107,7 +11108,7 @@ var init_option_definitions = __esm({
11107
11108
  },
11108
11109
  notary: {
11109
11110
  command: "notary",
11110
- summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
11111
+ summary: "Direct Notary summons; duties: souls/notary.md. Review uses fixed dispatch \u2014 binds --source-run identity; does not accept caller review prompt; verdict stays in the ledger. Missing-ticket (#1171) and unreadable-status reasks deliver their existing diagnostic text on the same seat, not the review sentence.",
11111
11112
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
11112
11113
  examples: [
11113
11114
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",
@@ -11168,7 +11169,7 @@ var init_option_definitions = __esm({
11168
11169
  },
11169
11170
  resume: {
11170
11171
  command: "resume",
11171
- summary: "Resume a role run under the live seat table (model/host/engine); session principal must still exist. Every callable seat, including Notary/\u7B26\u5B9D\u90CE, accepts the optional caller message and passes it through unchanged as the continuation prompt. Notary explicit new still accepts only its source-run locator, not a caller prompt. Global --model/--thinking/--host/--engine must be placed before <runId> (either before `resume` or between `resume` and <runId>); the one argv after <runId> is the opaque message, not a flag position (#471).",
11172
+ summary: "Resume a role run under the live seat table (model/host/engine); session principal must still exist. Every callable seat accepts the optional caller message and passes it through unchanged as the continuation prompt. Notary new/direct review calls use only --source-run plus the fixed review dispatch (no caller review prompt); public manual resume still passes the caller message. Global --model/--thinking/--host/--engine must be placed before <runId> (either before `resume` or between `resume` and <runId>); the one argv after <runId> is the opaque message, not a flag position (#471).",
11172
11173
  usage: ["ak-role resume <runId> [message]"],
11173
11174
  examples: [
11174
11175
  "ak-role resume 01abc\u2026",
@@ -268,7 +268,7 @@ function createNavigatorAttendance(options) {
268
268
  await promptAllowingRejectedPrepare(request);
269
269
  while (output === void 0 && prepareBatchRejected && delivery.nextAction() === "request-delivery") {
270
270
  delivery.recordDeliveryRequest();
271
- await promptAllowingRejectedPrepare(JSON.stringify(delivery.deliveryState()));
271
+ await promptAllowingRejectedPrepare(request);
272
272
  }
273
273
  if (output === void 0 && delivery.nextAction() === "request-delivery") {
274
274
  delivery.closeBudget();
@@ -267,9 +267,8 @@ const PUBLIC_ROLE_RECORDS = [
267
267
  bareCommand: false,
268
268
  outputTool: NOTARY_OUTPUT_TOOL_NAME,
269
269
  settlement: "accepted",
270
- /** Court reask replaces the initial prompt. Otherwise the fixed kickoff. */
270
+ /** Dialogue via shared resolveReviewSeatDialogueBody (review = fixed dispatch). */
271
271
  reaskPrompt: true,
272
- transportPrompt: "fixed-kickoff",
273
272
  gateStageLabel: "\u7B26\u5B9D\u90CE",
274
273
  /** Gate summon binds --source-run and keeps dialogue off the argv. */
275
274
  gateSummon: "source-run",
@@ -292,6 +291,8 @@ const PUBLIC_ROLE_RECORDS = [
292
291
  phases: [null],
293
292
  outputTool: COUNTERSIGN_OUTPUT_TOOL_NAME,
294
293
  settlement: "accepted",
294
+ /** Same shared dialogue resolver as other review seats (#1208 C1). */
295
+ reaskPrompt: true,
295
296
  gateStageLabel: "\u7ED9\u4E8B\u4E2D",
296
297
  /** Gate summon carries the parent payload as the instruction and a parent run id. */
297
298
  gateSummon: "parent-instruction",