opencastle 1.3.0 → 1.4.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 +102 -131
- package/bin/cli.mjs +20 -10
- package/dist/cli/adapters/claude-code.d.ts +5 -3
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.js +7 -3
- package/dist/cli/adapters/claude-code.js.map +1 -1
- package/dist/cli/adapters/single-file-base.d.ts +18 -0
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +29 -4
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/agent-plugin.test.js +12 -0
- package/dist/cli/agent-plugin.test.js.map +1 -1
- package/dist/cli/agent-roster.test.js +0 -48
- package/dist/cli/agent-roster.test.js.map +1 -1
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +20 -0
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/boundary.test.js +9 -7
- package/dist/cli/boundary.test.js.map +1 -1
- package/dist/cli/ci.d.ts.map +1 -1
- package/dist/cli/ci.js +6 -4
- package/dist/cli/ci.js.map +1 -1
- package/dist/cli/command-namespace.test.js +33 -0
- package/dist/cli/command-namespace.test.js.map +1 -1
- package/dist/cli/convoy/artifacts.d.ts +9 -2
- package/dist/cli/convoy/artifacts.d.ts.map +1 -1
- package/dist/cli/convoy/artifacts.js +13 -10
- package/dist/cli/convoy/artifacts.js.map +1 -1
- package/dist/cli/convoy/artifacts.test.js +4 -2
- package/dist/cli/convoy/artifacts.test.js.map +1 -1
- package/dist/cli/convoy/engine.d.ts +53 -23
- package/dist/cli/convoy/engine.d.ts.map +1 -1
- package/dist/cli/convoy/engine.git.test.d.ts +2 -0
- package/dist/cli/convoy/engine.git.test.d.ts.map +1 -0
- package/dist/cli/convoy/engine.git.test.js +435 -0
- package/dist/cli/convoy/engine.git.test.js.map +1 -0
- package/dist/cli/convoy/engine.js +1746 -2305
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/engine.test.js +698 -678
- package/dist/cli/convoy/engine.test.js.map +1 -1
- package/dist/cli/convoy/event-schemas.d.ts +2 -0
- package/dist/cli/convoy/event-schemas.d.ts.map +1 -1
- package/dist/cli/convoy/event-schemas.js +59 -57
- package/dist/cli/convoy/event-schemas.js.map +1 -1
- package/dist/cli/convoy/events.d.ts +4 -1
- package/dist/cli/convoy/events.d.ts.map +1 -1
- package/dist/cli/convoy/events.js +69 -84
- package/dist/cli/convoy/events.js.map +1 -1
- package/dist/cli/convoy/events.test.js +50 -9
- package/dist/cli/convoy/events.test.js.map +1 -1
- package/dist/cli/convoy/gates.d.ts +9 -4
- package/dist/cli/convoy/gates.d.ts.map +1 -1
- package/dist/cli/convoy/gates.js +29 -14
- package/dist/cli/convoy/gates.js.map +1 -1
- package/dist/cli/convoy/isolation.d.ts +32 -6
- package/dist/cli/convoy/isolation.d.ts.map +1 -1
- package/dist/cli/convoy/isolation.js +72 -34
- package/dist/cli/convoy/isolation.js.map +1 -1
- package/dist/cli/convoy/isolation.test.js +66 -42
- package/dist/cli/convoy/isolation.test.js.map +1 -1
- package/dist/cli/convoy/lock.d.ts.map +1 -1
- package/dist/cli/convoy/lock.js +25 -10
- package/dist/cli/convoy/lock.js.map +1 -1
- package/dist/cli/convoy/lock.test.js +12 -0
- package/dist/cli/convoy/lock.test.js.map +1 -1
- package/dist/cli/convoy/merge.d.ts +21 -4
- package/dist/cli/convoy/merge.d.ts.map +1 -1
- package/dist/cli/convoy/merge.js +69 -53
- package/dist/cli/convoy/merge.js.map +1 -1
- package/dist/cli/convoy/merge.test.js +23 -1
- package/dist/cli/convoy/merge.test.js.map +1 -1
- package/dist/cli/convoy/progress.d.ts +35 -0
- package/dist/cli/convoy/progress.d.ts.map +1 -0
- package/dist/cli/convoy/progress.js +103 -0
- package/dist/cli/convoy/progress.js.map +1 -0
- package/dist/cli/convoy/progress.test.d.ts +2 -0
- package/dist/cli/convoy/progress.test.d.ts.map +1 -0
- package/dist/cli/convoy/progress.test.js +53 -0
- package/dist/cli/convoy/progress.test.js.map +1 -0
- package/dist/cli/convoy/read-model.d.ts +468 -0
- package/dist/cli/convoy/read-model.d.ts.map +1 -0
- package/dist/cli/convoy/read-model.js +1132 -0
- package/dist/cli/convoy/read-model.js.map +1 -0
- package/dist/cli/convoy/read-model.test.d.ts +2 -0
- package/dist/cli/convoy/read-model.test.d.ts.map +1 -0
- package/dist/cli/convoy/read-model.test.js +609 -0
- package/dist/cli/convoy/read-model.test.js.map +1 -0
- package/dist/cli/convoy/redact.d.ts +34 -0
- package/dist/cli/convoy/redact.d.ts.map +1 -0
- package/dist/cli/convoy/redact.js +66 -0
- package/dist/cli/convoy/redact.js.map +1 -0
- package/dist/cli/convoy/redact.test.d.ts +2 -0
- package/dist/cli/convoy/redact.test.d.ts.map +1 -0
- package/dist/cli/convoy/redact.test.js +43 -0
- package/dist/cli/convoy/redact.test.js.map +1 -0
- package/dist/cli/convoy/reviewer.d.ts +65 -0
- package/dist/cli/convoy/reviewer.d.ts.map +1 -0
- package/dist/cli/convoy/reviewer.js +141 -0
- package/dist/cli/convoy/reviewer.js.map +1 -0
- package/dist/cli/convoy/reviewer.test.d.ts +2 -0
- package/dist/cli/convoy/reviewer.test.d.ts.map +1 -0
- package/dist/cli/convoy/reviewer.test.js +96 -0
- package/dist/cli/convoy/reviewer.test.js.map +1 -0
- package/dist/cli/convoy/schedule.d.ts +30 -0
- package/dist/cli/convoy/schedule.d.ts.map +1 -0
- package/dist/cli/convoy/schedule.js +111 -0
- package/dist/cli/convoy/schedule.js.map +1 -0
- package/dist/cli/convoy/schedule.test.d.ts +2 -0
- package/dist/cli/convoy/schedule.test.d.ts.map +1 -0
- package/dist/cli/convoy/schedule.test.js +45 -0
- package/dist/cli/convoy/schedule.test.js.map +1 -0
- package/dist/cli/convoy/spec-builder.d.ts +120 -30
- package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
- package/dist/cli/convoy/spec-builder.js +438 -114
- package/dist/cli/convoy/spec-builder.js.map +1 -1
- package/dist/cli/convoy/spec-builder.test.js +419 -435
- package/dist/cli/convoy/spec-builder.test.js.map +1 -1
- package/dist/cli/convoy/spec-types.d.ts +46 -92
- package/dist/cli/convoy/spec-types.d.ts.map +1 -1
- package/dist/cli/convoy/store.d.ts +6 -1
- package/dist/cli/convoy/store.d.ts.map +1 -1
- package/dist/cli/convoy/store.js +111 -15
- package/dist/cli/convoy/store.js.map +1 -1
- package/dist/cli/convoy/store.test.js +59 -13
- package/dist/cli/convoy/store.test.js.map +1 -1
- package/dist/cli/convoy/types.d.ts +76 -113
- package/dist/cli/convoy/types.d.ts.map +1 -1
- package/dist/cli/convoy/types.js +6 -13
- package/dist/cli/convoy/types.js.map +1 -1
- package/dist/cli/convoy/worktree.d.ts +88 -3
- package/dist/cli/convoy/worktree.d.ts.map +1 -1
- package/dist/cli/convoy/worktree.js +282 -56
- package/dist/cli/convoy/worktree.js.map +1 -1
- package/dist/cli/convoy/worktree.test.js +132 -1
- package/dist/cli/convoy/worktree.test.js.map +1 -1
- package/dist/cli/convoy-args.test.js +9 -27
- package/dist/cli/convoy-args.test.js.map +1 -1
- package/dist/cli/convoy-cmd.d.ts +31 -6
- package/dist/cli/convoy-cmd.d.ts.map +1 -1
- package/dist/cli/convoy-cmd.js +150 -200
- package/dist/cli/convoy-cmd.js.map +1 -1
- package/dist/cli/convoy-cmd.test.d.ts +2 -0
- package/dist/cli/convoy-cmd.test.d.ts.map +1 -0
- package/dist/cli/convoy-cmd.test.js +144 -0
- package/dist/cli/convoy-cmd.test.js.map +1 -0
- package/dist/cli/dashboard.d.ts +24 -11
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +241 -303
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/dashboard.test.d.ts +2 -0
- package/dist/cli/dashboard.test.d.ts.map +1 -0
- package/dist/cli/dashboard.test.js +340 -0
- package/dist/cli/dashboard.test.js.map +1 -0
- package/dist/cli/dispatcher.test.js +41 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +36 -11
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +9 -6
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/init-own-files.test.d.ts +2 -0
- package/dist/cli/init-own-files.test.d.ts.map +1 -0
- package/dist/cli/init-own-files.test.js +133 -0
- package/dist/cli/init-own-files.test.js.map +1 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +106 -7
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/init.test.js +5 -4
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/layers.d.ts.map +1 -1
- package/dist/cli/layers.js +13 -4
- package/dist/cli/layers.js.map +1 -1
- package/dist/cli/lesson.d.ts.map +1 -1
- package/dist/cli/lesson.js +6 -5
- package/dist/cli/lesson.js.map +1 -1
- package/dist/cli/log.d.ts +39 -0
- package/dist/cli/log.d.ts.map +1 -1
- package/dist/cli/log.js +267 -93
- package/dist/cli/log.js.map +1 -1
- package/dist/cli/log.test.d.ts +2 -0
- package/dist/cli/log.test.d.ts.map +1 -0
- package/dist/cli/log.test.js +208 -0
- package/dist/cli/log.test.js.map +1 -0
- package/dist/cli/nearest.d.ts +18 -0
- package/dist/cli/nearest.d.ts.map +1 -0
- package/dist/cli/nearest.js +38 -0
- package/dist/cli/nearest.js.map +1 -0
- package/dist/cli/nearest.test.d.ts +2 -0
- package/dist/cli/nearest.test.d.ts.map +1 -0
- package/dist/cli/nearest.test.js +24 -0
- package/dist/cli/nearest.test.js.map +1 -0
- package/dist/cli/pipeline.d.ts +61 -0
- package/dist/cli/pipeline.d.ts.map +1 -1
- package/dist/cli/pipeline.flow.test.d.ts +2 -0
- package/dist/cli/pipeline.flow.test.d.ts.map +1 -0
- package/dist/cli/pipeline.flow.test.js +524 -0
- package/dist/cli/pipeline.flow.test.js.map +1 -0
- package/dist/cli/pipeline.js +471 -690
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/plan.d.ts +82 -31
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +167 -507
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/plan.test.d.ts +2 -0
- package/dist/cli/plan.test.d.ts.map +1 -0
- package/dist/cli/plan.test.js +158 -0
- package/dist/cli/plan.test.js.map +1 -0
- package/dist/cli/prompt.d.ts.map +1 -1
- package/dist/cli/prompt.js +9 -7
- package/dist/cli/prompt.js.map +1 -1
- package/dist/cli/prompt.test.js +20 -2
- package/dist/cli/prompt.test.js.map +1 -1
- package/dist/cli/remove.d.ts.map +1 -1
- package/dist/cli/remove.js +3 -1
- package/dist/cli/remove.js.map +1 -1
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +7 -1
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/run/adapters/agent-process.d.ts +82 -0
- package/dist/cli/run/adapters/agent-process.d.ts.map +1 -0
- package/dist/cli/run/adapters/agent-process.js +224 -0
- package/dist/cli/run/adapters/agent-process.js.map +1 -0
- package/dist/cli/run/adapters/agent-process.test.d.ts +2 -0
- package/dist/cli/run/adapters/agent-process.test.d.ts.map +1 -0
- package/dist/cli/run/adapters/agent-process.test.js +159 -0
- package/dist/cli/run/adapters/agent-process.test.js.map +1 -0
- package/dist/cli/run/adapters/claude.d.ts +53 -2
- package/dist/cli/run/adapters/claude.d.ts.map +1 -1
- package/dist/cli/run/adapters/claude.js +147 -171
- package/dist/cli/run/adapters/claude.js.map +1 -1
- package/dist/cli/run/adapters/claude.test.js +197 -254
- package/dist/cli/run/adapters/claude.test.js.map +1 -1
- package/dist/cli/run/adapters/codex.d.ts +25 -2
- package/dist/cli/run/adapters/codex.d.ts.map +1 -1
- package/dist/cli/run/adapters/codex.js +113 -81
- package/dist/cli/run/adapters/codex.js.map +1 -1
- package/dist/cli/run/adapters/codex.test.js +116 -95
- package/dist/cli/run/adapters/codex.test.js.map +1 -1
- package/dist/cli/run/adapters/copilot.d.ts +35 -1
- package/dist/cli/run/adapters/copilot.d.ts.map +1 -1
- package/dist/cli/run/adapters/copilot.js +104 -287
- package/dist/cli/run/adapters/copilot.js.map +1 -1
- package/dist/cli/run/adapters/copilot.test.js +122 -282
- package/dist/cli/run/adapters/copilot.test.js.map +1 -1
- package/dist/cli/run/adapters/cursor.d.ts +25 -7
- package/dist/cli/run/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/run/adapters/cursor.js +103 -156
- package/dist/cli/run/adapters/cursor.js.map +1 -1
- package/dist/cli/run/adapters/cursor.test.js +106 -218
- package/dist/cli/run/adapters/cursor.test.js.map +1 -1
- package/dist/cli/run/adapters/index.d.ts +34 -5
- package/dist/cli/run/adapters/index.d.ts.map +1 -1
- package/dist/cli/run/adapters/index.js +147 -21
- package/dist/cli/run/adapters/index.js.map +1 -1
- package/dist/cli/run/adapters/index.test.d.ts +2 -0
- package/dist/cli/run/adapters/index.test.d.ts.map +1 -0
- package/dist/cli/run/adapters/index.test.js +129 -0
- package/dist/cli/run/adapters/index.test.js.map +1 -0
- package/dist/cli/run/adapters/opencode.d.ts +25 -9
- package/dist/cli/run/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/run/adapters/opencode.js +136 -152
- package/dist/cli/run/adapters/opencode.js.map +1 -1
- package/dist/cli/run/adapters/opencode.test.js +99 -218
- package/dist/cli/run/adapters/opencode.test.js.map +1 -1
- package/dist/cli/run/adapters/permission-modes.d.ts +47 -4
- package/dist/cli/run/adapters/permission-modes.d.ts.map +1 -1
- package/dist/cli/run/adapters/permission-modes.js +113 -37
- package/dist/cli/run/adapters/permission-modes.js.map +1 -1
- package/dist/cli/run/adapters/permission-modes.test.js +55 -40
- package/dist/cli/run/adapters/permission-modes.test.js.map +1 -1
- package/dist/cli/run/adapters/stub-cli.test-helper.d.ts +22 -0
- package/dist/cli/run/adapters/stub-cli.test-helper.d.ts.map +1 -0
- package/dist/cli/run/adapters/stub-cli.test-helper.js +73 -0
- package/dist/cli/run/adapters/stub-cli.test-helper.js.map +1 -0
- package/dist/cli/run/platform.d.ts +52 -0
- package/dist/cli/run/platform.d.ts.map +1 -0
- package/dist/cli/run/platform.js +207 -0
- package/dist/cli/run/platform.js.map +1 -0
- package/dist/cli/run/platform.test.d.ts +2 -0
- package/dist/cli/run/platform.test.d.ts.map +1 -0
- package/dist/cli/run/platform.test.js +119 -0
- package/dist/cli/run/platform.test.js.map +1 -0
- package/dist/cli/run/schema.d.ts +6 -8
- package/dist/cli/run/schema.d.ts.map +1 -1
- package/dist/cli/run/schema.js +44 -68
- package/dist/cli/run/schema.js.map +1 -1
- package/dist/cli/run/schema.test.js +59 -279
- package/dist/cli/run/schema.test.js.map +1 -1
- package/dist/cli/run.d.ts +34 -56
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +379 -1132
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/run.test.d.ts +2 -0
- package/dist/cli/run.test.d.ts.map +1 -0
- package/dist/cli/run.test.js +318 -0
- package/dist/cli/run.test.js.map +1 -0
- package/dist/cli/sync-check.d.ts.map +1 -1
- package/dist/cli/sync-check.js +12 -3
- package/dist/cli/sync-check.js.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +3 -2
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/team-config.d.ts.map +1 -1
- package/dist/cli/team-config.js +2 -21
- package/dist/cli/team-config.js.map +1 -1
- package/dist/cli/tiers.test.js +4 -13
- package/dist/cli/tiers.test.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +4 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/website-plugins.test.js +51 -2
- package/dist/cli/website-plugins.test.js.map +1 -1
- package/dist/orchestrator/plugins/coolify/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/coolify/config.js +13 -0
- package/dist/orchestrator/plugins/coolify/config.js.map +1 -1
- package/dist/orchestrator/plugins/sentry/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/sentry/config.js +13 -0
- package/dist/orchestrator/plugins/sentry/config.js.map +1 -1
- package/package.json +3 -10
- package/src/cli/adapters/claude-code.ts +7 -3
- package/src/cli/adapters/single-file-base.ts +47 -4
- package/src/cli/agent-plugin.test.ts +14 -0
- package/src/cli/agent-roster.test.ts +0 -55
- package/src/cli/bootstrap.ts +23 -0
- package/src/cli/boundary.test.ts +9 -7
- package/src/cli/ci.ts +6 -4
- package/src/cli/command-namespace.test.ts +35 -0
- package/src/cli/convoy/TELEMETRY.md +138 -130
- package/src/cli/convoy/artifacts.test.ts +4 -2
- package/src/cli/convoy/artifacts.ts +13 -12
- package/src/cli/convoy/engine.git.test.ts +462 -0
- package/src/cli/convoy/engine.test.ts +817 -850
- package/src/cli/convoy/engine.ts +1864 -2596
- package/src/cli/convoy/event-schemas.ts +63 -59
- package/src/cli/convoy/events.test.ts +58 -9
- package/src/cli/convoy/events.ts +69 -91
- package/src/cli/convoy/gates.ts +31 -12
- package/src/cli/convoy/isolation.test.ts +76 -43
- package/src/cli/convoy/isolation.ts +100 -38
- package/src/cli/convoy/lock.test.ts +16 -0
- package/src/cli/convoy/lock.ts +25 -8
- package/src/cli/convoy/merge.test.ts +25 -1
- package/src/cli/convoy/merge.ts +74 -61
- package/src/cli/convoy/progress.test.ts +59 -0
- package/src/cli/convoy/progress.ts +121 -0
- package/src/cli/convoy/read-model.test.ts +685 -0
- package/src/cli/convoy/read-model.ts +1469 -0
- package/src/cli/convoy/redact.test.ts +49 -0
- package/src/cli/convoy/redact.ts +73 -0
- package/src/cli/convoy/reviewer.test.ts +112 -0
- package/src/cli/convoy/reviewer.ts +196 -0
- package/src/cli/convoy/schedule.test.ts +56 -0
- package/src/cli/convoy/schedule.ts +109 -0
- package/src/cli/convoy/spec-builder.test.ts +460 -464
- package/src/cli/convoy/spec-builder.ts +460 -129
- package/src/cli/convoy/spec-types.ts +46 -108
- package/src/cli/convoy/store.test.ts +64 -13
- package/src/cli/convoy/store.ts +143 -33
- package/src/cli/convoy/types.ts +59 -71
- package/src/cli/convoy/worktree.test.ts +140 -1
- package/src/cli/convoy/worktree.ts +311 -61
- package/src/cli/convoy-args.test.ts +10 -30
- package/src/cli/convoy-cmd.test.ts +163 -0
- package/src/cli/convoy-cmd.ts +173 -215
- package/src/cli/dashboard/dashboard.css +2086 -0
- package/src/cli/dashboard/dashboard.js +1687 -0
- package/src/cli/dashboard/index.html +307 -0
- package/src/cli/dashboard.test.ts +382 -0
- package/src/cli/dashboard.ts +243 -339
- package/src/cli/dispatcher.test.ts +43 -2
- package/src/cli/docs-accuracy.test.ts +37 -10
- package/src/cli/doctor.ts +9 -6
- package/src/cli/init-own-files.test.ts +156 -0
- package/src/cli/init.test.ts +5 -4
- package/src/cli/init.ts +104 -7
- package/src/cli/layers.ts +13 -4
- package/src/cli/lesson.ts +6 -5
- package/src/cli/log.test.ts +228 -0
- package/src/cli/log.ts +302 -83
- package/src/cli/nearest.test.ts +27 -0
- package/src/cli/nearest.ts +38 -0
- package/src/cli/pipeline.flow.test.ts +607 -0
- package/src/cli/pipeline.ts +544 -759
- package/src/cli/plan.test.ts +193 -0
- package/src/cli/plan.ts +209 -545
- package/src/cli/prompt.test.ts +21 -2
- package/src/cli/prompt.ts +11 -7
- package/src/cli/remove.ts +3 -0
- package/src/cli/review.ts +7 -1
- package/src/cli/run/adapters/agent-process.test.ts +175 -0
- package/src/cli/run/adapters/agent-process.ts +252 -0
- package/src/cli/run/adapters/claude.test.ts +205 -260
- package/src/cli/run/adapters/claude.ts +151 -162
- package/src/cli/run/adapters/codex.test.ts +120 -100
- package/src/cli/run/adapters/codex.ts +115 -91
- package/src/cli/run/adapters/copilot.test.ts +135 -306
- package/src/cli/run/adapters/copilot.ts +105 -274
- package/src/cli/run/adapters/cursor.test.ts +111 -220
- package/src/cli/run/adapters/cursor.ts +105 -156
- package/src/cli/run/adapters/index.test.ts +148 -0
- package/src/cli/run/adapters/index.ts +168 -20
- package/src/cli/run/adapters/opencode.test.ts +106 -227
- package/src/cli/run/adapters/opencode.ts +139 -151
- package/src/cli/run/adapters/permission-modes.test.ts +63 -41
- package/src/cli/run/adapters/permission-modes.ts +118 -37
- package/src/cli/run/adapters/stub-cli.test-helper.ts +88 -0
- package/src/cli/run/platform.test.ts +128 -0
- package/src/cli/run/platform.ts +213 -0
- package/src/cli/run/schema.test.ts +62 -344
- package/src/cli/run/schema.ts +48 -78
- package/src/cli/run.test.ts +351 -0
- package/src/cli/run.ts +366 -1151
- package/src/cli/sync-check.ts +12 -3
- package/src/cli/sync.ts +3 -2
- package/src/cli/team-config.ts +2 -21
- package/src/cli/tiers.test.ts +4 -17
- package/src/cli/update.ts +4 -3
- package/src/cli/website-plugins.test.ts +55 -5
- package/src/orchestrator/agents/team-lead.agent.md +2 -2
- package/src/orchestrator/customizations/README.md +58 -13
- package/src/orchestrator/customizations/logs/README.md +23 -18
- package/src/orchestrator/instructions/general.instructions.md +1 -1
- package/src/orchestrator/plugins/coolify/config.ts +13 -0
- package/src/orchestrator/plugins/sentry/config.ts +13 -0
- package/src/orchestrator/prompts/assess-complexity.prompt.md +43 -26
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +44 -49
- package/src/orchestrator/prompts/brainstorm.prompt.md +2 -2
- package/src/orchestrator/prompts/bug-fix.prompt.md +5 -4
- package/src/orchestrator/prompts/create-skill.prompt.md +29 -39
- package/src/orchestrator/prompts/fix-convoy.prompt.md +43 -29
- package/src/orchestrator/prompts/fix-prd.prompt.md +26 -22
- package/src/orchestrator/prompts/generate-convoy.prompt.md +139 -147
- package/src/orchestrator/prompts/generate-prd.prompt.md +75 -68
- package/src/orchestrator/prompts/implement-feature.prompt.md +7 -6
- package/src/orchestrator/prompts/validate-convoy.prompt.md +29 -28
- package/src/orchestrator/prompts/validate-prd.prompt.md +28 -21
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +3 -3
- package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
- package/src/orchestrator/skills/fast-review/SKILL.md +3 -1
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +7 -8
- package/dist/cli/convoy/dag-analysis.d.ts +0 -39
- package/dist/cli/convoy/dag-analysis.d.ts.map +0 -1
- package/dist/cli/convoy/dag-analysis.js +0 -279
- package/dist/cli/convoy/dag-analysis.js.map +0 -1
- package/dist/cli/convoy/dag-analysis.test.d.ts +0 -2
- package/dist/cli/convoy/dag-analysis.test.d.ts.map +0 -1
- package/dist/cli/convoy/dag-analysis.test.js +0 -289
- package/dist/cli/convoy/dag-analysis.test.js.map +0 -1
- package/dist/cli/convoy/formula.d.ts +0 -19
- package/dist/cli/convoy/formula.d.ts.map +0 -1
- package/dist/cli/convoy/formula.js +0 -142
- package/dist/cli/convoy/formula.js.map +0 -1
- package/dist/cli/convoy/formula.test.d.ts +0 -2
- package/dist/cli/convoy/formula.test.d.ts.map +0 -1
- package/dist/cli/convoy/formula.test.js +0 -342
- package/dist/cli/convoy/formula.test.js.map +0 -1
- package/dist/cli/convoy/health.d.ts +0 -34
- package/dist/cli/convoy/health.d.ts.map +0 -1
- package/dist/cli/convoy/health.js +0 -123
- package/dist/cli/convoy/health.js.map +0 -1
- package/dist/cli/convoy/health.test.d.ts +0 -2
- package/dist/cli/convoy/health.test.d.ts.map +0 -1
- package/dist/cli/convoy/health.test.js +0 -448
- package/dist/cli/convoy/health.test.js.map +0 -1
- package/dist/cli/convoy/last-run.d.ts +0 -53
- package/dist/cli/convoy/last-run.d.ts.map +0 -1
- package/dist/cli/convoy/last-run.js +0 -54
- package/dist/cli/convoy/last-run.js.map +0 -1
- package/dist/cli/convoy/last-run.test.d.ts +0 -2
- package/dist/cli/convoy/last-run.test.d.ts.map +0 -1
- package/dist/cli/convoy/last-run.test.js +0 -110
- package/dist/cli/convoy/last-run.test.js.map +0 -1
- package/dist/cli/convoy/pipeline.d.ts +0 -41
- package/dist/cli/convoy/pipeline.d.ts.map +0 -1
- package/dist/cli/convoy/pipeline.js +0 -414
- package/dist/cli/convoy/pipeline.js.map +0 -1
- package/dist/cli/convoy/pipeline.test.d.ts +0 -2
- package/dist/cli/convoy/pipeline.test.d.ts.map +0 -1
- package/dist/cli/convoy/pipeline.test.js +0 -837
- package/dist/cli/convoy/pipeline.test.js.map +0 -1
- package/dist/cli/convoy/review-stages.d.ts +0 -9
- package/dist/cli/convoy/review-stages.d.ts.map +0 -1
- package/dist/cli/convoy/review-stages.js +0 -134
- package/dist/cli/convoy/review-stages.js.map +0 -1
- package/dist/cli/convoy/review-stages.test.d.ts +0 -2
- package/dist/cli/convoy/review-stages.test.d.ts.map +0 -1
- package/dist/cli/convoy/review-stages.test.js +0 -197
- package/dist/cli/convoy/review-stages.test.js.map +0 -1
- package/dist/cli/run/executor.d.ts +0 -15
- package/dist/cli/run/executor.d.ts.map +0 -1
- package/dist/cli/run/executor.js +0 -249
- package/dist/cli/run/executor.js.map +0 -1
- package/dist/cli/run/executor.test.d.ts +0 -2
- package/dist/cli/run/executor.test.d.ts.map +0 -1
- package/dist/cli/run/executor.test.js +0 -297
- package/dist/cli/run/executor.test.js.map +0 -1
- package/dist/cli/run/reporter.d.ts +0 -10
- package/dist/cli/run/reporter.d.ts.map +0 -1
- package/dist/cli/run/reporter.js +0 -142
- package/dist/cli/run/reporter.js.map +0 -1
- package/dist/cli/run-dry-run.test.d.ts +0 -2
- package/dist/cli/run-dry-run.test.d.ts.map +0 -1
- package/dist/cli/run-dry-run.test.js +0 -83
- package/dist/cli/run-dry-run.test.js.map +0 -1
- package/dist/cli/run-executor-flags.test.d.ts +0 -2
- package/dist/cli/run-executor-flags.test.d.ts.map +0 -1
- package/dist/cli/run-executor-flags.test.js +0 -31
- package/dist/cli/run-executor-flags.test.js.map +0 -1
- package/dist/cli/run-finish.test.d.ts +0 -2
- package/dist/cli/run-finish.test.d.ts.map +0 -1
- package/dist/cli/run-finish.test.js +0 -77
- package/dist/cli/run-finish.test.js.map +0 -1
- package/dist/cli/watch.d.ts +0 -15
- package/dist/cli/watch.d.ts.map +0 -1
- package/dist/cli/watch.js +0 -277
- package/dist/cli/watch.js.map +0 -1
- package/dist/dashboard/scripts/etl.d.ts +0 -10
- package/dist/dashboard/scripts/etl.d.ts.map +0 -1
- package/dist/dashboard/scripts/etl.js +0 -141
- package/dist/dashboard/scripts/etl.js.map +0 -1
- package/src/cli/convoy/dag-analysis.test.ts +0 -349
- package/src/cli/convoy/dag-analysis.ts +0 -367
- package/src/cli/convoy/formula.test.ts +0 -404
- package/src/cli/convoy/formula.ts +0 -174
- package/src/cli/convoy/health.test.ts +0 -519
- package/src/cli/convoy/health.ts +0 -189
- package/src/cli/convoy/last-run.test.ts +0 -130
- package/src/cli/convoy/last-run.ts +0 -87
- package/src/cli/convoy/pipeline.test.ts +0 -999
- package/src/cli/convoy/pipeline.ts +0 -492
- package/src/cli/convoy/review-stages.test.ts +0 -235
- package/src/cli/convoy/review-stages.ts +0 -166
- package/src/cli/run/executor.test.ts +0 -338
- package/src/cli/run/executor.ts +0 -292
- package/src/cli/run/reporter.ts +0 -160
- package/src/cli/run-dry-run.test.ts +0 -97
- package/src/cli/run-executor-flags.test.ts +0 -38
- package/src/cli/run-finish.test.ts +0 -91
- package/src/cli/watch.ts +0 -295
- package/src/dashboard/astro.config.mjs +0 -6
- package/src/dashboard/dist/_astro/index.CADNhRPS.css +0 -1
- package/src/dashboard/dist/data/.gitkeep +0 -0
- package/src/dashboard/dist/data/convoy-list.json +0 -1
- package/src/dashboard/dist/data/overall-stats.json +0 -29
- package/src/dashboard/dist/index.html +0 -1963
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +0 -31
- package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js +0 -6776
- package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js +0 -3754
- package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js +0 -99
- package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js +0 -8
- package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/package.json +0 -3
- package/src/dashboard/package-lock.json +0 -6
- package/src/dashboard/public/data/.gitkeep +0 -0
- package/src/dashboard/public/data/convoy-list.json +0 -1
- package/src/dashboard/public/data/overall-stats.json +0 -29
- package/src/dashboard/public/icon-192.png +0 -0
- package/src/dashboard/scripts/etl.test.ts +0 -166
- package/src/dashboard/scripts/etl.ts +0 -170
- package/src/dashboard/scripts/generate-demo-db.test.ts +0 -30
- package/src/dashboard/scripts/generate-demo-db.ts +0 -529
- package/src/dashboard/scripts/integration-test.ts +0 -504
- package/src/dashboard/scripts/verify-demo-data.sh +0 -51
- package/src/dashboard/seed-data/delegations.ndjson +0 -35
- package/src/dashboard/seed-data/events.ndjson +0 -104
- package/src/dashboard/seed-data/panels.ndjson +0 -13
- package/src/dashboard/seed-data/reviews.ndjson +0 -6
- package/src/dashboard/seed-data/sessions.ndjson +0 -50
- package/src/dashboard/src/env.d.ts +0 -1
- package/src/dashboard/src/layouts/Layout.astro +0 -25
- package/src/dashboard/src/pages/index.astro +0 -2313
- package/src/dashboard/src/styles/dashboard.css +0 -2943
- package/src/dashboard/tsconfig.json +0 -6
- /package/src/{dashboard/dist → cli/dashboard}/icon-192.png +0 -0
package/src/cli/run/schema.ts
CHANGED
|
@@ -62,8 +62,9 @@ interface RawSpec {
|
|
|
62
62
|
gates?: string[]
|
|
63
63
|
gate_retries?: number
|
|
64
64
|
branch?: string
|
|
65
|
-
depends_on_convoy?:
|
|
65
|
+
depends_on_convoy?: unknown
|
|
66
66
|
guard?: unknown
|
|
67
|
+
watch?: unknown
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
interface RawTask {
|
|
@@ -80,6 +81,7 @@ interface RawTask {
|
|
|
80
81
|
built_in_gates?: unknown
|
|
81
82
|
browser_test?: unknown
|
|
82
83
|
review?: string
|
|
84
|
+
detect_drift?: unknown
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
/**
|
|
@@ -119,21 +121,35 @@ function validateBrowserTestConfig(value: unknown, prefix: string, errors: strin
|
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
|
|
122
|
-
/**
|
|
123
|
-
* Validate a parsed spec object.
|
|
124
|
-
*/
|
|
125
124
|
/**
|
|
126
125
|
* Keys an earlier build honoured and this one does not.
|
|
127
126
|
*
|
|
128
127
|
* Silently accepting them is worse than rejecting them: the spec looks valid, the
|
|
129
128
|
* run proceeds, and the behaviour the author asked for never happens. Rejecting
|
|
130
|
-
* them outright would break specs that are otherwise fine, so they warn
|
|
129
|
+
* them outright would break specs that are otherwise fine, so they warn, and the
|
|
130
|
+
* warning names the key and says why it does nothing.
|
|
131
131
|
*/
|
|
132
132
|
const RETIRED_DEFAULTS: Record<string, string> = {
|
|
133
133
|
compaction: 'context compaction was removed; the adapter manages its own context',
|
|
134
134
|
inject_lessons: 'lessons are read from .opencastle/LESSONS-LEARNED.md by the agent itself',
|
|
135
135
|
snippets: 'snippets were folded into skills',
|
|
136
|
+
detect_drift: 'drift detection was removed; reviews and gates check the work instead',
|
|
137
|
+
review_stages: 'the two-stage review was removed; `review` picks one fast review or a panel',
|
|
138
|
+
mcp_approve_all: 'agents use the MCP servers and approvals in the project\'s own config, which `opencastle sync` writes',
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Top-level and per-task keys retired the same way. */
|
|
142
|
+
const RETIRED_SPEC_KEYS: Record<string, string> = {
|
|
143
|
+
watch: 'watch mode was removed; run the spec again, or `opencastle convoy resume` to continue one',
|
|
136
144
|
}
|
|
145
|
+
const RETIRED_TASK_KEYS: Record<string, string> = {
|
|
146
|
+
detect_drift: 'drift detection was removed; reviews and gates check the work instead',
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** What a version 2 (chained) spec is told to do instead. */
|
|
150
|
+
const CHAIN_REPLACEMENT =
|
|
151
|
+
'put every task in one version 1 spec and let `depends_on` order them — tasks that do not ' +
|
|
152
|
+
'depend on each other run in parallel. `opencastle convoy "<task>"` plans large work that way.'
|
|
137
153
|
|
|
138
154
|
/**
|
|
139
155
|
* Every key under `defaults` that something reads.
|
|
@@ -153,11 +169,9 @@ const KNOWN_DEFAULTS = new Set([
|
|
|
153
169
|
'browser_test',
|
|
154
170
|
'built_in_gates',
|
|
155
171
|
'circuit_breaker',
|
|
156
|
-
'detect_drift',
|
|
157
172
|
'max_concurrent_reviews',
|
|
158
173
|
'max_retries',
|
|
159
174
|
'max_swarm_concurrency',
|
|
160
|
-
'mcp_approve_all',
|
|
161
175
|
'mcp_server_approval_timeout',
|
|
162
176
|
'mcp_servers',
|
|
163
177
|
'model',
|
|
@@ -167,7 +181,6 @@ const KNOWN_DEFAULTS = new Set([
|
|
|
167
181
|
'review',
|
|
168
182
|
'review_budget',
|
|
169
183
|
'review_heuristics',
|
|
170
|
-
'review_stages',
|
|
171
184
|
'reviewer_model',
|
|
172
185
|
'timeout',
|
|
173
186
|
...Object.keys(RETIRED_DEFAULTS),
|
|
@@ -192,6 +205,7 @@ const KNOWN_BUILT_IN_GATES = new Set([
|
|
|
192
205
|
'gate_timeout',
|
|
193
206
|
])
|
|
194
207
|
|
|
208
|
+
/** Validate a parsed spec object. */
|
|
195
209
|
export function validateSpec(spec: unknown): ValidationResult {
|
|
196
210
|
const errors: string[] = []
|
|
197
211
|
const warnings: string[] = []
|
|
@@ -233,21 +247,19 @@ export function validateSpec(spec: unknown): ValidationResult {
|
|
|
233
247
|
errors.push('`adapter` must be a string')
|
|
234
248
|
}
|
|
235
249
|
|
|
236
|
-
// version
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
250
|
+
// version. A spec without one is a convoy spec, version 1: there is one
|
|
251
|
+
// executor now. Version 2 chained whole specs one after another; the planner
|
|
252
|
+
// writes one spec in which independent work runs side by side instead.
|
|
253
|
+
if (s.version === 2 || s.depends_on_convoy !== undefined) {
|
|
254
|
+
errors.push(`A chain of convoy specs (\`version: 2\` with \`depends_on_convoy\`) is no longer supported: ${CHAIN_REPLACEMENT}`)
|
|
255
|
+
// The rest of a chain spec is a list of other specs, so nothing below applies.
|
|
256
|
+
return { valid: false, errors, warnings }
|
|
257
|
+
} else if (s.version !== undefined && s.version !== 1) {
|
|
258
|
+
errors.push('`version` must be 1, or left out')
|
|
241
259
|
}
|
|
242
260
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (
|
|
246
|
-
!Array.isArray(s.depends_on_convoy) ||
|
|
247
|
-
!(s.depends_on_convoy as unknown[]).every((c) => typeof c === 'string')
|
|
248
|
-
) {
|
|
249
|
-
errors.push('`depends_on_convoy` must be an array of strings')
|
|
250
|
-
}
|
|
261
|
+
for (const [key, why] of Object.entries(RETIRED_SPEC_KEYS)) {
|
|
262
|
+
if ((s as Record<string, unknown>)[key] !== undefined) warnings.push(`\`${key}\` is ignored — ${why}`)
|
|
251
263
|
}
|
|
252
264
|
|
|
253
265
|
// defaults
|
|
@@ -327,11 +339,6 @@ export function validateSpec(spec: unknown): ValidationResult {
|
|
|
327
339
|
}
|
|
328
340
|
}
|
|
329
341
|
|
|
330
|
-
// mcp_approve_all validation
|
|
331
|
-
if (d.mcp_approve_all !== undefined && typeof d.mcp_approve_all !== 'boolean') {
|
|
332
|
-
errors.push('`defaults.mcp_approve_all` must be a boolean')
|
|
333
|
-
}
|
|
334
|
-
|
|
335
342
|
// mcp_server_approval_timeout validation
|
|
336
343
|
if (d.mcp_server_approval_timeout !== undefined) {
|
|
337
344
|
const t = Number(d.mcp_server_approval_timeout)
|
|
@@ -385,11 +392,6 @@ export function validateSpec(spec: unknown): ValidationResult {
|
|
|
385
392
|
validateBrowserTestConfig(d.browser_test, 'defaults.browser_test', errors)
|
|
386
393
|
}
|
|
387
394
|
|
|
388
|
-
// review_stages validation (Phase 40 — two-stage review toggle)
|
|
389
|
-
if (d.review_stages !== undefined && typeof d.review_stages !== 'boolean') {
|
|
390
|
-
errors.push('`defaults.review_stages` must be a boolean')
|
|
391
|
-
}
|
|
392
|
-
|
|
393
395
|
// review validation
|
|
394
396
|
const VALID_REVIEW = ['auto', 'fast', 'panel', 'none']
|
|
395
397
|
if (d.review !== undefined && !VALID_REVIEW.includes(d.review as string)) {
|
|
@@ -526,28 +528,11 @@ export function validateSpec(spec: unknown): ValidationResult {
|
|
|
526
528
|
}
|
|
527
529
|
}
|
|
528
530
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
s.version === 2 &&
|
|
532
|
-
Array.isArray(s.depends_on_convoy) &&
|
|
533
|
-
(s.depends_on_convoy as unknown[]).length > 0
|
|
534
|
-
|
|
535
|
-
if (!isPipeline) {
|
|
536
|
-
if (!s.tasks || !Array.isArray(s.tasks) || s.tasks.length === 0) {
|
|
537
|
-
errors.push('`tasks` is required and must be a non-empty array')
|
|
538
|
-
return { valid: false, errors, warnings }
|
|
539
|
-
}
|
|
540
|
-
} else if (s.tasks !== undefined && (!Array.isArray(s.tasks) || s.tasks.length === 0)) {
|
|
541
|
-
// Pipeline spec may omit tasks entirely, but if present they must be non-empty
|
|
542
|
-
errors.push('`tasks`, when provided, must be a non-empty array')
|
|
531
|
+
if (!s.tasks || !Array.isArray(s.tasks) || s.tasks.length === 0) {
|
|
532
|
+
errors.push('`tasks` is required and must be a non-empty array')
|
|
543
533
|
return { valid: false, errors, warnings }
|
|
544
534
|
}
|
|
545
535
|
|
|
546
|
-
// Skip per-task validation when pipeline spec has no tasks
|
|
547
|
-
if (isPipeline && !s.tasks) {
|
|
548
|
-
return { valid: errors.length === 0, errors, warnings }
|
|
549
|
-
}
|
|
550
|
-
|
|
551
536
|
const taskIds = new Set<string>()
|
|
552
537
|
const tasks = s.tasks as RawTask[]
|
|
553
538
|
|
|
@@ -560,6 +545,10 @@ export function validateSpec(spec: unknown): ValidationResult {
|
|
|
560
545
|
continue
|
|
561
546
|
}
|
|
562
547
|
|
|
548
|
+
for (const [key, why] of Object.entries(RETIRED_TASK_KEYS)) {
|
|
549
|
+
if ((task as Record<string, unknown>)[key] !== undefined) warnings.push(`\`${prefix}.${key}\` is ignored — ${why}`)
|
|
550
|
+
}
|
|
551
|
+
|
|
563
552
|
// id
|
|
564
553
|
if (!task.id || typeof task.id !== 'string') {
|
|
565
554
|
errors.push(`${prefix}: \`id\` is required and must be a string`)
|
|
@@ -713,20 +702,23 @@ function detectCycles(tasks: Array<{ id: string; depends_on?: string[] }>): stri
|
|
|
713
702
|
|
|
714
703
|
/**
|
|
715
704
|
* Apply default values to a parsed spec.
|
|
705
|
+
*
|
|
706
|
+
* Every spec is a convoy spec, version 1, whether or not it says so; a spec
|
|
707
|
+
* without `version` used to go to a second, older executor that ignored
|
|
708
|
+
* `defaults` altogether. Concurrency left out is `auto`, which lets the engine
|
|
709
|
+
* pick (`defaults.max_swarm_concurrency`, else 4) rather than one at a time.
|
|
716
710
|
*/
|
|
717
711
|
export function applyDefaults(spec: Record<string, unknown>): TaskSpec {
|
|
718
712
|
const s = spec as Record<string, unknown>
|
|
719
|
-
s.
|
|
713
|
+
s.version = 1
|
|
714
|
+
s.concurrency = s.concurrency === 'auto' || s.concurrency === undefined ? 'auto' : Number(s.concurrency)
|
|
720
715
|
s.on_failure = (s.on_failure as string) || 'continue'
|
|
721
|
-
//
|
|
716
|
+
// Empty means "not chosen": the caller resolves the runtime with resolveAdapter.
|
|
722
717
|
s.adapter = (s.adapter as string) || ''
|
|
723
718
|
s.gate_retries = s.gate_retries !== undefined ? Number(s.gate_retries) : 0
|
|
724
719
|
|
|
725
720
|
const tasks = (s.tasks as Array<Record<string, unknown>> | undefined) ?? []
|
|
726
|
-
const d =
|
|
727
|
-
s.version === 1 && s.defaults
|
|
728
|
-
? (s.defaults as Record<string, unknown>)
|
|
729
|
-
: {}
|
|
721
|
+
const d = s.defaults && typeof s.defaults === 'object' ? (s.defaults as Record<string, unknown>) : {}
|
|
730
722
|
for (const task of tasks) {
|
|
731
723
|
task.agent =
|
|
732
724
|
(task.agent as string) || (d.agent as string | undefined) || 'developer'
|
|
@@ -759,28 +751,6 @@ export function applyDefaults(spec: Record<string, unknown>): TaskSpec {
|
|
|
759
751
|
return s as unknown as TaskSpec
|
|
760
752
|
}
|
|
761
753
|
|
|
762
|
-
/**
|
|
763
|
-
* Returns true if the spec uses the Convoy Engine enhanced format (version: 1 or 2).
|
|
764
|
-
*/
|
|
765
|
-
export function isConvoySpec(spec: unknown): boolean {
|
|
766
|
-
if (!spec || typeof spec !== 'object') return false
|
|
767
|
-
const v = (spec as Record<string, unknown>).version
|
|
768
|
-
return v === 1 || v === 2
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Returns true if the spec is a pipeline spec (version: 2 + non-empty depends_on_convoy).
|
|
773
|
-
*/
|
|
774
|
-
export function isPipelineSpec(spec: unknown): boolean {
|
|
775
|
-
if (!spec || typeof spec !== 'object') return false
|
|
776
|
-
const s = spec as Record<string, unknown>
|
|
777
|
-
return (
|
|
778
|
-
s.version === 2 &&
|
|
779
|
-
Array.isArray(s.depends_on_convoy) &&
|
|
780
|
-
(s.depends_on_convoy as unknown[]).length > 0
|
|
781
|
-
)
|
|
782
|
-
}
|
|
783
|
-
|
|
784
754
|
/**
|
|
785
755
|
* Parse, validate, and return a typed task spec from a YAML string.
|
|
786
756
|
* @throws If the text is empty, cannot be parsed, or spec is invalid
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `convoy run <spec>` and `convoy resume`, from the command line inwards.
|
|
3
|
+
*
|
|
4
|
+
* The engine has its own tests; these check what this file adds: how the
|
|
5
|
+
* arguments are read, that a dry run starts and records nothing, that resume
|
|
6
|
+
* picks the run it says it picks, and that a real run against a stub `claude`
|
|
7
|
+
* returns its exit code and leaves nothing behind to keep the process alive.
|
|
8
|
+
*/
|
|
9
|
+
import { execFileSync } from 'node:child_process'
|
|
10
|
+
import { chmodSync, existsSync, mkdirSync, mkdtempSync, realpathSync, rmSync, statSync, writeFileSync } from 'node:fs'
|
|
11
|
+
import { hostname, tmpdir } from 'node:os'
|
|
12
|
+
import { delimiter, join } from 'node:path'
|
|
13
|
+
import { DatabaseSync } from 'node:sqlite'
|
|
14
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
15
|
+
import { parseRunArgs, resumeLast, runSpec, type RunArgs } from './run.js'
|
|
16
|
+
import { createConvoyStore } from './convoy/store.js'
|
|
17
|
+
import { readRun } from './convoy/read-model.js'
|
|
18
|
+
import { _resetAllowlistCache, _setAllowlistConfigPath } from './convoy/gates.js'
|
|
19
|
+
|
|
20
|
+
const args = (over: Partial<RunArgs> = {}): RunArgs => ({
|
|
21
|
+
spec: null, dryRun: false, adapter: null, concurrency: null, verbose: false, help: false, ...over,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
describe('parseRunArgs', () => {
|
|
25
|
+
it('takes the spec as a positional argument', () => {
|
|
26
|
+
expect(parseRunArgs(['my.convoy.yml', '--dry-run'], 'run')).toEqual(args({ spec: 'my.convoy.yml', dryRun: true }))
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('still reads -f and --file, which every older spec header names', () => {
|
|
30
|
+
expect(parseRunArgs(['-f', 'a.yml'], 'run')).toMatchObject({ spec: 'a.yml' })
|
|
31
|
+
expect(parseRunArgs(['--file', 'a.yml'], 'run')).toMatchObject({ spec: 'a.yml' })
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('refuses two specs', () => {
|
|
35
|
+
expect(parseRunArgs(['a.yml', 'b.yml'], 'run')).toEqual({ error: 'Two specs given: a.yml and b.yml. Run one at a time.' })
|
|
36
|
+
expect(parseRunArgs(['a.yml', '-f', 'b.yml'], 'run')).toHaveProperty('error')
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('reads the common flags', () => {
|
|
40
|
+
expect(parseRunArgs(['s.yml', '-a', 'codex', '-c', '3', '--verbose'], 'run')).toEqual(
|
|
41
|
+
args({ spec: 's.yml', adapter: 'codex', concurrency: 3, verbose: true }),
|
|
42
|
+
)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('refuses a concurrency that is not a whole number from 1 to 50', () => {
|
|
46
|
+
for (const bad of ['0', '51', '2.5', 'many']) {
|
|
47
|
+
expect(parseRunArgs(['s.yml', '-c', bad], 'run'), bad).toHaveProperty('error')
|
|
48
|
+
}
|
|
49
|
+
expect(parseRunArgs(['s.yml', '--concurrency'], 'run')).toEqual({ error: '--concurrency needs a value' })
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('names the nearest flag for a misspelled one', () => {
|
|
53
|
+
expect(parseRunArgs(['s.yml', '--dryRun'], 'run')).toEqual({ error: 'Unknown option --dryRun. Did you mean --dry-run?' })
|
|
54
|
+
expect(parseRunArgs(['s.yml', '--verbos'], 'run')).toEqual({ error: 'Unknown option --verbos. Did you mean --verbose?' })
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('lists what it accepts when nothing is close', () => {
|
|
58
|
+
expect((parseRunArgs(['s.yml', '--json'], 'run') as { error: string }).error).toMatch(/It accepts --dry-run, --adapter/)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('says what replaced a removed flag', () => {
|
|
62
|
+
const removed: Array<[string, RegExp]> = [
|
|
63
|
+
['--resume', /opencastle convoy resume/],
|
|
64
|
+
['--retry-failed', /opencastle convoy resume/],
|
|
65
|
+
['--status', /opencastle convoy —/],
|
|
66
|
+
['--dlq-list', /opencastle convoy resume/],
|
|
67
|
+
['--formula', /Formulas are gone/],
|
|
68
|
+
['--watch', /Watch mode is gone/],
|
|
69
|
+
['--report-dir', /convoy\.db/],
|
|
70
|
+
['--permission-mode', /defaults\.permission_mode/],
|
|
71
|
+
]
|
|
72
|
+
for (const [flag, why] of removed) {
|
|
73
|
+
const parsed = parseRunArgs(['s.yml', flag], 'run') as { error: string }
|
|
74
|
+
expect(parsed.error, flag).toMatch(new RegExp(`^${flag} was removed\\.`))
|
|
75
|
+
expect(parsed.error, flag).toMatch(why)
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('gives resume no spec, and says so for a stray word', () => {
|
|
80
|
+
expect(parseRunArgs(['--dry-run'], 'resume')).toEqual(args({ dryRun: true }))
|
|
81
|
+
expect((parseRunArgs(['task-1'], 'resume') as { error: string }).error).toMatch(/takes no name/)
|
|
82
|
+
expect(parseRunArgs(['-f', 'a.yml'], 'resume')).toEqual({ error: '-f belongs to opencastle convoy run' })
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
// ── Against a project on disk ─────────────────────────────────────────────────
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* A stand-in for Claude Code. It prints the `--output-format json` result
|
|
90
|
+
* shape, writes the files a prompt asks for with `WRITE <path> <text>` lines,
|
|
91
|
+
* sleeps on `SLEEP <seconds>`, fails while the file named by `FAILIF <path>`
|
|
92
|
+
* exists, and passes any review it is asked for.
|
|
93
|
+
*/
|
|
94
|
+
const STUB_CLAUDE = `#!/bin/sh
|
|
95
|
+
input=$(cat)
|
|
96
|
+
case "$input" in
|
|
97
|
+
*"You are a code reviewer"*)
|
|
98
|
+
printf '%s' '{"type":"result","subtype":"success","is_error":false,"result":"Fine. <!-- REVIEW_VERDICT { \\"verdict\\": \\"pass\\", \\"issues\\": [] } -->","total_cost_usd":0.001,"usage":{"input_tokens":50,"output_tokens":5}}'
|
|
99
|
+
exit 0 ;;
|
|
100
|
+
esac
|
|
101
|
+
failif=$(printf '%s\\n' "$input" | sed -n 's/^ *FAILIF //p' | head -n 1)
|
|
102
|
+
if [ -n "$failif" ] && [ -e "$failif" ]; then
|
|
103
|
+
printf '%s' '{"type":"result","subtype":"error_during_execution","is_error":true,"errors":["stub failure"],"total_cost_usd":0.002}'
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
printf '%s\\n' "$input" | while read -r verb path rest; do
|
|
107
|
+
case "$verb" in
|
|
108
|
+
WRITE) mkdir -p "$(dirname "$path")"; printf '%s\\n' "$rest" > "$path" ;;
|
|
109
|
+
SLEEP) sleep "$path" ;;
|
|
110
|
+
esac
|
|
111
|
+
done
|
|
112
|
+
printf '%s' '{"type":"result","subtype":"success","is_error":false,"result":"Done.","total_cost_usd":0.01,"usage":{"input_tokens":100,"output_tokens":20},"modelUsage":{"claude-stub":{"inputTokens":100,"outputTokens":20,"costUSD":0.01}}}'
|
|
113
|
+
`
|
|
114
|
+
|
|
115
|
+
let root: string
|
|
116
|
+
let saved: { PATH?: string; HOME?: string; NO_COLOR?: string }
|
|
117
|
+
let out: string[]
|
|
118
|
+
|
|
119
|
+
function git(...a: string[]): string {
|
|
120
|
+
return execFileSync('git', a, { cwd: root, encoding: 'utf8' }).trim()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
beforeEach(() => {
|
|
124
|
+
root = realpathSync(mkdtempSync(join(tmpdir(), 'oc-run-')))
|
|
125
|
+
const bin = join(root, '.bin')
|
|
126
|
+
mkdirSync(bin)
|
|
127
|
+
writeFileSync(join(bin, 'claude'), STUB_CLAUDE)
|
|
128
|
+
chmodSync(join(bin, 'claude'), 0o755)
|
|
129
|
+
// Only the stub is reachable: a real agent CLI on this machine never is.
|
|
130
|
+
saved = { PATH: process.env.PATH, HOME: process.env.HOME, NO_COLOR: process.env.NO_COLOR }
|
|
131
|
+
process.env.PATH = [bin, '/usr/bin', '/bin'].join(delimiter)
|
|
132
|
+
process.env.HOME = root
|
|
133
|
+
process.env.NO_COLOR = '1'
|
|
134
|
+
vi.spyOn(process, 'cwd').mockReturnValue(root)
|
|
135
|
+
out = []
|
|
136
|
+
const capture = (...a: unknown[]): void => void out.push(a.join(' '))
|
|
137
|
+
vi.spyOn(console, 'log').mockImplementation(capture)
|
|
138
|
+
vi.spyOn(console, 'error').mockImplementation(capture)
|
|
139
|
+
vi.spyOn(console, 'warn').mockImplementation(capture)
|
|
140
|
+
vi.spyOn(process.stdout, 'write').mockImplementation(((chunk: string) => (out.push(String(chunk)), true)) as typeof process.stdout.write)
|
|
141
|
+
_setAllowlistConfigPath('/nonexistent/secret-scan-config.yml')
|
|
142
|
+
_resetAllowlistCache()
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
afterEach(() => {
|
|
146
|
+
vi.restoreAllMocks()
|
|
147
|
+
for (const [k, v] of Object.entries(saved)) {
|
|
148
|
+
if (v === undefined) delete process.env[k]
|
|
149
|
+
else process.env[k] = v
|
|
150
|
+
}
|
|
151
|
+
rmSync(root, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 })
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
const text = (): string => out.join('\n')
|
|
155
|
+
|
|
156
|
+
function writeSpec(name: string, body: string): string {
|
|
157
|
+
writeFileSync(join(root, name), body)
|
|
158
|
+
return name
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const TWO_TASKS = `name: Two files
|
|
162
|
+
tasks:
|
|
163
|
+
- id: one
|
|
164
|
+
files: [one.txt]
|
|
165
|
+
prompt: |
|
|
166
|
+
WRITE one.txt first
|
|
167
|
+
- id: two
|
|
168
|
+
depends_on: [one]
|
|
169
|
+
files: [two.txt]
|
|
170
|
+
prompt: |
|
|
171
|
+
WRITE two.txt second
|
|
172
|
+
`
|
|
173
|
+
|
|
174
|
+
describe('convoy run --dry-run', () => {
|
|
175
|
+
it('shows the plan and the runtime, and records nothing', async () => {
|
|
176
|
+
const spec = writeSpec('s.yml', TWO_TASKS)
|
|
177
|
+
expect(await runSpec(args({ spec, dryRun: true }))).toBe(0)
|
|
178
|
+
expect(text()).toMatch(/Convoy: Two files — 2 tasks, up to 4 at once/)
|
|
179
|
+
expect(text()).toMatch(/two\s+developer\s+one\s+two\.txt/)
|
|
180
|
+
expect(text()).toContain('Claude Code — found on PATH')
|
|
181
|
+
expect(text()).toContain('nothing started, nothing recorded')
|
|
182
|
+
expect(existsSync(join(root, '.opencastle'))).toBe(false)
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
it('refuses what a run would refuse: two tasks that could run together on one file', async () => {
|
|
186
|
+
const spec = writeSpec('s.yml', `name: Clash
|
|
187
|
+
tasks:
|
|
188
|
+
- id: a
|
|
189
|
+
files: [same.txt]
|
|
190
|
+
prompt: x
|
|
191
|
+
- id: b
|
|
192
|
+
files: [same.txt]
|
|
193
|
+
prompt: y
|
|
194
|
+
`)
|
|
195
|
+
expect(await runSpec(args({ spec, dryRun: true }))).toBe(1)
|
|
196
|
+
expect(text()).toMatch(/File partition conflicts/)
|
|
197
|
+
expect(existsSync(join(root, '.opencastle'))).toBe(false)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it('still shows the plan when no runtime is installed, then says why it would not run', async () => {
|
|
201
|
+
process.env.PATH = ['/usr/bin', '/bin'].join(delimiter)
|
|
202
|
+
const spec = writeSpec('s.yml', TWO_TASKS)
|
|
203
|
+
expect(await runSpec(args({ spec, dryRun: true }))).toBe(1)
|
|
204
|
+
expect(text()).toMatch(/Convoy: Two files/)
|
|
205
|
+
expect(text()).toMatch(/No agent CLI found on PATH/)
|
|
206
|
+
})
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
describe('convoy run', () => {
|
|
210
|
+
it('names a missing spec, and a chained one, without starting anything', async () => {
|
|
211
|
+
expect(await runSpec(args({ spec: 'nope.yml' }))).toBe(1)
|
|
212
|
+
expect(text()).toContain('Spec not found: nope.yml')
|
|
213
|
+
const chain = writeSpec('chain.yml', 'name: c\nversion: 2\ndepends_on_convoy: [a.yml]\n')
|
|
214
|
+
expect(await runSpec(args({ spec: chain }))).toBe(1)
|
|
215
|
+
expect(text()).toMatch(/no longer supported/)
|
|
216
|
+
expect(await runSpec(args())).toBe(1)
|
|
217
|
+
expect(text()).toContain('Name the spec to run')
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
it('runs to the end on a stub runtime, lands the work on a branch, and lets go', async () => {
|
|
221
|
+
git('init', '-q', '-b', 'main')
|
|
222
|
+
git('config', 'user.email', 't@t')
|
|
223
|
+
git('config', 'user.name', 't')
|
|
224
|
+
writeFileSync(join(root, '.gitignore'), '.opencastle/\n.bin/\n')
|
|
225
|
+
git('add', '-A')
|
|
226
|
+
git('commit', '-qm', 'init')
|
|
227
|
+
const spec = writeSpec('s.yml', TWO_TASKS)
|
|
228
|
+
const listeners = process.listenerCount('SIGINT')
|
|
229
|
+
|
|
230
|
+
expect(await runSpec(args({ spec }))).toBe(0)
|
|
231
|
+
|
|
232
|
+
// The engine's summary, once.
|
|
233
|
+
expect(text().match(/Convoy done/g)).toHaveLength(1)
|
|
234
|
+
const branch = git('branch', '--list', 'convoy/*').replace('*', '').trim()
|
|
235
|
+
expect(branch).toMatch(/^convoy\/two-files-/)
|
|
236
|
+
expect(git('show', `${branch}:one.txt`)).toBe('first')
|
|
237
|
+
expect(git('show', `${branch}:two.txt`)).toBe('second')
|
|
238
|
+
// The user's checkout is untouched.
|
|
239
|
+
expect(git('rev-parse', '--abbrev-ref', 'HEAD')).toBe('main')
|
|
240
|
+
expect(existsSync(join(root, 'one.txt'))).toBe(false)
|
|
241
|
+
// Nothing left listening for Ctrl+C once the run is over.
|
|
242
|
+
expect(process.listenerCount('SIGINT')).toBe(listeners)
|
|
243
|
+
}, 60_000)
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
// ── convoy resume ─────────────────────────────────────────────────────────────
|
|
247
|
+
|
|
248
|
+
describe('convoy run, then resume after a failure', () => {
|
|
249
|
+
it('re-runs the failed task and the one it skipped, on the same branch, and ends done', async () => {
|
|
250
|
+
git('init', '-q', '-b', 'main')
|
|
251
|
+
git('config', 'user.email', 't@t')
|
|
252
|
+
git('config', 'user.name', 't')
|
|
253
|
+
writeFileSync(join(root, '.gitignore'), '.opencastle/\n.bin/\nbroken\n')
|
|
254
|
+
git('add', '-A')
|
|
255
|
+
git('commit', '-qm', 'init')
|
|
256
|
+
const flag = join(root, 'broken')
|
|
257
|
+
writeFileSync(flag, '')
|
|
258
|
+
const spec = writeSpec('s.yml', `name: Fails once
|
|
259
|
+
tasks:
|
|
260
|
+
- id: one
|
|
261
|
+
files: [one.txt]
|
|
262
|
+
max_retries: 0
|
|
263
|
+
prompt: |
|
|
264
|
+
FAILIF ${flag}
|
|
265
|
+
WRITE one.txt first
|
|
266
|
+
- id: two
|
|
267
|
+
depends_on: [one]
|
|
268
|
+
files: [two.txt]
|
|
269
|
+
prompt: |
|
|
270
|
+
WRITE two.txt second
|
|
271
|
+
`)
|
|
272
|
+
expect(await runSpec(args({ spec }))).toBe(1)
|
|
273
|
+
expect(text()).toMatch(/Resume with: opencastle convoy resume/)
|
|
274
|
+
|
|
275
|
+
rmSync(flag)
|
|
276
|
+
out.length = 0
|
|
277
|
+
expect(await resumeLast(args())).toBe(0)
|
|
278
|
+
expect(text()).toContain('Resuming Fails once')
|
|
279
|
+
expect(text()).toMatch(/Convoy done/)
|
|
280
|
+
const branches = git('branch', '--list', 'convoy/*').split('\n').map((b) => b.replace('*', '').trim()).filter(Boolean)
|
|
281
|
+
expect(branches).toHaveLength(1)
|
|
282
|
+
expect(git('show', `${branches[0]}:one.txt`)).toBe('first')
|
|
283
|
+
expect(git('show', `${branches[0]}:two.txt`)).toBe('second')
|
|
284
|
+
}, 60_000)
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
function seedRuns(runs: Array<{ id: string; status: string; tasks: Array<[string, string]>; created: string }>): void {
|
|
288
|
+
mkdirSync(join(root, '.opencastle'), { recursive: true })
|
|
289
|
+
const store = createConvoyStore(join(root, '.opencastle', 'convoy.db'))
|
|
290
|
+
for (const run of runs) {
|
|
291
|
+
store.insertConvoy({ id: run.id, name: `Run ${run.id}`, spec_hash: 'h', status: 'pending', branch: null, created_at: run.created, spec_yaml: TWO_TASKS })
|
|
292
|
+
for (const [id, status] of run.tasks) {
|
|
293
|
+
store.insertTask({
|
|
294
|
+
id, convoy_id: run.id, phase: 0, prompt: 'p', agent: 'developer', adapter: null, model: null, timeout_ms: 1000,
|
|
295
|
+
status: 'pending', retries: 0, max_retries: 0, files: null, depends_on: null, gates: null,
|
|
296
|
+
})
|
|
297
|
+
if (status !== 'pending') store.updateTaskStatus(id, run.id, status as 'done')
|
|
298
|
+
}
|
|
299
|
+
store.updateConvoyStatus(run.id, run.status as 'done', {})
|
|
300
|
+
}
|
|
301
|
+
store.close()
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
describe('convoy resume', () => {
|
|
305
|
+
it('says there is nothing to resume when there are no runs', async () => {
|
|
306
|
+
expect(await resumeLast(args())).toBe(1)
|
|
307
|
+
expect(text()).toContain('No convoy runs in this project yet')
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
it('says so and exits 0 when every run is done', async () => {
|
|
311
|
+
seedRuns([{ id: 'a', status: 'done', tasks: [['one', 'done']], created: '2026-10-01T00:00:00Z' }])
|
|
312
|
+
expect(await resumeLast(args())).toBe(0)
|
|
313
|
+
expect(text()).toMatch(/Nothing to resume: the last run, Run a, finished/)
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
it('previews the newest run that is not done, listing what would run, and writes nothing', async () => {
|
|
317
|
+
seedRuns([
|
|
318
|
+
{ id: 'old', status: 'failed', tasks: [['one', 'done'], ['two', 'failed'], ['three', 'skipped']], created: '2026-10-01T00:00:00Z' },
|
|
319
|
+
{ id: 'new', status: 'done', tasks: [['one', 'done']], created: '2026-10-02T00:00:00Z' },
|
|
320
|
+
])
|
|
321
|
+
const db = join(root, '.opencastle', 'convoy.db')
|
|
322
|
+
const before = statSync(db).mtimeMs
|
|
323
|
+
expect(await resumeLast(args({ dryRun: true }))).toBe(0)
|
|
324
|
+
expect(text()).toContain('Resuming Run old')
|
|
325
|
+
expect(text()).toContain('The newest run, Run new, finished')
|
|
326
|
+
expect(text()).toMatch(/Would run 2 of 3 task\(s\)/)
|
|
327
|
+
expect(text()).toMatch(/two — developer \[failed\]/)
|
|
328
|
+
expect(text()).toMatch(/three — developer \[skipped\]/)
|
|
329
|
+
expect(text()).not.toMatch(/one — developer/)
|
|
330
|
+
// Nothing was reset: the preview only read.
|
|
331
|
+
expect(statSync(db).mtimeMs).toBe(before)
|
|
332
|
+
expect(readRun(root, 'old')!.tasks.map((t) => t.status)).toEqual(['done', 'failed', 'skipped'])
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
it('counts a run "done" with a task skipped as not done', async () => {
|
|
336
|
+
seedRuns([{ id: 'a', status: 'done', tasks: [['one', 'done'], ['two', 'skipped']], created: '2026-10-01T00:00:00Z' }])
|
|
337
|
+
expect(await resumeLast(args({ dryRun: true }))).toBe(0)
|
|
338
|
+
expect(text()).toMatch(/Would run 1 of 2/)
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
it('refuses a run another process is still working on', async () => {
|
|
342
|
+
seedRuns([{ id: 'live', status: 'running', tasks: [['one', 'running']], created: new Date().toISOString() }])
|
|
343
|
+
const db = new DatabaseSync(join(root, '.opencastle', 'convoy.db'))
|
|
344
|
+
db.exec('CREATE TABLE IF NOT EXISTS engine_lock (id INTEGER PRIMARY KEY, pid INTEGER, hostname TEXT, started_at TEXT, last_heartbeat TEXT)')
|
|
345
|
+
db.prepare('INSERT OR REPLACE INTO engine_lock VALUES (1, ?, ?, ?, ?)').run(process.pid, hostname(), '2026-01-01T00:00:00Z', new Date().toISOString())
|
|
346
|
+
db.close()
|
|
347
|
+
expect(await resumeLast(args())).toBe(1)
|
|
348
|
+
expect(text()).toMatch(/is still running in another process/)
|
|
349
|
+
expect(text()).toContain('opencastle convoy dashboard')
|
|
350
|
+
})
|
|
351
|
+
})
|