instar 1.3.1657 → 1.3.1659

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 (60) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +52 -15
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/SessionManager.d.ts.map +1 -1
  5. package/dist/core/SessionManager.js +3 -1
  6. package/dist/core/SessionManager.js.map +1 -1
  7. package/dist/core/SlackReplyRelayInstaller.d.ts.map +1 -1
  8. package/dist/core/SlackReplyRelayInstaller.js +3 -0
  9. package/dist/core/SlackReplyRelayInstaller.js.map +1 -1
  10. package/dist/core/baselineProcessPatterns.d.ts +8 -0
  11. package/dist/core/baselineProcessPatterns.d.ts.map +1 -1
  12. package/dist/core/baselineProcessPatterns.js +14 -0
  13. package/dist/core/baselineProcessPatterns.js.map +1 -1
  14. package/dist/core/rebalanceProof.d.ts +15 -0
  15. package/dist/core/rebalanceProof.d.ts.map +1 -1
  16. package/dist/core/rebalanceProof.js +39 -3
  17. package/dist/core/rebalanceProof.js.map +1 -1
  18. package/dist/core/standDownDrain.d.ts.map +1 -1
  19. package/dist/core/standDownDrain.js +3 -1
  20. package/dist/core/standDownDrain.js.map +1 -1
  21. package/dist/data/standards-guard-index.json +1 -1
  22. package/dist/data/standards-guard-index.meta.json +2 -2
  23. package/dist/data/standards-registry.meta.json +1 -1
  24. package/dist/messaging/telegram-origin/OriginStore.d.ts +5 -0
  25. package/dist/messaging/telegram-origin/OriginStore.d.ts.map +1 -1
  26. package/dist/messaging/telegram-origin/OriginStore.js +2 -1
  27. package/dist/messaging/telegram-origin/OriginStore.js.map +1 -1
  28. package/dist/messaging/telegram-origin/OriginStore.worker.js +1 -1
  29. package/dist/messaging/telegram-origin/OriginStore.worker.js.map +1 -1
  30. package/dist/messaging/telegram-origin/OriginStoreBackend.d.ts +18 -0
  31. package/dist/messaging/telegram-origin/OriginStoreBackend.d.ts.map +1 -1
  32. package/dist/messaging/telegram-origin/OriginStoreBackend.js +50 -0
  33. package/dist/messaging/telegram-origin/OriginStoreBackend.js.map +1 -1
  34. package/dist/messaging/telegram-origin/SessionDeliveryNotice.d.ts +7 -0
  35. package/dist/messaging/telegram-origin/SessionDeliveryNotice.d.ts.map +1 -0
  36. package/dist/messaging/telegram-origin/SessionDeliveryNotice.js +25 -0
  37. package/dist/messaging/telegram-origin/SessionDeliveryNotice.js.map +1 -0
  38. package/dist/messaging/telegram-origin/TelegramOriginRuntime.d.ts +9 -2
  39. package/dist/messaging/telegram-origin/TelegramOriginRuntime.d.ts.map +1 -1
  40. package/dist/messaging/telegram-origin/TelegramOriginRuntime.js +39 -7
  41. package/dist/messaging/telegram-origin/TelegramOriginRuntime.js.map +1 -1
  42. package/dist/messaging/telegram-origin/TelegramOriginService.d.ts +1 -0
  43. package/dist/messaging/telegram-origin/TelegramOriginService.d.ts.map +1 -1
  44. package/dist/messaging/telegram-origin/TelegramOriginService.js +5 -2
  45. package/dist/messaging/telegram-origin/TelegramOriginService.js.map +1 -1
  46. package/dist/monitoring/delivery-failure-sentinel.js +5 -5
  47. package/dist/monitoring/delivery-failure-sentinel.js.map +1 -1
  48. package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
  49. package/dist/native/instar-desktop-host +0 -0
  50. package/package.json +1 -1
  51. package/scripts/lint-template-sha-history.ts +41 -17
  52. package/src/data/builtin-manifest.json +3 -3
  53. package/src/data/standards-guard-index.json +1 -1
  54. package/src/data/standards-guard-index.meta.json +2 -2
  55. package/src/data/standards-registry.meta.json +1 -1
  56. package/upgrades/1.3.1658.md +19 -0
  57. package/upgrades/1.3.1659.md +28 -0
  58. package/upgrades/side-effects/rebalance-proof-settled-idle.md +50 -0
  59. package/upgrades/side-effects/restart-reply-order-and-loss.md +79 -0
  60. package/upgrades/side-effects/slack-relay-sha-history.md +92 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../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from '../messaging/shared/channelIdentity.js';
60
60
  import { StandDownRegistry } from '../core/StandDownRegistry.js';
61
61
  import { getActiveOverloadShedPlanner, getMoveAftercare } from '../core/OverloadShedPlanner.js';
62
62
  import { QuietTopicScanner } from '../core/quietTopicScanner.js';
63
- import { RebalanceProofRunner, getActiveRebalanceProof, proofSpawnBrief, setActiveRebalanceProof, setActiveRebalanceProofStore } from '../core/rebalanceProof.js';
63
+ import { RebalanceProofRunner, getActiveRebalanceProof, waitForSettledIdle, proofSpawnBrief, setActiveRebalanceProof, setActiveRebalanceProofStore } from '../core/rebalanceProof.js';
64
64
  import { rebalanceProofState } from '../core/StageAdvancer.js';
65
65
  import { buildHandoffContinuationInstruction } from '../core/handoffContinuation.js';
66
66
  import { BASELINE_PROCESS_PATTERNS } from '../core/baselineProcessPatterns.js';
@@ -6577,23 +6577,64 @@ export async function startServer(options) {
6577
6577
  telegramOriginBoot = await bootTelegramOrigin({ config, token: typeof originBotToken === 'string' && originBotToken ? originBotToken : undefined,
6578
6578
  onRecoveredMessage: entry => {
6579
6579
  telegram?.logRecoveredOriginMessage(entry);
6580
+ // A late acceptance is reported by the durable exception scan. Only
6581
+ // an on-time acceptance can close the held Attention item here.
6582
+ if (entry.acceptedAt - entry.preparedAt >= 300_000)
6583
+ return;
6580
6584
  const attentionId = `telegram-origin-held-reply:${entry.operationId}`;
6581
6585
  if (telegram?.clearAttentionCondition({ id: attentionId }, `Telegram accepted recovered message ${entry.messageId}.`).closed === 0) {
6582
6586
  void telegram?.updateAttentionStatus(attentionId, 'DONE', { silent: true,
6583
6587
  closedBy: 'cause-cleared', resolution: `Telegram accepted recovered message ${entry.messageId}.` });
6584
6588
  }
6585
6589
  },
6586
- onSessionDeliveryHeld: entry => {
6590
+ onSessionDeliveryHeld: async (entry) => {
6587
6591
  if (!telegram || !entry.chatId)
6588
6592
  return;
6593
+ const { sessionDeliveryNotice, lateRecoveredReplyNotice } = await import('../messaging/telegram-origin/SessionDeliveryNotice.js');
6589
6594
  const topicId = entry.chatId === String(originTelegramConfig.config.issuesChatId)
6590
6595
  ? 10_000_000_000 + (entry.threadId ?? 1) : entry.threadId;
6591
- void telegram.createAttentionItem({ id: `telegram-origin-held-reply:${entry.operationId}`,
6592
- category: 'telegram-origin', priority: 'HIGH', title: 'A session reply is delayed',
6593
- sourceContext: 'telegram-origin-session-hold',
6594
- summary: `A reply to topic ${topicId ?? 'unknown'} is still in the delivery queue. Telegram was unreachable before this attempt connected; the server will retry the same message.`,
6595
- description: `Operation ${entry.operationId}. The advisory preflight does not confirm delivery.` }, { hubOnly: true })
6596
- .catch(error => console.warn('[telegram-origin] held reply attention unavailable', error instanceof Error ? error.name : 'unknown-error'));
6596
+ const late = entry.state === 'accepted' && entry.preparedAt !== undefined && entry.acceptedAt !== null && entry.acceptedAt !== undefined
6597
+ ? lateRecoveredReplyNotice(entry.preparedAt, entry.acceptedAt, entry.outOfOrder) : null;
6598
+ const attentionId = `telegram-origin-held-reply:${entry.operationId}`;
6599
+ const previous = telegram.getAttentionItem(attentionId);
6600
+ if (entry.state === 'accepted' && !late) {
6601
+ if (previous && previous.status !== 'DONE')
6602
+ await telegram.updateAttentionStatus(attentionId, 'DONE', { silent: true,
6603
+ closedBy: 'cause-cleared', resolution: 'Telegram accepted the original reply.' });
6604
+ return;
6605
+ }
6606
+ const copy = entry.state === 'accepted'
6607
+ ? { summary: 'An earlier reply was confirmed after a delay and may be out of order with newer answers.', topicText: late }
6608
+ : sessionDeliveryNotice(entry.state ?? 'held', entry.uncertain);
6609
+ if (entry.state === 'accepted' && previous?.status === 'DONE' && previous.summary === copy.summary)
6610
+ return;
6611
+ await telegram.upsertAttentionItem({ id: attentionId,
6612
+ category: 'telegram-origin', priority: 'HIGH', title: 'A reply needs delivery attention',
6613
+ sourceContext: 'telegram-origin-session-hold', summary: copy.summary,
6614
+ description: `Original reply to topic ${topicId ?? 'unknown'}; delivery state ${entry.state ?? 'held'}.` });
6615
+ if (topicId === null)
6616
+ return;
6617
+ // A stable logical send id lets the origin outbox answer a repeated
6618
+ // notice with its original receipt, including after a server restart.
6619
+ // A held/uncertain notice is retried by the next durable scan.
6620
+ if (!telegramOriginBoot)
6621
+ throw new Error('origin notice sender not ready');
6622
+ const { postOriginAutomationReply } = await import('../messaging/telegram-origin/OriginAutomationReply.js');
6623
+ const noticeState = entry.state === 'accepted' ? 'late'
6624
+ : entry.uncertain || entry.state === 'outcome-unknown' ? 'uncertain'
6625
+ : entry.state === 'expired' || entry.state === 'known-failed' ? 'failed' : 'delayed';
6626
+ const response = await postOriginAutomationReply({ service: telegramOriginBoot.runtime.service,
6627
+ port: config.port, authToken: config.authToken ?? '', producerId: 'reply-delivery-notice',
6628
+ topicId, body: { text: copy.topicText, metadata: { messageKind: 'health-alert' } },
6629
+ logicalSendId: `reply-delivery-notice:${entry.operationId}:${noticeState}` });
6630
+ if (response.status !== 200)
6631
+ throw new Error(`origin notice not confirmed: HTTP ${response.status}`);
6632
+ if (entry.state === 'accepted') {
6633
+ if (telegram.clearAttentionCondition({ id: attentionId }, 'The late reply and its explanation reached the conversation.').closed === 0) {
6634
+ await telegram.updateAttentionStatus(attentionId, 'DONE', { silent: true,
6635
+ closedBy: 'cause-cleared', resolution: 'The late reply and its explanation reached the conversation.' });
6636
+ }
6637
+ }
6597
6638
  },
6598
6639
  noticeOwner: typeof originBotToken === 'string' && !!originBotToken && !lifelineOwnsTelegramPoll(config.stateDir, originBotToken) && options.telegram !== false,
6599
6640
  holdsLease: () => coordinator.holdsLease(),
@@ -24828,14 +24869,10 @@ export async function startServer(options) {
24828
24869
  const name = await spawnSessionForTopic(sessionManager, telegram, `proof-${t}`, t, proofSpawnBrief());
24829
24870
  telegram.registerTopicSession(t, name, `proof-${t}`);
24830
24871
  }
24831
- const deadline = Date.now() + timeoutMs;
24832
- while (Date.now() < deadline) {
24872
+ return waitForSettledIdle(async () => {
24833
24873
  const tmux = live();
24834
- if (tmux && (await sessionManager.checkSessionWorkState(tmux)) === 'idle')
24835
- return true;
24836
- await new Promise((r) => setTimeout(r, 5_000));
24837
- }
24838
- return false;
24874
+ return tmux && (await sessionManager.checkSessionWorkState(tmux)) === 'idle' ? tmux : null;
24875
+ }, timeoutMs, { now: () => Date.now(), sleep: (ms) => new Promise((r) => setTimeout(r, ms)) });
24839
24876
  },
24840
24877
  move: (t, to) => planner.proofMove(String(t), to),
24841
24878
  probeViaHolder: async (t, nonce) => {