@akagilnc/pi-workflow-roles 0.1.5941 → 0.1.5949

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,39 +1,23 @@
1
1
  import { Type } from "typebox";
2
2
  const INFRASTRUCTURE_FAILURE_DECLARATION_KEY = "infrastructureFailure";
3
- const INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic";
4
- const infrastructureFailureNested = Type.Object(
5
- {
6
- [INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: Type.Unknown({
7
- description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
8
- })
9
- },
10
- {
11
- additionalProperties: true,
12
- description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
13
- }
14
- );
15
- infrastructureFailureNested.required = [];
16
- const infrastructureFailureDeclarationSchema = Type.Object(
17
- {
18
- [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureNested
19
- },
20
- { additionalProperties: true }
21
- );
3
+ const infrastructureFailureField = Type.Unknown({
4
+ description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u586B {diagnostic}\uFF1B\u6CA1\u6709\u5C31\u586B null"
5
+ });
22
6
  function withTerminatingOutputDeclarations(schema) {
23
7
  const baseProperties = schema.properties;
24
8
  const properties = {
25
9
  ...baseProperties ?? {},
26
10
  ...baseProperties?.ticketNumber === void 0 ? {
27
11
  ticketNumber: Type.Unknown({
28
- description: "\u53EF\u9009\u672C\u7968\u53F7\u3002\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\uFF08\u6B63\u6574\u6570\u3001\u6570\u5B57\u4E32\u6216\u524D\u5BFC #N\uFF1B\u5F52\u4F4D\u53EA\u8BFB\u672C\u5B57\u6BB5\uFF09\u3002"
12
+ description: "\u4EC5\u5C1A\u672A\u7ED1\u5B9A\u65F6\u586B\u672C\u7968\u53F7\uFF08\u6B63\u6574\u6570\u3001\u6570\u5B57\u4E32\u6216\u524D\u5BFC #N\uFF1B\u5F52\u4F4D\u53EA\u8BFB\u672C\u5B57\u6BB5\uFF09\uFF1B\u6CA1\u6709\u5C31\u586B null"
29
13
  })
30
14
  } : {},
31
15
  ...baseProperties?.summary === void 0 ? {
32
16
  summary: Type.Unknown({
33
- description: "\u672C\u5E2D\u81EA\u884C\u586B\u5199\u7684\u4E00\u4E24\u53E5\u300120\u201350 \u5B57\u7ED3\u8BBA\u6458\u8981\u3002\u53EF\u9009\uFF1B\u4E0D\u56E0\u7F3A\u5931\u6216\u8D85\u957F\u62D2\u6536\u3001\u622A\u65AD\u6216\u4EE3\u586B\u3002"
17
+ description: "\u4EC5\u672C\u5E2D\u6709\u7ED3\u8BBA\u65F6\u586B\u4E00\u4E24\u53E5\u300120\u201350 \u5B57\u7ED3\u8BBA\u6458\u8981\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002\u4E0D\u56E0\u7F3A\u5931\u6216\u8D85\u957F\u62D2\u6536\u3001\u622A\u65AD\u6216\u4EE3\u586B\u3002"
34
18
  })
35
19
  } : {},
36
- [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
20
+ [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureField
37
21
  };
38
22
  const object = Type.Object(properties, { additionalProperties: true });
39
23
  const incoming = schema.required;
@@ -43,6 +27,5 @@ function withTerminatingOutputDeclarations(schema) {
43
27
  }
44
28
  export {
45
29
  INFRASTRUCTURE_FAILURE_DECLARATION_KEY,
46
- INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY,
47
30
  withTerminatingOutputDeclarations
48
31
  };
@@ -703,7 +703,8 @@ async function runOmittedLensBatch(argv, parsed, env, io) {
703
703
  }
704
704
  /**
705
705
  * One same-parent lookup. Seat branches still build their own summons.
706
- * A found child resumes that child; no prior run returns undefined so the caller mints.
706
+ * A found child resumes that child. No prior run, explicit new, or a typed
707
+ * session-id-missing resume (失败照记,记完再起新) returns undefined so the caller mints.
707
708
  */
708
709
  function resumeSameParentInstructionSeat(input) {
709
710
  return tryResumeSameTicketSeatRun({
@@ -9113,15 +9113,15 @@ function withTerminatingOutputDeclarations(schema) {
9113
9113
  ...baseProperties ?? {},
9114
9114
  ...baseProperties?.ticketNumber === void 0 ? {
9115
9115
  ticketNumber: typebox_exports.Unknown({
9116
- description: "\u53EF\u9009\u672C\u7968\u53F7\u3002\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\uFF08\u6B63\u6574\u6570\u3001\u6570\u5B57\u4E32\u6216\u524D\u5BFC #N\uFF1B\u5F52\u4F4D\u53EA\u8BFB\u672C\u5B57\u6BB5\uFF09\u3002"
9116
+ description: "\u4EC5\u5C1A\u672A\u7ED1\u5B9A\u65F6\u586B\u672C\u7968\u53F7\uFF08\u6B63\u6574\u6570\u3001\u6570\u5B57\u4E32\u6216\u524D\u5BFC #N\uFF1B\u5F52\u4F4D\u53EA\u8BFB\u672C\u5B57\u6BB5\uFF09\uFF1B\u6CA1\u6709\u5C31\u586B null"
9117
9117
  })
9118
9118
  } : {},
9119
9119
  ...baseProperties?.summary === void 0 ? {
9120
9120
  summary: typebox_exports.Unknown({
9121
- description: "\u672C\u5E2D\u81EA\u884C\u586B\u5199\u7684\u4E00\u4E24\u53E5\u300120\u201350 \u5B57\u7ED3\u8BBA\u6458\u8981\u3002\u53EF\u9009\uFF1B\u4E0D\u56E0\u7F3A\u5931\u6216\u8D85\u957F\u62D2\u6536\u3001\u622A\u65AD\u6216\u4EE3\u586B\u3002"
9121
+ description: "\u4EC5\u672C\u5E2D\u6709\u7ED3\u8BBA\u65F6\u586B\u4E00\u4E24\u53E5\u300120\u201350 \u5B57\u7ED3\u8BBA\u6458\u8981\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002\u4E0D\u56E0\u7F3A\u5931\u6216\u8D85\u957F\u62D2\u6536\u3001\u622A\u65AD\u6216\u4EE3\u586B\u3002"
9122
9122
  })
9123
9123
  } : {},
9124
- [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
9124
+ [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureField
9125
9125
  };
9126
9126
  const object = typebox_exports.Object(properties, { additionalProperties: true });
9127
9127
  const incoming = schema.required;
@@ -9129,31 +9129,15 @@ function withTerminatingOutputDeclarations(schema) {
9129
9129
  object.required = preserved;
9130
9130
  return object;
9131
9131
  }
9132
- var INFRASTRUCTURE_FAILURE_DECLARATION_KEY, INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY, infrastructureFailureNested, infrastructureFailureDeclarationSchema;
9132
+ var INFRASTRUCTURE_FAILURE_DECLARATION_KEY, infrastructureFailureField;
9133
9133
  var init_terminating_infrastructure = __esm({
9134
9134
  "src/package-contracts/terminating-infrastructure.ts"() {
9135
9135
  "use strict";
9136
9136
  init_build();
9137
9137
  INFRASTRUCTURE_FAILURE_DECLARATION_KEY = "infrastructureFailure";
9138
- INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic";
9139
- infrastructureFailureNested = typebox_exports.Object(
9140
- {
9141
- [INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: typebox_exports.Unknown({
9142
- description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
9143
- })
9144
- },
9145
- {
9146
- additionalProperties: true,
9147
- description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
9148
- }
9149
- );
9150
- infrastructureFailureNested.required = [];
9151
- infrastructureFailureDeclarationSchema = typebox_exports.Object(
9152
- {
9153
- [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureNested
9154
- },
9155
- { additionalProperties: true }
9156
- );
9138
+ infrastructureFailureField = typebox_exports.Unknown({
9139
+ description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u586B {diagnostic}\uFF1B\u6CA1\u6709\u5C31\u586B null"
9140
+ });
9157
9141
  }
9158
9142
  });
9159
9143
 
@@ -9173,10 +9157,10 @@ var init_gatekeeper_output = __esm({
9173
9157
  description: "dispatch | pass"
9174
9158
  }),
9175
9159
  officer: typebox_exports.Unknown({
9176
- description: "status \u4E3A dispatch \u65F6\u4E3A inspector | notary"
9160
+ description: "\u4EC5 status \u4E3A dispatch \u65F6\u586B inspector | notary\uFF1B\u6CA1\u6709\u5C31\u586B null"
9177
9161
  }),
9178
9162
  findings: typebox_exports.Unknown({
9179
- description: "status \u4E3A pass \u65F6\u53EF\u9009 string[] findings"
9163
+ description: "\u4EC5 status \u4E3A pass \u65F6\u586B string[] findings\uFF1B\u6CA1\u6709\u5C31\u586B null"
9180
9164
  })
9181
9165
  })
9182
9166
  );
@@ -9198,13 +9182,13 @@ var init_navigator_output = __esm({
9198
9182
  NAVIGATOR_OUTPUT_TOOL_NAME = "ak_navigator_output";
9199
9183
  navigatorAdviceFields = {
9200
9184
  prose: typebox_exports.Unknown({
9201
- description: "\u5355\u6761\u6563\u6587\u5EFA\u8BAE\u3002\u65E0\u72B6\u6001\u5206\u53C9\u65F6\u4F7F\u7528\uFF1B\u539F\u6837\u5448\u73B0\u3002"
9185
+ description: "\u4EC5\u65E0\u72B6\u6001\u5206\u53C9\u65F6\u586B\u5355\u6761\u6563\u6587\u5EFA\u8BAE\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002\u539F\u6837\u5448\u73B0\u3002"
9202
9186
  }),
9203
9187
  byStatus: typebox_exports.Unknown({
9204
9188
  description: "\u6309\u4E3B\u8859\u95E8\u7ED3\u5C40 status \u9884\u5199\u7684\u6563\u6587\u5EFA\u8BAE\u3002\u952E\u4E3A status \u5B57\u9762\u91CF\uFF0C\u503C\u4E3A\u5EFA\u8BAE\u6B63\u6587\u3002\u7ED3\u7B97\u65F6\u4EE3\u7801\u53EA\u6309\u5B9E\u9645 status \u53D6\u5BF9\u5E94\u539F\u6587\uFF0C\u4E0D\u89E3\u6790\u5EFA\u8BAE\u8BED\u4E49\u3002"
9205
9189
  }),
9206
9190
  byRole: typebox_exports.Unknown({
9207
- description: "\u6574\u5F20\u8DEF\u7EBF\u8868\uFF1A\u952E\u4E3A\u8859\u95E8\u89D2\u8272\uFF0C\u503C\u4E3A\u8BE5\u8859\u95E8 status \u2192 \u5EFA\u8BAE\u3002\u76F4\u63A5\u5165\u53E3\u4E0D\u7ED9\u89D2\u8272\u65F6\u4F7F\u7528\u3002"
9191
+ description: "\u4EC5\u76F4\u63A5\u5165\u53E3\u4E0D\u7ED9\u89D2\u8272\u65F6\u586B\u6574\u5F20\u8DEF\u7EBF\u8868\uFF08\u952E\u4E3A\u8859\u95E8\u89D2\u8272\uFF0C\u503C\u4E3A\u8BE5\u8859\u95E8 status \u2192 \u5EFA\u8BAE\uFF09\uFF1B\u6CA1\u6709\u5C31\u586B null"
9208
9192
  })
9209
9193
  };
9210
9194
  navigatorAdviceBodySchema = openToolObject(typebox_exports.Object(navigatorAdviceFields));
@@ -9237,7 +9221,7 @@ var init_review_submission = __esm({
9237
9221
  reason: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u4E0A\u5448\u7406\u7531" })),
9238
9222
  violations: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u8FDD\u89C4\u6761\u76EE" })),
9239
9223
  conflicts: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u5F85\u51B3\u51B2\u7A81" })),
9240
- fix: typebox_exports.Optional(typebox_exports.Unknown({ description: "continue \u65F6\u7684\u8865\u6551\u8BF4\u660E\uFF1B\u53EF\u5199 summary \u6458\u8981\uFF0C\u5176\u4F59\u5185\u5BB9\u539F\u6837\u7559\u5B58" })),
9224
+ fix: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u4EC5 continue \u65F6\u586B\u8865\u6551\u8BF4\u660E\uFF08\u53EF\u5199 summary \u6458\u8981\uFF0C\u5176\u4F59\u5185\u5BB9\u539F\u6837\u7559\u5B58\uFF09\uFF1B\u6CA1\u6709\u5C31\u586B null" })),
9241
9225
  classes: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u5DF2\u88C1\u51B3 finding \u7C7B\uFF1B\u53EF\u8BF4\u660E name\u3001owner\u3001boundary\u3001disposition\uFF0C\u539F\u6837\u7559\u5B58" })),
9242
9226
  note: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u88C1\u51B3\u9644\u6CE8" })),
9243
9227
  evidence: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u7559\u5B58\u8BC1\u636E" })),
@@ -9328,7 +9312,7 @@ var init_reviewer_output = __esm({
9328
9312
  init_open_tool_schema();
9329
9313
  init_terminating_infrastructure();
9330
9314
  REVIEWER_OUTPUT_TOOL_NAME = "ak_reviewer_output";
9331
- REVIEWER_AMENDMENTS_DESCRIPTION = "\u5DF2\u8FD0\u884C lens \u7684 amendments \u627F\u8F7D candidates\u3001\u9010\u6761\u5904\u7F6E\u4E0E verdict \u7684\u5B8C\u6574\u62A5\u544A\uFF08\u975E\u4EC5 verdict \u884C\uFF09\uFF1B\u663E\u5F0F\u5355\u8F74\u65F6\u53E6\u4E00\u8F74\u53EF\u7701\u7565\uFF08completeness / correctness\uFF09\u3002hard-stop\uFF0Fusage error \u4E3A refused \u65F6\uFF0C\u5DF2\u4EA7\u51FA\u62A5\u544A\u4ECD\u7167\u5F55\u5BF9\u5E94 lens \u5B57\u6BB5\u3002";
9315
+ REVIEWER_AMENDMENTS_DESCRIPTION = "\u5DF2\u8FD0\u884C lens \u7684 amendments \u627F\u8F7D candidates\u3001\u9010\u6761\u5904\u7F6E\u4E0E verdict \u7684\u5B8C\u6574\u62A5\u544A\uFF08\u975E\u4EC5 verdict \u884C\uFF09\uFF1B\u5404\u8F74\uFF08completeness / correctness\uFF09\u4EC5\u6709\u5DF2\u4EA7\u51FA\u62A5\u544A\u65F6\u586B\u62A5\u544A\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002hard-stop\uFF0Fusage error \u4E3A refused \u65F6\uFF0C\u5DF2\u4EA7\u51FA\u62A5\u544A\u4ECD\u7167\u5F55\u5BF9\u5E94 lens \u5B57\u6BB5\u3002";
9332
9316
  REVIEWER_STATUS_DESCRIPTION = "completed | refused\u3002\u4E24\u79CD\u6B63\u5E38 lens verdict\uFF08completeness / correctness\uFF09\u5747 completed\uFF1Bhard-stop \u4E0E usage error \u4E3A refused\uFF08\u5DF2\u4EA7\u51FA\u62A5\u544A\u4ECD\u7167\u5F55\u8FDB\u6240\u9009 lens amendments\uFF09\u3002";
9333
9317
  reviewerOutputObject = typebox_exports.Object({
9334
9318
  status: typebox_exports.Unknown({ description: REVIEWER_STATUS_DESCRIPTION }),
@@ -9384,7 +9368,7 @@ var init_fixer_output = __esm({
9384
9368
  }),
9385
9369
  diffItems: diffItemsField,
9386
9370
  testEvidence: typebox_exports.Unknown({
9387
- description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002\u53EF\u5199 contract\uFF08\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6\uFF09\u3001minimumNecessaryCost\uFF08\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C\uFF09\u3001measuredDuration\uFF08\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F\uFF09\u3002"
9371
+ description: "\u4EC5 diff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u586B\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002\u673A\u5668\u4E0D\u6838\u9A8C\u3002\u53EF\u5199 contract\uFF08\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6\uFF09\u3001minimumNecessaryCost\uFF08\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C\uFF09\u3001measuredDuration\uFF08\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F\uFF09\u3002"
9388
9372
  })
9389
9373
  });
9390
9374
  fixerOutputSchema = withTerminatingOutputDeclarations(
@@ -9456,7 +9440,7 @@ var init_doctor_contracts = __esm({
9456
9440
  description: `\u9010\u6761\u8D44\u4EA7\u89C2\u5BDF\u4E0E\u5904\u65B9\uFF0C\u539F\u6837\u7559\u5B58\u3002\u4E00\u6761\u53EF\u542B targetKey\u3001targetKind\uFF08${DOCTOR_TARGET_KINDS.join(" | ")}\uFF09\u3001observation\u3001evidenceIds\u3001disposition\uFF08${DOCTOR_DISPOSITIONS.join(" | ")}\uFF09\u3001assetEvidence\uFF08targetKey\u3001targetKind\u3001evidenceId\uFF09\u3001guardrails\uFF08reproducibleFailure\u3001owningSeamOrInvariant\u3001deletionOrSimplificationSuffices\uFF0C\u5404\u9879\u53EF\u542B answer\u3001evidenceIds\u3001explanation\uFF09\u3001prescription\uFF08kind \u4E3A ${DOCTOR_PRESCRIPTION_KINDS.join(" | ")}\uFF0C\u53E6\u53EF\u5199 recommendation\u3001necessityExplanation\uFF09\u3001lastRealBite\uFF08kind \u4E3A ${DOCTOR_BITE_KINDS.join(" | ")}\uFF0C\u53E6\u53EF\u5199 targetKey\u3001evidenceId\u3001eligibleEvidenceIds\uFF09\u3002\u4E0D\u8981\u6C42\u4EFB\u4F55\u5904\u65B9\u6216\u53EF\u590D\u7528 finding\uFF1B\u7F3A\u53EF\u590D\u7528\u8D44\u4EA7\u6216 bounded-bite \u8BC1\u636E\u53EA\u6392\u9664\u5BF9\u5E94\u8D44\u4EA7\u5904\u65B9\u3002\u673A\u5668\u4E0D\u6838\u9A8C\u3002`
9457
9441
  }),
9458
9442
  reason: typebox_exports.Unknown({
9459
- description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u8BC1\u8BCD\u7684\u539F\u56E0\uFF1B\u4EC5 refused \u65F6\u7528\u3002"
9443
+ description: "\u4EC5 refused \u65F6\u586B\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u8BC1\u8BCD\u7684\u539F\u56E0\uFF1B\u6CA1\u6709\u5C31\u586B null"
9460
9444
  }),
9461
9445
  missingEvidence: typebox_exports.Unknown({
9462
9446
  description: "\u5982\u5B9E\u8BC1\u8BCD\u6240\u9700\u800C\u5C1A\u7F3A\u7684\u8BC1\u636E\uFF0C\u539F\u6837\u7559\u5B58\uFF08\u5982\u6BCF\u9879 need\u3001targetKeys\uFF09\u3002"
@@ -9660,15 +9644,17 @@ var init_diarist_contracts = __esm({
9660
9644
  }),
9661
9645
  ticketNumber: typebox_exports.Optional(
9662
9646
  typebox_exports.Unknown({
9663
- description: "\u672C\u5EAD\u5BF9\u8C61\u7968\u53F7\uFF08\u6B63\u6574\u6570\uFF09\u6216 null/\u7701\u7565\uFF1D\u771F\u65E0\u7968\uFF1B\u4E0B\u6E38\u8D70 typed \u952E\uFF1B\u8BA4\u4E0D\u51FA\u7528 status=escalate\uFF0C\u4E0D\u6D17\u6210\u65E0\u5F55\u3002\u673A\u68B0\u5C42\u4E0D\u91CD\u5224\u3002"
9647
+ description: "\u4EC5\u6709\u672C\u5EAD\u5BF9\u8C61\u65F6\u586B\u7968\u53F7\uFF08\u6B63\u6574\u6570\uFF09\uFF1B\u6CA1\u6709\u5C31\u586B null\uFF1D\u771F\u65E0\u7968\uFF1B\u4E0B\u6E38\u8D70 typed \u952E\uFF1B\u8BA4\u4E0D\u51FA\u7528 status=escalate\uFF0C\u4E0D\u6D17\u6210\u65E0\u5F55\u3002\u673A\u68B0\u5C42\u4E0D\u91CD\u5224\u3002"
9664
9648
  })
9665
9649
  ),
9666
9650
  reason: typebox_exports.Unknown({
9667
- description: "status \u4E3A escalate \u65F6\uFF1A\u4E0A\u5448\u7684\u539F\u56E0"
9651
+ description: "\u4EC5 status \u4E3A escalate \u65F6\u586B\u4E0A\u5448\u7684\u539F\u56E0\uFF1B\u6CA1\u6709\u5C31\u586B null"
9668
9652
  }),
9669
- sessions: typebox_exports.Optional(typebox_exports.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
9653
+ sessions: typebox_exports.Optional(typebox_exports.Unknown({
9654
+ description: `\u4EC5\u5355\u7968\u5EAD\u65F6\u586B\u5BF9\u8BDD\u8FB9\u754C\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002${DIARIST_SESSIONS_DESCRIPTION}`
9655
+ })),
9670
9656
  ticketSessions: typebox_exports.Unknown({
9671
- description: `\u591A\u7968\u5EAD\u9010\u7968\u5BF9\u8BDD\u8FB9\u754C\uFF1B\u6BCF\u7968\u542B ticketNumber\uFF08\u672C\u6761\u8FB9\u754C\u6240\u5F52\u7968\u53F7\uFF0C\u6B63\u6574\u6570\uFF09\u4E0E sessions\uFF08${DIARIST_SESSIONS_DESCRIPTION}\uFF09\u3002\u4E00\u6B21\u4EA4\u5377\u5404\u7968\u5404\u81EA\u5206\u5F55\u3002\u4E0E\u5355\u7968 sessions \u4E8C\u9009\u4E00\u3002`
9657
+ description: `\u4EC5\u591A\u7968\u5EAD\u65F6\u586B\u9010\u7968\u5BF9\u8BDD\u8FB9\u754C\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002\u6BCF\u7968\u542B ticketNumber\uFF08\u672C\u6761\u8FB9\u754C\u6240\u5F52\u7968\u53F7\uFF0C\u6B63\u6574\u6570\uFF09\u4E0E sessions\uFF08${DIARIST_SESSIONS_DESCRIPTION}\uFF09\u3002\u4E00\u6B21\u4EA4\u5377\u5404\u7968\u5404\u81EA\u5206\u5F55\u3002`
9672
9658
  })
9673
9659
  })
9674
9660
  )
@@ -11482,7 +11468,7 @@ var init_collector_tool_schemas = __esm({
11482
11468
  description: "\u6309\u673A\u5668\u8EAB\u4EFD\u5F52\u7EC4\u7684\u51FA\u5E2D\u3001\u6750\u6599\u4E0E\u9010\u6761 findings\uFF08LLM \u81EA\u884C\u4ECE\u5BBF\u4E3B CLI \u53D6\u8BC1\u6574\u7406\uFF1B\u4EE3\u7801\u4E0D\u4EE3\u6536\u4E0D\u5F52\u5E76\uFF09\u3002"
11483
11469
  }),
11484
11470
  unfinishedReasons: typebox_exports.Unknown({
11485
- description: "\u672A\u5B8C\u6210\u539F\u56E0\uFF1B\u53D6\u8BC1\u53D7\u9650\u65F6\u5982\u5B9E\u62A5\u544A\u3002"
11471
+ description: "\u4EC5\u53D6\u8BC1\u53D7\u9650\u65F6\u586B\u672A\u5B8C\u6210\u539F\u56E0\uFF1B\u6CA1\u6709\u5C31\u586B null"
11486
11472
  })
11487
11473
  })
11488
11474
  );
@@ -19492,24 +19478,48 @@ var init_auto_resume = __esm({
19492
19478
  });
19493
19479
 
19494
19480
  // src/public-cli/seat-ticket-binding.ts
19481
+ import { join as join21 } from "node:path";
19482
+ function resumedSessionIdMissing(result, runId) {
19483
+ if (typeof result !== "object" || result === null) return false;
19484
+ const terminal = result.terminal;
19485
+ if (typeof terminal !== "object" || terminal === null) return false;
19486
+ if (terminal.runId !== runId) return false;
19487
+ const outcome = terminal.roleOutcome;
19488
+ if (typeof outcome !== "object" || outcome === null) return false;
19489
+ if (outcome.kind !== "failure") return false;
19490
+ const facts = outcome.decisiveFacts;
19491
+ if (typeof facts !== "object" || facts === null) return false;
19492
+ return facts.errorCode === SESSION_ID_MISSING;
19493
+ }
19494
+ async function writerLockBlocksFreshSummons(runDirectory) {
19495
+ const autopsy = await autopsyWriterLock(join21(runDirectory, WRITER_LOCK_FILE));
19496
+ return autopsy.verdict === "alive" || autopsy.verdict === "unknown";
19497
+ }
19495
19498
  async function tryResumeSameTicketSeatRun(input) {
19496
19499
  if (input.freshSummons === true) return void 0;
19497
19500
  if (input.parentRunPath.trim() === "") return void 0;
19501
+ const bookKey = resolveBookKeyFromGit(input.projectRoot);
19498
19502
  const previous = await findLatestRunForSeatTicket({
19499
19503
  home: input.home,
19500
- bookKey: resolveBookKeyFromGit(input.projectRoot),
19504
+ bookKey,
19501
19505
  role: input.role,
19502
19506
  parentRunPath: input.parentRunPath,
19503
19507
  ...input.ticketNumber === void 0 ? {} : { ticketNumber: input.ticketNumber }
19504
19508
  });
19505
19509
  if (previous === void 0) return void 0;
19506
- return await input.resume(previous.runId, input.summons, previous.runDirectory);
19510
+ const resumed = await input.resume(previous.runId, input.summons, previous.runDirectory);
19511
+ if (!resumedSessionIdMissing(resumed, previous.runId)) return resumed;
19512
+ const live = await resolveLiveRunDirectoryPath(previous.runDirectory, input.home, bookKey);
19513
+ if (live !== void 0 && await writerLockBlocksFreshSummons(live)) return resumed;
19514
+ return void 0;
19507
19515
  }
19516
+ var SESSION_ID_MISSING;
19508
19517
  var init_seat_ticket_binding = __esm({
19509
19518
  "src/public-cli/seat-ticket-binding.ts"() {
19510
19519
  "use strict";
19511
19520
  init_activation_ledger_git();
19512
19521
  init_run_lifecycle();
19522
+ SESSION_ID_MISSING = "session-id-missing";
19513
19523
  }
19514
19524
  });
19515
19525
 
@@ -21208,7 +21218,7 @@ __export(public_role_summons_exports, {
21208
21218
  import { execFile as execFile3 } from "node:child_process";
21209
21219
  import { existsSync as existsSync10 } from "node:fs";
21210
21220
  import { realpath as realpath5 } from "node:fs/promises";
21211
- import { join as join21 } from "node:path";
21221
+ import { join as join22 } from "node:path";
21212
21222
  import { promisify as promisify3 } from "node:util";
21213
21223
  function createCapturingIo() {
21214
21224
  const chunks = [];
@@ -21232,7 +21242,7 @@ function parentDir(path) {
21232
21242
  function walkPackageRoot(start) {
21233
21243
  let dir = start;
21234
21244
  for (let i = 0; i < 12; i += 1) {
21235
- if (existsSync10(join21(dir, "package.json")) && existsSync10(join21(dir, "souls"))) {
21245
+ if (existsSync10(join22(dir, "package.json")) && existsSync10(join22(dir, "souls"))) {
21236
21246
  return dir;
21237
21247
  }
21238
21248
  const parent = parentDir(dir);
@@ -21775,7 +21785,7 @@ var init_compliance_transport = __esm({
21775
21785
  });
21776
21786
 
21777
21787
  // src/role-run-relocation.ts
21778
- import { dirname as dirname14, join as join22 } from "node:path";
21788
+ import { dirname as dirname14, join as join23 } from "node:path";
21779
21789
  async function retainedRunPathsMatch(recordedPath, currentPath, currentRunDirectory) {
21780
21790
  if (recordedPath === currentPath) return true;
21781
21791
  if (typeof recordedPath !== "string") return false;
@@ -21821,6 +21831,7 @@ var run_lifecycle_exports = {};
21821
21831
  __export(run_lifecycle_exports, {
21822
21832
  AUTO_RESUME_LIMIT: () => AUTO_RESUME_LIMIT,
21823
21833
  RunWriterLeaseHeldError: () => RunWriterLeaseHeldError,
21834
+ WRITER_LOCK_FILE: () => WRITER_LOCK_FILE,
21824
21835
  acquireRunWriterLease: () => acquireRunWriterLease,
21825
21836
  autopsyWriterLock: () => autopsyWriterLock,
21826
21837
  clearCurrentCourt: () => clearCurrentCourt,
@@ -21843,7 +21854,7 @@ __export(run_lifecycle_exports, {
21843
21854
  });
21844
21855
  import { existsSync as existsSync11 } from "node:fs";
21845
21856
  import { chmod, lstat as lstat3, open, readdir as readdir3, readFile as readFile10, unlink } from "node:fs/promises";
21846
- import { basename as basename11, join as join23 } from "node:path";
21857
+ import { basename as basename11, join as join24 } from "node:path";
21847
21858
  async function writeRoleRunState(runDirectory, record) {
21848
21859
  const payload = { ...record, runDirectory };
21849
21860
  writeSectionSync(runDirectory, "runState", { ...payload });
@@ -22138,7 +22149,7 @@ async function createWriterLease(lockPath, runDirectory, reportCleanupFailure) {
22138
22149
  },
22139
22150
  relocate(nextRunDirectory) {
22140
22151
  currentRunDirectory = nextRunDirectory;
22141
- currentLockPath = join23(nextRunDirectory, WRITER_LOCK_FILE);
22152
+ currentLockPath = join24(nextRunDirectory, WRITER_LOCK_FILE);
22142
22153
  },
22143
22154
  async release() {
22144
22155
  if (released) return;
@@ -22177,10 +22188,10 @@ async function acquireRunWriterLease(runDirectory, onCleanupFailure) {
22177
22188
  };
22178
22189
  const reportReadFailure = (error) => {
22179
22190
  reportDiagnostic(
22180
- `writer lease lock read failed (holder liveness unverifiable; lock left in place) at ${join23(runDirectory, WRITER_LOCK_FILE)}: ${describeErrorIdentity(error)}`
22191
+ `writer lease lock read failed (holder liveness unverifiable; lock left in place) at ${join24(runDirectory, WRITER_LOCK_FILE)}: ${describeErrorIdentity(error)}`
22181
22192
  );
22182
22193
  };
22183
- const lockPath = join23(runDirectory, WRITER_LOCK_FILE);
22194
+ const lockPath = join24(runDirectory, WRITER_LOCK_FILE);
22184
22195
  let lastAutopsy = { verdict: "absent" };
22185
22196
  let lastReclaimFailure;
22186
22197
  for (let reclaimsLeft = WRITER_LEASE_RECLAIM_ROUNDS; ; reclaimsLeft -= 1) {
@@ -22246,7 +22257,7 @@ async function findRunDirectoryById(home, runId, onlyBookKey, onlyRole, knownRun
22246
22257
  }
22247
22258
  if (runId.trim() === "") return void 0;
22248
22259
  const ledgerHome = resolveActivationLedgerHome(home);
22249
- const booksRoot = join23(ledgerHome, "books");
22260
+ const booksRoot = join24(ledgerHome, "books");
22250
22261
  let bookKeys;
22251
22262
  try {
22252
22263
  bookKeys = await readdir3(booksRoot);
@@ -22296,7 +22307,7 @@ async function findLatestRunForSeatTicket(input) {
22296
22307
  let runDirectories;
22297
22308
  try {
22298
22309
  runDirectories = await listBookRunDirectories(
22299
- input.ticketNumber === void 0 ? bookDir : join23(bookDir, String(input.ticketNumber))
22310
+ input.ticketNumber === void 0 ? bookDir : join24(bookDir, String(input.ticketNumber))
22300
22311
  );
22301
22312
  } catch (error) {
22302
22313
  if (errorCodeOf(error) === "ENOENT") return void 0;
@@ -30068,10 +30079,10 @@ var init_analyst_book_key = __esm({
30068
30079
  // src/atomic-write.ts
30069
30080
  import { randomUUID as randomUUID7 } from "node:crypto";
30070
30081
  import { rename as rename2, rm, writeFile as writeFile4 } from "node:fs/promises";
30071
- import { dirname as dirname15, join as join24 } from "node:path";
30082
+ import { dirname as dirname15, join as join25 } from "node:path";
30072
30083
  async function writeFileAtomically(destination, contents, options) {
30073
30084
  const parent = dirname15(destination);
30074
- const temporary = join24(parent, `.atomic-write-${randomUUID7()}.tmp`);
30085
+ const temporary = join25(parent, `.atomic-write-${randomUUID7()}.tmp`);
30075
30086
  try {
30076
30087
  await writeFile4(temporary, contents, options);
30077
30088
  await rename2(temporary, destination);
@@ -30088,12 +30099,12 @@ var init_atomic_write = __esm({
30088
30099
 
30089
30100
  // src/analyst-index.ts
30090
30101
  import { open as open2, readFile as readFile11, unlink as unlink2 } from "node:fs/promises";
30091
- import { dirname as dirname16, join as join25 } from "node:path";
30102
+ import { dirname as dirname16, join as join26 } from "node:path";
30092
30103
  import { setTimeout as sleep } from "node:timers/promises";
30093
30104
  async function withAnalystLibraryIndexLock(ledgerHome, fn) {
30094
30105
  const indexPath = analystLibraryIndexPath(ledgerHome);
30095
30106
  ensureRealDirectoryTree(ledgerHome, dirname16(indexPath));
30096
- const lockPath = join25(dirname16(indexPath), LIBRARY_INDEX_LOCK_NAME);
30107
+ const lockPath = join26(dirname16(indexPath), LIBRARY_INDEX_LOCK_NAME);
30097
30108
  assertLedgerFileInsideHome(lockPath, ledgerHome);
30098
30109
  const startedAt = Date.now();
30099
30110
  while (true) {
@@ -30120,7 +30131,7 @@ async function withAnalystLibraryIndexLock(ledgerHome, fn) {
30120
30131
  }
30121
30132
  }
30122
30133
  function analystLibraryIndexPath(ledgerHome) {
30123
- return join25(ledgerHome, "analyst", "library-index.json");
30134
+ return join26(ledgerHome, "analyst", "library-index.json");
30124
30135
  }
30125
30136
  function rowFromIssueMetricsPage(page) {
30126
30137
  return {
@@ -30414,7 +30425,7 @@ var init_analyst_cohort = __esm({
30414
30425
  });
30415
30426
 
30416
30427
  // src/archivist-record-pointer.ts
30417
- import { basename as basename12, join as join26 } from "node:path";
30428
+ import { basename as basename12, join as join27 } from "node:path";
30418
30429
  async function resolveOfficerPointer(raw, parentRunDirectory) {
30419
30430
  const where = `${parentRunDirectory} officers`;
30420
30431
  if (!isRecord(raw) || raw.kind !== DIRECT_OFFICER_RUN_POINTER_KIND || raw.version !== 1) {
@@ -30447,7 +30458,7 @@ async function resolveOfficerPointer(raw, parentRunDirectory) {
30447
30458
  };
30448
30459
  }
30449
30460
  async function readBookedOfficerPointers(parentRunDirectory) {
30450
- const { records, diagnostics } = await readSitianRecords(join26(parentRunDirectory, RUN_HISTORY_FILE));
30461
+ const { records, diagnostics } = await readSitianRecords(join27(parentRunDirectory, RUN_HISTORY_FILE));
30451
30462
  if (diagnostics.length > 0) {
30452
30463
  throw new Error(
30453
30464
  `${RUN_HISTORY_FILE} has ${diagnostics.length} malformed row(s); officer pointers unreadable: ${parentRunDirectory}`
@@ -30730,7 +30741,7 @@ var init_analyst_gate_cycles_read = __esm({
30730
30741
 
30731
30742
  // src/analyst-ledger.ts
30732
30743
  import { readdir as readdir4 } from "node:fs/promises";
30733
- import { basename as basename13, join as join27 } from "node:path";
30744
+ import { basename as basename13, join as join28 } from "node:path";
30734
30745
  async function readExistingRunLifecycleState(runDirectory) {
30735
30746
  return (await readRoleRunIdentity(runDirectory))?.state;
30736
30747
  }
@@ -30750,7 +30761,7 @@ function ghostLeaseCheckFromAutopsy(autopsy) {
30750
30761
  }
30751
30762
  }
30752
30763
  async function classifyGhostCandidate(input) {
30753
- const autopsy = await autopsyWriterLock(join27(input.runDirectory, "writer.lock"));
30764
+ const autopsy = await autopsyWriterLock(join28(input.runDirectory, "writer.lock"));
30754
30765
  const leaseCheck = ghostLeaseCheckFromAutopsy(autopsy);
30755
30766
  if (leaseCheck === void 0) return { kind: "live" };
30756
30767
  return {
@@ -31040,7 +31051,7 @@ async function classifyScopedRun(input) {
31040
31051
  async function scanAnalystIssueRuns(input) {
31041
31052
  const ledgerHome = resolveActivationLedgerHome(input.home);
31042
31053
  const scopeTicketNumber = input.ticketNumber;
31043
- const booksRoot = join27(ledgerHome, "books");
31054
+ const booksRoot = join28(ledgerHome, "books");
31044
31055
  let wholeBook = false;
31045
31056
  let scopeRootIdentity;
31046
31057
  let bookNames;
@@ -31073,7 +31084,7 @@ async function scanAnalystIssueRuns(input) {
31073
31084
  const ghostLegs = [];
31074
31085
  const scopeConflicts = [];
31075
31086
  for (const book of bookNames) {
31076
- const bookDir = join27(booksRoot, book);
31087
+ const bookDir = join28(booksRoot, book);
31077
31088
  let runDirectories;
31078
31089
  try {
31079
31090
  runDirectories = await listBookRunDirectories(bookDir);
@@ -31819,7 +31830,7 @@ var init_analyst_metric_family = __esm({
31819
31830
  });
31820
31831
 
31821
31832
  // src/analyst-page.ts
31822
- import { dirname as dirname17, join as join28 } from "node:path";
31833
+ import { dirname as dirname17, join as join29 } from "node:path";
31823
31834
  function analystIssuePageKey(address) {
31824
31835
  const parts = ["book", address.bookKey];
31825
31836
  if (address.issueNumber !== void 0) {
@@ -31830,7 +31841,7 @@ function analystIssuePageKey(address) {
31830
31841
  return sha256Hex(parts.join("\0")).slice(0, 32);
31831
31842
  }
31832
31843
  function analystIssuePagePath(ledgerHome, address) {
31833
- return join28(ledgerHome, "analyst", "issues", `${analystIssuePageKey(address)}.json`);
31844
+ return join29(ledgerHome, "analyst", "issues", `${analystIssuePageKey(address)}.json`);
31834
31845
  }
31835
31846
  function analystIssuePageAddressFromPage(page) {
31836
31847
  return {
@@ -33384,12 +33395,12 @@ var init_cli = __esm({
33384
33395
 
33385
33396
  // src/public-cli/main.ts
33386
33397
  import { existsSync as existsSync12 } from "node:fs";
33387
- import { dirname as dirname18, join as join29 } from "node:path";
33398
+ import { dirname as dirname18, join as join30 } from "node:path";
33388
33399
  import { fileURLToPath as fileURLToPath2 } from "node:url";
33389
33400
  var here = dirname18(fileURLToPath2(import.meta.url));
33390
33401
  function resolvePackageRoot(binDir) {
33391
- const canonical = join29(binDir, "..", "..");
33392
- if (existsSync12(join29(canonical, "package.json"))) {
33402
+ const canonical = join30(binDir, "..", "..");
33403
+ if (existsSync12(join30(canonical, "package.json"))) {
33393
33404
  return canonical;
33394
33405
  }
33395
33406
  return binDir;
@@ -23,7 +23,7 @@ import { isRecord, errorText, isEnoent } from "../unknown-value.js";
23
23
  * source: runWithAutoResumeLoop receives the effective value once per call.
24
24
  */
25
25
  export const AUTO_RESUME_LIMIT = 2;
26
- const WRITER_LOCK_FILE = "writer.lock";
26
+ export const WRITER_LOCK_FILE = "writer.lock";
27
27
  export async function writeRoleRunState(runDirectory, record) {
28
28
  const payload = { ...record, runDirectory };
29
29
  writeSectionSync(runDirectory, "runState", { ...payload });
@@ -1,38 +1,66 @@
1
1
  /**
2
- * Shared same-parent resume seam for gate / officer seats (#635 / #637 / #747 / #987).
3
- *
4
- * Lookup uses the parent run path; a typed ticket narrows same-ticket gate
5
- * re-summons, never creates an issue identity. Callers can also use explicit
6
- * `ak-role resume <runId>`. Lookup/resume failures propagate (失败诚实) — never wash into
7
- * a fresh mint. Returns undefined when the caller declared an explicit fresh
8
- * summons (`ak-role new`) or when no prior run exists; both mint new.
9
- * freshSummons is required so no seat can drift back into its own skip branch.
2
+ * Shared same-parent resume seam for gate / officer seats (#635 / #637 / #747 / #987 / #1253).
3
+ * Contract is on tryResumeSameTicketSeatRun.
10
4
  */
5
+ import { join } from "node:path";
11
6
  import { resolveBookKeyFromGit } from "../activation-ledger-git.js";
12
- import { findLatestRunForSeatTicket, } from "./run-lifecycle.js";
7
+ import { autopsyWriterLock, findLatestRunForSeatTicket, resolveLiveRunDirectoryPath, WRITER_LOCK_FILE, } from "./run-lifecycle.js";
8
+ const SESSION_ID_MISSING = "session-id-missing";
9
+ function resumedSessionIdMissing(result, runId) {
10
+ if (typeof result !== "object" || result === null)
11
+ return false;
12
+ const terminal = result.terminal;
13
+ if (typeof terminal !== "object" || terminal === null)
14
+ return false;
15
+ if (terminal.runId !== runId)
16
+ return false;
17
+ const outcome = terminal.roleOutcome;
18
+ if (typeof outcome !== "object" || outcome === null)
19
+ return false;
20
+ if (outcome.kind !== "failure")
21
+ return false;
22
+ const facts = outcome.decisiveFacts;
23
+ if (typeof facts !== "object" || facts === null)
24
+ return false;
25
+ return facts.errorCode === SESSION_ID_MISSING;
26
+ }
27
+ /** Live or unverifiable holder: same fail-closed verdict as lease acquire. */
28
+ async function writerLockBlocksFreshSummons(runDirectory) {
29
+ const autopsy = await autopsyWriterLock(join(runDirectory, WRITER_LOCK_FILE));
30
+ return autopsy.verdict === "alive" || autopsy.verdict === "unknown";
31
+ }
13
32
  /**
14
- * Sole same-seat → resume decision by parent run path (#637 / #724 / #747 / #987).
33
+ * Sole same-seat → resume decision by parent run path (#637 / #724 / #747 / #987 / #1253).
15
34
  * A supplied typed ticket only narrows the prior-run search. When a prior run is
16
35
  * found, resume carries this summons' materials and the located runDirectory so
17
- * load does not re-walk every book for the bare runId (#1195). Lookup/resume
18
- * failures propagate (失败诚实) — never wash into a fresh mint. Returns undefined
19
- * when the caller declared an explicit fresh summons (`ak-role new`), the parent
20
- * path is blank, or no prior run exists; those mint new. freshSummons is
21
- * required so no seat can drift back into its own skip branch.
36
+ * load does not re-walk every book for the bare runId (#1195). Typed
37
+ * session-id-missing is already recorded on that run (失败照记,记完再起新);
38
+ * return undefined so the caller mints once. Resume runs first; this seam does
39
+ * not look up a session id. A held or unverifiable writer lock, and every other
40
+ * result, returns as-is. Also returns undefined for explicit `ak-role new`, a
41
+ * blank parent path, or no prior run. freshSummons is required so no seat can
42
+ * drift back into its own skip branch.
22
43
  */
23
44
  export async function tryResumeSameTicketSeatRun(input) {
24
45
  if (input.freshSummons === true)
25
46
  return undefined;
26
47
  if (input.parentRunPath.trim() === "")
27
48
  return undefined;
49
+ const bookKey = resolveBookKeyFromGit(input.projectRoot);
28
50
  const previous = await findLatestRunForSeatTicket({
29
51
  home: input.home,
30
- bookKey: resolveBookKeyFromGit(input.projectRoot),
52
+ bookKey,
31
53
  role: input.role,
32
54
  parentRunPath: input.parentRunPath,
33
55
  ...(input.ticketNumber === undefined ? {} : { ticketNumber: input.ticketNumber }),
34
56
  });
35
57
  if (previous === undefined)
36
58
  return undefined;
37
- return await input.resume(previous.runId, input.summons, previous.runDirectory);
59
+ const resumed = await input.resume(previous.runId, input.summons, previous.runDirectory);
60
+ if (!resumedSessionIdMissing(resumed, previous.runId))
61
+ return resumed;
62
+ const live = await resolveLiveRunDirectoryPath(previous.runDirectory, input.home, bookKey);
63
+ if (live !== undefined && await writerLockBlocksFreshSummons(live))
64
+ return resumed;
65
+ return undefined;
38
66
  }
@@ -18,7 +18,7 @@ const reviewNarrativeFields = {
18
18
  reason: Type.Optional(Type.Unknown({ description: "上呈理由" })),
19
19
  violations: Type.Optional(Type.Unknown({ description: "违规条目" })),
20
20
  conflicts: Type.Optional(Type.Unknown({ description: "待决冲突" })),
21
- fix: Type.Optional(Type.Unknown({ description: "continue 时的补救说明;可写 summary 摘要,其余内容原样留存" })),
21
+ fix: Type.Optional(Type.Unknown({ description: "仅 continue 时填补救说明(可写 summary 摘要,其余内容原样留存);没有就填 null" })),
22
22
  classes: Type.Optional(Type.Unknown({ description: "已裁决 finding 类;可说明 name、owner、boundary、disposition,原样留存" })),
23
23
  note: Type.Optional(Type.Unknown({ description: "裁决附注" })),
24
24
  evidence: Type.Optional(Type.Unknown({ description: "留存证据" })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.5941",
3
+ "version": "0.1.5949",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@ export const collectorOutputBaseSchema = openToolObject(
14
14
  "按机器身份归组的出席、材料与逐条 findings(LLM 自行从宿主 CLI 取证整理;代码不代收不归并)。",
15
15
  }),
16
16
  unfinishedReasons: Type.Unknown({
17
- description: "未完成原因;取证受限时如实报告。",
17
+ description: "仅取证受限时填未完成原因;没有就填 null",
18
18
  }),
19
19
  }),
20
20
  );