input-kanban 0.0.8 → 0.0.10

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/ENVIRONMENT.md CHANGED
@@ -8,16 +8,18 @@ CLI options take precedence over environment variables. Environment variables ta
8
8
 
9
9
  - `PORT`: HTTP server port. Default: `8787`. CLI option: `--port`.
10
10
  - `HOST`: HTTP bind host. Default: `127.0.0.1`. CLI option: `--host`.
11
- - `KANBAN_DEFAULT_REPO`: Default target repository path for new runs. Default: the current working directory when `input-kanban` is launched. CLI option: `--repo`. Creating a run validates that this path is inside a Git work tree.
11
+ - `KANBAN_DEFAULT_WORKSPACE`: Default workspace path for new runs. Default: the current working directory when `input-kanban` is launched. CLI option: `--workspace`. `KANBAN_DEFAULT_REPO` remains as a compatibility alias. Creating a run only requires this path to exist and be a directory; Git is detected and marked when available.
12
12
  - `KANBAN_RUNS_DIR`: Directory for run state, logs, and artifacts. Default: `.input-kanban/runs` under the user's home directory. CLI option: `--runs-dir`.
13
13
  - `KANBAN_CODEX_BIN`: Codex CLI executable name or path. Default: `codex`. CLI option: `--codex-bin`.
14
14
  - `KANBAN_RUNNER`: Runner mode. Supported values: `headless`, `tmux`. Default: `headless`. CLI option: `--runner`.
15
+ - `KANBAN_AUTO_POLL_MS`: Poll interval for the Web server background scheduler. Default: `3000`.
16
+ - `KANBAN_AUTO_MAX_RETRIES`: Maximum automatic retries for recoverable failed/unknown tasks in the scheduler. Default: `1`.
15
17
 
16
18
  ## Environment Example
17
19
 
18
20
  ```bash
19
21
  PORT=8787 \
20
- KANBAN_DEFAULT_REPO=/path/to/child-repo \
22
+ KANBAN_DEFAULT_WORKSPACE=/path/to/workspace \
21
23
  KANBAN_RUNS_DIR=/path/to/kanban-runs \
22
24
  KANBAN_CODEX_BIN=codex \
23
25
  KANBAN_RUNNER=headless \
@@ -29,7 +31,7 @@ input-kanban
29
31
  ```bash
30
32
  input-kanban \
31
33
  --port 8787 \
32
- --repo /path/to/child-repo \
34
+ --workspace /path/to/workspace \
33
35
  --runs-dir /path/to/kanban-runs \
34
36
  --codex-bin codex \
35
37
  --runner headless
@@ -37,7 +39,8 @@ input-kanban \
37
39
 
38
40
  ## Notes
39
41
 
40
- - `KANBAN_DEFAULT_REPO` / `--repo` should point to the actual git repository where work should run.
42
+ - `KANBAN_DEFAULT_WORKSPACE` / `--workspace` should point to the local directory where work should run; `KANBAN_DEFAULT_REPO` / `--repo` remain compatibility aliases.
43
+ - `input-kanban serve` starts a lightweight background scheduler that uses the same orchestrator auto-advance path as CLI `submit --auto` / `input-kanban auto <runId>`. It advances planned runs, serial batches, final judge startup, and bounded automatic retries without relying on an open browser tab.
41
44
  - `KANBAN_RUNNER` / `--runner tmux` runs Codex tasks inside tmux windows while keeping scheduling and status tracking in the Node.js orchestrator.
42
45
  - `KANBAN_RUNNER=tmux` is optional. Use it when you want live terminal visibility into planner, worker, and final judge sessions.
43
46
  - tmux mode uses one session per run and one window for planner, each batch, and judge. Batch windows contain an overview pane plus worker panes.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zhang3xing1
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/PROJECT_GUIDE.md CHANGED
@@ -33,9 +33,9 @@ The intended use case is:
33
33
 
34
34
  ## Important Boundaries
35
35
 
36
- - If the current workspace is a multi-repo umbrella, the target repo must be a concrete child repository, not the umbrella root.
37
- - Workers can modify the target repository. Failed workers are not automatically retried because a partial modification may already exist.
38
- - The planner only creates a plan and does not modify the target repo. Planner failures, invalid output, and empty plans can be safely retried before any worker or judge starts.
36
+ - If the current workspace is a multi-repo umbrella, the target workspace must be a concrete child directory, not the umbrella root.
37
+ - Workers can modify the target workspace. Failed workers are not automatically retried because a partial modification may already exist.
38
+ - The planner only creates a plan and does not modify the target workspace. Planner failures, invalid output, and empty plans can be safely retried before any worker or judge starts.
39
39
  - Local process state, `exit_code`, logs, and artifacts are the source of truth. Codex App Server session lookup is auxiliary.
40
40
  - tmux mode changes terminal visibility only. Node.js still owns scheduling, batch barriers, `maxParallel`, stop/archive, `judge_input.json`, and status refresh from `exit_code` plus artifacts.
41
41
  - tmux windows stay open after command completion for human inspection, but `exit_code` is written before the keep-open shell starts so state can advance without closing the window.
@@ -58,6 +58,7 @@ Supported serve options:
58
58
  ```text
59
59
  --host <host>
60
60
  --port <port>
61
+ --workspace <path>
61
62
  --repo <path>
62
63
  --runs-dir <path>
63
64
  --codex-bin <path>
@@ -87,6 +88,19 @@ Supported result options:
87
88
 
88
89
  `input-kanban result [runId]` prints the final judge result. It prefers `judge/verdict.json` and falls back to `judge/last_message.md`. If no `runId` is provided, it uses the latest run. `--copy` sends the result to the system clipboard.
89
90
 
91
+ Supported retry options:
92
+
93
+ ```text
94
+ <runId>
95
+ [taskId]
96
+ --runs-dir <path>
97
+ --reason <text>
98
+ --max-retries <n>
99
+ --json
100
+ ```
101
+
102
+ `input-kanban retry <runId> [taskId]` retries failed or unknown worker tasks. If `taskId` is omitted, it retries failed/unknown tasks in the current blocked batch. Before retrying, the worker output directory is moved under `worker_attempts/<taskId>/attempt-XX/` so failed logs, stderr, exit code, and last message remain available for audit. Retry resets the task to `pending`, records retry history, then reuses the existing scheduler.
103
+
90
104
  Supported stop options:
91
105
 
92
106
  ```text
@@ -100,6 +114,7 @@ Supported stop options:
100
114
  Supported submit options:
101
115
 
102
116
  ```text
117
+ --workspace <path>
103
118
  --repo <path>
104
119
  --label <label>
105
120
  --task <text>
@@ -115,16 +130,48 @@ Supported submit options:
115
130
  --poll-ms <ms>
116
131
  ```
117
132
 
118
- `input-kanban submit` creates a run and starts the planner. Task content can come from `--task <text>` or `--task-file <path|->`; omitting `--repo` uses the current working directory as the target Git work tree. Omitting `--label` derives the run label from the first non-empty task line. Auto mode is the default for submit: it keeps polling the run, dispatches batches when the plan is ready, and starts the final judge once all batches complete. `--no-auto` keeps submit to create + plan only. `-d` / `--detach` starts a background supervisor process for the auto loop and lets the submitting terminal return immediately. The submit output includes `input-kanban status <runId> --watch` for terminal-side observation. Because it writes to the same runs directory as the Web server, CLI-created runs are visible in the 8787 dashboard when both processes use the same `--runs-dir`.
133
+ `input-kanban submit` creates a run and starts the planner. Task content can come from `--task <text>` or `--task-file <path|->`; omitting `--workspace` uses the current working directory as the target workspace, and `--repo` remains a compatibility alias. Omitting `--label` derives the run label from the first non-empty task line. Auto mode is the default for submit: it keeps polling the run through the shared orchestrator auto-advance path, dispatches batches when the plan is ready, and starts the final judge once all batches complete. `--no-auto` keeps submit to create + plan only. `-d` / `--detach` starts a background supervisor process for the same auto loop and lets the submitting terminal return immediately. The Web server also starts a lightweight scheduler that uses this shared path, so serial batch advancement does not depend on an open browser tab. The submit output includes `input-kanban status <runId> --watch` for terminal-side observation. Because it writes to the same runs directory as the Web server, CLI-created runs are visible in the 8787 dashboard when both processes use the same `--runs-dir`.
119
134
 
120
135
  Default behavior:
121
136
 
122
- - default repo: current working directory when `input-kanban` is launched; run creation validates that the selected repo is inside a Git work tree;
137
+ - default workspace: current working directory when `input-kanban` is launched; run creation only validates that the selected directory exists and is a directory; Git is detected and labeled when available;
123
138
  - default host: `127.0.0.1`;
124
139
  - default port: `8787`;
125
140
  - default runs directory: `~/.input-kanban/runs`;
126
141
  - default Codex binary: `codex`.
127
142
 
143
+ ## Agent Workflow
144
+
145
+ This project already exposes an agent-friendly CLI path. Use `--json` for machine-readable output and `runs --active` to discover current work before asking for per-run details.
146
+
147
+ Discovery / lookup pattern:
148
+
149
+ ```text
150
+ input-kanban --json runs --active
151
+ input-kanban --json status <runId>
152
+ input-kanban --json result <runId>
153
+ input-kanban --json stop <runId>
154
+ ```
155
+
156
+ Key points:
157
+
158
+ - `runs` lists visible batches from the shared runs directory; `--active` filters to runs that have not reached a terminal state or still have running tasks.
159
+ - `status` resolves a single run by id and defaults to the latest run when the id is omitted.
160
+ - `result` prefers `judge/verdict.json` and falls back to `judge/last_message.md`; `--copy` copies the result to the clipboard.
161
+ - `stop` requires an explicit `runId` and uses the same stop path as the Web dashboard.
162
+ - `retry` retries failed/unknown workers while preserving the failed attempt directory.
163
+ - `submit` defaults to auto mode: planner -> dispatch -> final judge, with one automatic retry for `batch_blocked` by default. `--no-auto` keeps create + plan only, and `-d/--detach` moves the auto loop to a background supervisor.
164
+ - The Web dashboard now follows the same default auto behavior while the page is open: after planning it auto-dispatches planned runs and auto-starts the final judge once all batches complete.
165
+
166
+ Example agent loop:
167
+
168
+ ```text
169
+ 1. input-kanban --json runs --active
170
+ 2. input-kanban --json status <runId>
171
+ 3. input-kanban --json result <runId>
172
+ 4. input-kanban --json stop <runId> # only when necessary
173
+ ```
174
+
128
175
  ## Data Model
129
176
 
130
177
  ### Run
@@ -190,18 +237,81 @@ If the planner returns valid JSON with zero tasks, the run is marked `plan_empty
190
237
 
191
238
  ## Worker Failure Policy
192
239
 
193
- Workers are not automatically retried.
240
+ Failed or unknown workers can be retried explicitly with `input-kanban retry <runId> [taskId]` or via Web/API retry. CLI/Web auto mode may retry a blocked batch once by default.
241
+
242
+ Retry rules:
194
243
 
195
- Reason: a worker may have already changed files in the target repository. Retrying could duplicate edits, overwrite partial work, or create conflicts.
244
+ - Retry is an orchestrator-level state transition, not a runner auto-restart.
245
+ - Retry refuses stopped or archived runs.
246
+ - Retry refuses tasks that still have a live process.
247
+ - Retry preserves failed output under `worker_attempts/<taskId>/attempt-XX/` before resetting the task.
248
+ - Retry resets failed/unknown tasks to `pending`, records retry history, and reuses the existing scheduler.
196
249
 
197
- Recovery options:
250
+ Recovery options after retries are exhausted:
198
251
 
199
- - Inspect `events.pretty`, `stderr.log`, `last_message.md`, and artifacts.
252
+ - Inspect `events.pretty`, `stderr.log`, `last_message.md`, archived worker attempts, and artifacts.
200
253
  - Manually mark `failed` or `unknown` workers as completed if the user confirms the work is actually done.
201
254
  - Manual completion writes `workers/<taskId>/manual_completion.json`.
202
255
  - If the user pastes a manual success result, it is saved as `workers/<taskId>/manual_result.md` and included in final judge input.
203
256
  - The UI preserves the original failed or unknown status while also showing the manual completion marker.
204
257
 
258
+ ## Run State Concurrency and Retry Implementation Notes
259
+
260
+ ### Failure Retry
261
+
262
+ Retry is implemented as an explicit orchestrator state transition.
263
+
264
+ Implemented behavior:
265
+
266
+ - `input-kanban retry <runId> [taskId]` retries either one failed/unknown task or, when `taskId` is omitted, failed/unknown tasks in the current blocked batch.
267
+ - CLI/Web auto mode retries a `batch_blocked` run once by default via the same retry path.
268
+ - Retry reuses the existing scheduler and does not trigger replanning.
269
+ - Planner retry remains separate and only applies before any worker or judge starts.
270
+
271
+ Safety requirements enforced by implementation:
272
+
273
+ 1. Refuse retry when the run is `stopped` or `archived`.
274
+ 2. Refuse retry if the target task still has a live process.
275
+ 3. Preserve the failed attempt directory under `worker_attempts/<taskId>/attempt-XX/` before resetting the task to `pending`.
276
+ 4. Reset the run back to `running` when there is pending retry work, then let the existing scheduler start workers naturally.
277
+ 5. Keep retry counters and history on the task so agents can tell transient noise from deterministic task failure.
278
+
279
+ Why this shape was favored:
280
+
281
+ - Runner-level auto-restart hides intent from the state machine and would have to be duplicated for headless/tmux.
282
+ - Auto-replan is too heavy for a single failed worker and would throw away useful per-task evidence.
283
+ - The retry decision belongs to orchestration, where agents and humans can see it explicitly.
284
+
285
+ ### `run_state.json` Concurrency Safety
286
+
287
+ The backend now uses a per-run lock file to protect state writes. Atomic writes prevent partial files; the lock prevents common lost-update races between detach supervisors, CLI commands, and Web API actions.
288
+
289
+ Implemented shape:
290
+
291
+ - The lock file is `run_state.lock` inside the run directory.
292
+ - Lock acquisition uses exclusive file creation and stores `pid`, `runId`, and timestamp in the lock file.
293
+ - Stale locks can be recovered when the owning PID is gone and the lock is older than the stale threshold.
294
+ - Lock granularity is one run, so different runs do not block each other.
295
+ - State transition paths re-read the run inside the lock before mutating it.
296
+
297
+ Write paths under lock include:
298
+
299
+ - planner start and completion callback;
300
+ - dispatch;
301
+ - retry;
302
+ - stop;
303
+ - archive;
304
+ - rename;
305
+ - manual task completion;
306
+ - judge start and completion callback;
307
+ - refresh/recovery state materialization.
308
+
309
+ Risk notes:
310
+
311
+ - A stale-lock timeout that is too short can accidentally steal a lock from a slow or paused process; too long slows recovery.
312
+ - `child.onExit` callbacks must continue to take the write lock.
313
+ - If the workspace ever moves to shared network storage, the current single-machine exclusive-file assumptions should be re-evaluated.
314
+
205
315
  ## Stop and Archive
206
316
 
207
317
  ### Stop
@@ -307,6 +417,7 @@ runs/<runId>/plan.json
307
417
  runs/<runId>/planner/
308
418
  runs/<runId>/planner_attempts/attempt-XX/
309
419
  runs/<runId>/workers/<taskId>/
420
+ runs/<runId>/worker_attempts/<taskId>/attempt-XX/
310
421
  runs/<runId>/judge/judge_input.json
311
422
  runs/<runId>/workers/<taskId>/events_timed.jsonl
312
423
  runs/<runId>/workers/<taskId>/manual_result.md
@@ -324,6 +435,7 @@ runs/<runId>/judge/verdict.json
324
435
  - `POST /api/runs/:runId/plan`
325
436
  - `POST /api/runs/:runId/dispatch`
326
437
  - `POST /api/runs/:runId/judge`
438
+ - `POST /api/runs/:runId/retry`
327
439
  - `POST /api/runs/:runId/stop`
328
440
  - `POST /api/runs/:runId/archive`
329
441
  - `PATCH /api/runs/:runId/label`
@@ -390,13 +502,13 @@ change. Record the exact commands, run ids, and artifact paths in the release
390
502
  notes or handoff.
391
503
 
392
504
  1. Headless runner:
393
- - Start the app with `input-kanban --runner headless --runs-dir <tmp-runs-dir> --repo <target-repo> --port <free-port>`.
505
+ - Start the app with `input-kanban --runner headless --runs-dir <tmp-runs-dir> --workspace <target-workspace> --port <free-port>`.
394
506
  - Create a small run, plan it, dispatch at least one worker, and run the final judge if the plan requires it.
395
507
  - Verify the run state reports `runner: headless`, no task exposes `tmux` metadata, and role directories contain the expected `prompt.md`, `events.jsonl`, `events_timed.jsonl`, `stderr.log`, `last_message.md`, and `exit_code` files.
396
508
  - Stop the run and verify no unrelated local process is affected.
397
509
 
398
510
  2. tmux runner, only when `tmux -V` succeeds:
399
- - Start the app with `input-kanban --runner tmux --runs-dir <tmp-runs-dir> --repo <target-repo> --port <free-port>`.
511
+ - Start the app with `input-kanban --runner tmux --runs-dir <tmp-runs-dir> --workspace <target-workspace> --port <free-port>`.
400
512
  - Create a small run and click Plan. Verify a session named `input-kanban-<runId>` exists and has a planner window.
401
513
  - Dispatch workers. Verify each batch gets its own window with an overview pane plus worker panes, and each role directory writes `run.sh` and `tmux.json` with the expected `sessionName`, `windowName`, `target`, and `attachCommand`.
402
514
  - Verify `run.sh` writes `exit_code` before printing the keep-open summary, then keeps the window open for manual inspection.
@@ -417,7 +529,7 @@ Keep a single repository-level `RELEASE_NOTES.md` with recent version history. D
417
529
  ## Change Guidelines
418
530
 
419
531
  - Do not add automatic worker retry unless there is a verified rollback or idempotency mechanism.
420
- - Do not default to `--skip-git-repo-check`; prefer a concrete target child repository.
532
+ - Do not default to bypassing workspace validation; prefer a concrete target child workspace.
421
533
  - Preserve batch barriers when modifying scheduling logic.
422
534
  - Decide clearly between soft archive and physical directory archive before changing archive semantics.
423
535
  - Keep the frontend buildless unless there is a strong reason to introduce a build pipeline.
package/README.en.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [中文](README.md) | English
4
4
 
5
- Input Kanban is a local Codex orchestration dashboard. The recommended path is to install it from npm, run `input-kanban` inside the target repository, and use the browser UI to manage planning, worker execution, and final judging.
5
+ Input Kanban is a local Codex orchestration dashboard. The recommended path is to install it from npm, run `input-kanban` inside the target workspace, and use the browser UI to manage planning, worker execution, and final judging. If the workspace is a Git repository, the UI marks it as such.
6
6
 
7
7
  ## Recommended Usage
8
8
 
@@ -18,12 +18,12 @@ Verify the installation:
18
18
  input-kanban --help
19
19
  ```
20
20
 
21
- ### 2. Start in the Target Repository
21
+ ### 2. Start in the Target Workspace
22
22
 
23
- Enter the repository you want Codex to modify or inspect:
23
+ Enter the workspace you want Codex to modify or inspect:
24
24
 
25
25
  ```bash
26
- cd /path/to/your/repo
26
+ cd /path/to/your/workspace
27
27
  input-kanban
28
28
  ```
29
29
 
@@ -35,14 +35,16 @@ http://127.0.0.1:8787
35
35
 
36
36
  Open that URL in your browser to use the dashboard.
37
37
 
38
- ### 3. Start with an Explicit Repository
38
+ ### 3. Start with an Explicit Workspace
39
39
 
40
- If you do not want to `cd` into the target repository first, pass it explicitly:
40
+ If you do not want to `cd` into the target workspace first, pass it explicitly:
41
41
 
42
42
  ```bash
43
- input-kanban --repo /path/to/your/repo
43
+ input-kanban --workspace /path/to/your/workspace
44
44
  ```
45
45
 
46
+ `--repo` remains available as a compatibility alias.
47
+
46
48
  ## CLI Auto Execution
47
49
 
48
50
  To submit a task from the terminal and let it advance automatically, use `submit`. Task content supports two input modes:
@@ -52,7 +54,9 @@ input-kanban submit --task-file task.md --label "Fix login issue"
52
54
  input-kanban submit --task "Fix the login issue and add regression tests" --label "Fix login issue"
53
55
  ```
54
56
 
55
- `submit` creates a run, starts planning, dispatches all batches, and starts the final judge after all workers finish by default. The default repo is the current directory. If `--label` is omitted, the run label is generated from the task text. It uses the same runs directory, so CLI-created runs are visible in the Web dashboard on port 8787 as long as the dashboard uses the same `--runs-dir`.
57
+ `submit` creates a run, starts planning, dispatches all batches, and starts the final judge after all workers finish by default. The default workspace is the current directory. If `--label` is omitted, the run label is generated from the task text. It uses the same runs directory, so CLI-created runs are visible in the Web dashboard on port 8787 as long as the dashboard uses the same `--runs-dir`.
58
+
59
+ `input-kanban serve` starts a lightweight background scheduler that keeps refreshing and advancing unfinished runs: it dispatches batches when a plan is ready, starts the next serial batch after the previous one completes, and starts the final judge after all batches complete. CLI `submit --auto` / `input-kanban auto <runId>` and the Web server share the same orchestrator auto-advance path, so progress no longer depends on whether a browser page is open or refreshed.
56
60
 
57
61
  To return immediately and let a background supervisor continue the auto loop, pass `-d` / `--detach`:
58
62
 
@@ -73,15 +77,21 @@ input-kanban submit --runs-dir ~/.input-kanban/runs --runner tmux -d
73
77
  Check and stop:
74
78
 
75
79
  ```bash
80
+ input-kanban runs
81
+ input-kanban --json runs --active
76
82
  input-kanban status
77
83
  input-kanban status --watch
78
84
  input-kanban status <runId> --watch
85
+ input-kanban --json status <runId>
79
86
  input-kanban result
80
87
  input-kanban result <runId> --copy
88
+ input-kanban --json result <runId>
89
+ input-kanban retry <runId> [taskId]
90
+ input-kanban --json retry <runId> [taskId]
81
91
  input-kanban stop <runId>
82
92
  ```
83
93
 
84
- Without a `runId`, `status` and `result` use the latest run by default. `result --copy` copies the final judge result. Stopping requires an explicit `runId` to avoid stopping the wrong run.
94
+ Use `runs` to discover visible run batches first; `runs --active` shows only runs that have not reached a terminal state or still have running tasks, which lets an agent find `runId` values before calling `status <runId>`. To focus on one workspace, use `input-kanban runs --workspace /path/to/workspace`; the Web sidebar has the same workspace filter. Without a `runId`, `status` and `result` use the latest run by default. `result --copy` copies the final judge result. `retry` preserves the failed attempt and retries failed/unknown tasks. `--json` is handy for agents/scripts that need structured output. Stopping requires an explicit `runId` to avoid stopping the wrong run.
85
95
 
86
96
  ## Common Startup Options
87
97
 
@@ -96,7 +106,7 @@ input-kanban --open
96
106
 
97
107
  Defaults:
98
108
 
99
- - target repository: the current directory where `input-kanban` is launched; creating a run validates that it is inside a Git work tree
109
+ - workspace: the current directory where `input-kanban` is launched; creating a run only requires an existing directory, and Git is shown as an optional capability when detected
100
110
  - host: `127.0.0.1`
101
111
  - port: `8787`
102
112
  - runs directory: `~/.input-kanban/runs`
@@ -107,20 +117,20 @@ Defaults:
107
117
 
108
118
  tmux mode still leaves batch barriers, `maxParallel`, final judge sequencing, and `judge_input.json` generation in Node.js. Each role output directory gets `run.sh` and `tmux.json`; status continues to be driven by `events.jsonl`, `stderr.log`, `last_message.md`, `exit_code`, and existing artifact files. After a tmux role command finishes, it writes `exit_code` first and then keeps the window open for inspection; the user closes the window manually from tmux.
109
119
 
110
- tmux mode is optional and intended for live terminal viewing of each Codex role. `codex exec` is currently non-interactive and does not normally show manual approval prompts; if you select `danger-full-access` when creating a run, you explicitly relax the worker sandbox and should only do so in a controlled test repository.
120
+ tmux mode is optional and intended for live terminal viewing of each Codex role. `codex exec` is currently non-interactive and does not normally show manual approval prompts; if you select `danger-full-access` when creating a run, you explicitly relax the worker sandbox and should only do so in a controlled test workspace.
111
121
 
112
122
  After run-level tmux metadata is available, the dashboard shows `Copy tmux attach command`. The file viewer no longer repeats tmux terminal details; use the run detail header to copy the attach command and inspect the tmux session.
113
123
 
114
124
  ## Using the Dashboard
115
125
 
116
126
  1. Click `New Run`.
117
- 2. Enter a label, target repository, worker sandbox, and task description.
127
+ 2. Enter a label, workspace, worker sandbox, and task description.
118
128
  3. Click `Create Run`.
119
129
  4. The dashboard automatically starts `Plan` so the Codex planner can generate batches and workers.
120
- 5. Click `Dispatch` to run workers by batch barrier and concurrency limits.
121
- 6. Inspect execution logs, final messages, error logs, and artifacts.
122
- 7. After all batches complete, click `Final Judge`.
123
- 8. Stop or archive a run when needed, or manually mark a confirmed failed/unknown worker as completed.
130
+ 5. After planning completes, Web auto mode dispatches workers by batch barrier and concurrency limits by default.
131
+ 6. After all batches complete, Web auto mode starts the final judge by default.
132
+ 7. Inspect execution logs, final messages, error logs, and artifacts.
133
+ 8. Stop or archive a run when needed, or manually click buttons to retry/advance, or manually mark a confirmed failed/unknown worker as completed.
124
134
 
125
135
  ## What It Is For
126
136
 
@@ -153,7 +163,7 @@ runs/<runId>/
153
163
  └── verdict.json
154
164
  ```
155
165
 
156
- These files are local run records and do not need to be committed to your application repository.
166
+ These files are local run records and do not need to be committed to your application workspace.
157
167
 
158
168
  ## Requirements
159
169
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  中文 | [English](README.en.md)
4
4
 
5
- Input Kanban 是一个本地 Codex 编排看板。推荐通过 npm 安装,然后在目标代码仓库里运行 `input-kanban`,用浏览器管理任务拆分、并发执行和最终验收。
5
+ Input Kanban 是一个本地 Codex 编排看板。推荐通过 npm 安装,然后在目标工作区里运行 `input-kanban`,用浏览器管理任务拆分、并发执行和最终验收;如果工作区恰好是 Git 仓库,界面会额外标识出来。
6
6
 
7
7
  ## 推荐使用方式
8
8
 
@@ -18,12 +18,12 @@ npm install -g input-kanban
18
18
  input-kanban --help
19
19
  ```
20
20
 
21
- ### 2. 在目标仓库启动
21
+ ### 2. 在目标工作区启动
22
22
 
23
- 进入你希望 Codex 修改或检查的代码仓库:
23
+ 进入你希望 Codex 修改或检查的工作区:
24
24
 
25
25
  ```bash
26
- cd /path/to/your/repo
26
+ cd /path/to/your/workspace
27
27
  input-kanban
28
28
  ```
29
29
 
@@ -35,14 +35,16 @@ http://127.0.0.1:8787
35
35
 
36
36
  打开浏览器访问这个地址即可使用看板。
37
37
 
38
- ### 3. 指定目标仓库启动
38
+ ### 3. 指定目标工作区启动
39
39
 
40
- 如果不想先 `cd` 到目标仓库,也可以显式指定:
40
+ 如果不想先 `cd` 到目标工作区,也可以显式指定:
41
41
 
42
42
  ```bash
43
- input-kanban --repo /path/to/your/repo
43
+ input-kanban --workspace /path/to/your/workspace
44
44
  ```
45
45
 
46
+ `--repo` 仍可作为兼容别名使用。
47
+
46
48
  ## CLI 自动执行
47
49
 
48
50
  如果希望从终端直接提交任务并自动推进,可以使用 `submit`。任务内容支持两种输入方式:
@@ -52,7 +54,9 @@ input-kanban submit --task-file task.md --label "修复登录问题"
52
54
  input-kanban submit --task "修复登录问题,并补充回归测试" --label "修复登录问题"
53
55
  ```
54
56
 
55
- `submit` 默认会创建任务批次、发起拆分、自动派发所有批次,并在全部完成后自动发起最终验收。默认 repo 是当前目录;如果不传 `--label`,任务批次名称会从任务内容自动生成。它使用同一个 runs 目录,所以只要 8787 Web 看板也使用相同的 `--runs-dir`,CLI 创建的任务会在 Web 界面里可见。
57
+ `submit` 默认会创建任务批次、发起拆分、自动派发所有批次,并在全部完成后自动发起最终验收。默认 workspace 是当前目录;如果不传 `--label`,任务批次名称会从任务内容自动生成。它使用同一个 runs 目录,所以只要 8787 Web 看板也使用相同的 `--runs-dir`,CLI 创建的任务会在 Web 界面里可见。
58
+
59
+ `input-kanban serve` 会启动一个轻量后台 scheduler,持续刷新并推进未完成的 run:plan ready 后派发 batch、串行 batch 完成后启动下一批、全部 batch 完成后启动 final judge。CLI `submit --auto` / `input-kanban auto <runId>` 与 Web server 共用同一套 orchestrator 自动推进逻辑,因此任务推进不再依赖浏览器页面是否打开或刷新。
56
60
 
57
61
  如果希望提交后立即返回,让任务在后台自动执行,可以加 `-d` / `--detach`:
58
62
 
@@ -73,15 +77,21 @@ input-kanban submit --runs-dir ~/.input-kanban/runs --runner tmux -d
73
77
  查看和停止:
74
78
 
75
79
  ```bash
80
+ input-kanban runs
81
+ input-kanban --json runs --active
76
82
  input-kanban status
77
83
  input-kanban status --watch
78
84
  input-kanban status <runId> --watch
85
+ input-kanban --json status <runId>
79
86
  input-kanban result
80
87
  input-kanban result <runId> --copy
88
+ input-kanban --json result <runId>
89
+ input-kanban retry <runId> [taskId]
90
+ input-kanban --json retry <runId> [taskId]
81
91
  input-kanban stop <runId>
82
92
  ```
83
93
 
84
- 不传 `runId` 时,`status` 和 `result` 默认查看最近一次任务批次。`result --copy` 会复制最终验收结果;停止任务请显式传入 `runId`,避免误停。
94
+ `runs` 用来先列出可见任务批次,`runs --active` 只列出未进入终态或仍有子任务运行的批次,便于 agent 先发现 `runId`,再用 `status <runId>` 查详情。要只看某个工作区,可用 `input-kanban runs --workspace /path/to/workspace`;Web 左栏也提供了工作区筛选。不传 `runId` 时,`status` 和 `result` 默认查看最近一次任务批次。`result --copy` 会复制最终验收结果;`retry` 会保留失败现场并重试失败/未知任务;`--json` 适合给 agent/脚本做结构化读取;停止任务请显式传入 `runId`,避免误停。
85
95
 
86
96
  ## 常用启动参数
87
97
 
@@ -96,7 +106,7 @@ input-kanban --open
96
106
 
97
107
  默认值:
98
108
 
99
- - 目标仓库:启动 `input-kanban` 时的当前目录;创建批次时会校验它必须位于 Git work tree
109
+ - 工作区:启动 `input-kanban` 时的当前目录;创建批次时只要求它是一个存在的目录,若检测到 Git 会额外显示 Git 标识
100
110
  - host:`127.0.0.1`
101
111
  - port:`8787`
102
112
  - runs 目录:`~/.input-kanban/runs`
@@ -107,20 +117,20 @@ input-kanban --open
107
117
 
108
118
  tmux 模式仍由 Node.js 负责 batch barrier、`maxParallel`、final judge 顺序和 `judge_input.json` 生成。每个角色输出目录会写入 `run.sh` 和 `tmux.json`,状态继续由 `events.jsonl`、`stderr.log`、`last_message.md`、`exit_code` 和既有 artifact 文件驱动。tmux 角色命令完成后会先写入 `exit_code`,再保留 window,方便查看现场;需要关闭时由用户在 tmux 里手动退出。
109
119
 
110
- tmux 模式是可选能力,主要用于在终端里实时查看每个 Codex 角色的执行过程。`codex exec` 当前属于非交互模式,默认不会弹出人工 approval;如果创建任务时选择 `danger-full-access`,表示显式放开 worker sandbox 限制,应只在受控测试仓库中使用。
120
+ tmux 模式是可选能力,主要用于在终端里实时查看每个 Codex 角色的执行过程。`codex exec` 当前属于非交互模式,默认不会弹出人工 approval;如果创建任务时选择 `danger-full-access`,表示显式放开 worker sandbox 限制,应只在受控测试工作区中使用。
111
121
 
112
122
  看板会在 run 生成 tmux 元数据后显示 `复制tmux attach指令`。文件查看区域不再重复展示 tmux 终端信息;如需查看现场,请从批次详情顶部复制 attach 指令进入 tmux session。
113
123
 
114
124
  ## 在看板里如何使用
115
125
 
116
126
  1. 点击 `新建任务批次`。
117
- 2. 输入批次名称、目标仓库、Worker 沙箱和任务说明。
127
+ 2. 输入批次名称、工作区、Worker 沙箱和任务说明。
118
128
  3. 点击 `创建批次`。
119
129
  4. 看板会自动发起 `拆分任务`,让 Codex planner 生成 batches 和 workers。
120
- 5. 点击 `派发执行`,按 batch barrier 和并发限制运行 workers。
121
- 6. 查看执行日志、最终回复、错误日志和产物。
122
- 7. 所有 batch 完成后,点击 `汇总验收`。
123
- 8. 必要时可以停止或归档 run,也可以手动标记已确认完成的失败/未知 worker。
130
+ 5. 拆分完成后,Web 默认自动派发执行,按 batch barrier 和并发限制运行 workers。
131
+ 6. 所有 batch 完成后,Web 默认自动发起 `汇总验收`。
132
+ 7. 查看执行日志、最终回复、错误日志和产物。
133
+ 8. 必要时可以停止或归档 run,也可以手动点击按钮重试、推进,或手动标记已确认完成的失败/未知 worker。
124
134
 
125
135
  ## 它适合做什么
126
136
 
@@ -153,7 +163,7 @@ runs/<runId>/
153
163
  └── verdict.json
154
164
  ```
155
165
 
156
- 这些文件是本地运行记录,不需要提交到你的业务仓库。
166
+ 这些文件是本地运行记录,不需要提交到你的业务工作区。
157
167
 
158
168
  ## 使用前提
159
169
 
package/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Release Notes
2
2
 
3
+ ## v0.0.10
4
+
5
+ ### Highlights
6
+
7
+ - Adopt a workspace-first model: `workspace` / `--workspace` are now the primary identity for runs, while `repo` / `--repo` remain compatibility aliases.
8
+ - Allow non-Git workspace directories and show Git only as an optional capability marker when detected.
9
+ - Add workspace filtering to CLI/API/Web: `input-kanban runs --workspace <path>` and `/api/runs?workspace=<path>` filter runs by workspace.
10
+ - Add a server-side background scheduler for `input-kanban serve` so unfinished runs continue to advance without relying on an open browser tab.
11
+ - Share auto-advance logic between CLI `submit --auto` / `input-kanban auto <runId>` and the Web server scheduler through the orchestrator.
12
+ - Make `/api/runs` lightweight by reading run summaries without refreshing every historical run, improving cold-start list loading.
13
+ - Simplify the Web sidebar: workspace filtering is a compact dropdown, the redundant list refresh button is removed, list load timing is available via a small hover icon, and Git is shown as a simple marker.
14
+
15
+ ### Verification
16
+
17
+ - `npm run check` passed with 62 tests.
18
+ - `npm pack --dry-run` passed before publishing.
19
+
20
+ ## v0.0.9
21
+
22
+ ### Highlights
23
+
24
+ - Add MIT license and include it in the published npm package.
25
+ - Add agent-friendly `--json` output for discovery, status lookup, result reading, stop, submit, and auto commands.
26
+ - Add `runs` / `runs --active` to list visible and active run IDs before querying details.
27
+ - Add `retry <runId> [taskId]` with preserved failed attempts and a one-shot auto retry path for blocked batches.
28
+ - Add per-run `run_state.lock` protection around state writes to reduce CLI/Web/supervisor lost-update races.
29
+ - Keep Web auto mode enabled by default after planning: dispatch planned work and auto-start the final judge while the page is open.
30
+ - Keep CLI auto mode enabled by default for `submit`, with `--no-auto` as the create-and-plan-only escape hatch.
31
+ - Add `result --copy` for copying final judge output, and keep version display in both CLI and Web footer.
32
+
33
+ ### Verification
34
+
35
+ - `npm run check` passed with 58 tests.
36
+ - `npm pack --dry-run` included the MIT `LICENSE` file.
37
+
3
38
  ## v0.0.8
4
39
 
5
40
  ### Highlights
@@ -9,13 +44,15 @@
9
44
  - Add CLI `-d` / `--detach` to run the auto loop in a background supervisor, plus `--no-auto` for create-and-plan-only mode.
10
45
  - Add CLI `status [runId] [--watch]`, defaulting to the latest run when `runId` is omitted.
11
46
  - Add CLI `result [runId] [--copy]` to print or copy the final judge result.
47
+ - Add CLI `retry <runId> [taskId]` and automatic one-shot retry for blocked batches while preserving failed worker attempts.
48
+ - Add per-run `run_state.lock` protection around state writes to reduce CLI/Web/supervisor lost-update races.
12
49
  - Add CLI `stop <runId>` and make backend stop robust across CLI/Web processes by falling back to stored live PIDs.
13
50
  - Derive the run label from task text when `--label` / form label is omitted.
14
51
  - Add dashboard run-card archive confirmation without modal popups and replace the detail refresh text chips with a one-shot circle animation.
15
52
 
16
53
  ### Verification
17
54
 
18
- - `npm run check` passed with 51 tests.
55
+ - `npm run check` passed with 58 tests.
19
56
 
20
57
  ## v0.0.7
21
58