Skip to content

๐Ÿ“˜ DSLs in ConnectSoft

๐Ÿง  What Is a DSL?

A Domain-Specific Language (DSL) in ConnectSoft is a structured, declarative YAML or JSON document that defines:

  • System intent (what to build)
  • Module structure (how to build it)
  • Artifact contracts (what it must emit)
  • Event interfaces (how it integrates)
  • Execution triggers (when agents should act)

DSLs are the formal interface between vision, architecture, and autonomous generation.


๐ŸŽฏ Why DSLs Matter in an AI Software Factory

Traditional Model:

  • Humans write requirements โ†’ translate into specs โ†’ code
  • Risk: unstructured input, missed logic, no audit trail

ConnectSoft Model (AI-First):

  • DSLs are machine-readable contracts generated from prompts and blueprints
  • DSLs drive agents, validate outputs, and orchestrate flows

โ€œDSLs are the control plane of automation โ€” they make agentic execution safe, observable, and predictable.โ€


๐Ÿงฑ What DSLs Enable

Capability DSL Role
Structure Define bounded contexts, aggregates, events
Traceability Carry traceId, dslRef, context, agentId
Agent Execution Trigger skills like GenerateHandler, EmitContract
Orchestration Route, validate, and replay DSLs
Observability Emit logs, spans, and metrics with DSL metadata
Autonomous Generation Blueprint โ†’ DSL โ†’ Artifact โ†’ PR โ†’ Deployment
Audit & Compliance Versioned DSLs = traceable system blueprint

๐Ÿ” DSLs in the ConnectSoft Lifecycle

sequenceDiagram
    participant VisionAgent
    participant DSLAgent
    participant Orchestrator
    participant GeneratorAgent

    VisionAgent->>DSLAgent: Generate DSLs (ddd.yaml, event.yaml)
    DSLAgent->>Orchestrator: Emit DslGenerated
    Orchestrator->>GeneratorAgent: Trigger Skill (GenerateHandler)
    GeneratorAgent->>Orchestrator: Emit CodeGenerated
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿ“ฆ DSLs vs Other Platform Assets

Asset Type DSL? Role
ddd.yaml โœ… Describes aggregates, commands, events
event.yaml โœ… Defines domain/integration events
pipeline.yaml โœ… CI/CD stages and triggers
MicroserviceTemplate โŒ Folder + project scaffolding
ConnectSoft.*.NuGet โŒ Reusable precompiled code (library)
SendNotification.cs โŒ Output artifact generated from DSL

๐Ÿง  Without DSLs, You'd Lose:

  • Structure: Agents wouldnโ€™t know what to generate
  • Safety: No validation between blueprint โ†’ code
  • Autonomy: Orchestration would rely on free-form text
  • Reuse: No shared contract across services or tenants
  • Observability: No traceable metadata

โœ… Summary

DSLs are:

  • The foundation of traceable software generation
  • The execution contract between prompts and agents
  • The schema that defines software logic, structure, and interaction
  • The fuel that drives autonomous delivery pipelines

Every service, event, adapter, and test in ConnectSoft starts with a DSL โ€” not code.


โš–๏ธ DSLs vs Skills vs Prompts in ConnectSoft

In the ConnectSoft AI Software Factory, three core building blocks drive intelligent software generation:

Concept Purpose
DSL Structured input that defines what to build
Skill Executable capability that knows how to build
Prompt Instructional or contextual input that tells when/why to build

Each plays a distinct role in the agentic execution lifecycle.


๐Ÿงฑ Conceptual Comparison Table

Aspect DSL Skill Prompt
What it is Declarative specification (YAML/JSON) Named agent capability Instructional or contextual message
Produced by Blueprint or DSL Generator Agent Engineering agent registry Prompt Engine, Orchestrator
Consumed by Agents + Orchestrators Internally by agents Agents and skill execution layers
Used for Defining structure, triggers, events Executing transformation/generation Driving execution or enriching skill
Example ddd.yaml, event.yaml GenerateHandler, EmitContract โ€œCreate a handler for BookCommandโ€
Traceable? โœ… Yes (dslRef, traceId) โœ… Yes (skillId, agentId) โœ… Yes (promptId, traceId)

๐Ÿง  How They Work Together

Full Lifecycle Example

Goal: Generate a handler for BookAppointment command.

  1. DSL (ddd.yaml):
command:
  name: BookAppointment
  fields:
    - patientId: Guid
    - timeSlot: DateTime
  1. Prompt:
"Generate a handler for the BookAppointment command using Clean Architecture."
  1. Skill: GenerateHandler skill is invoked by the Backend Developer Agent.

  2. Output: File: BookAppointmentHandler.cs Metadata: skillId=GenerateHandler, dslRef=ddd.yaml, traceId=...


๐Ÿ” Execution Flow Relationship

flowchart TD
    Vision --> DSL
    DSL -->|Provides structure| Prompt
    Prompt -->|Activates| Skill
    Skill -->|Produces| Artifact
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿงฌ Metadata Anchors

Identifier Origin Description
dslRef DSL Unique path/id for DSL document
skillId Skill Registered name of agent capability
promptId Prompt Optional hash of structured input
traceId All Shared execution context across system

โœ… Summary

DSL Skills Prompts
Define the structure Perform the action Trigger or refine the action
Declarative and reusable Executable and composable Contextual and conversational
Drive agent orchestration Power agent internals Inject natural language into flow

DSLs are the contracts, skills are the tools, and prompts are the instructions.


๐Ÿ”„ DSL Lifecycle in the ConnectSoft AI Software Factory

The DSL Lifecycle defines how DSLs flow through the ConnectSoft platform โ€” from their creation to validation, consumption, and traceable execution across agents, pipelines, and orchestrators.


๐Ÿงญ Phases of the DSL Lifecycle

flowchart TD
    A[๐Ÿ” Triggered by Prompt/Blueprint] --> B[๐Ÿ“ DSL Generated]
    B --> C[โœ… DSL Validated]
    C --> D[๐Ÿ“ฆ DSL Stored & Versioned]
    D --> E[โš™๏ธ DSL Consumed by Agents]
    E --> F[๐Ÿงช Artifact Emitted - Code/Test]
    F --> G[๐Ÿ“Š DSL Traced in Observability]
Hold "Alt" / "Option" to enable pan & zoom

1๏ธโƒฃ Trigger (Prompt or Blueprint)

  • Triggered by:

    • Vision Agent (from initial problem statement)
    • Solution Architect Agent (from blueprint)
    • User prompt (e.g., โ€œcreate a booking domainโ€)
  • Event: DslGenerationRequested


2๏ธโƒฃ Generation

  • Agent: DSL Generator Agent, Domain Modeler Agent
  • DSL file emitted:
    • Format: YAML or JSON
    • Stored in: /dsl/{context}/{dslType}.yaml
  • Event: DslGenerated

3๏ธโƒฃ Validation

  • Agent: DslValidatorAgent or validation service
  • Schema checked:
    • Against internal DSL schemas (e.g., ddd.schema.json)
    • Linted for AI correctness, naming, duplication
  • If valid:
    • Event: DslValidated
  • If invalid:
    • Event: DslValidationFailed
    • Error stored in execution-metadata.json

4๏ธโƒฃ Storage & Registry

  • DSL is stored with:
    • traceId, dslRef, version, context, dslType
    • DSL folder: dsl/Booking/ddd.yaml
  • Versioned and immutable
  • Linked to blueprint and orchestrator session

5๏ธโƒฃ Agent Consumption

  • Trigger: DslReady, DslValidated, or BlueprintReady
  • Consumed by:
    • Backend Developer Agent
    • Event Architect Agent
    • Adapter Generator Agent
    • Test Generator Agent
  • Agent looks up:
    • dslRef, context, commandName or eventName
  • Skill executed: GenerateHandler, EmitContract, etc.

6๏ธโƒฃ Artifact Emission

  • Result: .cs, .feature, .yaml, .md
  • Metadata:
    • dslRef, agentId, skillId, traceId, status
  • Event: CodeGenerated, TestCaseCreated, ArtifactReady

7๏ธโƒฃ Observability & Tracing

  • DSL lifecycle is fully visible in:
    • Studio (Trace Explorer โ†’ DSL View)
    • Logs (dslType, dslRef, context, agentId)
    • Metrics (e.g., dsl_validation_success_rate, dsl_artifact_latency)
    • Events (e.g., DslGenerated, CodeGenerated with dslRef)

๐Ÿ“˜ Sample Lifecycle Log (Structured)

{
  "traceId": "trace-a1b2c3",
  "dslRef": "dsl/Booking/ddd.yaml",
  "dslType": "DDD",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "status": "Success",
  "artifact": "BookAppointmentHandler.cs"
}

โœ… Summary

The DSL lifecycle ensures:

  • Predictable, auditable generation of artifacts
  • Safe, schema-validated automation
  • Full traceability from DSL โ†’ code โ†’ deployment
  • Reusability and version control of software knowledge

๐Ÿท๏ธ DSL Metadata & Traceability in ConnectSoft

Every DSL in the ConnectSoft AI Software Factory is treated as a traceable, first-class artifact. This ensures that:

  • Agents can identify where a DSL came from
  • Orchestrators know how it should be routed
  • Observability pipelines can trace what it affected

โ€œIf you canโ€™t trace a DSL, it doesnโ€™t belong in the factory.โ€


๐Ÿ“ฆ Metadata Structure for All DSLs

All DSLs carry a standardized metadata header โ€” either embedded or stored in a linked .metadata.json file.

Example: Embedded Metadata in ddd.yaml

$meta:
  dslType: DDD
  dslRef: dsl/Booking/ddd.yaml
  context: Booking
  moduleId: BookingService
  version: 1.0.0
  traceId: trace-a1b2c3
  agentId: domain-modeler
  generatedAt: 2025-05-17T13:00:00Z
  source: VisionAgent
  status: Validated

๐Ÿงฑ Metadata Field Reference

Field Description
dslType The type of DSL (DDD, Event, Pipeline, etc.)
dslRef Canonical path or unique ID of the DSL
context Bounded context or domain (e.g., Booking, Billing)
moduleId Module associated with the DSL
version DSL version (e.g., 1.0.0)
traceId Trace for execution flow (shared across all related artifacts/events)
agentId Agent that generated or processed the DSL
generatedAt UTC timestamp of when DSL was emitted
source Upstream source agent or user (e.g., VisionAgent, BlueprintTool)
status Current DSL status (Generated, Validated, Consumed, Failed)

๐Ÿ”Ž How Metadata Supports Platform Flows

1. Agent Routing

  • Orchestrators use dslType, context, and traceId to decide which agents to activate.
  • Example: if dslType == DDD โ†’ route to Backend Developer Agent and Event Architect Agent.

2. Studio Navigation

  • Users can search or trace:
    • "Show me all DSLs generated by VisionAgent in trace XYZ"
    • "Open dslRef for BookingService version 1.0.0"

3. Observability & Audit Logs

  • Metrics emitted:
    • dsl_validation_success_total{dslType="DDD", context="Booking"}
    • dsl_generation_latency_seconds{agentId="domain-modeler"}
  • Events include:
    • DslGenerated, DslValidated, DslSegmentConsumed, DslConsumedByAgent

๐Ÿง  Linked Execution Metadata Example

{
  "traceId": "trace-a1b2c3",
  "dslRef": "dsl/Booking/ddd.yaml",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler",
  "artifact": "BookAppointmentHandler.cs",
  "status": "Success"
}

โ†’ Linked to logs, metrics, test results, PRs, and commits.


โœ… Summary

  • DSL metadata provides routing, traceability, and observability across the entire platform.
  • Every DSL is self-identifying and context-aware.
  • DSLs without metadata are invalid in ConnectSoft โ€” no trace = no execution.

๐Ÿงฌ Anatomy of a DSL Document in ConnectSoft

Every DSL in the ConnectSoft platform follows a standardized structure to ensure:

  • It is understandable by agents
  • It can be validated automatically
  • It supports traceability and modular reuse

โ€œA DSL is not just a YAML file โ€” it is a typed, self-aware, composable source of system truth.โ€


๐Ÿงฑ Standard DSL Document Structure

$meta:
  dslType: DDD
  dslRef: dsl/Booking/ddd.yaml
  context: Booking
  moduleId: BookingService
  version: 1.0.0
  traceId: trace-a1b2c3
  agentId: domain-modeler
  status: Validated

aggregate:
  name: Appointment
  id: AppointmentId
  description: A veterinary appointment to be booked by pet owners.

commands:
  - name: BookAppointment
    fields:
      - name: patientId
        type: Guid
        required: true
      - name: slot
        type: DateTime
    emits: AppointmentBooked

events:
  - name: AppointmentBooked
    fields:
      - name: appointmentId
        type: AppointmentId
      - name: slot
        type: DateTime
      - name: patientId
        type: Guid

๐Ÿงฉ Core Sections of a DSL

Section Purpose
$meta Metadata block for orchestration, traceability, validation
aggregate / event / pipeline Core object the DSL defines (depends on dslType)
commands, fields, steps Detailed declarations per DSL type
dependencies (optional) References to other DSLs or artifacts
settings (optional) Generation flags, feature toggles

๐Ÿง  DSL Meta Section

Field Purpose
dslType Type of DSL (DDD, Event, Pipeline, etc.)
dslRef Path or ID used by orchestrators and Studio
context Bounded context (e.g., Booking, Billing)
traceId Lifecycle trace key for linking to generation flow
status Validation status (Validated, Invalid, etc.)

โœ… This section is required for the DSL to be routable and observable.


๐Ÿ› ๏ธ Optional Sections by DSL Type

DSL Type Optional Sections
DDD valueObjects, services
Event version, source, topic
Pipeline matrix, env, outputs
Adapter protocol, bindings, mode
Test scenarios, steps, tags
Execution skills, chain, memory

๐Ÿ“š Validation Rules

Every DSL type has an associated schema:

DSL Type Schema Location
DDD schemas/ddd.schema.json
Event schemas/event.schema.json
Test schemas/test.schema.json
Adapter schemas/adapter.schema.json
Pipeline schemas/pipeline.schema.json

Validation ensures:

  • Correct field structure
  • Required elements present
  • Valid types and enums

โœ… Summary

  • DSLs are structured into metadata + body
  • The $meta block is mandatory for orchestration and traceability
  • Body schema varies by dslType and supports validation + downstream execution
  • Agents and Studio use this structure to route, display, and generate artifacts

๐Ÿค– Agent Interaction with DSLs in ConnectSoft

In the ConnectSoft AI Software Factory, DSLs are the primary interface between architectural intent and agent execution. Agents use DSLs to:

  • Understand what to generate
  • Decide how to execute their skills
  • Report where output came from
  • Emit traceable, testable artifacts

๐Ÿง  Types of Agent Interactions with DSLs

Action Agent Behavior
Consume DSL Agent reads DSL file to determine what code/test/infrastructure to emit
Emit Artifact Agent produces .cs, .feature, .yaml, .md etc. with DSL references
Tag Output All generated outputs include dslRef, traceId, context, agentId
React to Event Agent subscribes to DSL-based events (DslValidated, DslSegmentReady)
Use in Prompt DSL is injected into the prompt context to make agent output precise

โš™๏ธ Execution Flow Example

sequenceDiagram
    participant Orchestrator
    participant DSLAgent
    participant BackendAgent
    participant CommitAgent

    Orchestrator->>DSLAgent: Generate ddd.yaml
    DSLAgent->>Orchestrator: Emit DslValidated
    Orchestrator->>BackendAgent: Process dslRef: dsl/Booking/ddd.yaml
    BackendAgent->>CommitAgent: Emit BookAppointmentHandler.cs (with metadata)
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿงฑ Agent Skill Decision from DSL

Agents map DSL segments to skills like:

DSL Element Skill Triggered
commands[] in DDD GenerateHandler
events[] in DDD EmitEventContract
valueObjects[] GenerateValueObjectClass
aggregate.name GenerateAggregateClass
scenarios[] in Test GenerateSpecFlowTest
jobs[] in Pipeline EmitPipelineYaml

โ†’ These skills are explicitly mapped to DSL paths, allowing deterministic behavior.


๐Ÿงฉ Agent Runtime Context Injection

When an agent is activated by a DSL, its prompt context includes:

{
  "dslRef": "dsl/Booking/ddd.yaml",
  "traceId": "trace-a1b2c3",
  "dslType": "DDD",
  "command": "BookAppointment",
  "context": "Booking",
  "agentId": "backend-developer",
  "skillId": "GenerateHandler"
}

โœ… Ensures observability and reproducibility.


File: BookAppointmentHandler.cs

// Generated by Backend Developer Agent
// Based on DSL: dsl/Booking/ddd.yaml
// traceId: trace-a1b2c3
// skill: GenerateHandler

๐Ÿ“Š Studio View of Agent+DSL Execution

  • Trace Timeline: DSL โ†’ Agent โ†’ Skill โ†’ Output
  • Explorer Drilldown:
    • Select DSL โ†’ see related artifacts and PR
    • Select Agent โ†’ see all DSLs consumed
  • Audit Logs:
    • โ€œdslRef dsl/Booking/ddd.yaml was used by backend-developer to emit handler fileโ€

โœ… Summary

  • DSLs are the primary input contracts for most agent executions
  • Agents use DSLs to determine what to generate, how to trace it, and where it belongs
  • All outputs are tagged with dslRef, enabling observability, reproducibility, and auditability

๐Ÿงญ Orchestration Layer Integration with DSLs

In ConnectSoft, the orchestration layer acts as the central dispatcher and controller of all autonomous flows. It relies on DSLs as the source of truth for:

  • Determining which agents to activate
  • Routing execution plans
  • Enforcing validation
  • Connecting lifecycle events from blueprint to release

โ€œDSLs are the connective tissue between agent decisions, orchestration logic, and blueprint alignment.โ€


โš™๏ธ Orchestration Lifecycle Flow (With DSLs)

flowchart TD
    Vision[Vision Document Created] --> DslGen[Generate DSLs]
    DslGen --> DslValidated
    DslValidated --> Orchestrator[Orchestrator Routes DSL]
    Orchestrator --> Agent[Agent Executes Skill]
    Agent --> PR[Pull Request Created]
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿ”„ What the Orchestrator Does with DSLs

Task Description
Monitor DSL events Listens to DslGenerated, DslValidated, DslSegmentReady
Route to agents Uses dslType, context, and traceId to dispatch correct agent & skill
Validate schemas Uses JSON schema validation for structural correctness
Apply gating logic Blocks downstream execution until DSL passes validation
Attach trace metadata Links every DSL to traceId and execution lifecycle
Emit progress events Sends DslSegmentConsumed, ArtifactGenerated, TraceAdvanced

๐Ÿงฉ How DSLs Are Matched to Agent Flows

DSL Type Target Agent(s) Skills Mapped
DDD Backend Developer, Domain Modeler GenerateHandler, EmitEvent, GenerateAggregate
Event Event Architect, Messaging Configurator EmitContract, ConfigurePublisher
Adapter Infrastructure Engineer GeneratePortAdapter, EmitBindings
Test Test Generator Agent GenerateSpecFlow, EmitTestCode
Pipeline DevOps Agent EmitYamlPipeline, AttachStagePolicy

โœ… This mapping is defined in the execution FSM and agent registry.


๐Ÿง  Triggering Strategy (Example)

trigger:
  when: DslValidated
  dslType: DDD
  context: Booking
  skill: GenerateHandler
  agent: backend-developer

โ†’ Stored in execution-plan.yaml or orchestrator config


๐Ÿ“‚ DSL Folder Routing Convention

dsl/
  Booking/
    ddd.yaml
    event.yaml
  Notifications/
    event.yaml
  Billing/
    pipeline.yaml

The orchestrator detects changes and routes by:

  • Folder (context)
  • File (dslType)
  • Execution metadata (traceId, version, etc.)

๐Ÿ“Š DSL in Orchestration Metrics

Metric Meaning
dsl_routed_total Count of DSLs routed to agents
dsl_validation_failure_total Schema or semantic failures
dsl_execution_latency_seconds Time from DslValidated to CodeGenerated
dsl_blocked_pending_dependency DSLs waiting for other DSLs (e.g., Event needs DDD first)

โœ… Summary

  • The orchestration layer treats DSLs as typed inputs to deterministic execution
  • It uses DSL metadata to route, validate, trigger, and trace flows
  • DSLs allow orchestration to be event-driven, parallel, and auditable

๐Ÿ“ก DSL Observability & Events in ConnectSoft

DSLs in ConnectSoft are observable units โ€” not just static files. Every DSL is part of a traceable lifecycle, emitting telemetry and triggering platform events at each phase.

This enables:

  • Real-time status tracking
  • Agent trace correlation
  • Studio diagnostics
  • Compliance auditing

โ€œIf a DSL is used to generate production code, it must be observable from birth to release.โ€


๐Ÿง  DSL Lifecycle Events

๐Ÿ“ Key Events Emitted

Event Name Triggered By Payload Includes
DslGenerated DSL Generator Agent dslRef, traceId, dslType, agentId
DslValidated DSL Validator / Orchestrator dslRef, context, status=success
DslValidationFailed Orchestrator / Schema Validator dslRef, errors, agentId, traceId
DslSegmentReady Manual segment release Signifies partial DSL availability
DslSegmentConsumed Agent processing the DSL dslRef, skillId, status, artifactRef
DslTraceComplete Final state in a generation loop Summary of all DSLs and output statuses

โœ… All events are published on the internal event bus with full observability headers.


๐Ÿ“Š DSL Metrics

Emitted to OpenTelemetry or Prometheus:

Metric Name Tags
dsl_generated_total dslType, agentId, context, status
dsl_validation_latency_seconds dslType, context, agentId
dsl_consumed_total dslRef, skillId, agentId
dsl_errors_total dslType, traceId, validationError

Sample Prometheus Metric

# HELP dsl_generated_total Total number of DSLs generated
# TYPE dsl_generated_total counter
dsl_generated_total{dslType="DDD", context="Booking", agentId="domain-modeler"} 3

๐Ÿ“˜ Studio DSL Observability Features

Feature Description
DSL Trace View Timeline of DSL events in context of a trace
Artifact Explorer Reverse map from .cs โ†’ dslRef
Validation Diagnostics Shows schema error reasons in-line
Segment Health Status Shows which DSLs are incomplete, expired, or invalid
Event Viewer Filters Filter logs/events by dslType, context, agentId

๐Ÿ” Audit & Compliance Support

DSL observability allows:

  • โœ… DSL โ†’ Artifact โ†’ Commit โ†’ PR โ†’ Deployment chain of custody
  • โœ… Identification of invalid generation triggers
  • โœ… Tracking of every DSL used to produce live service code
  • โœ… Automated retention or purging policies by status

โœ… Summary

  • Every DSL in ConnectSoft emits structured lifecycle events
  • These events power observability, replayability, traceability, and auditing
  • Studio, agents, and orchestrators all subscribe to DSL-related event streams
  • DSL observability enables full control and validation of AI-driven code production

โœ… DSL Validation & Schemas in ConnectSoft

Every DSL in ConnectSoft must be validated before it can be processed by agents or orchestrators. Validation ensures that:

  • The DSL is structurally correct
  • Required fields and relationships exist
  • The schema matches the intended dslType
  • Errors are traceable and recoverable

โ€œValidation is what turns a file into a contract.โ€


๐Ÿง  What Is Validated?

โœ… Schema Validation

Each DSL type (e.g., DDD, Event, Pipeline) is linked to a strict JSON Schema that defines:

  • Required fields
  • Allowed values and types
  • Pattern constraints (e.g., PascalCase, kebab-case)
  • Embedded or linked definitions (e.g., commands[], events[])

โœ… Semantic Validation

Goes beyond schema and checks for:

  • Duplicate identifiers (e.g., two commands with same name)
  • Conflicting fields across DSLs
  • Unsupported cross-context references
  • Context leakage (e.g., Billing DSL referencing Booking aggregate)

๐Ÿ“‚ DSL Schema File Locations

DSL Type Schema File Location
DDD schemas/ddd.schema.json
Event schemas/event.schema.json
Test schemas/test.schema.json
Adapter schemas/adapter.schema.json
Pipeline schemas/pipeline.schema.json

All schemas are centrally versioned, OpenAPI-compatible, and referenced by dslType.


๐Ÿงฐ Validation Engine Integration

Component Role
DslValidatorAgent Validates new DSLs using schema and semantic rules
Orchestrator FSM Blocks execution if DSL fails validation
Studio Shows validation errors in UI
CI Gate (optional) Can run dsl lint CLI during commits or PR checks

๐Ÿ” Sample Validation Result (Failure)

{
  "dslRef": "dsl/Booking/ddd.yaml",
  "dslType": "DDD",
  "context": "Booking",
  "status": "Failed",
  "errors": [
    {
      "field": "commands[0].fields[1].type",
      "message": "Missing required property 'type'"
    },
    {
      "field": "aggregate.name",
      "message": "Must be PascalCase"
    }
  ]
}

๐Ÿ”„ Validation Lifecycle Events

Event Name Triggered By Description
DslValidated On successful validation DSL is ready for use
DslValidationFailed On failure Agent/orchestrator/studio notified
DslRetryScheduled Optional retry if auto-fixable Triggered by planner or CLI

๐Ÿ›‘ What Happens If a DSL Is Invalid?

  • Orchestrator blocks downstream agent execution
  • Studio shows validation banner on DSL page
  • Retry path may be proposed by CorrectionAgent
  • Errors are logged, tagged, and audited

๐Ÿ“Š Metrics Emitted

Metric Description
dsl_validation_success_total Count of passed DSLs by type
dsl_validation_failure_total Count of invalid DSLs
dsl_validation_duration_seconds Time to run schema+semantic checks

โœ… Summary

  • Every DSL must pass schema + semantic validation
  • Validation blocks downstream actions, preserving safety and consistency
  • Failed validations emit structured errors and events
  • Studio, CI, and agents all rely on consistent schema enforcement

โšก Event-Driven Activation of DSLs in ConnectSoft

In ConnectSoft, DSLs are not manually triggered โ€” they are part of an event-driven execution graph.

This means that every step in the DSL lifecycle โ€” generation, validation, consumption โ€” is initiated by platform events emitted by agents, orchestrators, or system triggers.

โ€œIf something important happens in the factory, it emits an event โ€” and DSLs are no exception.โ€


๐Ÿ” End-to-End Event Flow (Example)

sequenceDiagram
    participant User
    participant VisionAgent
    participant DSLAgent
    participant Orchestrator
    participant BackendAgent

    User->>VisionAgent: Submit Vision Prompt
    VisionAgent->>DSLAgent: Generate ddd.yaml
    DSLAgent->>Orchestrator: Emit DslGenerated
    Orchestrator->>DSLAgent: Validate DSL
    DSLAgent->>Orchestrator: Emit DslValidated
    Orchestrator->>BackendAgent: Trigger GenerateHandler
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿ“ก Key DSL Events & Triggers

Event Description
VisionDocumentCreated Triggers DSL generation from blueprint
DslGenerated DSL created by agent; triggers validation
DslValidated DSL approved; triggers agent execution
BlueprintReady Blueprint contains DSL fragments to extract
AgentExecutionCompleted May emit DslSegmentReady for partial DSLs
DslConsumedByAgent Used for tracking + orchestrator progress update

๐Ÿง  Why Events Drive DSL Execution

  • Loose coupling: Orchestrators donโ€™t poll โ€” they react to DSL lifecycle changes
  • Parallelization: DSLs can activate multiple agents simultaneously
  • Safety: Events ensure that a DSL must be validated before it's consumed
  • Replayability: DSL flows can be replayed by re-emitting prior events

๐Ÿ“ฆ Examples of Event-Driven DSLs

Event Triggered DSL Activated
VisionDocumentCreated ddd.yaml, event.yaml
ProductPlanCreated product-plan.yaml
BlueprintReady adapter.yaml, test.yaml
PipelineRequested pipeline.yaml
ReleaseCandidateReady execution-dsl.yaml

๐Ÿ”„ Flow Control: Orchestrator FSM

The orchestrator subscribes to DSL events like:

transitions:
  - on: DslValidated
    if: dslType == "DDD"
    then:
      trigger:
        agent: backend-developer
        skill: GenerateHandler

โ†’ Declarative FSM makes DSLs automatically route themselves based on event flow.


๐Ÿ“Š Observability Hooks

Tool Feature
Studio DSL Event Feed, Trace Timeline, Trigger Map
Metrics dsl_activated_total, dsl_routing_latency
Audit Logs All DSLs include triggering event + origin

๐Ÿ” Security Consideration

Only events from trusted emitters (e.g., agents, orchestrators) can trigger DSL execution. Untrusted events or malformed DslGenerated are ignored or quarantined.


โœ… Summary

  • DSLs are activated by events, not manually invoked
  • This supports safe, scalable, autonomous execution
  • Events provide visibility, flexibility, and orchestration continuity
  • Every DSL participates in a traceable, auditable event graph

๐Ÿงฉ DSL Templates and Inheritance in ConnectSoft

In ConnectSoft, DSLs are not one-off documents โ€” they are composable, reusable contracts. The platform supports DSL templates and inheritance structures to enable:

  • Reuse of shared patterns across modules
  • Tenant-specific overrides
  • Multi-edition support
  • Declarative extensions of architectural blueprints

โ€œA DSL template is a blueprint of a blueprint โ€” a reusable base from which DSLs evolve.โ€


๐Ÿ“ฆ What Is a DSL Template?

A DSL template is a partial or base DSL definition stored in the DSL registry. It contains reusable structure and logic that can be:

  • Extended
  • Overridden
  • Referenced
  • Composed

DSL templates are typically parameterized or inherited by context-specific DSLs.


๐Ÿงฑ Example: Template + Instance

๐Ÿ”น Base Template โ€” ddd.template.yaml

$meta:
  dslType: DDD
  context: Shared
  template: true
aggregate:
  name: Appointment
  id: AppointmentId
commands:
  - name: CancelAppointment
    fields:
      - appointmentId: AppointmentId
    emits: AppointmentCancelled

๐Ÿ”ธ Inheriting DSL โ€” Booking/ddd.yaml

$extends: ../../shared/ddd.template.yaml
$meta:
  dslType: DDD
  context: Booking
  traceId: trace-abc123

commands:
  - name: BookAppointment
    fields:
      - patientId: Guid
      - slot: DateTime
    emits: AppointmentBooked

โœ… Merges both commands under aggregate: Appointment.


๐Ÿง  Inheritance Rules

Feature Behavior
$extends Specifies path to parent/base template
aggregate, commands, etc. Merged (child overrides take precedence)
$meta.template: true Marks file as non-executable base
traceId, agentId Inherited only if not explicitly overridden
Array merging Default: append unless name matches, then override

๐Ÿ”„ Use Cases

Use Case DSL Strategy
Shared aggregates across domains DSL template
Multi-tenant feature toggles Base + edition override
Product tier differentiation Extend + prune features
Centralized OpenAPI template Base DSL for APIs + extensions per service

dsl/
  shared/
    ddd.template.yaml
    event.template.yaml
  Booking/
    ddd.yaml          โ† extends shared/ddd.template.yaml
    event.yaml
  Billing/
    ddd.yaml

๐Ÿ” Agent Awareness

Agents support template inheritance natively. They receive the merged final DSL via orchestration โ€” no need to resolve templates themselves.

โ†’ Keeps agent logic simple and centralized.


๐Ÿ“Š Observability & Traceability

  • DslMerged event emitted during inheritance resolution
  • sourceTemplates[] field in execution metadata
  • Studio shows base vs. effective structure
  • Validation runs on the final merged DSL

โœ… Summary

  • DSL templates reduce duplication and encode reusable patterns
  • $extends lets you build specialized DSLs from generalized ones
  • The orchestration layer resolves inheritance before agent execution
  • All inheritance is traceable, observable, and version-controlled

๐Ÿง  Domain DSL (DDD DSL) โ€” Deep Dive

The DDD DSL (Domain-Driven Design DSL) defines the core business structure and behavior of a service using domain-driven principles:

  • Aggregates
  • Commands
  • Events
  • Value Objects
  • Handlers (implicit)

This DSL provides the canonical source of truth for the application layer and is consumed by agents to generate:

  • Domain models
  • Command handlers
  • Event contracts
  • Use case tests

โ€œDDD DSL is where your business rules come to life โ€” in a form that agents can understand, validate, and build from.โ€


๐Ÿ“ฆ DSL File Location

dsl/
  Booking/
    ddd.yaml

๐Ÿ“˜ Example: ddd.yaml

$meta:
  dslType: DDD
  context: Booking
  moduleId: BookingService
  traceId: trace-abc123
  version: 1.0.0
  agentId: domain-modeler

aggregate:
  name: Appointment
  id: AppointmentId
  description: Represents a veterinary appointment booked by a pet owner.

valueObjects:
  - name: TimeSlot
    fields:
      - name: start
        type: DateTime
      - name: end
        type: DateTime

commands:
  - name: BookAppointment
    fields:
      - patientId: Guid
      - slot: TimeSlot
    emits: AppointmentBooked

  - name: CancelAppointment
    fields:
      - appointmentId: AppointmentId
    emits: AppointmentCancelled

events:
  - name: AppointmentBooked
    fields:
      - appointmentId: AppointmentId
      - patientId: Guid
      - slot: TimeSlot

  - name: AppointmentCancelled
    fields:
      - appointmentId: AppointmentId

๐Ÿงฉ DSL Fields & Semantics

aggregate

Defines the root entity that encapsulates business behavior.

commands[]

Declares actions that mutate aggregate state. Mapped to handlers.

events[]

Defines outcomes triggered by commands or internal transitions.

valueObjects[]

Reusable, immutable models for encapsulated logic or structure.


โš™๏ธ Consumed By

Agent Skill Output
Backend Developer Agent GenerateHandler BookAppointmentHandler.cs
Domain Modeler Agent EmitAggregateClass Appointment.cs
Event Architect Agent EmitDomainEventContract AppointmentBooked.cs
Test Generator Agent GenerateSpecFlow BookAppointment.feature

๐Ÿ“š DSL-Driven Folder Structure

/BookingService/
  /Domain/
    Appointment.cs
    TimeSlot.cs
    Events/
      AppointmentBooked.cs
  /Application/
    Handlers/
      BookAppointmentHandler.cs
  /Tests/
    Features/
      BookAppointment.feature

๐Ÿงช Validation Rules

  • All commands must emit at least one event
  • Aggregate must have name and id
  • No duplicate command or event names
  • Field types must be resolvable (Guid, DateTime, VO)

๐Ÿง  Advanced Features (Supported)

Feature Support
Nested value objects โœ…
Inheritance via $extends โœ…
Command metadata โœ… (description, deprecated)
Internal-only events โœ… via visibility: internal

๐Ÿ“Š Traceability Fields

  • dslRef: Path to the DSL
  • traceId: Execution lifecycle trace
  • agentId: Origin of generator
  • dslType: Always DDD for this format

โœ… Summary

  • DDD DSL is the foundation of domain logic generation
  • Used by multiple agents to generate a complete Clean Architecture slice
  • Easily extended, validated, and versioned across services
  • Enables full traceability, parallel execution, and safe regeneration

๐Ÿ“ฃ Event DSL โ€” Deep Dive

The Event DSL in ConnectSoft defines system-wide, domain, and integration events as first-class, versioned contracts.

It enables:

  • Agents to generate event classes, schemas, and publish/subscribe bindings
  • Orchestrators to reason about event flow between bounded contexts
  • Services to evolve using event-driven architecture principles

โ€œIf it's important, it emits an event โ€” and if it emits, itโ€™s defined in the Event DSL.โ€


๐Ÿ“‚ DSL File Location

dsl/
  Booking/
    event.yaml

๐Ÿ“˜ Example: event.yaml

$meta:
  dslType: Event
  context: Booking
  traceId: trace-xyz789
  version: 1.0.0
  agentId: event-architect

events:
  - name: AppointmentBooked
    version: v1
    topic: booking.appointment.booked
    emittedBy: BookingService
    description: Raised when a booking is completed
    fields:
      - name: appointmentId
        type: Guid
      - name: patientId
        type: Guid
      - name: slot
        type: TimeSlot
    consumers:
      - NotificationService
      - AnalyticsAgent

  - name: AppointmentCancelled
    version: v1
    topic: booking.appointment.cancelled
    emittedBy: BookingService
    fields:
      - appointmentId: Guid

๐Ÿงฉ Key Fields

Field Description
name Name of the event
version Schema version (e.g. v1)
topic Routing key / message broker topic
emittedBy Source service or aggregate
fields[] Payload schema (typed)
consumers[] Expected subscribers (services or agents)

โš™๏ธ Consumed By

Agent Skill Output
Event Architect Agent EmitDomainEventContract AppointmentBooked.cs
Messaging Configurator ConfigureEventBindings MassTransit consumer config
Test Generator Agent GenerateEventFlowTest AppointmentBooked.spec
API Designer Agent ExposeWebhookEvent WebhookRegistered.cs (optional)

๐Ÿ” Generated Artifacts

  • DomainEvent class
  • Schema file: AppointmentBooked.event.json
  • Event registry file (event catalog)
  • Message broker mapping (e.g., RabbitMQ, Azure Service Bus)

๐Ÿงช Validation Rules

  • All events must have unique name per context
  • Field types must be resolvable globally or declared locally
  • Topics must follow platform topic naming conventions
  • Version must be present and semver-compatible

๐Ÿ“ฆ Versioning & Compatibility

Scenario Strategy
Add new field (non-required) v1 โ†’ v1.1
Remove or rename field v1 โ†’ v2
Change topic or structure v1 โ†’ v2

โœ… Multiple versions can coexist. Consumers declare supported versions explicitly.


๐Ÿ“Š Observability Hooks

Field Traced In
traceId Event generation logs
dslRef All output files and commit tags
topic Event bus instrumentation (e.g. OTEL)
version Event catalog, test coverage report

๐Ÿ“˜ Example Schema Output

{
  "$id": "AppointmentBooked.event.json",
  "title": "AppointmentBooked",
  "type": "object",
  "properties": {
    "appointmentId": { "type": "string", "format": "uuid" },
    "patientId": { "type": "string", "format": "uuid" },
    "slot": {
      "type": "object",
      "properties": {
        "start": { "type": "string", "format": "date-time" },
        "end": { "type": "string", "format": "date-time" }
      }
    }
  },
  "required": ["appointmentId", "patientId", "slot"]
}

โœ… Summary

  • Event DSLs define traceable, reusable, observable system events
  • They power inter-service communication and event-first orchestration
  • Events include schema, topic, version, emitter, and consumers
  • All event artifacts are versioned, validated, and linked to their origin DSL

๐Ÿ”Œ Adapter DSL โ€” Deep Dive

The Adapter DSL defines how ConnectSoft microservices connect to external systems and infrastructure layers โ€” including:

  • Databases
  • Message queues
  • HTTP APIs
  • Storage services
  • Identity providers

It describes the contract between a serviceโ€™s ports and their implementation adapters, ensuring that infrastructure details remain cleanly separated from domain logic.

โ€œAdapter DSL tells the platform how your ports are wired โ€” and lets agents build those connections cleanly and traceably.โ€


๐Ÿ“‚ DSL File Location

dsl/
  Booking/
    adapter.yaml

๐Ÿ“˜ Example: adapter.yaml

$meta:
  dslType: Adapter
  context: Booking
  traceId: trace-def123
  version: 1.0.0
  agentId: infrastructure-engineer

adapters:
  - name: BookingRepositoryAdapter
    port: IBookingRepository
    protocol: database
    type: Postgres
    implements: CreateBooking, CancelBooking
    connection:
      database: BookingDB
      table: Bookings
    injected: true

  - name: NotificationPublisher
    port: INotificationSender
    protocol: messaging
    type: MassTransit
    topic: notification.send
    injected: true

๐Ÿงฉ Key Fields

Field Description
name Name of the adapter class to generate
port Interface or contract it implements
protocol Category: database, http, messaging, cache, etc.
type Specific tech: Postgres, RabbitMQ, HttpClient, etc.
implements Optional: methods/commands implemented by this adapter
connection Endpoint, db, URL, topic, queue, etc.
injected Whether to wire it via DI automatically

โš™๏ธ Consumed By

Agent Skill Output
Infrastructure Engineer Agent GeneratePortAdapter BookingRepositoryAdapter.cs
Messaging Configurator Agent EmitPublisherConfiguration MassTransitOptions.cs
API Gateway Generator Agent ExposeAdapterRoute (for HTTP) booking.routes.yaml
DevOps Agent EmitAdapterSecrets bicep:secrets, .env

๐Ÿงฑ Typical Adapter Outputs

  • Class implementation for *.Adapter.cs
  • Dependency injection binding (services.AddScoped<IBookingRepository, BookingRepositoryAdapter>())
  • Infrastructure manifest (Bicep/Terraform: secrets, queues, connections)
  • Messaging or HTTP route configuration

๐Ÿ›ก Security Considerations

  • Secrets referenced via:

secretRef: BookingDB__ConnectionString
* Agents never embed secrets โ€” only emit secure bindings * Secret injection handled via env.yaml, Azure Key Vault, or Kubernetes secrets


๐Ÿงช Validation Rules

  • port must be declared or resolved via known interfaces
  • protocol must match type (e.g., messaging โ†’ MassTransit)
  • connection fields required for http, database, messaging
  • Duplicate adapter names are blocked per context

๐Ÿ“Š Observability Integration

Metadata Traced Used In
dslRef, traceId, agentId PR annotations, logs, execution metadata
port, type Studio DI map, telemetry injectors
protocol MassTransit metrics, DB client spans

๐Ÿ“˜ Infrastructure Manifest Example (Generated)

param BookingDB_ConnectionString string

resource sqlDb 'Microsoft.Sql/servers/databases@2022-02-01-preview' = {
  name: 'booking-db'
  location: resourceGroup().location
  properties: {
    collation: 'SQL_Latin1_General_CP1_CI_AS'
  }
}

โœ… Summary

  • The Adapter DSL defines how to bind ports to infrastructure
  • Supports multiple protocols: database, messaging, http, auth, etc.
  • Generates adapters, DI registrations, and infrastructure configuration
  • Keeps service logic clean, testable, and infrastructure-agnostic

๐Ÿงช Test DSL โ€” Deep Dive

The Test DSL allows ConnectSoft agents to define structured, versioned, and traceable test cases for:

  • Unit tests
  • BDD/SpecFlow feature files
  • Integration tests
  • Event-driven assertions

It enables autonomous agents to define test intentions declaratively, then generate implementation artifacts in the appropriate framework.

โ€œThe Test DSL is where expected behavior meets automation โ€” declaratively.โ€


๐Ÿ“‚ DSL File Location

dsl/
  Booking/
    test.yaml

๐Ÿ“˜ Example: test.yaml

$meta:
  dslType: Test
  context: Booking
  moduleId: BookingService
  traceId: trace-test001
  version: 1.0.0
  agentId: qa-engineer

features:
  - name: Booking Appointment
    scenarios:
      - name: Successful booking
        given:
          - patient exists
          - slot is available
        when:
          - patient books appointment
        then:
          - appointment is saved
          - AppointmentBooked event is emitted

      - name: Duplicate booking
        given:
          - patient already booked
        when:
          - patient books again
        then:
          - error is returned
          - no event is emitted

๐Ÿงฉ Core Fields

Field Description
features[] Test features (aligned with use cases)
scenarios[] Specific BDD-style test paths
given[] Preconditions or test setup
when[] Actions performed
then[] Assertions โ€” state, output, or events
tags[] Optional tags: @regression, @edge, @critical

โš™๏ธ Consumed By

Agent Skill Output
Test Generator Agent GenerateSpecFlow .feature file
QA Engineer Agent EmitTestClass BookingTests.cs
Bug Investigator Agent ReproduceFromTestDsl Replay scenarios
Code Reviewer Agent VerifyTestCoverageFromDsl Diff missing handlers/events

๐Ÿ›  DSL-to-Test Output Mapping

DSL Scope Output File
features[] *.feature file
then[] NUnit / MSTest / FluentAssertions
events[] MassTransit test consumer hooks
given[] AutoFixture, builder pattern setup

๐Ÿ“‹ Supported Output Formats

  • .feature (Gherkin/SpecFlow)
  • .cs or .ts test classes
  • Postman/Newman .json scenarios (optional)
  • YAML test assertions (contract-based modules)

๐Ÿ“Š Observability Tags

All test runs, results, and PRs are tagged with:

  • traceId
  • dslRef
  • dslType: Test
  • context
  • scenarioName

โœ… Enables per-scenario tracking, regression coverage heatmaps, and feedback loops.


๐Ÿ” Studio Integration

Feature Description
DSL Trace View View .feature file generated from each scenario
Test Coverage Map DSL vs Code: whatโ€™s tested and whatโ€™s not
Auto-fix Suggestions โ€œThis handler is missing a testโ€
Scenario Replay (Future) Replay given โ†’ when โ†’ then via test runner

๐Ÿงช Best Practices

Guideline Rationale
Use @edge, @error tags Helps prioritization and test generation
Keep then[] atomic Encourages clear assertions and diagnostics
Align with ddd.yaml commands Ensures functional parity
Reuse vocabulary with valueObjects Improves schema alignment and test clarity

โœ… Summary

  • The Test DSL defines structured test cases in a reusable, declarative format
  • Supports BDD, integration, and unit test generation
  • Fully traceable to domain logic and agent execution
  • Enables regression safety and intelligent feedback loops for AI-driven generation

๐Ÿš€ Pipeline DSL โ€” Deep Dive

The Pipeline DSL defines autonomous, declarative CI/CD workflows that ConnectSoft agents use to:

  • Build, test, and deploy services
  • Manage multi-stage environments (dev, staging, prod)
  • Integrate security, observability, and test gates
  • Emit traceable and observable release flows

โ€œPipeline DSL transforms deployment from script to orchestrated intelligence.โ€


๐Ÿ“‚ DSL File Location

dsl/
  Billing/
    pipeline.yaml

๐Ÿ“˜ Example: pipeline.yaml

$meta:
  dslType: Pipeline
  context: Billing
  traceId: trace-pipe001
  version: 1.0.0
  agentId: devops-engineer

pipeline:
  name: BuildAndDeployBillingService
  trigger:
    event: BlueprintReady
  stages:
    - name: Build
      jobs:
        - dotnet restore
        - dotnet build
        - dotnet test
    - name: Package
      jobs:
        - docker build -t billing-service .
        - docker push billing-service
    - name: DeployStaging
      environment: staging
      jobs:
        - pulumi up --stack staging
    - name: DeployProduction
      environment: production
      approvals:
        - approver: ReleaseManager
      jobs:
        - pulumi up --stack production

๐Ÿงฉ Key Fields

Field Description
trigger Event that activates the pipeline (e.g., BlueprintReady, DslValidated)
stages[] Ordered phases of the pipeline
jobs[] Shell or task commands to execute
environment Target environment (dev, staging, prod)
approvals[] Optional manual or role-based approvals
artifacts[] Output packages, docker images, test results

โš™๏ธ Consumed By

Agent Skill Output
DevOps Agent EmitYamlPipeline .yaml, .yml (Azure DevOps, GitHub Actions, etc.)
Deployment Orchestrator CoordinateStageExecution Tracked stage execution with events
Observability Agent InjectTelemetryHooks Pipeline logs, spans, and metrics
Security Agent EnforcePreReleaseChecks Stage blocks if policy fails

๐Ÿ“‹ Supported Backends

Platform Support
Azure DevOps โœ…
GitHub Actions โœ…
GitLab CI ๐ŸŸก planned
Harness, CircleCI ๐ŸŸก custom integration via job emitters

๐Ÿงช Validation Rules

  • Stage names must be unique
  • jobs[] must be non-empty
  • Trigger event must be resolvable in orchestrator FSM
  • Approvals must match user roles (optional)

๐Ÿ“Š Observability Signals

Metric Tags
pipeline_started_total context, dslRef, triggerEvent
pipeline_stage_duration_seconds stageName, status, traceId
pipeline_artifacts_emitted_total dslRef, environment

๐Ÿง  Studio Pipeline View

Feature Description
Stage Timeline Visual execution flow with durations
Artifact Viewer View packages, logs, and test results per stage
Approval Flow See approval logs and decisions
Trigger Tracker Show event โ†’ pipeline run linkage

๐Ÿ” Security Features

  • Role-based approvals (e.g., ReleaseManager)
  • Manual gate triggers
  • Secret injection via Key Vault/Env from adapter bindings
  • Rollback plans registered via DSL annotation (future)

โœ… Summary

  • Pipeline DSL defines declarative, event-driven CI/CD flows
  • Converts DSL triggers into YAML pipelines and observable artifacts
  • Enables agents to autonomously generate, track, and secure deployment processes
  • Fully integrated into orchestration and observability pipelines

๐Ÿค– Agent Execution DSL โ€” Deep Dive

The Agent Execution DSL defines declarative plans for how agents coordinate and execute skills, toolchains, memory access, and output pipelines in the ConnectSoft AI Software Factory.

It powers:

  • Intelligent skill chaining
  • Prompt and context composition
  • Memory and knowledge injection
  • Agent-to-agent handoff
  • Reproducible execution graphs

โ€œThe Agent Execution DSL is the blueprint for how thinking happens in the factory โ€” not just what is built, but how itโ€™s built.โ€


๐Ÿ“‚ DSL File Location

dsl/
  Booking/
    execution.yaml

๐Ÿ“˜ Example: execution.yaml

$meta:
  dslType: Execution
  context: Booking
  traceId: trace-exec001
  version: 1.0.0
  agentId: orchestrator

execution:
  flowName: GenerateBookingService
  steps:
    - skill: ComposeVisionDocument
      agent: vision-architect
      input:
        prompt: "Build a modular SaaS for booking veterinary appointments"
        memoryScope: vision/Booking
    - skill: EmitDomainModelDsl
      agent: domain-modeler
      input:
        source: vision/Booking/vision.md
    - skill: GenerateHandler
      agent: backend-developer
      input:
        dslRef: dsl/Booking/ddd.yaml
        target: BookAppointment
    - skill: CommitToGit
      agent: code-committer
      input:
        artifacts: [BookAppointmentHandler.cs, Appointment.cs]
        branch: feature/booking-service

๐Ÿงฉ Core Fields

Field Description
flowName Logical name of the execution pipeline
steps[] Ordered or conditional steps
skill Name of skill to execute (must be registered)
agent Responsible agent persona
input Prompt, DSL reference, memory, context
output (optional) Expected files or metadata
condition (optional) Execution guard (e.g., if not exists)

โš™๏ธ Consumed By

Agent Skill Engine Usage
Planner Agent EmitAgentPlan Generates the execution DSL itself
Orchestrator Agent RunExecutionFlow Walks through and executes all steps
Studio Visual execution map Tracks skill-by-skill progress
Debugger Agent (future) ReplayAgentPlan Replays or diagnoses failed steps

๐Ÿ” Conditional & Parallel Execution (Planned)

DSL supports planned extension for:

parallel:
  - skill: GenerateSpecFlow
    agent: test-generator
  - skill: EmitOpenApiContract
    agent: api-designer

And:

condition:
  exists: dsl/Booking/ddd.yaml

๐Ÿ“Š Execution Telemetry (Per Step)

Field Description
stepId Unique per step
status started, completed, failed
skillId Mapped to GenerateHandler, etc.
outputChecksum Hash of emitted artifact(s)
durationMs Runtime duration of the skill

โ†’ All steps traceable in logs, metrics, and Studio UI.


๐Ÿง  Studio Features

Feature Description
Execution Graph Visual trace of skill chain
Step Replay Re-run from failed point
Memory Injection Viewer See what memory was injected into each prompt
Output Verification Compare emitted artifacts against expected form

๐Ÿงช Validation Rules

  • All skills must exist in skillRegistry
  • agent must support the given skill
  • Steps must specify either prompt, dslRef, or memoryScope
  • Outputs are validated via checksum if declared

โœ… Summary

  • Agent Execution DSL defines how agents work together
  • Drives modular, observable multi-skill orchestration plans
  • Supports memory injection, prompt binding, and output validation
  • Enables full lifecycle control from problem โ†’ blueprint โ†’ code โ†’ PR

๐Ÿง  Linking DSLs to Blueprint & Vision Documents

In the ConnectSoft platform, DSLs arenโ€™t created in isolation โ€” they are derived, aligned, and traceable from:

  • โœจ Vision Documents: business goals, feature intent, user personas
  • ๐Ÿงฑ Blueprints: technical structure, modules, service responsibilities

This linking ensures that generated DSLs accurately reflect business context and can be evolved as upstream inputs change.

โ€œBlueprints define what to build, vision explains why โ€” DSLs are the bridge.โ€


๐Ÿ” Source Hierarchy Overview

graph TD
    A[Vision Document] --> B[Blueprint]
    B --> C[DSLs]
    C --> D[Artifacts (Code, Tests, Pipelines)]
Hold "Alt" / "Option" to enable pan & zoom

Each DSL includes a source or upstream reference to its originating vision/blueprint.


๐Ÿงฉ How Linking Works

1. Vision โ†’ DSL Mapping

Vision Entity Translates to DSL
Feature: "Book Appointment" Command in ddd.yaml
Persona: "Pet Owner" Test scenario in test.yaml
Module: "Notifications" Event in event.yaml, Adapter in adapter.yaml
Constraint: "Multi-tenant" Added to pipeline.yaml, adapter.yaml injection rules

2. Blueprint โ†’ DSL Binding

Blueprint Field DSL Output
boundedContext: Billing โ†’ dsl/Billing/ddd.yaml
service: NotificationService โ†’ dsl/Notifications/event.yaml
dependsOn: UserService โ†’ adapter.yaml reference
events: emits[] โ†’ event.yaml contracts

๐Ÿ“˜ DSL Metadata Example (Linked to Blueprint)

$meta:
  dslType: DDD
  context: Booking
  source:
    blueprint: blueprints/booking/blueprint.yaml
    feature: BookAppointment
    visionDoc: vision/booking/vision.md
  traceId: trace-link001
  agentId: domain-modeler

๐Ÿ“‚ Folder Convention

vision/
  booking/
    vision.md
blueprints/
  booking/
    blueprint.yaml
dsl/
  booking/
    ddd.yaml
    event.yaml

Studio recognizes and auto-links these paths.


๐Ÿง  Agent Behavior

Agent Behavior
Vision Architect Agent Emits vision.md with goals, scope, and personas
Blueprint Generator Agent Produces blueprint.yaml (context, modules, integrations)
DSL Generator Agent Reads both upstream files to generate accurate DSLs
QA Agent / Reviewer Can trace generated code/tests back to feature justification

๐Ÿ“Š Studio Support

Feature Description
โ€œShow DSL Sourceโ€ View original blueprint + vision fields
โ€œJump to Blueprintโ€ Cross-navigate from ddd.yaml to blueprint.yaml
โ€œCompare Generated DSL vs Visionโ€ Highlights mismatch or missing outputs
โ€œDSL Drift Detectorโ€ (future) Detects changes in upstream vision/blueprint not reflected in current DSL

โœ… Summary

  • DSLs are tightly coupled to upstream vision and blueprint documents
  • This ensures alignment to business goals and technical architecture
  • Agents embed source metadata to enable full traceability
  • DSLโ€“Blueprintโ€“Vision linkage is visible, validated, and auditable in Studio

๐Ÿ—‚๏ธ DSL Registry and Artifact Management

Every DSL in ConnectSoft is a versioned, traceable, and auditable artifact, managed by the DSL Registry โ€” a central component of the platformโ€™s modular, multi-agent architecture.

The registry ensures:

  • Consistent access to DSLs across agents and orchestrators
  • Version tracking and change history
  • Discovery and reuse of DSL components across modules or tenants
  • Linkage to generated artifacts, metrics, and commits

โ€œThe DSL registry is the factoryโ€™s source of truth for all structured intent.โ€


dsl/
  Booking/
    ddd.yaml
    event.yaml
    adapter.yaml
    test.yaml
    execution.yaml
  Billing/
    ddd.yaml
    pipeline.yaml

Each context (bounded context or domain) has its own namespace.


๐Ÿ“˜ DSL File Naming Conventions

Type File Name
Domain ddd.yaml
Events event.yaml
Adapters adapter.yaml
Tests test.yaml
Pipeline pipeline.yaml
Execution execution.yaml
Shared *.template.yaml

โœ… DSLs may also include *.metadata.json or $meta: blocks for traceability.


๐Ÿ” Versioning Model

Each DSL includes a version field (semver):

$meta:
  version: 1.0.2

Versioning Triggers:

Trigger Version Change
Added new optional field Patch (1.0.1 โ†’ 1.0.2)
Changed field structure/order Minor (1.0 โ†’ 1.1)
Breaking semantic meaning Major (1.x โ†’ 2.0)

All versions are retained in the registry under:

dsl/Booking/.history/ddd.v1.0.0.yaml

๐Ÿ“ฆ Artifact Linking

All artifacts emitted by agents (code, tests, configs) include:

{
  "traceId": "trace-abc123",
  "dslRef": "dsl/Booking/ddd.yaml",
  "dslVersion": "1.0.2",
  "artifact": "BookAppointmentHandler.cs"
}

This allows:

  • Audit of what code was generated from which DSL
  • Rebuild or rollback to a known version
  • Clear association of DSL โ†’ Artifact โ†’ PR

๐Ÿ“Š Studio Registry Features

Feature Description
DSL Explorer Navigate all DSLs by context and type
Version History Compare versions, diffs, rollback
Artifact Links See what files came from which DSL
Status Indicators Validated โœ…, Invalid โŒ, Deprecated โณ
Search & Filtering By agent, skill, module, tag, or traceId

๐Ÿ” Governance and Policies

  • DSLs must pass validation before being published
  • Mutating a DSL post-consumption triggers revalidation
  • Archived DSLs are retained for audit but not processed
  • Only specific agents (e.g., DSL Generator, Editor Agent) can write to the registry

๐Ÿค– Agent Interactions with Registry

Agent Role
DSL Generator Agent Emits DSL into registry with metadata
Planner / Orchestrator Looks up DSLs by type, version, or context
Rebuilder Agent Regenerates artifacts from pinned DSLs
Studio CLI (future) CLI tools to list, diff, export DSLs

โœ… Summary

  • The DSL Registry is the platformโ€™s authoritative source of structured software intent
  • All DSLs are versioned, validated, and linked to generated artifacts
  • Registry features power traceability, rebuilds, analytics, and reuse
  • Studio and agents use the registry to coordinate modular execution at scale

๐Ÿงช Future DSL Extensions and Custom Module Types

While the current ConnectSoft DSL suite covers foundational areas (DDD, Event, Test, Adapter, Pipeline, Execution), the platform is built to evolve new DSL types to support emerging needs such as:

  • Knowledge modeling
  • Analytics definitions
  • UI layout generation
  • Migration management
  • Custom orchestrator extensions

โ€œDSLs are not just tools โ€” they are language primitives for the factoryโ€™s next capabilities.โ€


๐Ÿ”ฎ Planned & Proposed DSL Types

DSL Type Purpose
Migration DSL Define DB schema evolutions, versioned changesets
UI DSL Describe component layout, binding to APIs, form logic
Analytics DSL Declare events, dimensions, metrics, and dashboards
Feature Flag DSL Define toggleable features, conditions, rollout plans
Workflow DSL Describe orchestration logic, human-in-loop flows
Memory DSL Declare structured memory objects for vector storage
Knowledge DSL Index long-form documents, FAQs, definitions
IAM DSL Role definitions, scopes, claims, policies
Task DSL Describe a multi-agent execution sequence (low-code automation)

๐Ÿ“˜ Example: Migration DSL (Draft)

$meta:
  dslType: Migration
  context: Billing
  version: 1.0.0
  traceId: trace-migrate123

migrations:
  - id: 001_create_invoices
    up:
      - createTable:
          name: Invoice
          columns:
            - name: Id
              type: Guid
              primaryKey: true
            - name: Amount
              type: Decimal
    down:
      - dropTable: Invoice

๐Ÿค– Agent Support for Future DSLs

DSL Type Agent (Planned/Existing) Skill
Migration Database Migration Agent EmitFluentMigratorScript
UI Frontend Layout Agent GenerateComponentLayout
Analytics Insights Agent EmitEventTrackingSchema
Workflow Orchestration Designer Agent EmitCoordinatorFlow
Memory Knowledge Ingestion Agent VectorizeMemoryEntry
IAM Security Architect Agent EmitAccessPolicy

๐Ÿง  Use Cases for Custom Module DSLs

Use Case DSL Outcome
Multi-tenant dashboarding analytics.yaml per context
Custom onboarding form ui-layout.yaml
Offline worker replay and retry workflow.yaml
Feature toggle-based release feature-flag.yaml
Memory-rich agents per tenant memory.yaml with vector embeddings

๐Ÿ“Š DSL Plugin System (Future)

ConnectSoft plans to support:

  • Plugin-registered DSL schemas
  • Custom validation rules per organization
  • Agent/skill mappings per custom DSL type
  • Auto-discovery via DSL metadata index

โ†’ Example: dslType: CRMRules โ†’ validated by custom agent, with downstream artifact emission.


๐Ÿงฉ DSL Composition (Experimental)

DSLs will support cross-type references, e.g.:

  • test.yaml reusing commands[] from ddd.yaml
  • analytics.yaml importing events from event.yaml
  • ui.yaml wiring to adapters declared in adapter.yaml

This unlocks advanced reuse and modular alignment across the system.


โœ… Summary

  • The ConnectSoft DSL engine is designed for extensibility
  • New DSLs can support UI, analytics, migrations, IAM, and more
  • Agent orchestration will adapt as DSL types evolve
  • DSLs will become composable and declaratively linked, enabling higher-level generation across more modules

๐Ÿ“š Recipes and Knowledge Memory vs DSLs

DSLs are not the only form of reusable intelligence in ConnectSoft.

The platform also supports:

  • Recipes โ†’ step-by-step, human-readable, contextualized guidance
  • Knowledge memory โ†’ semantic embeddings, indexed documents, and examples These power agent understanding, while DSLs power agent execution.

โ€œDSLs are code contracts. Recipes are how-tos. Knowledge is meaning. All three matter.โ€


๐Ÿงฉ Core Differences

Concept Format Used For Agent Role
DSL YAML/JSON Declarative contracts, generation Execution & artifact emission
Recipe Markdown Step-by-step instructions Prompt enhancement & planning
Memory Semantic vector Long-form docs, Q\&A, examples Prompt context & enrichment

๐Ÿ“˜ Example: DSL vs Recipe vs Memory

DSL (ddd.yaml)

commands:
  - name: BookAppointment
    fields:
      - patientId: Guid

Recipe (recipes/booking/book-appointment.md)

# BookAppointment Command

1. Validate patientId is not null
2. Check appointment slot is available
3. Save appointment
4. Emit AppointmentBooked event

Knowledge Memory

"The BookAppointment command must ensure that overlapping appointments are not allowed. If the time slot is occupied, return a domain exception."

Stored as a semantic chunk in the Booking context memory.


๐Ÿค– How Agents Use Them

Action DSL Used Recipe Used Memory Used
Generate BookAppointmentHandler.cs โœ… โœ… (optional prompt context) โœ… (injected context)
Plan test scenario from blueprint โœ… โœ… โœ…
Rebuild failed pipeline โœ… โœ… โŒ
Explain reasoning to user (studio UI) โŒ โœ… โœ…
Perform decision on best adapter type โŒ โœ… โœ…

๐Ÿง  Storage & Versioning

Asset Type Path Versioned?
DSL dsl/<context>/<type>.yaml โœ…
Recipe recipes/<context>/<use-case>.md โœ…
Memory memory/<context>/<semantic>.json โœ… (via embeddings snapshots)

๐Ÿ“Š Traceability and Observability

  • DSLs are observable: emit DslGenerated, DslValidated, etc.
  • Recipes are referenced in execution metadata, but not executed
  • Memory entries are recorded in memoryInjectionLog with traceId

๐Ÿงฉ Studio Features

Feature DSL Recipe Memory
Trace to code โœ… ๐Ÿ”„ linked ๐Ÿ”„ enriched
Display during prompt โœ… โœ… โœ…
Edit in UI โœ… โœ… ๐ŸŸก embedded only
Diff vs. generated output โœ… โœ… (planned) โŒ

๐Ÿ”„ Complementarity Model

graph TD
    A[DSL] --> C[Agent Execution]
    B[Recipe] --> C
    D[Memory Vector] --> C
    C --> E[Generated Code / Plan]
Hold "Alt" / "Option" to enable pan & zoom

DSL = declarative truth Recipe = procedural logic Memory = contextual intent

All are combined at execution time by the orchestrator and planner.


โœ… Summary

  • DSLs define what should be built
  • Recipes define how it should be done
  • Knowledge memory defines why it works or what matters

Together, they form the connective intelligence fabric of ConnectSoftโ€™s autonomous engineering system.


๐Ÿง  DSL-Aware Knowledge Graph

The DSL-Aware Knowledge Graph in ConnectSoft is the semantic structure that connects:

  • DSLs
  • Generated artifacts
  • Blueprints
  • Vision documents
  • Recipes
  • Memory embeddings
  • Agents and skills

This graph enables agents and orchestrators to reason across context, enforce consistency, and trace cause-and-effect across the entire software lifecycle.

โ€œThe knowledge graph is the map that lets agents navigate a factory of 3,000+ services โ€” with precision.โ€


๐Ÿงฉ What Is a DSL-Aware Knowledge Graph?

It is a semantic graph built from platform metadata, where nodes include:

  • DSLs (dslRef)
  • Skills (skillId)
  • Agents (agentId)
  • Trace IDs
  • Output files (artifacts)
  • Blueprints and recipes
  • Events (emitted/consumed)

And edges include:

  • definedBy
  • consumes
  • emits
  • linkedTo
  • derivedFrom
  • extends

๐Ÿ“˜ Example Subgraph

graph TD
    V[vision.md] -->|defines| BP[blueprint.yaml]
    BP -->|emits| D[ddd.yaml]
    D -->|consumed by| A1[Backend Agent]
    D -->|produces| H[BookAppointmentHandler.cs]
    D -->|extends| T[ddd.template.yaml]
    H -->|committed in| PR[PR #123]
Hold "Alt" / "Option" to enable pan & zoom

Each node and edge is tagged with traceId, context, dslType, etc.


๐Ÿ” Queries Supported

Query Purpose
โ€œWhat DSLs were used to generate this artifact?โ€ Trace backward from code
โ€œWhich agents modified this module?โ€ Identify contributors
โ€œWhat vision goal led to this event contract?โ€ Business-to-code mapping
โ€œWhat DSLs were extended by this one?โ€ Inheritance map
โ€œWhat tests validate a command?โ€ Validation chain

๐Ÿง  Powered By

  • Internal graph database or metadata index
  • Updated continuously by orchestrator and agents
  • Enriched with recipe references, memory usage, and user activity

๐Ÿ“Š Studio Features (Graph-Aware)

Feature Description
Trace Graph Explorer Navigate entity relationships visually
Dependency Impact Explorer Show affected DSLs/tests if aggregate changes
Coverage Map DSLs with missing artifacts/tests
โ€œWhy was this generated?โ€ Reverse map blueprint โ†’ DSL โ†’ skill โ†’ artifact

๐Ÿค– Agent Capabilities (Graph-Enabled)

Agent Behavior
Planner Agent Queries graph to decide next skill
QA Agent Uses graph to trace test gaps
Security Agent Flags orphaned/unused DSLs
Studio Assistant Agent Answers โ€œHow did this handler get here?โ€ questions

๐Ÿง  Knowledge Graph vs Knowledge Memory

Knowledge Graph Knowledge Memory
Structured, relational Semantic, vectorized
Used for traceability Used for context enrichment
GraphQL/DSL-exposed Natural language/prompt-based
Indexed by IDs and refs Indexed by semantic embeddings

โœ… Together, they provide full contextual + relational understanding of the software factory.


โœ… Summary

  • The DSL-Aware Knowledge Graph connects all entities in the platform: vision โ†’ blueprint โ†’ DSL โ†’ skill โ†’ artifact
  • Enables traceability, reasoning, planning, and impact analysis
  • Used by agents, Studio, and orchestration pipelines
  • Serves as the structural backbone of autonomy at scale