agent-steward 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/CHANGELOG.md +309 -2
  2. package/CROSS_PLATFORM.md +19 -0
  3. package/README.md +55 -8
  4. package/ROADMAP-STRATEGY.md +22 -19
  5. package/ROADMAP.md +230 -159
  6. package/dist/cli.d.ts +3 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +356 -0
  9. package/dist/core/analytics.d.ts +6 -0
  10. package/dist/core/analytics.d.ts.map +1 -1
  11. package/dist/core/analytics.js +20 -3
  12. package/dist/core/audit.d.ts +6 -0
  13. package/dist/core/audit.d.ts.map +1 -1
  14. package/dist/core/audit.js +24 -0
  15. package/dist/core/budget.d.ts +118 -0
  16. package/dist/core/budget.d.ts.map +1 -0
  17. package/dist/core/budget.js +206 -0
  18. package/dist/core/cron-to-schtasks.d.ts.map +1 -1
  19. package/dist/core/cron-to-schtasks.js +38 -0
  20. package/dist/core/dry-run.d.ts +26 -1
  21. package/dist/core/dry-run.d.ts.map +1 -1
  22. package/dist/core/dry-run.js +199 -8
  23. package/dist/core/execution.d.ts +203 -0
  24. package/dist/core/execution.d.ts.map +1 -0
  25. package/dist/core/execution.js +309 -0
  26. package/dist/core/feedback.d.ts +192 -0
  27. package/dist/core/feedback.d.ts.map +1 -0
  28. package/dist/core/feedback.js +426 -0
  29. package/dist/core/gate-integrity.d.ts +71 -0
  30. package/dist/core/gate-integrity.d.ts.map +1 -0
  31. package/dist/core/gate-integrity.js +275 -0
  32. package/dist/core/git-trigger.d.ts.map +1 -1
  33. package/dist/core/git-trigger.js +14 -2
  34. package/dist/core/guard-run.d.ts +4 -0
  35. package/dist/core/guard-run.d.ts.map +1 -0
  36. package/dist/core/guard-run.js +101 -0
  37. package/dist/core/guard.d.ts +52 -0
  38. package/dist/core/guard.d.ts.map +1 -0
  39. package/dist/core/guard.js +362 -0
  40. package/dist/core/local-ai.d.ts.map +1 -1
  41. package/dist/core/local-ai.js +7 -3
  42. package/dist/core/lock.d.ts +41 -0
  43. package/dist/core/lock.d.ts.map +1 -1
  44. package/dist/core/lock.js +141 -29
  45. package/dist/core/matrix.d.ts +8 -0
  46. package/dist/core/matrix.d.ts.map +1 -1
  47. package/dist/core/matrix.js +132 -17
  48. package/dist/core/mission.d.ts +103 -0
  49. package/dist/core/mission.d.ts.map +1 -0
  50. package/dist/core/mission.js +374 -0
  51. package/dist/core/opencode-models.d.ts +2 -2
  52. package/dist/core/opencode-models.d.ts.map +1 -1
  53. package/dist/core/opencode-models.js +28 -21
  54. package/dist/core/opencode-usage.d.ts +35 -0
  55. package/dist/core/opencode-usage.d.ts.map +1 -0
  56. package/dist/core/opencode-usage.js +132 -0
  57. package/dist/core/pipeline-apply.d.ts +38 -0
  58. package/dist/core/pipeline-apply.d.ts.map +1 -0
  59. package/dist/core/pipeline-apply.js +117 -0
  60. package/dist/core/pipeline-io.d.ts +13 -0
  61. package/dist/core/pipeline-io.d.ts.map +1 -0
  62. package/dist/core/pipeline-io.js +78 -0
  63. package/dist/core/pipeline-map.d.ts +52 -0
  64. package/dist/core/pipeline-map.d.ts.map +1 -0
  65. package/dist/core/pipeline-map.js +208 -0
  66. package/dist/core/pipeline-spec.d.ts +109 -0
  67. package/dist/core/pipeline-spec.d.ts.map +1 -0
  68. package/dist/core/pipeline-spec.js +554 -0
  69. package/dist/core/ps-wrapper.d.ts +27 -2
  70. package/dist/core/ps-wrapper.d.ts.map +1 -1
  71. package/dist/core/ps-wrapper.js +424 -65
  72. package/dist/core/record-history.d.ts.map +1 -1
  73. package/dist/core/record-history.js +206 -33
  74. package/dist/core/router/rules.d.ts.map +1 -1
  75. package/dist/core/router/rules.js +6 -0
  76. package/dist/core/run-mode.d.ts +12 -0
  77. package/dist/core/run-mode.d.ts.map +1 -0
  78. package/dist/core/run-mode.js +17 -0
  79. package/dist/core/scheduler/linux.d.ts +8 -1
  80. package/dist/core/scheduler/linux.d.ts.map +1 -1
  81. package/dist/core/scheduler/linux.js +34 -9
  82. package/dist/core/scheduler/logs.d.ts +4 -0
  83. package/dist/core/scheduler/logs.d.ts.map +1 -1
  84. package/dist/core/scheduler/logs.js +25 -1
  85. package/dist/core/scheduler/mac.d.ts +44 -2
  86. package/dist/core/scheduler/mac.d.ts.map +1 -1
  87. package/dist/core/scheduler/mac.js +126 -15
  88. package/dist/core/scheduler/windows.d.ts.map +1 -1
  89. package/dist/core/scheduler/windows.js +15 -12
  90. package/dist/core/secrets.d.ts.map +1 -1
  91. package/dist/core/secrets.js +18 -8
  92. package/dist/core/self-analysis.d.ts +32 -2
  93. package/dist/core/self-analysis.d.ts.map +1 -1
  94. package/dist/core/self-analysis.js +38 -27
  95. package/dist/core/shutdown.d.ts +33 -2
  96. package/dist/core/shutdown.d.ts.map +1 -1
  97. package/dist/core/shutdown.js +58 -2
  98. package/dist/core/structured-log.d.ts +37 -1
  99. package/dist/core/structured-log.d.ts.map +1 -1
  100. package/dist/core/structured-log.js +37 -0
  101. package/dist/core/usage-surface.d.ts +25 -0
  102. package/dist/core/usage-surface.d.ts.map +1 -0
  103. package/dist/core/usage-surface.js +41 -0
  104. package/dist/core/worktree-run.d.ts +4 -0
  105. package/dist/core/worktree-run.d.ts.map +1 -0
  106. package/dist/core/worktree-run.js +164 -0
  107. package/dist/core/worktree.d.ts +115 -0
  108. package/dist/core/worktree.d.ts.map +1 -0
  109. package/dist/core/worktree.js +462 -0
  110. package/dist/core/wrappers/bash.d.ts +19 -0
  111. package/dist/core/wrappers/bash.d.ts.map +1 -1
  112. package/dist/core/wrappers/bash.js +230 -27
  113. package/dist/db/capability-repo.d.ts +43 -2
  114. package/dist/db/capability-repo.d.ts.map +1 -1
  115. package/dist/db/capability-repo.js +96 -11
  116. package/dist/db/history-repo.d.ts +70 -5
  117. package/dist/db/history-repo.d.ts.map +1 -1
  118. package/dist/db/history-repo.js +170 -29
  119. package/dist/db/metrics-repo.d.ts +20 -2
  120. package/dist/db/metrics-repo.d.ts.map +1 -1
  121. package/dist/db/metrics-repo.js +35 -13
  122. package/dist/db/migrate.d.ts.map +1 -1
  123. package/dist/db/migrate.js +37 -17
  124. package/dist/db/recovery.d.ts +3 -1
  125. package/dist/db/recovery.d.ts.map +1 -1
  126. package/dist/db/recovery.js +11 -5
  127. package/dist/db/run-journal.d.ts +33 -5
  128. package/dist/db/run-journal.d.ts.map +1 -1
  129. package/dist/db/run-journal.js +78 -14
  130. package/dist/db/run-resume.d.ts +5 -0
  131. package/dist/db/run-resume.d.ts.map +1 -1
  132. package/dist/db/run-resume.js +9 -2
  133. package/dist/db/runs-repo.d.ts +19 -2
  134. package/dist/db/runs-repo.d.ts.map +1 -1
  135. package/dist/db/runs-repo.js +91 -60
  136. package/dist/db/schema.d.ts +2 -2
  137. package/dist/db/schema.d.ts.map +1 -1
  138. package/dist/db/schema.js +132 -2
  139. package/dist/db/templates-repo.d.ts +2 -2
  140. package/dist/db/templates-repo.d.ts.map +1 -1
  141. package/dist/db/templates-repo.js +5 -3
  142. package/dist/history.d.ts +7 -2
  143. package/dist/history.d.ts.map +1 -1
  144. package/dist/history.js +4 -2
  145. package/dist/hook-output.d.ts +2 -0
  146. package/dist/hook-output.d.ts.map +1 -0
  147. package/dist/hook-output.js +31 -0
  148. package/dist/i18n.d.ts +5 -0
  149. package/dist/i18n.d.ts.map +1 -1
  150. package/dist/i18n.js +11 -4
  151. package/dist/index.d.ts +375 -47
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +1344 -192
  154. package/dist/notifications.d.ts +53 -2
  155. package/dist/notifications.d.ts.map +1 -1
  156. package/dist/notifications.js +168 -21
  157. package/dist/profiles.d.ts.map +1 -1
  158. package/dist/profiles.js +82 -10
  159. package/dist/rpc.d.ts +354 -0
  160. package/dist/rpc.d.ts.map +1 -1
  161. package/dist/rpc.js +145 -0
  162. package/dist/server.d.ts +32 -2
  163. package/dist/server.d.ts.map +1 -1
  164. package/dist/server.js +154 -30
  165. package/dist/settings.d.ts +44 -2
  166. package/dist/settings.d.ts.map +1 -1
  167. package/dist/settings.js +85 -3
  168. package/dist/shared/jobs-view.d.ts +1 -1
  169. package/dist/shared/jobs-view.d.ts.map +1 -1
  170. package/dist/shared/jobs-view.js +2 -0
  171. package/dist/task-transfer.d.ts +21 -0
  172. package/dist/task-transfer.d.ts.map +1 -1
  173. package/dist/task-transfer.js +64 -3
  174. package/dist/templates.d.ts +2 -2
  175. package/dist/templates.d.ts.map +1 -1
  176. package/dist/templates.js +3 -3
  177. package/dist/types.d.ts +22 -2
  178. package/dist/types.d.ts.map +1 -1
  179. package/dist/workspaces.d.ts.map +1 -1
  180. package/dist/workspaces.js +34 -11
  181. package/docs/ARCHITECTURE.md +319 -66
  182. package/docs/COMPATIBILITY.md +2 -2
  183. package/docs/CONCEPT.md +18 -4
  184. package/docs/CROSS_PLATFORM.ru.md +20 -0
  185. package/docs/CROSS_PLATFORM.zh.md +18 -0
  186. package/docs/EXECUTION-LOOP.md +28 -10
  187. package/docs/FEATURES.md +129 -7
  188. package/docs/FEATURES.zh.md +97 -6
  189. package/docs/MIGRATION.md +2 -2
  190. package/docs/PIPELINE.md +293 -0
  191. package/docs/QA-A2-GUI-TUI.md +205 -0
  192. package/docs/README.ru.md +43 -4
  193. package/docs/README.zh.md +44 -4
  194. package/docs/SAFETY.md +23 -3
  195. package/gui-experimental.cjs +9 -8
  196. package/locales/en.json +58 -3
  197. package/locales/ru.json +58 -3
  198. package/locales/zh.json +58 -3
  199. package/opencode.pipeline.yaml +35 -0
  200. package/package.json +36 -4
  201. package/scripts/check-eslint-baseline.mjs +139 -0
  202. package/scripts/gen-test-plan-counters.mjs +117 -0
  203. package/scripts/github-ci-fetch.ps1 +37 -0
  204. package/scripts/pl-commit.ps1 +112 -0
  205. package/scripts/qa-a2-commit.ps1 +104 -0
  206. package/scripts/test-home.mjs +107 -0
  207. package/skills/scheduled-job-best-practices/SKILL.md +95 -1
  208. package/skills/scheduled-job-best-practices/references/recipes.md +139 -0
  209. package/src/cli.ts +417 -0
  210. package/src/core/analytics.ts +27 -4
  211. package/src/core/audit.ts +25 -0
  212. package/src/core/budget.ts +340 -0
  213. package/src/core/cron-to-schtasks.ts +42 -0
  214. package/src/core/dry-run.ts +235 -12
  215. package/src/core/execution.ts +538 -0
  216. package/src/core/feedback.ts +582 -0
  217. package/src/core/file-watcher.ts +2 -2
  218. package/src/core/gate-integrity.ts +330 -0
  219. package/src/core/git-trigger.ts +18 -5
  220. package/src/core/guard-run.ts +119 -0
  221. package/src/core/guard.ts +431 -0
  222. package/src/core/local-ai.ts +7 -3
  223. package/src/core/lock.ts +178 -37
  224. package/src/core/matrix.ts +158 -52
  225. package/src/core/mission.ts +531 -0
  226. package/src/core/native-notify.ts +1 -1
  227. package/src/core/opencode-models.ts +30 -21
  228. package/src/core/opencode-usage.ts +182 -0
  229. package/src/core/pipeline-apply.ts +158 -0
  230. package/src/core/pipeline-io.ts +96 -0
  231. package/src/core/pipeline-map.ts +283 -0
  232. package/src/core/pipeline-spec.ts +775 -0
  233. package/src/core/ps-wrapper.ts +435 -66
  234. package/src/core/record-history.ts +258 -81
  235. package/src/core/router/rules.ts +6 -0
  236. package/src/core/run-mode.ts +19 -0
  237. package/src/core/schedule-gate.ts +1 -1
  238. package/src/core/scheduler/at-fallback.ts +1 -1
  239. package/src/core/scheduler/linux.ts +40 -11
  240. package/src/core/scheduler/logs.ts +34 -3
  241. package/src/core/scheduler/mac.ts +174 -14
  242. package/src/core/scheduler/registry.ts +2 -2
  243. package/src/core/scheduler/windows.ts +19 -15
  244. package/src/core/secrets.ts +26 -19
  245. package/src/core/self-analysis.ts +75 -29
  246. package/src/core/shutdown.ts +90 -4
  247. package/src/core/structured-log.ts +89 -5
  248. package/src/core/telegram.ts +2 -2
  249. package/src/core/triage-worker.ts +7 -7
  250. package/src/core/triage.ts +2 -2
  251. package/src/core/usage-surface.ts +70 -0
  252. package/src/core/worktree-run.ts +199 -0
  253. package/src/core/worktree.ts +600 -0
  254. package/src/core/wrappers/bash.ts +248 -26
  255. package/src/db/capability-repo.ts +127 -10
  256. package/src/db/history-repo.ts +281 -40
  257. package/src/db/metrics-repo.ts +40 -13
  258. package/src/db/migrate.ts +57 -32
  259. package/src/db/recovery.ts +12 -5
  260. package/src/db/run-journal.ts +100 -13
  261. package/src/db/run-resume.ts +17 -1
  262. package/src/db/runs-repo.ts +147 -65
  263. package/src/db/schema.ts +134 -2
  264. package/src/db/templates-repo.ts +5 -3
  265. package/src/gui.tsx +438 -18
  266. package/src/history.ts +11 -4
  267. package/src/hook-output.ts +39 -0
  268. package/src/i18n.ts +12 -4
  269. package/src/index.ts +1902 -320
  270. package/src/notifications.ts +227 -47
  271. package/src/profiles.ts +88 -10
  272. package/src/rpc.ts +158 -0
  273. package/src/server.ts +201 -41
  274. package/src/settings.ts +125 -5
  275. package/src/shared/jobs-view.ts +3 -1
  276. package/src/task-transfer.ts +90 -6
  277. package/src/templates.ts +3 -3
  278. package/src/types.ts +23 -2
  279. package/src/workspaces.ts +37 -14
package/CROSS_PLATFORM.md CHANGED
@@ -54,6 +54,13 @@ The factory picks an implementation from `process.platform`:
54
54
  - Wrapper: `run-task.ps1` plus a per-task `run-<name>.cmd` in `%APPDATA%\opencode\agent-steward\wrapper`. The legacy `%APPDATA%\opencode\windows-scheduler` directory is migrated on first start.
55
55
  - Logs: `%APPDATA%\opencode\agent-steward\logs\<name>.log`.
56
56
  - cron is converted to schtasks (`convertCronToSchTasks`) — the same pattern set as before.
57
+ - The prompt is passed to `opencode run` after `--`, so a prompt beginning with `-`
58
+ cannot be mistaken for a flag. The wrapper rejects prompts longer than 30 000
59
+ characters before `CreateProcess` (32 767-char command-line limit).
60
+ - Timeout watchdog: the process tree is read with `Get-CimInstance`; if CIM fails or
61
+ returns nothing, the wrapper falls back to `Get-WmiObject`, then checks
62
+ `tasklist`/`Get-Process`. If no tree data is available it fails closed and runs
63
+ `taskkill /F /T /PID <root>`, so grandchildren are not left running.
57
64
 
58
65
  ### Linux
59
66
  - Tasks live in a managed `crontab` block:
@@ -70,19 +77,31 @@ The factory picks an implementation from `process.platform`:
70
77
  - Full cron syntax (unlike Windows), because crontab understands it natively.
71
78
  - One-shot (`once`): `at -t`; if `at` is not installed, the plugin falls back to a detached `sleep && command` process (`pid:<pid>` in the registry). The fallback does not survive a reboot — install the `at` package for durable one-shot runs.
72
79
  - Delete/rebuild touches only its own block; other `crontab` lines are left alone.
80
+ - An unclosed plugin block (begin marker without end) fails closed: the plugin reports an error and does not rewrite the crontab, so user lines after the marker are never lost.
73
81
 
74
82
  ### macOS
75
83
  - Tasks are LaunchAgent plists at `~/Library/LaunchAgents/com.opencode.scheduler.<name>.plist`.
76
84
  - Schedule: `StartInterval` for `* * * * *` and `*/N`, `StartCalendarInterval` for `M * * * *`,
77
85
  `M H * * *`, `M H * * D`.
78
86
  - Pause = `launchctl unload -w`, resume = `launchctl load -w`.
87
+ - Installing a paused task writes the plist but never calls `load -w` (it would
88
+ clear the pause); `unload -w` keeps the agent disabled after the next login.
89
+ - `launchctl load` failures are not swallowed: the install/resume error carries
90
+ the command, exit code and stderr (e.g. `Invalid property list` for a broken plist).
79
91
  - Wrapper is the same `.sh` as on Linux; config paths:
80
92
  `~/.config/opencode/agent-steward/` (or `$XDG_CONFIG_HOME`).
81
93
 
82
94
  ### Shared POSIX wrapper (`.sh`)
83
95
  - `cd` into the working directory, `opencode run` with the prompt read from a file.
96
+ The prompt follows `--`, so a leading `-` is not treated as an option.
97
+ - The argv backstop rejects `PROMPT_BYTES >= 131072`: Linux `MAX_ARG_STRLEN`
98
+ includes the trailing NUL, so at most 131 071 payload bytes fit.
84
99
  - Logs are appended with `>>` and prefixed with timestamps.
85
100
  - Locking via atomic `mkdir` — protects against parallel runs.
101
+ - Lock owner is written as `<pid>-<iso>` by Node/PS/bash; legacy `<iso>|<pid>` (PS)
102
+ and bare `<pid>` are still read, so a live lock is never evicted by another runtime.
103
+ - On startup the plugin reads the owner of both `<task>.lock` and `<task>.lock.d/pid`:
104
+ a lock directory is evicted only when its PID is dead or missing; age is a fallback.
86
105
  - Timeout: child process + watchdog (`TERM`, then `KILL`).
87
106
  - Quality Gate: `bash -lc "<command>"` (the `cmd.exe /c` equivalent on Windows).
88
107
  - Metrics: `node "<record-history.js>" <task> <status> <started> <duration> <error> "-" "-"` —
package/README.md CHANGED
@@ -49,14 +49,16 @@ Want to see it without installing OpenCode? `node scripts/demo-dashboard.mjs` st
49
49
  | Multi-repo | workspaces with path validation, per-workspace runs, matrix over one parent task |
50
50
  | Observability | SQLite history (success / error / timeout / partial / running), metrics (duration, tokens, cost), JSONL run logs with `/api/logs`, Prometheus `/metrics`, OTLP export, per-task logs, local web dashboard with 14-day analytics, history retention and CSV/JSON export |
51
51
  | Operations | dry-run preview, export/import JSON, templates, multi-channel notifications (webhook, Telegram, native OS toasts), quiet hours, digest, encrypted secrets (`${secret:NAME}`), audit log, settings |
52
- | Interfaces | OpenCode GUI panel, web dashboard, 26 agent tools, built-in agent skill |
52
+ | Interfaces | OpenCode GUI panel, web dashboard, 30 agent tools, built-in agent skill |
53
53
 
54
54
  ### Language
55
55
 
56
- The interface ships in Russian (default), English and Simplified Chinese. The language
57
- selector sits in the scheduler panel header (🌐 Auto / Русский / English / 中文) and is
58
- also available through the `manage_settings` tool (`action: "update"`, `locale: "zh"`).
59
- `locale: "auto"` (the "Auto" option) follows the OpenCode interface language: the panel
56
+ The interface ships in Russian, English and Simplified Chinese. By default the language
57
+ selector is set to **Auto** — like OpenCode, it follows the OpenCode interface language;
58
+ Russian, English and Chinese can be chosen explicitly. The selector sits in the scheduler
59
+ panel header (🌐 Auto / Русский / English / 中文) and is also available through the
60
+ `manage_settings` tool (`action: "update"`, `locale: "zh"`).
61
+ `locale: "auto"` (the "Auto" option, used by default) follows the OpenCode interface language: the panel
60
62
  reacts to language changes immediately, and the resolved locale is sent to the server so
61
63
  notifications, digests and the dashboard use the same language. The switch applies
62
64
  without a restart. Dashboard localization is still being rolled out: some client-side
@@ -123,7 +125,7 @@ npm run build && npm run build:gui
123
125
 
124
126
  ## Agent tools
125
127
 
126
- The agent gets the full feature set — 26 tools covering scheduling, pipelines, operations, observability and administration:
128
+ The agent gets the full feature set — 30 tools covering scheduling, pipelines, operations, observability and administration:
127
129
 
128
130
  | Tool | Arguments | What it does |
129
131
  |---|---|---|
@@ -135,7 +137,7 @@ The agent gets the full feature set — 26 tools covering scheduling, pipelines,
135
137
  | `pause_task` | `name` | Pauses a job (matrix parent pauses every clone) |
136
138
  | `resume_task` | `name` | Resumes a paused job |
137
139
  | `get_history` | `taskName?`, `status?`, `limit?` | Recent runs with duration, tokens, cost, model, quality gate and hooks |
138
- | `get_task_logs` | `name`, `lines?` | Tail of the run log |
140
+ | `get_task_logs` | `name` or `taskName`, `lines?` | Tail of the run log |
139
141
  | `dry_run` | `name?` | Simulates a pipeline (or every task): order, DAG, matrix fan-out, estimates |
140
142
  | `manage_workspaces` | `action`, `id?`, `name?`, `path?`, `color?` | Multi-repo workspaces: list, add, update, delete |
141
143
  | `matrix_control` | `action`, `name?` | Matrix results, cancel pending clones, clean up orphans, preview clones |
@@ -153,6 +155,10 @@ The agent gets the full feature set — 26 tools covering scheduling, pipelines,
153
155
  | `manage_secrets` | `action`, `name?`, `value?` | Create, list or delete AES-256-GCM encrypted secrets used in task `env` |
154
156
  | `get_audit_log` | `action?`, `target?`, `actor?`, `since?`, `until?`, `limit?` | Mutation audit journal: who changed what, when and via which interface |
155
157
  | `emit_event` | `eventName`, `payload?` | Start tasks subscribed to an MCP event |
158
+ | `pipeline_validate` | `path?`, `source?` | Validates `opencode.pipeline.yaml` without changing tasks |
159
+ | `pipeline_apply` | `path?`, `source?`, `dryRun?` | Idempotently creates or updates pipeline tasks; `dryRun` only reports the diff |
160
+ | `pipeline_export` | `pipeline` | Exports a pipeline's tasks back to YAML |
161
+ | `report_bug` | `description`, `taskName?`, `includeLogs?`, `includeAnalytics?`, `channel?` | Reports an agent-steward issue with diagnostics and optional reproduction context |
156
162
 
157
163
  `schedule_task` also accepts the full matrix configuration (`workspaceIds`, `strategy`, `failureMode`, `aggregation`, `concurrency`, `overrides`, `createAggregator`).
158
164
 
@@ -199,6 +205,41 @@ The plugin registers a built-in skill, `scheduled-job-best-practices`, so the ag
199
205
 
200
206
  Each workspace gets a clone named `<parent>-matrix-<workspace>`. The parent never runs itself: it aggregates clone results into `success`, `error` or `partial`. Clones stay in sync with the parent when you edit it; running clones are never touched.
201
207
 
208
+ ## Pipeline as code
209
+
210
+ Declare the whole workflow in one `opencode.pipeline.yaml` file instead of creating tasks one by one:
211
+
212
+ ```yaml
213
+ version: 1
214
+ name: nightly-release
215
+ defaults:
216
+ retryCount: 1
217
+ retryDelay: 120
218
+ steps:
219
+ - id: lint
220
+ schedule: "0 2 * * *"
221
+ prompt: Run the linter and fix what it reports.
222
+ qualityGate: npm run lint
223
+ - id: test
224
+ needs: [lint]
225
+ trigger: dag
226
+ prompt: Run the tests and fix failures.
227
+ qualityGate: npm test
228
+ ```
229
+
230
+ `needs` becomes a DAG dependency, a step with `trigger: dag` runs only after its dependencies succeed, and `defaults` are inherited by every step. Each step becomes a task named `<pipeline> <step>`.
231
+
232
+ ```bash
233
+ agent-steward pipeline validate opencode.pipeline.yaml
234
+ agent-steward pipeline apply opencode.pipeline.yaml --dry-run
235
+ agent-steward pipeline apply opencode.pipeline.yaml
236
+ agent-steward pipeline export --pipeline nightly-release --out opencode.pipeline.yaml
237
+ ```
238
+
239
+ Apply is idempotent: unchanged steps are skipped, edited steps are updated, and tasks outside the pipeline are never touched. Steps removed from the file are reported as stale, not deleted. The agent gets the same operations through `pipeline_validate`, `pipeline_apply` and `pipeline_export`.
240
+
241
+ See [docs/PIPELINE.md](docs/PIPELINE.md) for the full format, matrix fan-out, validation rules and limitations, and the ready-to-copy [example](opencode.pipeline.yaml).
242
+
202
243
  ## GUI and dashboard
203
244
 
204
245
  The OpenCode sidebar shows jobs, history, logs, dry-run, templates, import/export, concurrency limit and matrix grouping. The local web dashboard adds per-workspace summaries, matrix tabs, a pipeline view and metrics.
@@ -239,10 +280,15 @@ Tasks are **interactive only** by default: Task Scheduler starts them only while
239
280
  npm install
240
281
  npm run build # tsc
241
282
  npm run build:gui # vite
242
- npm test # 83 test suites, 600+ checks
283
+ npm test # 115 test suites, 600+ checks
243
284
  npm run test:en # same suites with the English locale
244
285
  ```
245
286
 
287
+ `npm run test:chaos` runs `test-chaos-dag.mjs` separately; `test-prod-install.mjs`
288
+ is likewise invoked through its own script. The **115** in `npm test` counts
289
+ exactly the suites listed in that script; every `test-*.mjs` file on disk is
290
+ reachable through at least one npm script.
291
+
246
292
  `npm run test:en` sets `OPENCODE_SCHEDULER_LOCALE=en` for every suite; the variable is a
247
293
  service hook, not a user setting.
248
294
 
@@ -255,6 +301,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
255
301
  - [docs/FEATURES.md](docs/FEATURES.md) — full feature catalog with examples.
256
302
  - [docs/FAQ.md](docs/FAQ.md) — recovery scenarios, webhook replay, operational answers.
257
303
  - [docs/MIGRATION.md](docs/MIGRATION.md) — moving from cron, systemd, launchd or Task Scheduler.
304
+ - [docs/PIPELINE.md](docs/PIPELINE.md) — pipeline-as-code: file format, CLI, idempotent apply.
258
305
  - [docs/SAVINGS.md](docs/SAVINGS.md) — how the "Saved $" estimate is calculated.
259
306
  - [CROSS_PLATFORM.md](CROSS_PLATFORM.md) — Windows / macOS / Linux differences and backends.
260
307
 
@@ -22,18 +22,21 @@ Scheduler, уведомления, аналитика — триггеры и о
22
22
 
23
23
  ---
24
24
 
25
- ## Текущая точка (agent-steward 0.0.2, milestone Д7)
25
+ ## Текущая точка (agent-steward 0.0.6, milestone Д7 + Durable DAG)
26
26
 
27
27
  - Опубликован в npm, CI зелёный на Windows / macOS / Linux
28
28
  - `plugin id` не меняется: `opencode-windows-scheduler` — имена SQLite/логов и ID действий TUI без изменений; каталог данных — `agent-steward` (legacy мигрирует автоматически)
29
29
  - Dual-support: один пакет работает с OpenCode V1 (≥ 1.18.29) и V2 (≥ 2.2.7)
30
- - 26 инструментов агента — паритет с RPC-поверхностью
30
+ - 30 инструментов агента — паритет с RPC-поверхностью
31
31
  - Локальный триаж + shadow mode, `manage_local_ai`, блок настроек в GUI — есть
32
32
  - Одноразовые запуски, непрерывность сессий, профили, webhooks, Telegram и нативные toast, тихие часы, Prometheus и OTLP — есть
33
33
  - Зашифрованные секреты (`${secret:NAME}`) и журнал аудита — есть
34
+ - Durable DAG (journal, resume, идемпотентность, DLQ, роутер 3 слоя, chaos-nightly, GUI) — выпущен (0.0.3–0.0.4)
34
35
  - Английский README и `docs/` — основные, русский синхронизирован в `docs/README.ru.md`
35
36
 
36
- **Чего ещё нет:** pipeline-as-code, Docker-runner, approvals, remote runners, capability-карта с LoRA-адаптерами, durable DAG.
37
+ **Выпущено в 0.0.5:** pipeline-as-code (`opencode.pipeline.yaml`: парсер, валидатор, CLI `validate|apply|export`, 3 инструмента, 51 тест) и worktree-изоляция с guard-условиями.
38
+
39
+ **Чего ещё нет в релизе:** Docker-runner, approvals, remote runners, capability-карта с LoRA-адаптерами.
37
40
 
38
41
  ---
39
42
 
@@ -51,7 +54,7 @@ Scheduler, уведомления, аналитика — триггеры и о
51
54
 
52
55
  Вынести интерфейс исполнителя агента за пределы OpenCode-specific кода. Позволить запускать задачи не только через OpenCode, но и через других агентов / MCP / стандартные API.
53
56
 
54
- Планируемые спринты: 32 (Pipeline-as-code), 36 (Durable DAG), 38 (Approvals, окружения, артефакты, 0.1.0).
57
+ Планируемые спринты: 38 (Approvals, окружения, артефакты, 0.1.0). Спринт 32 (Pipeline-as-code) и спринт 36 (Durable DAG) уже выполнены: выпущены в 0.0.5 / 0.0.3–0.0.4 (см. CHANGELOG).
55
58
 
56
59
  ### Этап 3: универсальный фреймворк оркестрации (долгосрочно, 0.2.x+)
57
60
 
@@ -81,33 +84,33 @@ Enforced `allowedTools` / `deniedTools` вместо advisory, scoped-инъек
81
84
 
82
85
  ## Горизонт 1–3 месяца: verifiable orchestration
83
86
 
84
- **Фактический порядок (18.11.2026):** Durable DAG (пункт 9, `0.0.3`–`0.0.4`) выпущен, следующим идёт Pipeline-as-code (`0.0.5`), затем остальные P2. Номер версии присваивается по факту релиза.
87
+ **Фактический порядок (19.11.2026):** Durable DAG (пункт 9, `0.0.3`–`0.0.4`) выпущен; Pipeline-as-code (пункт 5, `0.0.5`) и worktree-изоляция (пункт 6) выпущены в 0.0.5; следующими идут остальные P2.
85
88
 
86
89
  ### 4. Локальный помощник v2 (P2) — 1.5.5–1.5.6 ✅
87
90
 
88
91
  Дедуп уведомлений (правила + эмбеддинги), саммари логов в 3 строки, GUI-wizard настройки триажа, счётчик «сэкономлено $» с пометкой «оценка», асинхронный триаж, persistent-аудит решений. Закрыто срезами 31.1–31.13.
89
92
 
90
- ### 5. Pipeline-as-code (P2) — 0.0.5
93
+ ### 5. Pipeline-as-code (P2, 0.0.5 ✅)
91
94
 
92
- `opencode.pipeline.yaml` в репозитории + CLI `opencode pipeline validate\|run\|export`. DAG, матрицы и Quality Gates описываются файлом, который можно ревьюить в PR.
95
+ `opencode.pipeline.yaml` в репозитории + CLI `opencode pipeline validate\|apply\|export`. DAG, матрицы и Quality Gates описываются файлом, который можно ревьюить в PR. Парсер, валидатор, маппинг, идемпотентный apply, 3 инструмента и 51 тест (`test-pipeline.mjs`) выпущено в 0.0.5 (CHANGELOG: запись о Pipeline-as-code, PI-6/PI-7).
93
96
 
94
97
  Это водораздел между «планировщиком» и «оркестратором» (CONCEPT §3: фреймворк-супервизор, а не просто таймер).
95
98
 
96
- ### 6. Worktree-изоляция и guard-условия (P2) — 0.0.6
99
+ ### 6. Worktree-изоляция и guard-условия (P2, 0.0.5 ✅)
97
100
 
98
- Одноразовый `git worktree` на запуск, политика очистки, shell- и семантические guard-условия, статус `skipped`. 80% ценности безопасного fan-out без инфраструктуры Docker.
101
+ Одноразовый `git worktree` на запуск, политика очистки, shell- и семантические guard-условия, статус `skipped`. 80% ценности безопасного fan-out без инфраструктуры Docker. Выпущено в 0.0.5 (CHANGELOG W-1.1 … W-4.2).
99
102
 
100
- ### 7. Экономика v2 (P2) — 0.0.7
103
+ ### 7. Экономика v2 (P2)
101
104
 
102
- Бюджеты на день/неделю с авто-паузой и алертом, per-task token budgets, token efficiency score, прогноз, Grafana JSON, local vs cloud.
105
+ Бюджеты на день/неделю с авто-паузой и алертом, per-task token budgets, token efficiency score, прогноз, Grafana JSON, local vs cloud. Версия присваивается по факту релиза.
103
106
 
104
107
  ---
105
108
 
106
109
  ## Горизонт 3–6 месяцев: масштаб и надёжность
107
110
 
108
- ### 8. Docker runner (P3) — 0.0.8
111
+ ### 8. Docker runner (P3)
109
112
 
110
- Локальный процесс, Docker, SSH-хост. Задача описывает *что* делать, runner — *где*. Изоляцию не изобретаем: Docker / Landstrip. Opt-in, по умолчанию выключен.
113
+ Локальный процесс, Docker, SSH-хост. Задача описывает *что* делать, runner — *где*. Изоляцию не изобретаем: Docker / Landstrip. Opt-in, по умолчанию выключен. Версия присваивается по факту релиза.
111
114
 
112
115
  ### 9. Durable DAG (P1 для 0.1.0) — 0.0.3–0.0.4 ✅
113
116
 
@@ -154,15 +157,15 @@ Enforced `allowedTools` / `deniedTools` вместо advisory, scoped-инъек
154
157
 
155
158
  ## Метрики успеха
156
159
 
157
- | Метрика | Сейчас (0.0.2) | Через 2 мес | Через 6 мес |
160
+ | Метрика | Сейчас (0.0.6) | Через 2 мес | Через 6 мес |
158
161
  |---------|---------------|-------------|-------------|
159
- | npm latest | 0.0.2 | регулярные патчи | 0.1.x |
162
+ | npm latest | 0.0.6 | регулярные патчи | 0.1.x |
160
163
  | CI на 3 ОС | ✅ | ✅ | ✅ |
161
- | Покрытие RPC инструментами агента | 100% | 100% | 100% |
164
+ | Доступно агенту из RPC-поверхности | 30 / 57 (остальное GUI/CLI-only) | ≥30 / 57 | ≥30 / 57 |
162
165
  | Telegram / toast | ✅ | ✅ | ✅ |
163
166
  | Secrets / audit | ✅ | ✅ | ✅ |
164
167
  | Git-триггеры | ✅ | ✅ | ✅ |
165
- | Pipeline-as-code | ❌ | прототип | ✅ |
168
+ | Pipeline-as-code | ✅ (0.0.5) | ✅ | ✅ |
166
169
  | Docker runner | ❌ | ❌ | ✅ |
167
170
  | Загрузки npm / мес | первые | 300+ | 1500+ |
168
171
  | GitHub stars | единицы | 100+ | 500+ |
@@ -184,8 +187,8 @@ Enforced `allowedTools` / `deniedTools` вместо advisory, scoped-инъек
184
187
  ## Ближайшие две недели
185
188
 
186
189
  1. Durable DAG (0.0.3–0.0.4, закрыт) — 36.1–36.8 выполнены и выпущены: state-машина, resume, идемпотентность, DLQ, роутер.
187
- 2. Pipeline-as-code (0.0.5) — спецификация формата, парсер, CLI — следующий релиз.
188
- 3. Worktree-изоляция (0.0.6) и экономика v2 (0.0.7) — после Pipeline-as-code.
190
+ 2. Pipeline-as-code (0.0.5) — спецификация формата, парсер, CLI — выпущено.
191
+ 3. Worktree-изоляция (выпущена в 0.0.5) и экономика v2 (0.0.7) — после релиза Pipeline-as-code.
189
192
 
190
193
  **Критерий месяца:** пользователь ставит плагин одной командой, получает уведомление в Telegram о падении задачи, токены и доступы не лежат открытым текстом в `tasks.json`, а интерфейс говорит на его языке.
191
194