@akagilnc/pi-workflow-roles 0.1.3685 → 0.1.3702

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.
Files changed (54) hide show
  1. package/dist/acp-host/production-host.js +499 -559
  2. package/dist/analyst-gate-cycles-read.js +11 -1
  3. package/dist/archivist-record-entry.js +1 -1
  4. package/dist/auditor-dossier-tool.js +12 -0
  5. package/dist/dossier-resolution.js +0 -35
  6. package/dist/gatekeeper-pass-envelope.js +39 -34
  7. package/dist/gatekeeper-role.js +70 -77
  8. package/dist/judge-auditor.js +5 -24
  9. package/dist/judge-role.js +39 -42
  10. package/dist/notary-contracts.js +2 -17
  11. package/dist/notary-role.js +3 -6
  12. package/dist/package-contracts/judge-output.js +0 -2
  13. package/dist/package-contracts/terminating-tools.js +2 -2
  14. package/dist/public-cli/inspector-run.js +16 -2
  15. package/dist/public-cli/instruction-seat-run.js +14 -2
  16. package/dist/public-cli/main.js +189 -214
  17. package/dist/public-cli/notary-run.js +23 -20
  18. package/dist/public-cli/post-admission.js +30 -23
  19. package/dist/public-cli/run-lifecycle.js +6 -14
  20. package/dist/public-role-summons.js +38 -11
  21. package/dist/role-runtime.js +28 -3
  22. package/dist/submission-correctable-error.js +2 -1
  23. package/dist/submission-errors.js +26 -11
  24. package/dist/submission-ledger.js +7 -23
  25. package/extensions/role-runtime.ts +0 -2
  26. package/package.json +1 -1
  27. package/souls/countersign.md +12 -11
  28. package/souls/notary.md +5 -0
  29. package/src/acp-host/production-host.ts +1 -4
  30. package/src/acp-host/role-envelope.ts +1 -1
  31. package/src/analyst-gate-cycles-read.ts +10 -1
  32. package/src/archivist-record-entry.ts +7 -3
  33. package/src/auditor-dossier-tool.ts +21 -0
  34. package/src/dossier-resolution.ts +0 -39
  35. package/src/gatekeeper-pass-envelope.ts +59 -43
  36. package/src/gatekeeper-role.ts +114 -113
  37. package/src/host-contracts.ts +3 -3
  38. package/src/judge-auditor.ts +5 -43
  39. package/src/judge-role.ts +41 -54
  40. package/src/notary-contracts.ts +8 -27
  41. package/src/notary-role.ts +2 -7
  42. package/src/package-contracts/judge-output.ts +0 -1
  43. package/src/package-contracts/terminating-tools.ts +2 -2
  44. package/src/public-cli/inspector-run.ts +32 -2
  45. package/src/public-cli/instruction-seat-run.ts +30 -2
  46. package/src/public-cli/notary-run.ts +48 -16
  47. package/src/public-cli/post-admission.ts +31 -37
  48. package/src/public-cli/run-lifecycle.ts +6 -17
  49. package/src/public-role-summons.ts +76 -12
  50. package/src/role-runtime.ts +34 -9
  51. package/src/submission-correctable-error.ts +2 -0
  52. package/src/submission-errors.ts +28 -11
  53. package/src/submission-ledger.ts +8 -32
  54. package/dist/shape-unreadable-failure.js +0 -34
@@ -1,6 +1,5 @@
1
1
  const JUDGE_OUTPUT_TOOL_NAME = "ak_judge_output";
2
2
  const JUDGE_ACCEPTED_TEXT = "\u5927\u7406\u5BFA\u56DE\u6267\u5DF2\u63A5\u53D7";
3
- const JUDGE_ACCEPTED_AUDIT_NO_RECEIPT_TEXT = "\u5927\u7406\u5BFA\u56DE\u6267\u5DF2\u63A5\u53D7\uFF1B\u5BA1\u8BA1\u65E0\u56DE\u6267";
4
3
  function validateAcceptedJudgeDetails(verdict) {
5
4
  if (verdict === null || typeof verdict !== "object" || Array.isArray(verdict)) throw new Error("Judge verdict has no execution discriminator");
6
5
  let judgeStatus;
@@ -18,7 +17,6 @@ function validateAcceptedJudgeDetails(verdict) {
18
17
  throw new Error("Judge verdict has no execution discriminator");
19
18
  }
20
19
  export {
21
- JUDGE_ACCEPTED_AUDIT_NO_RECEIPT_TEXT,
22
20
  JUDGE_ACCEPTED_TEXT,
23
21
  JUDGE_OUTPUT_TOOL_NAME,
24
22
  validateAcceptedJudgeDetails
@@ -116,10 +116,10 @@ export function validateAcceptedDetails(toolName, details) {
116
116
  [COLLECTOR_OUTPUT_TOOL]: [],
117
117
  [DOCTOR_OUTPUT_TOOL_NAME]: ["completed", "refused"],
118
118
  [MERGER_OUTPUT_TOOL_NAME]: ["completed", "escalate"],
119
- [NOTARY_OUTPUT_TOOL_NAME]: ["pass", "bounce"],
119
+ [NOTARY_OUTPUT_TOOL_NAME]: ["pass", "bounce", "escalate"],
120
120
  [COUNTERSIGN_OUTPUT_TOOL_NAME]: ["converged", "continue", "escalate"],
121
121
  [GLEANER_LEFT_OUTPUT_TOOL_NAME]: ["completed"],
122
- [INSPECTOR_OUTPUT_TOOL_NAME]: ["pass", "bounce"],
122
+ [INSPECTOR_OUTPUT_TOOL_NAME]: ["pass", "bounce", "escalate"],
123
123
  [GATEKEEPER_OUTPUT_TOOL_NAME]: ["dispatch", "pass"],
124
124
  [NAVIGATOR_OUTPUT_TOOL_NAME]: ["advice"],
125
125
  [AUDITOR_OUTPUT_TOOL_NAME]: ["pass", "bounce", "escalate"],
@@ -30,11 +30,18 @@ export async function runPublicInspector(argv, env, io, parseInspectorArgv) {
30
30
  // #771: no mechanical ticket match against instruction text; parent-run path only.
31
31
  // No bare catch→fresh: lookup/resume failures surface; only true absence mints new.
32
32
  const projectRoot = parsed.project ?? env.cwd;
33
+ // #747: parentRunPath is the pure 卷宗指针 path only — never reask/materials text.
34
+ // #753: gate re-ask / new-submission pointers ride summons.instruction on resume.
33
35
  const parentRunPath = parentRunPathFromGatePointerInstruction(parsed.instruction);
34
36
  if (parentRunPath !== undefined) {
37
+ const resumeInstruction = env.reviewReask ?? env.gateReviewInstruction;
35
38
  const summons = {
36
- instruction: parsed.instruction,
37
- instructionEmpty: parsed.instruction.trim() === "",
39
+ ...(resumeInstruction === undefined
40
+ ? {
41
+ instruction: parsed.instruction,
42
+ instructionEmpty: parsed.instruction.trim() === "",
43
+ }
44
+ : { instruction: resumeInstruction, instructionEmpty: false }),
38
45
  attachmentPaths: parsed.attachmentPaths,
39
46
  };
40
47
  const resumed = await tryResumeSameTicketSeatRun({
@@ -48,6 +55,13 @@ export async function runPublicInspector(argv, env, io, parseInspectorArgv) {
48
55
  });
49
56
  if (resumed !== undefined)
50
57
  return resumed;
58
+ // Reask without a prior same-parent run cannot deliver the plain-language ask
59
+ // on a fresh mint without inventing a second prompt path — fail loud (#753).
60
+ // gateReviewInstruction alone is resume-only; fresh mint keeps argv 卷宗指针.
61
+ if (env.reviewReask !== undefined) {
62
+ presentStructuralRejection(new CliUsageError("inspector review reask requires a prior same-parent run to resume"), io);
63
+ return { exitCode: 2 };
64
+ }
51
65
  }
52
66
  let admitted;
53
67
  try {
@@ -150,9 +150,15 @@ export async function runPublicInstructionSeat(argv, env, io, role, parseArgv) {
150
150
  return { exitCode: 2 };
151
151
  }
152
152
  }
153
+ // #756: auditor reask / new-submission pointers ride summons.instruction on resume.
154
+ const resumeInstruction = env.reviewReask ?? env.gateReviewInstruction;
153
155
  const summons = {
154
- instruction: parsed.instruction,
155
- instructionEmpty: parsed.instruction.trim() === "",
156
+ ...(resumeInstruction === undefined
157
+ ? {
158
+ instruction: parsed.instruction,
159
+ instructionEmpty: parsed.instruction.trim() === "",
160
+ }
161
+ : { instruction: resumeInstruction, instructionEmpty: false }),
156
162
  attachmentPaths: parsed.attachmentPaths,
157
163
  };
158
164
  if (role === "auditor" && auditorSourceRun !== undefined) {
@@ -171,6 +177,12 @@ export async function runPublicInstructionSeat(argv, env, io, role, parseArgv) {
171
177
  });
172
178
  if (resumed !== undefined)
173
179
  return resumed;
180
+ // Reask without a prior same-parent run cannot deliver the plain-language ask
181
+ // on a fresh mint without inventing a second prompt path — fail loud (#753 / #756).
182
+ if (env.reviewReask !== undefined) {
183
+ presentStructuralRejection(new CliUsageError("auditor review reask requires a prior same-parent run to resume"), io);
184
+ return { exitCode: 2 };
185
+ }
174
186
  }
175
187
  let admitted;
176
188
  try {