github-issue-tower-defence-management 2.154.9 → 2.155.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -1
- package/bin/adapter/entry-points/cli/fleetConfig.js +33 -1
- package/bin/adapter/entry-points/cli/fleetConfig.js.map +1 -1
- package/bin/adapter/entry-points/cli/index.js +159 -51
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.js +27 -0
- package/bin/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.js.map +1 -0
- package/bin/adapter/entry-points/cli/projectConfig.js +5 -0
- package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
- package/bin/adapter/entry-points/cli/resumableSessionSelect.js +45 -0
- package/bin/adapter/entry-points/cli/resumableSessionSelect.js.map +1 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-B_lVAA3P.css +2 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-CN6FXgfc.js +93 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/bin/adapter/entry-points/console/webServer.js +20 -0
- package/bin/adapter/entry-points/console/webServer.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +30 -6
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/proxy/TokenListLoader.js +3 -2
- package/bin/adapter/proxy/TokenListLoader.js.map +1 -1
- package/bin/adapter/repositories/FileSystemResumableSessionTranscriptRepository.js +188 -0
- package/bin/adapter/repositories/FileSystemResumableSessionTranscriptRepository.js.map +1 -0
- package/bin/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.js +98 -0
- package/bin/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.js.map +1 -0
- package/bin/adapter/repositories/FileSystemWorkerSessionLogRepository.js +57 -0
- package/bin/adapter/repositories/FileSystemWorkerSessionLogRepository.js.map +1 -0
- package/bin/adapter/repositories/GitHubIssueCommentRepository.js +15 -2
- package/bin/adapter/repositories/GitHubIssueCommentRepository.js.map +1 -1
- package/bin/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.js +245 -0
- package/bin/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.js.map +1 -0
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +110 -19
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/RestIssueRepository.js +1 -0
- package/bin/adapter/repositories/issue/RestIssueRepository.js.map +1 -1
- package/bin/domain/entities/WorkerRequestText.js +6 -0
- package/bin/domain/entities/WorkerRequestText.js.map +1 -0
- package/bin/domain/entities/WorkerSessionFailureStreak.js +3 -0
- package/bin/domain/entities/WorkerSessionFailureStreak.js.map +1 -0
- package/bin/domain/services/commentCreateWithDedupRetry.js +46 -0
- package/bin/domain/services/commentCreateWithDedupRetry.js.map +1 -0
- package/bin/domain/usecases/AssignNoAssigneeIssueToManagerUseCase.js +2 -1
- package/bin/domain/usecases/AssignNoAssigneeIssueToManagerUseCase.js.map +1 -1
- package/bin/domain/usecases/CloseIssueAsRequestApplier.js +29 -0
- package/bin/domain/usecases/CloseIssueAsRequestApplier.js.map +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +61 -15
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/ResumableSessionSelectUseCase.js +153 -0
- package/bin/domain/usecases/ResumableSessionSelectUseCase.js.map +1 -0
- package/bin/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.js +12 -7
- package/bin/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.js.map +1 -1
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js +59 -21
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/StartPreparationUseCase.js +157 -3
- package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/WorkerSessionEndClassifyUseCase.js +225 -0
- package/bin/domain/usecases/WorkerSessionEndClassifyUseCase.js.map +1 -0
- package/bin/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.js +3 -0
- package/bin/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.js.map +1 -0
- package/bin/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.js +3 -0
- package/bin/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.js.map +1 -0
- package/bin/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.js +3 -0
- package/bin/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.js.map +1 -0
- package/bin/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.js +3 -0
- package/bin/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.js.map +1 -0
- package/bin/domain/usecases/extractCloseIssueAs.js +24 -0
- package/bin/domain/usecases/extractCloseIssueAs.js.map +1 -0
- package/bin/domain/usecases/findLastAgentReport.js +9 -3
- package/bin/domain/usecases/findLastAgentReport.js.map +1 -1
- package/bin/domain/usecases/isTransientApiError.js +3 -1
- package/bin/domain/usecases/isTransientApiError.js.map +1 -1
- package/bin/domain/usecases/urgentStoryLaunchHoldDecide.js +76 -0
- package/bin/domain/usecases/urgentStoryLaunchHoldDecide.js.map +1 -0
- package/package.json +1 -1
- package/types/adapter/entry-points/cli/fleetConfig.d.ts +3 -0
- package/types/adapter/entry-points/cli/fleetConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.d.ts +8 -0
- package/types/adapter/entry-points/cli/notifyFinishedIssuePreparationRetry.d.ts.map +1 -0
- package/types/adapter/entry-points/cli/projectConfig.d.ts +3 -0
- package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/resumableSessionSelect.d.ts +12 -0
- package/types/adapter/entry-points/cli/resumableSessionSelect.d.ts.map +1 -0
- package/types/adapter/entry-points/console/webServer.d.ts +1 -0
- package/types/adapter/entry-points/console/webServer.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts +3 -0
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/proxy/TokenListLoader.d.ts +1 -0
- package/types/adapter/proxy/TokenListLoader.d.ts.map +1 -1
- package/types/adapter/repositories/FileSystemResumableSessionTranscriptRepository.d.ts +13 -0
- package/types/adapter/repositories/FileSystemResumableSessionTranscriptRepository.d.ts.map +1 -0
- package/types/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.d.ts +12 -0
- package/types/adapter/repositories/FileSystemWorkerSessionFailureStreakRepository.d.ts.map +1 -0
- package/types/adapter/repositories/FileSystemWorkerSessionLogRepository.d.ts +5 -0
- package/types/adapter/repositories/FileSystemWorkerSessionLogRepository.d.ts.map +1 -0
- package/types/adapter/repositories/GitHubIssueCommentRepository.d.ts +5 -0
- package/types/adapter/repositories/GitHubIssueCommentRepository.d.ts.map +1 -1
- package/types/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.d.ts +30 -0
- package/types/adapter/repositories/LocalStorageUrgentStoryLaunchHoldRepository.d.ts.map +1 -0
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +3 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/RestIssueRepository.d.ts.map +1 -1
- package/types/domain/entities/Comment.d.ts +1 -0
- package/types/domain/entities/Comment.d.ts.map +1 -1
- package/types/domain/entities/SearchedIssue.d.ts +1 -0
- package/types/domain/entities/SearchedIssue.d.ts.map +1 -1
- package/types/domain/entities/WorkerRequestText.d.ts +2 -0
- package/types/domain/entities/WorkerRequestText.d.ts.map +1 -0
- package/types/domain/entities/WorkerSessionFailureStreak.d.ts +5 -0
- package/types/domain/entities/WorkerSessionFailureStreak.d.ts.map +1 -0
- package/types/domain/services/commentCreateWithDedupRetry.d.ts +11 -0
- package/types/domain/services/commentCreateWithDedupRetry.d.ts.map +1 -0
- package/types/domain/usecases/AssignNoAssigneeIssueToManagerUseCase.d.ts.map +1 -1
- package/types/domain/usecases/CloseIssueAsRequestApplier.d.ts +16 -0
- package/types/domain/usecases/CloseIssueAsRequestApplier.d.ts.map +1 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +1 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts +4 -1
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/ResumableSessionSelectUseCase.d.ts +35 -0
- package/types/domain/usecases/ResumableSessionSelectUseCase.d.ts.map +1 -0
- package/types/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.d.ts +3 -1
- package/types/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.d.ts.map +1 -1
- package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts +5 -2
- package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts +12 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/WorkerSessionEndClassifyUseCase.d.ts +27 -0
- package/types/domain/usecases/WorkerSessionEndClassifyUseCase.d.ts.map +1 -0
- package/types/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.d.ts +22 -0
- package/types/domain/usecases/adapter-interfaces/ResumableSessionTranscriptRepository.d.ts.map +1 -0
- package/types/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.d.ts +11 -0
- package/types/domain/usecases/adapter-interfaces/UrgentStoryLaunchHoldRepository.d.ts.map +1 -0
- package/types/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.d.ts +7 -0
- package/types/domain/usecases/adapter-interfaces/WorkerSessionFailureStreakRepository.d.ts.map +1 -0
- package/types/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.d.ts +11 -0
- package/types/domain/usecases/adapter-interfaces/WorkerSessionLogRepository.d.ts.map +1 -0
- package/types/domain/usecases/extractCloseIssueAs.d.ts +12 -0
- package/types/domain/usecases/extractCloseIssueAs.d.ts.map +1 -0
- package/types/domain/usecases/findLastAgentReport.d.ts +1 -0
- package/types/domain/usecases/findLastAgentReport.d.ts.map +1 -1
- package/types/domain/usecases/isTransientApiError.d.ts.map +1 -1
- package/types/domain/usecases/urgentStoryLaunchHoldDecide.d.ts +48 -0
- package/types/domain/usecases/urgentStoryLaunchHoldDecide.d.ts.map +1 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BCjejjC0.css +0 -2
- package/bin/adapter/entry-points/console/ui-dist/assets/index-CcgrBS5P.js +0 -93
package/README.md
CHANGED
|
@@ -30,7 +30,9 @@ Commands:
|
|
|
30
30
|
ownerCallFileAppend [options] Append one owner call to the per-session owner call file (writes nothing to stdout)
|
|
31
31
|
ownerCallFileDelete [options] Delete the per-session owner call file (writes nothing to stdout; an already absent file is not an error)
|
|
32
32
|
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
|
|
33
|
+
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
34
|
check-issue-silent-dispatch-allowed [options] Check whether an issue's body allows a dispatch cycle to end with no agent comment (read-only)
|
|
35
|
+
workerRequestTextRead [options] Print the request text a worker session receives for an issue, "Take ownership of <issue url>" (read-only)
|
|
34
36
|
help [command] display help for command
|
|
35
37
|
|
|
36
38
|
Options for schedule:
|
|
@@ -67,6 +69,9 @@ Options for notifyFinishedIssuePreparation:
|
|
|
67
69
|
--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
70
|
--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
71
|
--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.
|
|
72
|
+
--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.
|
|
73
|
+
--sessionWasResumed The worker session that just ended resumed a previous conversation; used with --sessionLogFilePath to decide --promptTooLongOnResume
|
|
74
|
+
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.
|
|
70
75
|
|
|
71
76
|
Options for checkIssueReviewReadiness:
|
|
72
77
|
--configFilePath <path> Path to config file for tower defence management (required)
|
|
@@ -119,8 +124,17 @@ Options for archive-unresumable-session:
|
|
|
119
124
|
--session-dir <path> Directory holding conversation records named <session-id>.jsonl (required)
|
|
120
125
|
--archive-dir <path> Destination directory the conversation record is moved into; created when it does not exist (required)
|
|
121
126
|
|
|
127
|
+
Options for select-resumable-session:
|
|
128
|
+
--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)
|
|
129
|
+
--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)
|
|
130
|
+
--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)
|
|
131
|
+
--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
|
|
132
|
+
|
|
122
133
|
Options for check-issue-silent-dispatch-allowed:
|
|
123
134
|
--issue-url <url> GitHub issue URL (required)
|
|
135
|
+
|
|
136
|
+
Options for workerRequestTextRead:
|
|
137
|
+
--issueUrl <url> GitHub issue URL the worker session takes ownership of (required)
|
|
124
138
|
```
|
|
125
139
|
|
|
126
140
|
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 +202,21 @@ preparationWorker:
|
|
|
188
202
|
graphqlRateLimitFloor: 500
|
|
189
203
|
```
|
|
190
204
|
|
|
205
|
+
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:
|
|
206
|
+
|
|
207
|
+
- `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`.
|
|
208
|
+
- `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.
|
|
209
|
+
|
|
210
|
+
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:
|
|
211
|
+
|
|
212
|
+
```yaml
|
|
213
|
+
claudeCodeOauthTokenListJsonPath: ~/.config/tdpm/claude-code-oauth-tokens.json
|
|
214
|
+
startPreparation:
|
|
215
|
+
maximumPreparingIssuesCount: 80
|
|
216
|
+
urgentStoryNames:
|
|
217
|
+
- urgent / production incident
|
|
218
|
+
```
|
|
219
|
+
|
|
191
220
|
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
221
|
|
|
193
222
|
- `owner` (string, required): GitHub owner (organisation or user) of the repository where the workflow issue is created.
|
|
@@ -219,8 +248,12 @@ The `ownerCallFileAppend` and `ownerCallFileDelete` sub-commands maintain one te
|
|
|
219
248
|
|
|
220
249
|
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
250
|
|
|
251
|
+
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.
|
|
252
|
+
|
|
222
253
|
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
254
|
|
|
255
|
+
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.
|
|
256
|
+
|
|
224
257
|
## Example 📖
|
|
225
258
|
|
|
226
259
|
Here's a quick example to illustrate its usage:
|
|
@@ -261,6 +294,10 @@ TOKEN=$(npx github-issue-tower-defence-management selectLiveSessionOauthToken --
|
|
|
261
294
|
npx github-issue-tower-defence-management countInTmuxByHumanSessionsPerToken --configFilePath ./preparator-config.yml --tokenListJsonPath ./claudeCodeOauthTokenList.json
|
|
262
295
|
```
|
|
263
296
|
|
|
297
|
+
```
|
|
298
|
+
REQUEST_TEXT=$(npx github-issue-tower-defence-management workerRequestTextRead --issueUrl https://github.com/HiromiShikata/test-repository/issues/1)
|
|
299
|
+
```
|
|
300
|
+
|
|
264
301
|
## Config
|
|
265
302
|
|
|
266
303
|
### Schedule Command Config
|
|
@@ -757,7 +794,14 @@ The following use cases execute on every `schedule` trigger (cadence is determin
|
|
|
757
794
|
- `RevertOrphanedPreparationUseCase` — reverts orphaned preparation issues back to awaiting-workspace
|
|
758
795
|
- `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
796
|
- `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
|
|
797
|
+
- `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.
|
|
798
|
+
- `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"}`.
|
|
799
|
+
- 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.
|
|
800
|
+
- 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.
|
|
801
|
+
- 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`.
|
|
802
|
+
- Already-closed rule: when the issue is already closed, the tool does not close it again and sets Status to `Done`.
|
|
803
|
+
- 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.
|
|
804
|
+
- `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
805
|
- `SetWorkflowManagementIssueToStoryUseCase`
|
|
762
806
|
- `SetNoStoryIssueToStoryUseCase`
|
|
763
807
|
- `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;AACnD,QAAA,kCAAkC,GAAG,6BAA6B,CAAC;AACnE,QAAA,mCAAmC,GAAG,uBAAuB,CAAC;AAC9D,QAAA,+BAA+B,GAAG,2BAA2B,CAAC;AAE9D,QAAA,4CAA4C,GAAG,EAAE,CAAC;AAElD,QAAA,8BAA8B,GAAG,EAAE,CAAC;AACpC,QAAA,gCAAgC,GAAG,GAAG,CAAC;AAQvC,QAAA,mCAAmC,GAA8B;IAC5E,qBAAqB,EAAE,iDAAuB;IAC9C,oBAAoB,EAAE,sCAA8B;IACpD,qBAAqB,EAAE,wCAAgC;CACxD,CAAC;AAMW,QAAA,wCAAwC,GACnD;IACE,2BAA2B,EAAE,oDAA4C;CAC1E,CAAC;AAEG,MAAM,0BAA0B,GA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AAI,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;
|
|
@@ -193,9 +233,18 @@ exports.program
|
|
|
193
233
|
(0, projectConfig_2.loadConfigFile)(options.config).errorReportingRepository ??
|
|
194
234
|
process.env.TDPM_ERROR_REPORT_REPOSITORY ??
|
|
195
235
|
'';
|
|
196
|
-
const { HandleScheduledEventUseCaseHandler } = await Promise.resolve().then(() => __importStar(require('../handlers/HandleScheduledEventUseCaseHandler')));
|
|
236
|
+
const { HandleScheduledEventUseCaseHandler, ScheduledEventHandlerInputValidationError, } = await Promise.resolve().then(() => __importStar(require('../handlers/HandleScheduledEventUseCaseHandler')));
|
|
197
237
|
const handler = new HandleScheduledEventUseCaseHandler();
|
|
198
|
-
|
|
238
|
+
try {
|
|
239
|
+
await handler.handle(options.config, options.verbose, parseInTmuxProjectOrder(options.inTmuxProjectOrder));
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
if (error instanceof ScheduledEventHandlerInputValidationError) {
|
|
243
|
+
console.error(error.message);
|
|
244
|
+
return process.exit(1);
|
|
245
|
+
}
|
|
246
|
+
throw error;
|
|
247
|
+
}
|
|
199
248
|
}
|
|
200
249
|
});
|
|
201
250
|
exports.program
|
|
@@ -404,7 +453,10 @@ exports.program
|
|
|
404
453
|
.option('--moveToFailedPreparation', 'Move the item to Failed Preparation status after reaching the consecutive failure threshold')
|
|
405
454
|
.option('--fleetConfigFilePath <path>', 'Path to fleet config YAML file (also read from TDPM_FLEET_CONFIG env var)')
|
|
406
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')
|
|
407
458
|
.action(async (options) => {
|
|
459
|
+
const sessionEndFlags = await notifyFinishedSessionEndFlagsResolve(options);
|
|
408
460
|
const token = process.env.GH_TOKEN;
|
|
409
461
|
if (!token) {
|
|
410
462
|
console.error('GH_TOKEN environment variable is required');
|
|
@@ -456,23 +508,6 @@ exports.program
|
|
|
456
508
|
const dispatchStartedAt = resolveUtcTimestampOption(options.dispatchStartedAt, 'dispatchStartedAt');
|
|
457
509
|
const workflowBlockerResolvedWebhookUrl = config.workflowBlockerResolvedWebhookUrl ?? null;
|
|
458
510
|
const projectName = config.projectName ?? 'default';
|
|
459
|
-
const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
|
|
460
|
-
const cachePath = (0, localStorageCacheDirectory_1.projectCacheDirectory)(projectName);
|
|
461
|
-
const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
|
|
462
|
-
const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository, token);
|
|
463
|
-
const readGhTokens = await (0, githubAppTokenMinter_1.mintReadOnlyTokensFromKeyPaths)(config.githubAppPrivateKeyPaths ?? []);
|
|
464
|
-
const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams, localStorageCacheRepository, readGhTokens);
|
|
465
|
-
const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
|
|
466
|
-
const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams, readGhTokens);
|
|
467
|
-
const graphqlProjectItemRepository = new GraphqlProjectItemRepository_1.GraphqlProjectItemRepository(...githubRepositoryParams);
|
|
468
|
-
const issueRepository = new ApiV3CheerioRestIssueRepository_1.ApiV3CheerioRestIssueRepository(apiV3IssueRepository, restIssueRepository, graphqlProjectItemRepository, localStorageCacheRepository, projectRepository, new SystemDateRepository_1.SystemDateRepository(), ...githubRepositoryParams);
|
|
469
|
-
const issueCommentRepository = new GitHubIssueCommentRepository_1.GitHubIssueCommentRepository(token, localStorageCacheRepository);
|
|
470
|
-
const webhookRepository = new FetchWebhookRepository_1.FetchWebhookRepository();
|
|
471
|
-
const consoleDataOutputDir = config.consoleDataOutputDir ?? null;
|
|
472
|
-
const consoleTabsRepository = consoleDataOutputDir !== null
|
|
473
|
-
? new FileSystemConsoleTabsRepository_1.FileSystemConsoleTabsRepository(consoleDataOutputDir, projectName)
|
|
474
|
-
: null;
|
|
475
|
-
const useCase = new NotifyFinishedIssuePreparationUseCase_1.NotifyFinishedIssuePreparationUseCase(projectRepository, issueRepository, issueCommentRepository, webhookRepository, consoleTabsRepository);
|
|
476
511
|
const rawAllowedIssueAuthors = config.allowedIssueAuthors;
|
|
477
512
|
const allowedIssueAuthors = rawAllowedIssueAuthors
|
|
478
513
|
? rawAllowedIssueAuthors
|
|
@@ -488,39 +523,79 @@ exports.program
|
|
|
488
523
|
console.error(error instanceof Error ? error.message : String(error));
|
|
489
524
|
return process.exit(1);
|
|
490
525
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
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
|
+
});
|
|
522
570
|
}
|
|
523
|
-
|
|
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>" when defaultLlmEffortLevel is set and "--autocompact <value>" when defaultLlmAutocompactMode is set, both space-separated on a single stdout line when both are set, and writes nothing when neither is set. The launcher forwards this output to claude-agent verbatim and decides nothing itself, 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 flags = [];
|
|
591
|
+
if (config.defaultLlmEffortLevel) {
|
|
592
|
+
flags.push('--effort', config.defaultLlmEffortLevel);
|
|
593
|
+
}
|
|
594
|
+
if (config.defaultLlmAutocompactMode) {
|
|
595
|
+
flags.push('--autocompact', config.defaultLlmAutocompactMode);
|
|
596
|
+
}
|
|
597
|
+
if (flags.length > 0) {
|
|
598
|
+
process.stdout.write(`${flags.join(' ')}\n`);
|
|
524
599
|
}
|
|
525
600
|
});
|
|
526
601
|
exports.program
|
|
@@ -709,6 +784,7 @@ const runServeWeb = async (options) => {
|
|
|
709
784
|
dashboardDir,
|
|
710
785
|
dashboardDataDir,
|
|
711
786
|
dashboardProjectNames,
|
|
787
|
+
dashboardProjectConfigDirectory: config.consoleProjectConfigDirectory ?? null,
|
|
712
788
|
dashboardProjectUrls: pjcodeToProjectUrl,
|
|
713
789
|
fleetTaskCreateUrl,
|
|
714
790
|
resolveGithubToken,
|
|
@@ -970,6 +1046,31 @@ exports.program
|
|
|
970
1046
|
return process.exit(output.exitCode);
|
|
971
1047
|
}
|
|
972
1048
|
});
|
|
1049
|
+
exports.program
|
|
1050
|
+
.command('select-resumable-session')
|
|
1051
|
+
.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.')
|
|
1052
|
+
.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>"')
|
|
1053
|
+
.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')
|
|
1054
|
+
.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')
|
|
1055
|
+
.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) => [
|
|
1056
|
+
...previousOtherSessionDirs,
|
|
1057
|
+
otherSessionDir,
|
|
1058
|
+
], [])
|
|
1059
|
+
.action((options) => {
|
|
1060
|
+
const output = (0, resumableSessionSelect_1.resumableSessionSelect)({
|
|
1061
|
+
sessionName: options.sessionName,
|
|
1062
|
+
sessionDir: options.sessionDir,
|
|
1063
|
+
otherSessionDirs: options.otherSessionDir,
|
|
1064
|
+
archiveRoot: options.archiveRoot,
|
|
1065
|
+
});
|
|
1066
|
+
if (output.stdout !== null) {
|
|
1067
|
+
console.log(output.stdout);
|
|
1068
|
+
}
|
|
1069
|
+
output.stderrLines.forEach((stderrLine) => console.error(stderrLine));
|
|
1070
|
+
if (output.exitCode !== 0) {
|
|
1071
|
+
return process.exit(output.exitCode);
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
973
1074
|
exports.program
|
|
974
1075
|
.command('check-issue-silent-dispatch-allowed')
|
|
975
1076
|
.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.')
|
|
@@ -992,6 +1093,13 @@ exports.program
|
|
|
992
1093
|
}
|
|
993
1094
|
return process.exit(output.exitCode);
|
|
994
1095
|
});
|
|
1096
|
+
exports.program
|
|
1097
|
+
.command('workerRequestTextRead')
|
|
1098
|
+
.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.')
|
|
1099
|
+
.requiredOption('--issueUrl <url>', 'GitHub issue URL the worker session takes ownership of')
|
|
1100
|
+
.action((options) => {
|
|
1101
|
+
console.log((0, WorkerRequestText_1.workerRequestTextOf)(options.issueUrl));
|
|
1102
|
+
});
|
|
995
1103
|
const storyGateCommandOutputPrintAndExit = (output) => {
|
|
996
1104
|
if (output.stdout !== null) {
|
|
997
1105
|
console.log(output.stdout);
|