@oisincoveney/pipeline 3.24.2 → 4.0.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 +14 -2
- package/defaults/pipeline.yaml +23 -5
- package/defaults/profiles.yaml +104 -21
- package/dist/argo-graph.js +90 -88
- package/dist/argo-submit.d.ts +110 -138
- package/dist/argo-submit.js +363 -378
- package/dist/argo-workflow.d.ts +156 -177
- package/dist/argo-workflow.js +96 -138
- package/dist/backlog.js +5 -4
- package/dist/bench/eval-report.js +21 -12
- package/dist/claude-settings-config.js +23 -31
- package/dist/claude-user-config.js +6 -16
- package/dist/cli/bootstrap-commands.js +3 -3
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.js +176 -171
- package/dist/cli/factory-commands.js +13 -13
- package/dist/cli/format.js +92 -86
- package/dist/cli/loop-commands.js +21 -21
- package/dist/cli/mcp-gateway-commands.js +12 -12
- package/dist/cli/plan-commands.js +85 -116
- package/dist/cli/program.d.ts +3 -3
- package/dist/cli/program.js +41 -43
- package/dist/cli/run-command.d.ts +1 -1
- package/dist/cli/run-command.js +25 -25
- package/dist/cli/run-commands.js +31 -29
- package/dist/cli/run-resolver.d.ts +1 -1
- package/dist/cli/run-resolver.js +30 -32
- package/dist/cli/run-service.d.ts +2 -3
- package/dist/cli/run-service.js +229 -239
- package/dist/cli/submit-options.js +85 -83
- package/dist/cluster-doctor.js +147 -175
- package/dist/codex-config.js +24 -30
- package/dist/commands/bench-command.js +9 -7
- package/dist/commands/coordinator-command.js +35 -0
- package/dist/commands/pipeline-command.js +13 -7
- package/dist/commands/runner-command-command.js +39 -24
- package/dist/commands/runner-node-command.js +31 -0
- package/dist/commands/ticket/complete.js +29 -33
- package/dist/commands/ticket/create.js +84 -82
- package/dist/commands/ticket/graph-check.js +11 -11
- package/dist/commands/ticket/next.js +36 -36
- package/dist/commands/ticket/sequence.js +11 -12
- package/dist/commands/ticket/shared.d.ts +5 -2
- package/dist/commands/ticket/shared.js +63 -66
- package/dist/commands/ticket/start.js +58 -67
- package/dist/commands/ticket-command.js +2 -2
- package/dist/config/defaults.d.ts +139 -140
- package/dist/config/defaults.js +81 -80
- package/dist/config/lint.js +52 -64
- package/dist/config/load.d.ts +4 -5
- package/dist/config/load.js +64 -74
- package/dist/config/schema/catalog.d.ts +2 -1
- package/dist/config/schema/catalog.js +3 -2
- package/dist/config/schema/mcp.js +46 -52
- package/dist/config/schemas.d.ts +382 -528
- package/dist/config/schemas.js +400 -398
- package/dist/config/validate.d.ts +1 -2
- package/dist/config/validate.js +236 -201
- package/dist/config.d.ts +2 -2
- package/dist/context/repo-map.js +105 -119
- package/dist/coordinator/composition.js +169 -0
- package/dist/coordinator/config.js +71 -0
- package/dist/coordinator/run-owner.js +64 -0
- package/dist/coordinator/wave-advance.js +148 -0
- package/dist/coordinator/wave-scheduler.js +50 -0
- package/dist/credentials/broker.d.ts +6 -8
- package/dist/credentials/broker.js +17 -16
- package/dist/credentials/codex-config.js +15 -19
- package/dist/credentials/file-targets.js +9 -15
- package/dist/credentials/local-codex-auth-sync.js +55 -58
- package/dist/credentials/opencode-config.js +28 -32
- package/dist/credentials/runner.js +13 -13
- package/dist/effect-sync-errors.js +28 -0
- package/dist/factory/create-experiment.js +285 -121
- package/dist/factory/exec.js +10 -12
- package/dist/factory/git-credentials.js +4 -4
- package/dist/factory/stamp-answers.js +10 -11
- package/dist/factory/template-update.js +65 -44
- package/dist/factory-lane.d.ts +26 -40
- package/dist/factory-lane.js +26 -25
- package/dist/gates.js +3 -3
- package/dist/git-remote-url.js +17 -19
- package/dist/hooks.d.ts +26 -26
- package/dist/hooks.js +20 -22
- package/dist/index.d.ts +4 -3
- package/dist/index.js +27 -36
- package/dist/install-commands/claude-code.js +100 -92
- package/dist/install-commands/host-selection.js +3 -6
- package/dist/install-commands/opencode.js +264 -259
- package/dist/install-commands/planner.js +163 -181
- package/dist/install-commands/result-format.js +1 -3
- package/dist/install-commands/shared.js +25 -42
- package/dist/install-commands/writer.js +22 -25
- package/dist/install-commands.js +8 -8
- package/dist/jscpd-output.js +29 -0
- package/dist/json-config-merge.js +14 -20
- package/dist/json-line-values.js +17 -6
- package/dist/loop/argo-poll.d.ts +0 -1
- package/dist/loop/argo-poll.js +15 -95
- package/dist/loop/backlog-records.js +1 -3
- package/dist/loop/controller-deps.js +150 -161
- package/dist/loop/controller.js +164 -186
- package/dist/loop/gh-checks.js +62 -61
- package/dist/loop/gh-runner.js +22 -25
- package/dist/loop/loop-command.js +66 -58
- package/dist/loop/loop-controller-entrypoint.js +29 -30
- package/dist/loop/merge.js +36 -40
- package/dist/loop/run-terminal-poll.js +69 -0
- package/dist/mcp/gateway-config.js +25 -29
- package/dist/mcp/gateway-doctor.js +77 -119
- package/dist/mcp/gateway-reconcile.js +17 -22
- package/dist/mcp/gateway-runtime.js +1 -3
- package/dist/mcp/host-config.js +37 -40
- package/dist/mcp/host-renderers.js +10 -18
- package/dist/mcp/repo-local-backends.js +51 -54
- package/dist/mcp/toolhive-vmcp.js +39 -39
- package/dist/model-resolver.js +29 -33
- package/dist/moka-global-config.d.ts +78 -55
- package/dist/moka-global-config.js +93 -92
- package/dist/moka-submit.d.ts +2179 -866
- package/dist/moka-submit.js +97 -99
- package/dist/opencode-project-config.js +34 -40
- package/dist/package-assets.js +1 -3
- package/dist/path-refs.js +2 -2
- package/dist/pipeline-init.js +25 -25
- package/dist/pipeline-runtime.d.ts +15 -14
- package/dist/pipeline-runtime.js +51 -50
- package/dist/planned-node.js +6 -3
- package/dist/planning/compile.d.ts +5 -5
- package/dist/planning/compile.js +140 -139
- package/dist/planning/dependency-refs.js +5 -5
- package/dist/planning/generate.d.ts +1296 -1296
- package/dist/planning/generate.js +307 -314
- package/dist/planning/graph.d.ts +0 -1
- package/dist/planning/graph.js +131 -149
- package/dist/remote/argo/model.d.ts +104 -122
- package/dist/remote/argo/model.js +205 -197
- package/dist/remote/argo/policy.js +39 -47
- package/dist/remote/argo/storage.js +81 -85
- package/dist/remote/jobs/execution-identity.js +70 -0
- package/dist/remote/jobs/job-outcome.js +108 -0
- package/dist/remote/jobs/manifest.js +96 -0
- package/dist/remote/jobs/model.d.ts +158 -0
- package/dist/remote/jobs/model.js +162 -0
- package/dist/remote/jobs/node-bootstrap.js +213 -0
- package/dist/remote/jobs/policy.js +123 -0
- package/dist/remote/jobs/reconcile.js +100 -0
- package/dist/remote/jobs/run-spec-client.js +64 -0
- package/dist/remote/jobs/run-spec-path.js +31 -0
- package/dist/remote/jobs/run-spec-server.d.ts +34 -0
- package/dist/remote/jobs/run-spec-server.js +116 -0
- package/dist/remote/jobs/submit.d.ts +23 -0
- package/dist/remote/jobs/submit.js +116 -0
- package/dist/remote/jobs/watch.js +59 -0
- package/dist/remote/submit/argo-submission.d.ts +3 -1
- package/dist/remote/submit/argo-submission.js +53 -58
- package/dist/remote/submit/compilation.d.ts +2 -0
- package/dist/remote/submit/compilation.js +46 -49
- package/dist/remote/submit/event-boundary.js +62 -76
- package/dist/remote/submit/hook-events.d.ts +6 -0
- package/dist/remote/submit/io.d.ts +7 -1
- package/dist/remote/submit/io.js +40 -43
- package/dist/remote/submit/jobs-submission.d.ts +59 -0
- package/dist/remote/submit/jobs-submission.js +97 -0
- package/dist/remote/submit/jobs-submit-result.d.ts +25 -0
- package/dist/remote/submit/jobs-submit-result.js +34 -0
- package/dist/remote/submit/options.d.ts +49 -0
- package/dist/remote/submit/options.js +27 -0
- package/dist/remote/submit/service.d.ts +40 -1
- package/dist/remote/submit/service.js +67 -49
- package/dist/run-control/command-context.js +6 -8
- package/dist/run-control/commands.js +10 -10
- package/dist/run-control/contracts.d.ts +52 -101
- package/dist/run-control/contracts.js +83 -69
- package/dist/run-control/detach.js +66 -72
- package/dist/run-control/execution-store.js +0 -0
- package/dist/run-control/file-errors.js +1 -3
- package/dist/run-control/logical-segment.js +3 -3
- package/dist/run-control/next-node.js +67 -78
- package/dist/run-control/postgres/postgres-run-control-store.js +196 -225
- package/dist/run-control/resume-command.js +34 -41
- package/dist/run-control/run-artifacts-command.js +84 -105
- package/dist/run-control/run-command-domain.js +7 -11
- package/dist/run-control/run-control-store.js +9 -9
- package/dist/run-control/run-query-command.js +73 -100
- package/dist/run-control/run-record.js +5 -3
- package/dist/run-control/run-state-lock.js +5 -5
- package/dist/run-control/runtime-event-projection.js +38 -50
- package/dist/run-control/runtime-reporter.js +86 -102
- package/dist/run-control/stop-command.js +42 -53
- package/dist/run-control/store-fs-effects.js +3 -1
- package/dist/run-control/store-manifest.js +38 -13
- package/dist/run-control/store-paths.js +3 -3
- package/dist/run-control/store.js +1 -1
- package/dist/run-control/submit-result.js +21 -21
- package/dist/run-control/supervisor.js +78 -68
- package/dist/run-control/workspace.js +2 -2
- package/dist/run-state/git-refs.js +258 -307
- package/dist/runner/opencode-excludes.js +4 -4
- package/dist/runner/subprocess-result.js +28 -37
- package/dist/runner/subprocess.js +41 -41
- package/dist/runner/timeouts.js +14 -13
- package/dist/runner-command/dynamic-command.js +46 -39
- package/dist/runner-command/environment-commands.js +91 -0
- package/dist/runner-command/finalize.js +174 -153
- package/dist/runner-command/lifecycle-context.js +115 -130
- package/dist/runner-command/lifecycle.js +78 -72
- package/dist/runner-command/pre-schedule.js +203 -223
- package/dist/runner-command/run.js +450 -448
- package/dist/runner-command/schedule-source-options.js +8 -10
- package/dist/runner-command/select-ready-wave.js +39 -30
- package/dist/runner-command/task-descriptor.js +11 -17
- package/dist/runner-command-contract.d.ts +147 -157
- package/dist/runner-command-contract.js +403 -411
- package/dist/runner-event-schema.d.ts +364 -505
- package/dist/runner-event-schema.js +187 -175
- package/dist/runner-event-sink.js +37 -43
- package/dist/runner-output.js +6 -6
- package/dist/runner.d.ts +57 -37
- package/dist/runner.js +176 -127
- package/dist/runtime/actor-ids.d.ts +1 -0
- package/dist/runtime/actor-ids.js +2 -2
- package/dist/runtime/agent-node/agent-node.js +99 -110
- package/dist/runtime/agent-node/handoff-finalization.js +23 -24
- package/dist/runtime/agent-node/model-selection.js +19 -22
- package/dist/runtime/agent-node/output-finalization.js +174 -204
- package/dist/runtime/agent-node/prompt-rendering.js +208 -251
- package/dist/runtime/agent-node/session-execution.js +43 -39
- package/dist/runtime/builtins/builtins.js +218 -284
- package/dist/runtime/changed-files/changed-files.js +29 -34
- package/dist/runtime/command-executor/command-executor.js +31 -23
- package/dist/runtime/config-error.js +1 -3
- package/dist/runtime/context/context.js +35 -37
- package/dist/runtime/contracts/contracts.d.ts +3 -0
- package/dist/runtime/contracts/index.d.ts +1 -1
- package/dist/runtime/detached-race.js +11 -14
- package/dist/runtime/drain-merge/drain-merge.js +139 -164
- package/dist/runtime/durable-store/acquisition.js +5 -3
- package/dist/runtime/durable-store/durable-store.d.ts +3 -1
- package/dist/runtime/durable-store/postgres/client.js +29 -0
- package/dist/runtime/durable-store/postgres/migrate-substrate.js +34 -29
- package/dist/runtime/durable-store/postgres/postgres-store.js +18 -20
- package/dist/runtime/events/events.js +273 -331
- package/dist/runtime/events/index.js +2 -2
- package/dist/runtime/execution-envelope.js +44 -0
- package/dist/runtime/gates/adjudication/llm-judge.js +21 -24
- package/dist/runtime/gates/adjudication/structured-claim.js +15 -16
- package/dist/runtime/gates/adjudicator/adjudicator.js +27 -27
- package/dist/runtime/gates/adjudicator/index.js +2 -2
- package/dist/runtime/gates/contract.js +5 -9
- package/dist/runtime/gates/gates.js +9 -8
- package/dist/runtime/gates/kinds/acceptance/acceptance.js +68 -71
- package/dist/runtime/gates/kinds/acceptance/index.js +2 -2
- package/dist/runtime/gates/kinds/artifact/artifact.js +4 -4
- package/dist/runtime/gates/kinds/artifact/index.js +2 -2
- package/dist/runtime/gates/kinds/builtin/builtin.js +4 -4
- package/dist/runtime/gates/kinds/builtin/index.js +2 -2
- package/dist/runtime/gates/kinds/changed-files/changed-files.js +31 -35
- package/dist/runtime/gates/kinds/changed-files/index.js +2 -2
- package/dist/runtime/gates/kinds/command/command.js +3 -3
- package/dist/runtime/gates/kinds/command/index.js +2 -2
- package/dist/runtime/gates/kinds/json-schema/index.js +2 -2
- package/dist/runtime/gates/kinds/json-schema/json-schema.js +7 -6
- package/dist/runtime/gates/kinds/verdict/index.js +2 -2
- package/dist/runtime/gates/kinds/verdict/verdict.js +3 -3
- package/dist/runtime/gates/orchestrator.js +72 -86
- package/dist/runtime/gates/registry.js +1 -3
- package/dist/runtime/handoff.d.ts +2 -1
- package/dist/runtime/handoff.js +43 -46
- package/dist/runtime/hooks/command-hook.js +57 -71
- package/dist/runtime/hooks/context.js +21 -25
- package/dist/runtime/hooks/events.js +84 -100
- package/dist/runtime/hooks/execution.js +6 -12
- package/dist/runtime/hooks/hooks.js +34 -23
- package/dist/runtime/hooks/invocation.js +23 -29
- package/dist/runtime/hooks/module-hook.js +36 -35
- package/dist/runtime/hooks/policy.js +32 -29
- package/dist/runtime/hooks/results.js +56 -66
- package/dist/runtime/journal-acquisition.d.ts +3 -2
- package/dist/runtime/journal-acquisition.js +14 -14
- package/dist/runtime/json-validation/json-validation.js +51 -72
- package/dist/runtime/launch-plan-args.js +39 -0
- package/dist/runtime/local-scheduler.js +46 -48
- package/dist/runtime/node-execution.js +376 -445
- package/dist/runtime/node-protocol/node-protocol.js +36 -79
- package/dist/runtime/node-state-store.d.ts +4 -1
- package/dist/runtime/node-state-store.js +13 -57
- package/dist/runtime/node-state-tracker.js +46 -54
- package/dist/runtime/open-pull-request/open-pull-request.js +201 -187
- package/dist/runtime/opencode-adapter.js +23 -24
- package/dist/runtime/opencode-agent-name.js +6 -6
- package/dist/runtime/opencode-runtime.js +115 -93
- package/dist/runtime/opencode-server.js +39 -53
- package/dist/runtime/opencode-session-executor.js +312 -344
- package/dist/runtime/parallel-node/parallel-node.js +123 -134
- package/dist/runtime/parallel-worktrees/parallel-worktrees.js +90 -73
- package/dist/runtime/protected-paths/protected-paths.js +70 -71
- package/dist/runtime/remediation/remediation.js +202 -231
- package/dist/runtime/retry.js +8 -10
- package/dist/runtime/run-journal.d.ts +2 -0
- package/dist/runtime/run-journal.js +7 -7
- package/dist/runtime/runtime-results.js +54 -69
- package/dist/runtime/scheduled-dependencies.d.ts +2 -1
- package/dist/runtime/scheduled-dependencies.js +61 -75
- package/dist/runtime/scheduler.js +179 -202
- package/dist/runtime/services/agent-node-runtime-service.js +3 -3
- package/dist/runtime/services/backlog-service.d.ts +1 -2
- package/dist/runtime/services/backlog-service.js +8 -14
- package/dist/runtime/services/command-executor-service.js +1 -1
- package/dist/runtime/services/config-io-service.js +24 -21
- package/dist/runtime/services/drain-merge-git-service.js +1 -1
- package/dist/runtime/services/file-system-service.js +9 -7
- package/dist/runtime/services/git-porcelain-service.js +6 -6
- package/dist/runtime/services/kubernetes-argo-service.d.ts +10 -3
- package/dist/runtime/services/kubernetes-argo-service.js +90 -84
- package/dist/runtime/services/kubernetes-jobs-read-service.js +115 -0
- package/dist/runtime/services/kubernetes-jobs-service.d.ts +37 -0
- package/dist/runtime/services/kubernetes-jobs-service.js +45 -0
- package/dist/runtime/services/kubernetes-jobs-watch-service.js +61 -0
- package/dist/runtime/services/kubernetes-lease-service.js +21 -0
- package/dist/runtime/services/mcp-gateway-service.js +143 -94
- package/dist/runtime/services/open-pull-request-git-service.js +1 -3
- package/dist/runtime/services/opencode-runtime-server-service.js +10 -12
- package/dist/runtime/services/opencode-sdk-service.js +7 -7
- package/dist/runtime/services/repo-io-service.js +10 -12
- package/dist/runtime/services/run-journal-file-service.js +2 -2
- package/dist/runtime/services/runner-command-io-service.js +48 -52
- package/dist/runtime/services/runner-event-sink-http-service.js +32 -39
- package/dist/runtime/step/step-node.js +15 -15
- package/dist/runtime/workflow-execution.js +56 -57
- package/dist/runtime/workflow-lifecycle.js +82 -101
- package/dist/runtime/yeet-event-record.js +104 -0
- package/dist/runtime/yeet-executor.js +184 -0
- package/dist/safe-json.js +16 -16
- package/dist/schedule/backlog-context.js +122 -116
- package/dist/schedule/baseline.js +249 -255
- package/dist/schedule/passes/coverage.js +63 -68
- package/dist/schedule/passes/drain-merge.js +34 -40
- package/dist/schedule/passes/ids.js +15 -17
- package/dist/schedule/passes/models.js +40 -37
- package/dist/schedule/passes/open-pull-request.js +16 -20
- package/dist/schedule/passes/references.js +18 -22
- package/dist/schedule/prompts.js +135 -141
- package/dist/schedule/scheduling-roles.js +8 -14
- package/dist/schema-boundary.d.ts +4 -0
- package/dist/schema-boundary.js +145 -0
- package/dist/serialized-write-queue.js +2 -2
- package/dist/standard-output-schemas.js +61 -59
- package/dist/strings.js +12 -12
- package/dist/task-ref.js +5 -5
- package/dist/tickets/apply-ticket-plan.js +52 -61
- package/dist/tickets/backlog-task-store.d.ts +15 -23
- package/dist/tickets/backlog-task-store.js +82 -94
- package/dist/tickets/completion/complete-ticket.js +53 -59
- package/dist/tickets/ticket-graph-dto.d.ts +24 -48
- package/dist/tickets/ticket-graph-dto.js +40 -40
- package/dist/tickets/ticket-graph.d.ts +7 -2
- package/dist/tickets/ticket-graph.js +36 -50
- package/dist/tickets/ticket-plan-command-args.js +6 -10
- package/dist/tickets/ticket-plan-render.js +10 -16
- package/dist/tickets/ticket-plan.d.ts +32 -41
- package/dist/tickets/ticket-plan.js +97 -77
- package/dist/tickets/ticket-selection.d.ts +3 -1
- package/dist/tickets/ticket-selection.js +37 -52
- package/dist/tickets/ticket-task-index.js +13 -17
- package/dist/tickets/validation-error-format.js +3 -10
- package/dist/token-estimator.js +12 -7
- package/dist/unknown-fields.js +21 -0
- package/dist/workflow-submit-contract.d.ts +9 -10
- package/dist/workflow-submit-contract.js +10 -9
- package/docs/adr-moka-postgres-schema-isolation.md +48 -0
- package/docs/adr-opencode-first-goal-loop-runtime.md +11 -11
- package/docs/config-architecture.md +13 -13
- package/docs/mcp-host-isolation.md +1 -0
- package/docs/moka-orchestrator-design.md +3 -3
- package/docs/operator-guide.md +1 -1
- package/docs/pipeline-console-runner-contract.md +10 -6
- package/docs/runtime-actor-model.md +18 -18
- package/docs/runtime-test-subsystems.md +200 -0
- package/docs/slash-command-adapter-contract.md +3 -3
- package/package.json +49 -85
- package/dist/config/schema/reference-validation.js +0 -83
package/README.md
CHANGED
|
@@ -290,8 +290,8 @@ sources of truth. Host resources use OpenCode native agents for model-backed
|
|
|
290
290
|
nodes. Otherwise generated instructions dispatch to the configured command
|
|
291
291
|
runner.
|
|
292
292
|
|
|
293
|
-
| Host
|
|
294
|
-
|
|
|
293
|
+
| Host | Generated files | Invocation |
|
|
294
|
+
| -------- | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
295
295
|
| OpenCode | `.opencode/commands/moka-<entrypoint>.md`, `.opencode/agents/*.md`, `.opencode/plugins/*.ts`, `.opencode/opencode.json` | `/moka-quick <task>`, `/moka-execute <task>`, `/moka-inspect <task>` |
|
|
296
296
|
|
|
297
297
|
The installer is idempotent, supports `--check` and `--dry-run`, and refuses to
|
|
@@ -379,6 +379,18 @@ Package and container publishing is owned by GitHub Actions. Do not publish from
|
|
|
379
379
|
a workstation with `npm publish`, `semantic-release`, Docker pushes, or direct
|
|
380
380
|
registry commands.
|
|
381
381
|
|
|
382
|
+
`@oisincoveney/pipeline` is published by `engine`'s own root-level
|
|
383
|
+
`.github/workflows/publish-pipeline.yml`, from this directory's current
|
|
384
|
+
(contract-v2) source, on every push to `main` under `runner/**`. The legacy
|
|
385
|
+
`oisin-ee/pipeline-runner` repository's publish workflow is retired — it
|
|
386
|
+
predates the ENG-67.3 contract-v2 bump and must not be used to cut a release.
|
|
387
|
+
The workflow authenticates to `registry.npmjs.org` via npm Trusted Publishing
|
|
388
|
+
(OIDC) rather than a static `NPM_TOKEN`; no npm credential is stored as a
|
|
389
|
+
GitHub secret in this org. Trusted Publishing must be configured on
|
|
390
|
+
npmjs.com for `@oisincoveney/pipeline`, bound to `oisin-ee/engine` and the
|
|
391
|
+
`publish-pipeline.yml` workflow filename, before this workflow can publish. A
|
|
392
|
+
successful release also triggers the runner container image build.
|
|
393
|
+
|
|
382
394
|
The authoritative package version lives in the npm registry, not in this
|
|
383
395
|
repository. `package.json` pins the `0.0.0-development` semantic-release
|
|
384
396
|
sentinel and is never bumped in git; semantic-release derives and publishes the
|
package/defaults/pipeline.yaml
CHANGED
|
@@ -36,7 +36,12 @@ hooks:
|
|
|
36
36
|
functions:
|
|
37
37
|
generated-defaults-audit:
|
|
38
38
|
kind: command
|
|
39
|
-
command:
|
|
39
|
+
command:
|
|
40
|
+
[
|
|
41
|
+
node,
|
|
42
|
+
-e,
|
|
43
|
+
"const fs=require('node:fs'); fs.writeFileSync(process.env.PIPELINE_HOOK_RESULT, JSON.stringify({status:'pass',summary:'Generated defaults audit passed'}));",
|
|
44
|
+
]
|
|
40
45
|
trusted: true
|
|
41
46
|
timeout_ms: 5000
|
|
42
47
|
output_limit_bytes: 4096
|
|
@@ -111,7 +116,8 @@ scheduler:
|
|
|
111
116
|
green-implementation:
|
|
112
117
|
category: green
|
|
113
118
|
profile: moka-code-writer
|
|
114
|
-
models:
|
|
119
|
+
models:
|
|
120
|
+
[opencode-go/qwen3.7-max, broker/gpt-5.5, kimi-for-coding/k2p6]
|
|
115
121
|
reasoning_effort: high
|
|
116
122
|
verification:
|
|
117
123
|
category: verification
|
|
@@ -119,7 +125,17 @@ scheduler:
|
|
|
119
125
|
models: [broker/gpt-5.5, kimi-for-coding/kimi-k2-thinking]
|
|
120
126
|
reasoning_effort: medium
|
|
121
127
|
execute:
|
|
122
|
-
required_categories:
|
|
128
|
+
required_categories:
|
|
129
|
+
[
|
|
130
|
+
intake,
|
|
131
|
+
research,
|
|
132
|
+
red,
|
|
133
|
+
green,
|
|
134
|
+
mechanical,
|
|
135
|
+
acceptance,
|
|
136
|
+
verification,
|
|
137
|
+
learn,
|
|
138
|
+
]
|
|
123
139
|
nodes:
|
|
124
140
|
backlog-intake:
|
|
125
141
|
category: intake
|
|
@@ -139,12 +155,14 @@ scheduler:
|
|
|
139
155
|
green-backend:
|
|
140
156
|
category: green
|
|
141
157
|
profile: moka-code-writer
|
|
142
|
-
models:
|
|
158
|
+
models:
|
|
159
|
+
[opencode-go/qwen3.7-max, broker/gpt-5.5, kimi-for-coding/k2p6]
|
|
143
160
|
reasoning_effort: high
|
|
144
161
|
green-frontend:
|
|
145
162
|
category: green
|
|
146
163
|
profile: moka-code-writer
|
|
147
|
-
models:
|
|
164
|
+
models:
|
|
165
|
+
[broker/gpt-5.5, kimi-for-coding/k2p6, opencode-go/qwen3.7-max]
|
|
148
166
|
reasoning_effort: high
|
|
149
167
|
acceptance-review:
|
|
150
168
|
category: acceptance
|
package/defaults/profiles.yaml
CHANGED
|
@@ -93,21 +93,37 @@ profiles:
|
|
|
93
93
|
model: broker/gpt-5.5
|
|
94
94
|
reasoning_effort: xhigh
|
|
95
95
|
description: Orchestrate the configured pipeline and enforce gates.
|
|
96
|
-
instructions:
|
|
96
|
+
instructions:
|
|
97
|
+
{
|
|
98
|
+
inline: "Orchestrate through the canonical local `moka run` supervisor. For compatibility slash commands, run the `moka run` command and flags shown in the command body. Treat execution as CLI/supervised runtime, not OpenCode-native Task execution. Enforce only package-configured gates.",
|
|
99
|
+
}
|
|
97
100
|
skills: [orchestrate, execute, quick, inspect]
|
|
98
101
|
mcp_servers: [pipeline-gateway]
|
|
99
102
|
tools: [read, list, grep, glob, bash]
|
|
100
|
-
filesystem:
|
|
103
|
+
filesystem:
|
|
104
|
+
{
|
|
105
|
+
mode: read-only,
|
|
106
|
+
allow: ["**/*"],
|
|
107
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
108
|
+
}
|
|
101
109
|
network: { mode: inherit }
|
|
102
110
|
moka-researcher:
|
|
103
111
|
runner: opencode
|
|
104
112
|
description: Research the requested task and produce structured findings.
|
|
105
|
-
instructions:
|
|
113
|
+
instructions:
|
|
114
|
+
{
|
|
115
|
+
inline: "Inspect first-party source, tests, docs, and task context for the current task only. Produce concise findings with file references and stop; do not perform open-ended repository exploration.",
|
|
116
|
+
}
|
|
106
117
|
timeout_ms: 900000
|
|
107
118
|
skills: [research, spec, scope]
|
|
108
119
|
mcp_servers: [pipeline-gateway]
|
|
109
120
|
tools: [read, list, grep, glob, bash]
|
|
110
|
-
filesystem:
|
|
121
|
+
filesystem:
|
|
122
|
+
{
|
|
123
|
+
mode: read-only,
|
|
124
|
+
allow: ["**/*"],
|
|
125
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
126
|
+
}
|
|
111
127
|
network: { mode: inherit }
|
|
112
128
|
output:
|
|
113
129
|
format: json_schema
|
|
@@ -116,12 +132,20 @@ profiles:
|
|
|
116
132
|
moka-ticket-scoper:
|
|
117
133
|
runner: opencode
|
|
118
134
|
description: Scope a request into a validated Backlog ticket plan.
|
|
119
|
-
instructions:
|
|
135
|
+
instructions:
|
|
136
|
+
{
|
|
137
|
+
inline: "Use the scope skill contract to produce implementation-complete Backlog tickets. Return only valid JSON matching `.pipeline/schemas/ticket-plan.schema.json`. Every acceptance criterion must include concrete evidence text. Do not emit partial tickets; include dependencies, likely files, references, priorities, and plan text for each proposed ticket.",
|
|
138
|
+
}
|
|
120
139
|
timeout_ms: 300000
|
|
121
140
|
skills: [scope]
|
|
122
141
|
mcp_servers: [pipeline-gateway]
|
|
123
142
|
tools: [read, list, grep, glob, bash]
|
|
124
|
-
filesystem:
|
|
143
|
+
filesystem:
|
|
144
|
+
{
|
|
145
|
+
mode: read-only,
|
|
146
|
+
allow: ["**/*"],
|
|
147
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
148
|
+
}
|
|
125
149
|
network: { mode: inherit }
|
|
126
150
|
output:
|
|
127
151
|
format: json_schema
|
|
@@ -136,30 +160,51 @@ profiles:
|
|
|
136
160
|
skills: [research]
|
|
137
161
|
mcp_servers: [pipeline-gateway]
|
|
138
162
|
tools: [read, list, grep, glob, bash]
|
|
139
|
-
filesystem:
|
|
163
|
+
filesystem:
|
|
164
|
+
{
|
|
165
|
+
mode: read-only,
|
|
166
|
+
allow: ["**/*"],
|
|
167
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
168
|
+
}
|
|
140
169
|
network: { mode: inherit }
|
|
141
170
|
moka-schedule-planner:
|
|
142
171
|
runner: opencode
|
|
143
172
|
model: broker/gpt-5.5
|
|
144
173
|
reasoning_effort: xhigh
|
|
145
174
|
description: Refine a baseline schedule into a specialized approved-plan artifact.
|
|
146
|
-
instructions:
|
|
175
|
+
instructions:
|
|
176
|
+
{
|
|
177
|
+
inline: "Generate exactly one workflow named root as an explicit schedule graph. Return YAML only.",
|
|
178
|
+
}
|
|
147
179
|
timeout_ms: 300000
|
|
148
180
|
skills: [schedule-graph-shaping]
|
|
149
181
|
mcp_servers: [pipeline-gateway]
|
|
150
182
|
tools: [read, list, grep, glob, bash]
|
|
151
|
-
filesystem:
|
|
183
|
+
filesystem:
|
|
184
|
+
{
|
|
185
|
+
mode: read-only,
|
|
186
|
+
allow: ["**/*"],
|
|
187
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
188
|
+
}
|
|
152
189
|
network: { mode: inherit }
|
|
153
190
|
moka-test-writer:
|
|
154
191
|
runner: opencode
|
|
155
192
|
scheduling_roles: [implementation]
|
|
156
193
|
description: Add focused failing tests for the requested behavior.
|
|
157
194
|
timeout_ms: 1800000
|
|
158
|
-
instructions:
|
|
195
|
+
instructions:
|
|
196
|
+
{
|
|
197
|
+
inline: "This scheduled node is already dispatched by Moka; do direct repository work inside the current workspace. Do not invoke `moka run`, `moka submit`, `$dispatch`, `$scope`, `$execute`, or any nested Moka/workflow supervisor from this node. Add focused failing tests for the requested behavior only. Do not change production code. Only edit files matching test paths such as **/*.test.*, **/*.spec.*, **/*_test.*, **/__tests__/**, test/**, or tests/**. Tool findings about lint, types, complexity, or dead code must be resolved at source; comments must not hide them. If a gate flags your test, restructure the test (e.g. move restricted imports into shared support/fixture helpers). Return only valid JSON with top-level changes and verification. Every changes entry must include summary, why, and files. Include risks, followups, and lessons when present. Do not use Markdown fences or prose outside the JSON object.",
|
|
198
|
+
}
|
|
159
199
|
skills: [test]
|
|
160
200
|
mcp_servers: [pipeline-gateway]
|
|
161
201
|
tools: [read, list, grep, glob, bash, edit, write]
|
|
162
|
-
filesystem:
|
|
202
|
+
filesystem:
|
|
203
|
+
{
|
|
204
|
+
mode: workspace-write,
|
|
205
|
+
allow: ["**/*"],
|
|
206
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
207
|
+
}
|
|
163
208
|
network: { mode: inherit }
|
|
164
209
|
output:
|
|
165
210
|
format: json_schema
|
|
@@ -170,11 +215,19 @@ profiles:
|
|
|
170
215
|
scheduling_roles: [implementation]
|
|
171
216
|
description: Implement production code until the failing tests pass.
|
|
172
217
|
timeout_ms: 1800000
|
|
173
|
-
instructions:
|
|
218
|
+
instructions:
|
|
219
|
+
{
|
|
220
|
+
inline: "This scheduled node is already dispatched by Moka; do direct repository work inside the current workspace. Do not invoke `moka run`, `moka submit`, `$dispatch`, `$scope`, `$execute`, or any nested Moka/workflow supervisor from this node. Implement the smallest production change that makes the failing tests pass. Tool findings about lint, types, complexity, or dead code must be resolved at source; comments must not hide them. Reduce complexity by extracting helpers, remove genuinely dead code, and migrate off deprecated APIs rather than hiding the warning. Return only valid JSON with top-level changes and verification. Every changes entry must include summary, why, and files. Include risks, followups, and lessons when present. Do not use Markdown fences or prose outside the JSON object.",
|
|
221
|
+
}
|
|
174
222
|
skills: [trace, test, fix, library-first-development]
|
|
175
223
|
mcp_servers: [pipeline-gateway]
|
|
176
224
|
tools: [read, list, grep, glob, bash, edit, write]
|
|
177
|
-
filesystem:
|
|
225
|
+
filesystem:
|
|
226
|
+
{
|
|
227
|
+
mode: workspace-write,
|
|
228
|
+
allow: ["**/*"],
|
|
229
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
230
|
+
}
|
|
178
231
|
network: { mode: inherit }
|
|
179
232
|
output:
|
|
180
233
|
format: json_schema
|
|
@@ -184,11 +237,19 @@ profiles:
|
|
|
184
237
|
runner: opencode
|
|
185
238
|
scheduling_roles: [coverage]
|
|
186
239
|
description: Audit the finished change against every acceptance criterion.
|
|
187
|
-
instructions:
|
|
240
|
+
instructions:
|
|
241
|
+
{
|
|
242
|
+
inline: 'Audit the completed change against each canonical acceptance criterion independently. Return only valid JSON with top-level "verdict", "evidence", "acceptance", and optional "violations". Each "acceptance" entry must include "id", "verdict", and non-empty "evidence". Do not use Markdown fences or prose outside the JSON object.',
|
|
243
|
+
}
|
|
188
244
|
skills: [critique, doubt]
|
|
189
245
|
mcp_servers: [pipeline-gateway]
|
|
190
246
|
tools: [read, list, grep, glob, bash]
|
|
191
|
-
filesystem:
|
|
247
|
+
filesystem:
|
|
248
|
+
{
|
|
249
|
+
mode: read-only,
|
|
250
|
+
allow: ["**/*"],
|
|
251
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
252
|
+
}
|
|
192
253
|
network: { mode: inherit }
|
|
193
254
|
output:
|
|
194
255
|
format: json_schema
|
|
@@ -198,11 +259,19 @@ profiles:
|
|
|
198
259
|
runner: opencode
|
|
199
260
|
scheduling_roles: [coverage]
|
|
200
261
|
description: Perform the final thermo-nuclear code quality review of the integration branch.
|
|
201
|
-
instructions:
|
|
262
|
+
instructions:
|
|
263
|
+
{
|
|
264
|
+
inline: "Perform the final code quality review of the integration branch.",
|
|
265
|
+
}
|
|
202
266
|
skills: [critique]
|
|
203
267
|
mcp_servers: [pipeline-gateway]
|
|
204
268
|
tools: [read, list, grep, glob, bash]
|
|
205
|
-
filesystem:
|
|
269
|
+
filesystem:
|
|
270
|
+
{
|
|
271
|
+
mode: read-only,
|
|
272
|
+
allow: ["**/*"],
|
|
273
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
274
|
+
}
|
|
206
275
|
network: { mode: inherit }
|
|
207
276
|
output:
|
|
208
277
|
format: json_schema
|
|
@@ -212,11 +281,19 @@ profiles:
|
|
|
212
281
|
runner: opencode
|
|
213
282
|
scheduling_roles: [coverage]
|
|
214
283
|
description: Verify checks, implementation fit, and final evidence.
|
|
215
|
-
instructions:
|
|
284
|
+
instructions:
|
|
285
|
+
{
|
|
286
|
+
inline: 'Verify checks, implementation fit, and final evidence. Return only valid JSON with top-level "verdict", "evidence", and optional "violations". Do not use Markdown fences or prose outside the JSON object.',
|
|
287
|
+
}
|
|
216
288
|
skills: [verify, critique, secure, optimize]
|
|
217
289
|
mcp_servers: [pipeline-gateway]
|
|
218
290
|
tools: [read, list, grep, glob, bash]
|
|
219
|
-
filesystem:
|
|
291
|
+
filesystem:
|
|
292
|
+
{
|
|
293
|
+
mode: read-only,
|
|
294
|
+
allow: ["**/*"],
|
|
295
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
296
|
+
}
|
|
220
297
|
network: { mode: inherit }
|
|
221
298
|
output:
|
|
222
299
|
format: json_schema
|
|
@@ -227,11 +304,17 @@ profiles:
|
|
|
227
304
|
model: broker/gpt-5.5
|
|
228
305
|
reasoning_effort: low
|
|
229
306
|
description: Store durable lessons from the completed run.
|
|
230
|
-
instructions:
|
|
307
|
+
instructions:
|
|
308
|
+
{ inline: "Store durable lessons from the completed run when useful." }
|
|
231
309
|
skills: [migrate]
|
|
232
310
|
mcp_servers: [pipeline-gateway]
|
|
233
311
|
tools: [read, list, grep, glob, bash]
|
|
234
|
-
filesystem:
|
|
312
|
+
filesystem:
|
|
313
|
+
{
|
|
314
|
+
mode: read-only,
|
|
315
|
+
allow: ["**/*"],
|
|
316
|
+
deny: ["node_modules/**", "dist/**", ".git/**"],
|
|
317
|
+
}
|
|
235
318
|
network: { mode: inherit }
|
|
236
319
|
output:
|
|
237
320
|
format: json_schema
|
package/dist/argo-graph.js
CHANGED
|
@@ -1,107 +1,109 @@
|
|
|
1
1
|
import { uniqueStrings } from "./strings.js";
|
|
2
|
-
import { resolveExecutableDependencyIds } from "./planning/dependency-refs.js";
|
|
2
|
+
import { indexPlannedNodesById, resolveExecutableDependencyIds } from "./planning/dependency-refs.js";
|
|
3
3
|
import { terminalDependencyItems } from "./planning/graph.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { mutableArray, nonEmptyMutableArray, parseStrictWithSchema, requiredString, struct } from "./schema-boundary.js";
|
|
5
|
+
import * as Option$1 from "effect/Option";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import * as Arr from "effect/Array";
|
|
8
|
+
import * as HashMap from "effect/HashMap";
|
|
9
|
+
import * as Match from "effect/Match";
|
|
6
10
|
//#region src/argo-graph.ts
|
|
7
|
-
const argoExecutableTaskSchema =
|
|
8
|
-
dependencies:
|
|
9
|
-
nodeId:
|
|
10
|
-
taskName:
|
|
11
|
-
templateName:
|
|
12
|
-
})
|
|
13
|
-
const argoExecutionGraphSchema =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
terminalTaskNames:
|
|
17
|
-
workflowId:
|
|
18
|
-
})
|
|
11
|
+
const argoExecutableTaskSchema = struct({
|
|
12
|
+
dependencies: mutableArray(requiredString),
|
|
13
|
+
nodeId: requiredString,
|
|
14
|
+
taskName: requiredString,
|
|
15
|
+
templateName: requiredString
|
|
16
|
+
});
|
|
17
|
+
const argoExecutionGraphSchema = struct({
|
|
18
|
+
tasks: nonEmptyMutableArray(argoExecutableTaskSchema),
|
|
19
|
+
terminalNodeIds: mutableArray(requiredString),
|
|
20
|
+
terminalTaskNames: mutableArray(requiredString),
|
|
21
|
+
workflowId: requiredString
|
|
22
|
+
});
|
|
19
23
|
/**
|
|
20
24
|
* Thrown when the Argo graph compiler encounters a node kind that cannot be
|
|
21
25
|
* lowered to an Argo DAG task. Callers should surface this as a validation
|
|
22
26
|
* failure before attempting a cluster submission.
|
|
23
27
|
*/
|
|
24
|
-
var ArgoGraphCompilerError = class extends
|
|
28
|
+
var ArgoGraphCompilerError = class extends Schema.TaggedErrorClass()("ArgoGraphCompilerError", {
|
|
29
|
+
kind: Schema.String,
|
|
30
|
+
message: Schema.String,
|
|
31
|
+
nodeId: Schema.String
|
|
32
|
+
}) {
|
|
25
33
|
constructor(kind, nodeId) {
|
|
26
34
|
super({
|
|
27
35
|
kind,
|
|
28
|
-
nodeId
|
|
29
|
-
|
|
36
|
+
message: `Argo graph compiler: node kind '${kind}' on node '${nodeId}' cannot be lowered to an Argo DAG task`,
|
|
37
|
+
nodeId
|
|
30
38
|
});
|
|
31
39
|
}
|
|
32
40
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
constructor(plan) {
|
|
42
|
-
this.plan = plan;
|
|
43
|
-
this.indexNodes(plan.topologicalOrder);
|
|
44
|
-
}
|
|
45
|
-
compile() {
|
|
46
|
-
this.compileNodes(this.plan.topologicalOrder, []);
|
|
47
|
-
const terminalTasks = this.terminalTasks();
|
|
48
|
-
return {
|
|
49
|
-
terminalNodeIds: terminalTasks.map((task) => task.nodeId),
|
|
50
|
-
tasks: this.tasks,
|
|
51
|
-
terminalTaskNames: terminalTasks.map((task) => task.taskName),
|
|
52
|
-
workflowId: this.plan.workflowId
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
indexNodes(nodes) {
|
|
56
|
-
for (const node of nodes) {
|
|
57
|
-
if (this.nodeById.has(node.id)) throw new Error(`Argo schedule contains duplicate node id '${node.id}'`);
|
|
58
|
-
this.nodeById.set(node.id, node);
|
|
59
|
-
this.indexNodes(node.children ?? []);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
compileNodes(nodes, inheritedNeeds) {
|
|
63
|
-
for (const node of nodes) this.compileNode(node, inheritedNeeds);
|
|
64
|
-
}
|
|
65
|
-
compileNode(node, inheritedNeeds) {
|
|
66
|
-
const kind = node.kind;
|
|
67
|
-
switch (kind) {
|
|
68
|
-
case "agent":
|
|
69
|
-
case "builtin":
|
|
70
|
-
case "command":
|
|
71
|
-
this.compileExecutableNode(node, inheritedNeeds);
|
|
72
|
-
return;
|
|
73
|
-
case "group": return;
|
|
74
|
-
case "parallel":
|
|
75
|
-
this.compileParallelNode(node, inheritedNeeds);
|
|
76
|
-
return;
|
|
77
|
-
default: throw new ArgoGraphCompilerError(String(kind), node.id);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
compileExecutableNode(node, inheritedNeeds) {
|
|
81
|
-
const dependencies = this.resolveDependencyTaskNames([...inheritedNeeds, ...node.needs]);
|
|
82
|
-
const task = argoExecutableTaskSchema.parse({
|
|
83
|
-
dependencies,
|
|
84
|
-
nodeId: node.id,
|
|
85
|
-
taskName: argoTaskName(node.id),
|
|
86
|
-
templateName: argoTemplateName(node.id)
|
|
41
|
+
var ArgoGraphDuplicateNodeError = class extends Schema.TaggedErrorClass()("ArgoGraphDuplicateNodeError", {
|
|
42
|
+
message: Schema.String,
|
|
43
|
+
nodeId: Schema.String
|
|
44
|
+
}) {
|
|
45
|
+
constructor(nodeId) {
|
|
46
|
+
super({
|
|
47
|
+
message: `Argo schedule contains duplicate node id '${nodeId}'`,
|
|
48
|
+
nodeId
|
|
87
49
|
});
|
|
88
|
-
this.tasks.push(task);
|
|
89
|
-
}
|
|
90
|
-
compileParallelNode(node, inheritedNeeds) {
|
|
91
|
-
this.compileNodes(node.children ?? [], [...inheritedNeeds, ...node.needs]);
|
|
92
|
-
}
|
|
93
|
-
resolveDependencyTaskNames(nodeIds) {
|
|
94
|
-
return uniqueStrings(resolveExecutableDependencyIds(this.nodeById, nodeIds).map((id) => argoTaskName(id)));
|
|
95
|
-
}
|
|
96
|
-
terminalTasks() {
|
|
97
|
-
return terminalDependencyItems(this.tasks, (task) => task.taskName, (task) => task.dependencies);
|
|
98
50
|
}
|
|
99
51
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
52
|
+
const argoTaskName = (nodeId) => `node-${nodeId}`;
|
|
53
|
+
const argoTemplateName = (nodeId) => `task-${nodeId}`;
|
|
54
|
+
const emptyDuplicateNodeSearchState = {
|
|
55
|
+
duplicate: Option$1.none(),
|
|
56
|
+
seen: HashMap.empty()
|
|
57
|
+
};
|
|
58
|
+
const nodeAndDescendants = (node) => [node, ...Arr.flatMap(node.children ?? [], nodeAndDescendants)];
|
|
59
|
+
const plannedNodeTree = (nodes) => Arr.flatMap(nodes, nodeAndDescendants);
|
|
60
|
+
const trackDuplicateNodeId = (state, node) => Option$1.isSome(state.duplicate) ? state : HashMap.has(state.seen, node.id) ? {
|
|
61
|
+
...state,
|
|
62
|
+
duplicate: Option$1.some(node.id)
|
|
63
|
+
} : {
|
|
64
|
+
duplicate: Option$1.none(),
|
|
65
|
+
seen: HashMap.set(state.seen, node.id, true)
|
|
66
|
+
};
|
|
67
|
+
const duplicateNodeId = (nodes) => Arr.reduce(plannedNodeTree(nodes), emptyDuplicateNodeSearchState, trackDuplicateNodeId).duplicate;
|
|
68
|
+
const assertUniqueNodeIds = (nodes) => {
|
|
69
|
+
Option$1.match(duplicateNodeId(nodes), {
|
|
70
|
+
onNone: () => void 0,
|
|
71
|
+
onSome: (nodeId) => {
|
|
72
|
+
throw new ArgoGraphDuplicateNodeError(nodeId);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
const resolveDependencyTaskNames = (context, nodeIds) => uniqueStrings(resolveExecutableDependencyIds(context.nodeById, nodeIds).map((id) => argoTaskName(id)));
|
|
77
|
+
const compileExecutableNode = (context, node, inheritedNeeds) => {
|
|
78
|
+
const dependencies = resolveDependencyTaskNames(context, [...inheritedNeeds, ...node.needs]);
|
|
79
|
+
return parseStrictWithSchema(argoExecutableTaskSchema, {
|
|
80
|
+
dependencies,
|
|
81
|
+
nodeId: node.id,
|
|
82
|
+
taskName: argoTaskName(node.id),
|
|
83
|
+
templateName: argoTemplateName(node.id)
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const compileArgoNodes = (context, nodes, inheritedNeeds, initialTasks = []) => Arr.reduce(nodes, initialTasks, (tasks, node) => compileArgoNode({
|
|
87
|
+
context,
|
|
88
|
+
inheritedNeeds,
|
|
89
|
+
node,
|
|
90
|
+
tasks
|
|
91
|
+
}));
|
|
92
|
+
const compileArgoNode = (input) => Match.value(input.node.kind).pipe(Match.whenOr("agent", "builtin", "command", () => [...input.tasks, compileExecutableNode(input.context, input.node, input.inheritedNeeds)]), Match.when("group", () => input.tasks), Match.when("parallel", () => compileArgoNodes(input.context, input.node.children ?? [], [...input.inheritedNeeds, ...input.node.needs], input.tasks)), Match.exhaustive);
|
|
93
|
+
const compileArgoExecutionGraphUnchecked = (plan) => {
|
|
94
|
+
const context = { nodeById: indexPlannedNodesById(plan.topologicalOrder) };
|
|
95
|
+
const tasks = compileArgoNodes(context, plan.topologicalOrder, []);
|
|
96
|
+
const terminalTasks = terminalDependencyItems(tasks, (task) => task.taskName, (task) => task.dependencies);
|
|
97
|
+
return {
|
|
98
|
+
tasks,
|
|
99
|
+
terminalNodeIds: terminalTasks.map((task) => task.nodeId),
|
|
100
|
+
terminalTaskNames: terminalTasks.map((task) => task.taskName),
|
|
101
|
+
workflowId: plan.workflowId
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const compileArgoExecutionGraph = (plan) => {
|
|
105
|
+
assertUniqueNodeIds(plan.topologicalOrder);
|
|
106
|
+
return parseStrictWithSchema(argoExecutionGraphSchema, compileArgoExecutionGraphUnchecked(plan));
|
|
107
|
+
};
|
|
106
108
|
//#endregion
|
|
107
109
|
export { ArgoGraphCompilerError, compileArgoExecutionGraph };
|