@akagilnc/pi-workflow-roles 0.1.4673 → 0.1.4698

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.
@@ -1,5 +1,6 @@
1
1
  import { auditorRunDirectory } from "./auditor-dossier-tool.js";
2
2
  import { OFFICER_CONCLUSION_REASK } from "./gatekeeper-role.js";
3
+ import { coalesceSubmissionRows } from "./public-cli/terminal.js";
3
4
  const AUDITOR_DOSSIER_PROMPT = "\u5377\u5B97\u6307\u9488\uFF1A";
4
5
  const COMPLIANCE_RESPONSE_ENTRY_TYPE = "ak_compliance_response";
5
6
  const AUDITOR_PARENT_ATTEMPT_BINDING_ENTRY_TYPE = "ak_auditor_parent_attempt_binding";
@@ -63,7 +64,7 @@ async function projectAuditorTerminal(summoned) {
63
64
  };
64
65
  }
65
66
  if (outcome.kind === "failure") {
66
- const rows = outcome.payloads ?? summoned.terminal?.submissions ?? [];
67
+ const rows = summoned.terminal?.submissions ?? [];
67
68
  return {
68
69
  status: "transport_failure",
69
70
  diagnostic: outcome.diagnostic,
@@ -73,7 +74,10 @@ async function projectAuditorTerminal(summoned) {
73
74
  };
74
75
  }
75
76
  if (outcome.kind === "accepted") {
76
- const rows = outcome.payloads ?? summoned.terminal?.submissions ?? [];
77
+ const rows = coalesceSubmissionRows(
78
+ outcome.payloads,
79
+ summoned.terminal?.submissions
80
+ );
77
81
  if (rows.length === 0) {
78
82
  return readComplianceCandidate({}, usage);
79
83
  }
@@ -124,21 +124,20 @@ function projectOfficerDecision(officer, decision, fallbackStatus) {
124
124
  */
125
125
  function thisCourtOfficerPayloads(terminal) {
126
126
  const outcome = terminal?.roleOutcome;
127
+ // This-court identity only from accepted/audit_escalation settlement payloads
128
+ // (#879). Failure history is not this-court (#953) — it rides submissions.
127
129
  if (outcome !== undefined && (outcome.kind === "accepted" || outcome.kind === "audit_escalation")) {
128
130
  if (outcome.payloads !== undefined && outcome.payloads.length > 0)
129
131
  return outcome.payloads;
130
132
  }
131
- if (outcome?.kind === "failure" && outcome.payloads !== undefined && outcome.payloads.length > 0) {
132
- return outcome.payloads;
133
- }
134
133
  // No sole-row identity guess: undivided submissions are not this-court (#879).
135
134
  return [];
136
135
  }
137
- /** Failure/transport channel may still surface every recorded payload beside the failure (#836 A.3). */
136
+ /**
137
+ * Failure/transport channel surfaces recorded history beside the failure
138
+ * (#836 A.3) via the historical carrier only (#953 — not failure.payloads).
139
+ */
138
140
  function officerFailurePayloads(terminal) {
139
- const outcome = terminal?.roleOutcome;
140
- if (outcome?.kind === "failure")
141
- return outcome.payloads ?? terminal?.submissions ?? [];
142
141
  return terminal?.submissions ?? [];
143
142
  }
144
143
  function projectOfficerPayloads(officer, payloads, fallbackStatus) {