@adhdev/mesh-shared 1.0.60-rc.44 → 1.0.60-rc.46

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.
package/dist/index.mjs CHANGED
@@ -1657,6 +1657,12 @@ var RECLAIMING_SEND_REFUSALS = ["session_exited", "no_target", "unsupported_inpu
1657
1657
  var DELIVERY_OUTCOMES = ["delivered", "queued"];
1658
1658
  var DELIVERY_VIAS = ["local", "p2p"];
1659
1659
  var DISPATCH_FAILURE_REASONS = ["worker_absent", "transport_error", "spawn_failed", "rejected_by_worker", "timeout"];
1660
+ function sanitizeRefusalCode(value) {
1661
+ if (typeof value !== "string") return void 0;
1662
+ const normalized = value.trim().toLowerCase().replace(/[^a-z_]/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
1663
+ if (!normalized) return void 0;
1664
+ return normalized.slice(0, 64);
1665
+ }
1660
1666
  var CONSUME_PROFILES = ["default", "native_source"];
1661
1667
  var SESSION_REBOUND_REASONS = ["restart", "live_holder"];
1662
1668
  var SUSPENSION_MODALS = ["approval", "choice"];
@@ -1692,7 +1698,13 @@ var HOLD_REASONS = [
1692
1698
  // the structured report is the primary evidence (design §F2), so the idle edge
1693
1699
  // only opens this hold (R9r) — a report commits (R17), a new busy edge cancels
1694
1700
  // it as a false idle (R12r), expiry commits weak (R13r).
1695
- "await_report"
1701
+ "await_report",
1702
+ // A worker report recorded while the session is still generating (R17g):
1703
+ // the report is the verdict, the idle edge is only awaited as corroboration
1704
+ // — a turn_end commits the report (R9t), expiry commits it anyway (R13t) so
1705
+ // a session whose FSM never shows the idle edge again does not wait for
1706
+ // liveness / hard_ceiling.
1707
+ "await_end"
1696
1708
  ];
1697
1709
  var TURN_OUTCOMES = ["completed", "failed", "cancelled"];
1698
1710
  var COMMIT_STRENGTHS = ["genuine", "weak", "tool_report", "operator"];
@@ -1778,7 +1790,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
1778
1790
  },
1779
1791
  delivered: { messageId: id, outcome: en(DELIVERY_OUTCOMES), via: en(DELIVERY_VIAS) },
1780
1792
  delivery_refused: { messageId: id, reason: en(SEND_REFUSAL_REASONS) },
1781
- dispatch_failed: { workerAbsent: bool, reason: en(DISPATCH_FAILURE_REASONS) },
1793
+ dispatch_failed: { workerAbsent: bool, reason: en(DISPATCH_FAILURE_REASONS), refusalCode: idOpt },
1782
1794
  duplicate_dispatch_refusal: { holderSessionId: id, holderAttemptId: idOpt },
1783
1795
  session_rebound: { toSessionId: id, reason: en(SESSION_REBOUND_REASONS) },
1784
1796
  turn_started: { retro: bool },
@@ -1810,7 +1822,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
1810
1822
  session_error: { reason: en(SESSION_ERROR_REASONS) },
1811
1823
  worker_report: {
1812
1824
  outcome: en(WORKER_REPORT_OUTCOMES),
1813
- summary: { t: "summary_ref" },
1825
+ summary: { t: "summary_ref", optional: true },
1814
1826
  hasHandoffNotes: bool,
1815
1827
  branchState: enOpt(WORKER_BRANCH_STATES),
1816
1828
  touchedFileCount: intOpt
@@ -3489,6 +3501,7 @@ export {
3489
3501
  renderMissionBriefBlock,
3490
3502
  renderWorkerProtocolFooter,
3491
3503
  sanitizeModelIdentifier,
3504
+ sanitizeRefusalCode,
3492
3505
  scoreGitStatusCandidate,
3493
3506
  scoreGitUpstreamFreshness,
3494
3507
  sessionIdsEquivalent,