github-issue-tower-defence-management 2.154.10 → 2.155.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 (129) hide show
  1. package/README.md +49 -1
  2. package/bin/adapter/entry-points/cli/fleetConfig.js +33 -1
  3. package/bin/adapter/entry-points/cli/fleetConfig.js.map +1 -1
  4. package/bin/adapter/entry-points/cli/index.js +144 -50
  5. package/bin/adapter/entry-points/cli/index.js.map +1 -1
  6. package/bin/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.js +27 -0
  7. package/bin/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.js.map +1 -0
  8. package/bin/adapter/entry-points/cli/projectConfig.js +5 -0
  9. package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
  10. package/bin/adapter/entry-points/cli/resumableSessionSelect.js +45 -0
  11. package/bin/adapter/entry-points/cli/resumableSessionSelect.js.map +1 -0
  12. package/bin/adapter/entry-points/console/ui-dist/assets/index-B_lVAA3P.css +2 -0
  13. package/bin/adapter/entry-points/console/ui-dist/assets/index-CN6FXgfc.js +93 -0
  14. package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
  15. package/bin/adapter/entry-points/console/webServer.js +20 -0
  16. package/bin/adapter/entry-points/console/webServer.js.map +1 -1
  17. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +15 -1
  18. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
  19. package/bin/adapter/proxy/TokenListLoader.js +3 -2
  20. package/bin/adapter/proxy/TokenListLoader.js.map +1 -1
  21. package/bin/adapter/repositories/FileSystemResumableSessionTranscriptRepository.js +188 -0
  22. package/bin/adapter/repositories/FileSystemResumableSessionTranscriptRepository.js.map +1 -0
  23. package/bin/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.js +98 -0
  24. package/bin/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.js.map +1 -0
  25. package/bin/adapter/repositories/FileSystemWorkerSessionLogRepository.js +57 -0
  26. package/bin/adapter/repositories/FileSystemWorkerSessionLogRepository.js.map +1 -0
  27. package/bin/adapter/repositories/GitHubIssueCommentRepository.js +10 -2
  28. package/bin/adapter/repositories/GitHubIssueCommentRepository.js.map +1 -1
  29. package/bin/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.js +245 -0
  30. package/bin/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.js.map +1 -0
  31. package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +81 -8
  32. package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
  33. package/bin/domain/entities/WorkerRequestText.js +6 -0
  34. package/bin/domain/entities/WorkerRequestText.js.map +1 -0
  35. package/bin/domain/entities/WorkerSessionFailureStreak.js +3 -0
  36. package/bin/domain/entities/WorkerSessionFailureStreak.js.map +1 -0
  37. package/bin/domain/services/commentCreateWithDedupRetry.js +46 -0
  38. package/bin/domain/services/commentCreateWithDedupRetry.js.map +1 -0
  39. package/bin/domain/usecases/CloseIssueAsRequestApplier.js +29 -0
  40. package/bin/domain/usecases/CloseIssueAsRequestApplier.js.map +1 -0
  41. package/bin/domain/usecases/HandleScheduledEventUseCase.js +1 -0
  42. package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
  43. package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +61 -15
  44. package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
  45. package/bin/domain/usecases/ResumableSessionSelectUseCase.js +153 -0
  46. package/bin/domain/usecases/ResumableSessionSelectUseCase.js.map +1 -0
  47. package/bin/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.js +12 -7
  48. package/bin/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.js.map +1 -1
  49. package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js +59 -21
  50. package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js.map +1 -1
  51. package/bin/domain/usecases/StartPreparationUseCase.js +157 -3
  52. package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
  53. package/bin/domain/usecases/WorkerSessionEndClassifyUseCase.js +225 -0
  54. package/bin/domain/usecases/WorkerSessionEndClassifyUseCase.js.map +1 -0
  55. package/bin/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.js +3 -0
  56. package/bin/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.js.map +1 -0
  57. package/bin/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.js +3 -0
  58. package/bin/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.js.map +1 -0
  59. package/bin/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.js +3 -0
  60. package/bin/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.js.map +1 -0
  61. package/bin/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.js +3 -0
  62. package/bin/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.js.map +1 -0
  63. package/bin/domain/usecases/extractCloseIssueAs.js +24 -0
  64. package/bin/domain/usecases/extractCloseIssueAs.js.map +1 -0
  65. package/bin/domain/usecases/urgentStoryLaunchHoldDecide.js +76 -0
  66. package/bin/domain/usecases/urgentStoryLaunchHoldDecide.js.map +1 -0
  67. package/package.json +1 -1
  68. package/types/adapter/entry-points/cli/fleetConfig.d.ts +3 -0
  69. package/types/adapter/entry-points/cli/fleetConfig.d.ts.map +1 -1
  70. package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
  71. package/types/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.d.ts +8 -0
  72. package/types/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.d.ts.map +1 -0
  73. package/types/adapter/entry-points/cli/projectConfig.d.ts +3 -0
  74. package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
  75. package/types/adapter/entry-points/cli/resumableSessionSelect.d.ts +12 -0
  76. package/types/adapter/entry-points/cli/resumableSessionSelect.d.ts.map +1 -0
  77. package/types/adapter/entry-points/console/webServer.d.ts +1 -0
  78. package/types/adapter/entry-points/console/webServer.d.ts.map +1 -1
  79. package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
  80. package/types/adapter/proxy/TokenListLoader.d.ts +1 -0
  81. package/types/adapter/proxy/TokenListLoader.d.ts.map +1 -1
  82. package/types/adapter/repositories/FileSystemResumableSessionTranscriptRepository.d.ts +13 -0
  83. package/types/adapter/repositories/FileSystemResumableSessionTranscriptRepository.d.ts.map +1 -0
  84. package/types/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.d.ts +12 -0
  85. package/types/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.d.ts.map +1 -0
  86. package/types/adapter/repositories/FileSystemWorkerSessionLogRepository.d.ts +5 -0
  87. package/types/adapter/repositories/FileSystemWorkerSessionLogRepository.d.ts.map +1 -0
  88. package/types/adapter/repositories/GitHubIssueCommentRepository.d.ts +5 -0
  89. package/types/adapter/repositories/GitHubIssueCommentRepository.d.ts.map +1 -1
  90. package/types/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.d.ts +30 -0
  91. package/types/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.d.ts.map +1 -0
  92. package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +2 -1
  93. package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
  94. package/types/domain/entities/WorkerRequestText.d.ts +2 -0
  95. package/types/domain/entities/WorkerRequestText.d.ts.map +1 -0
  96. package/types/domain/entities/WorkerSessionFailureStreak.d.ts +5 -0
  97. package/types/domain/entities/WorkerSessionFailureStreak.d.ts.map +1 -0
  98. package/types/domain/services/commentCreateWithDedupRetry.d.ts +11 -0
  99. package/types/domain/services/commentCreateWithDedupRetry.d.ts.map +1 -0
  100. package/types/domain/usecases/CloseIssueAsRequestApplier.d.ts +16 -0
  101. package/types/domain/usecases/CloseIssueAsRequestApplier.d.ts.map +1 -0
  102. package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +1 -0
  103. package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
  104. package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts +4 -1
  105. package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
  106. package/types/domain/usecases/ResumableSessionSelectUseCase.d.ts +35 -0
  107. package/types/domain/usecases/ResumableSessionSelectUseCase.d.ts.map +1 -0
  108. package/types/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.d.ts +3 -1
  109. package/types/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.d.ts.map +1 -1
  110. package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts +5 -2
  111. package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts.map +1 -1
  112. package/types/domain/usecases/StartPreparationUseCase.d.ts +12 -1
  113. package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
  114. package/types/domain/usecases/WorkerSessionEndClassifyUseCase.d.ts +27 -0
  115. package/types/domain/usecases/WorkerSessionEndClassifyUseCase.d.ts.map +1 -0
  116. package/types/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.d.ts +22 -0
  117. package/types/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.d.ts.map +1 -0
  118. package/types/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.d.ts +11 -0
  119. package/types/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.d.ts.map +1 -0
  120. package/types/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.d.ts +7 -0
  121. package/types/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.d.ts.map +1 -0
  122. package/types/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.d.ts +11 -0
  123. package/types/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.d.ts.map +1 -0
  124. package/types/domain/usecases/extractCloseIssueAs.d.ts +12 -0
  125. package/types/domain/usecases/extractCloseIssueAs.d.ts.map +1 -0
  126. package/types/domain/usecases/urgentStoryLaunchHoldDecide.d.ts +48 -0
  127. package/types/domain/usecases/urgentStoryLaunchHoldDecide.d.ts.map +1 -0
  128. package/bin/adapter/entry-points/console/ui-dist/assets/index-BCjejjC0.css +0 -2
  129. package/bin/adapter/entry-points/console/ui-dist/assets/index-CcgrBS5P.js +0 -93
package/README.md CHANGED
@@ -19,6 +19,7 @@ Commands:
19
19
  schedule [options] Handle scheduled events (trigger: issue or schedule) (default)
20
20
  startDaemon [options] Start daemon to prepare GitHub issues
21
21
  notifyFinishedIssuePreparation [options] Notify that issue preparation is finished
22
+ selectLlmLaunchFlags [options] Print the --effort and --autocompact launch flags for a worker session, derived from the defaultLlmEffortLevel and defaultLlmAutocompactMode fields of the config file at --configFilePath. Writes "--effort <value>" using defaultLlmEffortLevel, falling back to "xhigh" when defaultLlmEffortLevel is unset or empty. Writes "--autocompact <value>" after it on the same stdout line only when defaultLlmAutocompactMode is set to a non-empty value. The launcher decides no value itself and only forwards these flags to claude-agent, the same split as the selectLiveSessionOauthToken command.
22
23
  checkIssueReviewReadiness [options] Check whether an issue is review-ready (read-only; does not change Status or post any comment)
23
24
  serveWeb [options] Start the local TDPM web server (console tabs, dashboard, and in-tmux session list)
24
25
  serveConsole [options] Deprecated alias for serveWeb. Use serveWeb instead.
@@ -30,7 +31,9 @@ Commands:
30
31
  ownerCallFileAppend [options] Append one owner call to the per-session owner call file (writes nothing to stdout)
31
32
  ownerCallFileDelete [options] Delete the per-session owner call file (writes nothing to stdout; an already absent file is not an error)
32
33
  archive-unresumable-session [options] Move aside the conversation record of a session that ended because its prompt exceeded the model context limit, so the next launch starts a fresh conversation
34
+ select-resumable-session [options] Print the claude session id a dispatched worker resumes, or nothing when it starts a new claude session, copying the transcript file from another worktree when needed
33
35
  check-issue-silent-dispatch-allowed [options] Check whether an issue's body allows a dispatch cycle to end with no agent comment (read-only)
36
+ workerRequestTextRead [options] Print the request text a worker session receives for an issue, "Take ownership of <issue url>" (read-only)
34
37
  help [command] display help for command
35
38
 
36
39
  Options for schedule:
@@ -67,6 +70,12 @@ Options for notifyFinishedIssuePreparation:
67
70
  --moveToFailedPreparation Move the item to Failed Preparation status after reaching the consecutive failure threshold; takes precedence over --deferPreparation when both are supplied; records --sessionErrorLine in the comment
68
71
  --fleetConfigFilePath <path> Path to the fleet-wide YAML config file holding the workflowIssueReporter mapping; falls back to the TDPM_FLEET_CONFIG environment variable. When set and the file contains a workflowIssueReporter section, a silent-redispatch escalation automatically creates (or comments on) an issue in the configured repository instead of only logging locally.
69
72
  --dispatchStartedAt <timestamp> ISO-8601 UTC timestamp (for example 2026-01-31T09:00:00Z) at which the item entered Preparation for the session that just ended. An agent report posted before this time is not counted as that session's report, so a session that posts nothing is recorded as NO_REPORT_FROM_AGENT_BOT and counts toward the consecutive-no-report threshold (thresholdForAutoReject) that moves the item to Failed Preparation. When omitted, the latest agent report on the issue is used whatever its age.
73
+ --sessionLogFilePath <path> Path to the log of the worker session that just ended. The command reads it once, before the notification, and sets --rateLimitRejected for a usage-limit ending, or for a rejected rate-limit event when the session ended neither with terminal_reason blocking_limit nor on an HTTP 429 session-limit error, --promptTooLongOnResume for a resumed session that ended with terminal_reason blocking_limit before any tool call, and --moveToFailedPreparation with its own --sessionErrorLine on the third consecutive ending with the same non-completed terminal_reason. The consecutive count is kept per issue under the TDPM cache directory (worker-session-failure-streaks) and is reset by a completed ending or a log without a terminal_reason. The result is combined with the explicit flags; usage-limit and rate-limit classification is skipped when a non-empty --missingAgentName is given, which also keeps the count from moving the item to Failed Preparation.
74
+ --sessionWasResumed The worker session that just ended resumed a previous conversation; used with --sessionLogFilePath to decide --promptTooLongOnResume
75
+ The notification is attempted up to 3 times, waiting 30 seconds and then 60 seconds after a failed attempt; the session log is classified only once. A GitHub API rate limit ends the command without an error and without a retry, and the third failure ends the command with that error.
76
+
77
+ Options for selectLlmLaunchFlags:
78
+ --configFilePath <path> Path to config file for tower defence management (required)
70
79
 
71
80
  Options for checkIssueReviewReadiness:
72
81
  --configFilePath <path> Path to config file for tower defence management (required)
@@ -119,8 +128,17 @@ Options for archive-unresumable-session:
119
128
  --session-dir <path> Directory holding conversation records named <session-id>.jsonl (required)
120
129
  --archive-dir <path> Destination directory the conversation record is moved into; created when it does not exist (required)
121
130
 
131
+ Options for select-resumable-session:
132
+ --session-name <name> Name the worker claude session is started with (claude --name); a transcript file is a candidate only when its first line contains "customTitle":"<name>" (required)
133
+ --session-dir <path> Session directory holding the transcript files (<session id>.jsonl) of the current working directory of the worker; claude --resume <session id> finds transcript files only in this directory (required)
134
+ --archive-root <path> Directory archive-unresumable-session moves transcript files into; a transcript file is archived when <archive-root>/<session id>.jsonl or <archive-root>/<directory>/<session id>.jsonl exists (required)
135
+ --other-session-dir <path> Session directory of another worktree of the same repository, searched when --session-dir yields no resumable transcript file; repeatable, and of transcript files with the same modification time the one in the directory given first wins
136
+
122
137
  Options for check-issue-silent-dispatch-allowed:
123
138
  --issue-url <url> GitHub issue URL (required)
139
+
140
+ Options for workerRequestTextRead:
141
+ --issueUrl <url> GitHub issue URL the worker session takes ownership of (required)
124
142
  ```
125
143
 
126
144
  The `serveWeb` sub-command starts a local HTTP server that serves the TDPM web surface — the console tabs, the dashboard, and the in-tmux-by-human session list. `serveConsole` remains available as a deprecated alias that maps to the same handler, so existing invokers keep working during rollout; new usage should prefer `serveWeb`. One running instance serves every project: the user opens a per-project URL path `/projects/{pjcode}` (or `/projects/{pjcode}/{workflow-blocker|prs|triage|unread|failed-preparation|todo-by-human}`) and the bundled UI reads the `pjcode` from its own URL path and loads that project's list data. The server serves the bundled single-page-application `index.html` at `/`, `/index.html`, and every `/projects/{pjcode}` and `/projects/{pjcode}/{tab}` app route. Every response is sent with `Cache-Control: no-store`. Any request path containing a segment that begins with a dot (for example `/.git` or `/.env`) is rejected with HTTP 404. The UI bootstrap assets (HTML and JS) are served without authentication; served `*.json` files and `/api/*` paths require an access token supplied either as the `k` query parameter (`?k=<token>`) or the `X-PV-Token` request header. The access token is read from the `consoleAccessToken` config value and never appears on the command line. When the built UI bundle directory (`ui-dist`) is absent the server still starts and serves a minimal placeholder index for `/`, `/index.html`, and the per-project app routes.
@@ -188,6 +206,21 @@ preparationWorker:
188
206
  graphqlRateLimitFloor: 500
189
207
  ```
190
208
 
209
+ The `schedule` command (trigger `schedule`) supports a `startPreparation` mapping in the fleet-wide config file named by the `TDPM_FLEET_CONFIG` environment variable. Supported keys:
210
+
211
+ - `maximumPreparingIssuesCount` (integer of at least 1, default `80`): the maximum number of issues in preparation status, used when neither the project README nor the project config sets `maximumPreparingIssuesCount`.
212
+ - `urgentStoryNames` (list of strings, default empty): the names of the stories whose tasks are urgent. When the list is non-empty, every preparation worker launch is held before `aw` starts while an urgent-story task of another project waits in `Awaiting Workspace` and the free worker slots across all Claude OAuth tokens do not exceed the number of such waiting tasks. A task whose own story is urgent, or that an urgent-story task in `Awaiting Workspace` depends on, is never held. The hold is re-evaluated every 10 seconds; after 300 seconds the still-waiting urgent-story tasks are recorded as timed out, are not waited for again during the next 1800 seconds, and the launch goes ahead; the whole hold is bounded at 420 seconds, and any error during the hold is logged as `urgentStoryLaunchHold: failed (<message>); the spawn goes ahead`. While a launch is held, other projects' launches do not wait for that project's urgent-story tasks. Each evaluation logs one line prefixed by `urgentStoryLaunchHold: `. The free worker slots are counted from the token list named by the project config's `claudeCodeOauthTokenListJsonPath`, otherwise by the fleet config's top-level `claudeCodeOauthTokenListJsonPath` (a leading `~/` is expanded to the home directory); when neither is set, or the token list has no available token, the launch goes ahead without the hold.
213
+
214
+ A key the file omits keeps its built-in value; a `urgentStoryNames` value that is not a list of strings, or a top-level `claudeCodeOauthTokenListJsonPath` that is not a string, is reported as an error. Example:
215
+
216
+ ```yaml
217
+ claudeCodeOauthTokenListJsonPath: ~/.config/tdpm/claude-code-oauth-tokens.json
218
+ startPreparation:
219
+ maximumPreparingIssuesCount: 80
220
+ urgentStoryNames:
221
+ - urgent / production incident
222
+ ```
223
+
191
224
  The `notifyFinishedIssuePreparation` and `revertOrphanedPreparation` commands support a `workflowIssueReporter` mapping in the fleet-wide config file named by `--fleetConfigFilePath` or the `TDPM_FLEET_CONFIG` environment variable. When a silent-redispatch escalation fires (an agent is dispatched and returns no report three consecutive times, indicating a TDPM process-level problem rather than a task-specific one), TDPM automatically creates a tracking issue in the configured repository or, when an open issue with the same title already exists, adds a comment to it instead of opening a duplicate. Supported keys:
192
225
 
193
226
  - `owner` (string, required): GitHub owner (organisation or user) of the repository where the workflow issue is created.
@@ -219,8 +252,12 @@ The `ownerCallFileAppend` and `ownerCallFileDelete` sub-commands maintain one te
219
252
 
220
253
  The `archive-unresumable-session` sub-command moves aside the stored conversation record of a session that ended because its prompt exceeded the model context limit, so the next launch for that task starts a fresh conversation instead of resuming a record that can never load again. Without it, a launcher that resumes the same stored conversation on every attempt keeps terminating on the same condition and the task never starts. It reads the finished run's stream-json log named by `--log-file` line by line, parsing each line that is a JSON object and ignoring every line that is not. A record matches when all three of `type` equals `result`, `is_error` is `true`, and `result` equals `Prompt is too long` hold; the session whose record is archived is the `session_id` of that matching record. A session that merely hit a usage limit ends with `terminal_reason` `api_error`, `api_error_status` `429`, and a different `result`, so it does not match and nothing is moved. When no record matches, the sub-command writes `no-op` to stdout, changes nothing, and exits 0. When a record matches, it creates `--archive-dir` if it does not exist, moves `<--session-dir>/<session-id>.jsonl` to `<--archive-dir>/<session-id>.jsonl`, writes `archived <destination path>` to stdout, and exits 0. The conversation record is moved, never deleted, so the conversation stays recoverable. When a record matches but that conversation record file is absent, the sub-command writes a diagnostic naming the expected source path to stderr and exits 1. It only changes where the record is stored; it does not change how a session is chosen for a task.
221
254
 
255
+ The `select-resumable-session` sub-command decides whether a dispatched worker resumes an earlier `claude` session of the same task and agent, and which session id it passes to `claude --resume <session id>`, so the worker launcher only gathers directory paths and passes the answer to `claude`. A transcript file is the JSON Lines file `<session id>.jsonl` in which `claude` stores one session: a regular file in a session directory whose name ends in `.jsonl` and does not start with `.`; a missing session directory holds no transcript files. A transcript file is a candidate only when its first line contains `"customTitle":"<--session-name>"`, closing quote included, so a title that only starts with the name is not a candidate. A candidate is not resumable when `<--archive-root>/<session id>.jsonl` or `<--archive-root>/<directory>/<session id>.jsonl` exists, or when its last main-chain assistant entry is an API error whose text is `Prompt is too long`. A main-chain assistant entry is a JSON line with `type` `assistant` and `isSidechain` not `true`; its error text is the `text` values of its `message.content` items joined together when `isApiErrorMessage` is `true`, and empty otherwise; lines that are not JSON objects are ignored. In `--session-dir` the resumable candidate with the newest modification time is selected, and of candidates with the same modification time the one whose file name comes first in ascending order wins. When `--session-dir` yields no selection, the transcript files of all `--other-session-dir` directories are ranked together by modification time: of candidates with the same modification time the one in the directory given first wins, and within one directory the file name that comes first in ascending order wins. A directory equal to `--session-dir` is left out, and a transcript file whose file name also exists in `--session-dir` is skipped. The selected transcript file must have an entry time, the first JSON object line with a string `timestamp` that parses as a date; without one the sub-command writes `Session resumption: <session id> has no entry time to compare with the definitions; starting a new session` to stderr, copies nothing, and prints nothing. A transcript file selected from another session directory is copied into `--session-dir`, which is created with mode `700` when absent: the copy keeps the source's mode and its access and modification times, is written as `<session id>.jsonl.copying`, and is renamed to `<session id>.jsonl`, and the source stays where it is. After the transcript file is copied, its session id directory `<session id>/` next to the source transcript file, which holds the subagent transcripts and tool results of that session, is copied recursively, keeping its times, when it exists and `<--session-dir>/<session id>` does not. The sub-command then writes `Session resumption: copied <source transcript file> into <--session-dir> (original kept)` to stderr, preceded by `Session resumption: warning: could not copy session directory <source session id directory> into <--session-dir>` when only the session id directory copy failed, in which case the session is still resumed. When the transcript file copy fails, or `<--session-dir>/<session id>.jsonl` already exists, it writes `Session resumption: could not copy <source transcript file> into <--session-dir>; starting a new session` to stderr and prints nothing. stdout carries the session id to resume followed by a newline, or nothing when the worker starts a new `claude` session, and the exit code is 0 in every one of these cases; a missing required option exits non-zero.
256
+
222
257
  The `check-issue-silent-dispatch-allowed` sub-command reports whether the issue named by `--issue-url` declares, in its own body, that a dispatch cycle ending with no agent comment is expected and must not be treated as a missing report. This lets `notifyFinishedIssuePreparation` skip the `NO_REPORT_FROM_AGENT_BOT` rejection for a task whose body already instructs the assigned agent to stay silent during some or all dispatch cycles, a design used for certain recurring, owner-directed tasks. It parses `owner`, `repo`, and the issue number from `--issue-url`, fetches that issue's body from the GitHub REST API using the `GH_TOKEN` environment variable, and evaluates it against the exact literal marker `<!-- TDPM_SILENT_DISPATCH_ALLOWED -->`: the marker must appear as a contiguous substring of the body, so the bare token without its `<!-- -->` wrapper does not count. It writes nothing to stdout. It exits 0 when the marker is present, 1 when it is absent, and 2 with a diagnostic on stderr when `--issue-url` cannot be parsed or the GitHub API call fails.
223
258
 
259
+ The `workerRequestTextRead` sub-command prints the request text a worker session receives for the issue named by `--issueUrl`, exactly `Take ownership of <issue url>` followed by one newline, to stdout, writes nothing to stderr, and exits 0. The worker launcher calls it and passes the printed text to the worker session unchanged, so the text is defined in one place in this CLI, the same CLI that parses it back out of running worker processes to find which issues already have a running worker. It reads nothing and changes nothing. When `--issueUrl` is missing, it prints nothing to stdout, prints an error naming `--issueUrl` to stderr, and exits non-zero.
260
+
224
261
  ## Example 📖
225
262
 
226
263
  Here's a quick example to illustrate its usage:
@@ -261,6 +298,10 @@ TOKEN=$(npx github-issue-tower-defence-management selectLiveSessionOauthToken --
261
298
  npx github-issue-tower-defence-management countInTmuxByHumanSessionsPerToken --configFilePath ./preparator-config.yml --tokenListJsonPath ./claudeCodeOauthTokenList.json
262
299
  ```
263
300
 
301
+ ```
302
+ REQUEST_TEXT=$(npx github-issue-tower-defence-management workerRequestTextRead --issueUrl https://github.com/HiromiShikata/test-repository/issues/1)
303
+ ```
304
+
264
305
  ## Config
265
306
 
266
307
  ### Schedule Command Config
@@ -757,7 +798,14 @@ The following use cases execute on every `schedule` trigger (cadence is determin
757
798
  - `RevertOrphanedPreparationUseCase` — reverts orphaned preparation issues back to awaiting-workspace
758
799
  - `ClearDependedIssueURLUseCase` (items with a closed depended issue, on cycles that do not run the slow sweep) — runs before `StartPreparationUseCase` on the issue list the cycle already fetched and does not fetch issues again. For every open item whose Depended Issue URL lists a closed issue, it removes the closed and Icebox URLs from the field, so a task whose blocker closed is dispatched in the same cycle. It calls GitHub only for an item it changes, with the same field write, comment read and notification comment the slow sweep would make for that item. Items whose depended issues are only open, in Icebox, absent from the issue list or circular are left to the slow sweep. A failure is logged with the failing item URLs and the cycle continues.
759
800
  - `StartPreparationUseCase` — starts preparation for issues ready to be worked on
760
- - `NotifyFinishedIssuePreparationUseCase` — checks preparation-status issues and advances them. When the issue carries one or more `change-target:<path>` labels and all auto status checks pass, the related pull request's full file list is fetched (paginated, no 100-file truncation) and the PR is auto-approved before transitioning to Awaiting Owner if every changed file is under at least one of the labeled paths. Matching is boundary-safe (`change-target:foo` matches `foo/bar.ts` but not `foobar/baz.ts`); multiple `change-target:` labels are OR-combined. When no `change-target:` label is present, behavior is unchanged. When the issue carries one or more `change-target-must:<path>` labels, the PR is also rejected with a `CHANGE_TARGET_MUST_PATH_NOT_CHANGED` status when no changed file falls under a required path. The rejection submits a "request changes" review containing an inline comment on the first changed file (or a PR-level comment when the PR has no changed files) that names the required directory. `change-target-must:` paths are also treated as allowed paths for the confinement check, behaving identically to `change-target:` in addition to requiring at least one change under the path. When the last agent comment's first fenced JSON block includes a non-empty `nextStepAgent` string property, the use case adds the label named by that value to the issue (creating the label in the repository if it does not already exist) and transitions the issue to Awaiting Workspace, allowing the next agent identified by the label to pick up the issue automatically.
801
+ - `NotifyFinishedIssuePreparationUseCase` — checks preparation-status issues and advances them. When the issue carries one or more `change-target:<path>` labels and all auto status checks pass, the related pull request's full file list is fetched (paginated, no 100-file truncation) and the PR is auto-approved before transitioning to Awaiting Owner if every changed file is under at least one of the labeled paths. Matching is boundary-safe (`change-target:foo` matches `foo/bar.ts` but not `foobar/baz.ts`); multiple `change-target:` labels are OR-combined. When no `change-target:` label is present, behavior is unchanged. When the issue carries one or more `change-target-must:<path>` labels, the PR is also rejected with a `CHANGE_TARGET_MUST_PATH_NOT_CHANGED` status when no changed file falls under a required path. The rejection submits a "request changes" review containing an inline comment on the first changed file (or a PR-level comment when the PR has no changed files) that names the required directory. `change-target-must:` paths are also treated as allowed paths for the confinement check, behaving identically to `change-target:` in addition to requiring at least one change under the path. When the last fenced `json` block that parses as JSON in the last trusted agent report includes a non-empty `nextStepAgent` string property, the use case sets the issue's project Agent field to that value (adding the value as an Agent field option, and the Agent field itself, when the project does not have them yet) and transitions the issue to Awaiting Workspace, so the agent named in the Agent field picks up the issue on the next dispatch.
802
+ - `closeIssueAs` in the last fenced `json` block that parses as JSON in the last trusted agent report, the same block `nextStepAgent`, `workflowError` and `needOwnerConfirmationOrApproval` are read from, asks the tool to close the task issue, so the agent does not close it itself. The allowed values are `"completed"` and `"not_planned"`, the GitHub REST `state_reason` values behind the "Close as completed" and "Close as not planned" buttons. An absent field or `null` requests no close. The evidence for closing stays in the comment body and the JSON carries only the value, for example `{"closeIssueAs": "completed"}`.
803
+ - Precedence: when the same block also sets a non-empty string `nextStepAgent`, a non-empty `workflowError` or `needOwnerConfirmationOrApproval: true`, the report is routed exactly as without `closeIssueAs` and the issue is not closed.
804
+ - A valid value is evaluated as soon as the last agent report is located, before the unregistered `nextStepAgent` check, the CI-failing pull request hand-over and every Failed Preparation escalation (no report, REJECTED count, dispatch loop), so none of them prevents the close. When the issue is open and no open pull request closes it, the tool closes it with that state reason, then sets Status to `Done` and posts no comment. When the project's Status field has no `Done` option, the issue is still closed, Status is left unchanged and an error naming the project and the issue is logged. An issue whose Depended Issue URL or Reactivation Trigger is still pending moves to Awaiting Workspace as before and is not closed.
805
+ - Open pull request rule: when an open pull request closes the issue on merge, the tool does not close the issue, logs a warning naming the issue and every such pull request, and routes the report exactly as without `closeIssueAs`.
806
+ - Already-closed rule: when the issue is already closed, the tool does not close it again and sets Status to `Done`.
807
+ - Invalid-value rule: any other value, such as `"not planned"`, `""`, `false` or `1`, is checked after the `needOwnerConfirmationOrApproval` branch, so the existing escalations still apply first. The tool then does not close the issue, posts `Invalid closeIssueAs value {received value as JSON}: allowed values are "completed" and "not_planned". The issue was not closed.` and sets Status to Awaiting Workspace.
808
+ - `RevertOrphanedPreparationUseCase` applies the same precedence, open pull request, already-closed and missing `Done` option rules to an orphaned Preparation issue whose last trusted agent report carries a valid `closeIssueAs`, right after locating that report and before its unregistered agent check, its dispatch loop escalation and its `waitingForOwner` check, then moves on to the next issue. `waitingForOwner` is not a precedence signal. It reads the comments of an already-closed orphaned issue so the already-closed rule can apply; when that read fails, which is logged as an error, or no valid `closeIssueAs` applies, the closed issue keeps its existing routing to Awaiting Owner, else `Done`, else Awaiting Workspace.
761
809
  - `SetWorkflowManagementIssueToStoryUseCase`
762
810
  - `SetNoStoryIssueToStoryUseCase`
763
811
  - `UpdateIssueStatusByLabelUseCase`
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.loadErrorReportingRepository = exports.ERROR_REPORTING_REPOSITORY_KEY = exports.loadFleetTaskCreateUrl = exports.loadWorkflowImprovementIssueUrl = exports.loadSilentNotificationEnabled = exports.loadWorkflowIssueReporterSettings = exports.loadStartPreparationFleetSettings = exports.loadPreparationWorkerSettings = exports.loadLiveSessionOauthTokenSelectionSettings = exports.resolveFleetConfigFilePath = exports.DEFAULT_START_PREPARATION_FLEET_SETTINGS = exports.DEFAULT_PREPARATION_WORKER_SETTINGS = exports.DEFAULT_GRAPHQL_RATE_LIMIT_FLOOR = exports.DEFAULT_MAX_CONCURRENT_WORKERS = exports.DEFAULT_FLEET_MAXIMUM_PREPARING_ISSUES_COUNT = exports.SILENT_NOTIFICATION_ENABLED_KEY = exports.WORKFLOW_ISSUE_REPORTER_SECTION_KEY = exports.WORKFLOW_IMPROVEMENT_ISSUE_URL_KEY = exports.START_PREPARATION_SECTION_KEY = exports.PREPARATION_WORKER_SECTION_KEY = exports.LIVE_SESSION_OAUTH_TOKEN_SELECTION_SECTION_KEY = exports.FLEET_CONFIG_FILE_PATH_ENVIRONMENT_VARIABLE = void 0;
39
+ exports.loadErrorReportingRepository = exports.ERROR_REPORTING_REPOSITORY_KEY = exports.loadFleetTaskCreateUrl = exports.loadWorkflowImprovementIssueUrl = exports.loadSilentNotificationEnabled = exports.loadWorkflowIssueReporterSettings = exports.loadFleetClaudeCodeOauthTokenListJsonPath = exports.loadStartPreparationFleetSettings = exports.loadPreparationWorkerSettings = exports.loadLiveSessionOauthTokenSelectionSettings = exports.resolveFleetConfigFilePath = exports.DEFAULT_START_PREPARATION_FLEET_SETTINGS = exports.DEFAULT_PREPARATION_WORKER_SETTINGS = exports.DEFAULT_GRAPHQL_RATE_LIMIT_FLOOR = exports.DEFAULT_MAX_CONCURRENT_WORKERS = exports.DEFAULT_FLEET_MAXIMUM_PREPARING_ISSUES_COUNT = exports.CLAUDE_CODE_OAUTH_TOKEN_LIST_JSON_PATH_KEY = exports.SILENT_NOTIFICATION_ENABLED_KEY = exports.WORKFLOW_ISSUE_REPORTER_SECTION_KEY = exports.WORKFLOW_IMPROVEMENT_ISSUE_URL_KEY = exports.START_PREPARATION_SECTION_KEY = exports.PREPARATION_WORKER_SECTION_KEY = exports.LIVE_SESSION_OAUTH_TOKEN_SELECTION_SECTION_KEY = exports.FLEET_CONFIG_FILE_PATH_ENVIRONMENT_VARIABLE = void 0;
40
40
  const fs = __importStar(require("fs"));
41
41
  const yaml_1 = __importDefault(require("yaml"));
42
42
  const LiveSessionOauthTokenSelectUseCase_1 = require("../../../domain/usecases/LiveSessionOauthTokenSelectUseCase");
@@ -48,6 +48,7 @@ exports.START_PREPARATION_SECTION_KEY = 'startPreparation';
48
48
  exports.WORKFLOW_IMPROVEMENT_ISSUE_URL_KEY = 'workflowImprovementIssueUrl';
49
49
  exports.WORKFLOW_ISSUE_REPORTER_SECTION_KEY = 'workflowIssueReporter';
50
50
  exports.SILENT_NOTIFICATION_ENABLED_KEY = 'silentNotificationEnabled';
51
+ exports.CLAUDE_CODE_OAUTH_TOKEN_LIST_JSON_PATH_KEY = 'claudeCodeOauthTokenListJsonPath';
51
52
  exports.DEFAULT_FLEET_MAXIMUM_PREPARING_ISSUES_COUNT = 80;
52
53
  exports.DEFAULT_MAX_CONCURRENT_WORKERS = 40;
53
54
  exports.DEFAULT_GRAPHQL_RATE_LIMIT_FLOOR = 500;
@@ -58,6 +59,7 @@ exports.DEFAULT_PREPARATION_WORKER_SETTINGS = {
58
59
  };
59
60
  exports.DEFAULT_START_PREPARATION_FLEET_SETTINGS = {
60
61
  maximumPreparingIssuesCount: exports.DEFAULT_FLEET_MAXIMUM_PREPARING_ISSUES_COUNT,
62
+ urgentStoryNames: [],
61
63
  };
62
64
  const resolveFleetConfigFilePath = (cliValue) => {
63
65
  if (cliValue !== null && cliValue !== '') {
@@ -108,6 +110,17 @@ const readBoundedNumber = (section, sectionKey, key, fleetConfigFilePath, fallba
108
110
  }
109
111
  return value;
110
112
  };
113
+ const readStringList = (section, sectionKey, key, fleetConfigFilePath, fallback) => {
114
+ const value = section[key];
115
+ if (value === undefined || value === null) {
116
+ return fallback;
117
+ }
118
+ if (!Array.isArray(value) ||
119
+ !value.every((item) => typeof item === 'string')) {
120
+ throw new Error(`${sectionKey}.${key} in ${fleetConfigFilePath} must be a list of strings.`);
121
+ }
122
+ return value;
123
+ };
111
124
  const loadLiveSessionOauthTokenSelectionSettings = (fleetConfigFilePath) => {
112
125
  if (fleetConfigFilePath === null) {
113
126
  return LiveSessionOauthTokenSelectUseCase_1.DEFAULT_LIVE_SESSION_OAUTH_TOKEN_SELECTION_SETTINGS;
@@ -150,9 +163,28 @@ const loadStartPreparationFleetSettings = (fleetConfigFilePath) => {
150
163
  }
151
164
  return {
152
165
  maximumPreparingIssuesCount: readBoundedNumber(section, exports.START_PREPARATION_SECTION_KEY, 'maximumPreparingIssuesCount', fleetConfigFilePath, exports.DEFAULT_START_PREPARATION_FLEET_SETTINGS.maximumPreparingIssuesCount, (value) => Number.isInteger(value) && value >= 1, 'integer of at least 1'),
166
+ urgentStoryNames: readStringList(section, exports.START_PREPARATION_SECTION_KEY, 'urgentStoryNames', fleetConfigFilePath, exports.DEFAULT_START_PREPARATION_FLEET_SETTINGS.urgentStoryNames),
153
167
  };
154
168
  };
155
169
  exports.loadStartPreparationFleetSettings = loadStartPreparationFleetSettings;
170
+ const loadFleetClaudeCodeOauthTokenListJsonPath = (fleetConfigFilePath) => {
171
+ if (fleetConfigFilePath === null) {
172
+ return null;
173
+ }
174
+ const top = parseFleetConfigTopLevel(fleetConfigFilePath);
175
+ if (top === null) {
176
+ return null;
177
+ }
178
+ const value = top[exports.CLAUDE_CODE_OAUTH_TOKEN_LIST_JSON_PATH_KEY];
179
+ if (value === undefined || value === null) {
180
+ return null;
181
+ }
182
+ if (typeof value !== 'string') {
183
+ throw new Error(`${exports.CLAUDE_CODE_OAUTH_TOKEN_LIST_JSON_PATH_KEY} in ${fleetConfigFilePath} must be a string path.`);
184
+ }
185
+ return value;
186
+ };
187
+ exports.loadFleetClaudeCodeOauthTokenListJsonPath = loadFleetClaudeCodeOauthTokenListJsonPath;
156
188
  const loadWorkflowIssueReporterSettings = (fleetConfigFilePath) => {
157
189
  if (fleetConfigFilePath === null) {
158
190
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"fleetConfig.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/fleetConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,oHAGqE;AACrE,8FAA2F;AAI9E,QAAA,2CAA2C,GAAG,mBAAmB,CAAC;AAElE,QAAA,8CAA8C,GACzD,gCAAgC,CAAC;AACtB,QAAA,8BAA8B,GAAG,mBAAmB,CAAC;AACrD,QAAA,6BAA6B,GAAG,kBAAkB,CAAC;A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iBjC;AAEW,QAAA,8BAA8B,GAAG,0BAA0B,CAAC;AAElE,MAAM,4BAA4B,GAAG,CAC1C,mBAAkC,EACnB,EAAE;IACjB,IAAI,mBAAmB,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;IAC1D,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,sCAA8B,CAAC,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,GAAG,sCAA8B,OAAO,mBAAmB,oBAAoB,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC"}
@@ -46,6 +46,7 @@ Object.defineProperty(exports, "loadConfigFile", { enumerable: true, get: functi
46
46
  Object.defineProperty(exports, "mergeConfigs", { enumerable: true, get: function () { return projectConfig_1.mergeConfigs; } });
47
47
  Object.defineProperty(exports, "parseProjectReadmeConfig", { enumerable: true, get: function () { return projectConfig_1.parseProjectReadmeConfig; } });
48
48
  const path = __importStar(require("path"));
49
+ const WorkerRequestText_1 = require("../../../domain/entities/WorkerRequestText");
49
50
  const CheckIssueReviewReadinessUseCase_1 = require("../../../domain/usecases/CheckIssueReviewReadinessUseCase");
50
51
  const CliErrorReportUseCase_1 = require("../../../domain/usecases/CliErrorReportUseCase");
51
52
  const ConsoleErrorReportUseCase_1 = require("../../../domain/usecases/ConsoleErrorReportUseCase");
@@ -55,6 +56,7 @@ const NotifyFinishedIssuePreparationUseCase_1 = require("../../../domain/usecase
55
56
  const PullRequestProjectItemRemoveUseCase_1 = require("../../../domain/usecases/PullRequestProjectItemRemoveUseCase");
56
57
  const RevertOrphanedPreparationUseCase_1 = require("../../../domain/usecases/RevertOrphanedPreparationUseCase");
57
58
  const StartPreparationUseCase_1 = require("../../../domain/usecases/StartPreparationUseCase");
59
+ const WorkerSessionEndClassifyUseCase_1 = require("../../../domain/usecases/WorkerSessionEndClassifyUseCase");
58
60
  const iso8601UtcDateTimePattern_1 = require("../../../domain/services/iso8601UtcDateTimePattern");
59
61
  const FetchWebhookRepository_1 = require("../../repositories/FetchWebhookRepository");
60
62
  const GitHubIssueCommentRepository_1 = require("../../repositories/GitHubIssueCommentRepository");
@@ -77,12 +79,16 @@ const CliGitHubGraphqlRateLimitRepository_1 = require("../../repositories/CliGit
77
79
  const resolveNextStepAgentDispatchRepetition_1 = require("../../../domain/usecases/resolveNextStepAgentDispatchRepetition");
78
80
  const ProxyClaudeTokenUsageRepository_1 = require("../../repositories/ProxyClaudeTokenUsageRepository");
79
81
  const SystemDateRepository_1 = require("../../repositories/SystemDateRepository");
82
+ const FileSystemWorkerSessionFailureStreakRepository_1 = require("../../repositories/FileSystemWorkerSessionFailureStreakRepository");
83
+ const FileSystemWorkerSessionLogRepository_1 = require("../../repositories/FileSystemWorkerSessionLogRepository");
80
84
  const os = __importStar(require("os"));
81
85
  const consoleGithubTokenResolver_1 = require("../console/consoleGithubTokenResolver");
82
86
  const readOnlyTokenRotator_1 = require("../console/readOnlyTokenRotator");
83
87
  const githubAppTokenMinter_1 = require("./githubAppTokenMinter");
84
88
  const unresumableSessionArchive_1 = require("./unresumableSessionArchive");
89
+ const resumableSessionSelect_1 = require("./resumableSessionSelect");
85
90
  const checkIssueSilentDispatchAllowed_1 = require("./checkIssueSilentDispatchAllowed");
91
+ const notifyFinishedIssuePreparationRetry_1 = require("./notifyFinishedIssuePreparationRetry");
86
92
  const storyGateCommands_1 = require("./storyGateCommands");
87
93
  const consoleProjectResolver_1 = require("../console/consoleProjectResolver");
88
94
  const consoleReadApi_1 = require("../console/consoleReadApi");
@@ -122,6 +128,40 @@ const resolveUtcTimestampOption = (rawValue, optionName) => {
122
128
  }
123
129
  return parsed;
124
130
  };
131
+ const notifyFinishedSessionEndFlagsResolve = async (options) => {
132
+ const explicitSessionEndFlags = {
133
+ sessionErrorLine: options.sessionErrorLine ?? null,
134
+ rateLimitRejected: options.rateLimitRejected ?? null,
135
+ promptTooLongOnResume: options.promptTooLongOnResume ?? null,
136
+ moveToFailedPreparation: options.moveToFailedPreparation ?? null,
137
+ };
138
+ if (options.sessionLogFilePath === undefined) {
139
+ return explicitSessionEndFlags;
140
+ }
141
+ const workerSessionEndClassification = await new WorkerSessionEndClassifyUseCase_1.WorkerSessionEndClassifyUseCase(new FileSystemWorkerSessionLogRepository_1.FileSystemWorkerSessionLogRepository(), new FileSystemWorkerSessionFailureStreakRepository_1.FileSystemWorkerSessionFailureStreakRepository()).run({
142
+ issueUrl: options.issueUrl,
143
+ sessionLogFilePath: options.sessionLogFilePath,
144
+ sessionWasResumed: options.sessionWasResumed === true,
145
+ missingAgentNameReported: options.missingAgentName !== undefined &&
146
+ options.missingAgentName !== '',
147
+ });
148
+ for (const diagnosticLine of workerSessionEndClassification.diagnosticLines) {
149
+ console.log(diagnosticLine);
150
+ }
151
+ return {
152
+ sessionErrorLine: workerSessionEndClassification.sessionErrorLine ??
153
+ explicitSessionEndFlags.sessionErrorLine,
154
+ rateLimitRejected: workerSessionEndClassification.rateLimitRejected
155
+ ? true
156
+ : explicitSessionEndFlags.rateLimitRejected,
157
+ promptTooLongOnResume: workerSessionEndClassification.promptTooLongOnResume
158
+ ? true
159
+ : explicitSessionEndFlags.promptTooLongOnResume,
160
+ moveToFailedPreparation: workerSessionEndClassification.moveToFailedPreparation
161
+ ? true
162
+ : explicitSessionEndFlags.moveToFailedPreparation,
163
+ };
164
+ };
125
165
  const DEFAULT_IN_TMUX_DATA_DIR = '/home/hiromi/0_workspaces/workspace1/jsonpub/in-tmux-by-human';
126
166
  const DEFAULT_DASHBOARD_DIR = '/home/hiromi/0_workspaces/workspace1/jsonpub';
127
167
  const DEFAULT_DASHBOARD_DATA_DIR = null;
@@ -413,7 +453,10 @@ exports.program
413
453
  .option('--moveToFailedPreparation', 'Move the item to Failed Preparation status after reaching the consecutive failure threshold')
414
454
  .option('--fleetConfigFilePath <path>', 'Path to fleet config YAML file (also read from TDPM_FLEET_CONFIG env var)')
415
455
  .option('--dispatchStartedAt <timestamp>', "ISO-8601 UTC timestamp (for example 2026-01-31T09:00:00Z) at which the item entered Preparation for the session that just ended; an agent report posted before it is not counted as that session's report, so a session that posts nothing is counted toward the consecutive-no-report threshold")
456
+ .option('--sessionLogFilePath <path>', 'Path to the log of the worker session that just ended; it is classified once before the notification, and a usage-limit or rejected rate-limit ending, a prompt too long on resume, or a third consecutive ending with the same non-completed terminal_reason sets --rateLimitRejected, --promptTooLongOnResume, or --moveToFailedPreparation with its own session error line')
457
+ .option('--sessionWasResumed', 'The worker session that just ended resumed a previous conversation; with --sessionLogFilePath, a blocking_limit ending before any tool call then sets --promptTooLongOnResume')
416
458
  .action(async (options) => {
459
+ const sessionEndFlags = await notifyFinishedSessionEndFlagsResolve(options);
417
460
  const token = process.env.GH_TOKEN;
418
461
  if (!token) {
419
462
  console.error('GH_TOKEN environment variable is required');
@@ -465,23 +508,6 @@ exports.program
465
508
  const dispatchStartedAt = resolveUtcTimestampOption(options.dispatchStartedAt, 'dispatchStartedAt');
466
509
  const workflowBlockerResolvedWebhookUrl = config.workflowBlockerResolvedWebhookUrl ?? null;
467
510
  const projectName = config.projectName ?? 'default';
468
- const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
469
- const cachePath = (0, localStorageCacheDirectory_1.projectCacheDirectory)(projectName);
470
- const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
471
- const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository, token);
472
- const readGhTokens = await (0, githubAppTokenMinter_1.mintReadOnlyTokensFromKeyPaths)(config.githubAppPrivateKeyPaths ?? []);
473
- const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams, localStorageCacheRepository, readGhTokens);
474
- const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
475
- const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams, readGhTokens);
476
- const graphqlProjectItemRepository = new GraphqlProjectItemRepository_1.GraphqlProjectItemRepository(...githubRepositoryParams);
477
- const issueRepository = new ApiV3CheerioRestIssueRepository_1.ApiV3CheerioRestIssueRepository(apiV3IssueRepository, restIssueRepository, graphqlProjectItemRepository, localStorageCacheRepository, projectRepository, new SystemDateRepository_1.SystemDateRepository(), ...githubRepositoryParams);
478
- const issueCommentRepository = new GitHubIssueCommentRepository_1.GitHubIssueCommentRepository(token, localStorageCacheRepository);
479
- const webhookRepository = new FetchWebhookRepository_1.FetchWebhookRepository();
480
- const consoleDataOutputDir = config.consoleDataOutputDir ?? null;
481
- const consoleTabsRepository = consoleDataOutputDir !== null
482
- ? new FileSystemConsoleTabsRepository_1.FileSystemConsoleTabsRepository(consoleDataOutputDir, projectName)
483
- : null;
484
- const useCase = new NotifyFinishedIssuePreparationUseCase_1.NotifyFinishedIssuePreparationUseCase(projectRepository, issueRepository, issueCommentRepository, webhookRepository, consoleTabsRepository);
485
511
  const rawAllowedIssueAuthors = config.allowedIssueAuthors;
486
512
  const allowedIssueAuthors = rawAllowedIssueAuthors
487
513
  ? rawAllowedIssueAuthors
@@ -497,40 +523,75 @@ exports.program
497
523
  console.error(error instanceof Error ? error.message : String(error));
498
524
  return process.exit(1);
499
525
  }
500
- try {
501
- await useCase.run({
502
- projectUrl,
503
- issueUrl: options.issueUrl,
504
- thresholdForAutoReject,
505
- thresholdForDispatchLoop,
506
- workflowBlockerResolvedWebhookUrl,
507
- allowedIssueAuthors,
508
- labelsAsLlmAgentName: config.labelsAsLlmAgentName ?? null,
509
- labelsNotRequiringPullRequest: config.labelsNotRequiringPullRequest ?? null,
510
- changeTargetPathAliases: config.changeTargetPathAliases ?? null,
511
- agents: config.agents ?? null,
512
- missingAgentName: options.missingAgentName ?? null,
513
- sessionErrorLine: options.sessionErrorLine ?? null,
514
- manager: config.manager ?? null,
515
- developerAgentNames: config.developerAgentNames ?? null,
516
- defaultAgentName: config.defaultAgentName ?? null,
517
- deferPreparation: options.deferPreparation ?? null,
518
- rateLimitRejected: options.rateLimitRejected ?? null,
519
- promptTooLongOnResume: options.promptTooLongOnResume ?? null,
520
- moveToFailedPreparation: options.moveToFailedPreparation ?? null,
521
- workflowIssueReporterSettings: notifyWorkflowIssueReporterSettings,
522
- tdpmReportingRepository: notifyEffectiveErrorReportingRepo,
523
- projectName: config.projectName ?? null,
524
- dispatchStartedAt,
525
- });
526
- }
527
- catch (e) {
528
- if (e instanceof githubRateLimitRetry_1.GitHubRateLimitError) {
529
- console.warn(`notifyFinishedIssuePreparation rate-limited, will retry next cycle: ${e.message}`);
530
- return;
526
+ await (0, notifyFinishedIssuePreparationRetry_1.notifyFinishedIssuePreparationRunWithRetry)(async () => {
527
+ const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
528
+ const cachePath = (0, localStorageCacheDirectory_1.projectCacheDirectory)(projectName);
529
+ const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
530
+ const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository, token);
531
+ const readGhTokens = await (0, githubAppTokenMinter_1.mintReadOnlyTokensFromKeyPaths)(config.githubAppPrivateKeyPaths ?? []);
532
+ const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams, localStorageCacheRepository, readGhTokens);
533
+ const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
534
+ const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams, readGhTokens);
535
+ const graphqlProjectItemRepository = new GraphqlProjectItemRepository_1.GraphqlProjectItemRepository(...githubRepositoryParams);
536
+ const issueRepository = new ApiV3CheerioRestIssueRepository_1.ApiV3CheerioRestIssueRepository(apiV3IssueRepository, restIssueRepository, graphqlProjectItemRepository, localStorageCacheRepository, projectRepository, new SystemDateRepository_1.SystemDateRepository(), ...githubRepositoryParams);
537
+ const issueCommentRepository = new GitHubIssueCommentRepository_1.GitHubIssueCommentRepository(token, localStorageCacheRepository);
538
+ const webhookRepository = new FetchWebhookRepository_1.FetchWebhookRepository();
539
+ const consoleDataOutputDir = config.consoleDataOutputDir ?? null;
540
+ const consoleTabsRepository = consoleDataOutputDir !== null
541
+ ? new FileSystemConsoleTabsRepository_1.FileSystemConsoleTabsRepository(consoleDataOutputDir, projectName)
542
+ : null;
543
+ const useCase = new NotifyFinishedIssuePreparationUseCase_1.NotifyFinishedIssuePreparationUseCase(projectRepository, issueRepository, issueCommentRepository, webhookRepository, consoleTabsRepository);
544
+ try {
545
+ await useCase.run({
546
+ projectUrl,
547
+ issueUrl: options.issueUrl,
548
+ thresholdForAutoReject,
549
+ thresholdForDispatchLoop,
550
+ workflowBlockerResolvedWebhookUrl,
551
+ allowedIssueAuthors,
552
+ labelsAsLlmAgentName: config.labelsAsLlmAgentName ?? null,
553
+ labelsNotRequiringPullRequest: config.labelsNotRequiringPullRequest ?? null,
554
+ changeTargetPathAliases: config.changeTargetPathAliases ?? null,
555
+ agents: config.agents ?? null,
556
+ missingAgentName: options.missingAgentName ?? null,
557
+ sessionErrorLine: sessionEndFlags.sessionErrorLine,
558
+ manager: config.manager ?? null,
559
+ developerAgentNames: config.developerAgentNames ?? null,
560
+ defaultAgentName: config.defaultAgentName ?? null,
561
+ deferPreparation: options.deferPreparation ?? null,
562
+ rateLimitRejected: sessionEndFlags.rateLimitRejected,
563
+ promptTooLongOnResume: sessionEndFlags.promptTooLongOnResume,
564
+ moveToFailedPreparation: sessionEndFlags.moveToFailedPreparation,
565
+ workflowIssueReporterSettings: notifyWorkflowIssueReporterSettings,
566
+ tdpmReportingRepository: notifyEffectiveErrorReportingRepo,
567
+ projectName: config.projectName ?? null,
568
+ dispatchStartedAt,
569
+ });
531
570
  }
532
- throw e;
533
- }
571
+ catch (e) {
572
+ if (e instanceof githubRateLimitRetry_1.GitHubRateLimitError) {
573
+ console.warn(`notifyFinishedIssuePreparation rate-limited, will retry next cycle: ${e.message}`);
574
+ return;
575
+ }
576
+ throw e;
577
+ }
578
+ }, {
579
+ sleep: githubRateLimitRetry_1.realSleep,
580
+ writeLine: (line) => console.log(line),
581
+ writeAttemptFailure: (error) => console.error((0, errorSanitizer_1.sanitizeErrorForLogging)(error)),
582
+ });
583
+ });
584
+ exports.program
585
+ .command('selectLlmLaunchFlags')
586
+ .description('Print the --effort and --autocompact launch flags for a worker session, derived from the defaultLlmEffortLevel and defaultLlmAutocompactMode fields of the config file at --configFilePath. Writes "--effort <value>" using defaultLlmEffortLevel, falling back to "xhigh" when defaultLlmEffortLevel is unset or empty. Writes "--autocompact <value>" after it on the same stdout line only when defaultLlmAutocompactMode is set to a non-empty value. The launcher decides no value itself and only forwards these flags to claude-agent, the same split as the selectLiveSessionOauthToken command.')
587
+ .requiredOption('--configFilePath <path>', 'Path to config file for tower defence management')
588
+ .action((options) => {
589
+ const config = (0, projectConfig_2.loadConfigFile)(options.configFilePath);
590
+ const effortFlag = ['--effort', config.defaultLlmEffortLevel || 'xhigh'];
591
+ const autocompactFlag = config.defaultLlmAutocompactMode
592
+ ? ['--autocompact', config.defaultLlmAutocompactMode]
593
+ : [];
594
+ process.stdout.write(`${[...effortFlag, ...autocompactFlag].join(' ')}\n`);
534
595
  });
535
596
  exports.program
536
597
  .command('checkIssueReviewReadiness')
@@ -718,6 +779,7 @@ const runServeWeb = async (options) => {
718
779
  dashboardDir,
719
780
  dashboardDataDir,
720
781
  dashboardProjectNames,
782
+ dashboardProjectConfigDirectory: config.consoleProjectConfigDirectory ?? null,
721
783
  dashboardProjectUrls: pjcodeToProjectUrl,
722
784
  fleetTaskCreateUrl,
723
785
  resolveGithubToken,
@@ -979,6 +1041,31 @@ exports.program
979
1041
  return process.exit(output.exitCode);
980
1042
  }
981
1043
  });
1044
+ exports.program
1045
+ .command('select-resumable-session')
1046
+ .description('Decide whether a dispatched worker resumes an earlier claude session of the same task and agent, and which session id it passes to claude --resume. Writes that session id followed by a newline to stdout, or nothing when the worker starts a new claude session, and writes each "Session resumption: ..." line to stderr. A transcript file is a regular <session id>.jsonl file whose name does not start with a dot; it is a candidate only when its first line contains "customTitle":"<session name>". A candidate is not resumable when it is archived under --archive-root, or when its last main-chain assistant entry is the "Prompt is too long" API error. In --session-dir the resumable candidate with the newest modification time is selected, a tie going to the ascending file name. When --session-dir yields none, the transcript files of every --other-session-dir are ranked together by modification time, a tie going to the directory given first and then to the ascending file name; a directory equal to --session-dir and a transcript file whose file name also exists in --session-dir are skipped. A selected transcript file without an entry time starts a new claude session. A transcript file selected from another session directory is copied into --session-dir, created with mode 700 when absent, keeping its mode and times, together with its session id directory <session id>/; the source stays where it is. Exits 0 in every case above.')
1047
+ .requiredOption('--session-name <name>', 'Name the worker claude session is started with (claude --name); a transcript file is a candidate only when its first line contains "customTitle":"<name>"')
1048
+ .requiredOption('--session-dir <path>', 'Session directory holding the transcript files (<session id>.jsonl) of the current working directory of the worker; claude --resume <session id> finds transcript files only in this directory')
1049
+ .requiredOption('--archive-root <path>', 'Directory archive-unresumable-session moves transcript files into; a transcript file is archived when <archive-root>/<session id>.jsonl or <archive-root>/<directory>/<session id>.jsonl exists')
1050
+ .option('--other-session-dir <path>', 'Session directory of another worktree of the same repository, searched when --session-dir yields no resumable transcript file; repeatable, and of transcript files with the same modification time the one in the directory given first wins', (otherSessionDir, previousOtherSessionDirs) => [
1051
+ ...previousOtherSessionDirs,
1052
+ otherSessionDir,
1053
+ ], [])
1054
+ .action((options) => {
1055
+ const output = (0, resumableSessionSelect_1.resumableSessionSelect)({
1056
+ sessionName: options.sessionName,
1057
+ sessionDir: options.sessionDir,
1058
+ otherSessionDirs: options.otherSessionDir,
1059
+ archiveRoot: options.archiveRoot,
1060
+ });
1061
+ if (output.stdout !== null) {
1062
+ console.log(output.stdout);
1063
+ }
1064
+ output.stderrLines.forEach((stderrLine) => console.error(stderrLine));
1065
+ if (output.exitCode !== 0) {
1066
+ return process.exit(output.exitCode);
1067
+ }
1068
+ });
982
1069
  exports.program
983
1070
  .command('check-issue-silent-dispatch-allowed')
984
1071
  .description('Parse owner/repo/issue-number from --issue-url, fetch that issue body via the GitHub REST API using the GH_TOKEN environment variable, and evaluate it with isSilentDispatchAllowedByIssueBody. Exits 0 when silent dispatch is allowed for this issue, 1 when it is not, and 2 with a diagnostic on stderr when the URL cannot be parsed or the GitHub API call fails. Writes nothing to stdout for exit codes 0 or 1.')
@@ -1001,6 +1088,13 @@ exports.program
1001
1088
  }
1002
1089
  return process.exit(output.exitCode);
1003
1090
  });
1091
+ exports.program
1092
+ .command('workerRequestTextRead')
1093
+ .description('Print the request text a worker session receives for one issue, "Take ownership of <issue url>", followed by one newline to stdout and exit 0. The worker launcher passes the printed text to the worker session unchanged, so this CLI, which also parses that text back out of running processes, is the single place that defines it. Reads nothing and changes nothing.')
1094
+ .requiredOption('--issueUrl <url>', 'GitHub issue URL the worker session takes ownership of')
1095
+ .action((options) => {
1096
+ console.log((0, WorkerRequestText_1.workerRequestTextOf)(options.issueUrl));
1097
+ });
1004
1098
  const storyGateCommandOutputPrintAndExit = (output) => {
1005
1099
  if (output.stdout !== null) {
1006
1100
  console.log(output.stdout);