Skip to content

AIFACTORY-FEAT-134: Workflow definition: Infrastructure plan

Generated from the architecture model

This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.

A design artefact, not a tracker

This backlog is generated from model/backlog/ and validated against the architecture model. No work item exists in any tracker, and no item carries a date, an estimate or an assignee (ADR-0029).

Epic Factory assets: workflow definitions, agents and skills · Increment I2 Deliver it · State elaborated · Route solution-architect · Build order 107 of 185 (Factory code)

The workflow definition infrastructure-plan as a published asset: Derives the Infrastructure Blueprint and the Pulumi program from the module, database, security and observability blueprints, previews it in the sandbox and records the output; nothing is applied. It has 8 steps, names the agents infrastructure-architect, infrastructure-engineer and the tools blueprint-submit-version, blueprint-validate, shell-sandbox, and is executed by WorkflowEngineService under Run Control.

Delivers —
Stubs —
Realizes workflows: infrastructure-plan
adrs: ADR-0004, ADR-0014, ADR-0017, ADR-0027
Requirements FR-11, XL-09
Depends on AIFACTORY-FEAT-189 AgentRegistryService: the publication path of releases from I2
Sources model/workflows/infrastructure-plan.yaml

Scenarios to trace (9, catalog): SCN-infrastructure-plan-001 ✓, SCN-infrastructure-plan-002 ✓, SCN-infrastructure-plan-003 ✓, SCN-infrastructure-plan-004 ✓, SCN-infrastructure-plan-005 ✓, SCN-infrastructure-plan-006 ✓, SCN-infrastructure-plan-007 ✓, SCN-infrastructure-plan-008 ✓, SCN-infrastructure-plan-009 ✓

AIFACTORY-US-031: The infrastructure of a product is planned from its design

behavior · persona operator As an operator, I want the Infrastructure Blueprint of a product produced from its validated design, with a previewed infrastructure program, so that delivery never waits for a person to write a blueprint, and I read a plan before anything is provisioned.

The integration PBI of the definition infrastructure-plan. When BlueprintService has published BlueprintValidated with passed true for the Module, Database, Security and Observability Blueprints of a project, the last two produced by the definitions security-blueprint and observability-blueprint, WorkflowEngineService satisfies the four required readiness members module-blueprints, database-blueprint, security-blueprint and observability-blueprint of the project scope and submits the run itself through SubmitRun of RunControlService with a service token that names the project and the bundle idempotency key (D131); the same versions return the existing run and a newer version of any member supersedes the open correlation and starts a new one. Run Control accepts the run and publishes RunAccepted; the engine loads the Published release the run pinned through AgentRegistryService and marks the eight steps ready in the declared order: derive-topology, draft-blueprint, submit-version, validate, check-valid, generate-pulumi, preview and record-outputs, with the agents infrastructure-architect and infrastructure-engineer on their pinned releases. Nothing is applied: the program is previewed in the sandbox only (ADR-0004). Every step records exactly one outcome and the run reports exactly one outcome to Run Control (ADR-0014). Before any run, the definition release and the agent releases of its two agents, with any skill, tool or model profile release they need that is not yet Published, are submitted through SubmitRelease and published through PublishRelease of AgentRegistryService (feature agent-registry-service-publication); each publication is approved by a Reviewer who is not the submitter, a Platform admin for a model profile release, no evaluation verdict is required before I4, and the runs pin the Published release, never a Draft one (D140). The step behaviour is specified in AIFACTORY-US-1197 to AIFACTORY-US-1201; this PBI proves the chain on the recorded fixture.

Acceptance criteria

AC1 Given BlueprintService/BlueprintValidated with passed true for the kinds Module, Database, Security and Observability of one project and tenant, when the last of the four members is satisfied, then WorkflowEngineService/ReadinessRunSubmitted is emitted once and the run is submitted through RunControlService/SubmitRun with a service token naming the project (D131); no run starts while a member is missing.
AC2 Given one of the awaited blueprints gets a new validated version while a correlation is open, when the bundle is recomputed, then WorkflowEngineService/ReadinessSuperseded is emitted for the open correlation and a new run is submitted with the new fingerprint.
AC3 Given the Published release of infrastructure-plan, authored exactly as in model/workflows/infrastructure-plan.yaml, submitted through AgentRegistryService/SubmitRelease and published through AgentRegistryService/PublishRelease after an approval by a Reviewer who is not the submitter (D140), when RunControlService/RunAccepted arrives for a run that pinned it, then WorkflowEngineService/WorkflowRunStarted is emitted and infrastructure-plan/derive-topology, infrastructure-plan/draft-blueprint, infrastructure-plan/submit-version, infrastructure-plan/validate, infrastructure-plan/check-valid, infrastructure-plan/generate-pulumi, infrastructure-plan/preview and infrastructure-plan/record-outputs become ready in that order, each agent step on the pinned Published release of its agent, and no Draft release is loaded.
AC4 Given every step succeeds, when the run completes, then infrastructure-blueprint (blueprint-infrastructure-v1), pulumi-program (change-set-v1) and validation-receipt are the run outputs, nothing is applied to any environment, WorkflowEngineService/WorkflowRunCompleted is emitted once and RunControlService/RunCompleted follows exactly once (ADR-0004, ADR-0014).
AC5 Given the recorded fixture inputs of model/workflows/infrastructure-plan.yaml, when the fixture run executes in the pipeline, then its outputs match the recorded ones field by field and the run stays within the declared budget (ADR-0024).
Traces: services WorkflowEngineService, RunControlService, BlueprintService, ToolAdapterService, ArtifactService, AgentRegistryService
Traces: workflows infrastructure-plan
Traces: steps infrastructure-plan/derive-topology, infrastructure-plan/draft-blueprint, infrastructure-plan/submit-version, infrastructure-plan/validate, infrastructure-plan/check-valid, infrastructure-plan/generate-pulumi, infrastructure-plan/preview, infrastructure-plan/record-outputs
Traces: agents infrastructure-architect, infrastructure-engineer
Traces: tools blueprint-submit-version, blueprint-validate, shell-sandbox
Traces: apis RunControlService/SubmitRun, AgentRegistryService/SubmitRelease, AgentRegistryService/PublishRelease
Traces: events AgentRegistryService/AssetReleasePublished, BlueprintService/BlueprintValidated, WorkflowEngineService/ReadinessRunSubmitted, WorkflowEngineService/ReadinessSuperseded, WorkflowEngineService/WorkflowRunStarted, WorkflowEngineService/WorkflowRunCompleted, RunControlService/RunAccepted, RunControlService/RunCompleted
Traces: descriptors workflow-definition-v1, readiness-bundle-v1, blueprint-module-v1, blueprint-database-v1, blueprint-security-v1, blueprint-observability-v1, blueprint-infrastructure-v1, change-set-v1
Traces: adrs ADR-0004, ADR-0014, ADR-0017, ADR-0024, ADR-0027, ADR-0030
Traces: requirements FR-11, XL-09
Depends on AIFACTORY-US-1197, AIFACTORY-US-1198, AIFACTORY-US-1199, AIFACTORY-US-1200, AIFACTORY-US-1201, feature:wf-security-blueprint, feature:wf-observability-blueprint, feature:wf-module-blueprints, feature:wf-database-blueprint, feature:blueprint-service, feature:workflow-engine-service, feature:run-control-service, feature:agent-registry-service-thin, feature:agent-registry-service-publication
Sources model/workflows/infrastructure-plan.yaml, docs/planes/agent-runtime/workflow-definitions/infrastructure-plan.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-353 Readiness start of the infrastructure plan on its four validated blueprints implementation The infrastructure plan starts once per version set of its four awaited blueprints, only when all four members are validated, through SubmitRun with a service token naming the project, and a newer member version supersedes the open correlation (AC1 and AC2 of AIFACTORY-US-031). ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-350 Author, submit and publish the release of the workflow definition infrastructure-plan with its agent releases implementation The release of infrastructure-plan (workflow-definition-v1) authored with its 8 steps, input mappings, retry policies, timeouts, the failure policy Retry of each agent and tool step, the idempotency_key documentHash of submit-version and the on_false loop of check-valid exactly as in model/workflows/infrastructure-plan.yaml and accepted by ValidateWorkflowDefinition; it is submitted through SubmitRelease of AgentRegistryService together with the agent releases infrastructure-architect and infrastructure-engineer of AIFACTORY-TASK-351 and any skill, tool or model profile release of their closure that is not yet Published, each publication is approved, through the approval that RunControlService opens with the subject kind asset-release, by a Reviewer who is not the submitter (a Platform admin for a model profile release), and each release is published through PublishRelease with the alias latest moved to it (feature agent-registry-service-publication, D140); no evaluation verdict is required before I4, and the Published release ids are recorded for the fixture run, which pins them. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-351 Author the agent releases infrastructure-architect, infrastructure-engineer with their prompts and skills implementation Draft releases of infrastructure-architect and infrastructure-engineer with their instructions, the skills infrastructure-architect-derive-topology, infrastructure-architect-draft-blueprint, infrastructure-engineer-generate-pulumi and infrastructure-engineer-record-outputs among their bound skills, tool bindings and model profiles; each release passes a smoke run on a fixture input in the template tests and is submitted for publication by AIFACTORY-TASK-350, and no evaluation verdict is required for its publication before I4 (D140). ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-352 Fixture run of infrastructure-plan against recorded inputs verification The definition runs end to end on four fixture blueprints in the acceptance environment from the readiness start to RunCompleted on the Published releases of AIFACTORY-TASK-350 with nothing applied; every step output validates against its descriptor (AC3 to AC5 of AIFACTORY-US-031). ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-729 Verify infrastructure-planned-from-design by running the declared command verification Run dotnet test -c Release --filter Category=WorkflowFixture; it passes and proves AC1 to AC5 of AIFACTORY-US-031; the output names the Published release ids of infrastructure-plan, infrastructure-architect and infrastructure-engineer that the run pinned, as AgentRegistryService/GetRelease reports them with their approval by a Reviewer who is not the submitter (D140). ConnectSoft.AI.SoftwareFactory.WorkflowEngineService

AIFACTORY-US-1197: The Infrastructure Architect derives the topology and drafts the Infrastructure Blueprint from the four blueprints

behavior · persona operator As an operator, I want the deployment profile, regions, stores and pools of a product chosen from its validated design and written as an Infrastructure Blueprint, so that infrastructure follows the design and the residency rules instead of a hand-written plan.

The two agent steps of the architect in infrastructure-plan. When the engine marks derive-topology ready it resolves module-blueprints, database-blueprint, security-blueprint and observability-blueprint from the run inputs of the same names; the infrastructure-architect release runs the skill infrastructure-architect-derive-topology in read class with knowledge-search, graph-query, list-files and read-range and writes topology (artifact-v1): the deployment profile, regions, stores and pools chosen from the blueprints and the NFR class (ADR-0017). When draft-blueprint becomes ready it receives the four blueprints and topology from steps.derive-topology.topology, and on a revision pass the findings of the last validation receipt as feedback; the skill infrastructure-architect-draft-blueprint writes, in sandbox class, the Infrastructure Blueprint against blueprint-infrastructure-v1, addressing the rules INF-001 to INF-003: a Pulumi program as the target (ADR-0004), regions that respect the residency rule of the tenant and production applies gated through promotions or provisioning runs. Neither step touches a shared system or needs an approval. Both declare failure_policy Retry: a Failed attempt of failure class transient is retried under the exponential budget of 3 attempts with backoff 30s, any other failure class is not retried, and a step that exceeds PT30M or spends its budget fails the run with the evidence.

Acceptance criteria

AC1 Given a run accepted with the four blueprints, when infrastructure-architect executes infrastructure-plan/derive-topology, then topology (artifact-v1) is recorded once under the run envelope with the deployment profile, regions, stores and pools and the NFR class they follow (SCN-infrastructure-plan-001, ADR-0017).
AC2 Given steps.derive-topology.topology is recorded, when infrastructure-plan/draft-blueprint runs, then infrastructure-blueprint validates against blueprint-infrastructure-v1, names a Pulumi program as the target and is recorded once (SCN-infrastructure-plan-002, ADR-0004).
AC3 Given a revision pass after infrastructure-plan/check-valid took its false branch, when infrastructure-plan/draft-blueprint re-runs, then the findings of steps.validate.validation-receipt are in its context as feedback and the new draft addresses each finding by rule id (INF-001 to INF-003) or schema path (SCN-infrastructure-plan-002, ADR-0026).
AC4 Given an attempt of either step exceeds PT30M, settles Failed with a non-transient failure class, or spends the exponential budget of 3 attempts, when Run Control settles the step through RunControlService/StepSettled, then WorkflowEngineService/WorkflowRunFailed names the step and no shared system is changed (SCN-infrastructure-plan-001, SCN-infrastructure-plan-002, ADR-0014).
Traces: workflows infrastructure-plan
Traces: steps infrastructure-plan/derive-topology, infrastructure-plan/draft-blueprint
Traces: agents infrastructure-architect
Traces: services WorkflowEngineService
Traces: events WorkflowEngineService/StepReady, WorkflowEngineService/WorkflowRunFailed, RunControlService/StepSettled
Traces: descriptors blueprint-module-v1, blueprint-database-v1, blueprint-security-v1, blueprint-observability-v1, artifact-v1, blueprint-infrastructure-v1
Traces: scenarios SCN-infrastructure-plan-001, SCN-infrastructure-plan-002
Traces: adrs ADR-0004, ADR-0014, ADR-0017, ADR-0026
Traces: requirements FR-11, XL-09
Depends on feature:workflow-engine-service, feature:run-control-service
Sources model/workflows/infrastructure-plan.yaml, model/skills/architecture/infrastructure-architect-derive-topology.yaml, model/skills/architecture/infrastructure-architect-draft-blueprint.yaml, model/blueprints.yaml, model/scenarios/infrastructure-plan.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-4771 Recorded fixture of the four blueprints with the expected topology and Infrastructure Blueprint fixture Fixture Module, Database, Security and Observability Blueprints with the expected topology (artifact-v1) and the expected Infrastructure Blueprint draft (blueprint-infrastructure-v1), plus a receipt with an INF-002 finding as feedback for the revision pass of SCN-infrastructure-plan-002. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-4772 Verify the input mappings and skill selection of the architect steps in the Draft release verification The steps derive-topology and draft-blueprint of the Draft release authored by AIFACTORY-TASK-350 resolve the four blueprints and topology exactly as mapped in model/workflows/infrastructure-plan.yaml and select the skills infrastructure-architect-derive-topology and infrastructure-architect-draft-blueprint. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-4773 Prove the topology and draft steps on the fixture verification A fixture run proves SCN-infrastructure-plan-001 and SCN-infrastructure-plan-002 (AC1 to AC4 of AIFACTORY-US-1197); the outputs validate against artifact-v1 and blueprint-infrastructure-v1, the revision pass addresses each finding, and the retry exhaustion ends in WorkflowRunFailed naming the step. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService

AIFACTORY-US-1198: The Infrastructure Blueprint draft is stored as a project-scope Draft version and validated with a receipt

behavior · persona operator As an operator, I want the drafted Infrastructure Blueprint stored as a Draft version of my project and validated against its schema and the INF rules, so that no infrastructure program is generated from a blueprint that has not passed validation.

The two tool steps of infrastructure-plan; they reuse the tool bindings of blueprint-submit-version and blueprint-validate that the feature wf-vision-to-blueprint delivers and fork nothing. When submit-version becomes ready the engine resolves document from steps.draft-blueprint.infrastructure-blueprint and emits StepReady with action class shared-write; Run Control dispatches the attempt through the pipeline of ToolAdapterService. Draft versions are autonomous by default; when the project policy gates blueprint drafts, Policy.Decide answers allow-with-approval for the action kind tool-invocation and an approval whose subject is the run is requested, bound to the invocation request hash, which covers the document hash, with proposal kind tool-invocation; the run waits WaitingForApproval and the write happens only on an approving decision (D64, D129). The tool stores the document as a project-scope Draft BlueprintVersion of kind Infrastructure, idempotent on its document hash, and returns version-ref (blueprint-version-ref-v1). The step declares failure_policy Retry with idempotency_key documentHash, so a Failed attempt of failure class transient is retried under the fixed budget of 2 attempts with backoff 10s (D114); an Uncertain attempt is never retried automatically and waits for an operator decision with a finding (D119). When validate becomes ready the tool blueprint-validate validates the version against blueprint-infrastructure-v1 and the rules INF-001 to INF-003 in sandbox class and returns validation-receipt with passed, documentHash and findings; a receipt with passed false is a successful step output. A version reference of another tenant is answered NOT_FOUND and the attempt takes failure class permanent (ADR-0015).

Acceptance criteria

AC1 Given steps.draft-blueprint.infrastructure-blueprint is recorded and the project policy does not gate blueprint drafts, when infrastructure-plan/submit-version runs through BlueprintService/Blueprints.SubmitDraftVersion, then a Draft BlueprintService/BlueprintVersion of kind Infrastructure exists in project scope, version-ref is recorded once and the same document submitted again returns the same version (SCN-infrastructure-plan-003, D64).
AC2 Given the project policy gates blueprint drafts, when infrastructure-plan/submit-version is reached, then RunControlService/ApprovalRequested is published for the run bound to the invocation request hash with proposal kind tool-invocation before any write, the write happens only on an approving RunControlService/ApprovalDecided, and a rejected or expired decision ends in ToolAdapterService/ToolInvocationDenied with no Draft version (SCN-infrastructure-plan-003, ADR-0026).
AC3 Given a submit attempt settles Failed with failure class transient, when Run Control evaluates it, then it is retried under the fixed budget of 2 attempts because the step declares idempotency_key documentHash; given it settles Uncertain, then ToolAdapterService/ToolEffectUncertain is emitted, it is not retried and the step waits until an operator settles it through ToolAdapterService/ConfirmToolEffect (SCN-infrastructure-plan-003, ADR-0014).
AC4 Given steps.submit-version.version-ref is recorded, when infrastructure-plan/validate runs through BlueprintService/Blueprints.Validate, then validation-receipt with passed, documentHash and findings by rule id INF-001 to INF-003 or schema path is recorded once whether it passed or not, and BlueprintService/BlueprintValidated is emitted with passed true or false (SCN-infrastructure-plan-004).
AC5 Given the version reference belongs to another tenant, or a validate attempt exceeds PT5M or spends the fixed budget of 2 attempts, when the step settles, then a foreign reference is answered NOT_FOUND with no receipt and failure class permanent without a retry, and WorkflowEngineService/WorkflowRunFailed names the step (SCN-infrastructure-plan-004, ADR-0015).
Traces: workflows infrastructure-plan
Traces: steps infrastructure-plan/submit-version, infrastructure-plan/validate
Traces: tools blueprint-submit-version, blueprint-validate
Traces: services BlueprintService, ToolAdapterService, RunControlService, WorkflowEngineService
Traces: aggregates BlueprintService/BlueprintVersion
Traces: apis BlueprintService/Blueprints.SubmitDraftVersion, BlueprintService/Blueprints.Validate, ToolAdapterService/ConfirmToolEffect
Traces: events BlueprintService/BlueprintValidated, RunControlService/ApprovalRequested, RunControlService/ApprovalDecided, ToolAdapterService/ToolInvocationDenied, ToolAdapterService/ToolEffectUncertain, WorkflowEngineService/WorkflowRunFailed
Traces: descriptors blueprint-infrastructure-v1, blueprint-version-ref-v1, blueprint-validation-receipt-v1
Traces: scenarios SCN-infrastructure-plan-003, SCN-infrastructure-plan-004
Traces: adrs ADR-0014, ADR-0015, ADR-0026
Traces: requirements FR-11
Depends on AIFACTORY-US-1197, feature:wf-vision-to-blueprint, feature:blueprint-service, feature:tool-adapter-service, feature:run-control-service, feature:workflow-engine-service
Sources model/workflows/infrastructure-plan.yaml, model/tools/blueprint-submit-version.yaml, model/tools/blueprint-validate.yaml, model/blueprints.yaml, model/scenarios/infrastructure-plan.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-354 Verify the Infrastructure rule set on the delivered BlueprintService verification A fixture run proves that Blueprints.Validate evaluates INF-001 to INF-003 as delivered by the feature blueprint-service, returning a receipt with findings by rule id, severity and path for the fixture documents of the validate step; nothing of BlueprintService is implemented here. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-4774 Bind the submit and validate steps to the shared blueprint tool bindings implementation The steps submit-version and validate of the Draft release call blueprint-submit-version and blueprint-validate as delivered by the feature wf-vision-to-blueprint, with document and version-ref mapped as in model/workflows/infrastructure-plan.yaml and the idempotency_key documentHash on submit-version. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-4775 Fixture Infrastructure Blueprint documents with their expected receipts fixture One fixture document that passes INF-001 to INF-003 and one that fails INF-001 by naming Bicep, each with its expected blueprint-version-ref-v1 and blueprint-validation-receipt-v1, plus a version reference of another tenant with the expected NOT_FOUND, as the oracle of SCN-infrastructure-plan-003 and SCN-infrastructure-plan-004. ConnectSoft.AI.SoftwareFactory.BlueprintService
AIFACTORY-TASK-4776 Prove the submit and validate steps on the fixture verification A fixture run proves SCN-infrastructure-plan-003 and SCN-infrastructure-plan-004 (AC1 to AC5 of AIFACTORY-US-1198), including the idempotent resubmission, the gated path, the transient retry, the Uncertain path settled through ConfirmToolEffect, a failed receipt recorded as a step output and the foreign version reference answered NOT_FOUND. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService

AIFACTORY-US-1199: The engine checks the Infrastructure Blueprint receipt and sends findings back to the draft at most twice

behavior · persona operator As an operator, I want a failed validation of the Infrastructure Blueprint to return its findings to the draft a bounded number of times and then fail with the report, so that the program is generated only from a validated blueprint and a failing blueprint never loops forever.

The condition step of infrastructure-plan. When check-valid becomes ready the engine evaluates steps.validate.validation-receipt.passed == true over the recorded receipt; a condition step never retries, never calls a service and completes within PT1M. When the receipt passed, the condition completes with one outcome and generate-pulumi becomes ready. When it did not, the engine takes the on_false branch to draft-blueprint with steps.validate.validation-receipt as feedback: the draft, submit and validate steps re-run in order, the revised document gets its own Draft version and its own receipt, and the iteration count of the run rises by one. The branch is taken at most 2 times; when the receipt is still failed after the last iteration the run fails with the validation report as its evidence, WorkflowRunFailed names check-valid with the failure class validation, Run Control records Failed exactly once, no program is generated and every Draft version created on the way stays a Draft. A missing or unreadable receipt fails the condition with evidence instead of being read as passed (ADR-0026, D61).

Acceptance criteria

AC1 Given steps.validate.validation-receipt is recorded with passed true, when the engine evaluates infrastructure-plan/check-valid, then the condition completes with one outcome, no service is called and infrastructure-plan/generate-pulumi becomes ready (SCN-infrastructure-plan-005).
AC2 Given the recorded receipt has passed false and fewer than 2 iterations were counted, when the engine evaluates infrastructure-plan/check-valid, then it takes the false branch to infrastructure-plan/draft-blueprint with the receipt as feedback and the iteration count rises by one (SCN-infrastructure-plan-006).
AC3 Given the receipt is still passed false after the second iteration, when the engine evaluates the condition, then WorkflowEngineService/WorkflowRunFailed names check-valid with failure class validation and the report as evidence, RunControlService/RunFailed is published exactly once and no program is generated (SCN-infrastructure-plan-006, ADR-0014).
AC4 Given the receipt is missing or unreadable, or the evaluation exceeds PT1M, when the engine evaluates infrastructure-plan/check-valid, then the condition is not retried, it fails with evidence and the run follows the compensation policy of model/workflows/infrastructure-plan.yaml (SCN-infrastructure-plan-005, ADR-0026).
Traces: workflows infrastructure-plan
Traces: steps infrastructure-plan/check-valid, infrastructure-plan/draft-blueprint
Traces: services WorkflowEngineService
Traces: events WorkflowEngineService/WorkflowRunFailed, RunControlService/RunFailed
Traces: descriptors blueprint-validation-receipt-v1
Traces: scenarios SCN-infrastructure-plan-005, SCN-infrastructure-plan-006
Traces: adrs ADR-0014, ADR-0026
Traces: requirements FR-11
Depends on AIFACTORY-US-1198, feature:workflow-engine-service, feature:run-control-service
Sources model/workflows/infrastructure-plan.yaml, model/services/agent-mesh/WorkflowEngineService.yaml, model/scenarios/infrastructure-plan.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-4777 Fixture receipt sequences for the pass, loop and limit paths fixture Recorded receipt sequences (passed true; passed false then true; passed false three times) that drive check-valid of infrastructure-plan through the pass, the single loop and the iteration limit, each with the expected run outcome and iteration count. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService
AIFACTORY-TASK-4778 Prove the condition and the bounded loop on the fixture verification A fixture run proves SCN-infrastructure-plan-005 and SCN-infrastructure-plan-006 (AC1 to AC4 of AIFACTORY-US-1199); generate-pulumi ready on pass, a loop back with feedback on a failed receipt, and WorkflowRunFailed naming check-valid with failure class validation after the second iteration. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService

AIFACTORY-US-1200: The Infrastructure Engineer generates the Pulumi program and previews it in the sandbox without applying it

behavior · persona operator As an operator, I want the infrastructure program generated from the validated blueprint and previewed against a sandbox stack, so that I read the planned changes, destructive ones flagged, before anything is provisioned.

The generation and preview steps of infrastructure-plan. When check-valid held the engine marks generate-pulumi ready and resolves infrastructure-blueprint from steps.draft-blueprint.infrastructure-blueprint and topology from steps.derive-topology.topology. The infrastructure-engineer release runs the skill infrastructure-engineer-generate-pulumi in sandbox class with its bound tools list-files, search-text, search-symbols, find-references, read-range, get-dependencies, get-git-diff, knowledge-search, apply-patch, write-file, shell-sandbox and build-and-test, and generates the Pulumi program and its stack configuration in the run's isolated workspace (ADR-0004), returning pulumi-program (change-set-v1) with its diff reference and hash. The step declares failure_policy Retry with the exponential budget of 3 attempts. When preview becomes ready the tool shell-sandbox receives pulumi-program from steps.generate-pulumi.pulumi-program and runs the preview against the sandbox stack under the allow-list and block-list of the tool and its egress allow-list, auditing commandLine, exitCode, durationMs and sandbox; it returns preview-report (artifact-v1), in which every destructive operation of the diff is a finding. Nothing is applied to any environment: a command on the block-list is denied, and the step stays sandbox class. The preview declares failure_policy Retry: a Failed attempt of failure class transient is retried under the fixed budget of 2 attempts with backoff 10s, any other failure class is not retried, and a step that exceeds PT20M or spends its budget fails the run with the workspace output in place.

Acceptance criteria

AC1 Given infrastructure-plan/check-valid held, when infrastructure-engineer executes infrastructure-plan/generate-pulumi, then pulumi-program (change-set-v1) with the program and stack configuration is recorded once under the run envelope and nothing leaves the isolated workspace (SCN-infrastructure-plan-007, ADR-0004).
AC2 Given steps.generate-pulumi.pulumi-program is recorded, when infrastructure-plan/preview runs shell-sandbox against the sandbox stack, then preview-report (artifact-v1) is recorded once, every destructive operation of the diff is a finding, the audit record carries commandLine, exitCode, durationMs and sandbox, and no environment is changed (SCN-infrastructure-plan-008).
AC3 Given a command of the preview matches the block-list of shell-sandbox, when the invocation is evaluated, then it is denied with ToolAdapterService/ToolInvocationDenied and the attempt fails without a retry (SCN-infrastructure-plan-008).
AC4 Given an attempt of infrastructure-plan/generate-pulumi spends its exponential budget of 3 attempts or exceeds PT30M, or an attempt of infrastructure-plan/preview spends its fixed budget of 2 attempts or exceeds PT20M, when Run Control settles the step through RunControlService/StepSettled, then WorkflowEngineService/WorkflowRunFailed names the step (SCN-infrastructure-plan-007, SCN-infrastructure-plan-008, ADR-0014).
Traces: workflows infrastructure-plan
Traces: steps infrastructure-plan/generate-pulumi, infrastructure-plan/preview
Traces: agents infrastructure-engineer
Traces: tools shell-sandbox
Traces: services WorkflowEngineService, ToolAdapterService
Traces: events ToolAdapterService/ToolInvocationDenied, RunControlService/StepSettled, WorkflowEngineService/WorkflowRunFailed
Traces: descriptors blueprint-infrastructure-v1, change-set-v1, artifact-v1
Traces: scenarios SCN-infrastructure-plan-007, SCN-infrastructure-plan-008
Traces: adrs ADR-0004, ADR-0014
Traces: requirements FR-11, XL-09
Depends on AIFACTORY-US-1199, feature:tool-adapter-service, feature:workflow-engine-service, feature:run-control-service
Sources model/workflows/infrastructure-plan.yaml, model/skills/devops-delivery/infrastructure-engineer-generate-pulumi.yaml, model/tools/shell-sandbox.yaml, model/scenarios/infrastructure-plan.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-355 Infrastructure program generation and sandbox preview implementation The infrastructure-engineer skill infrastructure-engineer-generate-pulumi generates the Pulumi program and stack configuration from the validated blueprint, and the preview step runs shell-sandbox against the sandbox stack and returns a preview report with destructive operations as findings (SCN-infrastructure-plan-007, SCN-infrastructure-plan-008). ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-4779 Fixture program and preview reports with and without destructive operations fixture The expected pulumi-program of the fixture blueprint and two recorded preview reports, one additive and one with a destructive operation flagged as a finding, plus a block-listed command with its expected denial, as the oracle of SCN-infrastructure-plan-007 and SCN-infrastructure-plan-008. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-4780 Prove the generation and the preview on the fixture verification A fixture run proves SCN-infrastructure-plan-007 and SCN-infrastructure-plan-008 (AC1 to AC4 of AIFACTORY-US-1200); the program and the report recorded once, the destructive operation reported as a finding, the block-listed command denied and nothing applied to any environment. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService

AIFACTORY-US-1201: The Infrastructure Engineer records the blueprint, the program and the preview with lineage and the run completes

behavior · persona operator As an operator, I want the validated blueprint, the generated program and its preview recorded together with lineage, so that provisioning later starts from outputs that trace back to the design and to the preview I read.

The last agent step of infrastructure-plan. When preview succeeded the engine marks record-outputs ready and resolves infrastructure-blueprint from steps.draft-blueprint.infrastructure-blueprint, pulumi-program from steps.generate-pulumi.pulumi-program and preview-report from steps.preview.preview-report. The infrastructure-engineer release runs the skill infrastructure-engineer-record-outputs in sandbox class: it assembles the generated outputs of the plan, the blueprint and the program with lineage to the preview report, and returns generated-outputs (change-set-v1). AgentRuntimeService records that output under the run envelope through Artifacts.Store of ArtifactService with the producer run, attempt and agent and the declared lineage, so exactly one new ArtifactStored results for it. The run then completes with infrastructure-blueprint, pulumi-program and validation-receipt as its outputs and Run Control records one Completed outcome. The step applies nothing, opens no proposal and requests no approval. It declares failure_policy Retry and is sandbox class, so a Failed attempt of failure class transient is retried under the exponential budget of 3 attempts with backoff 30s; an attempt that exceeds PT30M, fails with any other failure class or spends the budget fails the run with the evidence, and an output already stored is not written twice on recovery.

Acceptance criteria

AC1 Given infrastructure-plan/preview succeeded, when the engine marks infrastructure-plan/record-outputs ready, then infrastructure-blueprint, pulumi-program and preview-report are resolved from the mappings of model/workflows/infrastructure-plan.yaml and infrastructure-engineer executes the step on its pinned release (SCN-infrastructure-plan-009).
AC2 Given the step returns generated-outputs, when AgentRuntimeService records it, then it is stored once through ArtifactService/Artifacts.Store with the producer run, attempt and agent and lineage to the blueprint, the program and the preview report, and exactly one new ArtifactService/ArtifactStored is emitted for it (SCN-infrastructure-plan-009).
AC3 Given the output is stored, when the step completes, then the run outputs are set and WorkflowEngineService/WorkflowRunCompleted is emitted once; given an attempt exceeds PT30M or spends its budget, then WorkflowEngineService/WorkflowRunFailed names the step and no output is written twice on recovery (SCN-infrastructure-plan-009, ADR-0014).
Traces: workflows infrastructure-plan
Traces: steps infrastructure-plan/record-outputs
Traces: agents infrastructure-engineer
Traces: services WorkflowEngineService, AgentRuntimeService, ArtifactService
Traces: apis ArtifactService/Artifacts.Store
Traces: events ArtifactService/ArtifactStored, WorkflowEngineService/WorkflowRunCompleted, WorkflowEngineService/WorkflowRunFailed
Traces: descriptors blueprint-infrastructure-v1, change-set-v1, artifact-v1
Traces: scenarios SCN-infrastructure-plan-009
Traces: adrs ADR-0014
Traces: requirements FR-11
Depends on AIFACTORY-US-1200, feature:artifact-service, feature:agent-runtime-service, feature:workflow-engine-service
Sources model/workflows/infrastructure-plan.yaml, model/skills/devops-delivery/infrastructure-engineer-record-outputs.yaml, model/scenarios/infrastructure-plan.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-4781 Bind the record-outputs skill and map the run outputs implementation The step record-outputs of the Draft release runs infrastructure-engineer-record-outputs with the three inputs mapped as in model/workflows/infrastructure-plan.yaml, and the run outputs infrastructure-blueprint, pulumi-program and validation-receipt are set from the recorded step outputs. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-4782 Fixture expected generated outputs with their lineage fixture The expected generated-outputs of the fixture run (change-set-v1) with the producer run and lineage to the blueprint, the program and the preview report, and the expectation of exactly one new ArtifactStored, as the oracle of SCN-infrastructure-plan-009. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-4783 Prove the record step and the run completion on the fixture verification A fixture run proves SCN-infrastructure-plan-009 (AC1 to AC3 of AIFACTORY-US-1201); one ArtifactStored with lineage, the run outputs set, WorkflowRunCompleted and RunCompleted exactly once, and the timeout path ending Failed without a second write on recovery. ConnectSoft.AI.SoftwareFactory.WorkflowEngineService