@akagilnc/pi-workflow-roles 0.1.5318 → 0.1.5323

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.
@@ -60,16 +60,6 @@ export function latestPayloadEscalated(roleOutcome) {
60
60
  const payloads = roleOutcome.payloads ?? [];
61
61
  return isEscalatePayload(payloads[payloads.length - 1]);
62
62
  }
63
- /** Routing boolean over the child's own typed sequence — does not pick or rewrite a sole row. */
64
- export function courtDiaristEscalated(roleOutcome) {
65
- if (roleOutcome === undefined)
66
- return false;
67
- if (roleOutcome.kind === "audit_escalation")
68
- return true;
69
- if (roleOutcome.kind !== "accepted")
70
- return false;
71
- return (roleOutcome.payloads ?? []).some(isEscalatePayload);
72
- }
73
63
  /**
74
64
  * Invoke public 起居郎 under the court-pipeline quiet face.
75
65
  * Returns escalate or unbound; the secretariat needs no ticket handoff.
@@ -115,7 +105,7 @@ export async function invokeCourtDiarist(input, env, io) {
115
105
  const submissions = result.terminal?.submissions;
116
106
  // Escalate routing is a boolean over the preserved sequence (#881). Reasons and
117
107
  // payload bodies stay on roleOutcome — never rewritten into a sole identity reason.
118
- if (courtDiaristEscalated(roleOutcome)) {
108
+ if (latestPayloadEscalated(roleOutcome)) {
119
109
  return {
120
110
  identity: {
121
111
  kind: "escalate",
@@ -598,9 +598,10 @@ export async function runPublicInstructionSeat(argv, env, io, role, parseArgv) {
598
598
  thrown: new Error(outcome.failedWithoutEscalate.diagnostic),
599
599
  }, seatAdapters(admitted, env), env.principalAuthority, io);
600
600
  }
601
+ // The diarist's escalation pauses only the diarist's own run; call order
602
+ // belongs to the caller, so the Secretariat still takes its own turn.
601
603
  if (outcome.identity.kind === "escalate" && outcome.terminal !== undefined) {
602
604
  io.stdout(formatTerminalResult(outcome.terminal));
603
- return { exitCode: 0, admitted, terminal: outcome.terminal };
604
605
  }
605
606
  }
606
607
  return dispatchAdmitted(admitted, env, io);
@@ -25077,12 +25077,6 @@ function latestPayloadEscalated(roleOutcome) {
25077
25077
  const payloads = roleOutcome.payloads ?? [];
25078
25078
  return isEscalatePayload(payloads[payloads.length - 1]);
25079
25079
  }
25080
- function courtDiaristEscalated(roleOutcome) {
25081
- if (roleOutcome === void 0) return false;
25082
- if (roleOutcome.kind === "audit_escalation") return true;
25083
- if (roleOutcome.kind !== "accepted") return false;
25084
- return (roleOutcome.payloads ?? []).some(isEscalatePayload);
25085
- }
25086
25080
  async function invokeCourtDiarist(input, env, io) {
25087
25081
  const quietIo = {
25088
25082
  stdout() {
@@ -25115,7 +25109,7 @@ async function invokeCourtDiarist(input, env, io) {
25115
25109
  });
25116
25110
  const roleOutcome = result.terminal?.roleOutcome;
25117
25111
  const submissions = result.terminal?.submissions;
25118
- if (courtDiaristEscalated(roleOutcome)) {
25112
+ if (latestPayloadEscalated(roleOutcome)) {
25119
25113
  return {
25120
25114
  identity: {
25121
25115
  kind: "escalate",
@@ -25678,7 +25672,6 @@ async function runPublicInstructionSeat(argv2, env, io, role, parseArgv2) {
25678
25672
  }
25679
25673
  if (outcome.identity.kind === "escalate" && outcome.terminal !== void 0) {
25680
25674
  io.stdout(formatTerminalResult(outcome.terminal));
25681
- return { exitCode: 0, admitted, terminal: outcome.terminal };
25682
25675
  }
25683
25676
  }
25684
25677
  return dispatchAdmitted(admitted, env, io);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.5318",
3
+ "version": "0.1.5323",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -75,8 +75,8 @@
75
75
  }
76
76
  },
77
77
  "devDependencies": {
78
- "@earendil-works/pi-ai": "0.87.1",
79
- "@earendil-works/pi-coding-agent": "0.87.1",
78
+ "@earendil-works/pi-ai": "0.99.1",
79
+ "@earendil-works/pi-coding-agent": "0.99.1",
80
80
  "@types/node": "latest",
81
81
  "esbuild": "^0.28.1",
82
82
  "tsx": "latest",
@@ -131,16 +131,6 @@ export function latestPayloadEscalated(
131
131
  return isEscalatePayload(payloads[payloads.length - 1]);
132
132
  }
133
133
 
134
- /** Routing boolean over the child's own typed sequence — does not pick or rewrite a sole row. */
135
- export function courtDiaristEscalated(
136
- roleOutcome: TerminalRoleOutcome | undefined,
137
- ): boolean {
138
- if (roleOutcome === undefined) return false;
139
- if (roleOutcome.kind === "audit_escalation") return true;
140
- if (roleOutcome.kind !== "accepted") return false;
141
- return (roleOutcome.payloads ?? []).some(isEscalatePayload);
142
- }
143
-
144
134
  /**
145
135
  * Invoke public 起居郎 under the court-pipeline quiet face.
146
136
  * Returns escalate or unbound; the secretariat needs no ticket handoff.
@@ -198,7 +188,7 @@ export async function invokeCourtDiarist(
198
188
  const submissions = result.terminal?.submissions;
199
189
  // Escalate routing is a boolean over the preserved sequence (#881). Reasons and
200
190
  // payload bodies stay on roleOutcome — never rewritten into a sole identity reason.
201
- if (courtDiaristEscalated(roleOutcome)) {
191
+ if (latestPayloadEscalated(roleOutcome)) {
202
192
  return {
203
193
  identity: {
204
194
  kind: "escalate",
@@ -773,9 +773,10 @@ export async function runPublicInstructionSeat(
773
773
  thrown: new Error(outcome.failedWithoutEscalate.diagnostic),
774
774
  }, seatAdapters(admitted, env), env.principalAuthority, io) as SeatRunResult;
775
775
  }
776
+ // The diarist's escalation pauses only the diarist's own run; call order
777
+ // belongs to the caller, so the Secretariat still takes its own turn.
776
778
  if (outcome.identity.kind === "escalate" && outcome.terminal !== undefined) {
777
779
  io.stdout(formatTerminalResult(outcome.terminal));
778
- return { exitCode: 0, admitted, terminal: outcome.terminal };
779
780
  }
780
781
  }
781
782
  return dispatchAdmitted(admitted, env, io);