Skip to content

🌐 Service Blueprint

🧭 What Is a Service Blueprint?

A Service Blueprint is a domain-centric, functional specification that defines a cohesive set of business capabilities as a logical unit β€” decoupled from its technical realization (e.g., microservice, module, shared library).

In the ConnectSoft AI Software Factory, a Service is a business-aligned boundary that serves as the primary unit of domain responsibility and orchestration.

It is not necessarily a runtime artifact. Instead, it acts as:

  • A domain container for behavior, state, APIs, and events
  • A source of truth for related capabilities, workflows, and data contracts
  • A bridge between feature-level specifications and physical microservices/modules

🧱 Not Just a Microservice

While a microservice is a deployable runtime unit, a service blueprint is a domain-first design construct. In some cases:

  • A service may be implemented by a single microservice
  • In other cases, it may span:

  • Several collaborating modules

  • Internal orchestration within a monolith
  • Event processors or background workers
  • Libraries or SDKs used across runtimes

πŸ“˜ Example Service Domains

Service Name Description
ReferralService Manages referrals, status flows, and outbound messaging
NotificationService Centralized gateway for email, SMS, and push channels
DocumentGenerationService Handles rendering, templating, versioning of PDFs and reports
PaymentService Encapsulates billing, invoices, transactions

These services are defined before deciding if they require standalone deployment.


🧠 Agent Usage

The Microservice Generator Agent, Domain Model Agent, and Product Manager Agent all rely on the Service Blueprint to:

  • Drive physical architecture decisions (microservice, module, or gateway)
  • Coordinate message contracts
  • Align testing scope and boundaries
  • Index for reuse in libraries or other platforms

🎯 Why It Exists in the Factory

The Service Blueprint is foundational to the ConnectSoft AI Software Factory because it enables a domain-driven, technology-agnostic representation of business functionality before any decisions are made about:

  • Deployment boundaries
  • Hosting models
  • Implementation strategy

It ensures business-aligned reasoning, promotes clean separation of concerns, and powers downstream orchestration and reuse.


🏭 Core Reasons for Existence

Reason Description
🧠 Agent Interoperability Serves as a shared boundary object across Product, Architecture, and QA agents
πŸ”— Traceable Functional Mapping Aligns features, stories, and events with a bounded responsibility surface
🧱 Independent of Implementation Allows separation of design vs physical topology (microservice, module, lib)
♻️ Reusability & Composability Services can be reused across apps, APIs, and domains
πŸ“¦ Template-Agnostic Design Precedes and informs template CLI generation (microservice vs shared module)

🧠 Role in Agent System

The Service Blueprint is not generated by a single agent β€” it's an emergent construct, composed from signals and artifacts across multiple upstream agents:

  • 🧠 Vision Architect Agent β†’ Initial domain hints, goals
  • πŸ‘©β€πŸ’Ό Product Manager Agent β†’ Features and responsibilities
  • 🧱 Domain Model Agent β†’ Aggregates and entities
  • 🧠 Microservice Generator Agent β†’ Realizes service in physical form

πŸ“š Agent Knowledge Coordination

It serves as a semantic glue between:

  • Features in Product Blueprint
  • Entities in Domain Model
  • APIs and contracts in Microservice Blueprint
  • Security boundaries in Auth Blueprint
  • Deployment strategies in Infra Blueprint

πŸ” Example Factory Use Cases

  • βœ… Validate a service boundary supports all required features
  • 🧠 Regenerate contracts or tests when service structure changes
  • πŸ—οΈ Delay or change implementation model (from lib β†’ microservice)
  • πŸ” Support multiple versions of a service with traceability
  • 🧠 Use in prompt memory, search, or code generation scaffolding

Without the Service Blueprint, the Factory would be forced to reason too early about physical artifacts β€” reducing agility, traceability, and modular evolution.


🧠 Agent Responsible

The Service Blueprint is a composite artifact, generated through collaborative coordination between multiple intelligent agents within the ConnectSoft AI Software Factory. While no single agent owns the entire blueprint, it is materialized and validated primarily by the following:


🧠 Primary Agent: Service Blueprint Generator Agent

Role Description
🧠 Service Blueprint Generator Agent Synthesizes inputs from upstream agents to create or update the blueprint
πŸ“Œ Memory-aware Reads previous service artifacts and deltas from prior versions
βš™οΈ Orchestration-aware Injects outputs into downstream agents (code gen, tests, CI)

🀝 Supporting Agents

Agent Role in Blueprint Generation
Vision Architect Agent Provides domain problems, constraints, goals
Product Manager Agent Supplies business features and capabilities
Domain Model Agent Supplies aggregates, entities, value objects
Microservice Generator Agent Decides if this blueprint maps to physical microservice(s)
Test Generator Agent Generates contracts, behavior, and scenario test definitions
Infrastructure Blueprint Agent Maps service to hosting/deployment decisions

🧬 Agent Collaboration Diagram

graph TD
  Vision["🧠 Vision Architect Agent"]
  Product["πŸ‘©β€πŸ’Ό Product Manager Agent"]
  Domain["πŸ“¦ Domain Model Agent"]
  Generator["πŸ—οΈ Service Blueprint Generator Agent"]
  Microservice["βš™οΈ Microservice Generator Agent"]
  Test["πŸ§ͺ Test Generator Agent"]

  Vision --> Generator
  Product --> Generator
  Domain --> Generator
  Generator --> Microservice
  Generator --> Test
Hold "Alt" / "Option" to enable pan & zoom

The Service Blueprint Generator Agent is not a passive formatter β€” it understands semantic structure, computes deltas, and adapts structure based on evolving needs.


πŸ“₯ Agent Inputs

  • πŸ“˜ Vision Blueprint
  • πŸ“¦ Domain model catalog
  • 🧩 Product-feature-service linkage table
  • πŸ” Prior versions of this service
  • πŸ“Š System health & trace logs (observability loop)

πŸ“€ Agent Outputs

  • service-blueprint.md / .json
  • Traceable embeddings for reuse across feature graphs
  • Signal triggers for downstream scaffolding or CI

🧱 Difference Between Service, Module, Microservice

The ConnectSoft AI Software Factory promotes layered abstractions to maximize separation of concerns. At the heart of this structure is the Service β€” which serves as the functional core. To understand how Service Blueprints relate to other constructs, we distinguish between:


πŸ” 1. Service

A Service is a domain-aligned unit of business responsibility β€” not a deployment unit or code artifact. It defines:

  • 🎯 What the business logic is
  • 🧠 What entities, processes, and workflows it owns
  • πŸ”„ What contracts and messages it manages

It is the semantic center of a capability.


βš™οΈ 2. Module

A Module is a code packaging construct β€” typically realized as a:

  • Shared .NET library (.csproj)
  • Internal SDK
  • Plug-in or adapter

It may or may not be a full service, and can belong to one or more services.

Modules are technical constructs that group reusable behaviors or data structures.


πŸš€ 3. Microservice

A Microservice is a runtime-deployable, infrastructure-isolated unit that may implement:

  • A single service (ideal case)
  • Multiple closely related services (less ideal)
  • Or a part of a larger monolith (in legacy systems)

Microservices are the deployment boundary, not the business boundary.


🧱 Comparison Table

Concept Defines Aligned To Owned By Deployable Reusable
Service Business capability Domain Language Product/Architect No Yes
Module Code package/unit Code structure Dev team No Yes
Microservice Deployment unit Infra boundary DevOps Yes No

🧠 Factory Behavior

Input Type Factory Action
Service Generates contracts, tests, orchestration blueprints
Module Generates .csproj, DI setup, unit tests
Microservice Generates full solution, Dockerfile, CI/CD pipelines

The Service Blueprint is where business logic and functional ownership are defined β€” it is the most stable and semantic layer in the system. Other layers may change, deploy, or evolve β€” but services remain aligned to purpose.


πŸ“˜ Format and File Shape

Every Service Blueprint in the ConnectSoft AI Software Factory is generated as a multi-format artifact that supports both human review and machine processing. This guarantees compatibility across agents, traceability in memory graphs, and visibility in Studio interfaces.


πŸ“ Primary File Outputs

Format Description Used By
.md Human-readable Markdown blueprint Studio UI, architects, reviewers
.json Canonical machine-readable structure Downstream agents, validators
embedding Semantic vector embedding for memory graph indexing Retrieval, summarization, search

πŸ“¦ Example File Structure

blueprints/services/ReferralService/
β”œβ”€β”€ service-blueprint.md
β”œβ”€β”€ service-blueprint.json
β”œβ”€β”€ embedding.vector

πŸ“š Blueprint Naming Convention

blueprints/services/{ServiceName}/service-blueprint.{md,json}
  • ServiceName is in PascalCase and must match the internal blueprint ID
  • Versioned via tagging or suffix (-v2.md, v2025-06-01.json)
  • Embeddings are auto-tagged with blueprint hash and version

✨ Markdown File Structure

The .md file includes standardized sections:

# πŸ“˜ ReferralService – Service Blueprint

## 🎯 Business Responsibility
## 🧩 Features Covered
## πŸ“¦ Aggregates and Entities
## πŸ” APIs and Events
## 🧠 Role in System
## πŸ§ͺ Tests and Quality Constraints
## πŸ” Security Scope
...

Each section is traceable by agents and validated by blueprint checkers.


🧠 JSON File Schema (Simplified)

{
  "id": "ReferralService",
  "description": "...",
  "features": [...],
  "entities": [...],
  "apis": {...},
  "events": {...},
  "constraints": {...},
  "version": "v1",
  "traceId": "svc-93A7EAF"
}
  • Schema is validated and versioned using a shared Factory JSON schema
  • Machine-readable format feeds template generation, orchestration, testing, etc.

🧠 Embedding & Trace Graph

  • All blueprints are indexed in the Factory memory graph using:

  • Blueprint ID

  • Version hash
  • Feature tags
  • Domain scope
  • Aggregate references
  • Enables search, recall, diffing, and quality scoring

πŸ“Œ By producing blueprints in multiple formats, the Factory ensures agents can generate, reason about, evolve, and trace services across their full lifecycle.


πŸ“ Naming, Storage, Versioning

The ConnectSoft AI Software Factory enforces consistent naming conventions, blueprint storage layouts, and versioning policies to ensure traceability, reproducibility, and compatibility of every Service Blueprint across its lifecycle.


🧾 Naming Convention

Element Rule
Service Name PascalCase, must reflect business capability (e.g., BillingService)
File Prefix Always service-blueprint
Version Tags Appended via suffix or folder hierarchy
Trace ID Globally unique and stable across regenerations

Example Blueprint Files:

blueprints/services/NotificationService/service-blueprint.md
blueprints/services/NotificationService/service-blueprint-v2.json

Traceable ID inside file:

"traceId": "svc-notification-20250608"

πŸ—‚οΈ Storage Structure

blueprints/
└── services/
    β”œβ”€β”€ NotificationService/
    β”‚   β”œβ”€β”€ service-blueprint.md
    β”‚   β”œβ”€β”€ service-blueprint.json
    β”‚   β”œβ”€β”€ v1/
    β”‚   β”‚   β”œβ”€β”€ snapshot.md
    β”‚   β”‚   β”œβ”€β”€ diff-report.json
    β”‚   β”œβ”€β”€ embeddings/
    β”‚   β”‚   β”œβ”€β”€ vector.json
    β”‚   └── coverage/
    β”‚       β”œβ”€β”€ apis.csv
    β”‚       └── tests.md
  • Embeddings are stored separately but linked by traceId
  • Coverage reports, diffs, and deltas are included for blueprint evolution

πŸ•˜ Versioning Strategies

Strategy Description
Semver e.g., v1.2.3 for functional/service scope versions
Date-stamped e.g., v2025-06-08 used for regenerations tied to Factory orchestration
Labeled e.g., draft, approved, validated, archived

Blueprints always retain both human-meaningful and machine-consumable version metadata.


πŸ” Regeneration Markers

Each blueprint version includes:

  • originPromptId
  • generatedByAgent
  • upstreamDeltaHash
  • changeSummary

This enables diff auditing, traceable regeneration, and backward-compatible history.


πŸ“¦ GitOps Alignment

Service blueprints are treated as version-controlled assets. Each update to the blueprint is:

  • Committed to Git
  • Reviewed via pull request or CI validator
  • Associated with automated snapshot tests and diff checks

🧠 Factory agents use these structures to identify whether a blueprint needs to be regenerated, evolved, or relinked to new features or contexts.


🧩 Input Dependencies

To generate and evolve a Service Blueprint, the AI Software Factory relies on a rich network of upstream inputs β€” from domain models and product plans to memory traces and system constraints. These ensure that each service is semantically valid, contextually grounded, and operationally coherent.


🧠 Core Input Sources

Source Description
🧠 Vision Blueprint Provides the purpose, business goals, constraints, and user impact
πŸ“‹ Product Blueprint Lists features, epics, and capabilities assigned to this service
πŸ“¦ Domain Model Blueprint Defines entities, aggregates, value objects, enums within service boundary
πŸ” System Interaction Graph Maps dependencies to APIs, events, and other services
🧱 Architecture Blueprint Establishes DDD boundaries, service placement, and responsibilities
🧠 Memory Graph Provides historical embeddings, previous versions, quality scores

πŸ”„ Supporting Inputs

Input Used For
Feature-to-Service Mapping Determines which features fall under this service scope
Event Taxonomy Establishes which domain events this service publishes or subscribes to
Security Model / Auth Blueprint Clarifies trust zones and role-based access
Test Coverage Matrix Determines expected scenario and behavior tests

🧠 Input Resolution Flow (Orchestration View)

flowchart TD
  Product[πŸ“‹ Product Blueprint]
  Vision[🧠 Vision Blueprint]
  Domain[πŸ“¦ Domain Model]
  Arch[πŸ›οΈ Architecture Blueprint]
  Generator[πŸ€– Service Blueprint Generator Agent]

  Product --> Generator
  Vision --> Generator
  Domain --> Generator
  Arch --> Generator
Hold "Alt" / "Option" to enable pan & zoom

The Service Blueprint is not created in isolation β€” it’s synthesized from upstream cognitive signals and orchestrated artifacts.


πŸ“š Sample Input Snapshot (ReferralService)

{
  "visionGoal": "Streamline referral workflows between clinics",
  "features": ["SubmitReferral", "UpdateReferralStatus", "NotifyReferrer"],
  "entities": ["Referral", "Clinic", "User"],
  "events": ["ReferralSubmitted", "ReferralStatusChanged"],
  "authScope": "Clinic Admin, Referrer"
}

πŸ“Œ This deep set of inputs ensures that each service is richly described, strategically placed, and cross-agent interoperable from its first generation.


πŸ”„ Generation Trigger Events

The Service Blueprint is not a static artifact β€” it is continuously regenerated, evolved, or refined based on meaningful change events in the AI Software Factory. These events may be triggered by humans, other agents, or automated diff watchers in the memory graph.


πŸ” When Is a Service Blueprint Created?

Trigger Type Description
🧠 New Feature Assigned A new product capability maps to a domain that has no existing service
πŸ“¦ New Aggregate Introduced A new domain entity or process emerges from the Domain Model blueprint
πŸ—οΈ New Microservice Planned The Architecture Blueprint defines a new runtime component
πŸ” Service Coverage Gap Detected by QA/Test Generator Agent or Audit Agent
πŸ‘€ Human Prompt A user or engineer explicitly requests a new service via the UI or prompt

πŸ” When Is It Regenerated?

Change Signal Cause
🧠 Vision Change Business goals or constraints evolve
πŸ“‹ Feature Modified An existing feature shifts ownership or structure
πŸ” Event Reassignment Events published/subscribed shift from one service to another
⚠️ Observability Gap Detected Metrics, tests, or contracts missing or outdated
🧠 Blueprint Invalidation A downstream agent fails validation due to stale or missing data

🧠 Trigger Sources by Agent

Agent Trigger Role
Product Manager Agent Suggests new services based on emerging features
Domain Model Agent Splits or merges service scope when domain changes
Architecture Blueprint Agent Creates new blueprint shell if system topology is updated
Test Generator Agent Requests regeneration when scenarios are uncovered or outdated
Blueprint Auditor Agent Flags blueprint for rebuild if violations or omissions detected

πŸ“ˆ Regeneration Event Types

Event Name Trigger Pattern
ServiceBlueprintMissing No blueprint exists for mapped feature
ServiceScopeConflictDetected Feature mapped to multiple services
ServiceContractOutdated DTOs or events out of sync
ServiceBlueprintEvolved Manually triggered regeneration

🧠 Sample Orchestration Flow

sequenceDiagram
    participant ProductAgent
    participant DomainAgent
    participant ServiceGenAgent
    participant MicroserviceAgent

    ProductAgent->>ServiceGenAgent: Feature β†’ Service Mapping
    DomainAgent->>ServiceGenAgent: Entity β†’ Aggregate Inclusion
    ServiceGenAgent->>MicroserviceAgent: Blueprint β†’ Runtime Mapping
Hold "Alt" / "Option" to enable pan & zoom

πŸ” Service Blueprints are living artifacts, maintained as part of the Factory’s evolving knowledge graph β€” regenerated when the world changes, not just when code changes.


πŸ“¦ Outputs and Consumers

The Service Blueprint produces structured, traceable outputs that are consumed by multiple agents, templates, and orchestration layers across the ConnectSoft AI Software Factory. These outputs form the foundation for code generation, testing, orchestration, and runtime alignment.


πŸ“€ Core Outputs

Output Type Format Purpose
🧠 service-blueprint.md Markdown Human-readable overview for architects and Studio
🧠 service-blueprint.json JSON Canonical structure for agent interoperability
πŸ“¦ feature-to-service-map.json JSON Lookup table for downstream traceability
🧬 embedding.vector Vector Injected into memory graph for search, validation, and diffing
πŸ” service-contracts.json JSON Extracted interface shape for tests, DTOs, API consistency
πŸ§ͺ scenario-tags.yaml YAML Used by Test Generator to seed coverage plans

πŸ‘₯ Primary Consumers

Consumer Agent/System Role
Microservice Generator Agent Maps service into CLI template for physical realization
Test Generator Agent Uses blueprint to create scenario tests, contract verifications
Observability Agent Builds telemetry and tracing plan based on events/APIs in blueprint
Blueprint Auditor Agent Validates blueprint completeness, integrity, alignment with domain model
Orchestration Agent Aligns gateway routing, event choreography, and system flow
Documentation Agent Generates linked markdown pages for Studio users

πŸ“˜ Cross-Blueprint Traceability

Service Blueprint β†’ Microservice Blueprint:

  • May result in:

  • A dedicated microservice (if required)

  • A shared module (if embedded into another service)
  • A service proxy/gateway route (if composed by gateway)

This mapping is tracked using serviceBlueprintId β†’ microserviceBlueprintId links.


πŸ§ͺ Service-to-Test Coverage

  • Each service-blueprint.json declares:

  • Required feature scenarios

  • Success and failure cases
  • API + Event contract expectations

These are converted to automated test plans and CI hooks.


🧠 Memory Graph Entry Example

{
  "id": "ReferralService",
  "type": "ServiceBlueprint",
  "traceId": "svc-referral-v2",
  "features": ["SubmitReferral", "CancelReferral"],
  "mappedTo": ["microservices/referral", "tests/scenarios/referral-tests.md"]
}

πŸ“¦ A Service Blueprint is not just documentation β€” it is a generation contract, traceable node, and cognitive artifact used by the entire AI factory runtime.


πŸ“š Domain Responsibility & Business Role

At its core, every Service Blueprint represents a bounded domain responsibility β€” a distinct business capability that the software system must own, model, and evolve. It describes what the service exists to do, in language that is understandable to stakeholders and traceable by agents.


🎯 What a Service Owns

A service should:

  • Manage a cohesive subset of domain logic
  • Own aggregates, policies, and invariants
  • Enforce business rules that are consistent across APIs and events
  • Serve as the source of truth for one or more business capabilities

🧱 Characteristics of a Well-Defined Service

Property Description
🎯 Aligned Purpose Clearly tied to a business goal or outcome
πŸ“¦ Entity Ownership Defines, persists, and mutates specific domain aggregates
πŸ“Š Behavioral Cohesion Centralizes decisions, transitions, and workflows
🧠 Cross-Capability Reuse May be invoked by multiple modules, microservices, or APIs

🧠 Example: ReferralService

{
  "id": "ReferralService",
  "description": "Handles all operations related to medical referrals between clinics.",
  "features": [
    "SubmitReferral",
    "UpdateReferralStatus",
    "AttachDocumentsToReferral",
    "NotifyReferrer",
    "RejectReferral"
  ],
  "entities": [
    "Referral",
    "ReferralStatus",
    "Clinic",
    "ReferralAttachment"
  ],
  "ownership": "Manages state transitions and auditability of all referral workflows"
}

πŸ”„ Boundaries in Domain-Driven Design

Service blueprints often align with:

  • Bounded Contexts in the architecture blueprint
  • Capability maps in product planning
  • Sagas or processes in orchestration models

This alignment enables traceability across all levels of the Factory β€” from idea to code to behavior to test.


🧠 Used By Agents To:

  • Validate whether a capability is fully covered
  • Identify which service owns a contract or aggregate
  • Evaluate test coverage vs. business priority
  • Recommend splitting or merging service scope over time

πŸ“š The β€œResponsibility” section of the Service Blueprint becomes a declarative contract between business intent and system implementation β€” and is central to domain-driven traceability.


🧾 Interfaces and Contracts

Every Service Blueprint defines the public-facing contracts that allow other services, frontends, and systems to interact with its domain logic. These contracts are essential for API generation, integration testing, and event choreography across the Factory.


πŸ”Œ Types of Interfaces

Interface Type Description Protocol
πŸ“‘ REST API Exposes commands and queries for synchronous interaction HTTP / OpenAPI
πŸ” Events Publishes domain events and listens to others for coordination Event Bus (Azure SB / Kafka)
🧠 Internal APIs Optional private interfaces consumed by other services/modules gRPC / internal REST
πŸ“¦ Shared Contracts DTOs, Enums, Value Objects shared with other components JSON Schema / ProtoBuf

πŸ“˜ Interface Blueprint Block Example

"contracts": {
  "restApi": {
    "basePath": "/referrals",
    "endpoints": [
      {
        "method": "POST",
        "path": "/submit",
        "input": "SubmitReferralRequest",
        "output": "ReferralResponse"
      },
      {
        "method": "PATCH",
        "path": "/{id}/status",
        "input": "UpdateReferralStatusRequest",
        "output": "ReferralStatusResponse"
      }
    ]
  },
  "events": {
    "publishes": ["ReferralSubmitted", "ReferralRejected"],
    "subscribes": ["UserRegistered", "ClinicUpdated"]
  }
}

🧠 Usage Across the Factory

Component Role
API Contract Generator Agent Creates OpenAPI or gRPC specs from this blueprint
Test Generator Agent Produces integration and contract tests for each interface
Microservice Generator Agent Scaffolds controllers, handlers, and DTOs
Observability Agent Hooks telemetry into endpoint and event flows
Gateway Blueprint Agent Routes and secures endpoint access via API gateway layer

πŸ“š Contract Scope Best Practices

  • πŸ“Œ Contracts should be:

  • Owned by the service (not shared across boundaries blindly)

  • Stable, versioned, and explicitly traceable
  • Minimal β€” exposing only what is necessary for orchestration
  • 🧠 Internal contracts may be reused via generated SDKs (e.g., with ConnectSoft.ContractGenerator tools)

πŸ” Memory Graph Linking

Each endpoint and event is linked to:

  • Service Blueprint ID
  • Feature ID(s)
  • Aggregate / DTO definition
  • Traceable tests and consumer mappings

🧾 A service’s contracts are its external promise β€” defining how the domain can be safely interacted with, reused, and evolved across the platform.


πŸ“¦ Entities, Aggregates, and Ownership Scope

A core function of a Service Blueprint is to declare which domain objects the service owns, manages, and mutates. This defines its bounded context, informs DDD design, and ensures clean separations between services, avoiding shared write ownership.


🧱 Entity Types in the Blueprint

Type Description
🧩 Entity A domain object with identity (e.g., Referral, Invoice)
πŸ”— Aggregate A root entity and its invariants (e.g., Referral + Attachments)
🎭 Value Object Stateless, immutable type used for modeling attributes (e.g., EmailAddress)
🧾 Enum Enumerated set of business states or categories

πŸ“š Example: ReferralService

"entities": [
  {
    "name": "Referral",
    "type": "Aggregate",
    "owned": true,
    "description": "Represents the lifecycle of a patient referral between clinics"
  },
  {
    "name": "ReferralStatus",
    "type": "Enum",
    "description": "Enumerates possible states: Draft, Submitted, Rejected, Completed"
  },
  {
    "name": "Clinic",
    "type": "Entity",
    "owned": false,
    "reference": "OrganizationService"
  }
]

🧠 Ownership Semantics

Ownership Type Meaning
owned: true Service can mutate, validate, and store this object
owned: false Service only references this object; managed by another service
composed The object is fully embedded inside an aggregate; no global identity

Ownership metadata enables clean modeling and prevents write conflicts, aggregate overlap, or event schema duplication.


🧠 Used By Agents To:

Agent Role
Domain Model Agent Enforces aggregate integrity and invariants
Microservice Generator Agent Maps aggregates into folders, repositories, handlers
Test Generator Agent Generates tests aligned to entity lifecycle transitions
Documentation Agent Renders entity diagrams and type hierarchies in markdown
Security Agent Determines RBAC scopes for aggregate-sensitive operations

🧠 Entity Trace Indexing

All entities are trace-indexed with:

  • entityId and owningServiceId
  • aggregateGroup, events, scenarios, and features
  • vector embeddings for semantic lookup

πŸ“¦ Entity and aggregate modeling is not optional β€” it’s the semantic backbone of the Factory, enabling clean architecture, valid code generation, and consistent behavior.


πŸ” Security & Authorization Scope

Each Service Blueprint defines a precise security boundary β€” identifying who can access what, under what roles, and via which interfaces. This forms the basis for both code-level enforcement and infrastructure policy alignment, ensuring that generated services comply with Zero Trust and Least Privilege principles from day one.


πŸ” What’s Captured

Security Element Description
πŸ”‘ Access Roles Roles or scopes permitted to interact with APIs and features
πŸ›‘οΈ Trust Zone Whether the service is internal-only, public-facing, or shared
πŸ” Authn Mechanism Token-based (OAuth2/OpenID), API Key, or session token
πŸ” Data Access Level Full, scoped (e.g., own clinic only), or read-only
🚫 Forbidden Actions Hard limits for certain actors (e.g., no deletes for non-admins)

πŸ“˜ Example Security Declaration

"security": {
  "accessRoles": ["ClinicAdmin", "Referrer", "SystemAuditor"],
  "trustZone": "internal",
  "authMechanism": "OpenIdConnect",
  "scopedAccess": true,
  "scopeFilter": "ClinicId",
  "restrictedActions": ["RejectReferral"]
}

🎯 Authorization Patterns

  • πŸ” RBAC (Role-Based Access Control): Maps OpenId claims or internal roles to permissions
  • πŸ” ABAC (Attribute-Based Access Control): Enforces clinic-level, region-level, or user-ownership constraints
  • 🚨 Audit-Only Operations: Allows actions but logs them with elevated observability tags

🧠 Used By Agents To:

Agent Use of Security Scope
Microservice Generator Agent Generates auth decorators, guards, policy attributes
API Gateway Agent Injects policies into reverse proxy rules and middleware
Security Agent Validates RBAC alignment, scopes, token expectations
Test Generator Agent Generates access violation tests and forbidden scenario cases
Observability Agent Tags security-sensitive endpoints with alerts and metrics

πŸ“¦ Artifacts Derived

Artifact Format Description
security-policy.json JSON Resolved list of actions, roles, and constraints
policy-injection.config Configuration Middleware or filter registration for auth policies
test-auth-cases.yaml YAML Scenario cases for positive and negative access tests

πŸ” Every service in the Factory is security-first by design β€” access control is modeled, codified, enforced, and tested before the first request hits production.


βš™οΈ Runtime Characteristics (Resilience, Health, Limits)

The Service Blueprint includes key operational metadata that describes how the service should behave at runtime under stress, failure, or degraded conditions. These attributes guide resilience engineering, service health monitoring, and automated platform configuration.


βš™οΈ Runtime Dimensions

Aspect Description
πŸ” Retry Policy Defines when and how retries occur (e.g., transient fault handling)
⏳ Timeout Settings Maximum time per operation or request
🧯 Circuit Breaker Flags when a service or downstream dependency should temporarily halt usage
❀️ Health Checks Liveness, readiness, startup probes
πŸ“Š Resource Limits CPU, memory, concurrency constraints
πŸ§ͺ Fault Injection Chaos/resilience testing hooks

πŸ“˜ Example Runtime Declaration

"runtime": {
  "timeoutMs": 3000,
  "retryPolicy": {
    "maxAttempts": 3,
    "backoffStrategy": "exponential"
  },
  "circuitBreaker": {
    "failureThreshold": 0.5,
    "cooldownPeriod": 30
  },
  "healthChecks": ["startup", "liveness", "readiness"],
  "resourceLimits": {
    "cpu": "500m",
    "memory": "256Mi"
  }
}

🧠 Used By Factory Agents To:

Agent Runtime Usage
Microservice Generator Agent Injects Polly resilience handlers, timeout tokens, and config bindings
Deployment Agent Maps limits to container resources and startup probes
Observability Agent Wires up health endpoints to telemetry dashboards and alert rules
Chaos Testing Agent Plans fault scenarios (e.g., drop messages, delay APIs, exhaust memory)
Pipeline Agent Creates smoke test hooks and resilience probes in CI/CD

πŸ”„ Config Output Artifacts

Artifact Description
resilience.json Formal retry, timeout, breaker rules
health-check.config.yaml K8s and cloud-native probe definitions
startup-constraints.json Startup dependencies and initialization order
limits.yaml CPU, memory, scaling thresholds

πŸ§ͺ Validation Considerations

  • πŸ” All retry and timeout settings are validated against downstream SLAs
  • ❀️ Health checks are observable, testable, and traced
  • πŸ“Š Limits are enforced via Helm charts / Terraform in downstream IaC

βš™οΈ Runtime behavior is codified in the blueprint, ensuring all generated microservices operate with consistent, observable, and resilient defaults β€” aligned to their domain impact.


πŸ“ˆ Observability Tags and Metrics

Every Service Blueprint in the Factory explicitly defines how the service should be instrumented, traced, and monitored. This enables deep integration with the platform’s observability mesh, ensuring that every behavior is measurable, debuggable, and traceable β€” across logs, metrics, traces, and events.


πŸ“Š Observability Dimensions

Dimension Description
πŸ“› Trace Identity Unique traceId per request, span propagation, correlation ID headers
🧠 Agent Metadata Injected tags like agentId, featureId, scenarioId
πŸ“Š Custom Metrics Domain-specific counters, timers, histograms (e.g., referral_accepted)
πŸ“‹ Audit Trails Entity-level change logs and decision justifications
🚨 Alerts & Thresholds Configurable rules for errors, latency, throughput

πŸ“˜ Example Observability Block

"observability": {
  "traceIdPropagation": true,
  "customTags": ["featureId", "scenarioId", "aggregateId"],
  "metrics": [
    {
      "name": "referral_submissions_total",
      "type": "counter",
      "labels": ["status", "clinicId"]
    },
    {
      "name": "referral_processing_duration_ms",
      "type": "histogram"
    }
  ],
  "auditTrailEnabled": true
}

🧠 Used By Agents To:

Agent Role
Observability Agent Injects metrics, logs, and trace hooks in the generated service
Test Generator Agent Verifies that observability outputs match service expectations
Documentation Agent Renders observability overview and dashboards
Security Agent Monitors for suspicious access patterns or policy violations
Orchestration Agent Links observability to the event mesh and root-cause workflows

πŸ› οΈ Toolchain Integration

Integration Example
Tracing OpenTelemetry + Azure Monitor / Zipkin / Jaeger
Metrics Prometheus, Azure Metrics, Grafana dashboards
Logging Serilog + Trace Correlation + Log Enrichment
Alerts Azure Alerts, Grafana Alerts, PagerDuty integrations

🧬 Blueprint-Driven Metrics

Each metric declared in the blueprint is:

  • Embedded into generated service code (via metric libraries)
  • Registered with monitoring dashboards (via observability provisioning)
  • Linked to feature β†’ entity β†’ scenario lineage for fine-grained visibility

πŸ“ˆ Observability is not an afterthought in the Factory β€” it is modeled, versioned, validated, and deployed as part of the Service Blueprint contract.


πŸ”„ Event Publishing and Subscriptions

Each Service Blueprint explicitly defines its event-driven interactions: the domain events it publishes, those it subscribes to, and how those events are structured, versioned, and processed. This enables true event-driven architecture (EDA) and supports clean service choreography across the Factory.


πŸ“¦ Event Contracts

Event Type Role Format
πŸ“€ Published Events Emitted as outcomes of domain transitions CloudEvent / JSON Schema
πŸ“₯ Subscribed Events Trigger state changes or side-effects CloudEvent / Protobuf
🧠 Internal Events Optional in-process triggers or audits Internal DTOs

πŸ“˜ Example Event Declaration

"events": {
  "publishes": [
    {
      "name": "ReferralSubmitted",
      "schema": "v1",
      "triggeredBy": ["POST /referrals/submit"]
    },
    {
      "name": "ReferralRejected",
      "schema": "v1",
      "triggeredBy": ["PATCH /referrals/{id}/status"]
    }
  ],
  "subscribes": [
    {
      "name": "UserRegistered",
      "sourceService": "UserService",
      "usedFor": "Auto-linking referrals"
    },
    {
      "name": "ClinicUpdated",
      "sourceService": "OrganizationService"
    }
  ]
}

πŸ“‘ Event Metadata (Standardized)

Attribute Description
eventType Semantic category (e.g., DomainEvent, IntegrationEvent)
sourceService Owning service
correlationId Tied to trace and aggregate
version Allows safe evolution and consumers compatibility
originFeatureId Helps link to upstream planning and scenarios

🧠 Used By Factory Agents To:

Agent Role
Microservice Generator Agent Creates producer/consumer scaffolding for events
Event Choreographer Agent Plans event sequence, consistency boundaries
Test Generator Agent Produces publish-subscribe tests and contract validators
Observability Agent Instruments event flows with trace and metric hooks
Security Agent Applies role and scope filters on event payloads

πŸ” Memory & Event Mesh Linking

Each event is:

  • Indexed in the Event Taxonomy
  • Cross-linked with:

  • Aggregate

  • Feature
  • Scenario
  • Test coverage
  • Versioned and validated in the event schema registry

πŸ§ͺ Event-Based QA Examples

  • ReferralSubmitted β†’ triggers downstream clinic availability check
  • ReferralRejected β†’ should suppress notification to referrer
  • ClinicUpdated β†’ modifies referral eligibility

πŸ”„ Events are first-class citizens in the Factory: observable, testable, traceable, and regenerable β€” declared upfront in every service blueprint.


πŸ“ File & Artifact Outputs (Generated by Blueprint)

The Service Blueprint doesn’t just guide human understanding β€” it powers the automated generation of code, tests, configuration, observability hooks, and deployment manifests. This cycle enumerates the full range of files and artifacts created directly from the blueprint by downstream agents or templates.


πŸ“¦ Generated Files by Agent

Agent Artifact Type Format(s) Target Path
🧠 Microservice Generator Service code, contracts .cs, .proto, .json, .csproj src/services/{ServiceName}/
πŸ§ͺ Test Generator Agent Unit + scenario tests .cs, .feature, .json tests/{ServiceName}.Tests/
πŸ” Security Agent Policy configs, auth filters .json, .cs src/services/{ServiceName}/Security/
πŸ“Š Observability Agent Metrics, logs, traces config .yaml, .json, .cs src/services/{ServiceName}/Observability/
πŸ” Event Choreographer Event bindings + schemas .json, .proto, .cs src/contracts/events/, schemas/
βš™οΈ Deployment Agent Helm charts, probes, sidecars .yaml, .tf, .bicep deploy/k8s/services/{ServiceName}/
πŸ“˜ Documentation Agent Markdown, diagrams .md, .svg, .png docs/services/{ServiceName}/

🧱 Example File Tree (ReferralService)

ReferralService/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Application/
β”‚   β”œβ”€β”€ Domain/
β”‚   β”œβ”€β”€ Infrastructure/
β”‚   └── Api/
β”œβ”€β”€ tests/
β”‚   └── ReferralService.Tests/
β”œβ”€β”€ contracts/
β”‚   └── events/
β”œβ”€β”€ deploy/
β”‚   └── k8s/
β”œβ”€β”€ docs/
β”‚   └── blueprint.md

πŸ“š Embedded Files in Memory Graph

Every artifact is also:

  • πŸ”— Cross-linked with blueprint sections (e.g., api.rest[0] β†’ controller.cs)
  • 🧠 Embedded semantically for code search and refactoring
  • πŸ“„ Version-tagged (e.g., v1, draft, generated-from-service-blueprint-v3)

🧠 Trace ID Conventions

All generated assets are tagged with:

Tag Purpose
traceId Request-level and artifact-level traceability
originBlueprintId Maps back to the blueprint that generated it
agentId Shows which agent generated the file
featureIds Highlights relevant user stories / scenarios

πŸ› οΈ GitOps + DevOps Integration

Artifacts are committed to dedicated repositories or mono-repos and integrated into:

  • πŸ“¦ CI pipelines (build, test, validate)
  • πŸš€ CD pipelines (deploy to QA / staging / prod)
  • πŸ§ͺ Regression coverage maps
  • πŸ“Š Observability dashboards

πŸ“ A Service Blueprint is not static documentation β€” it is a live, generative contract that orchestrates full-fidelity software assets across the ConnectSoft AI Software Factory.


🧠 Memory & Traceability Structure

Every Service Blueprint is fully integrated into the ConnectSoft Memory Graph β€” the long-term semantic store that powers context injection, prompt grounding, search, and intelligent reuse across all agents in the Factory.

This cycle outlines how the blueprint and its subcomponents are indexed, traced, and retrieved, ensuring full lifecycle visibility from idea to code to production metrics.


🧠 Memory Layers Involved

Memory Type Purpose
🧾 Short-Term Memory Active prompt injection during generation and orchestration
🧬 Vector Memory Semantic embeddings for search, clustering, validation
πŸ“‚ Blob Storage Raw markdown/JSON blueprints, archived outputs
πŸ•ΈοΈ Trace Index Structured references between entities, agents, features

πŸ“Ž Trace Metadata

Each Service Blueprint is automatically tagged with:

Tag Description
blueprintId Canonical ID of the service blueprint
agentId Which agent created or updated the blueprint
originPromptId Original signal or intent captured from human input
featureIds[] Features supported by this service
entityIds[] Aggregates/entities it owns or references
microserviceId? Physical microservice realization (if applicable)
scenarios[] Supported business or user scenarios

{
  "blueprintId": "ReferralService",
  "featureIds": ["SubmitReferral", "CancelReferral"],
  "entityIds": ["Referral", "Clinic"],
  "publishedEvents": ["ReferralSubmitted"],
  "mappedTo": {
    "microservice": "ReferralMicroservice",
    "api": "ReferralController.cs",
    "testScenario": "referral-tests.feature"
  }
}

🧠 Queryable via Agent APIs

Function Result
FindBlueprintByFeature() Return services that fulfill a given capability
FindConsumersByEvent() Show all subscribers to a given domain event
FindBlueprintDiff() Track changes across blueprint versions or feature scope
InjectContextForAgent() Load partial blueprint context into active agent prompt

πŸ“˜ Blueprint Memory Graph Record (Markdown + JSON + Embedding)

Component Format Stored As
Metadata JSON TraceIndex + tag index
Markdown Spec Markdown Blob storage + memory-indexed
Semantic Vector Embedding Stored in vector DB (e.g., Azure AI Search)
Cross-links Graph Edges Feature β†’ Entity β†’ Event β†’ Test β†’ Agent paths

🧠 Every decision, output, and artifact in the Factory is memory-traced back to its source blueprint β€” ensuring visibility, explainability, and intelligent reuse across all generations.


πŸ§ͺ Scenario Mapping & Test Coverage

A well-formed Service Blueprint includes explicit mappings to real-world scenarios that the service must support β€” enabling automated test generation, coverage tracking, and runtime validation against expected business behavior.

These mappings connect features, user actions, and domain transitions directly to code and test outcomes, forming a closed feedback loop in the Factory.


πŸ“‹ Scenario Types

Type Description
βœ… Positive Scenarios Normal flows (e.g., submit referral, update status)
❌ Negative Scenarios Error paths (e.g., submit referral without clinic ID)
πŸ” Security Scenarios Unauthorized access, role checks, scoping constraints
πŸ”„ Integration Scenarios Message-based flows, cross-service orchestration
πŸ“‰ Degraded Scenarios Timeouts, retries, circuit-breaking during external dependencies

🧠 Example: ReferralService Scenario Block

"scenarios": [
  {
    "id": "submit-referral-valid",
    "type": "positive",
    "description": "Clinic admin submits a referral with complete details",
    "linkedTo": ["ReferralSubmittedEvent", "POST /referrals/submit"],
    "expectedOutcome": "Referral stored and event published"
  },
  {
    "id": "submit-referral-missing-clinic",
    "type": "negative",
    "description": "Submission fails due to missing clinic context",
    "expectedOutcome": "Validation error with 400 response"
  }
]

πŸ§ͺ Used By Test Generator Agent To:

Action Output
Generate BDD Feature files .feature files for SpecFlow or Gherkin
Scaffold test cases Integration tests and domain scenario tests
Link scenario ID β†’ test file Enables observability, test traceability
Validate test coverage report Ensures each blueprint scenario is exercised

πŸ” Round-Trip Coverage Mapping

Link From Link To
Scenario ID Test ID, Feature File, Execution Log
Feature ID Scenario ID β†’ Endpoint / Event / Command
Entity Transition Scenario outcome (mutation or event)
Test Result Observability span, execution metrics

🧠 Agent Feedback Loop

Failed or untested scenarios can trigger blueprint correction workflows, feedback to the Test QA Agent, or generate BlueprintCoverageAlert events β€” driving continuous alignment.


πŸ“˜ Blueprint Test Index

Each service’s blueprint includes:

  • βœ… Scenario list (with tags, type, outcome expectations)
  • πŸ”— Test linkage map (scenarioId β†’ test file)
  • πŸ“Š Coverage ratio and gap report (live or snapshot)
  • 🧠 Vector embedding of scenario descriptions for retrieval

πŸ§ͺ The Factory treats scenarios as first-class, testable, traceable behaviors β€” connecting domain intent to working code through blueprint declarations.


πŸ—‚οΈ Blueprint Versioning and Mutation History

The Service Blueprint evolves over time β€” as requirements change, features are added, architecture evolves, or bugs are fixed. The ConnectSoft AI Software Factory tracks every mutation of the blueprint, allowing time-travel debugging, trace-based regeneration, and safe branching during iterative generation.


πŸ“Œ Versioning Model

Attribute Description
version Monotonic version tag (e.g., v1, v2, v2.1, rc, approved)
status draft, generated, reviewed, validated, deprecated
createdByAgent Agent ID that created this version
mutatedByAgents[] Agents that changed it since the last version
mutationReason Natural language explanation of what changed
timestamp Creation/modification datetime

πŸ” Example Blueprint Version Block

"versioning": {
  "version": "v2.1",
  "status": "validated",
  "createdByAgent": "MicroserviceGeneratorAgent",
  "mutatedByAgents": ["SecurityAgent", "TestGeneratorAgent"],
  "mutationReason": "Added scoped role enforcement and new test scenarios",
  "timestamp": "2025-06-08T11:32:00Z"
}

πŸ“˜ Changelog Format

Blueprint changelogs are structured, diffable, and consumable by both humans and agents:

- version: v2.0
  changedBy: SecurityAgent
  change: "Introduced RBAC on endpoint PATCH /referrals/{id}/status"
  timestamp: 2025-05-30

- version: v2.1
  changedBy: TestGeneratorAgent
  change: "Added tests for access violation scenarios"
  timestamp: 2025-06-01

🧠 Used By Factory For:

Use Case Factory Mechanism
πŸ” Agent Retry/Regeneration Uses latest stable or fallback blueprint version
πŸ§ͺ Scenario Audit Trail Tracks which blueprint version test cases were generated from
🧬 Diff Analysis Enables BlueprintDiffAgent to assess structural change impact
🧠 Semantic Search Time-Slicing Allows filtering by blueprint version in memory graph
πŸ› οΈ DevOps Pipeline Checks Ensures only validated versions go into CD pipelines

πŸ“‚ Files Generated

File Description
microservice-blueprint.v1.md First version
microservice-blueprint.v2.json Later version in machine-readable format
changelog.yaml Mutation history with timestamps and diffs

πŸ—‚οΈ A blueprint is a versioned software artifact, with mutation lineage, traceable intent, and rollback capability β€” enabling safe evolution inside the Factory.


πŸ”§ CLI Template Mapping and Code Injection Points

Each Service Blueprint defines the mapping between blueprint content and the microservice CLI template used to generate the implementation β€” including the code structure, injection points, extension hooks, and feature toggles.

This enables automated, deterministic code generation, aligned to Clean Architecture, from the blueprint specification.


πŸ› οΈ CLI Template Specification

Section Description
templateId Name of the CLI template (e.g., connectsoft.microservice)
templateVersion Resolved NuGet package version or Git commit
customizations Parameters to override default behavior (e.g., --includeHangfire)
featureSwitches[] Toggles for optional modules (e.g., caching, localization, auth)
targetPath Destination directory in source repository

πŸ“˜ Example CLI Mapping Block

"cliTemplate": {
  "templateId": "connectsoft.microservice",
  "templateVersion": "2.3.0",
  "customizations": {
    "domain": "Referrals",
    "includeHangfire": true,
    "useGrpc": false
  },
  "featureSwitches": ["audit", "massTransit", "openTelemetry"],
  "targetPath": "services/ReferralService"
}

πŸ”½ Code Injection Points

Injection Point Derived From Blueprint Section
Domain/Aggregates.cs entities and aggregates
Api/Controllers/*.cs api.rest
Messaging/Consumers.cs events.subscribes
Messaging/Producers.cs events.publishes
Security/Policies.cs security.accessRoles
Health/StartupChecks.cs runtime.healthChecks
Observability/Metrics.cs observability.metrics

🧠 Used By Factory Agents To:

Agent Role
Microservice Generator Agent Invokes CLI with resolved parameters
Orchestration Agent Determines service paths and template registration
Pipeline Agent Integrates template scaffolding with CI/CD and lint steps
Test Generator Agent Maps generated endpoints to test paths automatically

🧩 Template Extensibility Rules

  • πŸ“¦ Blueprints define extensions using reserved x-* fields (e.g., x-internalRoutes)
  • 🧠 Agents can plug in post-processors to append logic to injected files
  • 🧬 Supports deterministic diffing for round-trip blueprint updates

πŸ”§ CLI templates turn abstract blueprints into fully scaffolded codebases β€” clean, modular, testable, and aligned with Factory principles.


πŸ—ƒοΈ Repository & DevOps Integration Metadata

Each Service Blueprint defines the source control, branching, DevOps automation, and artifact lineage associated with the service. This metadata connects the generated microservice to the broader CI/CD pipelines, Git strategy, and deployment orchestration of the Factory.


πŸ“‚ Repository Structure

Attribute Description
repositoryType mono-repo, multi-repo, or hybrid
repoName Azure DevOps or GitHub repo name (e.g., ReferralService)
pathInRepo Directory inside repo where service resides
defaultBranch Usually main, develop, or environment-specific
featureBranchPattern Naming convention for scoped changes (e.g., feature/{featureId})

πŸ“˜ Example Git & DevOps Block

"devOps": {
  "repositoryType": "multi-repo",
  "repoName": "ReferralService",
  "pathInRepo": "/",
  "defaultBranch": "main",
  "featureBranchPattern": "feature/{featureId}",
  "pipelines": {
    "ci": "ci-referral-service.yml",
    "cd": "cd-referral-service.yml"
  },
  "artifactId": "ReferralService:2025.06.08.01"
}

πŸš€ DevOps Metadata

Component Purpose
ciPipeline Code build, lint, test, publish
cdPipeline Deploy to environments (QA, staging, prod)
buildTags Auto-tag image versions and traceable artifact IDs
secretsRefs Links to Azure Key Vault or config sources
envMatrix Environment-specific configurations (scopes, URLs)

🧠 Used By Factory For:

Agent Role
Orchestration Agent Initializes Git repo, structure, permissions
Pipeline Agent Generates YAML pipeline scripts for CI/CD
Release Manager Agent Tracks artifact status, rollout phases, and pipeline health
Security Agent Scans repo policies and secret injection patterns

πŸ“ Artifacts Stored

Artifact Name Description
ci-pipeline.yml CI workflow template for the service
cd-pipeline.yml CD deployment steps
.azure-pipelines.yaml If mono-repo, reusable pipeline reference
service-metadata.json Blueprint β†’ Repo β†’ Artifact trace specification
deployment-badge.svg CI/CD status badge for dashboards

πŸ” GitOps Compliance

All blueprint-defined metadata supports:

  • πŸ“¦ Declarative repository provisioning
  • πŸ”„ Git-based review + versioning of infrastructure
  • 🚦 Promotion workflows with approval gates
  • 🧠 Event-sourced CI/CD triggers across Factory agents

πŸ—ƒοΈ The Service Blueprint is not just a design document β€” it’s a DevOps contract, governing how the service is created, shipped, deployed, and traced in real time.


πŸ“š Documentation Structure and Developer Experience

Every Service Blueprint includes structured documentation metadata to ensure that the developer experience (DX) is streamlined, consistent, and immediately useful. This section defines the developer-facing artifacts, how they're generated, and how they evolve with the service.


🧾 Documentation Components

Section Purpose
🧭 Overview What the service does, why it exists, who owns it
πŸ“‘ APIs & Events REST/gRPC interfaces, published/subscribed events
🧱 Domain Model Entities, aggregates, and their relationships
πŸ§ͺ Test Scenarios Documented QA behavior, BDD examples, edge cases
πŸ”’ Security Model Role-based access, auth flows, audit rules
πŸ“Š Observability Insights Key metrics, traces, log patterns, alerting conditions
πŸš€ Deployment Notes Runtime profiles, health checks, readiness contracts
πŸ€– Factory Lineage Which agents contributed, trace IDs, links to upstream blueprints

πŸ“˜ Blueprint-Generated Docs

Each blueprint produces developer-facing markdown in the service’s docs/ folder:

services/
  ReferralService/
    docs/
      index.md
      api.md
      events.md
      domain-model.md
      observability.md
      scenarios.md
      deployment.md

These are populated by:

  • 🧠 Microservice Generator Agent β†’ Overview, domain, endpoints
  • πŸ“Š Observability Agent β†’ metrics, alerts, logs
  • πŸ§ͺ Test Generator Agent β†’ feature/test scenario mappings
  • πŸ” Security Agent β†’ RBAC, roles, policies
  • πŸ“˜ Documentation Agent β†’ indexes, menus, badges

🧠 Developer Portals & MKDocs Integration

Channel Usage
MKDocs Blueprint docs compiled into live site for engineers
Azure DevOps Wiki Synchronized copies with release notes and change logs
Studio Mode Preview docs in Factory Studio UI
Semantic Search Developer queries against vectorized documentation

πŸ“¦ Artifacts Produced

File Description
docs/index.md Blueprint summary
docs/api.md Endpoints, input/output contracts
docs/events.md Event schemas and flows
docs/domain-model.md Aggregates and behavior
docs/scenarios.md Scenario→Test coverage and trace links
docs/deployment.md Health checks, limits, readiness probes
docs/badges.md CI/CD status, blueprint quality, coverage levels

🧠 DX Enhancements

Feature Blueprint Impact
🧠 Prompt-based support Agents answer questions using embedded blueprint docs
🧩 Jump-to-code links From doc β†’ file or line in generated repo
πŸ•΅οΈ Auditability Each section trace-linked to agent action
πŸ§ͺ Feedback capture Docs include improve/flag scenario links

πŸ“š Every service in the Factory is born with docs β€” machine-authored, memory-linked, developer-grade knowledge portals.


πŸ“Œ Tags, Quality Score, and Catalog Integration

Each Service Blueprint in the AI Software Factory is enriched with metadata and quality annotations that allow the system to index, evaluate, filter, and reuse microservices effectively β€” powering the Factory's Blueprint Catalog, quality assurance, and evolution strategies.


🏷️ Metadata Tags

These tags enable semantic classification, discoverability, and agent-based filtering:

Tag Type Examples
domainContext Referrals, Billing, Notifications
serviceType Write, ReadModel, SyncAdapter, EventProcessor
integrationPoints Twilio, Braze, Stripe, Segment
communicationMode REST, gRPC, EventOnly
ownerTeam TeamHealth, TeamGrowth
capabilities Idempotent, Retryable, Secure, Multitenant

πŸ“Š Quality Score (Factory Evaluation)

Each Service Blueprint is automatically scored by a BlueprintQualityEvaluatorAgent using structured heuristics:

Category Description Weight
πŸ“¦ Coverage Features, endpoints, events covered 30%
πŸ” Traceability Links to upstream blueprints and test coverage 20%
πŸ§ͺ Testability Scenario mapping and validation contracts 20%
πŸ“Š Observability Metrics, logs, traces, health declarations 10%
πŸ” Security Clarity Role-based model, scopes, threat detection hints 10%
πŸ“ Documentation Docs completeness and navigability 10%

The score is stored and displayed with 🟒 Green / 🟑 Yellow / πŸ”΄ Red visual indicators.


πŸ“ Example Blueprint Catalog Entry

{
  "blueprintId": "ReferralService",
  "tags": ["Referrals", "Write", "REST", "Retryable", "TeamHealth"],
  "qualityScore": 87,
  "status": "validated",
  "version": "v2.1",
  "linkedFeatures": ["SubmitReferral", "CancelReferral"],
  "observability": {
    "traces": true,
    "metrics": true,
    "logs": true
  }
}

🧠 Used By:

Component / Agent Purpose
BlueprintCatalog UI Allows search, filter, preview of service blueprints
Orchestration Agent Selects matching blueprints by capability or domain
Audit & QA Agent Flags low-scoring blueprints for improvement
Developer Studio Shows badges, scores, and agent contributions visually

🧩 Badging & Visuals

Blueprints render with:

  • πŸ“› Name, domain, version
  • 🎯 Feature coverage count
  • 🟒/🟑/πŸ”΄ Quality ring with hover details
  • 🏷️ Semantic tags (clickable in catalog)
  • 🧠 Agent lineage (creator/modifiers)

πŸ“Œ Metadata is not decoration β€” it is the foundation of intelligence and reuse in a platform where 3000+ microservices must remain searchable, composable, and verifiable.


βœ… Final Summary Table & Consolidated Overview

The table below consolidates the core elements of the Service Blueprint, enabling downstream agents, human engineers, and validation tools to quickly understand, evaluate, and act on the blueprint as a single, authoritative artifact.

This summary can be rendered at the end of the blueprint file (microservice-blueprint.md) and indexed in memory for analytics and factory dashboards.


πŸ“˜ Service Blueprint Summary

Property Value / Description
πŸ“› Service ID ReferralService (example)
πŸ“¦ Domain Context Referrals
🎯 Business Responsibility Manage clinic referrals and status transitions
🧬 Aggregates Owned Referral, ReferralStatus, Clinic
πŸ” Interfaces REST endpoints, publishes ReferralSubmittedEvent
πŸ› οΈ Template Used connectsoft.microservice v2.3.0
πŸ“‚ Repo Location services/ReferralService
πŸš€ CI/CD Pipelines ci-referral-service.yml, cd-referral-service.yml
πŸ§ͺ Test Scenarios 6 total (positive, negative, security)
πŸ“Š Observability Traces, metrics, logs, health checks configured
πŸ” Security Model Role-based access, tenant-scoped endpoints
🧠 Created by Agent Microservice Generator Agent
πŸ“˜ Blueprint Version v2.1 – status: validated
🧾 Generated Artifacts .csproj, .cs, .json, .md, .feature, .yaml
🧠 Stored In Memory Graph Vector DB, TraceIndex, Blob, Catalog
πŸ“Œ Tags Write, Referrals, Retryable, Secure, TeamHealth
🟒 Quality Score 87/100 – Green
πŸ”— Related Blueprints Vision: vision-blueprint.md, Product: agentic-saas-product-blueprint.md

🧠 Final Thought

The Service Blueprint is the semantic heart of a microservice in the Factory β€” not just a description, but a living contract that shapes infrastructure, code, testing, and knowledge across generations.

It ensures every service is:

  • Memory-indexed
  • Trace-linked
  • Test-covered
  • Security-scoped
  • Agent-generated
  • Cataloged & versioned

β€”

βœ… Blueprint Ready for generation, review, test, and deployment in the ConnectSoft AI Software Factory.