@revisium/orchestrator 0.0.0 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +202 -1
- package/control-plane/bootstrap.config.json +104 -2
- package/control-plane/default-playbook/catalog/pipelines.json +657 -0
- package/control-plane/default-playbook/catalog/roles.json +65 -0
- package/control-plane/default-playbook/package.json +5 -0
- package/control-plane/default-playbook/playbook.json +13 -0
- package/control-plane/default-playbook/prompts/analyst.md +29 -0
- package/control-plane/default-playbook/prompts/developer.md +26 -0
- package/control-plane/default-playbook/prompts/integrator.md +20 -0
- package/control-plane/default-playbook/prompts/orchestrator.md +23 -0
- package/control-plane/default-playbook/prompts/reviewer.md +28 -0
- package/control-plane/default-playbook/prompts/triager.md +51 -0
- package/control-plane/default-playbook/prompts/watcher.md +24 -0
- package/dist/api/graphql-api/filters/agent-observability-exception.filter.js +24 -0
- package/dist/api/graphql-api/filters/agent-observability-exception.filter.js.map +1 -0
- package/dist/api/graphql-api/filters/graphql-validation-exception.filter.js +36 -0
- package/dist/api/graphql-api/filters/graphql-validation-exception.filter.js.map +1 -0
- package/dist/api/graphql-api/graphql-api.module.js +77 -0
- package/dist/api/graphql-api/graphql-api.module.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/agent-observability-subscription-bridge.service.js +296 -0
- package/dist/api/graphql-api/graphql-ws/agent-observability-subscription-bridge.service.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/agent-observability-subscription-mappers.js +64 -0
- package/dist/api/graphql-api/graphql-ws/agent-observability-subscription-mappers.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/constants.js +11 -0
- package/dist/api/graphql-api/graphql-ws/constants.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/pubsub.module.js +32 -0
- package/dist/api/graphql-api/graphql-ws/pubsub.module.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/run-progress-subscription-poller.service.js +101 -0
- package/dist/api/graphql-api/graphql-ws/run-progress-subscription-poller.service.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/subscription-bridge.service.js +115 -0
- package/dist/api/graphql-api/graphql-ws/subscription-bridge.service.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/subscription-mappers.js +85 -0
- package/dist/api/graphql-api/graphql-ws/subscription-mappers.js.map +1 -0
- package/dist/api/graphql-api/graphql-ws/ws.js +22 -0
- package/dist/api/graphql-api/graphql-ws/ws.js.map +1 -0
- package/dist/api/graphql-api/inbox/inbox-subscription.resolver.js +56 -0
- package/dist/api/graphql-api/inbox/inbox-subscription.resolver.js.map +1 -0
- package/dist/api/graphql-api/inbox/inbox.resolver.js +125 -0
- package/dist/api/graphql-api/inbox/inbox.resolver.js.map +1 -0
- package/dist/api/graphql-api/inbox/inputs/answer-question.input.js +33 -0
- package/dist/api/graphql-api/inbox/inputs/answer-question.input.js.map +1 -0
- package/dist/api/graphql-api/inbox/inputs/gate-decision.input.js +27 -0
- package/dist/api/graphql-api/inbox/inputs/gate-decision.input.js.map +1 -0
- package/dist/api/graphql-api/inbox/inputs/list-inbox.input.js +28 -0
- package/dist/api/graphql-api/inbox/inputs/list-inbox.input.js.map +1 -0
- package/dist/api/graphql-api/inbox/inputs/resolve-inbox-item.input.js +38 -0
- package/dist/api/graphql-api/inbox/inputs/resolve-inbox-item.input.js.map +1 -0
- package/dist/api/graphql-api/inbox/model/gate-risk.model.js +53 -0
- package/dist/api/graphql-api/inbox/model/gate-risk.model.js.map +1 -0
- package/dist/api/graphql-api/inbox/model/inbox-connection.model.js +16 -0
- package/dist/api/graphql-api/inbox/model/inbox-connection.model.js.map +1 -0
- package/dist/api/graphql-api/inbox/model/inbox-item.model.js +88 -0
- package/dist/api/graphql-api/inbox/model/inbox-item.model.js.map +1 -0
- package/dist/api/graphql-api/inbox/model/inbox-resolution.model.js +48 -0
- package/dist/api/graphql-api/inbox/model/inbox-resolution.model.js.map +1 -0
- package/dist/api/graphql-api/method/inputs/list-method.input.js +15 -0
- package/dist/api/graphql-api/method/inputs/list-method.input.js.map +1 -0
- package/dist/api/graphql-api/method/method.resolver.js +90 -0
- package/dist/api/graphql-api/method/method.resolver.js.map +1 -0
- package/dist/api/graphql-api/method/model/alternative-role-group.model.js +32 -0
- package/dist/api/graphql-api/method/model/alternative-role-group.model.js.map +1 -0
- package/dist/api/graphql-api/method/model/pipeline-connection.model.js +16 -0
- package/dist/api/graphql-api/method/model/pipeline-connection.model.js.map +1 -0
- package/dist/api/graphql-api/method/model/pipeline.model.js +69 -0
- package/dist/api/graphql-api/method/model/pipeline.model.js.map +1 -0
- package/dist/api/graphql-api/method/model/playbook-connection.model.js +16 -0
- package/dist/api/graphql-api/method/model/playbook-connection.model.js.map +1 -0
- package/dist/api/graphql-api/method/model/playbook.model.js +47 -0
- package/dist/api/graphql-api/method/model/playbook.model.js.map +1 -0
- package/dist/api/graphql-api/method/model/role-connection.model.js +16 -0
- package/dist/api/graphql-api/method/model/role-connection.model.js.map +1 -0
- package/dist/api/graphql-api/method/model/role.model.js +98 -0
- package/dist/api/graphql-api/method/model/role.model.js.map +1 -0
- package/dist/api/graphql-api/pr/inputs/pr-readiness.input.js +52 -0
- package/dist/api/graphql-api/pr/inputs/pr-readiness.input.js.map +1 -0
- package/dist/api/graphql-api/pr/model/pr-readiness.model.js +403 -0
- package/dist/api/graphql-api/pr/model/pr-readiness.model.js.map +1 -0
- package/dist/api/graphql-api/pr/pr.resolver.js +76 -0
- package/dist/api/graphql-api/pr/pr.resolver.js.map +1 -0
- package/dist/api/graphql-api/registerGraphqlEnums.js +9 -0
- package/dist/api/graphql-api/registerGraphqlEnums.js.map +1 -0
- package/dist/api/graphql-api/runs/inputs/create-run.input.js +63 -0
- package/dist/api/graphql-api/runs/inputs/create-run.input.js.map +1 -0
- package/dist/api/graphql-api/runs/inputs/get-agent-log.input.js +48 -0
- package/dist/api/graphql-api/runs/inputs/get-agent-log.input.js.map +1 -0
- package/dist/api/graphql-api/runs/inputs/get-run-attempts.input.js +32 -0
- package/dist/api/graphql-api/runs/inputs/get-run-attempts.input.js.map +1 -0
- package/dist/api/graphql-api/runs/inputs/get-run-events.input.js +28 -0
- package/dist/api/graphql-api/runs/inputs/get-run-events.input.js.map +1 -0
- package/dist/api/graphql-api/runs/inputs/list-runs.input.js +23 -0
- package/dist/api/graphql-api/runs/inputs/list-runs.input.js.map +1 -0
- package/dist/api/graphql-api/runs/inputs/simulate-route.input.js +43 -0
- package/dist/api/graphql-api/runs/inputs/simulate-route.input.js.map +1 -0
- package/dist/api/graphql-api/runs/model/agent-activity.model.js +367 -0
- package/dist/api/graphql-api/runs/model/agent-activity.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/create-run-result.model.js +53 -0
- package/dist/api/graphql-api/runs/model/create-run-result.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-attempt.model.js +114 -0
- package/dist/api/graphql-api/runs/model/run-attempt.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-connection.model.js +16 -0
- package/dist/api/graphql-api/runs/model/run-connection.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-cost.model.js +67 -0
- package/dist/api/graphql-api/runs/model/run-cost.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-digest.model.js +41 -0
- package/dist/api/graphql-api/runs/model/run-digest.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-event-connection.model.js +16 -0
- package/dist/api/graphql-api/runs/model/run-event-connection.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-event.model.js +58 -0
- package/dist/api/graphql-api/runs/model/run-event.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-progress.model.js +33 -0
- package/dist/api/graphql-api/runs/model/run-progress.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run-workflow.model.js +287 -0
- package/dist/api/graphql-api/runs/model/run-workflow.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/run.model.js +57 -0
- package/dist/api/graphql-api/runs/model/run.model.js.map +1 -0
- package/dist/api/graphql-api/runs/model/usage.model.js +32 -0
- package/dist/api/graphql-api/runs/model/usage.model.js.map +1 -0
- package/dist/api/graphql-api/runs/run-digest.resolver.js +40 -0
- package/dist/api/graphql-api/runs/run-digest.resolver.js.map +1 -0
- package/dist/api/graphql-api/runs/run-events.resolver.js +45 -0
- package/dist/api/graphql-api/runs/run-events.resolver.js.map +1 -0
- package/dist/api/graphql-api/runs/run-progress.resolver.js +53 -0
- package/dist/api/graphql-api/runs/run-progress.resolver.js.map +1 -0
- package/dist/api/graphql-api/runs/runs-subscription.resolver.js +124 -0
- package/dist/api/graphql-api/runs/runs-subscription.resolver.js.map +1 -0
- package/dist/api/graphql-api/runs/runs.resolver.js +165 -0
- package/dist/api/graphql-api/runs/runs.resolver.js.map +1 -0
- package/dist/api/graphql-api/share/graphql-param-types.js +6 -0
- package/dist/api/graphql-api/share/graphql-param-types.js.map +1 -0
- package/dist/api/graphql-api/share/inputs/connection.input.js +27 -0
- package/dist/api/graphql-api/share/inputs/connection.input.js.map +1 -0
- package/dist/api/graphql-api/share/inputs/run-subscription.input.js +22 -0
- package/dist/api/graphql-api/share/inputs/run-subscription.input.js.map +1 -0
- package/dist/api/graphql-api/share/model/paginated.model.js +75 -0
- package/dist/api/graphql-api/share/model/paginated.model.js.map +1 -0
- package/dist/api/graphql-api/system/model/daemon-status.model.js +47 -0
- package/dist/api/graphql-api/system/model/daemon-status.model.js.map +1 -0
- package/dist/api/graphql-api/system/model/doctor-result.model.js +33 -0
- package/dist/api/graphql-api/system/model/doctor-result.model.js.map +1 -0
- package/dist/api/graphql-api/system/model/project.model.js +37 -0
- package/dist/api/graphql-api/system/model/project.model.js.map +1 -0
- package/dist/api/graphql-api/system/model/repository-context.model.js +70 -0
- package/dist/api/graphql-api/system/model/repository-context.model.js.map +1 -0
- package/dist/api/graphql-api/system/model/repository-validation.model.js +62 -0
- package/dist/api/graphql-api/system/model/repository-validation.model.js.map +1 -0
- package/dist/api/graphql-api/system/model/system-status.model.js +29 -0
- package/dist/api/graphql-api/system/model/system-status.model.js.map +1 -0
- package/dist/api/graphql-api/system/system.resolver.js +83 -0
- package/dist/api/graphql-api/system/system.resolver.js.map +1 -0
- package/dist/cli/commands/doctor-report.js +70 -0
- package/dist/cli/commands/doctor-report.js.map +1 -0
- package/dist/cli/commands/lifecycle.js +463 -0
- package/dist/cli/commands/lifecycle.js.map +1 -0
- package/dist/cli/commands/mcp.js +53 -8
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/process-tree.js +87 -0
- package/dist/cli/commands/process-tree.js.map +1 -0
- package/dist/cli/commands/revisium-helpers.js +2 -2
- package/dist/cli/commands/rogue-reaper.js +63 -0
- package/dist/cli/commands/rogue-reaper.js.map +1 -0
- package/dist/cli/index.js +5 -29
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/program.js +7 -23
- package/dist/cli/program.js.map +1 -1
- package/dist/config.js +79 -1
- package/dist/config.js.map +1 -1
- package/dist/control-plane/bootstrap.js +101 -0
- package/dist/control-plane/bootstrap.js.map +1 -0
- package/dist/control-plane/change-notifications.js +35 -0
- package/dist/control-plane/change-notifications.js.map +1 -0
- package/dist/control-plane/client-transport.js +74 -41
- package/dist/control-plane/client-transport.js.map +1 -1
- package/dist/control-plane/data-access.js +13 -5
- package/dist/control-plane/data-access.js.map +1 -1
- package/dist/control-plane/definitions.js +1 -1
- package/dist/control-plane/definitions.js.map +1 -1
- package/dist/control-plane/inbox.js +5 -31
- package/dist/control-plane/inbox.js.map +1 -1
- package/dist/control-plane/index.js +1 -1
- package/dist/control-plane/index.js.map +1 -1
- package/dist/control-plane/json-fields.js +2 -0
- package/dist/control-plane/json-fields.js.map +1 -1
- package/dist/control-plane/resolve-cwd.js +76 -8
- package/dist/control-plane/resolve-cwd.js.map +1 -1
- package/dist/control-plane/schema-migration.js +82 -0
- package/dist/control-plane/schema-migration.js.map +1 -0
- package/dist/control-plane/seed-default-playbook.js +141 -0
- package/dist/control-plane/seed-default-playbook.js.map +1 -0
- package/dist/control-plane/steps.js +15 -349
- package/dist/control-plane/steps.js.map +1 -1
- package/dist/control-plane/tables.js +1 -0
- package/dist/control-plane/tables.js.map +1 -1
- package/dist/e2e/kit/agents.js +148 -0
- package/dist/e2e/kit/agents.js.map +1 -0
- package/dist/e2e/kit/assertions.js +163 -0
- package/dist/e2e/kit/assertions.js.map +1 -0
- package/dist/e2e/kit/crash.js +44 -0
- package/dist/e2e/kit/crash.js.map +1 -0
- package/dist/e2e/kit/drive.js +45 -0
- package/dist/e2e/kit/drive.js.map +1 -0
- package/dist/e2e/kit/env.js +16 -0
- package/dist/e2e/kit/env.js.map +1 -0
- package/dist/e2e/kit/fake-integrator.js +57 -0
- package/dist/e2e/kit/fake-integrator.js.map +1 -0
- package/dist/e2e/kit/gh-emulator.js +213 -0
- package/dist/e2e/kit/gh-emulator.js.map +1 -0
- package/dist/e2e/kit/git-target-repo.js +115 -0
- package/dist/e2e/kit/git-target-repo.js.map +1 -0
- package/dist/e2e/kit/harness.js +72 -0
- package/dist/e2e/kit/harness.js.map +1 -0
- package/dist/e2e/kit/index.js +14 -0
- package/dist/e2e/kit/index.js.map +1 -0
- package/dist/e2e/kit/mcp.js +32 -0
- package/dist/e2e/kit/mcp.js.map +1 -0
- package/dist/e2e/kit/scenarios.js +196 -0
- package/dist/e2e/kit/scenarios.js.map +1 -0
- package/dist/e2e/recovery-crash-child.js +29 -0
- package/dist/e2e/recovery-crash-child.js.map +1 -0
- package/dist/e2e/recovery-dd-crash-child.js +43 -0
- package/dist/e2e/recovery-dd-crash-child.js.map +1 -0
- package/dist/engine/dbos.module.js +2 -1
- package/dist/engine/dbos.module.js.map +1 -1
- package/dist/engine/dbos.service.js +89 -18
- package/dist/engine/dbos.service.js.map +1 -1
- package/dist/engine/ensure-postgres.js +18 -4
- package/dist/engine/ensure-postgres.js.map +1 -1
- package/dist/features/inbox/commands/handlers/inbox-command.handlers.js +80 -0
- package/dist/features/inbox/commands/handlers/inbox-command.handlers.js.map +1 -0
- package/dist/features/inbox/commands/impl/answer-question.command.js +7 -0
- package/dist/features/inbox/commands/impl/answer-question.command.js.map +1 -0
- package/dist/features/inbox/commands/impl/approve-gate.command.js +7 -0
- package/dist/features/inbox/commands/impl/approve-gate.command.js.map +1 -0
- package/dist/features/inbox/commands/impl/reject-gate.command.js +7 -0
- package/dist/features/inbox/commands/impl/reject-gate.command.js.map +1 -0
- package/dist/features/inbox/commands/impl/resolve-inbox-item.command.js +7 -0
- package/dist/features/inbox/commands/impl/resolve-inbox-item.command.js.map +1 -0
- package/dist/features/inbox/commands/index.js +8 -0
- package/dist/features/inbox/commands/index.js.map +1 -0
- package/dist/features/inbox/inbox-api.module.js +23 -0
- package/dist/features/inbox/inbox-api.module.js.map +1 -0
- package/dist/features/inbox/inbox-api.service.js +63 -0
- package/dist/features/inbox/inbox-api.service.js.map +1 -0
- package/dist/features/inbox/queries/handlers/inbox-query.handlers.js +111 -0
- package/dist/features/inbox/queries/handlers/inbox-query.handlers.js.map +1 -0
- package/dist/features/inbox/queries/impl/get-inbox-item.query.js +7 -0
- package/dist/features/inbox/queries/impl/get-inbox-item.query.js.map +1 -0
- package/dist/features/inbox/queries/impl/get-pending-decisions.query.js +7 -0
- package/dist/features/inbox/queries/impl/get-pending-decisions.query.js.map +1 -0
- package/dist/features/inbox/queries/impl/list-inbox.query.js +7 -0
- package/dist/features/inbox/queries/impl/list-inbox.query.js.map +1 -0
- package/dist/features/inbox/queries/impl/summarize-gate-risk.query.js +7 -0
- package/dist/features/inbox/queries/impl/summarize-gate-risk.query.js.map +1 -0
- package/dist/features/inbox/queries/index.js +8 -0
- package/dist/features/inbox/queries/index.js.map +1 -0
- package/dist/features/method/commands/index.js +2 -0
- package/dist/features/method/commands/index.js.map +1 -0
- package/dist/features/method/method-api.module.js +23 -0
- package/dist/features/method/method-api.module.js.map +1 -0
- package/dist/features/method/method-api.service.js +47 -0
- package/dist/features/method/method-api.service.js.map +1 -0
- package/dist/features/method/queries/handlers/method-query.handlers.js +115 -0
- package/dist/features/method/queries/handlers/method-query.handlers.js.map +1 -0
- package/dist/features/method/queries/impl/get-pipeline.query.js +7 -0
- package/dist/features/method/queries/impl/get-pipeline.query.js.map +1 -0
- package/dist/features/method/queries/impl/get-role.query.js +7 -0
- package/dist/features/method/queries/impl/get-role.query.js.map +1 -0
- package/dist/features/method/queries/impl/list-pipelines.query.js +7 -0
- package/dist/features/method/queries/impl/list-pipelines.query.js.map +1 -0
- package/dist/features/method/queries/impl/list-playbooks.query.js +7 -0
- package/dist/features/method/queries/impl/list-playbooks.query.js.map +1 -0
- package/dist/features/method/queries/impl/list-roles.query.js +7 -0
- package/dist/features/method/queries/impl/list-roles.query.js.map +1 -0
- package/dist/features/method/queries/index.js +9 -0
- package/dist/features/method/queries/index.js.map +1 -0
- package/dist/features/pr/commands/index.js +2 -0
- package/dist/features/pr/commands/index.js.map +1 -0
- package/dist/features/pr/pr-api.module.js +23 -0
- package/dist/features/pr/pr-api.module.js.map +1 -0
- package/dist/features/pr/pr-api.service.js +35 -0
- package/dist/features/pr/pr-api.service.js.map +1 -0
- package/dist/features/pr/queries/handlers/pr-query.handlers.js +48 -0
- package/dist/features/pr/queries/handlers/pr-query.handlers.js.map +1 -0
- package/dist/features/pr/queries/impl/get-pr-readiness.query.js +7 -0
- package/dist/features/pr/queries/impl/get-pr-readiness.query.js.map +1 -0
- package/dist/features/pr/queries/impl/list-pr-feedback.query.js +7 -0
- package/dist/features/pr/queries/impl/list-pr-feedback.query.js.map +1 -0
- package/dist/features/pr/queries/index.js +3 -0
- package/dist/features/pr/queries/index.js.map +1 -0
- package/dist/features/runs/commands/handlers/runs-command.handlers.js +32 -0
- package/dist/features/runs/commands/handlers/runs-command.handlers.js.map +1 -0
- package/dist/features/runs/commands/impl/create-run.command.js +7 -0
- package/dist/features/runs/commands/impl/create-run.command.js.map +1 -0
- package/dist/features/runs/commands/index.js +3 -0
- package/dist/features/runs/commands/index.js.map +1 -0
- package/dist/features/runs/queries/handlers/runs-query.handlers.js +359 -0
- package/dist/features/runs/queries/handlers/runs-query.handlers.js.map +1 -0
- package/dist/features/runs/queries/impl/get-agent-activity.query.js +7 -0
- package/dist/features/runs/queries/impl/get-agent-activity.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-agent-attempts.query.js +7 -0
- package/dist/features/runs/queries/impl/get-agent-attempts.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-agent-log.query.js +7 -0
- package/dist/features/runs/queries/impl/get-agent-log.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-run-attempts.query.js +7 -0
- package/dist/features/runs/queries/impl/get-run-attempts.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-run-digest.query.js +7 -0
- package/dist/features/runs/queries/impl/get-run-digest.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-run-events.query.js +7 -0
- package/dist/features/runs/queries/impl/get-run-events.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-run-progress.query.js +7 -0
- package/dist/features/runs/queries/impl/get-run-progress.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-run-workflow.query.js +7 -0
- package/dist/features/runs/queries/impl/get-run-workflow.query.js.map +1 -0
- package/dist/features/runs/queries/impl/get-run.query.js +7 -0
- package/dist/features/runs/queries/impl/get-run.query.js.map +1 -0
- package/dist/features/runs/queries/impl/list-runs.query.js +7 -0
- package/dist/features/runs/queries/impl/list-runs.query.js.map +1 -0
- package/dist/features/runs/queries/impl/simulate-route.query.js +7 -0
- package/dist/features/runs/queries/impl/simulate-route.query.js.map +1 -0
- package/dist/features/runs/queries/index.js +15 -0
- package/dist/features/runs/queries/index.js.map +1 -0
- package/dist/features/runs/runs-api.module.js +23 -0
- package/dist/features/runs/runs-api.module.js.map +1 -0
- package/dist/features/runs/runs-api.service.js +79 -0
- package/dist/features/runs/runs-api.service.js.map +1 -0
- package/dist/features/shared/connection.js +39 -0
- package/dist/features/shared/connection.js.map +1 -0
- package/dist/features/system/commands/index.js +2 -0
- package/dist/features/system/commands/index.js.map +1 -0
- package/dist/features/system/queries/handlers/system-query.handlers.js +96 -0
- package/dist/features/system/queries/handlers/system-query.handlers.js.map +1 -0
- package/dist/features/system/queries/impl/doctor.query.js +4 -0
- package/dist/features/system/queries/impl/doctor.query.js.map +1 -0
- package/dist/features/system/queries/impl/get-project.query.js +4 -0
- package/dist/features/system/queries/impl/get-project.query.js.map +1 -0
- package/dist/features/system/queries/impl/get-repository-context.query.js +7 -0
- package/dist/features/system/queries/impl/get-repository-context.query.js.map +1 -0
- package/dist/features/system/queries/impl/get-status.query.js +4 -0
- package/dist/features/system/queries/impl/get-status.query.js.map +1 -0
- package/dist/features/system/queries/impl/validate-repository.query.js +7 -0
- package/dist/features/system/queries/impl/validate-repository.query.js.map +1 -0
- package/dist/features/system/queries/index.js +9 -0
- package/dist/features/system/queries/index.js.map +1 -0
- package/dist/features/system/system-api.module.js +23 -0
- package/dist/features/system/system-api.module.js.map +1 -0
- package/dist/features/system/system-api.service.js +47 -0
- package/dist/features/system/system-api.service.js.map +1 -0
- package/dist/host/daemon.js +99 -0
- package/dist/host/daemon.js.map +1 -0
- package/dist/host/dbos-identity.js +42 -0
- package/dist/host/dbos-identity.js.map +1 -0
- package/dist/host/ensure-host.js +120 -0
- package/dist/host/ensure-host.js.map +1 -0
- package/dist/host/host-runtime.js +90 -0
- package/dist/host/host-runtime.js.map +1 -0
- package/dist/host/host.lifecycle.js +16 -3
- package/dist/host/host.lifecycle.js.map +1 -1
- package/dist/host/queue-ownership.js +70 -0
- package/dist/host/queue-ownership.js.map +1 -0
- package/dist/host/queue-poller-census.js +47 -0
- package/dist/host/queue-poller-census.js.map +1 -0
- package/dist/http/graphql-host.js +56 -0
- package/dist/http/graphql-host.js.map +1 -0
- package/dist/{mcp/mcp.module.js → http/graphql-host.module.js} +12 -10
- package/dist/http/graphql-host.module.js.map +1 -0
- package/dist/infrastructure/metrics/graphql/graphql-metrics.js +91 -0
- package/dist/infrastructure/metrics/graphql/graphql-metrics.js.map +1 -0
- package/dist/mcp/mcp-capabilities.js +9 -1
- package/dist/mcp/mcp-capabilities.js.map +1 -1
- package/dist/mcp/mcp-facade.service.js +68 -5
- package/dist/mcp/mcp-facade.service.js.map +1 -1
- package/dist/mcp/mcp-http.service.js +95 -0
- package/dist/mcp/mcp-http.service.js.map +1 -0
- package/dist/mcp/mcp-tools.js +93 -7
- package/dist/mcp/mcp-tools.js.map +1 -1
- package/dist/observability/agent-activity-reporter.js +185 -0
- package/dist/observability/agent-activity-reporter.js.map +1 -0
- package/dist/observability/agent-observability.service.js +1142 -0
- package/dist/observability/agent-observability.service.js.map +1 -0
- package/dist/observability/index.js +4 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/types.js +11 -0
- package/dist/observability/types.js.map +1 -0
- package/dist/pipeline/await-human.js +8 -4
- package/dist/pipeline/await-human.js.map +1 -1
- package/dist/pipeline/data-driven-task.workflow.js +667 -0
- package/dist/pipeline/data-driven-task.workflow.js.map +1 -0
- package/dist/pipeline/data-driven-template.js +57 -0
- package/dist/pipeline/data-driven-template.js.map +1 -0
- package/dist/pipeline/pipeline.module.js +2 -2
- package/dist/pipeline/pipeline.module.js.map +1 -1
- package/dist/pipeline/pipeline.service.js +412 -0
- package/dist/pipeline/pipeline.service.js.map +1 -0
- package/dist/pipeline/route-contract.js +82 -0
- package/dist/pipeline/route-contract.js.map +1 -0
- package/dist/pipeline-core/index.js +16 -0
- package/dist/pipeline-core/index.js.map +1 -0
- package/dist/pipeline-core/interpret.js +353 -0
- package/dist/pipeline-core/interpret.js.map +1 -0
- package/dist/pipeline-core/kit/assertions.js +61 -0
- package/dist/pipeline-core/kit/assertions.js.map +1 -0
- package/dist/pipeline-core/kit/builders.js +138 -0
- package/dist/pipeline-core/kit/builders.js.map +1 -0
- package/dist/pipeline-core/kit/drive.js +96 -0
- package/dist/pipeline-core/kit/drive.js.map +1 -0
- package/dist/pipeline-core/kit/fixtures.js +342 -0
- package/dist/pipeline-core/kit/fixtures.js.map +1 -0
- package/dist/pipeline-core/kit/index.js +13 -0
- package/dist/pipeline-core/kit/index.js.map +1 -0
- package/dist/pipeline-core/types.js +134 -0
- package/dist/pipeline-core/types.js.map +1 -0
- package/dist/pipeline-core/validate-capability.js +23 -0
- package/dist/pipeline-core/validate-capability.js.map +1 -0
- package/dist/pipeline-core/validate-conflicts.js +37 -0
- package/dist/pipeline-core/validate-conflicts.js.map +1 -0
- package/dist/pipeline-core/validate-dataflow.js +212 -0
- package/dist/pipeline-core/validate-dataflow.js.map +1 -0
- package/dist/pipeline-core/validate-diff.js +158 -0
- package/dist/pipeline-core/validate-diff.js.map +1 -0
- package/dist/pipeline-core/validate-edges.js +44 -0
- package/dist/pipeline-core/validate-edges.js.map +1 -0
- package/dist/pipeline-core/validate-graph.js +123 -0
- package/dist/pipeline-core/validate-graph.js.map +1 -0
- package/dist/pipeline-core/validate-loops.js +226 -0
- package/dist/pipeline-core/validate-loops.js.map +1 -0
- package/dist/pipeline-core/validate-parallel.js +132 -0
- package/dist/pipeline-core/validate-parallel.js.map +1 -0
- package/dist/pipeline-core/validate-sink.js +27 -0
- package/dist/pipeline-core/validate-sink.js.map +1 -0
- package/dist/pipeline-core/validate-topology.js +140 -0
- package/dist/pipeline-core/validate-topology.js.map +1 -0
- package/dist/pipeline-core/validate-verdict.js +72 -0
- package/dist/pipeline-core/validate-verdict.js.map +1 -0
- package/dist/pipeline-core/validate.js +119 -0
- package/dist/pipeline-core/validate.js.map +1 -0
- package/dist/playbook/catalog-loader.js +14 -1
- package/dist/playbook/catalog-loader.js.map +1 -1
- package/dist/playbook/import-mapper.js +14 -38
- package/dist/playbook/import-mapper.js.map +1 -1
- package/dist/playbook/manifest.js +1 -1
- package/dist/revisium/playbooks.service.js +107 -19
- package/dist/revisium/playbooks.service.js.map +1 -1
- package/dist/revisium/roles.service.js +1 -1
- package/dist/revisium/roles.service.js.map +1 -1
- package/dist/revisium/run.service.js +55 -8
- package/dist/revisium/run.service.js.map +1 -1
- package/dist/run/append-event.js +24 -1
- package/dist/run/append-event.js.map +1 -1
- package/dist/run/block-run.js +17 -0
- package/dist/run/block-run.js.map +1 -0
- package/dist/run/complete-run.js +18 -0
- package/dist/run/complete-run.js.map +1 -0
- package/dist/run/create-run.js +33 -36
- package/dist/run/create-run.js.map +1 -1
- package/dist/run/inspect-run.js +31 -30
- package/dist/run/inspect-run.js.map +1 -1
- package/dist/run/run-outputs.js +88 -0
- package/dist/run/run-outputs.js.map +1 -0
- package/dist/run/terminal-run-status.js +66 -7
- package/dist/run/terminal-run-status.js.map +1 -1
- package/dist/runners/claude-code.service.js +5 -0
- package/dist/runners/claude-code.service.js.map +1 -1
- package/dist/runners/codex.service.js +51 -0
- package/dist/runners/codex.service.js.map +1 -0
- package/dist/runners/integrator-branch-naming.js +39 -0
- package/dist/runners/integrator-branch-naming.js.map +1 -0
- package/dist/runners/integrator-git.js +84 -0
- package/dist/runners/integrator-git.js.map +1 -0
- package/dist/runners/integrator-remote.js +34 -0
- package/dist/runners/integrator-remote.js.map +1 -0
- package/dist/runners/integrator-types.js +9 -0
- package/dist/runners/integrator-types.js.map +1 -0
- package/dist/runners/integrator.js +327 -147
- package/dist/runners/integrator.js.map +1 -1
- package/dist/runners/runner.module.js +7 -3
- package/dist/runners/runner.module.js.map +1 -1
- package/dist/runners/worktree.service.js +63 -0
- package/dist/runners/worktree.service.js.map +1 -0
- package/dist/smoke/cli.js +47 -0
- package/dist/smoke/cli.js.map +1 -0
- package/dist/smoke/isolation.js +113 -0
- package/dist/smoke/isolation.js.map +1 -0
- package/dist/task-control-plane/run-watch.service.js +281 -0
- package/dist/task-control-plane/run-watch.service.js.map +1 -0
- package/dist/task-control-plane/task-control-plane-api.service.js +569 -23
- package/dist/task-control-plane/task-control-plane-api.service.js.map +1 -1
- package/dist/task-control-plane/task-control-plane.module.js +22 -3
- package/dist/task-control-plane/task-control-plane.module.js.map +1 -1
- package/dist/worker/artifact-store.js +116 -0
- package/dist/worker/artifact-store.js.map +1 -0
- package/dist/worker/build-context.js +169 -2
- package/dist/worker/build-context.js.map +1 -1
- package/dist/worker/claude-code-runner.js +159 -68
- package/dist/worker/claude-code-runner.js.map +1 -1
- package/dist/worker/codex-runner.js +474 -0
- package/dist/worker/codex-runner.js.map +1 -0
- package/dist/worker/git-worktree-manager.js +129 -65
- package/dist/worker/git-worktree-manager.js.map +1 -1
- package/dist/worker/process-executor.js +23 -2
- package/dist/worker/process-executor.js.map +1 -1
- package/dist/worker/result-envelope.js +115 -57
- package/dist/worker/result-envelope.js.map +1 -1
- package/dist/worker/runner-common.js +106 -0
- package/dist/worker/runner-common.js.map +1 -0
- package/dist/worker/runner-dispatch.js +4 -1
- package/dist/worker/runner-dispatch.js.map +1 -1
- package/dist/worker/runner.js +11 -1
- package/dist/worker/runner.js.map +1 -1
- package/dist/worker/stub-runner.js +7 -45
- package/dist/worker/stub-runner.js.map +1 -1
- package/package.json +32 -7
- package/dist/app.module.js +0 -28
- package/dist/app.module.js.map +0 -1
- package/dist/cli/commands/bootstrap.js +0 -39
- package/dist/cli/commands/bootstrap.js.map +0 -1
- package/dist/cli/commands/dev.js +0 -143
- package/dist/cli/commands/dev.js.map +0 -1
- package/dist/cli/commands/inbox.js +0 -288
- package/dist/cli/commands/inbox.js.map +0 -1
- package/dist/cli/commands/playbook.js +0 -74
- package/dist/cli/commands/playbook.js.map +0 -1
- package/dist/cli/commands/poll-workflow-state.js +0 -144
- package/dist/cli/commands/poll-workflow-state.js.map +0 -1
- package/dist/cli/commands/revisium-context.js +0 -23
- package/dist/cli/commands/revisium-context.js.map +0 -1
- package/dist/cli/commands/revisium.js +0 -89
- package/dist/cli/commands/revisium.js.map +0 -1
- package/dist/cli/commands/run.js +0 -426
- package/dist/cli/commands/run.js.map +0 -1
- package/dist/cli/commands/work.js +0 -149
- package/dist/cli/commands/work.js.map +0 -1
- package/dist/cli/live-guard.js +0 -49
- package/dist/cli/live-guard.js.map +0 -1
- package/dist/cli/needs-host.js +0 -78
- package/dist/cli/needs-host.js.map +0 -1
- package/dist/mcp/mcp-stdio.service.js +0 -48
- package/dist/mcp/mcp-stdio.service.js.map +0 -1
- package/dist/mcp/mcp.module.js.map +0 -1
- package/dist/pipeline/develop-task.workflow.js +0 -497
- package/dist/pipeline/develop-task.workflow.js.map +0 -1
- package/dist/worker/loop.js +0 -122
- package/dist/worker/loop.js.map +0 -1
- package/dist/worker/script-runner.js +0 -28
- package/dist/worker/script-runner.js.map +0 -1
- package/dist/worker/worker-id.js +0 -18
- package/dist/worker/worker-id.js.map +0 -1
- package/dist/worker/worktree-manager.js +0 -7
- package/dist/worker/worktree-manager.js.map +0 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pipeline-core/kit/builders.ts — fluent helpers for writing templates in tests.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the readability of the e2e kit: a test builds a `Template` declaratively instead of hand-
|
|
5
|
+
* writing the verbose discriminated-union literals. Builders apply NO semantics — they only assemble
|
|
6
|
+
* data; `validateTemplate` is the single source of truth. Intentionally permissive so INVALID
|
|
7
|
+
* fixtures can be expressed (e.g. omit a default, point an edge nowhere).
|
|
8
|
+
*/
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Condition shorthands — read like the spec (§3).
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
export const verdictEq = (value) => ({ op: 'verdict.eq', value });
|
|
13
|
+
export const verdictIn = (...value) => ({ op: 'verdict.in', value });
|
|
14
|
+
export const counterLt = (scope, value) => ({ op: 'counter.lt', scope, value });
|
|
15
|
+
export const counterGte = (scope, value) => ({ op: 'counter.gte', scope, value });
|
|
16
|
+
export const allOf = (...of) => ({ op: 'all', of });
|
|
17
|
+
export const anyOf = (...of) => ({ op: 'any', of });
|
|
18
|
+
export const notCond = (cond) => ({ op: 'not', cond });
|
|
19
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
// Branch shorthands.
|
|
21
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
22
|
+
export const on = (when, goto) => ({ when, goto });
|
|
23
|
+
export const otherwise = (goto) => ({ default: goto });
|
|
24
|
+
export const node = {
|
|
25
|
+
agent(id, roleRef, next, opts = {}) {
|
|
26
|
+
return { id, kind: 'agent', roleRef, next, ...effect(opts) };
|
|
27
|
+
},
|
|
28
|
+
script(id, scriptRef, next, opts = {}) {
|
|
29
|
+
return { id, kind: 'script', scriptRef, next, ...effect(opts) };
|
|
30
|
+
},
|
|
31
|
+
humanGate(id, reason, outcomes, branches, opts = {}) {
|
|
32
|
+
return {
|
|
33
|
+
id,
|
|
34
|
+
kind: 'humanGate',
|
|
35
|
+
reason,
|
|
36
|
+
outcomes,
|
|
37
|
+
branches,
|
|
38
|
+
...(opts.timeout ? { timeout: opts.timeout } : {}),
|
|
39
|
+
...(opts.incrementCounters ? { incrementCounters: opts.incrementCounters } : {}),
|
|
40
|
+
...(opts.displayName ? { displayName: opts.displayName } : {}),
|
|
41
|
+
...(opts.gatedArtifact ? { gatedArtifact: opts.gatedArtifact } : {}),
|
|
42
|
+
...(opts.verdictFrom ? { verdictFrom: opts.verdictFrom } : {}),
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
choice(id, branches, opts = {}) {
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
kind: 'choice',
|
|
49
|
+
branches,
|
|
50
|
+
...(opts.incrementCounters ? { incrementCounters: opts.incrementCounters } : {}),
|
|
51
|
+
...(opts.displayName ? { displayName: opts.displayName } : {}),
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
parallel(id, branches, join, opts = {}) {
|
|
55
|
+
return { id, kind: 'parallel', branches, join, ...(opts.displayName ? { displayName: opts.displayName } : {}) };
|
|
56
|
+
},
|
|
57
|
+
join(id, joinMode, next, opts = {}) {
|
|
58
|
+
return {
|
|
59
|
+
id,
|
|
60
|
+
kind: 'join',
|
|
61
|
+
joinMode,
|
|
62
|
+
next,
|
|
63
|
+
...(opts.merge ? { merge: opts.merge } : {}),
|
|
64
|
+
...(opts.displayName ? { displayName: opts.displayName } : {}),
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
wait(id, duration, next, opts = {}) {
|
|
68
|
+
return { id, kind: 'wait', duration, next, ...(opts.displayName ? { displayName: opts.displayName } : {}) };
|
|
69
|
+
},
|
|
70
|
+
terminal(id, status, opts = {}) {
|
|
71
|
+
return { id, kind: 'terminal', status, ...(opts.displayName ? { displayName: opts.displayName } : {}) };
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
function effect(opts) {
|
|
75
|
+
return {
|
|
76
|
+
...(opts.catch ? { catch: opts.catch } : {}),
|
|
77
|
+
...(opts.onFailure ? { onFailure: opts.onFailure } : {}),
|
|
78
|
+
...(opts.escalateTo ? { escalateTo: opts.escalateTo } : {}),
|
|
79
|
+
...(opts.resultSchema ? { resultSchema: opts.resultSchema } : {}),
|
|
80
|
+
...(opts.incrementCounters ? { incrementCounters: opts.incrementCounters } : {}),
|
|
81
|
+
...(opts.displayName ? { displayName: opts.displayName } : {}),
|
|
82
|
+
...(opts.produces ? { produces: opts.produces } : {}),
|
|
83
|
+
...(opts.consumes ? { consumes: opts.consumes } : {}),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
87
|
+
// Join-mode shorthands.
|
|
88
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
89
|
+
export const joinAll = () => ({ kind: 'all' });
|
|
90
|
+
export const joinAny = () => ({ kind: 'any' });
|
|
91
|
+
export const joinQuorum = (count) => ({ kind: 'quorum', count });
|
|
92
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
93
|
+
// Template builder — `template().entry(...).domain(...).scope(...).add(...).build()`.
|
|
94
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
95
|
+
export class TemplateBuilder {
|
|
96
|
+
t;
|
|
97
|
+
constructor(pipelineId) {
|
|
98
|
+
this.t = { specVersion: '1.0', pipelineId, entry: '', verdicts: { domain: [] }, nodes: {} };
|
|
99
|
+
}
|
|
100
|
+
specVersion(v) {
|
|
101
|
+
this.t.specVersion = v;
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
title(title) {
|
|
105
|
+
this.t.title = title;
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
entry(id) {
|
|
109
|
+
this.t.entry = id;
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
domain(...labels) {
|
|
113
|
+
this.t.verdicts = { domain: labels };
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
policy(policy) {
|
|
117
|
+
this.t.policy = policy;
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
scope(id, scope) {
|
|
121
|
+
this.t.scopes ??= {};
|
|
122
|
+
this.t.scopes[id] = scope;
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
add(...nodes) {
|
|
126
|
+
for (const n of nodes)
|
|
127
|
+
this.t.nodes[n.id] = n;
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
build() {
|
|
131
|
+
// Return a deep-ish clone so a fixture can be mutated by a diff test without leaking.
|
|
132
|
+
return structuredClone(this.t);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export function template(pipelineId) {
|
|
136
|
+
return new TemplateBuilder(pipelineId);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/pipeline-core/kit/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsBH,gFAAgF;AAChF,kDAAkD;AAClD,gFAAgF;AAEhF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAa,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GA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,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,CAAC,MAAsB;QAC3B,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,EAAU,EAAE,KAAY;QAC5B,IAAI,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,GAAG,CAAC,GAAG,KAAa;QAClB,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK;QACH,sFAAsF;QACtF,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;CACF;AAED,MAAM,UAAU,QAAQ,CAAC,UAAkB;IACzC,OAAO,IAAI,eAAe,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pipeline-core/kit/drive.ts — run `step()` to a terminal, feeding scripted results.
|
|
3
|
+
*
|
|
4
|
+
* The readability counterpart of the e2e `drive`: a test names the verdict each agent/gate produces
|
|
5
|
+
* and `drive` walks the interpreter to completion, recording the visited path of effect/gate/terminal
|
|
6
|
+
* nodes. This keeps interpreter tests declarative ("reviewer BLOCKER ×3 → blocked at the cap") instead
|
|
7
|
+
* of hand-threading `step()` calls and `RunState`.
|
|
8
|
+
*
|
|
9
|
+
* Scripted results are keyed by NODE ID and consumed one-per-visit (arrays clamp to the last entry,
|
|
10
|
+
* mirroring the e2e AgentSpec), so a node hit N times in a loop can yield a different verdict each pass.
|
|
11
|
+
*/
|
|
12
|
+
import { initialState, step } from '../interpret.js';
|
|
13
|
+
const MAX_STEPS = 1000; // a VALID template always terminates; this guards a test-authoring mistake.
|
|
14
|
+
/**
|
|
15
|
+
* Drive `template` from its initial state to a terminal, feeding each emitted Decision the scripted
|
|
16
|
+
* result for its node. Throws if a non-terminal Decision has no script entry, or if it runs away.
|
|
17
|
+
*/
|
|
18
|
+
export function drive(template, script = {}) {
|
|
19
|
+
const visits = new Map();
|
|
20
|
+
const joinVisits = new Map();
|
|
21
|
+
const trace = [];
|
|
22
|
+
const path = [];
|
|
23
|
+
let state = initialState(template);
|
|
24
|
+
let lastResult;
|
|
25
|
+
for (let i = 0; i < MAX_STEPS; i++) {
|
|
26
|
+
const out = step(template, state, lastResult);
|
|
27
|
+
state = out.state;
|
|
28
|
+
const decision = out.decision;
|
|
29
|
+
// For `complete` the cursor sits on the node that completed (terminal, or an aborting effect);
|
|
30
|
+
// every other Decision carries its own nodeId.
|
|
31
|
+
const nodeId = decision.type === 'complete' ? soleActive(state) : decision.nodeId;
|
|
32
|
+
trace.push({ nodeId, decision: decision.type });
|
|
33
|
+
path.push(nodeId);
|
|
34
|
+
if (decision.type === 'complete') {
|
|
35
|
+
return { status: decision.status, path, trace, counters: { ...state.scopedCounters } };
|
|
36
|
+
}
|
|
37
|
+
if (decision.type === 'fork') {
|
|
38
|
+
// The adapter runs the branches concurrently and records arrivals (§4); the core never sees the
|
|
39
|
+
// live race. We model that by jumping the cursor to the JOIN and feeding the arrivals scripted
|
|
40
|
+
// on the join node, so the next step aggregates a recorded result. A missing join script with
|
|
41
|
+
// mode `all` synthesizes one arrival per branch (verdict undefined) so the barrier is satisfied.
|
|
42
|
+
const arrivals = joinArrivalsFor(script, decision.joinId, decision.branches.map((b) => b.id), joinVisits);
|
|
43
|
+
state = { ...state, activeNodeIds: new Set([decision.joinId]) };
|
|
44
|
+
lastResult = { joinArrivals: arrivals };
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
// Resolve the scripted result for THIS node's effect and feed it as the next lastResult.
|
|
48
|
+
lastResult = resultFor(script, nodeId, decision, visits);
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`drive: ${template.pipelineId} did not terminate within ${MAX_STEPS} steps (script gap or loop)`);
|
|
51
|
+
}
|
|
52
|
+
function soleActive(state) {
|
|
53
|
+
return [...state.activeNodeIds][0] ?? '<none>';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Recorded arrivals for a join: from the script entry on the join node, else one per branch. Like
|
|
57
|
+
* `resultFor`, an ARRAY entry is consumed one-per-visit (clamped) so a join hit repeatedly in a loop can
|
|
58
|
+
* yield a different recorded aggregation each pass; a single entry is reused every visit.
|
|
59
|
+
*/
|
|
60
|
+
function joinArrivalsFor(script, joinId, branchIds, joinVisits) {
|
|
61
|
+
const n = joinVisits.get(joinId) ?? 0;
|
|
62
|
+
joinVisits.set(joinId, n + 1);
|
|
63
|
+
const entry = script[joinId];
|
|
64
|
+
const picked = Array.isArray(entry) ? entry[Math.min(n, entry.length - 1)] : entry;
|
|
65
|
+
if (picked && typeof picked === 'object' && 'joinArrivals' in picked)
|
|
66
|
+
return picked.joinArrivals;
|
|
67
|
+
return branchIds.map((branchId, i) => ({ branchId, seq: i + 1 }));
|
|
68
|
+
}
|
|
69
|
+
function resultFor(script, nodeId, _decision, visits) {
|
|
70
|
+
const n = visits.get(nodeId) ?? 0;
|
|
71
|
+
visits.set(nodeId, n + 1);
|
|
72
|
+
const entry = script[nodeId];
|
|
73
|
+
if (entry === undefined) {
|
|
74
|
+
// A gate/effect with no script: assume structural success with no domain verdict (e.g. a script
|
|
75
|
+
// node that just proceeds). Tests that route on a verdict must script it. `_decision` is unused
|
|
76
|
+
// here but kept in the signature so a future kind-specific default can branch on it.
|
|
77
|
+
return {};
|
|
78
|
+
}
|
|
79
|
+
const picked = Array.isArray(entry) ? (entry[Math.min(n, entry.length - 1)] ?? {}) : entry;
|
|
80
|
+
return normalize(picked);
|
|
81
|
+
}
|
|
82
|
+
function normalize(r) {
|
|
83
|
+
if (typeof r === 'string')
|
|
84
|
+
return { verdict: r, outcome: 'succeeded' };
|
|
85
|
+
if ('joinArrivals' in r)
|
|
86
|
+
return { joinArrivals: r.joinArrivals };
|
|
87
|
+
const out = {};
|
|
88
|
+
if (r.verdict !== undefined)
|
|
89
|
+
out.verdict = r.verdict;
|
|
90
|
+
if (r.outcome !== undefined)
|
|
91
|
+
out.outcome = r.outcome;
|
|
92
|
+
if (r.errorCode !== undefined)
|
|
93
|
+
out.errorCode = r.errorCode;
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=drive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive.js","sourceRoot":"","sources":["../../../src/pipeline-core/kit/drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AA0BrD,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,4EAA4E;AAEpG;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,QAAkB,EAAE,SAAsB,EAAE;IAChE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC7C,MAAM,KAAK,GAAY,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,IAAI,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,UAAkC,CAAC;IAEvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAC9C,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QA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AAC;IAC7B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,gGAAgG;QAChG,gGAAgG;QAChG,qFAAqF;QACrF,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3F,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,SAAS,CAAC,CAAiB;IAClC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IACvE,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;IACjE,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS;QAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;IACrD,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS;QAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;IACrD,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS;QAAE,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC;IAC3D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pipeline-core/kit/fixtures.ts — typed Template fixtures (the e2e-style "real pipelines" + targeted).
|
|
3
|
+
*
|
|
4
|
+
* `featureDevelopment` is the §13 canonical example, transcribed faithfully to a typed `Template`.
|
|
5
|
+
* `localChange` is its no-gate sibling (§13 footnote). The rest are small, single-purpose fixtures:
|
|
6
|
+
* nested-scope loops, a parallel/join, and one INVALID template per §12 rule (each named for the rule
|
|
7
|
+
* + diagnostic it is designed to trip), so validation tests read as a rule catalogue.
|
|
8
|
+
*/
|
|
9
|
+
import { allOf, counterGte, counterLt, joinAll, joinAny, joinQuorum, node, on, otherwise, template, verdictEq, } from './builders.js';
|
|
10
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
// §13 — feature-development (the canonical example).
|
|
12
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
export function featureDevelopment() {
|
|
14
|
+
return template('feature-development')
|
|
15
|
+
.title('Feature development with plan + merge gates and bounded rework')
|
|
16
|
+
.specVersion('1.0')
|
|
17
|
+
.entry('analyst')
|
|
18
|
+
.domain('approved', 'changes_requested', 'blocker', 'clean', 'dirty')
|
|
19
|
+
.policy({ conflicts: [['developer', 'reviewer']], enforcement: 'strict' })
|
|
20
|
+
.scope('codeReviewLoop', { cap: 3, parent: null })
|
|
21
|
+
.add(node.agent('analyst', 'role:analyst', 'planGate', { resultSchema: 'schema:plan', onFailure: 'abort' }), node.humanGate('planGate', 'plan-review', ['approved', 'changes_requested'], [
|
|
22
|
+
on(verdictEq('approved'), 'developer'),
|
|
23
|
+
on(verdictEq('changes_requested'), 'analyst'),
|
|
24
|
+
otherwise('blockedEnd'),
|
|
25
|
+
]), node.agent('developer', 'role:developer', 'codeReview', { resultSchema: 'schema:change', onFailure: 'abort' }), node.agent('codeReview', 'role:reviewer', 'codeReviewRouter', {
|
|
26
|
+
resultSchema: 'schema:reviewVerdict',
|
|
27
|
+
onFailure: 'abort',
|
|
28
|
+
}), node.choice('codeReviewRouter', [
|
|
29
|
+
on(verdictEq('approved'), 'integrator'),
|
|
30
|
+
on(allOf(verdictEq('blocker'), counterLt('codeReviewLoop', 3)), 'reworkDeveloper'),
|
|
31
|
+
otherwise('blockedEnd'),
|
|
32
|
+
]), node.agent('reworkDeveloper', 'role:developer', 'codeReview', {
|
|
33
|
+
resultSchema: 'schema:change',
|
|
34
|
+
incrementCounters: ['codeReviewLoop'],
|
|
35
|
+
onFailure: 'abort',
|
|
36
|
+
}), node.script('integrator', 'script:integrator', 'watcherPost', {
|
|
37
|
+
resultSchema: 'schema:integration',
|
|
38
|
+
onFailure: 'route',
|
|
39
|
+
catch: [{ onError: 'revo.ScriptFailed', goto: 'failedEnd' }],
|
|
40
|
+
}), node.agent('watcherPost', 'role:watcher', 'watcherRouter', {
|
|
41
|
+
resultSchema: 'schema:watchVerdict',
|
|
42
|
+
onFailure: 'abort',
|
|
43
|
+
}), node.choice('watcherRouter', [on(verdictEq('clean'), 'mergeGate'), otherwise('failedEnd')]), node.humanGate('mergeGate', 'merge-review', ['approved', 'changes_requested'], [
|
|
44
|
+
on(verdictEq('approved'), 'mergedEnd'),
|
|
45
|
+
otherwise('blockedEnd'),
|
|
46
|
+
]), node.terminal('mergedEnd', 'succeeded'), node.terminal('failedEnd', 'failed'), node.terminal('blockedEnd', 'blocked'))
|
|
47
|
+
.build();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* confirmMergeFlow — minimal fixture exercising the `script:confirmMerge` node (plan 0017 follow-up):
|
|
51
|
+
* entry → confirmMerge → mergedEnd, with catch routing a block to `blockedEnd` and a throw to `failedEnd`.
|
|
52
|
+
* Used to assert the adapter routes a merged result to a SUCCEEDED terminal (worktree released) and a
|
|
53
|
+
* not-merged block to a BLOCKED terminal (worktree kept).
|
|
54
|
+
*/
|
|
55
|
+
export function confirmMergeFlow() {
|
|
56
|
+
return template('confirm-merge-flow')
|
|
57
|
+
.title('confirmMerge → merged (succeeded) / not-merged (blocked) — plan 0017 test fixture')
|
|
58
|
+
.specVersion('1.0')
|
|
59
|
+
.entry('confirmMerge')
|
|
60
|
+
.domain('approved', 'clean', 'blocker', 'changes_requested')
|
|
61
|
+
.add(node.script('confirmMerge', 'script:confirmMerge', 'mergedEnd', {
|
|
62
|
+
resultSchema: 'schema:integration',
|
|
63
|
+
onFailure: 'route',
|
|
64
|
+
catch: [
|
|
65
|
+
{ onError: 'revo.ScriptBlocked', goto: 'blockedEnd' },
|
|
66
|
+
{ onError: 'revo.ScriptFailed', goto: 'failedEnd' },
|
|
67
|
+
],
|
|
68
|
+
}), node.terminal('mergedEnd', 'succeeded'), node.terminal('blockedEnd', 'blocked'), node.terminal('failedEnd', 'failed'))
|
|
69
|
+
.build();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* featureDevelopmentPrReview — the plan 0018 PR review-feedback loop, transcribed to a typed Template.
|
|
73
|
+
* Mirrors the seeded `feature-development` tail: after the integrator opens the PR, `pollPr` observes +
|
|
74
|
+
* classifies (review_changes > ci_changes > clean); review comments go through analyst `triage`
|
|
75
|
+
* (fix/wontfix/question) with a separate question gate; CI failures loop the developer; fixes are
|
|
76
|
+
* re-pushed BEFORE `respondThreads` replies + resolves (so the reply carries the fix sha). Used by the
|
|
77
|
+
* data-driven adapter unit tests; the live JSON template (default + e2e fixture) carries the same tail.
|
|
78
|
+
*/
|
|
79
|
+
export function featureDevelopmentPrReview() {
|
|
80
|
+
return template('feature-development-pr-review')
|
|
81
|
+
.title('Feature development with a PR review-feedback loop (plan 0018)')
|
|
82
|
+
.specVersion('1.0')
|
|
83
|
+
.entry('analyst')
|
|
84
|
+
.domain('approved', 'changes_requested', 'blocker', 'clean', 'review_changes', 'ci_changes', 'fix', 'wontfix', 'question')
|
|
85
|
+
.policy({ conflicts: [['developer', 'reviewer']], enforcement: 'strict' })
|
|
86
|
+
.scope('codeReviewLoop', { cap: 3, parent: null })
|
|
87
|
+
.scope('ciLoop', { cap: 3, parent: null })
|
|
88
|
+
.scope('reviewLoop', { cap: 3, parent: null })
|
|
89
|
+
.scope('questionLoop', { cap: 3, parent: null })
|
|
90
|
+
.add(node.agent('analyst', 'role:analyst', 'planGate', { resultSchema: 'schema:plan', onFailure: 'abort', produces: { name: 'plan' } }), node.humanGate('planGate', 'plan-review', ['approved', 'changes_requested'], [
|
|
91
|
+
on(verdictEq('approved'), 'developer'),
|
|
92
|
+
on(verdictEq('changes_requested'), 'analyst'),
|
|
93
|
+
otherwise('blockedEnd'),
|
|
94
|
+
]), node.agent('developer', 'role:developer', 'codeReview', { resultSchema: 'schema:change', onFailure: 'abort' }), node.agent('codeReview', 'role:reviewer', 'codeReviewRouter', { resultSchema: 'schema:reviewVerdict', onFailure: 'abort' }), node.choice('codeReviewRouter', [
|
|
95
|
+
on(verdictEq('approved'), 'integrator'),
|
|
96
|
+
on(allOf(verdictEq('blocker'), counterLt('codeReviewLoop', 3)), 'reworkDeveloper'),
|
|
97
|
+
otherwise('blockedEnd'),
|
|
98
|
+
]), node.agent('reworkDeveloper', 'role:developer', 'codeReview', { resultSchema: 'schema:change', incrementCounters: ['codeReviewLoop'], onFailure: 'abort' }), node.script('integrator', 'script:integrator', 'pollPr', {
|
|
99
|
+
resultSchema: 'schema:integration', onFailure: 'route',
|
|
100
|
+
catch: [{ onError: 'revo.ScriptFailed', goto: 'failedEnd' }],
|
|
101
|
+
}),
|
|
102
|
+
// ── plan 0018 — observe the PR, classify, route by feedback type ──
|
|
103
|
+
node.script('pollPr', 'script:pollPr', 'prRouter', {
|
|
104
|
+
resultSchema: 'schema:prFeedback', onFailure: 'route', produces: { name: 'prFeedback' },
|
|
105
|
+
catch: [{ onError: 'revo.ScriptBlocked', goto: 'blockedEnd' }, { onError: 'revo.ScriptFailed', goto: 'failedEnd' }],
|
|
106
|
+
}), node.choice('prRouter', [
|
|
107
|
+
on(verdictEq('clean'), 'mergeGate'),
|
|
108
|
+
on(verdictEq('review_changes'), 'triage'),
|
|
109
|
+
on(allOf(verdictEq('ci_changes'), counterLt('ciLoop', 3)), 'ciRework'),
|
|
110
|
+
otherwise('blockedEnd'),
|
|
111
|
+
]), node.agent('ciRework', 'role:developer', 'integrator', {
|
|
112
|
+
resultSchema: 'schema:change', incrementCounters: ['ciLoop'], onFailure: 'abort',
|
|
113
|
+
consumes: [{ node: 'pollPr', as: 'feedback' }],
|
|
114
|
+
}), node.agent('triage', 'role:triager', 'triageRouter', {
|
|
115
|
+
resultSchema: 'schema:triage', onFailure: 'abort', produces: { name: 'triage' },
|
|
116
|
+
consumes: [{ node: 'analyst', as: 'plan', staleOk: true }, { node: 'pollPr', as: 'feedback' }],
|
|
117
|
+
}), node.choice('triageRouter', [
|
|
118
|
+
on(allOf(verdictEq('question'), counterLt('questionLoop', 3)), 'questionGate'),
|
|
119
|
+
on(allOf(verdictEq('fix'), counterLt('reviewLoop', 3)), 'reviewRework'),
|
|
120
|
+
on(verdictEq('wontfix'), 'respondThreads'),
|
|
121
|
+
otherwise('blockedEnd'),
|
|
122
|
+
]), node.humanGate('questionGate', 'review-question', ['approved', 'changes_requested'], [
|
|
123
|
+
on(verdictEq('approved'), 'triage'),
|
|
124
|
+
otherwise('blockedEnd'),
|
|
125
|
+
], { incrementCounters: ['questionLoop'] }), node.agent('reviewRework', 'role:developer', 'reviewIntegrator', {
|
|
126
|
+
resultSchema: 'schema:change', incrementCounters: ['reviewLoop'], onFailure: 'abort',
|
|
127
|
+
consumes: [{ node: 'triage', as: 'triage' }],
|
|
128
|
+
}), node.script('reviewIntegrator', 'script:integrator', 'respondThreads', {
|
|
129
|
+
resultSchema: 'schema:integration', onFailure: 'route',
|
|
130
|
+
catch: [{ onError: 'revo.ScriptBlocked', goto: 'blockedEnd' }, { onError: 'revo.ScriptFailed', goto: 'failedEnd' }],
|
|
131
|
+
}), node.script('respondThreads', 'script:respondThreads', 'pollPr', {
|
|
132
|
+
resultSchema: 'schema:respond', onFailure: 'route', consumes: [{ node: 'triage', as: 'triage' }],
|
|
133
|
+
catch: [{ onError: 'revo.ScriptBlocked', goto: 'blockedEnd' }, { onError: 'revo.ScriptFailed', goto: 'failedEnd' }],
|
|
134
|
+
}), node.humanGate('mergeGate', 'merge-review', ['approved', 'changes_requested'], [
|
|
135
|
+
on(verdictEq('approved'), 'confirmMerge'),
|
|
136
|
+
otherwise('blockedEnd'),
|
|
137
|
+
]), node.script('confirmMerge', 'script:confirmMerge', 'mergedEnd', {
|
|
138
|
+
resultSchema: 'schema:integration', onFailure: 'route',
|
|
139
|
+
catch: [{ onError: 'revo.ScriptBlocked', goto: 'blockedEnd' }, { onError: 'revo.ScriptFailed', goto: 'failedEnd' }],
|
|
140
|
+
}), node.terminal('mergedEnd', 'succeeded'), node.terminal('failedEnd', 'failed'), node.terminal('blockedEnd', 'blocked'))
|
|
141
|
+
.build();
|
|
142
|
+
}
|
|
143
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
144
|
+
// §13 footnote — local-change (orchestrator + developer, NO humanGate).
|
|
145
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
146
|
+
export function localChange() {
|
|
147
|
+
return template('local-change')
|
|
148
|
+
.title('Local change — orchestrator + developer, no gate')
|
|
149
|
+
.entry('orchestrator')
|
|
150
|
+
.domain('approved')
|
|
151
|
+
.add(node.agent('orchestrator', 'role:orchestrator', 'developer', { resultSchema: 'schema:plan' }), node.agent('developer', 'role:developer', 'doneEnd', { resultSchema: 'schema:change' }), node.terminal('doneEnd', 'succeeded'))
|
|
152
|
+
.build();
|
|
153
|
+
}
|
|
154
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
155
|
+
// Targeted — a nested-scope rework loop (inner loop resets on outer re-entry, §7).
|
|
156
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
157
|
+
/**
|
|
158
|
+
* outer (cap 2) ⊃ inner (cap 2). `outerWork` increments `outer` (and resets `inner`); `innerWork`
|
|
159
|
+
* increments `inner`. The inner cap routes back to the outer loop; the outer cap routes to blocked.
|
|
160
|
+
*/
|
|
161
|
+
export function nestedScopeLoop() {
|
|
162
|
+
return template('nested-scope-loop')
|
|
163
|
+
.entry('start')
|
|
164
|
+
.domain('redo_inner', 'redo_outer', 'done')
|
|
165
|
+
.scope('outer', { cap: 2, parent: null })
|
|
166
|
+
.scope('inner', { cap: 2, parent: 'outer' })
|
|
167
|
+
.add(node.agent('start', 'role:worker', 'innerWork'), node.agent('innerWork', 'role:worker', 'innerRouter', { incrementCounters: ['inner'] }), node.choice('innerRouter', [
|
|
168
|
+
on(verdictEq('done'), 'doneEnd'),
|
|
169
|
+
on(allOf(verdictEq('redo_inner'), counterLt('inner', 2)), 'innerWork'),
|
|
170
|
+
on(counterGte('inner', 2), 'outerRouter'),
|
|
171
|
+
otherwise('blockedEnd'),
|
|
172
|
+
]), node.choice('outerRouter', [
|
|
173
|
+
on(counterLt('outer', 2), 'outerWork'),
|
|
174
|
+
otherwise('blockedEnd'),
|
|
175
|
+
]), node.agent('outerWork', 'role:worker', 'innerWork', { incrementCounters: ['outer'] }), node.terminal('doneEnd', 'succeeded'), node.terminal('blockedEnd', 'blocked'))
|
|
176
|
+
.build();
|
|
177
|
+
}
|
|
178
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
179
|
+
// Targeted — a parallel/join (two review branches → join → terminal).
|
|
180
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
181
|
+
/** Map a join-mode kind to its `JoinMode` (quorum fixed at 2 for this fan-out shape). */
|
|
182
|
+
function joinModeFromKind(kind) {
|
|
183
|
+
if (kind === 'all')
|
|
184
|
+
return joinAll();
|
|
185
|
+
if (kind === 'any')
|
|
186
|
+
return joinAny();
|
|
187
|
+
return joinQuorum(2);
|
|
188
|
+
}
|
|
189
|
+
/** `joinModeKind` selects `all` (default), `any`, or `quorum{2}` on the same fan-out shape. */
|
|
190
|
+
export function parallelReview(joinModeKind = 'all') {
|
|
191
|
+
const mode = joinModeFromKind(joinModeKind);
|
|
192
|
+
return template('parallel-review')
|
|
193
|
+
.entry('fanout')
|
|
194
|
+
.domain('clean', 'dirty', 'approved')
|
|
195
|
+
.add(node.parallel('fanout', [
|
|
196
|
+
{ id: 'sec', entry: 'secReview' },
|
|
197
|
+
{ id: 'perf', entry: 'perfReview' },
|
|
198
|
+
], 'reviewJoin'), node.agent('secReview', 'role:reviewer', 'reviewJoin'), node.agent('perfReview', 'role:reviewer', 'reviewJoin'),
|
|
199
|
+
// `merge` declared so the 2-writer fan-out is well-formed under all modes (§12.8).
|
|
200
|
+
node.join('reviewJoin', mode, 'joinRouter', { merge: { findings: 'appendByBranchOrder' } }), node.choice('joinRouter', [on(verdictEq('clean'), 'doneEnd'), otherwise('blockedEnd')]), node.terminal('doneEnd', 'succeeded'), node.terminal('blockedEnd', 'blocked'))
|
|
201
|
+
.build();
|
|
202
|
+
}
|
|
203
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
204
|
+
// Targeted — a gate with a timeout edge (§6) + a node with onFailure=route+catch (§6).
|
|
205
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
206
|
+
export function gateWithTimeout() {
|
|
207
|
+
return template('gate-with-timeout')
|
|
208
|
+
.entry('gate')
|
|
209
|
+
.domain('approved')
|
|
210
|
+
.add(node.humanGate('gate', 'review', ['approved'], [on(verdictEq('approved'), 'doneEnd'), otherwise('blockedEnd')], {
|
|
211
|
+
timeout: { after: 'PT24H', goto: 'failedEnd' },
|
|
212
|
+
}), node.terminal('doneEnd', 'succeeded'), node.terminal('blockedEnd', 'blocked'), node.terminal('failedEnd', 'failed'))
|
|
213
|
+
.build();
|
|
214
|
+
}
|
|
215
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
216
|
+
// INVALID fixtures — one per §12 rule. Each is the minimal shape that trips its rule.
|
|
217
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
218
|
+
/** rule 1 — entry points at a node that does not exist (ENTRY_UNRESOLVED). */
|
|
219
|
+
export const invalidEntryUnresolved = () => template('inv').entry('ghost').domain('approved').add(node.terminal('end', 'succeeded')).build();
|
|
220
|
+
/** rule 2 — an edge points at a non-existent node (REF_UNRESOLVED). */
|
|
221
|
+
export const invalidRefUnresolved = () => template('inv').entry('a').domain('approved').add(node.agent('a', 'role:x', 'nowhere')).build();
|
|
222
|
+
/** rule 3 — a non-terminal with no exit (NONTERMINAL_NO_EXIT) — forced via a choice with no branches. */
|
|
223
|
+
export const invalidNonterminalNoExit = () => template('inv').entry('a').domain('approved').add(node.choice('a', [])).build();
|
|
224
|
+
/** rule 3 — a terminal with a bad status (TERMINAL_BAD_STATUS). */
|
|
225
|
+
export const invalidTerminalBadStatus = () => {
|
|
226
|
+
const t = template('inv').entry('a').domain('approved').add(node.terminal('a', 'succeeded')).build();
|
|
227
|
+
t.nodes['a'].status = 'done'; // not in {succeeded,failed,blocked}
|
|
228
|
+
return t;
|
|
229
|
+
};
|
|
230
|
+
/** rule 4 — a choice with no default (ROUTING_NO_DEFAULT). */
|
|
231
|
+
export const invalidNoDefault = () => template('inv')
|
|
232
|
+
.entry('a')
|
|
233
|
+
.domain('approved')
|
|
234
|
+
.add(node.choice('a', [on(verdictEq('approved'), 'end')]), node.terminal('end', 'succeeded'))
|
|
235
|
+
.build();
|
|
236
|
+
/** rule 4 — a guard placed AFTER the default (ROUTING_GUARD_AFTER_DEFAULT). */
|
|
237
|
+
export const invalidGuardAfterDefault = () => template('inv')
|
|
238
|
+
.entry('a')
|
|
239
|
+
.domain('approved')
|
|
240
|
+
.add(node.choice('a', [otherwise('end'), on(verdictEq('approved'), 'end')]), node.terminal('end', 'succeeded'))
|
|
241
|
+
.build();
|
|
242
|
+
/** rule 5 — a node unreachable from entry (UNREACHABLE_NODE). */
|
|
243
|
+
export const invalidUnreachable = () => template('inv')
|
|
244
|
+
.entry('a')
|
|
245
|
+
.domain('approved')
|
|
246
|
+
.add(node.agent('a', 'role:x', 'end'), node.terminal('end', 'succeeded'), node.agent('orphan', 'role:y', 'end'))
|
|
247
|
+
.build();
|
|
248
|
+
/** rule 6 — an unbounded back-edge (LOOP_UNBOUNDED): a choice loops back with no counter.gte cap. */
|
|
249
|
+
export const invalidUnboundedLoop = () => template('inv')
|
|
250
|
+
.entry('a')
|
|
251
|
+
.domain('approved')
|
|
252
|
+
.add(node.agent('a', 'role:x', 'router'), node.choice('router', [on(verdictEq('approved'), 'a'), otherwise('end')]), node.terminal('end', 'succeeded'))
|
|
253
|
+
.build();
|
|
254
|
+
/** rule 7 — a guard references an undeclared scope (SCOPE_UNDECLARED). */
|
|
255
|
+
export const invalidScopeUndeclared = () => template('inv')
|
|
256
|
+
.entry('a')
|
|
257
|
+
.domain('approved')
|
|
258
|
+
.add(node.agent('a', 'role:x', 'router'), node.choice('router', [on(counterGte('ghostScope', 3), 'end'), otherwise('end')]), node.terminal('end', 'succeeded'))
|
|
259
|
+
.build();
|
|
260
|
+
/** rule 7 — a scope whose parent does not resolve (SCOPE_PARENT_UNRESOLVED). The scope is otherwise
|
|
261
|
+
* well-formed (incremented on its own loop) so the parent-unresolved finding stands alone. */
|
|
262
|
+
export const invalidScopeParent = () => template('inv')
|
|
263
|
+
.entry('a')
|
|
264
|
+
.domain('approved')
|
|
265
|
+
.scope('child', { cap: 2, parent: 'ghostParent' })
|
|
266
|
+
.add(node.agent('a', 'role:x', 'router', { incrementCounters: ['child'] }), node.choice('router', [on(counterLt('child', 2), 'a'), otherwise('end')]), node.terminal('end', 'succeeded'))
|
|
267
|
+
.build();
|
|
268
|
+
/** rule 8 — quorum K > N (QUORUM_K_GT_N). */
|
|
269
|
+
export const invalidQuorumKgtN = () => template('inv')
|
|
270
|
+
.entry('fanout')
|
|
271
|
+
.domain('clean')
|
|
272
|
+
.add(node.parallel('fanout', [{ id: 'a', entry: 'aWork' }, { id: 'b', entry: 'bWork' }], 'j'), node.agent('aWork', 'role:x', 'j'), node.agent('bWork', 'role:y', 'j'), node.join('j', joinQuorum(3), 'end', { merge: { f: 'overwrite' } }), node.terminal('end', 'succeeded'))
|
|
273
|
+
.build();
|
|
274
|
+
/** rule 8 — a cross-branch goto (BRANCH_CROSS_GOTO): branch a's node jumps into branch b. */
|
|
275
|
+
export const invalidCrossBranchGoto = () => template('inv')
|
|
276
|
+
.entry('fanout')
|
|
277
|
+
.domain('clean')
|
|
278
|
+
.add(node.parallel('fanout', [{ id: 'a', entry: 'aWork' }, { id: 'b', entry: 'bWork' }], 'j'), node.agent('aWork', 'role:x', 'bWork'), // crosses into branch b
|
|
279
|
+
node.agent('bWork', 'role:y', 'j'), node.join('j', joinAll(), 'end', { merge: { f: 'overwrite' } }), // merge present → only BRANCH_CROSS_GOTO trips
|
|
280
|
+
node.terminal('end', 'succeeded'))
|
|
281
|
+
.build();
|
|
282
|
+
/** rule 8 — a multi-writer fan-out with no merge reducer (MERGE_MISSING). */
|
|
283
|
+
export const invalidMissingMerge = () => template('inv')
|
|
284
|
+
.entry('fanout')
|
|
285
|
+
.domain('clean')
|
|
286
|
+
.add(node.parallel('fanout', [{ id: 'a', entry: 'aWork' }, { id: 'b', entry: 'bWork' }], 'j'), node.agent('aWork', 'role:x', 'j'), node.agent('bWork', 'role:y', 'j'), node.join('j', joinAll(), 'end'), // no merge declared, 2 effect writers
|
|
287
|
+
node.terminal('end', 'succeeded'))
|
|
288
|
+
.build();
|
|
289
|
+
/** rule 9 — a guard uses an undeclared verdict (VERDICT_UNDECLARED). */
|
|
290
|
+
export const invalidVerdictUndeclared = () => template('inv')
|
|
291
|
+
.entry('a')
|
|
292
|
+
.domain('approved')
|
|
293
|
+
.add(node.agent('a', 'role:x', 'router'), node.choice('router', [on(verdictEq('mystery'), 'end'), otherwise('end')]), node.terminal('end', 'succeeded'))
|
|
294
|
+
.build();
|
|
295
|
+
/** rule 9 — a guard uses a CORE verdict, which must route structurally (VERDICT_CORE_IN_GUARD). */
|
|
296
|
+
export const invalidCoreVerdictInGuard = () => template('inv')
|
|
297
|
+
.entry('a')
|
|
298
|
+
.domain('approved')
|
|
299
|
+
.add(node.agent('a', 'role:x', 'router'), node.choice('router', [on(verdictEq('succeeded'), 'end'), otherwise('end')]), node.terminal('end', 'succeeded'))
|
|
300
|
+
.build();
|
|
301
|
+
/** rule 9 — a domain label shadows a core verdict (VERDICT_DOMAIN_SHADOWS_CORE). */
|
|
302
|
+
export const invalidDomainShadowsCore = () => template('inv')
|
|
303
|
+
.entry('a')
|
|
304
|
+
.domain('approved', 'failed')
|
|
305
|
+
.add(node.agent('a', 'role:x', 'end'), node.terminal('end', 'succeeded'))
|
|
306
|
+
.build();
|
|
307
|
+
/** rule 9 — a gate outcome not in domain (GATE_OUTCOME_NOT_SUBSET). */
|
|
308
|
+
export const invalidGateOutcomeNotSubset = () => template('inv')
|
|
309
|
+
.entry('g')
|
|
310
|
+
.domain('approved')
|
|
311
|
+
.add(node.humanGate('g', 'r', ['approved', 'rejected'], [on(verdictEq('approved'), 'end'), otherwise('end')]), node.terminal('end', 'succeeded'))
|
|
312
|
+
.build();
|
|
313
|
+
/** rule 11 — a node id that breaks the id pattern (ID_BAD_PATTERN). */
|
|
314
|
+
export const invalidBadId = () => {
|
|
315
|
+
const t = template('inv').entry('a').domain('approved').add(node.agent('a', 'role:x', 'end'), node.terminal('end', 'succeeded')).build();
|
|
316
|
+
// Re-key 'a' to an illegal id and re-point entry.
|
|
317
|
+
const a = t.nodes['a'];
|
|
318
|
+
delete t.nodes['a'];
|
|
319
|
+
a.id = '1bad';
|
|
320
|
+
t.nodes['1bad'] = a;
|
|
321
|
+
t.entry = '1bad';
|
|
322
|
+
return t;
|
|
323
|
+
};
|
|
324
|
+
/** rule 12 — a malformed capability ref (CAPABILITY_REF_SHAPE). */
|
|
325
|
+
export const invalidCapabilityRef = () => template('inv')
|
|
326
|
+
.entry('a')
|
|
327
|
+
.domain('approved')
|
|
328
|
+
.add(node.agent('a', 'not-a-role-handle', 'end'), node.terminal('end', 'succeeded'))
|
|
329
|
+
.build();
|
|
330
|
+
/** rule 6 — onFailure=route with NO catch (FAILURE_ROUTE_NO_CATCH). */
|
|
331
|
+
export const invalidRouteNoCatch = () => template('inv')
|
|
332
|
+
.entry('a')
|
|
333
|
+
.domain('approved')
|
|
334
|
+
.add(node.script('a', 'script:x', 'end', { onFailure: 'route' }), node.terminal('end', 'succeeded'))
|
|
335
|
+
.build();
|
|
336
|
+
/** rule 6 — onFailure=escalate with NO escalateTo (FAILURE_ESCALATE_NO_TARGET). */
|
|
337
|
+
export const invalidEscalateNoTarget = () => template('inv')
|
|
338
|
+
.entry('a')
|
|
339
|
+
.domain('approved')
|
|
340
|
+
.add(node.agent('a', 'role:x', 'end', { onFailure: 'escalate' }), node.terminal('end', 'succeeded'))
|
|
341
|
+
.build();
|
|
342
|
+
//# sourceMappingURL=fixtures.js.map
|