π Orchestration Domain¶
π§ Purpose of the Orchestration Domain¶
The Orchestration Domain is the central nervous system of the ConnectSoft AI Software Factory. It is responsible for coordinating multi-agent collaboration, phase-driven execution, and automated project flows through events, state transitions, and explicit task delegation.
This domain ensures that complex project goalsβsuch as scaffolding microservices, applying templates, validating code, deploying infrastructure, or coordinating agentsβare executed in the correct order, by the right agents, and under traceable supervision.
π§© Role in the Platform¶
| Function | Description |
|---|---|
| Flow Control | Coordinates sequential and parallel execution of tasks across services. |
| Agent Collaboration | Directs and monitors AI agents responsible for each software lifecycle step. |
| Trigger Management | Reacts to lifecycle events (e.g., ProjectCreated, MicroservicePlanned). |
| Phase Enforcement | Ensures actions occur only when a project is in the correct state. |
| Stateful Execution | Maintains orchestration graphs and lifecycle state per project. |
| Retry and Resilience | Retries failed tasks, routes around errors, and supports recovery patterns. |
π Core Activities Orchestrated¶
| Orchestrated Process | Description |
|---|---|
ProjectBootstrapOrchestrator |
Launches first-time scaffolding of a new project using Vision and Planning agents. |
MicroserviceAssemblyCoordinator |
Drives the creation of an individual microservice (from architecture to code). |
CI/CD Pipeline Generator |
Applies CI/CD templates after code scaffolding. |
InfrastructureProvisioning |
Coordinates agents to deploy Bicep, ARM, or Terraform modules. |
Testing and QA Orchestration |
Launches validation agents to execute unit, integration, and BDD tests. |
Security & Compliance |
Activates hardening steps like auth service generation, key vault setup. |
π‘ Orchestration Flow Layers¶
flowchart TD
EventBus["π¨ Domain Events"] --> Orchestrator["π§ Orchestration Layer"]
Orchestrator --> Agents["π€ AI Agents"]
Orchestrator --> StateStore["ποΈ Orchestration State"]
Orchestrator --> Trace["π Telemetry & Traces"]
Agents --> Orchestrator
π§ Principles Followed¶
- β Event-Driven: Orchestrators are reactive, triggered by lifecycle events and agent outputs.
- β Phase-Aware: All orchestration logic respects the current state in the project lifecycle.
- β Traceable: Every orchestration action emits trace IDs and spans.
- β Composable: Orchestration logic is modular, scriptable, and pluggable.
- β Agent-Centric: Agents are treated as asynchronous workers coordinated by orchestrators.
ποΈ Key Components in the Domain¶
| Component | Description |
|---|---|
OrchestrationControllerService |
Entry point for dispatching orchestration plans |
ProjectOrchestrationState |
Stores phase, progress, and status of orchestration across the project |
OrchestrationEventRouter |
Listens to events and routes them to correct orchestrators |
AgentTaskDispatcher |
Sends commands to agents and tracks execution state |
ExecutionGraphBuilder |
Builds structured flow plans and sequences of tasks |
π How It Interacts with Other Domains¶
| Interacting Domain | Purpose of Interaction |
|---|---|
TemplateCatalog |
Applies scaffolding templates at correct points in orchestration. |
ProjectLifecycle |
Orchestrators respect and mutate lifecycle phases. |
AgentSystem |
Sends tasks, receives outcomes, and reacts accordingly. |
Coordinators |
Specific orchestrators delegate to specialized coordination components. |
Human Collaboration |
Requests manual approvals or confirmations via UI flows. |
π¦ Outputs of This Domain¶
- Emitted domain events:
TemplateApplied,AgentTaskScheduled,PhaseAdvanced, etc. - Project-level orchestration state objects
- ExecutionGraph logs and telemetry
- Audit trail for orchestration decisions and triggers
The Orchestration Domain enables ConnectSoft to operate autonomously at scale, managing thousands of agent tasks and execution flows in a reliable, traceable, and modular fashion. It abstracts the complexity of sequencing, dependency tracking, and human-agent collaboration into a declarative, event-driven control layer.
π§ Domain Model & Aggregates¶
This section defines the core domain model, entities, aggregates, and value objects of the Orchestration Domain. These models represent the state, identity, and behavior of project execution flows within the software factory.
The goal is to provide persistent, auditable, and event-driven models that orchestrators use to plan, track, and resume flows across agents and microservices.
π§© Core Aggregates¶
1. ProjectOrchestrationAggregate¶
| Property | Type | Description |
|---|---|---|
projectId |
Guid/String | Global project reference |
lifecyclePhase |
Enum | Current lifecycle phase (e.g., Planning, Infrastructure) |
executionGraph |
ExecutionGraph |
DAG of all orchestration tasks |
status |
Enum | Overall status: Pending, InProgress, Failed, Completed |
lastEventId |
Guid/String | Last domain event that modified the orchestration state |
createdAt |
DateTime | Time orchestration was initialized |
lastUpdated |
DateTime | Last update timestamp |
β This aggregate handles commands like:
ApplyTemplateToProjectAdvancePhaseDispatchAgentTask
π§± Entity: OrchestrationTask¶
Represents a single agent-triggered step or system action within a phase.
| Field | Description |
|---|---|
taskId |
Unique task identifier (correlated with traceId) |
type |
e.g. ApplyTemplate, GeneratePlan, ValidateTestSuite |
status |
Pending, InProgress, Completed, Failed |
triggerEvent |
Event that caused this task to be scheduled |
agentId |
Responsible agent/persona (e.g., developer-agent) |
inputs |
Input data (e.g., tokens, identifiers) |
outputs |
Result payload, status message |
dependsOn |
Other taskIds this task is dependent on |
emittedEvents |
List of emitted events after completion |
createdAt |
Timestamp |
πΈοΈ Value Object: ExecutionGraph¶
A Directed Acyclic Graph (DAG) of orchestration tasks for a given project phase.
- Ensures no circular dependencies
- Used by orchestrators to walk the graph and determine next executable nodes
- Persisted per
ProjectOrchestrationAggregate
Sample JSON Shape¶
{
"nodes": [
{
"taskId": "t1",
"type": "GenerateMicroservicePlan",
"dependsOn": []
},
{
"taskId": "t2",
"type": "ApplyTemplate",
"dependsOn": ["t1"]
},
{
"taskId": "t3",
"type": "RunTestPlan",
"dependsOn": ["t2"]
}
]
}
π§ Supporting Models¶
| Model | Purpose |
|---|---|
OrchestrationTriggerContext |
Captures full metadata of the trigger event or command |
AgentInvocationResult |
Outcome of an agent task (used to update task state) |
TaskFailureDetail |
Captures root cause, retry count, escalation flags |
PhaseTransitionRule |
Value object defining rules for phase advancement |
π§© Domain Events¶
| Event | Description |
|---|---|
AgentTaskScheduled |
A task was emitted and delegated to an agent |
AgentTaskCompleted |
Agent finished and result is stored |
PhaseAdvanced |
Project moved to next phase via orchestrator decision |
ExecutionGraphBuilt |
Orchestrator created or updated execution plan |
OrchestrationFailed |
Catastrophic failure during execution graph resolution |
π‘οΈ Invariants and Policies¶
- A task cannot start until all its dependencies are marked as
Completed - Tasks must belong to a valid phase and context-matching
projectId - Phase advancement is allowed only via completed transitions and policy checks
π Aggregate Behaviors¶
ProjectOrchestration.Apply(AgentTaskResult result)
β Update task status
β Emit next executable tasks
β Possibly emit PhaseAdvanced
ProjectOrchestration.AdvancePhase()
β Validate completion
β Reset executionGraph
This domain model provides the state backbone for intelligent orchestration, allowing the platform to execute large-scale, multi-agent, dependency-aware task graphs. It supports recoverable, observable, and declarative coordination across the software lifecycle.
π§ Key Use Cases¶
This cycle documents the foundational orchestration use cases that power automation within the ConnectSoft AI Software Factory. These are the scenarios where orchestrators direct agents, templates, lifecycle transitions, and human approvals to produce real SaaS-ready outcomes.
Each use case illustrates a real-world orchestration flow, triggered by events or user input, and resolved through multi-agent collaboration.
π Primary Orchestration Use Cases¶
1. New Project Initialization¶
Trigger: ProjectCreated
Orchestrator: ProjectBootstrapOrchestrator
Flow:
- Agent
VisionArchitectAgentgenerates high-level architecture - Agent
EnterpriseArchitectAgentproduces domain model - Agent
PlannerAgentproposes microservices - Agent
DeveloperAgentstarts applying templates - Phase advances to
InfrastructureReady
2. Microservice Assembly¶
Trigger: MicroservicePlanned
Orchestrator: MicroserviceAssemblyCoordinator
Flow:
- Template application: microservice template, database entity, service layer
- API Gateway configuration is applied
- Identity & permissions model linked (if needed)
- Domain events registered
- Post-generation validation triggers
TestOrchestrator
3. CI/CD Pipeline Setup¶
Trigger: MicroserviceGenerated or InfrastructureProvisioned
Orchestrator: CICDPipelineOrchestrator
Flow:
- Apply YAML pipeline templates for build, test, deploy
- Integrate secrets, container registry, and environments
- Agent verifies artifact flow
- Phase marked
PipelineReady
4. Infrastructure Provisioning¶
Trigger: LifecyclePhaseChanged β InfrastructurePhase
Orchestrator: InfrastructureProvisioningOrchestrator
Flow:
- Apply infrastructure templates (e.g., Bicep, ARM, Terraform)
- Use DevOpsAgent for provisioning and monitoring
- Validate resources deployed (App Service, Key Vault, DB)
- Emit
InfrastructureReady
5. Security & Identity Orchestration¶
Trigger: LifecyclePhaseChanged β SecurityPhase
Orchestrator: SecurityHardeningOrchestrator
Flow:
- Agent applies identity microservice (via template)
- RBAC roles and user flows provisioned
- OAuth2/OpenIddict scaffolding applied
- Validated by
SecurityAgentorQAAgent
6. Testing & Validation Flow¶
Trigger: ScaffoldingCompleted or MicroserviceAssemblyFinished
Orchestrator: TestingPlanOrchestrator
Flow:
- Generate SpecFlow or xUnit test suite
- Execute validation jobs via CI agent
- Confirm deployment environments
- Feedback loop into lifecycle β
QAVerified
π§ Special Orchestration Conditions¶
| Condition | Example |
|---|---|
| Human-in-the-loop approval | WaitForStudioConfirmation before applying auth system |
| Agent failure fallback | Retry with alternate plan or skip optional phase |
| Phase-specific filtering | Apply templates only if phase is InfrastructurePhase |
| Dependency chaining | Microservice A β Events β Microservice B must exist |
π Cross-Cycle Coordination¶
Some use cases are composed:
- Project Bootstrap β spawns β Microservice Assembly for each planned service
- Microservice Assembly β triggers β CI/CD Setup and Testing Flow
- Security Orchestration β can run in parallel but finalize only before
GoLivePhase
These key orchestration use cases form the reusable automation recipes of the ConnectSoft AI Software Factory. Each use case aligns to lifecycle phases, triggers agents, and drives end-to-end outcomes with minimal manual intervention, but full traceability and recovery.
π Bounded Contexts and Subdomains¶
This section defines the bounded contexts and logical subdomains of the Orchestration Domain. Each context encapsulates specific responsibilities and models that support clean, modular, and scalable orchestration in ConnectSoft's AI Software Factory.
These contexts enable teams to evolve orchestration capabilities independently, enforce boundaries between lifecycle, execution, and agent management, and align to Clean Architecture and DDD principles.
π§© Top-Level Bounded Contexts¶
| Context | Responsibility |
|---|---|
ExecutionPlanning |
Constructs and maintains task graphs for orchestrated flows |
LifecycleControl |
Advances project lifecycle states and validates phase transitions |
AgentTaskDispatch |
Issues commands to AI agents and receives outcomes |
EventTriggerRouting |
Listens to platform events and routes them to appropriate orchestrators |
CoordinationCore |
Hosts domain rules, orchestrator registry, and active flow metadata |
π· 1. ExecutionPlanning Context¶
- Builds and persists
ExecutionGraphDAGs per project - Supports dependency resolution, sequencing, and readiness
- Core object:
OrchestrationTaskGraph - Produces:
TaskScheduled,GraphBuilt,NodeUnblocked
π§© This context owns the logic of what can run next.
π· 2. LifecycleControl Context¶
- Integrates with the
ProjectLifecycledomain - Advances
lifecyclePhaseinProjectOrchestrationState - Triggers new orchestrators upon entering each phase
- Guards invalid transitions using
PhaseTransitionRules
π§© It ensures actions are allowed only in valid lifecycle stages.
π· 3. AgentTaskDispatch Context¶
- Dispatches serialized task contracts to AI agents
- Tracks task state updates (
InProgress,Completed,Failed) - Validates task identity, agent permissions, and retry rules
- Interfaces with:
AgentSystem,AgentGateway,AgentInbox
π§© It is the bridge between orchestrators and agent system contracts.
π· 4. EventTriggerRouting Context¶
- Subscribes to the global domain event bus
- Filters events relevant to orchestration domain
- Routes each event to the correct registered orchestrator(s)
- Prevents duplicate scheduling via trace IDs or idempotency keys
π§© This context powers reactive orchestration.
π· 5. CoordinationCore Context¶
- Maintains orchestrator metadata registry (e.g. bootstrap, microservice)
- Hosts orchestration policies, escalation paths, global retry settings
- Stores in-flight orchestration sessions and their trace context
- Links to human-initiated actions (e.g. Studio confirmations)
π§© It enables meta-level control and coordination of orchestrators.
π― Boundary Diagram¶
graph TD
EventBus -->|routes to| EventTriggerRouting
EventTriggerRouting --> CoordinationCore
CoordinationCore --> ExecutionPlanning
CoordinationCore --> LifecycleControl
CoordinationCore --> AgentTaskDispatch
AgentTaskDispatch -->|invoke| AgentSystem
LifecycleControl --> ProjectLifecycle
π« Anti-Patterns Avoided¶
| Anti-Pattern | Solution in ConnectSoft |
|---|---|
| Monolithic orchestrators | Contexts split by responsibility and trigger type |
| Agent-state leakage | AgentTaskDispatch is isolated + contracts explicit |
| Shared state mutation | Each context owns its internal aggregate invariants |
π§© Future Contexts (Pluggable)¶
| Planned Context | Purpose |
|---|---|
HumanConfirmationFlow |
Await Studio/UX confirmations for specific tasks |
OrchestrationMonitoring |
Stream traces, metrics, and health to observability services |
MultiProjectSync |
Manage dependencies and sequencing across multiple projects |
By structuring the Orchestration Domain into clear bounded contexts, the platform can scale coordination logic across thousands of projects and agents without coupling or complexity. Each subdomain enforces a clean separation of responsibilities and supports autonomous evolution.
π Trigger Sources and Event Routing¶
This cycle explains how orchestration flows are initiated by trigger sources, especially through event routing and reactive orchestration. Events act as the starting point for orchestrators to engage agents, apply templates, or advance lifecycle states.
The EventTriggerRouting context handles all orchestration triggers with traceable, idempotent, and tenant-isolated logic.
π¦ Primary Trigger Sources¶
| Source Type | Description |
|---|---|
| Domain Events | Events like ProjectCreated, MicroservicePlanned, PhaseChanged |
| Agent Events | Results from agent executions (e.g. PlanGenerated, TemplateApplied) |
| Lifecycle Events | Transitions in the project phase machine (e.g. Init β InfraReady) |
| Scheduled Jobs | Timers or CRON triggers for delayed orchestration (e.g. daily test run) |
| Manual Inputs | User actions in Studio (e.g. βApply Templateβ, βRun Agentβ) |
π‘ Event Routing Pipeline¶
flowchart TD
EventBus["π¨ EventBus"] --> Filter["EventFilter"]
Filter --> Router["EventRouter"]
Router --> Dispatch["OrchestratorDispatcher"]
Dispatch --> Orchestrator["Active Orchestrator"]
- EventFilter filters events based on type, tenant, and source.
- EventRouter determines orchestration targets.
- Dispatcher invokes registered orchestrator instance (stateful/stateless).
- TraceId is preserved for observability and replay.
π§© Event Handling Interface¶
Each orchestrator implements:
Where:
@eventis the raw payload (e.g.MicroservicePlanned)contextcontains tenant, traceId, phase, projectId, etc.
π Examples of Event-Orchestrator Pairs¶
| Domain Event | Routed Orchestrator |
|---|---|
ProjectCreated |
ProjectBootstrapOrchestrator |
MicroservicePlanned |
MicroserviceAssemblyCoordinator |
LifecyclePhaseChanged |
Phase-specific orchestrator (e.g. Infra) |
TemplateApplied |
Orchestrator may chain follow-up tasks |
AgentTaskFailed |
Retry handler or failure escalation |
π Chaining Events into New Triggers¶
Orchestrators can emit events that re-trigger other orchestrators, forming a composable workflow:
Each event may:
- Start a new orchestrator instance
- Trigger an existing orchestrator to advance its graph
π Idempotency & Deduplication¶
Handled via:
- Unique
eventIdper event - Deduplication store by
eventId+projectId - Optional replay detection for recovery scenarios
π§ Scheduled Orchestration (Timer-Based Triggers)¶
Used for:
- Re-running QA tests
- Scheduled publishing jobs
- Health checks and audits
Integrated with:
- Azure Durable Timers
- CRON expression metadata in orchestration definition
ScheduleTriggerOrchestratorwith auto-resume
ποΈ Studio-Initiated Manual Triggers¶
| Trigger Action | Routed To |
|---|---|
| βRegenerate Microserviceβ button | MicroserviceAssemblyCoordinator |
| βApply Template to Projectβ | TemplateApplierOrchestrator |
| βMark Phase Completeβ | LifecyclePhaseOrchestrator |
These are gated by:
- Tenant policies
- Feature flags
- Required confirmations or RBAC
π Monitoring Trigger Activity¶
| Metric | Description |
|---|---|
orchestration_triggers/sec |
Incoming routed events triggering orchestrators |
event_rejected_total |
Invalid or unauthorized events dropped |
manual_triggered_total |
Human-initiated orchestration starts |
orchestration_errors_total |
Failed starts or invalid graph conditions |
The event routing system makes ConnectSoft orchestration reactive, decoupled, and traceable. Whether triggered by events, schedules, or user inputs, orchestrators respond with declarative task flows to drive agents, templates, and services autonomously.
π ProjectBootstrapOrchestrator β Design and Flow¶
This section documents the structure, execution flow, and role of the ProjectBootstrapOrchestratorβthe entry point into ConnectSoftβs autonomous SaaS factory. It activates when a user or agent creates a new project, kicking off the initial orchestration sequence that sets the foundation for all downstream flows.
π When Itβs Triggered¶
Domain Event:
{
"type": "ProjectCreated",
"projectId": "proj-123",
"tenantId": "connectsoft",
"triggeredBy": "user:dmitry"
}
This event triggers:
π§© Primary Responsibilities¶
| Task | Description |
|---|---|
| 1οΈβ£ Load project metadata | Load initial domain model, architecture spec, and selected templates. |
| 2οΈβ£ Generate system-level plan | Trigger VisionArchitectAgent β system architecture + naming. |
| 3οΈβ£ Generate domain model plan | Trigger EnterpriseArchitectAgent β DDD entities + relationships. |
| 4οΈβ£ Plan microservices | Trigger PlannerAgent β suggest microservices and responsibilities. |
| 5οΈβ£ Dispatch microservice assembly | For each planned service, trigger MicroserviceAssemblyCoordinator. |
| 6οΈβ£ Advance lifecycle phase | Emit LifecyclePhaseChanged β PlanningCompleted. |
π Execution Flow¶
sequenceDiagram
participant Studio
participant EventBus
participant BootstrapOrchestrator
participant VisionArchitectAgent
participant EnterpriseArchitectAgent
participant PlannerAgent
participant LifecycleController
Studio->>EventBus: ProjectCreated
EventBus->>BootstrapOrchestrator: Trigger Start
BootstrapOrchestrator->>VisionArchitectAgent: Generate System Plan
BootstrapOrchestrator->>EnterpriseArchitectAgent: Generate Domain Model
BootstrapOrchestrator->>PlannerAgent: Plan Microservices
BootstrapOrchestrator->>EventBus: MicroservicePlanned (xN)
BootstrapOrchestrator->>LifecycleController: Advance to PlanningCompleted
π§ ExecutionGraph Example¶
[
{ "taskId": "T1", "type": "GenerateVisionPlan", "agentId": "vision-architect-agent" },
{ "taskId": "T2", "type": "GenerateDomainModel", "agentId": "enterprise-architect-agent" },
{ "taskId": "T3", "type": "PlanMicroservices", "agentId": "planner-agent", "dependsOn": ["T1", "T2"] }
]
π Phase Advancement¶
After all initial plans are complete, the orchestrator emits:
This enables downstream orchestrators to begin: MicroserviceAssembly, CI/CD, InfrastructureProvisioning.
π Security & Control¶
| Checkpoint | Enforcement Rule |
|---|---|
| Project template locked | Canβt proceed without template pre-configuration |
| Agent results timeout | If agents do not respond within threshold, escalate |
| Human-in-the-loop (optional) | Manual review of initial plan in Studio UI |
π§© Supporting Contracts¶
StartProjectBootstrapCommandAgentInvocationRequest β agentId, planType, projectMetadataMicroservicePlannedEvent β name, techStack, triggers assembly coordinator
π Observability & Telemetry¶
| Trace Field | Description |
|---|---|
traceId |
Preserved throughout project orchestration |
phaseChangeReason |
Derived from orchestrator β lifecycle domain |
agentFlowStatus |
Status of each plan-generating agent |
projectBootstrapTimeMs |
End-to-end execution duration |
π Recovery Behavior¶
- If domain model generation fails β retry with fallback prompt
- If microservice planning fails β escalate to manual UI confirmation
- ExecutionGraph supports partial plan recovery
The
ProjectBootstrapOrchestratorinitiates the first intelligent coordination for every new SaaS solution. By engaging multiple high-level agents and preparing the project lifecycle, it ensures ConnectSoft can scale from idea to infrastructure with autonomy, reliability, and traceability.
π MicroserviceAssemblyCoordinator β Flow, Graph, and Agent Sequencing¶
This cycle explains the design, responsibilities, and flow logic of the MicroserviceAssemblyCoordinator. This orchestrator is triggered once microservices are proposed by planning agents, and it takes responsibility for coordinating their scaffolding, integration, and validation across the entire software factory pipeline.
It is one of the most frequently invoked orchestrators, capable of operating on hundreds of microservices per project.
π When Itβs Triggered¶
Event:
{
"eventType": "MicroservicePlanned",
"microserviceId": "svc-abc123",
"projectId": "proj-xyz456",
"agentId": "planner-agent"
}
The orchestrator will:
- Retrieve the microservice definition
- Build a tailored execution graph
- Launch agent tasks in proper sequence
π§© Responsibilities¶
| Task | Description |
|---|---|
| π Load microservice blueprint | Pull planned name, responsibilities, and tokenized parameters |
| π¦ Apply code templates | Trigger DeveloperAgent to apply microservice template |
| π Link auth model | If flagged, invoke IdentityAgent to define roles and permissions |
| π Generate API Gateway route | Trigger GatewayAgent to add external/public routes |
| ποΈ Setup service bus events | Trigger IntegrationAgent for MassTransit or Azure Service Bus scaffolding |
| π Setup observability | Apply logging, tracing, health checks templates via DevOpsAgent |
| π§ͺ Run validation | Ensure compile + test passes, emit validation status |
π ExecutionGraph Example¶
[
{
"taskId": "M1",
"type": "ApplyMicroserviceTemplate",
"agentId": "developer-agent",
"dependsOn": []
},
{
"taskId": "M2",
"type": "ConfigureApiGateway",
"agentId": "gateway-agent",
"dependsOn": ["M1"]
},
{
"taskId": "M3",
"type": "ApplyObservabilityTemplates",
"agentId": "devops-agent",
"dependsOn": ["M1"]
},
{
"taskId": "M4",
"type": "RunMicroserviceValidation",
"agentId": "qa-agent",
"dependsOn": ["M2", "M3"]
}
]
π¦ Applied Templates (Sample)¶
template-microservice-cleanarchtemplate-logging-serilogtemplate-healthcheck-uitemplate-masstransit-setuptemplate-openiddict-authtemplate-api-gateway-proxy
π€ Involved Agents¶
| Agent | Role in Flow |
|---|---|
DeveloperAgent |
Scaffold full microservice with proper tokens |
GatewayAgent |
Add API gateway route and CORS policies |
IntegrationAgent |
Add event bus subscription and publish declarations |
DevOpsAgent |
Inject infrastructure and monitoring templates |
QAAgent |
Run SpecFlow/xUnit tests after scaffolding |
SecurityAgent (optional) |
Inject roles, scopes, and auth methods |
π Input Validation¶
Microservice plans must contain:
nameentityModelrequiresAuth(bool)exposedPublicly(bool)technologyStack(must match template compatibility)
Failure to validate results in:
MicroserviceOrchestrationFailedevent- Logging + optional UI feedback (for manual fixing)
π Result: Event Emission¶
Once completed successfully:
{
"eventType": "MicroserviceAssemblyCompleted",
"microserviceId": "svc-abc123",
"status": "Validated",
"generatedArtifacts": ["Dockerfile", "svc.csproj", "tests"]
}
This can trigger:
CICDPipelineOrchestratorTestOrchestrator- Optional manual review steps
π₯ Failure Handling¶
| Failure Point | Recovery Mechanism |
|---|---|
| Agent does not respond | Retry with backoff (max 3), then escalate |
| Invalid entity model | Skip generation, emit InvalidDomainPlan |
| CI validation fails | Retry after fix, or trigger manual approval |
π Traceability¶
All microservice orchestration:
- Includes
microserviceId,projectId,traceId - Is tracked via
OrchestrationExecutionGraph - Logs per agent output are stored in execution state
π§ Orchestration Design Patterns Used¶
- Fan-out pattern: MicroservicePlan spawns multi-agent parallel tasks
- Barrier synchronization: Validation starts only after all setup is done
- Event-sourced orchestration: Each result is emitted and observed independently
- Tenant-scoped orchestration: Ensures template and agent access rules are respected
The
MicroserviceAssemblyCoordinatororchestrates the end-to-end microservice setupβfrom planning to generation, infrastructure, gateway, and testingβby executing a well-structured multi-agent plan. It is critical for producing composable and production-ready services within minutes.
π TestingPlanOrchestrator β Coordinating Quality Assurance Flows¶
This section defines the structure and behavior of the TestingPlanOrchestrator, which governs automated test orchestration, QA validation, and test plan generation for microservices, domains, and end-to-end scenarios.
It is triggered after the scaffolding or modification of a microservice, template application, or infrastructure setup and ensures that the resulting system components are valid, verifiable, and production-grade.
π Trigger Points¶
| Trigger Event | Scenario |
|---|---|
MicroserviceAssemblyCompleted |
Validate service scaffolding correctness and behavior |
TemplateApplied (test suite) |
Execute associated validation steps |
PhaseAdvanced β QAPhase |
Run tests across all generated services and workflows |
Manual Test Trigger (Studio) |
Studio user clicks βValidate Microserviceβ |
π§© Responsibilities¶
| Task | Description |
|---|---|
| π Generate Test Suite Plan | Trigger QAAgent to generate SpecFlow or xUnit tests |
| π§ͺ Execute Test Plans | Dispatch test runs to CI agent (or test executor) |
| π Capture Test Results | Parse and interpret results from test runners |
| π’ Emit QA Status | Mark service/component as QAVerified, QAFailed, or Skipped |
| π Retry or Manual Escalation | Handle retries or trigger fallback confirmations |
π ExecutionGraph Sample¶
[
{
"taskId": "TQA1",
"type": "GenerateTestSuite",
"agentId": "qa-agent"
},
{
"taskId": "TQA2",
"type": "RunUnitTests",
"agentId": "qa-agent",
"dependsOn": ["TQA1"]
},
{
"taskId": "TQA3",
"type": "ValidateResultAndEmitStatus",
"agentId": "qa-agent",
"dependsOn": ["TQA2"]
}
]
π§ Supported Test Types¶
| Test Type | Triggering Agent | Target Components |
|---|---|---|
| Unit Tests | QAAgent |
Microservice application logic |
| BDD Tests (SpecFlow) | QAAgent |
Domain model + business processes |
| Integration Tests | QAAgent |
Microservices with DB or API gateway |
| Infrastructure Smoke Tests | DevOpsAgent |
Health checks, secrets, availability |
π¦ Applied Templates (Optional)¶
template-unit-tests-xunittemplate-bdd-specflowtemplate-test-fixturestemplate-database-testconfig
These templates are either applied manually or orchestrated from CI/CD flows.
π Validation Output Example¶
{
"eventType": "MicroserviceQAVerified",
"microserviceId": "svc-123",
"testCoverage": 82.6,
"testSuite": "SpecFlow",
"result": "Passed"
}
π Failure Scenarios¶
| Case | Recovery Flow |
|---|---|
| Tests fail due to missing endpoint | Re-run after service re-deployment |
| Incomplete test scaffold | Escalate to PlannerAgent for additions |
| Agent crash during test | Retry task up to 3 times |
π§ββοΈ Human-Driven QA (Optional)¶
In manual testing or hybrid environments:
QAReviewRequiredevent is emitted- ConnectSoft Studio shows a test report card
- User manually accepts or rejects the QA phase
- Recorded as
QAManuallyVerified
π Observability & KPIs¶
| Metric | Purpose |
|---|---|
qa_test_coverage_pct |
Average test coverage per microservice |
qa_pass_rate |
Percentage of successful test executions |
qa_fail_root_cause_count |
Common failures: setup, config, missing dep |
qa_execution_duration_ms |
Average runtime for all test plans |
π Security & Constraints¶
- All test plans are sandboxed
- Test inputs are generated using read-only or mockable data
- Secure services (auth, secrets) are mocked during validation
The
TestingPlanOrchestratorensures that autonomously generated microservices and infrastructure are safe, valid, and test-covered before being marked as production-ready. It completes the loop of planning β generation β validation in the ConnectSoft autonomous pipeline.
π SecurityHardeningOrchestrator β Identity, Permissions, and Auth Flow Setup¶
This section defines the responsibilities and execution flow of the SecurityHardeningOrchestrator, responsible for embedding identity, access control, and security services into each generated SaaS application. It coordinates agents and templates to apply auth systems, RBAC, OpenID Connect flows, and tenant-level permissioning.
This orchestrator ensures that security is a first-class, orchestrated concern, not an afterthought.
π Trigger Points¶
| Event Type | Scenario |
|---|---|
PhaseAdvanced β SecurityPhase |
Project enters the security hardening lifecycle phase |
MicroservicePlanned |
If service requires authentication |
Manual Trigger (Studio) |
βApply Identity Layerβ clicked by architect |
AuthTemplateApplied |
Further refinement orchestration needed |
π§© Responsibilities¶
| Task | Description |
|---|---|
| π‘οΈ Scaffold Identity Microservice | Apply OpenIddict or OAuth2 template using DeveloperAgent |
| π Define Roles, Claims, Scopes | Trigger SecurityAgent to define RBAC and OIDC claims |
| π Connect Microservices to Identity | Modify appsettings.json, policies, and add OIDC flows |
| ποΈ Apply API Authorization Policies | Secure endpoints with role-based decorators |
| π Secrets Injection & Key Vault | Trigger DevOpsAgent to bind secrets and scopes to Azure Key Vault |
| π§ͺ Validate Auth Flows | Trigger QAAgent to validate login, tokens, and authorization checks |
π ExecutionGraph Example¶
[
{
"taskId": "S1",
"type": "ScaffoldIdentityService",
"agentId": "developer-agent"
},
{
"taskId": "S2",
"type": "DefineRBACModel",
"agentId": "security-agent",
"dependsOn": ["S1"]
},
{
"taskId": "S3",
"type": "InjectSecrets",
"agentId": "devops-agent",
"dependsOn": ["S1"]
},
{
"taskId": "S4",
"type": "TestAuthenticationFlow",
"agentId": "qa-agent",
"dependsOn": ["S2", "S3"]
}
]
π Security Layer Templates Used¶
template-openiddict-auth-microservicetemplate-identity-scopes-rolestemplate-secrets-injectiontemplate-api-auth-policytemplate-oidc-client-config
Each template is parameterized by:
TenantIdServiceNamePublicClientRedirectUrisAdminRoles/UserRoles
π§ Agent Collaboration¶
| Agent | Responsibility |
|---|---|
DeveloperAgent |
Scaffold OpenIddict, configure client credentials |
SecurityAgent |
Define and inject claims, policies, and scopes |
DevOpsAgent |
Register secrets, configure identity URLs |
QAAgent |
Simulate login/token flows, test endpoint protections |
π Role & Permission Model¶
Security metadata includes:
{
"roles": ["Admin", "User", "QA"],
"claims": ["CanViewOrders", "CanManageUsers"],
"scopes": ["api.read", "api.write", "identity.profile"]
}
π§ͺ Validation Output Example¶
{
"eventType": "SecurityHardeningVerified",
"projectId": "proj-123",
"identityService": "svc-auth",
"accessControlStatus": "Passed",
"testedRoles": ["Admin", "User"]
}
π Recovery & Manual Review¶
| Scenario | Fallback Action |
|---|---|
| Role mismatch or missing claim | Escalate to Studio β security architect confirmation |
| Auth flow failure | Retry with alternate token or agent suggestion |
| Secret binding failed | Mark SecurityOrchestrationFailed, retry on next phase |
π Telemetry Fields¶
| Field | Purpose |
|---|---|
security_hardening_time_ms |
Total time for orchestration + agent tasks |
identity_templates_applied |
Count of security-related templates |
qa_auth_tests_passed |
Binary success/failure of final auth test suite |
The
SecurityHardeningOrchestratorelevates security to a built-in orchestration capability, ensuring each SaaS solution has fully wired authentication, secrets management, role enforcement, and test coverageβpowered by agents and templates.
π CI/CD Orchestration β Pipeline Template Application and Build Verification¶
This section documents the CI/CD pipeline orchestration process managed by the CICDPipelineOrchestrator, which configures automated build-test-deploy pipelines for generated microservices and infrastructure. It ensures that every scaffolded module is production-deployable through modern DevOps automation.
This orchestrator translates microservice metadata and templates into runnable Azure DevOps pipelines, including artifact publishing, testing, release, and multi-environment configuration.
π Trigger Points¶
| Event Type | Scenario |
|---|---|
MicroserviceAssemblyCompleted |
Microservice is ready and validated |
PhaseAdvanced β PipelinePhase |
Project enters the CI/CD pipeline setup lifecycle phase |
Manual Trigger (Studio) |
User clicks βSetup Build Pipelineβ in UI |
π§© Responsibilities¶
| Task | Description |
|---|---|
| π§± Apply Pipeline Templates | Scaffold azure-pipelines.yml and supporting build config files |
| π Configure Secrets and Tokens | Inject registry credentials, Azure login info, and token scopes |
| π§ͺ Inject Test and Linting Steps | Apply templates for dotnet test, specflow, stylecop etc. |
| π³ Configure Docker Build & Publish | Define Dockerfile, container registry auth, tagging strategy |
| π Push Initial Pipeline to Repo | Commit all CI/CD files to appropriate repo path |
| β Trigger Initial Build | Use DevOps API or CLI to start build and gather results |
π Applied Templates¶
template-ci-yaml-coretemplate-ci-xunit-steptemplate-ci-dockerizetemplate-ci-test-coveragetemplate-pipeline-var-grouptemplate-release-env-dev/staging/prod
All templates are parameterized using:
microserviceNamebuildStageDependenciesdeploymentSlotsartifactNameregistryUrl
π ExecutionGraph Sample¶
[
{
"taskId": "C1",
"type": "ApplyPipelineYamlTemplate",
"agentId": "devops-agent"
},
{
"taskId": "C2",
"type": "ConfigureDockerBuild",
"agentId": "devops-agent",
"dependsOn": ["C1"]
},
{
"taskId": "C3",
"type": "TriggerPipelineRun",
"agentId": "devops-agent",
"dependsOn": ["C2"]
},
{
"taskId": "C4",
"type": "CapturePipelineStatus",
"agentId": "qa-agent",
"dependsOn": ["C3"]
}
]
π§ Agent Roles¶
| Agent | Function |
|---|---|
DevOpsAgent |
Applies pipeline, deployment, docker, and environment templates |
QAAgent |
Validates build/test results and test coverage |
SecurityAgent |
Ensures credential injection is secured and auditable |
π§ͺ Validation Criteria¶
CI build is marked successful when:
- Pipeline succeeds with 0 build/test failures
- All required stages (test, coverage, build, publish) are present
- Docker image is built and pushed (if configured)
- Artifacts are linked to a release pipeline or environment
π¦ Example Output Event¶
{
"eventType": "PipelineSetupCompleted",
"microserviceId": "svc-orders",
"pipelineId": "azdevops-1981",
"status": "Success",
"coverage": 85.1,
"dockerImage": "acr.azurecr.io/svc-orders:1.0.0"
}
π Failure Handling¶
| Failure Condition | Remediation Path |
|---|---|
| YAML template missing or invalid | Retry with fallback template |
| Azure DevOps access denied | Escalate to human admin, emit PipelineAuthError |
| Test stage fails | Trigger QAAgent to re-run or request fix |
π Secrets & RBAC Constraints¶
- Use Azure Key Vault + DevOps Library Var Groups
- Pipelines are scoped per tenant, with namespace isolation
- All credentials injected via secure task variables or linked secrets
π Telemetry¶
| Metric | Purpose |
|---|---|
pipeline_setup_duration_ms |
Time to scaffold, commit, and validate CI/CD |
pipeline_failure_count |
Track agent/pipeline/template misalignment |
ci_artifact_publish_rate |
Track % of builds that produce valid artifacts |
build_success_rate |
Overall system quality metric |
The
CICDPipelineOrchestratortransforms microservice plans into runnable, auditable CI/CD pipelines with Docker builds, secrets injection, tests, and deploy stepsβentirely agent-driven and aligned to ConnectSoft's automation standards.
π Triggering Agents via Events β Orchestration-Driven Collaboration¶
This section explains how orchestrators in the ConnectSoft platform trigger agents through event-based contracts, enabling decoupled, traceable, and phase-aware collaboration between orchestration services and AI-driven agents.
Rather than calling agents directly, orchestrators emit structured commands as domain events, which are picked up by agent inboxes or agent gateways, making the system reactive and resilient.
π¦ Trigger Mechanism Overview¶
- Orchestrator evaluates task readiness from
ExecutionGraph. - It emits an
AgentTaskScheduleddomain event. - The agentβs event handler receives the task and executes it.
- The agent emits
AgentTaskCompleted,AgentTaskFailed, or follow-up domain events.
π Example Event Structure¶
πΈ Outgoing Agent Trigger¶
{
"eventType": "AgentTaskScheduled",
"traceId": "trace-xyz",
"projectId": "proj-123",
"agentId": "developer-agent",
"taskType": "ApplyTemplate",
"taskPayload": {
"templateId": "template-microservice",
"inputs": {
"serviceName": "orders",
"namespace": "connectsoft.svc.orders"
}
}
}
πΉ Expected Agent Response¶
{
"eventType": "AgentTaskCompleted",
"agentId": "developer-agent",
"taskId": "task-xyz",
"result": {
"status": "Success",
"outputs": {
"filesGenerated": 18,
"validationStatus": "Passed"
}
}
}
π Trigger-to-Response Lifecycle¶
sequenceDiagram
participant Orchestrator
participant EventBus
participant Agent
participant ProjectState
Orchestrator->>EventBus: AgentTaskScheduled
EventBus->>Agent: Receive Agent Task
Agent->>Agent: Execute Task Logic
Agent->>EventBus: AgentTaskCompleted
EventBus->>Orchestrator: Notify with result
Orchestrator->>ProjectState: Update ExecutionGraph
π Supported AgentTask Types¶
| Task Type | Description |
|---|---|
ApplyTemplate |
Applies a .NET, DevOps, or frontend template |
GeneratePlan |
Produces architectural/domain/infra plans |
RunTests |
Executes tests and validation scripts |
ConfigureServiceBus |
Generates or updates event bus topology |
InjectSecrets |
Applies secrets/config into environments |
π§ Agent Trigger Abstractions¶
To support multi-agent environments, all triggers are standardized with:
traceIdprojectIdtaskIdtaskTypepayloadagentPersona(e.g.,qa,devops,planner)phaseContext
Agents implement a single entrypoint like:
π§± Idempotency & Reliability¶
| Strategy | Implementation |
|---|---|
| Idempotency keys | Combine taskId + traceId to avoid reprocessing |
| Retry metadata | Task includes retry policy and max attempt thresholds |
| Agent acknowledgment | Agents must confirm receipt to avoid duplicate triggering |
π‘οΈ Error & Fallback Behavior¶
| Error Case | Orchestrator Reaction |
|---|---|
| Agent does not acknowledge task | Retry with exponential backoff |
| Agent reports permanent failure | Emit AgentTaskFailed β escalate or skip |
| Agent silent after N minutes | Mark task as Stalled, issue Studio notification |
π§© Event Traceability¶
All agent-triggered tasks include:
traceId: Linked to full orchestration treeagentId: AI persona or microservice-bound executorprojectId: Project-specific context for isolationphase: Lifecycle enforcement logicorigin:OrchestratorName + Phase + TaskIndex
π Observability¶
| Metric | Purpose |
|---|---|
agent_tasks_triggered_total |
All emitted task events |
agent_task_success_rate |
% of agent tasks completing successfully |
avg_agent_response_time |
Mean time between trigger and result |
agent_task_retry_count |
Count of retries per task type |
The orchestration layer triggers agents using structured domain events that carry clear intent, payload, context, and correlation metadata. This approach supports multi-agent concurrency, idempotency, observability, and policy-based enforcement at scale, allowing ConnectSoft to operate thousands of agent flows in parallel.
π Human-in-the-Loop Collaboration β Manual Approvals and Checkpoints in Orchestration¶
This section details how the orchestration domain integrates human oversight and decision-making checkpoints into autonomous agent workflows. Human-in-the-loop (HITL) features ensure safety, correctness, and user alignment by requiring manual approvals, confirmations, or guided inputs at key decision points.
This is essential in phases like security, production deployment, or domain modeling, where agents may require human confirmation or manual intervention before proceeding.
π Use Cases for Manual Collaboration¶
| Scenario | Example Triggered Action |
|---|---|
| Approving a generated domain model | Confirm entity relationships suggested by EnterpriseArchitectAgent |
| Reviewing an OAuth flow configuration | Approve OpenID client redirect URIs |
| Pushing to production | Require Studio user confirmation before DeployToProduction executes |
| Accepting fallback planning | User approves alternate path after agent failure or incomplete output |
| Resolving ambiguous template matches | Studio displays template choice preview before orchestration continues |
π€ Interaction Flow¶
sequenceDiagram
participant Orchestrator
participant StudioUI
participant User
participant EventBus
Orchestrator->>StudioUI: Emit HumanTaskRequested
StudioUI->>User: Prompt for action (Approve/Reject/Modify)
User->>StudioUI: Submits response
StudioUI->>EventBus: Emit HumanTaskResponseReceived
EventBus->>Orchestrator: Resume orchestration with result
π Event Examples¶
π‘ Task Requested¶
{
"eventType": "HumanTaskRequested",
"traceId": "trace-abc",
"projectId": "proj-123",
"taskId": "manual-456",
"title": "Approve OAuth Settings",
"description": "Confirm redirect URIs and token scopes for svc-auth",
"options": ["Approve", "Edit", "Reject"],
"requiredRole": "Architect"
}
π’ Task Response¶
{
"eventType": "HumanTaskResponseReceived",
"taskId": "manual-456",
"response": "Approved",
"submittedBy": "user:dmitry",
"timestamp": "2025-05-05T10:13:00Z"
}
π§ Orchestrator Responsibilities¶
| Task | Description |
|---|---|
Emit HumanTaskRequested event |
Define prompt details, roles, options |
| Pause orchestration flow | Block dependent execution graph node until manual input is received |
| Resume orchestration on response | Interpret response (e.g. continue, skip, modify) |
| Enforce RBAC for sensitive approvals | Restrict actions to authorized Studio users |
π¦ Human Task Metadata Model¶
| Field | Type | Description |
|---|---|---|
taskId |
string | Unique ID for the pending human task |
projectId |
string | Target project context |
prompt |
string | Display text to user |
options |
array | List of available actions (Approve, etc.) |
requiredRole |
string | e.g., βArchitectβ, βAdminβ, βReviewerβ |
traceId |
string | For correlation with orchestration flow |
π RBAC Enforcement¶
All manual approvals are:
- Mapped to project-level roles or ConnectSoft tenant policies
- Logged with traceId and userId for auditability
- Escalated if no response within timeout window (optional fallback)
β±οΈ Timeout & Escalation Rules¶
| Rule | Description |
|---|---|
responseTimeoutSec |
If exceeded, orchestration logs a TimeoutWarning |
fallbackAction |
Defined path: continue, skip, or abort orchestration |
escalationTarget |
Optional secondary user or group to notify on delay |
π Telemetry and Tracking¶
| Metric | Purpose |
|---|---|
human_tasks_requested_total |
Total prompts emitted across all orchestrators |
human_task_avg_response_time |
Average user reaction time |
manual_intervention_rate |
% of orchestrations requiring human input |
approval_rate_by_role |
Breakdown of response types by user role |
Human-in-the-loop checkpoints allow the orchestration layer to collaborate intelligently with real users, incorporating approval flows, overrides, and fallback paths. This hybrid pattern blends automation with safety, transparency, and stakeholder control.
π Execution Flow Tracking β Monitoring Graph State and Task Progress¶
This section defines how the orchestration layer tracks the real-time state of the execution graph, including the status of each orchestrated task, task dependencies, and orchestration progress.
This capability is essential for:
- Displaying orchestration progress in Studio
- Resuming interrupted flows
- Diagnosing issues across multi-agent pipelines
π¦ Execution State Model¶
At the core is the ExecutionGraph, a directed acyclic graph (DAG) where each node represents an orchestration task and its current state.
πΈ ExecutionGraphNode¶
{
"taskId": "T3",
"type": "RunUnitTests",
"status": "InProgress",
"agentId": "qa-agent",
"dependsOn": ["T1", "T2"],
"startedAt": "2025-05-05T12:00:00Z",
"completedAt": null
}
πΉ Task Status Values¶
| Status | Description |
|---|---|
Pending |
Not started; waiting for dependencies |
Ready |
All dependencies satisfied, awaiting dispatch |
InProgress |
Task triggered and running |
Completed |
Successfully executed |
Failed |
Executed and failed |
Stalled |
Hung or unresponsive |
Skipped |
Intentionally bypassed |
π Lifecycle of a Task Node¶
stateDiagram-v2
[*] --> Pending
Pending --> Ready: Dependencies Satisfied
Ready --> InProgress: Dispatched to Agent
InProgress --> Completed: AgentTaskCompleted
InProgress --> Failed: AgentTaskFailed
InProgress --> Stalled: Timeout
Failed --> Skipped: Manual Override
π§ Real-Time Graph Tracking¶
Each orchestrator maintains:
- Current graph snapshot in
ProjectOrchestrationState - Task status updates emitted as events:
TaskStarted,TaskCompleted, etc. - Full execution trace with timestamps, durations, agent metadata
This allows:
- UI rendering of dependency trees and flow status
- Time-based alerts and escalations
- Graph replay and debugging
π Example Progress Output¶
{
"executionStatus": {
"totalTasks": 6,
"completed": 4,
"inProgress": 1,
"failed": 1
},
"activeTasks": ["RunTests"],
"blockedTasks": ["ValidateCoverage"]
}
π ExecutionGraph Utilities¶
| Utility | Purpose |
|---|---|
GetNextExecutableTasks() |
Returns all Ready tasks based on current graph state |
MarkTaskComplete(taskId) |
Updates task + downstream dependencies |
TraceExecutionTree() |
Returns subgraph rooted at given task for inspection |
ReplayGraph(traceId) |
Simulates past execution with historic task statuses |
πΎ Persistence and Recovery¶
- Execution graphs are stored in a distributed state store (e.g., Redis, Cosmos DB)
- Tasks are updated atomically per orchestration context
- Supports pause-resume, multi-tenant isolation, and partial replay
π Metrics & Observability¶
| Metric | Description |
|---|---|
orchestration_graph_depth |
Max depth of dependency chain |
avg_task_duration_by_type |
Aggregated task execution durations |
stalled_task_count |
Tasks stuck in InProgress too long |
orchestration_completion_ratio |
% of completed tasks in each graph |
π Role in Orchestration Studio¶
Execution flow is visualized:
- As a live DAG (Mermaid or graph DB-based)
- With task statuses, agent avatars, and time markers
- Filtered by microservice, template, or phase
The
ExecutionGraphis the real-time memory and heartbeat of an orchestrator, enabling detailed tracking, dependency management, replay, and debugging across large-scale AI-driven software generation.
π Orchestration Failure Handling and Recovery Patterns¶
This section outlines how the orchestration layer detects, logs, and recovers from partial failures, agent crashes, invalid templates, or execution timeouts. It establishes a fault-tolerant foundation for ConnectSoft to operate at scale, ensuring orchestration flows are resilient and recoverable.
π₯ Common Failure Scenarios¶
| Scenario | Description |
|---|---|
| π§ Agent fails to respond | Agent crashes, doesn't acknowledge task, or fails execution |
| β±οΈ Task execution timeout | Task stuck in InProgress state beyond allowed threshold |
| π Retry limit exceeded | Max retries reached without success |
| π Security or RBAC violation | Task or event rejected due to permission error |
| β Template invalid or missing | Code generation fails due to missing files, tokens, or logic errors |
| π Downstream dependency failure | Parent task or orchestrator fails; dependent flow blocked |
π Recovery Patterns¶
πΉ 1. Retry with Backoff¶
- Each task includes a retry policy (max attempts, delay, exponential factor)
- On
AgentTaskFailed, orchestrator may retry automatically:
πΉ 2. Skip and Continue¶
- For non-blocking tasks (e.g. test coverage, analytics), orchestrator can skip and mark as
Skipped - Downstream tasks proceed with a warning
- Logged as
PartialOrchestrationCompleted
πΉ 3. Human Escalation¶
- Orchestrator emits
ManualInterventionRequired -
User in Studio can choose to:
-
Retry manually
- Replace input
- Cancel orchestration
πΉ 4. Fallback Orchestrator Invocation¶
- Alternate orchestrator can be triggered if primary fails
- E.g., use
BasicPlannerAgentinstead ofPlannerAgenton failure
π§± Error Classifications¶
| Type | Examples | Strategy |
|---|---|---|
| Recoverable | Timeout, missing resource, retryable error | Retry or skip |
| Partially recoverable | Test fail, missing optional templates | Warn and continue |
| Fatal | Invalid project model, agent not available | Escalate to user, stop flow |
| Policy violation | RBAC denied, secret injection blocked | Abort task, log audit trail |
π Example Failure Event¶
{
"eventType": "OrchestrationTaskFailed",
"projectId": "proj-abc",
"taskId": "T4",
"reason": "AgentTimeout",
"attempts": 3,
"maxAttempts": 3,
"traceId": "trace-123"
}
π Monitoring & Alerts¶
| Metric | Purpose |
|---|---|
task_failures_total |
Aggregate failure count by agent/task type |
task_retry_attempts_avg |
Average retries before success or escalation |
stalled_tasks_total |
Number of hung/incomplete tasks |
orchestration_abort_rate |
% of flows terminated due to unhandled failures |
π‘οΈ Safety Policies¶
| Rule | Description |
|---|---|
| Max stalled time (per task) | Default 15 min β escalate or abort |
| Max retries per orchestrator | Default 3 attempts, tracked per taskId |
| Escalation TTL (time to live) | Manual intervention expires after 2h, system continues |
| Flow lock on repeated failure | Prevent infinite loops, temporarily block execution |
π Resumability¶
- All orchestrators store checkpointed graph state
- Flows can be resumed on platform reboot or after human input
- A
traceIdmaps the full execution path for diagnostics
The orchestration layer incorporates structured failure detection, automatic retries, human escalation, and fallback strategies to guarantee consistent outcomes across thousands of orchestrated tasks and agent workflowsβeven in unpredictable, real-world conditions.
π Orchestration Observability β Logs, Traces, and Telemetry Design¶
This section defines how orchestration flows are made observable, diagnosable, and traceable across distributed agents, services, and lifecycle stages. It provides the foundation for real-time monitoring, alerting, and retrospective debugging in the ConnectSoft AI Software Factory.
Observability is implemented using structured logs, correlated traces, execution metrics, and optional visual graphs in Studio.
π¦ Observability Layers¶
| Layer | Description |
|---|---|
| π Structured Logging | Agent and orchestrator log records with metadata |
| π Execution Tracing | traceId used to correlate all agent tasks + events |
| π Metrics | Prometheus-style counters, gauges, histograms |
| π§ Semantic Audit Trail | Describes orchestration intent and human actions |
| πΌοΈ Visual Graph UI | Studio renders orchestrator DAGs with live status |
π§Ύ Structured Logs¶
Every task and orchestrator emits logs with consistent schema:
{
"timestamp": "2025-05-05T15:15:00Z",
"traceId": "trace-abc",
"projectId": "proj-xyz",
"taskId": "T1",
"agentId": "developer-agent",
"logLevel": "Info",
"message": "Applied template successfully",
"durationMs": 3125
}
β Logged to:
- Elasticsearch
- Application Insights
- Azure Monitor (per tenant)
π Key Metrics¶
| Metric Name | Type | Description |
|---|---|---|
orchestrations_started_total |
Counter | New orchestrations launched |
agent_task_latency_ms |
Histogram | Time between dispatch and response |
template_applied_count |
Counter | Number of template applications per orchestrator |
orchestration_active_total |
Gauge | Currently running orchestrations |
agent_failure_rate |
Gauge | Percent of failed tasks per agent |
qa_pass_rate |
Gauge | QA validation success ratio |
π Metrics are exported via OpenTelemetry or Prometheus-compatible endpoints.
π Distributed Tracing (TraceID)¶
The traceId:
- Is generated per orchestration flow (UUID or ULID)
- Propagated to every event, agent task, and response
- Enables full-path replay in monitoring systems
Each agent logs:
traceId,taskId,phase,agentId,tenantId
π‘ Used by:
- OpenTelemetry trace viewers
- Azure Monitor / App Insights application maps
- Orchestration Graph visualizer in Studio
π§ Semantic Audit Trail¶
Every significant decision or manual action is recorded:
{
"type": "ManualApproval",
"actor": "user:dmitry",
"action": "Approved domain model plan",
"phase": "Planning",
"timestamp": "2025-05-05T13:50:00Z",
"traceId": "trace-xyz"
}
Enables:
- Post-mortem audits
- Governance compliance
- Replay or rollback of orchestrations
πΌοΈ Studio Integration¶
Orchestration Studio UI shows:
- DAG view of all orchestration tasks and dependencies
- Task status: pending, running, complete, failed
- Logs grouped by
traceId,taskId,agentId - Inline preview of agent output (e.g., plan, template, test result)
Studio uses:
- WebSocket/live polling for updates
- Aggregated metrics for dashboards
π¦ Alerting Rules (Optional)¶
| Rule | Alert Description |
|---|---|
agent_task_latency_ms > 30000 |
Agent not responding in time |
orchestration_failure_rate > 5% |
High error ratio in last hour |
template_failure_count > 0 |
Template generation issues |
Connected to:
- Azure Alerts
- Grafana dashboards
- Slack/Teams for critical projects
Orchestration observability transforms the platform from βautonomous but opaqueβ to transparent, debuggable, and trustworthy. It supports both engineers and Studio users in understanding how software is generated, where failures happen, and how systems are evolving over time.
π Coordinators vs. Orchestrators β Structural Patterns and Runtime Roles¶
This section clarifies the architectural distinction between Orchestrators and Coordinators in the ConnectSoft AI Software Factory. While often related, they serve different roles in the orchestration ecosystemβorchestrators execute bounded flows, whereas coordinators manage orchestration composition, delegation, and runtime control across multiple flows or domains.
Understanding this separation is key to maintaining modular, scalable, and composable orchestration logic.
π Core Distinction¶
| Feature | Orchestrator | Coordinator |
|---|---|---|
| Scope | Single flow (e.g., Bootstrap, Security) | Multiple orchestrators (e.g., by domain or project) |
| Lifecycle | Per event / per traceId | Long-lived (per project or tenant scope) |
| Logic Focus | Flow definition, graph execution | Orchestration registry, session memory, escalation handling |
| State Ownership | Task graph and current node state | Orchestration status, cross-flow relationships |
| Trigger Mechanism | Event-driven (Domain Events) | Passive or registry-based; called by orchestrators |
| Recovery Role | Handles partial graph recovery | Manages cross-orchestrator recovery or overrides |
π§© Examples in ConnectSoft¶
πΈ Orchestrators¶
| Name | Purpose |
|---|---|
ProjectBootstrapOrchestrator |
Triggers agents to create architecture and domain plans |
MicroserviceAssemblyCoordinator |
Orchestrates microservice scaffolding |
SecurityHardeningOrchestrator |
Applies roles, scopes, identity setup |
CICDPipelineOrchestrator |
Applies pipeline templates and builds services |
πΉ Coordinators¶
| Name | Role |
|---|---|
ProjectOrchestrationCoordinator |
Tracks orchestration state per project |
MicroserviceExecutionCoordinator |
Manages graph state and agent routing per service |
HumanApprovalCoordinator |
Manages pending human decisions and Studio responses |
FallbackCoordinator |
Substitutes failing orchestrators or agents |
π§± Coordinator Design Elements¶
-
π Orchestrator Registry Maps event types and lifecycle stages to orchestrator classes β Used by
EventTriggerRouter -
π§ State Tracker / Store Central store for orchestration execution state (e.g. CosmosDB, Redis)
-
π‘ Agent Delegation Router Supports forwarding agent tasks between orchestrators when needed
-
π¦ Policy Enforcer Applies retry, escalation, fallback, or skip policies globally
π§ Example Runtime Relationship¶
graph TD
EventBus --> OrchestratorA
EventBus --> OrchestratorB
OrchestratorA --> Coordinator
OrchestratorB --> Coordinator
Coordinator --> StateStore[(OrchestrationState)]
Coordinator --> Studio
- Orchestrators emit results
- Coordinator persists metadata
- Studio queries coordinator state
- Coordinator may retry/reassign work
π¦ Shared Concepts¶
| Concern | Who Owns It | Behavior |
|---|---|---|
| ExecutionGraph | Orchestrator | Task-level flow structure |
| Project Phase | Coordinator | Cross-orchestrator lifecycle advancement |
| Trace ID | Shared | Used by all logs, events, agents |
| Agent Delegation | Coordinator | May reroute based on orchestration state |
π Benefits of Separation¶
| Benefit | Description |
|---|---|
| π Observability | Coordinators track orchestration evolution across flows |
| β»οΈ Reusability | Same coordinator supports different orchestrators |
| π§© Modularity | Orchestrators can be independently versioned/swapped |
| π₯ Isolation | Faulty orchestrator doesnβt corrupt shared state |
Coordinators provide long-running oversight and state tracking across orchestrators, while orchestrators define task-specific, event-driven execution logic. This distinction ensures ConnectSoftβs orchestration model remains scalable, traceable, and easy to extend in both human and agent-driven systems.
π Event Sources and Event Contracts for Orchestration Layer¶
This section documents the event-driven architecture of the orchestration domainβfocusing on the event types, publishers, schemas, and routing rules that allow orchestrators to act reactively, maintain state consistency, and engage agents or human users automatically.
ConnectSoft orchestrators are fully event-sourced, and rely on consistent contracts and schemas for interoperability, traceability, and extensibility.
π Core Event Sources¶
| Source Component | Description |
|---|---|
| π§ Agents | Emit task results (AgentTaskCompleted, PlanGenerated) |
| π§± Templates Engine | Emit events like TemplateApplied, TemplateFailed |
| π€ Studio Actions | Emit ManualTaskApproved, TriggerRequested, OverrideSubmitted |
| π¦ Infrastructure Executors | Emit DeploymentCompleted, SecretInjected, PipelineStarted |
| π Lifecycle Controller | Emits LifecyclePhaseAdvanced, PhaseFailed, etc. |
All are pushed into a central Event Bus (e.g., Azure Event Grid, Kafka, or MassTransit abstraction).
π Event Contract Schema¶
Every orchestration-related event uses a normalized schema:
{
"eventType": "AgentTaskCompleted",
"eventId": "evt-123",
"traceId": "trace-xyz",
"projectId": "proj-abc",
"source": "developer-agent",
"payload": {
"taskId": "T1",
"status": "Success",
"outputs": { "filesGenerated": 14 }
},
"timestamp": "2025-05-05T16:40:00Z"
}
π¦ Standard Orchestration Events¶
| Event Type | Producer | Used For |
|---|---|---|
ProjectCreated |
Studio / API | Bootstrap orchestrator entrypoint |
AgentTaskScheduled |
Orchestrator | Trigger specific agent |
AgentTaskCompleted |
Agent | Resume graph / validate success |
AgentTaskFailed |
Agent | Retry / escalate / abort logic |
TemplateApplied |
Agent or Template Svc | Mark template success and artifact refs |
MicroservicePlanned |
PlannerAgent | Triggers MicroserviceAssembly flow |
PipelineSetupCompleted |
DevOpsAgent | Continue to deployment phase |
LifecyclePhaseAdvanced |
Lifecycle Coordinator | Begin new orchestrator in next phase |
π§© Custom Domain Events¶
Orchestrators may define custom events such as:
SecurityScopeBoundGatewayRouteRegisteredEntityRelationshipConfirmedQAVerificationFailedReleaseCandidateReady
Each includes:
projectId,tenantId,traceId- Optional
microserviceId origin: orchestrator or agent name
π‘ Event Routing Rules¶
EventBus β Router β Dispatcher β Orchestrator
flowchart TD
EventBus --> Filter
Filter --> Router
Router --> OrchestratorA
Router --> OrchestratorB
- Filter based on tenant, type, and trace
- Router maps eventType β orchestrator handlers
- Each orchestrator subscribes only to events in its scope
β Event Contract Guidelines¶
| Rule | Enforcement |
|---|---|
Must include traceId |
Enables full flow traceability |
eventId must be unique |
Prevents duplicate processing |
| Payload should be strongly typed | Validate before dispatch to orchestrator |
| Events are immutable | No updates; always emit follow-up events instead |
| Backward-compatible versions only | Old orchestrators must tolerate schema extensions |
π Observability of Events¶
All events are:
- Logged with correlation to
taskId,orchestratorId,agentId - Exposed via event stream visualizers in Studio
- Persisted in an Event Store (or via audit stream)
Example telemetry:
The orchestration layer thrives on a robust event contract system. By ensuring every componentβfrom agents to Studio to infrastructureβcommunicates via consistent, observable events, the ConnectSoft platform becomes inherently extensible, debuggable, and adaptive to change.
π Lifecycle Phase Transitions and Phase-Gated Orchestration¶
This section defines the lifecycle model used in ConnectSoftβs orchestration layer and how phase-based orchestration ensures each project progresses through a safe, orderly, and autonomous set of generation, validation, and deployment stages.
Lifecycle phases act as gates and milestones that control which orchestrators are activated and what agents or human actions are permitted at each point.
ποΈ Standard Project Lifecycle Phases¶
| Phase Name | Description |
|---|---|
InitializationPhase |
Project created; orchestrator bootstrap begins |
PlanningPhase |
Architecture, domain model, microservice planning |
AssemblyPhase |
Code generation, template application, configuration |
SecurityPhase |
Identity setup, roles, claims, secrets, and policies |
ValidationPhase |
QA test orchestration, coverage, and human approvals |
PipelinePhase |
CI/CD pipeline generation and trigger setup |
DeploymentPhase |
Infrastructure and deployment to target environments |
ObservabilityPhase |
Logging, tracing, alerts, dashboards configured |
DeliveryCompletePhase |
All systems validated and project marked complete |
Each phase has:
- Entry event (
LifecyclePhaseAdvanced) - Optional orchestrator launch
- Allowable agent/task types
π Phase Transition Mechanism¶
sequenceDiagram
participant Coordinator
participant EventBus
participant Orchestrator
participant ProjectState
Orchestrator->>Coordinator: RequestPhaseAdvance("AssemblyPhase")
Coordinator->>ProjectState: UpdatePhase
Coordinator->>EventBus: Emit LifecyclePhaseAdvanced
EventBus->>Orchestrator: Trigger next orchestrator(s)
π LifecyclePhaseAdvanced Event¶
{
"eventType": "LifecyclePhaseAdvanced",
"projectId": "proj-abc",
"from": "PlanningPhase",
"to": "AssemblyPhase",
"triggeredBy": "bootstrap-orchestrator",
"timestamp": "2025-05-05T17:05:00Z"
}
π§± Phase Constraints¶
| Phase | Allowed Orchestrators | Disallowed Tasks |
|---|---|---|
PlanningPhase |
DomainModelOrchestrator, VisionPlanOrchestrator |
No template generation or pipelines |
SecurityPhase |
SecurityHardeningOrchestrator |
Cannot deploy or release to prod |
ValidationPhase |
TestingPlanOrchestrator, QAAgent |
Agent planning is locked |
DeploymentPhase |
DeployOrchestrator |
Planning and architecture changes blocked |
π Phase Enforcement Rules¶
- Tasks outside current phase β rejected or postponed
- Manual override allowed for approved roles (Studio, Admins)
- Phase transitions validated by Coordinator via dependency checks
β Phase Advancement Triggers¶
| Trigger Type | Example |
|---|---|
| Orchestrator Emits Event | MicroserviceAssemblyCoordinator completes |
| Agent Confirms Result | QAAgent passes all validations |
| Human Approval in Studio | User accepts domain model or security scaffold |
| Time-based Trigger | Auto-advance after successful idle period (optional) |
π Phase-Aware Observability¶
| Metric | Description |
|---|---|
active_phase_distribution |
Breakdown of projects by current lifecycle phase |
avg_time_per_phase |
Duration trends per phase |
blocked_tasks_due_to_phase |
How many tasks were paused due to phase limits |
π Studio UI Integration¶
Lifecycle phase is:
- Displayed as a vertical timeline on each project
- Each phase clickable β shows orchestrator status
- Users can trigger phase advancement (if permitted)
The lifecycle phase system gives ConnectSoft orchestration governance, ensuring correct task sequencing, reducing agent overload, and enabling human understanding of a projectβs journey. It is the backbone of autonomous software generation at scale.
π Secrets, Configuration, and Tenant-Aware Orchestration¶
This cycle outlines how the orchestration layer in ConnectSoft handles secrets management, configuration injection, and tenant-level isolation. These capabilities ensure that each orchestrated project or microservice:
- Uses the correct settings per tenant/environment.
- Safely accesses secrets via secure channels.
- Avoids configuration leakage or cross-tenant violations.
π Core Concepts¶
| Capability | Description |
|---|---|
| π Secrets Injection | Inject credentials, tokens, and secure settings into templates and pipelines |
| βοΈ Config Mapping | Populate microservice appsettings.*.json from structured config definitions |
| π§ Tenant Isolation | All orchestration and agent flows scoped to tenant IDs |
| π§ Config Validation | Ensure agents receive only contextually valid settings |
ποΈ Configuration Structure¶
Each project has a ProjectConfiguration object structured as:
{
"tenantId": "tenant-abc",
"projectId": "proj-123",
"env": "dev",
"secrets": {
"ServiceBusConnectionString": "@vault:sb-dev",
"OAuthClientSecret": "@vault:auth-secret"
},
"variables": {
"EnvironmentName": "Development",
"EnableTelemetry": true
}
}
@vault:indicates secrets are pulled from a tenant-specific Azure Key Vault or equivalent.
π Secrets Injection Flow¶
- Orchestrator or agent requests secret token via
SecretsManagerinterface. - Vault integration retrieves actual value securely (e.g., via managed identity).
-
Secret is injected into:
-
appsettings.json - DevOps pipeline variable group
- Dockerfile ENV variable (if required)
- Secrets never appear in logs or task payloads.
π§ Tenant-Aware Routing¶
Every event, task, and orchestration includes:
tenantIdprojectIdtraceId
Routing logic ensures:
- Tasks are dispatched to agents within the same tenant context.
- Secrets/configs are retrieved from tenant-scoped stores.
- No template or artifact crosses tenant boundaries.
π Example: Agent Receives Tenant Configuration¶
{
"agentId": "developer-agent",
"taskType": "ApplyTemplate",
"tenantId": "tenant-abc",
"config": {
"EnableOpenTelemetry": true,
"ServiceBusConnectionString": "@vault:sb-dev"
}
}
π Key Vault Integration¶
| Feature | Description |
|---|---|
| Vault per tenant | Each tenant gets isolated Key Vault instance/prefix |
| Secret reference syntax | @vault:secret-name, resolved at runtime |
| Auditable access | All retrievals logged with traceId, agentId |
| Rotation support | Supports secret updates without re-templating |
π Configuration Propagation Targets¶
| Target | Injected Values |
|---|---|
| Microservice config files | appsettings.json, .env, YAML files |
| CI/CD pipelines | Azure DevOps variable groups or secret variables |
| Agent inputs | Passed in taskPayload.config |
| Test environments | BDD/environment fixtures |
π Metrics and Tracking¶
| Metric | Description |
|---|---|
secrets_requested_total |
Count of secrets pulled from vault |
config_injection_failures |
Failed config merge/injection attempts |
tenant_task_routing_accuracy |
% of tasks dispatched to correct tenant context |
vault_latency_ms |
Latency of secret resolution requests |
πΌοΈ Studio UI Integration¶
- Tenant-scoped environment variables visible per project
- Secure secrets never shown; only reference keys
- Users can edit non-secret configuration via web UI
- Config overrides visible in orchestration previews
This tenant-aware configuration and secrets system ensures every generated service or pipeline remains secure, contextual, and tenant-isolated, while supporting agent autonomy and auditability across environments.
π Orchestration Timeouts, Parallelism, and Scheduling Controls¶
This section describes how the orchestration layer handles execution timing, parallelism, and scheduling strategies for tasks and flows. These controls ensure that ConnectSoft can orchestrate large-scale, multi-agent software generation efficiently, while avoiding resource contention, deadlocks, and long-running failures.
β±οΈ Timeout Strategies¶
Each orchestrated task includes configurable timeout metadata:
| Timeout Type | Scope | Default Value |
|---|---|---|
| Task timeout | Per execution graph node | 15 minutes |
| Agent acknowledgment | After AgentTaskScheduled |
30 seconds |
| Human task TTL | For HumanTaskRequested |
2 hours |
| Orchestration TTL | Whole orchestration flow | 12β24 hours |
β³ Timeout triggers:
TaskStalledAgentNotAcknowledgedOrchestrationExpired
π Retry + Delay¶
Tasks include backoff strategies:
This helps recover from:
- Agent overload
- Temporary failures (vault access, repo lock)
- CI queue slowness
π Parallelism Model¶
Each orchestrator uses a task scheduling engine to determine:
- Which tasks can be executed concurrently (based on DAG)
- Maximum in-flight tasks per orchestrator or tenant
- Per-agent concurrency limits
πΈ Sample DAG¶
graph TD
T1 --> T2
T1 --> T3
T2 --> T4
T3 --> T4
β Tasks T2 and T3 run in parallel after T1.
βοΈ Execution Scheduler Parameters¶
| Parameter | Description |
|---|---|
maxConcurrentTasks |
Orchestrator-wide throttle (e.g. 5) |
agentConcurrencyLimit |
Per-agent cap (e.g. QAAgent: 3, DevOpsAgent: 2) |
phaseExecutionWindow |
Allowed time window per phase (e.g. 6 hours) |
schedulingStrategy |
FIFO, priority-based, or cost-aware (future extension) |
π Orchestration Scheduling (Optional)¶
Orchestrators can be:
- Scheduled to run at off-peak times
- Throttled across tenants to balance resource usage
- Triggered only if quotas/costs permit (e.g., Azure budget guardrails)
π Monitoring Metrics¶
| Metric | Purpose |
|---|---|
avg_task_execution_time |
Overall performance insight |
tasks_executed_in_parallel |
Measures orchestration throughput |
task_timeout_count |
Tracks hanging or slow tasks |
parallelism_utilization_ratio |
Are concurrency limits being saturated? |
Time-bound, concurrent, and controlled execution is crucial to ConnectSoftβs orchestration model. With graph-aware parallelism, per-agent limits, and timeout safety nets, the system supports high-throughput, fault-tolerant, and resource-optimized software generation.
π Multi-Project Orchestration β Dependency Trees and Cascading Flows¶
This section explains how the orchestration layer supports multi-project coordination, allowing ConnectSoft to manage project families, shared modules, and cascading orchestration flows across related workspaces. It enables reuse, impact-aware propagation, and orchestrated project-of-projects execution.
π Project Relationship Types¶
| Relationship Type | Description |
|---|---|
| π ParentβChild | A core platform project triggers several extension projects |
| π Shared Module | A library (e.g., core-domain, auth) reused across many services |
| π§± Layered Projects | Infrastructure β core services β feature modules β UI layers |
| πͺ Cross-Dependency | One projectβs success/failure impacts others |
ποΈ Example Structure¶
π¦ platform-core (root project)
β£ π¦ service-auth
β£ π¦ service-orders
β π¦ ui-backoffice
All children must wait until core finishes.
π§ Multi-Project Coordinator Roles¶
| Capability | Description |
|---|---|
| π§ Trigger child orchestrations | Launches orchestrators on dependent projects |
| π Propagate state changes | Updates downstream projects when parent phase completes |
| β οΈ Manage blocking errors | Prevents cascading if a shared base fails |
| π Render project trees in Studio | Shows hierarchy and real-time orchestration state |
π Trigger Cascades¶
{
"eventType": "OrchestrationCascadeTriggered",
"parentProjectId": "core-platform",
"triggeredChildren": ["service-orders", "service-auth"]
}
Used when:
- Parent phase reaches
DeliveryCompletePhase - Core template changes
- Human confirmation approves rollout
π§© Dependency Graph Model¶
Each project holds metadata like:
{
"projectId": "svc-orders",
"dependsOn": ["platform-core"],
"triggerOnUpstreamPhase": "AssemblyPhase"
}
- Coordinator checks all upstreams have completed phase X
- Child orchestration begins automatically or via Studio button
π Sample Use Case¶
Updating core domain entities:
platform-coreupdated with newOrderStatusenum.- Studio triggers partial regeneration of
service-ordersandui-backoffice. - Only impacted orchestrators run.
- QA phase verifies compatibility.
βοΈ Orchestrator Reuse¶
- Child projects often reuse shared orchestrators with different config
- Coordinators ensure they receive updated configs, secrets, and phases
π Metrics and Observability¶
| Metric | Description |
|---|---|
project_dependency_depth |
How many hops exist between root and leaf projects |
cascaded_orchestration_count |
Number of orchestrations triggered by upstreams |
blocked_due_to_upstream |
Projects awaiting parent completion |
multi_project_fail_ratio |
Rate of failed orchestrations in cascaded runs |
πΌοΈ Studio Integration¶
- Shows tree or graph view of project relationships
- Allows triggering children selectively or in bulk
- Visual phase alignment checker
With multi-project orchestration, ConnectSoft supports platform-style SaaS ecosystems, where modular projects influence each other. Coordinators manage flow integrity, prevent premature rollout, and ensure synchronization across domains and lifecycles.
π Finalization, Cleanup, and Delivery Notifications¶
This final orchestration section describes how ConnectSoft wraps up a projectβs lifecycle after successful orchestration completionβhandling state finalization, delivery artifacts, cleanup operations, and notifications to agents, users, and external systems.
This ensures a project exits automation cleanly, consistently, and transparently, ready for deployment, testing, or handoff.
β Finalization Flow¶
sequenceDiagram
participant Orchestrator
participant Coordinator
participant EventBus
participant Studio
participant NotificationService
Orchestrator->>Coordinator: RequestFinalization
Coordinator->>EventBus: Emit ProjectDeliveryComplete
EventBus->>Studio: Update project status
EventBus->>NotificationService: Send delivery alerts
Orchestrator->>CleanupAgent: Trigger cleanup routines
π ProjectDeliveryComplete Event¶
{
"eventType": "ProjectDeliveryComplete",
"projectId": "proj-xyz",
"tenantId": "tenant-abc",
"completedAt": "2025-05-05T17:50:00Z",
"deliveryArtifacts": [
"docker://svc-orders:1.0.0",
"url://devops-pipeline/1234",
"docs://domain-model.pdf"
]
}
π¦ Delivery Artifacts¶
Final orchestration output may include:
| Artifact Type | Description |
|---|---|
| π³ Docker image refs | Built and published container tags |
| π Docs & plans | Generated domain/infra docs, architecture diagrams |
| π§ Pipeline links | CI/CD pipelines in DevOps or GitHub Actions |
| π§ͺ Test results | QA summaries, specflow, test coverage reports |
| πΊοΈ API contracts | OpenAPI, GraphQL, gRPC schemas |
These are linked to the orchestration trace and project record.
π§Ή Cleanup Tasks¶
| Task | Purpose |
|---|---|
| ποΈ Remove temp artifacts | Delete scaffolding cache or interim code workspaces |
| π Revoke agent permissions | Unassign temporary permissions/scopes |
| π§ͺ Finalize QA test coverage | Lock coverage snapshot for metrics |
| π¦ Snapshot orchestration logs | Archive all logs for audit + metrics |
Cleanup is handled by CleanupAgent or system orchestrator.
π£ Delivery Notifications¶
| Channel | Message Type |
|---|---|
| Studio UI | Banner: βProject X delivered successfullyβ |
| Summary report and delivery links | |
| Webhook | For downstream CI/CD triggers |
| Slack / Teams | Project owner or team notification |
π§ Supports:
- Branding per tenant
- Role-based subscription (e.g., QA only)
π Final Lock State¶
After delivery:
- Project enters read-only state unless explicitly reopened
- Manual or agent-triggered re-entry requires admin approval
- Studio disables editing in UI but allows viewing artifacts
π Final Metrics Emitted¶
| Metric Name | Purpose |
|---|---|
project_delivery_duration_ms |
Total time from project creation to completion |
project_retry_count |
Number of task retries across entire execution |
delivery_artifacts_count |
Number of publishable outputs generated |
delivery_success_rate |
Aggregated across all orchestrated projects |
πΌοΈ Studio Integration¶
- βDelivery Summaryβ page per project
- Timeline of phases, orchestrators, task results
- Downloadable ZIP export of artifacts (configurable)
- Option to clone project or use as template
The
ProjectDeliveryCompletephase ensures a consistent, governed conclusion to the orchestration lifecycle. With traceable delivery artifacts, cleanup logic, role-based notifications, and final state transitions, ConnectSoft guarantees that every orchestrated solution is production-ready, auditable, and repeatable.