@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.
@@ -1519,15 +1519,15 @@ function withTerminatingOutputDeclarations(schema) {
1519
1519
  ...baseProperties ?? {},
1520
1520
  ...baseProperties?.ticketNumber === void 0 ? {
1521
1521
  ticketNumber: Type2.Unknown({
1522
- 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"
1522
+ 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"
1523
1523
  })
1524
1524
  } : {},
1525
1525
  ...baseProperties?.summary === void 0 ? {
1526
1526
  summary: Type2.Unknown({
1527
- 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"
1527
+ 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"
1528
1528
  })
1529
1529
  } : {},
1530
- [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
1530
+ [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureField
1531
1531
  };
1532
1532
  const object = Type2.Object(properties, { additionalProperties: true });
1533
1533
  const incoming = schema.required;
@@ -1535,30 +1535,14 @@ function withTerminatingOutputDeclarations(schema) {
1535
1535
  object.required = preserved;
1536
1536
  return object;
1537
1537
  }
1538
- var INFRASTRUCTURE_FAILURE_DECLARATION_KEY, INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY, infrastructureFailureNested, infrastructureFailureDeclarationSchema;
1538
+ var INFRASTRUCTURE_FAILURE_DECLARATION_KEY, infrastructureFailureField;
1539
1539
  var init_terminating_infrastructure = __esm({
1540
1540
  "src/package-contracts/terminating-infrastructure.ts"() {
1541
1541
  "use strict";
1542
1542
  INFRASTRUCTURE_FAILURE_DECLARATION_KEY = "infrastructureFailure";
1543
- INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic";
1544
- infrastructureFailureNested = Type2.Object(
1545
- {
1546
- [INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: Type2.Unknown({
1547
- description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
1548
- })
1549
- },
1550
- {
1551
- additionalProperties: true,
1552
- description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
1553
- }
1554
- );
1555
- infrastructureFailureNested.required = [];
1556
- infrastructureFailureDeclarationSchema = Type2.Object(
1557
- {
1558
- [INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureNested
1559
- },
1560
- { additionalProperties: true }
1561
- );
1543
+ infrastructureFailureField = Type2.Unknown({
1544
+ description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u586B {diagnostic}\uFF1B\u6CA1\u6709\u5C31\u586B null"
1545
+ });
1562
1546
  }
1563
1547
  });
1564
1548
 
@@ -1578,10 +1562,10 @@ var init_gatekeeper_output = __esm({
1578
1562
  description: "dispatch | pass"
1579
1563
  }),
1580
1564
  officer: Type3.Unknown({
1581
- description: "status \u4E3A dispatch \u65F6\u4E3A inspector | notary"
1565
+ description: "\u4EC5 status \u4E3A dispatch \u65F6\u586B inspector | notary\uFF1B\u6CA1\u6709\u5C31\u586B null"
1582
1566
  }),
1583
1567
  findings: Type3.Unknown({
1584
- description: "status \u4E3A pass \u65F6\u53EF\u9009 string[] findings"
1568
+ description: "\u4EC5 status \u4E3A pass \u65F6\u586B string[] findings\uFF1B\u6CA1\u6709\u5C31\u586B null"
1585
1569
  })
1586
1570
  })
1587
1571
  );
@@ -1682,13 +1666,13 @@ var init_navigator_output = __esm({
1682
1666
  NAVIGATOR_OUTPUT_TOOL_NAME = "ak_navigator_output";
1683
1667
  navigatorAdviceFields = {
1684
1668
  prose: Type4.Unknown({
1685
- description: "\u5355\u6761\u6563\u6587\u5EFA\u8BAE\u3002\u65E0\u72B6\u6001\u5206\u53C9\u65F6\u4F7F\u7528\uFF1B\u539F\u6837\u5448\u73B0\u3002"
1669
+ 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"
1686
1670
  }),
1687
1671
  byStatus: Type4.Unknown({
1688
1672
  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"
1689
1673
  }),
1690
1674
  byRole: Type4.Unknown({
1691
- 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"
1675
+ 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"
1692
1676
  })
1693
1677
  };
1694
1678
  navigatorAdviceBodySchema = openToolObject(Type4.Object(navigatorAdviceFields));
@@ -1721,7 +1705,7 @@ var init_review_submission = __esm({
1721
1705
  reason: Type5.Optional(Type5.Unknown({ description: "\u4E0A\u5448\u7406\u7531" })),
1722
1706
  violations: Type5.Optional(Type5.Unknown({ description: "\u8FDD\u89C4\u6761\u76EE" })),
1723
1707
  conflicts: Type5.Optional(Type5.Unknown({ description: "\u5F85\u51B3\u51B2\u7A81" })),
1724
- fix: Type5.Optional(Type5.Unknown({ description: "continue \u65F6\u7684\u8865\u6551\u8BF4\u660E\uFF1B\u53EF\u5199 summary \u6458\u8981\uFF0C\u5176\u4F59\u5185\u5BB9\u539F\u6837\u7559\u5B58" })),
1708
+ fix: Type5.Optional(Type5.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" })),
1725
1709
  classes: Type5.Optional(Type5.Unknown({ description: "\u5DF2\u88C1\u51B3 finding \u7C7B\uFF1B\u53EF\u8BF4\u660E name\u3001owner\u3001boundary\u3001disposition\uFF0C\u539F\u6837\u7559\u5B58" })),
1726
1710
  note: Type5.Optional(Type5.Unknown({ description: "\u88C1\u51B3\u9644\u6CE8" })),
1727
1711
  evidence: Type5.Optional(Type5.Unknown({ description: "\u7559\u5B58\u8BC1\u636E" })),
@@ -1812,7 +1796,7 @@ var init_reviewer_output = __esm({
1812
1796
  init_open_tool_schema();
1813
1797
  init_terminating_infrastructure();
1814
1798
  REVIEWER_OUTPUT_TOOL_NAME = "ak_reviewer_output";
1815
- 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";
1799
+ 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";
1816
1800
  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";
1817
1801
  reviewerOutputObject = Type6.Object({
1818
1802
  status: Type6.Unknown({ description: REVIEWER_STATUS_DESCRIPTION }),
@@ -1871,7 +1855,7 @@ var init_fixer_output = __esm({
1871
1855
  }),
1872
1856
  diffItems: diffItemsField,
1873
1857
  testEvidence: Type8.Unknown({
1874
- 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"
1858
+ 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"
1875
1859
  })
1876
1860
  });
1877
1861
  fixerOutputSchema = withTerminatingOutputDeclarations(
@@ -1956,7 +1940,7 @@ var init_doctor_contracts = __esm({
1956
1940
  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`
1957
1941
  }),
1958
1942
  reason: Type10.Unknown({
1959
- description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u8BC1\u8BCD\u7684\u539F\u56E0\uFF1B\u4EC5 refused \u65F6\u7528\u3002"
1943
+ 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"
1960
1944
  }),
1961
1945
  missingEvidence: Type10.Unknown({
1962
1946
  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"
@@ -2247,7 +2231,7 @@ var init_ticket_provenance_contracts = __esm({
2247
2231
  import { Type as Type13 } from "typebox";
2248
2232
  function projectDiaristSessions(value) {
2249
2233
  const raw = value?.sessions;
2250
- if (raw === void 0) return [];
2234
+ if (raw == null) return [];
2251
2235
  return projectTicketProvenanceSessions(raw);
2252
2236
  }
2253
2237
  function projectDiaristTicketSessions(value) {
@@ -2284,15 +2268,17 @@ var init_diarist_contracts = __esm({
2284
2268
  }),
2285
2269
  ticketNumber: Type13.Optional(
2286
2270
  Type13.Unknown({
2287
- 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"
2271
+ 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"
2288
2272
  })
2289
2273
  ),
2290
2274
  reason: Type13.Unknown({
2291
- description: "status \u4E3A escalate \u65F6\uFF1A\u4E0A\u5448\u7684\u539F\u56E0"
2275
+ description: "\u4EC5 status \u4E3A escalate \u65F6\u586B\u4E0A\u5448\u7684\u539F\u56E0\uFF1B\u6CA1\u6709\u5C31\u586B null"
2292
2276
  }),
2293
- sessions: Type13.Optional(Type13.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
2277
+ sessions: Type13.Optional(Type13.Unknown({
2278
+ description: `\u4EC5\u5355\u7968\u5EAD\u65F6\u586B\u5BF9\u8BDD\u8FB9\u754C\uFF1B\u6CA1\u6709\u5C31\u586B null\u3002${DIARIST_SESSIONS_DESCRIPTION}`
2279
+ })),
2294
2280
  ticketSessions: Type13.Unknown({
2295
- 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`
2281
+ 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`
2296
2282
  })
2297
2283
  })
2298
2284
  )
@@ -3119,7 +3105,7 @@ var init_collector_tool_schemas = __esm({
3119
3105
  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"
3120
3106
  }),
3121
3107
  unfinishedReasons: Type15.Unknown({
3122
- description: "\u672A\u5B8C\u6210\u539F\u56E0\uFF1B\u53D6\u8BC1\u53D7\u9650\u65F6\u5982\u5B9E\u62A5\u544A\u3002"
3108
+ description: "\u4EC5\u53D6\u8BC1\u53D7\u9650\u65F6\u586B\u672A\u5B8C\u6210\u539F\u56E0\uFF1B\u6CA1\u6709\u5C31\u586B null"
3123
3109
  })
3124
3110
  })
3125
3111
  );
@@ -14233,24 +14219,48 @@ var init_post_admission = __esm({
14233
14219
  });
14234
14220
 
14235
14221
  // src/public-cli/seat-ticket-binding.ts
14222
+ import { join as join22 } from "node:path";
14223
+ function resumedSessionIdMissing(result, runId) {
14224
+ if (typeof result !== "object" || result === null) return false;
14225
+ const terminal = result.terminal;
14226
+ if (typeof terminal !== "object" || terminal === null) return false;
14227
+ if (terminal.runId !== runId) return false;
14228
+ const outcome = terminal.roleOutcome;
14229
+ if (typeof outcome !== "object" || outcome === null) return false;
14230
+ if (outcome.kind !== "failure") return false;
14231
+ const facts = outcome.decisiveFacts;
14232
+ if (typeof facts !== "object" || facts === null) return false;
14233
+ return facts.errorCode === SESSION_ID_MISSING;
14234
+ }
14235
+ async function writerLockBlocksFreshSummons(runDirectory) {
14236
+ const autopsy = await autopsyWriterLock(join22(runDirectory, WRITER_LOCK_FILE));
14237
+ return autopsy.verdict === "alive" || autopsy.verdict === "unknown";
14238
+ }
14236
14239
  async function tryResumeSameTicketSeatRun(input) {
14237
14240
  if (input.freshSummons === true) return void 0;
14238
14241
  if (input.parentRunPath.trim() === "") return void 0;
14242
+ const bookKey = resolveBookKeyFromGit(input.projectRoot);
14239
14243
  const previous = await findLatestRunForSeatTicket({
14240
14244
  home: input.home,
14241
- bookKey: resolveBookKeyFromGit(input.projectRoot),
14245
+ bookKey,
14242
14246
  role: input.role,
14243
14247
  parentRunPath: input.parentRunPath,
14244
14248
  ...input.ticketNumber === void 0 ? {} : { ticketNumber: input.ticketNumber }
14245
14249
  });
14246
14250
  if (previous === void 0) return void 0;
14247
- return await input.resume(previous.runId, input.summons, previous.runDirectory);
14251
+ const resumed = await input.resume(previous.runId, input.summons, previous.runDirectory);
14252
+ if (!resumedSessionIdMissing(resumed, previous.runId)) return resumed;
14253
+ const live = await resolveLiveRunDirectoryPath(previous.runDirectory, input.home, bookKey);
14254
+ if (live !== void 0 && await writerLockBlocksFreshSummons(live)) return resumed;
14255
+ return void 0;
14248
14256
  }
14257
+ var SESSION_ID_MISSING;
14249
14258
  var init_seat_ticket_binding = __esm({
14250
14259
  "src/public-cli/seat-ticket-binding.ts"() {
14251
14260
  "use strict";
14252
14261
  init_activation_ledger_git();
14253
14262
  init_run_lifecycle();
14263
+ SESSION_ID_MISSING = "session-id-missing";
14254
14264
  }
14255
14265
  });
14256
14266
 
@@ -15909,10 +15919,10 @@ var init_analyst_book_key = __esm({
15909
15919
  // src/atomic-write.ts
15910
15920
  import { randomUUID as randomUUID7 } from "node:crypto";
15911
15921
  import { rename as rename2, rm, writeFile as writeFile3 } from "node:fs/promises";
15912
- import { dirname as dirname14, join as join22 } from "node:path";
15922
+ import { dirname as dirname14, join as join23 } from "node:path";
15913
15923
  async function writeFileAtomically(destination, contents, options) {
15914
15924
  const parent = dirname14(destination);
15915
- const temporary = join22(parent, `.atomic-write-${randomUUID7()}.tmp`);
15925
+ const temporary = join23(parent, `.atomic-write-${randomUUID7()}.tmp`);
15916
15926
  try {
15917
15927
  await writeFile3(temporary, contents, options);
15918
15928
  await rename2(temporary, destination);
@@ -15929,12 +15939,12 @@ var init_atomic_write = __esm({
15929
15939
 
15930
15940
  // src/analyst-index.ts
15931
15941
  import { open, readFile as readFile10, unlink } from "node:fs/promises";
15932
- import { dirname as dirname15, join as join23 } from "node:path";
15942
+ import { dirname as dirname15, join as join24 } from "node:path";
15933
15943
  import { setTimeout as sleep } from "node:timers/promises";
15934
15944
  async function withAnalystLibraryIndexLock(ledgerHome, fn) {
15935
15945
  const indexPath = analystLibraryIndexPath(ledgerHome);
15936
15946
  ensureRealDirectoryTree(ledgerHome, dirname15(indexPath));
15937
- const lockPath = join23(dirname15(indexPath), LIBRARY_INDEX_LOCK_NAME);
15947
+ const lockPath = join24(dirname15(indexPath), LIBRARY_INDEX_LOCK_NAME);
15938
15948
  assertLedgerFileInsideHome(lockPath, ledgerHome);
15939
15949
  const startedAt = Date.now();
15940
15950
  while (true) {
@@ -15961,7 +15971,7 @@ async function withAnalystLibraryIndexLock(ledgerHome, fn) {
15961
15971
  }
15962
15972
  }
15963
15973
  function analystLibraryIndexPath(ledgerHome) {
15964
- return join23(ledgerHome, "analyst", "library-index.json");
15974
+ return join24(ledgerHome, "analyst", "library-index.json");
15965
15975
  }
15966
15976
  function rowFromIssueMetricsPage(page) {
15967
15977
  return {
@@ -16255,7 +16265,7 @@ var init_analyst_cohort = __esm({
16255
16265
  });
16256
16266
 
16257
16267
  // src/archivist-record-pointer.ts
16258
- import { basename as basename11, join as join24 } from "node:path";
16268
+ import { basename as basename11, join as join25 } from "node:path";
16259
16269
  async function resolveOfficerPointer(raw, parentRunDirectory) {
16260
16270
  const where = `${parentRunDirectory} officers`;
16261
16271
  if (!isRecord(raw) || raw.kind !== DIRECT_OFFICER_RUN_POINTER_KIND || raw.version !== 1) {
@@ -16288,7 +16298,7 @@ async function resolveOfficerPointer(raw, parentRunDirectory) {
16288
16298
  };
16289
16299
  }
16290
16300
  async function readBookedOfficerPointers(parentRunDirectory) {
16291
- const { records, diagnostics } = await readSitianRecords(join24(parentRunDirectory, RUN_HISTORY_FILE));
16301
+ const { records, diagnostics } = await readSitianRecords(join25(parentRunDirectory, RUN_HISTORY_FILE));
16292
16302
  if (diagnostics.length > 0) {
16293
16303
  throw new Error(
16294
16304
  `${RUN_HISTORY_FILE} has ${diagnostics.length} malformed row(s); officer pointers unreadable: ${parentRunDirectory}`
@@ -16571,7 +16581,7 @@ var init_analyst_gate_cycles_read = __esm({
16571
16581
 
16572
16582
  // src/analyst-ledger.ts
16573
16583
  import { readdir as readdir3 } from "node:fs/promises";
16574
- import { basename as basename12, join as join25 } from "node:path";
16584
+ import { basename as basename12, join as join26 } from "node:path";
16575
16585
  async function readExistingRunLifecycleState(runDirectory) {
16576
16586
  return (await readRoleRunIdentity(runDirectory))?.state;
16577
16587
  }
@@ -16591,7 +16601,7 @@ function ghostLeaseCheckFromAutopsy(autopsy) {
16591
16601
  }
16592
16602
  }
16593
16603
  async function classifyGhostCandidate(input) {
16594
- const autopsy = await autopsyWriterLock(join25(input.runDirectory, "writer.lock"));
16604
+ const autopsy = await autopsyWriterLock(join26(input.runDirectory, "writer.lock"));
16595
16605
  const leaseCheck = ghostLeaseCheckFromAutopsy(autopsy);
16596
16606
  if (leaseCheck === void 0) return { kind: "live" };
16597
16607
  return {
@@ -16881,7 +16891,7 @@ async function classifyScopedRun(input) {
16881
16891
  async function scanAnalystIssueRuns(input) {
16882
16892
  const ledgerHome = resolveActivationLedgerHome(input.home);
16883
16893
  const scopeTicketNumber = input.ticketNumber;
16884
- const booksRoot = join25(ledgerHome, "books");
16894
+ const booksRoot = join26(ledgerHome, "books");
16885
16895
  let wholeBook = false;
16886
16896
  let scopeRootIdentity;
16887
16897
  let bookNames;
@@ -16914,7 +16924,7 @@ async function scanAnalystIssueRuns(input) {
16914
16924
  const ghostLegs = [];
16915
16925
  const scopeConflicts = [];
16916
16926
  for (const book of bookNames) {
16917
- const bookDir = join25(booksRoot, book);
16927
+ const bookDir = join26(booksRoot, book);
16918
16928
  let runDirectories;
16919
16929
  try {
16920
16930
  runDirectories = await listBookRunDirectories(bookDir);
@@ -17660,7 +17670,7 @@ var init_analyst_metric_family = __esm({
17660
17670
  });
17661
17671
 
17662
17672
  // src/analyst-page.ts
17663
- import { dirname as dirname16, join as join26 } from "node:path";
17673
+ import { dirname as dirname16, join as join27 } from "node:path";
17664
17674
  function analystIssuePageKey(address) {
17665
17675
  const parts = ["book", address.bookKey];
17666
17676
  if (address.issueNumber !== void 0) {
@@ -17671,7 +17681,7 @@ function analystIssuePageKey(address) {
17671
17681
  return sha256Hex(parts.join("\0")).slice(0, 32);
17672
17682
  }
17673
17683
  function analystIssuePagePath(ledgerHome, address) {
17674
- return join26(ledgerHome, "analyst", "issues", `${analystIssuePageKey(address)}.json`);
17684
+ return join27(ledgerHome, "analyst", "issues", `${analystIssuePageKey(address)}.json`);
17675
17685
  }
17676
17686
  function analystIssuePageAddressFromPage(page) {
17677
17687
  return {
@@ -19235,7 +19245,7 @@ __export(public_role_summons_exports, {
19235
19245
  import { execFile as execFile3 } from "node:child_process";
19236
19246
  import { existsSync as existsSync12 } from "node:fs";
19237
19247
  import { realpath as realpath6 } from "node:fs/promises";
19238
- import { join as join27 } from "node:path";
19248
+ import { join as join28 } from "node:path";
19239
19249
  import { promisify as promisify3 } from "node:util";
19240
19250
  function createCapturingIo() {
19241
19251
  const chunks = [];
@@ -19259,7 +19269,7 @@ function parentDir(path) {
19259
19269
  function walkPackageRoot(start) {
19260
19270
  let dir = start;
19261
19271
  for (let i = 0; i < 12; i += 1) {
19262
- if (existsSync12(join27(dir, "package.json")) && existsSync12(join27(dir, "souls"))) {
19272
+ if (existsSync12(join28(dir, "package.json")) && existsSync12(join28(dir, "souls"))) {
19263
19273
  return dir;
19264
19274
  }
19265
19275
  const parent = parentDir(dir);
@@ -19808,7 +19818,7 @@ var init_compliance_transport = __esm({
19808
19818
  });
19809
19819
 
19810
19820
  // src/role-run-relocation.ts
19811
- import { dirname as dirname17, join as join28 } from "node:path";
19821
+ import { dirname as dirname17, join as join29 } from "node:path";
19812
19822
  async function retainedRunPathsMatch(recordedPath, currentPath, currentRunDirectory) {
19813
19823
  if (recordedPath === currentPath) return true;
19814
19824
  if (typeof recordedPath !== "string") return false;
@@ -19854,6 +19864,7 @@ var run_lifecycle_exports = {};
19854
19864
  __export(run_lifecycle_exports, {
19855
19865
  AUTO_RESUME_LIMIT: () => AUTO_RESUME_LIMIT,
19856
19866
  RunWriterLeaseHeldError: () => RunWriterLeaseHeldError,
19867
+ WRITER_LOCK_FILE: () => WRITER_LOCK_FILE,
19857
19868
  acquireRunWriterLease: () => acquireRunWriterLease,
19858
19869
  autopsyWriterLock: () => autopsyWriterLock,
19859
19870
  clearCurrentCourt: () => clearCurrentCourt,
@@ -19876,7 +19887,7 @@ __export(run_lifecycle_exports, {
19876
19887
  });
19877
19888
  import { existsSync as existsSync13 } from "node:fs";
19878
19889
  import { chmod, lstat as lstat3, open as open2, readdir as readdir4, readFile as readFile14, unlink as unlink2 } from "node:fs/promises";
19879
- import { basename as basename13, join as join29 } from "node:path";
19890
+ import { basename as basename13, join as join30 } from "node:path";
19880
19891
  async function writeRoleRunState(runDirectory, record) {
19881
19892
  const payload = { ...record, runDirectory };
19882
19893
  writeSectionSync(runDirectory, "runState", { ...payload });
@@ -20171,7 +20182,7 @@ async function createWriterLease(lockPath, runDirectory, reportCleanupFailure) {
20171
20182
  },
20172
20183
  relocate(nextRunDirectory) {
20173
20184
  currentRunDirectory = nextRunDirectory;
20174
- currentLockPath = join29(nextRunDirectory, WRITER_LOCK_FILE);
20185
+ currentLockPath = join30(nextRunDirectory, WRITER_LOCK_FILE);
20175
20186
  },
20176
20187
  async release() {
20177
20188
  if (released) return;
@@ -20210,10 +20221,10 @@ async function acquireRunWriterLease(runDirectory, onCleanupFailure) {
20210
20221
  };
20211
20222
  const reportReadFailure = (error) => {
20212
20223
  reportDiagnostic(
20213
- `writer lease lock read failed (holder liveness unverifiable; lock left in place) at ${join29(runDirectory, WRITER_LOCK_FILE)}: ${describeErrorIdentity(error)}`
20224
+ `writer lease lock read failed (holder liveness unverifiable; lock left in place) at ${join30(runDirectory, WRITER_LOCK_FILE)}: ${describeErrorIdentity(error)}`
20214
20225
  );
20215
20226
  };
20216
- const lockPath = join29(runDirectory, WRITER_LOCK_FILE);
20227
+ const lockPath = join30(runDirectory, WRITER_LOCK_FILE);
20217
20228
  let lastAutopsy = { verdict: "absent" };
20218
20229
  let lastReclaimFailure;
20219
20230
  for (let reclaimsLeft = WRITER_LEASE_RECLAIM_ROUNDS; ; reclaimsLeft -= 1) {
@@ -20279,7 +20290,7 @@ async function findRunDirectoryById(home, runId, onlyBookKey, onlyRole, knownRun
20279
20290
  }
20280
20291
  if (runId.trim() === "") return void 0;
20281
20292
  const ledgerHome = resolveActivationLedgerHome(home);
20282
- const booksRoot = join29(ledgerHome, "books");
20293
+ const booksRoot = join30(ledgerHome, "books");
20283
20294
  let bookKeys;
20284
20295
  try {
20285
20296
  bookKeys = await readdir4(booksRoot);
@@ -20329,7 +20340,7 @@ async function findLatestRunForSeatTicket(input) {
20329
20340
  let runDirectories;
20330
20341
  try {
20331
20342
  runDirectories = await listBookRunDirectories(
20332
- input.ticketNumber === void 0 ? bookDir : join29(bookDir, String(input.ticketNumber))
20343
+ input.ticketNumber === void 0 ? bookDir : join30(bookDir, String(input.ticketNumber))
20333
20344
  );
20334
20345
  } catch (error) {
20335
20346
  if (errorCodeOf(error) === "ENOENT") return void 0;
@@ -21068,7 +21079,7 @@ init_submission_ledger();
21068
21079
  init_filed_submission();
21069
21080
  init_report_ticket_tool();
21070
21081
  import { writeSync as writeSync2 } from "node:fs";
21071
- import { join as join30 } from "node:path";
21082
+ import { join as join31 } from "node:path";
21072
21083
  import { Value as Value2 } from "typebox/value";
21073
21084
 
21074
21085
  // src/activation-trace.ts
@@ -22865,7 +22876,7 @@ function readRoleRunCoordinates(ctx, label) {
22865
22876
  if (runDirectory === void 0) throw new Error(`${label} requires AK_ROLE_RUN_DIR`);
22866
22877
  const admitted = readPageSync(runDirectory, "admitted");
22867
22878
  if (typeof admitted?.projectRoot !== "string" || admitted.projectRoot.trim() === "") {
22868
- throw new Error(`${label} state.jsonl admitted-request row missing projectRoot (${join30(runDirectory, RUN_STATE_FILE)})`);
22879
+ throw new Error(`${label} state.jsonl admitted-request row missing projectRoot (${join31(runDirectory, RUN_STATE_FILE)})`);
22869
22880
  }
22870
22881
  return {
22871
22882
  runDirectory,
@@ -24632,12 +24643,12 @@ function createAcpRoleTurnHost(config) {
24632
24643
  // src/acp-host/seat-profile-soul.ts
24633
24644
  import { constants as constants3 } from "node:fs";
24634
24645
  import { access as access3, copyFile, lstat as lstat4, mkdir as mkdir4, readlink, symlink as symlink2, unlink as unlink3 } from "node:fs/promises";
24635
- import { dirname as dirname19, join as join31, relative as relative4, resolve as resolve16 } from "node:path";
24646
+ import { dirname as dirname19, join as join32, relative as relative4, resolve as resolve16 } from "node:path";
24636
24647
  function seatProfileName(spec, role) {
24637
24648
  return `${spec.namePrefix}${role}`;
24638
24649
  }
24639
24650
  function packageRoleSoulPath(packageRoot, role) {
24640
- return join31(packageRoot, "souls", `${role}.md`);
24651
+ return join32(packageRoot, "souls", `${role}.md`);
24641
24652
  }
24642
24653
  async function pathExists2(path) {
24643
24654
  try {
@@ -24654,16 +24665,16 @@ async function ensureSeatProfileSoul(options) {
24654
24665
  if (!await pathExists2(soulTarget)) {
24655
24666
  throw new Error(`packaged role soul missing: ${soulTarget}`);
24656
24667
  }
24657
- const profilesRoot = join31(operatorHome, ...spec.profilesRootFromHome);
24658
- const profileDir = join31(profilesRoot, profileName);
24668
+ const profilesRoot = join32(operatorHome, ...spec.profilesRootFromHome);
24669
+ const profileDir = join32(profilesRoot, profileName);
24659
24670
  const hostRoot = dirname19(profilesRoot);
24660
- const soulPath = join31(profileDir, spec.soulFileName);
24671
+ const soulPath = join32(profileDir, spec.soulFileName);
24661
24672
  if (!await pathExists2(profileDir)) {
24662
24673
  await mkdir4(profileDir, { recursive: true });
24663
24674
  for (const name of ["auth.json", ".env", "config.yaml"]) {
24664
- const source = join31(hostRoot, name);
24675
+ const source = join32(hostRoot, name);
24665
24676
  if (!await pathExists2(source)) continue;
24666
- await copyFile(source, join31(profileDir, name));
24677
+ await copyFile(source, join32(profileDir, name));
24667
24678
  }
24668
24679
  } else {
24669
24680
  await mkdir4(profileDir, { recursive: true });
@@ -11,7 +11,7 @@ export const collectorOutputBaseSchema = openToolObject(Type.Object({
11
11
  description: "按机器身份归组的出席、材料与逐条 findings(LLM 自行从宿主 CLI 取证整理;代码不代收不归并)。",
12
12
  }),
13
13
  unfinishedReasons: Type.Unknown({
14
- description: "未完成原因;取证受限时如实报告。",
14
+ description: "仅取证受限时填未完成原因;没有就填 null",
15
15
  }),
16
16
  }));
17
17
  /** Runtime does not enrich findings; the model submits the receipt and signals sole-final. */
@@ -31,11 +31,11 @@ export function validateRecordedDiaristOutput(value) {
31
31
  }
32
32
  /**
33
33
  * Project sessions from a completed diarist payload.
34
- * Absent key → empty (lawful). Present but unusable → undefined (caller reasks).
34
+ * Null / absent key → empty (lawful). Non-null but unusable → undefined (caller reasks).
35
35
  */
36
36
  export function projectDiaristSessions(value) {
37
37
  const raw = value?.sessions;
38
- if (raw === undefined)
38
+ if (raw == null)
39
39
  return [];
40
40
  return projectTicketProvenanceSessions(raw);
41
41
  }
@@ -72,13 +72,15 @@ export const diaristOutputSchema = withTerminatingOutputDeclarations(openToolObj
72
72
  description: "completed | escalate",
73
73
  }),
74
74
  ticketNumber: Type.Optional(Type.Unknown({
75
- description: "本庭对象票号(正整数)或 null/省略=真无票;下游走 typed 键;认不出用 status=escalate,不洗成无录。机械层不重判。",
75
+ description: "仅有本庭对象时填票号(正整数);没有就填 null=真无票;下游走 typed 键;认不出用 status=escalate,不洗成无录。机械层不重判。",
76
76
  })),
77
77
  reason: Type.Unknown({
78
- description: "status 为 escalate 时:上呈的原因",
78
+ description: "仅 status 为 escalate 时填上呈的原因;没有就填 null",
79
79
  }),
80
- sessions: Type.Optional(Type.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
80
+ sessions: Type.Optional(Type.Unknown({
81
+ description: `仅单票庭时填对话边界;没有就填 null。${DIARIST_SESSIONS_DESCRIPTION}`,
82
+ })),
81
83
  ticketSessions: Type.Unknown({
82
- description: `多票庭逐票对话边界;每票含 ticketNumber(本条边界所归票号,正整数)与 sessions(${DIARIST_SESSIONS_DESCRIPTION})。一次交卷各票各自分录。与单票 sessions 二选一。`,
84
+ description: `仅多票庭时填逐票对话边界;没有就填 null。每票含 ticketNumber(本条边界所归票号,正整数)与 sessions(${DIARIST_SESSIONS_DESCRIPTION})。一次交卷各票各自分录。`,
83
85
  }),
84
86
  })));
@@ -23,7 +23,7 @@ const doctorSubmissionObject = Type.Object({
23
23
  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`
24
24
  }),
25
25
  reason: Type.Unknown({
26
- description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u8BC1\u8BCD\u7684\u539F\u56E0\uFF1B\u4EC5 refused \u65F6\u7528\u3002"
26
+ 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"
27
27
  }),
28
28
  missingEvidence: Type.Unknown({
29
29
  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"