github-issue-tower-defence-management 1.118.0 → 1.118.1

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 (30) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +5 -3
  3. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +14 -2
  4. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
  5. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js +7 -2
  6. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js.map +1 -1
  7. package/bin/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.js +128 -0
  8. package/bin/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.js.map +1 -0
  9. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js +61 -16
  10. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js.map +1 -1
  11. package/bin/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.js +3 -0
  12. package/bin/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.js.map +1 -0
  13. package/package.json +1 -1
  14. package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +11 -0
  15. package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.test.ts +6 -0
  16. package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts +13 -0
  17. package/src/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.test.ts +251 -0
  18. package/src/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.ts +121 -0
  19. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +218 -9
  20. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.ts +105 -19
  21. package/src/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.ts +20 -0
  22. package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
  23. package/types/adapter/entry-points/handlers/notifySilentTmuxSessions.d.ts +3 -0
  24. package/types/adapter/entry-points/handlers/notifySilentTmuxSessions.d.ts.map +1 -1
  25. package/types/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.d.ts +20 -0
  26. package/types/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.d.ts.map +1 -0
  27. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts +7 -1
  28. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts.map +1 -1
  29. package/types/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.d.ts +19 -0
  30. package/types/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.d.ts.map +1 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.118.1](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.118.0...v1.118.1) (2026-06-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **silent-monitor:** cache hub-task status and suppress resolved-closed fail-opens ([#1128](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1128)) ([c3aa66c](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/c3aa66ccdf677d3de59b215ff812ea61664c32fb))
7
+
1
8
  # [1.118.0](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.117.10...v1.118.0) (2026-06-30)
2
9
 
3
10
 
package/README.md CHANGED
@@ -295,7 +295,9 @@ subAgentRunningThresholdSeconds?: number # Optional: Seconds a sub-process may r
295
295
  silentNotificationStaggerSeconds?: number # Optional: Seconds to wait between consecutive session notifications within one cycle, so the targets are notified sequentially rather than all at once. Default 25
296
296
  candidateDebounceRecencyWindowSeconds?: number # Optional: Recency window in seconds within which a session must have been recorded as a notification candidate in a previous cycle for the two-consecutive-cycle debounce to allow a notification this cycle. A small multiple of the schedule interval to tolerate interval jitter. Default 900
297
297
  candidateDebounceStateFilePath?: string # Optional: Path to the JSON state file that persists the per-cycle candidate session set used by the two-consecutive-cycle debounce. When unset, defaults to ${XDG_CACHE_HOME:-~/.cache}/tdpm/silent-session-candidates.json
298
- activeHubTaskStatus?: string # Optional: GitHub Project Status value that marks a session's hub task as still actively worked in an interactive session. For a session whose name is a `https://github.com/{owner}/{repo}/issues/{N}` issue URL, the hub task's latest Status is resolved before sending and the notification is skipped when the issue is closed or its Status differs from this value. Sessions whose name is not a github.com issue URL are never checked. When the hub task Status cannot be resolved, the notification is sent anyway (fail-open): a genuinely unresolvable hub task (the issue is not found, or its repository cannot be resolved by the token) is logged at info level without an error, while a real transient API error is logged as a warning so it stays visible. When unset, this hub-task active-status check is a no-op and existing behavior is preserved
298
+ activeHubTaskStatus?: string # Optional: GitHub Project Status value that marks a session's hub task as still actively worked in an interactive session. For a session whose name is a `https://github.com/{owner}/{repo}/issues/{N}` issue URL, the hub task's latest state and Status are resolved before sending and the notification is suppressed when the issue is closed or merged, or when its Status differs from this value. Each resolved status is cached by issue URL (see hubTaskStatusCacheStateFilePath and hubTaskStatusCacheTtlSeconds) so a fresh cached entry decides the gate without a new GitHub query. When the hub task cannot be resolved (the resolver returns no tracked task, or a transient API error is thrown), a cached status is used as a fallback even after it expires: a cached active entry keeps the notification (the session is still notified if genuinely stalled) and a cached closed or non-active entry suppresses it. Only when there is no cached status at all and live resolution fails does the gate fail open once, logging a distinct warning. Sessions whose name is not a github.com issue URL are never checked. When unset, this hub-task active-status check is a no-op and existing behavior is preserved
299
+ hubTaskStatusCacheStateFilePath?: string # Optional: Path to the JSON state file that caches each hub task's resolved state and Status keyed by issue URL for the hub-task active-status gate. When unset, defaults to ${XDG_CACHE_HOME:-~/.cache}/tdpm/silent-session-hub-task-status.json
300
+ hubTaskStatusCacheTtlSeconds?: number # Optional: Seconds a cached hub-task status is considered fresh enough to decide the gate without re-querying GitHub. A cached entry older than this is re-resolved, but is still used as a fallback when re-resolution fails. Default 300
299
301
  silentSubAgentIdleMessageHeader?: string # Optional: Overrides the line shown above the sub-process list in the idle (no-output) sub-process message. When unset, a generic built-in line is used
300
302
  silentSubAgentIdleMessageFooter?: string # Optional: Overrides the line shown below the sub-process list in the idle (no-output) sub-process message. When unset, a generic built-in line is used
301
303
  silentSubAgentLongRunningMessageHeader?: string # Optional: Overrides the line shown above the sub-process list in the long-running sub-process message. When unset, a generic built-in line is used
@@ -565,9 +567,9 @@ The main-session stalled section is sent when the session's main output has been
565
567
 
566
568
  The sub-process section is sent, regardless of main output, when at least one sub-process of the session has been output-idle for `subAgentSilentThresholdSeconds` or has been running for `subAgentRunningThresholdSeconds`. It is composed of up to two distinct messages, one per condition: an idle message that lists each sub-process that produced no output for at least `subAgentSilentThresholdSeconds` with its no-output minutes and asks the agent to check whether it is stuck or legitimately waiting on an external dependency, and a long-running message that lists each sub-process that has been running for at least `subAgentRunningThresholdSeconds` with its running minutes and asks the agent to verify it is genuinely advancing rather than caught in an infinite loop, a task that is too large, or a stuck approach. The long-running message foregrounds the running duration and does not surface the short idle time, so a sub-process flagged only for running long is not dismissed because its silent time looks small; a sub-process that matches both conditions appears in both messages. The long-running threshold is overridable per project via `subAgentRunningThresholdSeconds` (default 900 seconds) for repositories whose continuous integration legitimately runs longer. Sub-processes are discovered in one of two ways: when `subAgentTranscriptRootDirectory` is configured, each session's `subagents/agent-<id>.jsonl` transcripts are scanned. The sub-agent directory is the `subagents/` directory that sits next to the session's already-resolved main-session transcript file under `projects/<cwd-slug>/<sessionId>/subagents/`, derived by stripping the `.jsonl` suffix from the main-session transcript path and appending `subagents`; this on-disk path is keyed by the session's working-directory slug and session id, not by the tmux session name. Finished sub-agents are skipped, determined from the last meaningful transcript entry rather than from the last non-null `stop_reason` seen anywhere in the file. A sub-agent is treated as finished when its last entry is a completion or termination marker: an assistant message whose `stop_reason` is `end_turn` or `stop_sequence`, an assistant message whose final content block is `text` (a final answer returned to the parent, which Claude Code often writes with a `null` `stop_reason`), a user message whose final content block is `text` (a terminal user entry such as `[Request interrupted by user]`), a user message whose final content block is a `tool_result`, or a user message with no content blocks. The `tool_result` and empty-user terminal shapes are the ones a sub-agent leaves when it ends right after its last tool call completes — for example the `tool_result` of the final `StructuredOutput` call a sub-agent uses to return its result, the launch acknowledgement of a background command, or any other tool whose result is written but no assistant turn follows because the sub-agent's process is gone (killed, crashed, or token-exhausted). Recognizing these shapes as terminal is what lets a marker-less dead transcript be excluded by the completion signal itself rather than by an age cap. Only a sub-agent whose last entry is an assistant message with a pending `tool_use` block and no following tool result is still considered active and subject to the idle and running thresholds; this is the genuinely-incomplete shape — the sub-agent requested a tool that never returned and is hung mid-work. Idle time is taken from the transcript file modification time (following symlinks) while running time is taken from its first entry timestamp. Because sub-agents run in-process inside the parent session rather than as separate operating-system processes, no process-liveness signal can be matched back to a transcript; the completion-or-termination marker at the end of the transcript is the sole signal used to exclude finished sub-agents. There is no age cap: a sub-agent that is past the idle or running threshold and does not end in a completion or termination marker is flagged regardless of how long it has been silent, so a genuinely-stuck sub-agent that has been hung on a pending tool call for hours or days is still reported instead of being silently dropped. Otherwise sub-processes are discovered by matching `subAgentProcessMatchPattern` against process command lines.
567
569
 
568
- A two-consecutive-cycle debounce guards against transient false positives: a session is notified only when it meets the silent-target condition (output silent at or beyond the threshold and not waiting on the owner) in the current cycle and it was also a notification candidate in the immediately previous cycle. The set of candidate session names is persisted across cycles, keyed by the globally-unique session name, in a state file written atomically (the default path is `${XDG_CACHE_HOME:-~/.cache}/tdpm/silent-session-candidates.json`, overridable via `candidateDebounceStateFilePath`). The monitor runs as a fresh process each schedule cycle, so this on-disk state is what carries the previous cycle's candidate set forward. Each cycle loads the candidate set recorded within `candidateDebounceRecencyWindowSeconds` of now (default 900, a small multiple of the schedule interval to tolerate interval jitter), then records the current candidate set with the current timestamp; entries that age past the retention window are dropped on the next save, and a save merges with other recently-recorded session names so concurrent per-project runs do not clobber each other. A candidate that appears for only one isolated cycle — for example because the owner's reply has not yet been flushed to the transcript when the monitor reads it, or because a transient hub-task status resolution error fails open for a single cycle — is therefore deferred and never notified, while a genuine stall that persists across cycles is still caught, one cycle later. Because silence is measured from the latest transcript entry of any type — including the monitor's own injected reminder and the owner's reply — a notified session's measured silence resets as soon as it produces any activity, so a session that has resumed is not re-flagged. When more than one session is notified in the same cycle, the sends are spaced out sequentially with `silentNotificationStaggerSeconds` between consecutive sends (no wait before the first or after the last) so the targets are not all triggered at once. When `activeHubTaskStatus` is configured, each notification is gated on the latest GitHub Project Status of the session's hub task: a session whose name identifies a github.com issue or pull request — accepted both as a clean `https://github.com/{owner}/{repo}/issues/{N}` URL and as the real tmux session-name form `https_//github_com/{owner}/{repo}/issues/{N}` produced by replacing `.` and `:` with `_` (the `pull` path is accepted in both forms too) — is notified only while that hub task is open and in the configured active Status, so a session whose hub task has been closed or moved to another Status is skipped; sessions whose name does not identify a github.com issue or pull request are never gated, and a hub task whose Status cannot be resolved fails open (the notification is sent): a genuinely unresolvable hub task (the issue is not found, or its repository cannot be resolved by the token) is logged at info level without an error, while a real transient API error is logged as a warning so it stays visible. When `activeHubTaskStatus` is unset, this hub-task check is a no-op. Process-snapshot collection, transcript resolution, owner-call detection, the wait between sends, and the message wording are all performed through injectable ports, so the logic is unit-testable without touching the host, and the host-specific process and environment access, sub-process pattern, and message wording are supplied through adapters or configuration. When `silentNotificationEnabled` is not true the step is a no-op, and any error during the step is logged and swallowed so the schedule cycle is never affected.
570
+ A two-consecutive-cycle debounce guards against transient false positives: a session is notified only when it meets the silent-target condition (output silent at or beyond the threshold and not waiting on the owner) in the current cycle and it was also a notification candidate in the immediately previous cycle. The set of candidate session names is persisted across cycles, keyed by the globally-unique session name, in a state file written atomically (the default path is `${XDG_CACHE_HOME:-~/.cache}/tdpm/silent-session-candidates.json`, overridable via `candidateDebounceStateFilePath`). The monitor runs as a fresh process each schedule cycle, so this on-disk state is what carries the previous cycle's candidate set forward. Each cycle loads the candidate set recorded within `candidateDebounceRecencyWindowSeconds` of now (default 900, a small multiple of the schedule interval to tolerate interval jitter), then records the current candidate set with the current timestamp; entries that age past the retention window are dropped on the next save, and a save merges with other recently-recorded session names so concurrent per-project runs do not clobber each other. A candidate that appears for only one isolated cycle — for example because the owner's reply has not yet been flushed to the transcript when the monitor reads it, or because a transient hub-task status resolution error fails open for a single cycle — is therefore deferred and never notified, while a genuine stall that persists across cycles is still caught, one cycle later. Because silence is measured from the latest transcript entry of any type — including the monitor's own injected reminder and the owner's reply — a notified session's measured silence resets as soon as it produces any activity, so a session that has resumed is not re-flagged. When more than one session is notified in the same cycle, the sends are spaced out sequentially with `silentNotificationStaggerSeconds` between consecutive sends (no wait before the first or after the last) so the targets are not all triggered at once. When `activeHubTaskStatus` is configured, each notification is gated on the latest GitHub state and Project Status of the session's hub task: a session whose name identifies a github.com issue or pull request — accepted both as a clean `https://github.com/{owner}/{repo}/issues/{N}` URL and as the real tmux session-name form `https_//github_com/{owner}/{repo}/issues/{N}` produced by replacing `.` and `:` with `_` (the `pull` path is accepted in both forms too) — is notified only while that hub task is open and in the configured active Status, so a session whose hub task has been closed, merged, or moved to another Status (for example Done) is suppressed; sessions whose name does not identify a github.com issue or pull request are never gated. To cut GitHub query load and remove most fail-opens, each resolved status is cached by issue URL in a state file written atomically (the default path is `${XDG_CACHE_HOME:-~/.cache}/tdpm/silent-session-hub-task-status.json`, overridable via `hubTaskStatusCacheStateFilePath`). On each cycle the gate reads the cache first: a cached entry recorded within `hubTaskStatusCacheTtlSeconds` of now (default 300) decides the gate without any GitHub query, and otherwise the hub task is re-resolved and the result written back to the cache. When live resolution fails — the resolver returns no tracked task (a closed or Done issue filtered out of the active project), or a transient API error is thrown the gate falls back to the cached status even after it has expired: a cached active entry keeps the notification (still notified if genuinely stalled) and a cached closed or non-active entry suppresses it, each logged with a distinct warning. Only when there is no cached status at all and live resolution fails does the gate fail open once (a closed issue and a transient error are indistinguishable in that case without an extra network call), logging a distinct warning, so the next cycle can populate the cache. When `activeHubTaskStatus` is unset, this hub-task check is a no-op. Process-snapshot collection, transcript resolution, owner-call detection, the wait between sends, and the message wording are all performed through injectable ports, so the logic is unit-testable without touching the host, and the host-specific process and environment access, sub-process pattern, and message wording are supplied through adapters or configuration. When `silentNotificationEnabled` is not true the step is a no-op, and any error during the step is logged and swallowed so the schedule cycle is never affected.
569
571
 
570
- Each config key above has a matching environment variable read when the config key is unset: `TDPM_SILENT_NOTIFICATION_ENABLED` (the string `true` enables the step), `TDPM_SILENT_OWNER_CALL_MARKER`, `TDPM_SUBAGENT_OUTPUT_ROOT_DIRECTORY`, `TDPM_SUBAGENT_PROCESS_MATCH_PATTERN`, `TDPM_SUBAGENT_TRANSCRIPT_ROOT_DIRECTORY`, `TDPM_MAIN_SILENT_THRESHOLD_SECONDS`, `TDPM_SUBAGENT_SILENT_THRESHOLD_SECONDS`, `TDPM_SUBAGENT_RUNNING_THRESHOLD_SECONDS`, `TDPM_SILENT_NOTIFICATION_STAGGER_SECONDS`, `TDPM_SILENT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS`, `TDPM_SILENT_CANDIDATE_DEBOUNCE_STATE_FILE_PATH`, `TDPM_ACTIVE_HUB_TASK_STATUS`, `TDPM_SILENT_MAIN_STALLED_MESSAGE`, `TDPM_SILENT_SUBAGENT_IDLE_MESSAGE_HEADER`, `TDPM_SILENT_SUBAGENT_IDLE_MESSAGE_FOOTER`, `TDPM_SILENT_SUBAGENT_LONG_RUNNING_MESSAGE_HEADER`, and `TDPM_SILENT_SUBAGENT_LONG_RUNNING_MESSAGE_FOOTER`.
572
+ Each config key above has a matching environment variable read when the config key is unset: `TDPM_SILENT_NOTIFICATION_ENABLED` (the string `true` enables the step), `TDPM_SILENT_OWNER_CALL_MARKER`, `TDPM_SUBAGENT_OUTPUT_ROOT_DIRECTORY`, `TDPM_SUBAGENT_PROCESS_MATCH_PATTERN`, `TDPM_SUBAGENT_TRANSCRIPT_ROOT_DIRECTORY`, `TDPM_MAIN_SILENT_THRESHOLD_SECONDS`, `TDPM_SUBAGENT_SILENT_THRESHOLD_SECONDS`, `TDPM_SUBAGENT_RUNNING_THRESHOLD_SECONDS`, `TDPM_SILENT_NOTIFICATION_STAGGER_SECONDS`, `TDPM_SILENT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS`, `TDPM_SILENT_CANDIDATE_DEBOUNCE_STATE_FILE_PATH`, `TDPM_ACTIVE_HUB_TASK_STATUS`, `TDPM_SILENT_HUB_TASK_STATUS_CACHE_STATE_FILE_PATH`, `TDPM_SILENT_HUB_TASK_STATUS_CACHE_TTL_SECONDS`, `TDPM_SILENT_MAIN_STALLED_MESSAGE`, `TDPM_SILENT_SUBAGENT_IDLE_MESSAGE_HEADER`, `TDPM_SILENT_SUBAGENT_IDLE_MESSAGE_FOOTER`, `TDPM_SILENT_SUBAGENT_LONG_RUNNING_MESSAGE_HEADER`, and `TDPM_SILENT_SUBAGENT_LONG_RUNNING_MESSAGE_FOOTER`.
571
573
 
572
574
  ## Token Rotation Order File
573
575
 
@@ -107,13 +107,13 @@ class HandleScheduledEventUseCaseHandler {
107
107
  this.handle = async (configFilePath, _verbose) => {
108
108
  const configFileContent = fs_1.default.readFileSync(configFilePath, 'utf8');
109
109
  const input = yaml_1.default.parse(configFileContent);
110
- if (!(() => { const _io0 = input => "string" === typeof input.org && "number" === typeof input.allowIssueCacheMinutes && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io1(input.changeTargetPathAliases)) && "string" === typeof input.projectUrl && "string" === typeof input.projectName && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io2(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || "string" === typeof input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && (undefined === input.dashboardDataDir || "string" === typeof input.dashboardDataDir) && (undefined === input.workflowBlockerStoryName || "string" === typeof input.workflowBlockerStoryName) && (undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir) && (undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl) && (undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken) && (undefined === input.inTmuxProjectOrder || Array.isArray(input.inTmuxProjectOrder) && input.inTmuxProjectOrder.every(elem => "string" === typeof elem)) && (undefined === input.inTmuxLauncherCommand || "string" === typeof input.inTmuxLauncherCommand) && (undefined === input.silentNotificationEnabled || "boolean" === typeof input.silentNotificationEnabled) && (undefined === input.ownerCallMarker || "string" === typeof input.ownerCallMarker) && (undefined === input.subAgentOutputRootDirectory || "string" === typeof input.subAgentOutputRootDirectory) && (undefined === input.subAgentProcessMatchPattern || "string" === typeof input.subAgentProcessMatchPattern) && (undefined === input.subAgentTranscriptRootDirectory || "string" === typeof input.subAgentTranscriptRootDirectory) && (undefined === input.mainSilentThresholdSeconds || "number" === typeof input.mainSilentThresholdSeconds) && (undefined === input.subAgentSilentThresholdSeconds || "number" === typeof input.subAgentSilentThresholdSeconds) && (undefined === input.subAgentRunningThresholdSeconds || "number" === typeof input.subAgentRunningThresholdSeconds) && (undefined === input.silentNotificationStaggerSeconds || "number" === typeof input.silentNotificationStaggerSeconds) && (undefined === input.candidateDebounceRecencyWindowSeconds || "number" === typeof input.candidateDebounceRecencyWindowSeconds) && (undefined === input.candidateDebounceStateFilePath || "string" === typeof input.candidateDebounceStateFilePath) && (undefined === input.activeHubTaskStatus || "string" === typeof input.activeHubTaskStatus) && (undefined === input.silentMainStalledMessage || "string" === typeof input.silentMainStalledMessage) && (undefined === input.silentSubAgentIdleMessageHeader || "string" === typeof input.silentSubAgentIdleMessageHeader) && (undefined === input.silentSubAgentIdleMessageFooter || "string" === typeof input.silentSubAgentIdleMessageFooter) && (undefined === input.silentSubAgentLongRunningMessageHeader || "string" === typeof input.silentSubAgentLongRunningMessageHeader) && (undefined === input.silentSubAgentLongRunningMessageFooter || "string" === typeof input.silentSubAgentLongRunningMessageFooter) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => Object.keys(input).every(key => {
110
+ if (!(() => { const _io0 = input => "string" === typeof input.org && "number" === typeof input.allowIssueCacheMinutes && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io1(input.changeTargetPathAliases)) && "string" === typeof input.projectUrl && "string" === typeof input.projectName && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io2(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || "string" === typeof input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && (undefined === input.dashboardDataDir || "string" === typeof input.dashboardDataDir) && (undefined === input.workflowBlockerStoryName || "string" === typeof input.workflowBlockerStoryName) && (undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir) && (undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl) && (undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken) && (undefined === input.inTmuxProjectOrder || Array.isArray(input.inTmuxProjectOrder) && input.inTmuxProjectOrder.every(elem => "string" === typeof elem)) && (undefined === input.inTmuxLauncherCommand || "string" === typeof input.inTmuxLauncherCommand) && (undefined === input.silentNotificationEnabled || "boolean" === typeof input.silentNotificationEnabled) && (undefined === input.ownerCallMarker || "string" === typeof input.ownerCallMarker) && (undefined === input.subAgentOutputRootDirectory || "string" === typeof input.subAgentOutputRootDirectory) && (undefined === input.subAgentProcessMatchPattern || "string" === typeof input.subAgentProcessMatchPattern) && (undefined === input.subAgentTranscriptRootDirectory || "string" === typeof input.subAgentTranscriptRootDirectory) && (undefined === input.mainSilentThresholdSeconds || "number" === typeof input.mainSilentThresholdSeconds) && (undefined === input.subAgentSilentThresholdSeconds || "number" === typeof input.subAgentSilentThresholdSeconds) && (undefined === input.subAgentRunningThresholdSeconds || "number" === typeof input.subAgentRunningThresholdSeconds) && (undefined === input.silentNotificationStaggerSeconds || "number" === typeof input.silentNotificationStaggerSeconds) && (undefined === input.candidateDebounceRecencyWindowSeconds || "number" === typeof input.candidateDebounceRecencyWindowSeconds) && (undefined === input.candidateDebounceStateFilePath || "string" === typeof input.candidateDebounceStateFilePath) && (undefined === input.activeHubTaskStatus || "string" === typeof input.activeHubTaskStatus) && (undefined === input.hubTaskStatusCacheStateFilePath || "string" === typeof input.hubTaskStatusCacheStateFilePath) && (undefined === input.hubTaskStatusCacheTtlSeconds || "number" === typeof input.hubTaskStatusCacheTtlSeconds) && (undefined === input.silentMainStalledMessage || "string" === typeof input.silentMainStalledMessage) && (undefined === input.silentSubAgentIdleMessageHeader || "string" === typeof input.silentSubAgentIdleMessageHeader) && (undefined === input.silentSubAgentIdleMessageFooter || "string" === typeof input.silentSubAgentIdleMessageFooter) && (undefined === input.silentSubAgentLongRunningMessageHeader || "string" === typeof input.silentSubAgentLongRunningMessageHeader) && (undefined === input.silentSubAgentLongRunningMessageFooter || "string" === typeof input.silentSubAgentLongRunningMessageFooter) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => Object.keys(input).every(key => {
111
111
  const value = input[key];
112
112
  if (undefined === value)
113
113
  return true;
114
114
  return "string" === typeof value;
115
115
  }); const _io2 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io3 = input => "string" === typeof input.defaultAgentName && (null === input.defaultLlmModelName || undefined === input.defaultLlmModelName || "string" === typeof input.defaultLlmModelName) && (null === input.fallbackLlmModelName || undefined === input.fallbackLlmModelName || "string" === typeof input.fallbackLlmModelName) && (null === input.defaultLlmAgentName || undefined === input.defaultLlmAgentName || "string" === typeof input.defaultLlmAgentName) && "string" === typeof input.configFilePath && (null === input.maximumPreparingIssuesCount || "number" === typeof input.maximumPreparingIssuesCount) && (undefined === input.utilizationPercentageThreshold || "number" === typeof input.utilizationPercentageThreshold) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.preparationProcessCheckCommand || "string" === typeof input.preparationProcessCheckCommand) && (null === input.codexHomeCandidates || undefined === input.codexHomeCandidates || Array.isArray(input.codexHomeCandidates) && input.codexHomeCandidates.every(elem => "string" === typeof elem)) && (undefined === input.awLogDirectoryPath || "string" === typeof input.awLogDirectoryPath) && (undefined === input.awLogStaleThresholdMinutes || "number" === typeof input.awLogStaleThresholdMinutes) && (null === input.awaitingQualityCheckStatus || undefined === input.awaitingQualityCheckStatus || "string" === typeof input.awaitingQualityCheckStatus) && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)); const _io4 = input => "string" === typeof input.scanBaseDirectory && "number" === typeof input.targetHourUtc && (undefined === input.enableKevNvdReport || "boolean" === typeof input.enableKevNvdReport) && (undefined === input.kevReportRepo || "string" === typeof input.kevReportRepo); const _io5 = input => "object" === typeof input.manager && null !== input.manager && _io6(input.manager) && ("object" === typeof input.bot && null !== input.bot && _io10(input.bot)); const _io6 = input => "object" === typeof input.github && null !== input.github && _io7(input.github) && ("object" === typeof input.slack && null !== input.slack && _io8(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && _io9(input.googleServiceAccount)); const _io7 = input => "string" === typeof input.token; const _io8 = input => "string" === typeof input.userToken; const _io9 = input => "string" === typeof input.serviceAccountKey; const _io10 = input => "object" === typeof input.github && null !== input.github && _io11(input.github); const _io11 = input => "string" === typeof input.token; return input => "object" === typeof input && null !== input && _io0(input); })()(input)) {
116
- throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.org && "number" === typeof input.allowIssueCacheMinutes && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io1(input.changeTargetPathAliases)) && "string" === typeof input.projectUrl && "string" === typeof input.projectName && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io2(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || "string" === typeof input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && (undefined === input.dashboardDataDir || "string" === typeof input.dashboardDataDir) && (undefined === input.workflowBlockerStoryName || "string" === typeof input.workflowBlockerStoryName) && (undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir) && (undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl) && (undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken) && (undefined === input.inTmuxProjectOrder || Array.isArray(input.inTmuxProjectOrder) && input.inTmuxProjectOrder.every(elem => "string" === typeof elem)) && (undefined === input.inTmuxLauncherCommand || "string" === typeof input.inTmuxLauncherCommand) && (undefined === input.silentNotificationEnabled || "boolean" === typeof input.silentNotificationEnabled) && (undefined === input.ownerCallMarker || "string" === typeof input.ownerCallMarker) && (undefined === input.subAgentOutputRootDirectory || "string" === typeof input.subAgentOutputRootDirectory) && (undefined === input.subAgentProcessMatchPattern || "string" === typeof input.subAgentProcessMatchPattern) && (undefined === input.subAgentTranscriptRootDirectory || "string" === typeof input.subAgentTranscriptRootDirectory) && (undefined === input.mainSilentThresholdSeconds || "number" === typeof input.mainSilentThresholdSeconds) && (undefined === input.subAgentSilentThresholdSeconds || "number" === typeof input.subAgentSilentThresholdSeconds) && (undefined === input.subAgentRunningThresholdSeconds || "number" === typeof input.subAgentRunningThresholdSeconds) && (undefined === input.silentNotificationStaggerSeconds || "number" === typeof input.silentNotificationStaggerSeconds) && (undefined === input.candidateDebounceRecencyWindowSeconds || "number" === typeof input.candidateDebounceRecencyWindowSeconds) && (undefined === input.candidateDebounceStateFilePath || "string" === typeof input.candidateDebounceStateFilePath) && (undefined === input.activeHubTaskStatus || "string" === typeof input.activeHubTaskStatus) && (undefined === input.silentMainStalledMessage || "string" === typeof input.silentMainStalledMessage) && (undefined === input.silentSubAgentIdleMessageHeader || "string" === typeof input.silentSubAgentIdleMessageHeader) && (undefined === input.silentSubAgentIdleMessageFooter || "string" === typeof input.silentSubAgentIdleMessageFooter) && (undefined === input.silentSubAgentLongRunningMessageHeader || "string" === typeof input.silentSubAgentLongRunningMessageHeader) && (undefined === input.silentSubAgentLongRunningMessageFooter || "string" === typeof input.silentSubAgentLongRunningMessageFooter) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => Object.keys(input).every(key => {
116
+ throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.org && "number" === typeof input.allowIssueCacheMinutes && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io1(input.changeTargetPathAliases)) && "string" === typeof input.projectUrl && "string" === typeof input.projectName && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io2(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || "string" === typeof input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && (undefined === input.dashboardDataDir || "string" === typeof input.dashboardDataDir) && (undefined === input.workflowBlockerStoryName || "string" === typeof input.workflowBlockerStoryName) && (undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir) && (undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl) && (undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken) && (undefined === input.inTmuxProjectOrder || Array.isArray(input.inTmuxProjectOrder) && input.inTmuxProjectOrder.every(elem => "string" === typeof elem)) && (undefined === input.inTmuxLauncherCommand || "string" === typeof input.inTmuxLauncherCommand) && (undefined === input.silentNotificationEnabled || "boolean" === typeof input.silentNotificationEnabled) && (undefined === input.ownerCallMarker || "string" === typeof input.ownerCallMarker) && (undefined === input.subAgentOutputRootDirectory || "string" === typeof input.subAgentOutputRootDirectory) && (undefined === input.subAgentProcessMatchPattern || "string" === typeof input.subAgentProcessMatchPattern) && (undefined === input.subAgentTranscriptRootDirectory || "string" === typeof input.subAgentTranscriptRootDirectory) && (undefined === input.mainSilentThresholdSeconds || "number" === typeof input.mainSilentThresholdSeconds) && (undefined === input.subAgentSilentThresholdSeconds || "number" === typeof input.subAgentSilentThresholdSeconds) && (undefined === input.subAgentRunningThresholdSeconds || "number" === typeof input.subAgentRunningThresholdSeconds) && (undefined === input.silentNotificationStaggerSeconds || "number" === typeof input.silentNotificationStaggerSeconds) && (undefined === input.candidateDebounceRecencyWindowSeconds || "number" === typeof input.candidateDebounceRecencyWindowSeconds) && (undefined === input.candidateDebounceStateFilePath || "string" === typeof input.candidateDebounceStateFilePath) && (undefined === input.activeHubTaskStatus || "string" === typeof input.activeHubTaskStatus) && (undefined === input.hubTaskStatusCacheStateFilePath || "string" === typeof input.hubTaskStatusCacheStateFilePath) && (undefined === input.hubTaskStatusCacheTtlSeconds || "number" === typeof input.hubTaskStatusCacheTtlSeconds) && (undefined === input.silentMainStalledMessage || "string" === typeof input.silentMainStalledMessage) && (undefined === input.silentSubAgentIdleMessageHeader || "string" === typeof input.silentSubAgentIdleMessageHeader) && (undefined === input.silentSubAgentIdleMessageFooter || "string" === typeof input.silentSubAgentIdleMessageFooter) && (undefined === input.silentSubAgentLongRunningMessageHeader || "string" === typeof input.silentSubAgentLongRunningMessageHeader) && (undefined === input.silentSubAgentLongRunningMessageFooter || "string" === typeof input.silentSubAgentLongRunningMessageFooter) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => Object.keys(input).every(key => {
117
117
  const value = input[key];
118
118
  if (undefined === value)
119
119
  return true;
@@ -298,6 +298,14 @@ class HandleScheduledEventUseCaseHandler {
298
298
  path: _path + ".activeHubTaskStatus",
299
299
  expected: "(string | undefined)",
300
300
  value: input.activeHubTaskStatus
301
+ }), undefined === input.hubTaskStatusCacheStateFilePath || "string" === typeof input.hubTaskStatusCacheStateFilePath || _report(_exceptionable, {
302
+ path: _path + ".hubTaskStatusCacheStateFilePath",
303
+ expected: "(string | undefined)",
304
+ value: input.hubTaskStatusCacheStateFilePath
305
+ }), undefined === input.hubTaskStatusCacheTtlSeconds || "number" === typeof input.hubTaskStatusCacheTtlSeconds || _report(_exceptionable, {
306
+ path: _path + ".hubTaskStatusCacheTtlSeconds",
307
+ expected: "(number | undefined)",
308
+ value: input.hubTaskStatusCacheTtlSeconds
301
309
  }), undefined === input.silentMainStalledMessage || "string" === typeof input.silentMainStalledMessage || _report(_exceptionable, {
302
310
  path: _path + ".silentMainStalledMessage",
303
311
  expected: "(string | undefined)",
@@ -798,6 +806,10 @@ class HandleScheduledEventUseCaseHandler {
798
806
  process.env.TDPM_ACTIVE_HUB_TASK_STATUS ??
799
807
  null,
800
808
  hubTaskStatusResolver: issueRepository,
809
+ hubTaskStatusCacheStateFilePath: mergedInput.hubTaskStatusCacheStateFilePath ??
810
+ process.env.TDPM_SILENT_HUB_TASK_STATUS_CACHE_STATE_FILE_PATH ??
811
+ null,
812
+ hubTaskStatusCacheTtlSeconds: readSilentSeconds(mergedInput.hubTaskStatusCacheTtlSeconds, process.env.TDPM_SILENT_HUB_TASK_STATUS_CACHE_TTL_SECONDS, notifySilentTmuxSessions_1.DEFAULT_NOTIFY_SILENT_TMUX_SESSIONS_PARAMS.hubTaskStatusCacheTtlSeconds),
801
813
  messageTemplates: {
802
814
  mainStalledMessage: mergedInput.silentMainStalledMessage ??
803
815
  process.env.TDPM_SILENT_MAIN_STALLED_MESSAGE ??
@@ -1 +1 @@
1
- {"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,+DAA2D;AAC3D,6DAAyD;AACzD,6DAAyD;AACzD,+DAA2D;AAC3D,2DAAuD;AACvD,uEAAmE;AACnE,qFAAkF;AAClF,uEAAmE;AACnE,yEAGoC;AACpC,uEAAmE;AACnE,wDAG8B;AAC9B,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wF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C,GAAG,CAAC,gDAAgD;gCAC5D,IAAI;4BACN,gCAAgC,EAC9B,WAAW,CAAC,sCAAsC;gCAClD,OAAO,CAAC,GAAG,CAAC,gDAAgD;gCAC5D,IAAI;yBACP;wBACD,GAAG,EAAE,SAAS;qBACf,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CACX,0CACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CAAA;AAlkBD,gFAkkBC"}
1
+ {"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,+DAA2D;AAC3D,6DAAyD;AACzD,6DAAyD;AACzD,+DAA2D;AAC3D,2DAAuD;AACvD,uEAAmE;AACnE,qFAAkF;AAClF,uEAAmE;AACnE,yEAGoC;AACpC,uEAAmE;AACnE,wDAG8B;AAC9B,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,sGAAmG;AACnG,gGAA6F;AAC7F,kGAA+F;AAC/F,gIAA6H;AAC7H,oHAAiH;AACjH,wGAAqG;AAIrG,0FAAuF;AACvF,wGAAqG;AACrG,gIAA6H;AAC7H,wGAAqG;AACrG,kIAA+H;AAC/H,8GAA2G;AAC3G,0GAAuG;AACvG,wGAAqG;AACrG,0HAAuH;AACvH,8GAA2G;AAC3G,8FAA2F;AAC3F,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sC;gCAClD,OAAO,CAAC,GAAG,CAAC,gDAAgD;gCAC5D,IAAI;yBACP;wBACD,GAAG,EAAE,SAAS;qBACf,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CACX,0CACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CAAA;AA7kBD,gFA6kBC"}
@@ -18,6 +18,7 @@ const FileSystemSubAgentSilentSecondsResolver_1 = require("../../repositories/Fi
18
18
  const ConfigurableSilentSessionMessageComposer_1 = require("../../repositories/ConfigurableSilentSessionMessageComposer");
19
19
  const RealSleeper_1 = require("../../repositories/RealSleeper");
20
20
  const FileSystemSilentSessionCandidateStateRepository_1 = require("../../repositories/FileSystemSilentSessionCandidateStateRepository");
21
+ const FileSystemSilentSessionHubTaskStatusCacheRepository_1 = require("../../repositories/FileSystemSilentSessionHubTaskStatusCacheRepository");
21
22
  const createOwnerCallStatusProvider = (ownerCallMarker) => {
22
23
  if (ownerCallMarker !== null && ownerCallMarker.length > 0) {
23
24
  return new TranscriptOwnerCallStatusProvider_1.TranscriptOwnerCallStatusProvider(ownerCallMarker);
@@ -31,7 +32,7 @@ const createSubAgentActivityRepository = (subAgentTranscriptRootDirectory, subAg
31
32
  return new ProcessListSessionSubAgentActivityRepository_1.ProcessListSessionSubAgentActivityRepository(subAgentProcessMatchPattern, new NodeSubAgentProcessLister_1.NodeSubAgentProcessLister(localCommandRunner), new FileSystemSubAgentSilentSecondsResolver_1.FileSystemSubAgentSilentSecondsResolver(subAgentOutputRootDirectory, now));
32
33
  };
33
34
  const notifySilentTmuxSessions = async (params) => {
34
- const { enabled, localCommandRunner, processEnvironReader, ownerCallMarker, subAgentOutputRootDirectory, subAgentProcessMatchPattern, subAgentTranscriptRootDirectory, mainSilentThresholdSeconds, subAgentSilentThresholdSeconds, subAgentRunningThresholdSeconds, staggerSeconds, candidateDebounceRecencyWindowSeconds, candidateDebounceStateFilePath, activeHubTaskStatus, hubTaskStatusResolver, messageTemplates, now, } = params;
35
+ const { enabled, localCommandRunner, processEnvironReader, ownerCallMarker, subAgentOutputRootDirectory, subAgentProcessMatchPattern, subAgentTranscriptRootDirectory, mainSilentThresholdSeconds, subAgentSilentThresholdSeconds, subAgentRunningThresholdSeconds, staggerSeconds, candidateDebounceRecencyWindowSeconds, candidateDebounceStateFilePath, activeHubTaskStatus, hubTaskStatusResolver, hubTaskStatusCacheStateFilePath, hubTaskStatusCacheTtlSeconds, messageTemplates, now, } = params;
35
36
  if (!enabled) {
36
37
  console.log('Silent live session notification skipped: not enabled (set silentNotificationEnabled or TDPM_SILENT_NOTIFICATION_ENABLED=true to enable).');
37
38
  return;
@@ -39,7 +40,9 @@ const notifySilentTmuxSessions = async (params) => {
39
40
  const messageComposer = new ConfigurableSilentSessionMessageComposer_1.ConfigurableSilentSessionMessageComposer(messageTemplates, new DefaultSilentSessionMessageComposer_1.DefaultSilentSessionMessageComposer(ownerCallMarker));
40
41
  const useCase = new NotifySilentLiveSessionsUseCase_1.NotifySilentLiveSessionsUseCase(new LocalProcessLiveSessionProcessSnapshotProvider_1.LocalProcessLiveSessionProcessSnapshotProvider(localCommandRunner, processEnvironReader ?? new ProcFsProcessEnvironReader_1.ProcFsProcessEnvironReader()), new FileSystemInteractiveLiveSessionTranscriptResolver_1.FileSystemInteractiveLiveSessionTranscriptResolver(), new FileSystemSessionOutputActivityRepository_1.FileSystemSessionOutputActivityRepository(), createSubAgentActivityRepository(subAgentTranscriptRootDirectory, subAgentProcessMatchPattern, subAgentOutputRootDirectory, localCommandRunner, now), createOwnerCallStatusProvider(ownerCallMarker), new TmuxSilentSessionNotificationRepository_1.TmuxSilentSessionNotificationRepository(localCommandRunner), candidateDebounceStateFilePath !== null
41
42
  ? new FileSystemSilentSessionCandidateStateRepository_1.FileSystemSilentSessionCandidateStateRepository(candidateDebounceStateFilePath)
42
- : new FileSystemSilentSessionCandidateStateRepository_1.FileSystemSilentSessionCandidateStateRepository(), messageComposer, new RealSleeper_1.RealSleeper(), hubTaskStatusResolver);
43
+ : new FileSystemSilentSessionCandidateStateRepository_1.FileSystemSilentSessionCandidateStateRepository(), messageComposer, new RealSleeper_1.RealSleeper(), hubTaskStatusResolver, hubTaskStatusCacheStateFilePath !== null
44
+ ? new FileSystemSilentSessionHubTaskStatusCacheRepository_1.FileSystemSilentSessionHubTaskStatusCacheRepository(hubTaskStatusCacheStateFilePath)
45
+ : new FileSystemSilentSessionHubTaskStatusCacheRepository_1.FileSystemSilentSessionHubTaskStatusCacheRepository());
43
46
  await useCase.run({
44
47
  mainSilentThresholdSeconds,
45
48
  subAgentSilentThresholdSeconds,
@@ -47,6 +50,7 @@ const notifySilentTmuxSessions = async (params) => {
47
50
  staggerSeconds,
48
51
  candidateDebounceRecencyWindowSeconds,
49
52
  activeHubTaskStatus,
53
+ hubTaskStatusCacheTtlSeconds,
50
54
  now,
51
55
  });
52
56
  };
@@ -57,5 +61,6 @@ exports.DEFAULT_NOTIFY_SILENT_TMUX_SESSIONS_PARAMS = {
57
61
  subAgentRunningThresholdSeconds: NotifySilentLiveSessionsUseCase_1.DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
58
62
  staggerSeconds: NotifySilentLiveSessionsUseCase_1.DEFAULT_NOTIFICATION_STAGGER_SECONDS,
59
63
  candidateDebounceRecencyWindowSeconds: NotifySilentLiveSessionsUseCase_1.DEFAULT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS,
64
+ hubTaskStatusCacheTtlSeconds: NotifySilentLiveSessionsUseCase_1.DEFAULT_HUB_TASK_STATUS_CACHE_TTL_SECONDS,
60
65
  };
61
66
  //# sourceMappingURL=notifySilentTmuxSessions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifySilentTmuxSessions.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":";;;AAIA,8GAQkE;AAClE,sHAAmH;AACnH,sIAAmI;AACnI,8FAA2F;AAC3F,8IAA2I;AAC3I,4HAAyH;AACzH,wHAAqH;AACrH,gHAA6G;AAC7G,4GAAyG;AACzG,kIAA+H;AAC/H,gIAA6H;AAC7H,oIAAiI;AACjI,4FAAyF;AACzF,wHAAqH;AACrH,0HAGqE;AACrE,gEAA6D;AAC7D,wIAAqI;AAsBrI,MAAM,6BAA6B,GAAG,CACpC,eAA8B,EACL,EAAE;IAC3B,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,qEAAiC,CAAC,eAAe,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,IAAI,yEAAmC,EAAE,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,gCAAgC,GAAG,CACvC,+BAA8C,EAC9C,2BAA0C,EAC1C,2BAA0C,EAC1C,kBAAsC,EACtC,GAAS,EAC0B,EAAE;IACrC,IAAI,+BAA+B,KAAK,IAAI,EAAE,CAAC;QAC7C,OAAO,IAAI,yFAA2C,CACpD,IAAI,6FAA6C,CAC/C,+BAA+B,CAChC,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,2FAA4C,CACrD,2BAA2B,EAC3B,IAAI,qDAAyB,CAAC,kBAAkB,CAAC,EACjD,IAAI,iFAAuC,CACzC,2BAA2B,EAC3B,GAAG,CACJ,CACF,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,wBAAwB,GAAG,KAAK,EAC3C,MAAsC,EACvB,EAAE;IACjB,MAAM,EACJ,OAAO,EACP,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,8BAA8B,EAC9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CAC3C,CAAC"}
1
+ {"version":3,"file":"notifySilentTmuxSessions.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":";;;AAIA,8GASkE;AAClE,sHAAmH;AACnH,sIAAmI;AACnI,8FAA2F;AAC3F,8IAA2I;AAC3I,4HAAyH;AACzH,wHAAqH;AACrH,gHAA6G;AAC7G,4GAAyG;AACzG,kIAA+H;AAC/H,gIAA6H;AAC7H,oIAAiI;AACjI,4FAAyF;AACzF,wHAAqH;AACrH,0HAGqE;AACrE,gEAA6D;AAC7D,wIAAqI;AACrI,gJAA6I;AAwB7I,MAAM,6BAA6B,GAAG,CACpC,eAA8B,EACL,EAAE;IAC3B,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,qEAAiC,CAAC,eAAe,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,IAAI,yEAAmC,EAAE,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,gCAAgC,GAAG,CACvC,+BAA8C,EAC9C,2BAA0C,EAC1C,2BAA0C,EAC1C,kBAAsC,EACtC,GAAS,EAC0B,EAAE;IACrC,IAAI,+BAA+B,KAAK,IAAI,EAAE,CAAC;QAC7C,OAAO,IAAI,yFAA2C,CACpD,IAAI,6FAA6C,CAC/C,+BAA+B,CAChC,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,2FAA4C,CACrD,2BAA2B,EAC3B,IAAI,qDAAyB,CAAC,kBAAkB,CAAC,EACjD,IAAI,iFAAuC,CACzC,2BAA2B,EAC3B,GAAG,CACJ,CACF,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,wBAAwB,GAAG,KAAK,EAC3C,MAAsC,EACvB,EAAE;IACjB,MAAM,EACJ,OAAO,EACP,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,EAC3B,+BA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AAC;AA1EW,QAAA,wBAAwB,4BA0EnC;AAEW,QAAA,0CAA0C,GAAG;IACxD,0BAA0B,EAAE,uEAAqC;IACjE,8BAA8B,EAAE,2EAAyC;IACzE,+BAA+B,EAAE,4EAA0C;IAC3E,cAAc,EAAE,sEAAoC;IACpD,qCAAqC,EACnC,mFAAiD;IACnD,4BAA4B,EAAE,2EAAyC;CAC/D,CAAC"}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.FileSystemSilentSessionHubTaskStatusCacheRepository = exports.DEFAULT_HUB_TASK_STATUS_RETENTION_WINDOW_SECONDS = void 0;
37
+ const fs = __importStar(require("fs"));
38
+ const os = __importStar(require("os"));
39
+ const path = __importStar(require("path"));
40
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
41
+ const isIssueState = (value) => value === 'OPEN' || value === 'CLOSED' || value === 'MERGED';
42
+ exports.DEFAULT_HUB_TASK_STATUS_RETENTION_WINDOW_SECONDS = 60 * 60;
43
+ const defaultStateFilePath = () => {
44
+ const base = process.env.XDG_CACHE_HOME ?? path.join(os.homedir(), '.cache');
45
+ return path.join(base, 'tdpm', 'silent-session-hub-task-status.json');
46
+ };
47
+ class FileSystemSilentSessionHubTaskStatusCacheRepository {
48
+ constructor(stateFilePath = defaultStateFilePath(), retentionWindowSeconds = exports.DEFAULT_HUB_TASK_STATUS_RETENTION_WINDOW_SECONDS) {
49
+ this.stateFilePath = stateFilePath;
50
+ this.retentionWindowSeconds = retentionWindowSeconds;
51
+ this.loadHubTaskStatus = async (params) => {
52
+ for (const entry of this.readEntries()) {
53
+ if (entry.url === params.url) {
54
+ return entry;
55
+ }
56
+ }
57
+ return null;
58
+ };
59
+ this.saveHubTaskStatus = async (params) => {
60
+ const recordedEpochSeconds = Math.floor(params.now.getTime() / 1000);
61
+ const oldestRetainedEpochSeconds = recordedEpochSeconds - this.retentionWindowSeconds;
62
+ const mergedByUrl = new Map();
63
+ for (const entry of this.readEntries()) {
64
+ if (entry.recordedEpochSeconds >= oldestRetainedEpochSeconds &&
65
+ entry.url !== params.url) {
66
+ mergedByUrl.set(entry.url, entry);
67
+ }
68
+ }
69
+ mergedByUrl.set(params.url, {
70
+ url: params.url,
71
+ state: params.state,
72
+ status: params.status,
73
+ recordedEpochSeconds,
74
+ });
75
+ this.writeEntries(Array.from(mergedByUrl.values()));
76
+ };
77
+ this.readEntries = () => {
78
+ let raw;
79
+ try {
80
+ raw = fs.readFileSync(this.stateFilePath, 'utf8');
81
+ }
82
+ catch {
83
+ return [];
84
+ }
85
+ let parsed;
86
+ try {
87
+ parsed = JSON.parse(raw);
88
+ }
89
+ catch {
90
+ return [];
91
+ }
92
+ if (!isRecord(parsed)) {
93
+ return [];
94
+ }
95
+ const storedEntries = parsed.hubTaskStatuses;
96
+ if (!Array.isArray(storedEntries)) {
97
+ return [];
98
+ }
99
+ const entries = [];
100
+ for (const storedEntry of storedEntries) {
101
+ if (!isRecord(storedEntry)) {
102
+ continue;
103
+ }
104
+ const url = storedEntry.url;
105
+ const state = storedEntry.state;
106
+ const status = storedEntry.status;
107
+ const recordedEpochSeconds = storedEntry.recordedEpochSeconds;
108
+ if (typeof url === 'string' &&
109
+ isIssueState(state) &&
110
+ (typeof status === 'string' || status === null) &&
111
+ typeof recordedEpochSeconds === 'number' &&
112
+ Number.isFinite(recordedEpochSeconds)) {
113
+ entries.push({ url, state, status, recordedEpochSeconds });
114
+ }
115
+ }
116
+ return entries;
117
+ };
118
+ this.writeEntries = (entries) => {
119
+ const directory = path.dirname(this.stateFilePath);
120
+ fs.mkdirSync(directory, { recursive: true });
121
+ const temporaryPath = `${this.stateFilePath}.${process.pid}.tmp`;
122
+ fs.writeFileSync(temporaryPath, JSON.stringify({ hubTaskStatuses: entries }));
123
+ fs.renameSync(temporaryPath, this.stateFilePath);
124
+ };
125
+ }
126
+ }
127
+ exports.FileSystemSilentSessionHubTaskStatusCacheRepository = FileSystemSilentSessionHubTaskStatusCacheRepository;
128
+ //# sourceMappingURL=FileSystemSilentSessionHubTaskStatusCacheRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSystemSilentSessionHubTaskStatusCacheRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAO7B,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,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AAC;IA7FC,CAAC;CA8FL;AAlGD,kHAkGC"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotifySilentLiveSessionsUseCase = exports.isGitHubIssueOrPullRequestSessionName = exports.parseHubTaskIssueUrlFromSessionName = exports.DEFAULT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS = exports.DEFAULT_NOTIFICATION_STAGGER_SECONDS = exports.DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS = exports.DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS = exports.DEFAULT_MAIN_SILENT_THRESHOLD_SECONDS = void 0;
3
+ exports.NotifySilentLiveSessionsUseCase = exports.isGitHubIssueOrPullRequestSessionName = exports.parseHubTaskIssueUrlFromSessionName = exports.DEFAULT_HUB_TASK_STATUS_CACHE_TTL_SECONDS = exports.DEFAULT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS = exports.DEFAULT_NOTIFICATION_STAGGER_SECONDS = exports.DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS = exports.DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS = exports.DEFAULT_MAIN_SILENT_THRESHOLD_SECONDS = void 0;
4
4
  const ResolveInteractiveLiveSessionsUseCase_1 = require("./ResolveInteractiveLiveSessionsUseCase");
5
5
  exports.DEFAULT_MAIN_SILENT_THRESHOLD_SECONDS = 10 * 60;
6
6
  exports.DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS = 5 * 60;
7
7
  exports.DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS = 15 * 60;
8
8
  exports.DEFAULT_NOTIFICATION_STAGGER_SECONDS = 25;
9
9
  exports.DEFAULT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS = 15 * 60;
10
+ exports.DEFAULT_HUB_TASK_STATUS_CACHE_TTL_SECONDS = 5 * 60;
10
11
  const GITHUB_ISSUE_OR_PULL_URL_PATTERN = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\/(?:issues|pull)\/(\d+)$/;
11
12
  const GITHUB_TMUX_SESSION_NAME_PATTERN = /^https_\/\/github_com\/([^/]+)\/([^/]+)\/(?:issues|pull)\/(\d+)$/;
12
13
  const parseHubTaskIssueUrlFromSessionName = (sessionName) => {
@@ -26,7 +27,7 @@ const GITHUB_ISSUE_OR_PULL_REQUEST_SESSION_NAME_PATTERN = /^https(:\/\/|_\/\/)gi
26
27
  const isGitHubIssueOrPullRequestSessionName = (sessionName) => GITHUB_ISSUE_OR_PULL_REQUEST_SESSION_NAME_PATTERN.test(sessionName);
27
28
  exports.isGitHubIssueOrPullRequestSessionName = isGitHubIssueOrPullRequestSessionName;
28
29
  class NotifySilentLiveSessionsUseCase {
29
- constructor(liveSessionProcessSnapshotProvider, interactiveLiveSessionTranscriptResolver, sessionOutputActivityRepository, subAgentActivityRepository, ownerCallStatusProvider, notificationRepository, candidateStateRepository, messageComposer, sleeper, hubTaskStatusResolver = null) {
30
+ constructor(liveSessionProcessSnapshotProvider, interactiveLiveSessionTranscriptResolver, sessionOutputActivityRepository, subAgentActivityRepository, ownerCallStatusProvider, notificationRepository, candidateStateRepository, messageComposer, sleeper, hubTaskStatusResolver = null, hubTaskStatusCacheRepository = null) {
30
31
  this.liveSessionProcessSnapshotProvider = liveSessionProcessSnapshotProvider;
31
32
  this.interactiveLiveSessionTranscriptResolver = interactiveLiveSessionTranscriptResolver;
32
33
  this.sessionOutputActivityRepository = sessionOutputActivityRepository;
@@ -37,6 +38,7 @@ class NotifySilentLiveSessionsUseCase {
37
38
  this.messageComposer = messageComposer;
38
39
  this.sleeper = sleeper;
39
40
  this.hubTaskStatusResolver = hubTaskStatusResolver;
41
+ this.hubTaskStatusCacheRepository = hubTaskStatusCacheRepository;
40
42
  this.resolveInteractiveLiveSessions = new ResolveInteractiveLiveSessionsUseCase_1.ResolveInteractiveLiveSessionsUseCase();
41
43
  this.run = async (params) => {
42
44
  const snapshot = await this.liveSessionProcessSnapshotProvider.getSnapshot();
@@ -73,7 +75,7 @@ class NotifySilentLiveSessionsUseCase {
73
75
  console.log(`Silent live session notification: ${debouncedCandidates.length} debounced candidate(s) of ${candidates.length} current candidate(s) across ${interactiveSessions.length} interactive session(s); ${suppressedFirstCycleCount} first-cycle candidate(s) deferred until they persist into the next cycle.`);
74
76
  let sentCount = 0;
75
77
  for (const candidate of debouncedCandidates) {
76
- if (!(await this.isHubTaskActive(candidate.sessionName, params.activeHubTaskStatus))) {
78
+ if (!(await this.isHubTaskActive(candidate.sessionName, params.activeHubTaskStatus, params.hubTaskStatusCacheTtlSeconds, params.now))) {
77
79
  continue;
78
80
  }
79
81
  if (sentCount > 0) {
@@ -84,7 +86,7 @@ class NotifySilentLiveSessionsUseCase {
84
86
  console.log(`Notified ${candidate.sessionName}.`);
85
87
  }
86
88
  };
87
- this.isHubTaskActive = async (sessionName, activeHubTaskStatus) => {
89
+ this.isHubTaskActive = async (sessionName, activeHubTaskStatus, hubTaskStatusCacheTtlSeconds, now) => {
88
90
  if (activeHubTaskStatus === null || this.hubTaskStatusResolver === null) {
89
91
  return true;
90
92
  }
@@ -92,23 +94,66 @@ class NotifySilentLiveSessionsUseCase {
92
94
  if (hubTaskIssueUrl === null) {
93
95
  return true;
94
96
  }
95
- try {
96
- const issue = await this.hubTaskStatusResolver.getIssueByUrl(hubTaskIssueUrl);
97
- if (issue === null) {
98
- console.log(`Hub task ${hubTaskIssueUrl} for session ${sessionName} is not a resolvable tracked task; sending notification (fail-open).`);
99
- return true;
100
- }
101
- if (issue.state !== 'OPEN' || issue.status !== activeHubTaskStatus) {
102
- console.log(`Skipping ${sessionName}: hub task ${hubTaskIssueUrl} is no longer active (state "${issue.state}", status "${issue.status ?? 'null'}", active status "${activeHubTaskStatus}").`);
103
- return false;
97
+ const cachedEntry = this.hubTaskStatusCacheRepository === null
98
+ ? null
99
+ : await this.hubTaskStatusCacheRepository.loadHubTaskStatus({
100
+ url: hubTaskIssueUrl,
101
+ });
102
+ const nowEpochSeconds = Math.floor(now.getTime() / 1000);
103
+ if (cachedEntry !== null) {
104
+ const cacheAgeSeconds = nowEpochSeconds - cachedEntry.recordedEpochSeconds;
105
+ if (cacheAgeSeconds <= hubTaskStatusCacheTtlSeconds) {
106
+ const active = this.isResolvedStatusActive(cachedEntry.state, cachedEntry.status, activeHubTaskStatus);
107
+ if (!active) {
108
+ console.log(`Skipping ${sessionName}: hub task ${hubTaskIssueUrl} is no longer active per cached status (state "${cachedEntry.state}", status "${cachedEntry.status ?? 'null'}", active status "${activeHubTaskStatus}").`);
109
+ }
110
+ return active;
104
111
  }
105
- return true;
112
+ }
113
+ const resolution = await this.tryResolveAndCacheHubTask(hubTaskIssueUrl, activeHubTaskStatus, sessionName, now);
114
+ if (resolution.resolved) {
115
+ return resolution.active;
116
+ }
117
+ if (cachedEntry !== null) {
118
+ const active = this.isResolvedStatusActive(cachedEntry.state, cachedEntry.status, activeHubTaskStatus);
119
+ console.warn(`Hub task ${hubTaskIssueUrl} for session ${sessionName} could not be resolved (${resolution.reason}); falling back to expired cached status (state "${cachedEntry.state}", status "${cachedEntry.status ?? 'null'}"), so the notification is ${active ? 'sent' : 'suppressed'}.`);
120
+ return active;
121
+ }
122
+ console.warn(`Hub task ${hubTaskIssueUrl} for session ${sessionName} is not resolvable and has no cached status (${resolution.reason}); sending notification (fail-open).`);
123
+ return true;
124
+ };
125
+ this.tryResolveAndCacheHubTask = async (hubTaskIssueUrl, activeHubTaskStatus, sessionName, now) => {
126
+ if (this.hubTaskStatusResolver === null) {
127
+ return { resolved: false, reason: 'resolver is not configured' };
128
+ }
129
+ let issue;
130
+ try {
131
+ issue = await this.hubTaskStatusResolver.getIssueByUrl(hubTaskIssueUrl);
106
132
  }
107
133
  catch (error) {
108
- console.warn(`Failed to resolve hub task status for session ${sessionName} (${hubTaskIssueUrl}); sending notification (fail-open): ${error instanceof Error ? error.message : String(error)}`);
109
- return true;
134
+ return {
135
+ resolved: false,
136
+ reason: error instanceof Error ? error.message : String(error),
137
+ };
138
+ }
139
+ if (issue === null) {
140
+ return { resolved: false, reason: 'resolver returned no tracked task' };
141
+ }
142
+ if (this.hubTaskStatusCacheRepository !== null) {
143
+ await this.hubTaskStatusCacheRepository.saveHubTaskStatus({
144
+ url: hubTaskIssueUrl,
145
+ state: issue.state,
146
+ status: issue.status,
147
+ now,
148
+ });
149
+ }
150
+ const active = this.isResolvedStatusActive(issue.state, issue.status, activeHubTaskStatus);
151
+ if (!active) {
152
+ console.log(`Skipping ${sessionName}: hub task ${hubTaskIssueUrl} is no longer active (state "${issue.state}", status "${issue.status ?? 'null'}", active status "${activeHubTaskStatus}").`);
110
153
  }
154
+ return { resolved: true, active };
111
155
  };
156
+ this.isResolvedStatusActive = (state, status, activeHubTaskStatus) => state === 'OPEN' && status === activeHubTaskStatus;
112
157
  this.collectSnapshots = async (interactiveSessions, transcriptPathBySessionName, now) => {
113
158
  const sessionNames = interactiveSessions.map((session) => session.sessionName);
114
159
  const activities = await this.sessionOutputActivityRepository.listSessionOutputActivities(transcriptPathBySessionName);