ποΈ Agent Microservice Standard Blueprint¶
π What Is a Microservice Standard Blueprint?¶
A Microservice Standard Blueprint is a machine- and human-readable specification of an individual service within the ConnectSoft AI Software Factory. It defines the contract, behavior, interfaces, boundaries, and deployment profile of a microservice β automatically generated by the platform from domain signals, agent context, and system modeling artifacts.
This blueprint is the core build instruction for a microservice β equivalent to what a senior architect and lead developer would document before implementation.
ποΈ What It Captures¶
Each Microservice Standard Blueprint includes:
- π Service Identity: name, namespace, trace ID, domain context
- π¦ Responsibility & Capability: clearly defined business role
- π Input/Output Contracts: REST/gRPC APIs, event subscriptions, published messages
- π§± Used Aggregates & Entities: semantic domain references
- βοΈ Technology & Runtime: .NET, messaging bus, DB, libraries
- π‘ Observability & Resilience: telemetry, retries, health, security
- π DevOps Integration: pipelines, containerization, IaC
- π§ Trace-Ready Metadata: all sections mapped to memory graph for search, reuse, validation
π§ Generated by Agent¶
This blueprint is created by the π§ Microservice Generator Agent, using:
- System context from
Architecture Blueprint - Feature signals from
Product Blueprint - Constraints from
Vision Blueprint - Template catalog registry and CLI invocation parameters
It is deterministically created from upstream agent outputs β but remains editable, diffable, and version-controlled like any core software asset.
π§ͺ Why It's Critical¶
- π Drives microservice CLI template generation
- π§ Enables downstream QA/Test, Observability, Infra, and CI agents
- π Provides a canonical source of truth for a single autonomous module
- 𧬠Encodes Clean Architecture and Domain-Driven principles
- π§ Persists in long-term memory graph with full trace lineage
π§© Blueprint Shape¶
Each blueprint exists as:
| Format | Use |
|---|---|
.md |
Studio + human-readable rendering |
.json |
Machine-parsed agent input/output |
embedding |
Vectorized semantic memory and search indexing |
Example filenames:
blueprints/microservices/{service-name}/microservice-blueprint.md
blueprints/microservices/{service-name}/microservice-blueprint.json
π¦ One Per Service¶
Each microservice in the Factory has one blueprint. They are used to:
- 𧬠Derive Git repo structure
- βοΈ Scaffold .NET codebase with the correct CLI template
- π¦ Link observability and deployment to service ID
- π§ Track cross-microservice events, APIs, and dependencies
π§ When and Why It's Generated¶
The Microservice Standard Blueprint is generated when the Factory determines that a new deployable backend service is needed β typically as part of the downstream orchestration flow from architecture modeling or feature decomposition.
It is created after the Vision, Product, and Architecture Blueprints, and serves as the execution-ready artifact for the actual microservice generation.
The blueprint marks the moment where a conceptual system becomes a concrete, autonomous, production-bound service.
βοΈ Generation Trigger Points¶
The blueprint is automatically initiated by the π§ Microservice Generator Agent when any of the following occur:
- π§
Architecture Blueprintdefines a new bounded context to be implemented as a service - π§±
Feature Blockrequires infrastructure separation, isolation, or independent scalability - π¦ A template reference (from template catalog) resolves to
microservice-cli - π Regeneration is triggered due to version update, memory correction, or event change
π Timing in the Factory Lifecycle¶
flowchart TD
Vision["π Vision Blueprint"]
Product["π¦ Product Blueprint"]
Architecture["ποΈ Architecture Blueprint"]
Generator["π§ Microservice Generator Agent"]
MSBP["π Microservice Standard Blueprint"]
CLI["βοΈ CLI Template Engine"]
Vision --> Product
Product --> Architecture
Architecture --> Generator
Generator --> MSBP
MSBP --> CLI
π Blueprint generation is not first β it follows strategic design decisions and domain modeling.
π§ Agent Context¶
At generation time, the agent combines:
- π Context from system architecture (
boundedContext,domainLayer, etc.) - 𧬠Feature signals relevant to the service responsibility
- π Constraints and compliance needs (e.g., multi-tenancy, auth)
- π Template resolution from the microservice CLI registry
- π§ Memory links to related services, aggregates, and modules
π Outcomes of Generation¶
Once created, the blueprint:
- π― Triggers actual service skeleton generation via CLI template
- π§ Registers all interface contracts in memory graph
- π’ Emits
microservice-blueprint.createdto downstream agents - π Initializes repository, folder structure, and source code pipeline
- π§ͺ Enables test and observability setup to begin
π§© Summary Table¶
| Trigger Source | Description |
|---|---|
| Architecture Blueprint | Defines the service boundary |
| Product/Feature Blocks | Indicate need for isolated responsibility |
| CLI Template Registry Match | Resolves to microservice base template |
| Memory Graph Inference | Suggests new autonomous scope from context |
β Guarantees¶
The Factory ensures:
- π§ No microservice is generated without a formal blueprint
- πͺ Blueprint is idempotent: rerun yields same spec unless upstream changes
- π Traceability and regeneration are fully versioned and observable
π Blueprintβs Role in the Software Factory¶
The Microservice Standard Blueprint serves as the operational contract between domain-driven design, system architecture, and executable automation in the ConnectSoft AI Software Factory. It acts as the central planning artifact that connects vision with infrastructure, and intent with runtime reality.
It is both a design output and a generation input β a blueprint and a build manifest in one.
π§ Where It Sits in the Factory¶
The blueprint is generated as part of the Engineering Cluster, immediately after Architecture decisions are finalized.
It feeds into:
- ποΈ CLI Template Engine for source code bootstrapping
- π§ͺ QA and Test Agents for contract validation
- π¦ Deployment and CI/CD pipelines for infrastructure alignment
- π‘ Observability graph for signal setup
- π€ AI feedback loop via event mesh and memory updates
πΈοΈ System Flow¶
flowchart LR
VBP["π Vision Blueprint"]
PBP["π¦ Product Blueprint"]
ABP["ποΈ Architecture Blueprint"]
MSA["π§ Microservice Generator Agent"]
MSBP["π Microservice Standard Blueprint"]
Code["βοΈ .NET CLI Template"]
Repo["π Git Repository"]
Pipelines["π CI/CD Pipelines"]
QA["π§ͺ QA Agent"]
OBS["π‘ Observability Agent"]
VBP --> PBP --> ABP --> MSA --> MSBP
MSBP --> Code --> Repo --> Pipelines
MSBP --> QA
MSBP --> OBS
π Factory Responsibilities¶
| Area | How Blueprint Is Used |
|---|---|
| π§± Code Generation | CLI templating engine reads blueprint parameters |
| π¦ Modular Registration | Service metadata is added to Factory service registry |
| π Dependency Mapping | Declares other services and libraries used |
| π§ͺ QA Planning | Blueprint feeds contract test generation |
| π‘ Observability | Establishes metrics, health probes, traces, alert anchors |
| π GitOps / DevOps | Triggers pipelines and repo creation |
π€ Agent Interactions¶
| Agent | Interaction With Blueprint |
|---|---|
| π§ Microservice Generator | Creates and maintains blueprint |
| π§ͺ QA Agent | Reads contracts, events, APIs for test scaffolding |
| π¦ Blueprint Orchestrator | Registers blueprint metadata in system registry |
| βοΈ DevOps Agent | Deploys IaC and pipeline definitions per blueprint |
| π‘ Observability Agent | Configures telemetry based on blueprint definitions |
π§© Summary¶
| Role | Description |
|---|---|
| π Connector | Links domain modeling with runtime deployment |
| π― Specification | Describes everything the service should be and expose |
| βοΈ Generator Input | Passed into .NET CLI-based scaffolding and CI systems |
| π§ Memory Embedder | All blocks are memory-traceable and graph-indexed |
π§ Who Creates and Consumes It¶
The Microservice Standard Blueprint is generated, enriched, and consumed by a network of agent roles and Factory subsystems, each responsible for a different layer of the software creation lifecycle.
It ensures clean separation of responsibilities, while also providing a shared source of truth across development, testing, deployment, and monitoring.
π§ Generated By¶
| Agent | Role |
|---|---|
π§ Microservice Generator Agent |
Primary creator; reads from upstream blueprints and memory signals |
π¦ Template Catalog Resolver |
Maps the service type to CLI template and runtime parameters |
ποΈ Architecture Agent |
Provides domain context, boundaries, and inter-service relations |
𧬠Product Planning Agents |
Feed service responsibility and feature triggers |
The Generator Agent combines signals, maps them to templates, injects memory links, and emits a full
.md+.jsonoutput.
π§βπ» Consumed By¶
| Consumer Agent / System | Purpose |
|---|---|
βοΈ CLI Template Engine |
Bootstraps actual microservice code from blueprint fields |
π§ͺ QA Agent |
Builds test plans and scenarios from contracts and domain signals |
π‘ Observability Agent |
Reads output contracts, events, health config |
βοΈ DevOps & Release Agent |
Wires IaC, secrets, CI/CD pipelines per blueprint traceId |
π§ Memory Graph |
Indexes and semantically embeds all blueprint sections |
π Repo Initializer |
Creates and links the Git repository for the microservice |
π§ Replanning Agents |
Use it to detect changes, regressions, or dependency drift |
π Multi-Agent Collaboration Snapshot¶
graph TD
Generator["π§ Microservice Generator"]
Blueprint["π Microservice Blueprint"]
CLI["βοΈ CLI Engine"]
QA["π§ͺ QA Agent"]
OBS["π‘ Observability"]
DevOps["βοΈ DevOps Agent"]
Repo["π GitOps"]
Memory["π§ Memory Graph"]
Generator --> Blueprint
Blueprint --> CLI
Blueprint --> QA
Blueprint --> OBS
Blueprint --> DevOps
Blueprint --> Repo
Blueprint --> Memory
π Storage and Consumption Points¶
| Format | Consumer Example |
|---|---|
markdown |
Studio UI, human readers |
json |
CLI, DevOps, QA Agent, observability |
embedding |
Semantic Kernel, similarity match, memory search |
β Guarantees¶
- All consuming agents get versioned, traceable blueprints
- No microservice is generated or tested without one
- Serves as the contractual anchor for service lifecycle and evolution
π¦ Output Format and Storage Paths¶
The Microservice Standard Blueprint is produced in multiple output formats to support both human-in-the-loop workflows and automated agent pipelines. It follows strict naming conventions, storage structure, and versioning rules to ensure traceability, reproducibility, and orchestration consistency across the AI Software Factory.
π Output Formats¶
| Format | Description |
|---|---|
.md |
Full markdown blueprint, structured for Studio rendering and human review |
.json |
Machine-readable blueprint for CLI tools and agent APIs |
embedding |
Semantic vector form for long-term memory indexing and cross-agent search |
π Folder Structure¶
All service blueprints are stored under the following canonical path:
blueprints/
βββ microservices/
βββ {service-name}/
βββ microservice-blueprint.md
βββ microservice-blueprint.json
βββ trace-metadata.json
βββ signals/
βββ api-signals.json
βββ event-contracts.json
βββ observability-anchors.json
π§ Traceability and Indexing¶
Each blueprint is tagged with:
traceIdβ globally unique ID across factory agentsprojectIdβ scope of solution/project this service belongs toagentIdβ which generator created itversionβ incremented per update or regenerationoriginPromptβ original intent prompt or upstream reference
These tags are stored in both the .json file and embedded in memory metadata.
π§© Memory Graph Integration¶
Upon generation, blueprint content is indexed to:
| Memory Layer | Description |
|---|---|
semantic memory |
Embeds sections for vector search and reuse |
trace graph |
Links blueprint to upstream features, downstream pipelines |
contract index |
Maps APIs, events, schemas to service traceId |
agent registry |
Registers blueprint version under owning agent |
πͺ Sample Output Manifest¶
{
"serviceName": "referral-notifier",
"traceId": "ms-20250608-referral-notifier-v1",
"version": 1,
"outputs": [
"microservice-blueprint.md",
"microservice-blueprint.json",
"event-contracts.json"
],
"storagePath": "blueprints/microservices/referral-notifier"
}
β Summary Table¶
| Aspect | Example or Rule |
|---|---|
| π Base Path | blueprints/microservices/{service-name} |
| π Markdown File | microservice-blueprint.md |
| π JSON File | microservice-blueprint.json |
| π§ Memory Integration | semantic, trace graph, agent registry, observability |
| πͺͺ Tags Included | traceId, agentId, projectId, version, originPrompt |
π Microservice Identity & Metadata¶
Every microservice in the Factory is uniquely defined by a rich identity block that anchors it within the broader system topology, domain map, and agent memory graph. This metadata is foundational β enabling everything from template resolution to pipeline targeting, observability tagging, and service discovery.
π Identity Fields¶
| Field | Description |
|---|---|
serviceName |
Canonical name of the service (used in code, routing, folders) |
traceId |
Globally unique blueprint ID across the Factory |
projectId |
Higher-level solution/project this microservice belongs to |
namespace |
Full C#-style namespace derived from project and service name |
context |
Domain or bounded context this service belongs to |
templateId |
ID of the CLI template used for generation |
tags |
Key-value labels for routing, monitoring, and agent interaction |
π§ Sample Identity Block¶
{
"serviceName": "referral-notifier",
"traceId": "ms-20250608-referral-notifier-v1",
"projectId": "vetspire-referrals",
"namespace": "ConnectSoft.Services.ReferralNotifier",
"context": "ReferralManagement",
"templateId": "dotnet-microservice-v1",
"tags": ["event-consumer", "notification", "bounded-context:referral"]
}
π§© Naming Conventions¶
| Element | Convention Example |
|---|---|
| Service Name | lower-kebab-case (e.g. referral-notifier) |
| Namespace | Company.Domain.Services.ServiceName |
| Trace ID | ms-{date}-{serviceName}-v{version} |
| Folder Path | blueprints/microservices/{service-name}/ |
π§ Memory Anchoring¶
Upon creation, the identity block is:
- Indexed into the memory graph as the root node for the service
- Used for resolving cross-blueprint links (e.g., metrics, APIs, consumers)
- Propagated to CLI generation, agent pipelines, and UI display tools
- Automatically emits a
microservice-identity-createdevent for orchestration
π Example Identity Markdown Block¶
## π Identity
- **Service Name**: `referral-notifier`
- **Trace ID**: `ms-20250608-referral-notifier-v1`
- **Project**: `vetspire-referrals`
- **Context**: `ReferralManagement`
- **Namespace**: `ConnectSoft.Services.ReferralNotifier`
- **Template**: `dotnet-microservice-v1`
- **Tags**: `event-consumer`, `notification`, `bounded-context:referral`
β Guarantees¶
- Every blueprint has exactly one identity block
- All file paths, repos, telemetry keys, and contracts are derived from it
- It is immutable after generation (versioned if changed)
π§± Domain Context & Bounded Context Info¶
Each microservice is rooted in a specific domain and bounded context β derived from strategic modeling and domain-driven design. This section encodes the semantic purpose and ownership boundary of the service, ensuring it aligns with the overall architecture and functional modularity of the system.
This isnβt just categorization β it defines the microserviceβs language, autonomy, and authority.
πΊοΈ Core Domain Metadata¶
| Field | Description |
|---|---|
domain |
The broader business area this service belongs to |
boundedContext |
The specific DDD context the service owns |
aggregateRoots |
Primary aggregates/entities managed within this service |
contextOwner |
Agent/system responsible for defining/modifying the context |
businessCapability |
Describes what this context is responsible for in the business |
π§ Example Block¶
{
"domain": "Veterinary Operations",
"boundedContext": "ReferralManagement",
"aggregateRoots": ["Referral", "ReferralStatus"],
"contextOwner": "enterprise-architect-agent",
"businessCapability": "Manage lifecycle of external referrals"
}
π In Markdown Form¶
## π§± Domain Context
- **Domain**: Veterinary Operations
- **Bounded Context**: ReferralManagement
- **Aggregate Roots**: Referral, ReferralStatus
- **Context Owner**: Enterprise Architect Agent
- **Business Capability**: Manage lifecycle of external referrals
𧬠Uses of Domain Context¶
| Consumer Agent | Purpose |
|---|---|
π§ Microservice Generator |
Template and code responsibility mapping |
ποΈ Architecture Agent |
Traces service to strategic system views |
π§ͺ QA Agent |
Aligns test logic with entity behavior and lifecycle |
π‘ Observability Agent |
Domain-specific tagging and health strategy |
π§ Memory Engine |
Indexes relationships and enables DDD discovery in downstream AI |
π§© Design Principles Enforced¶
- β³οΈ A microservice may belong to only one bounded context
- π Contexts must map to modeled domain maps from Architecture Blueprint
- π§ All aggregates must be defined in the Entity Graph, or inferred via signal
β Summary Table¶
| Attribute | Example |
|---|---|
| Domain | Veterinary Operations |
| Bounded Context | ReferralManagement |
| Aggregates Owned | Referral, ReferralStatus |
| Semantic Scope | Ownership of referral lifecycle |
| Memory Traceability | β memory/index/context/{traceId} |
π¦ Responsibility & Business Capability¶
This section defines the core functional role of the microservice β what it does, what problems it solves, and which business capabilities it encapsulates. It is used by agents across the Factory to align features, observability, metrics, and tests to the service's declared mission.
In DDD terms, this is the serviceβs reason for existence β its authoritative boundary and value delivery scope.
π― Functional Responsibility¶
| Attribute | Description |
|---|---|
primaryFunction |
One-line summary of the serviceβs key behavior |
capabilities |
Specific business actions or workflows owned by this service |
notResponsibleFor |
Explicit exclusions to prevent scope creep |
inputSignals |
Feature blocks or epics that triggered this service |
ownerPersona |
Stakeholder or product persona most aligned with the service |
π§ Example JSON Block¶
{
"primaryFunction": "Handle referral acceptance and status updates",
"capabilities": [
"Receive and process referral events",
"Allow veterinary staff to accept or reject referrals",
"Update referral status and notify clinics"
],
"notResponsibleFor": [
"Referral analytics",
"User access control"
],
"inputSignals": ["feature:accept-referral", "feature:notify-client"],
"ownerPersona": "Product Manager - Referral Operations"
}
π Markdown Example¶
## π¦ Responsibility & Capability
- **Primary Function**: Handle referral acceptance and status updates
- **Capabilities**:
- Process referral events
- Accept or reject referrals by veterinary staff
- Update and persist referral statuses
- Notify external clinics of status changes
- **Not Responsible For**:
- Analytics dashboards
- User authentication
- **Triggering Features**: `accept-referral`, `notify-client`
- **Persona Owner**: Product Manager β Referral Operations
π How It's Used in the Factory¶
| Consumer Agent | Usage |
|---|---|
π§ͺ QA Agent |
Aligns test scenarios to declared capabilities |
π‘ Observability Agent |
Builds health and KPI anchors around capability boundaries |
π Docs/Studio UI |
Uses this block in documentation and overview views |
π§ Replanning Agent |
Verifies capability drift or misalignment with original goals |
𧬠Generator Agent |
Chooses templates and patterns based on declared role |
β Guarantees¶
- Capabilities are mapped to features, not arbitrarily listed
- Responsibility is exclusive β enforced by agent scope validation
- Must include at least one exclusion (
notResponsibleFor) to force clarity
π€ Ownership & Lifecycle Agents¶
Ownership in the AI Software Factory is explicit, traceable, and agent-aware. Every microservice blueprint encodes not only its business and domain role, but also who owns it, who maintains it, and which agents are responsible for its lifecycle from creation to deprecation.
Ownership is not just about Git β it is about sustained accountability across generations of agents and orchestrated flows.
π€ Ownership Metadata¶
| Field | Description |
|---|---|
creatorAgent |
Agent responsible for original generation (usually microservice-generator) |
maintainerAgent |
Agent or cluster responsible for long-term evolution and health |
humanOwner |
Real-world product or engineering persona who is accountable |
lifecycleStage |
Current phase in the Factory lifecycle (e.g., draft, active, retired) |
version |
Current blueprint version for this service |
π§ Example Block¶
{
"creatorAgent": "microservice-generator-agent",
"maintainerAgent": "engineering-orchestration-cluster",
"humanOwner": "CTO - Veterinary Systems",
"lifecycleStage": "active",
"version": 1
}
π Markdown Example¶
## π€ Ownership & Lifecycle
- **Created By**: Microservice Generator Agent
- **Maintained By**: Engineering Orchestration Cluster
- **Human Owner**: CTO β Veterinary Systems
- **Lifecycle Stage**: Active
- **Blueprint Version**: 1
π Lifecycle Stage States¶
| Stage | Meaning |
|---|---|
draft |
Created but not yet executed |
active |
Deployed, live, and owned |
paused |
Temporarily excluded from releases or updates |
retired |
Deprecated service; blueprint frozen but archived |
invalid |
Failed validation or conflicted with architecture blueprint |
𧬠Agent Uses¶
| Agent/System | Purpose |
|---|---|
π§ Orchestrator Agent |
Determines if a blueprint is eligible for planning/deploy |
βοΈ DevOps Agent |
Manages CI/CD and IaC only for active blueprints |
π§ͺ QA Agent |
Runs test plans tied to lifecycle transitions |
π Blueprint Linter |
Validates completeness and ownership consistency |
β Best Practices¶
- Ownership fields must be explicitly defined by Generator Agent
- Lifecycle changes are event-driven, traceable, and persisted
- Versioning is semantic β each change emits a
blueprint.version.updatedevent
π Input/Output Contracts (API, Event, gRPC)¶
A Microservice Standard Blueprint defines all interfaces exposed or consumed by the service β including REST APIs, gRPC services, and event-driven messaging. These contracts serve as the boundary of interaction, enabling agents to generate test cases, documentation, observability hooks, and downstream service integrations.
In the Factory, all I/O contracts are declared first, generated next, and tested automatically β no more hidden endpoints or undocumented events.
π€ Output Contracts (Exposed)¶
| Type | Description |
|---|---|
| REST API | Public HTTP endpoints with route, method, schema |
| gRPC | Service and method declarations in .proto form |
| Events | Domain events published to the bus (with payload schema) |
π₯ Input Contracts (Consumed)¶
| Type | Description |
|---|---|
| REST | External HTTP APIs invoked by this service |
| gRPC | External services it connects to via protobuf |
| Events | Subscribed topics, domains, or service-originated events |
π§ Example Contracts Block (JSON)¶
{
"restApi": {
"exposes": ["/referrals/accept", "/referrals/reject"],
"consumes": ["GET /clinics/info"]
},
"events": {
"publishes": ["ReferralAccepted", "ReferralRejected"],
"subscribes": ["ReferralCreated"]
},
"grpc": {
"exposes": ["ReferralService.AcceptReferral"],
"consumes": []
}
}
π Markdown Representation¶
## π Input/Output Contracts
### REST API
- **Exposes**:
- `POST /referrals/accept`
- `POST /referrals/reject`
- **Consumes**:
- `GET /clinics/info`
### gRPC Services
- **Exposes**:
- `ReferralService.AcceptReferral`
- **Consumes**: None
### Event Contracts
- **Publishes**:
- `ReferralAccepted`
- `ReferralRejected`
- **Subscribes**:
- `ReferralCreated`
π Contract Details Location¶
Each contract is declared and versioned in:
blueprints/microservices/{service-name}/contracts/
βββ rest/
β βββ openapi.json
β βββ routes.md
βββ events/
β βββ published.json
β βββ subscribed.json
βββ grpc/
βββ proto/
βββ metadata.json
π€ Factory Uses¶
| Agent | Use Case |
|---|---|
π§ͺ QA Agent |
Generates contract tests from these declarations |
π‘ Observability |
Anchors telemetry to events and endpoints |
π Docs Agent |
Produces endpoint reference and schemas |
π Cross-Service Map |
Builds integration graphs between services |
β Guarantees¶
- All exposed and consumed contracts are versioned and diffable
- Each contract is linked to the semantic memory graph
- Changes automatically trigger validations and alerts to agents
π‘ Event-Driven Interfaces¶
Event-driven contracts in the Microservice Standard Blueprint describe the asynchronous communication model of the service β what domain events it publishes, what signals it subscribes to, and how it interacts with the event mesh of the system.
This section is essential for enabling decoupled, reactive, and observable systems, following ConnectSoftβs Event-Driven Architecture principles.
Event contracts are first-class citizens in the Factory β modeled, tested, monitored, and trace-linked like APIs.
π€ Published Events¶
These are domain events emitted by the service and consumed by others.
| Field | Description |
|---|---|
eventName |
Canonical name of the domain event |
payloadSchema |
JSON schema or .avsc file describing structure |
channel |
Topic or bus used for publishing |
semanticType |
Type of event (e.g., created, updated, failed) |
version |
Versioned contract for downstream validation |
π₯ Subscribed Events¶
These are external events the service listens to.
| Field | Description |
|---|---|
sourceService |
Origin of the event |
eventName |
Subscribed event name |
payloadContract |
Validated schema definition |
handlingPolicy |
At-least-once, idempotent, dead-letter, etc. |
π§ Example JSON Block¶
{
"publishes": [
{
"eventName": "ReferralAccepted",
"channel": "vet.referral.outbound",
"semanticType": "status.updated",
"version": "v1"
}
],
"subscribes": [
{
"eventName": "ReferralCreated",
"sourceService": "referral-intake",
"channel": "vet.referral.inbound",
"handlingPolicy": "idempotent"
}
]
}
π Markdown Format¶
## π‘ Event-Driven Interfaces
### Publishes
- `ReferralAccepted` β Channel: `vet.referral.outbound` (v1)
- Type: `status.updated`
### Subscribes
- `ReferralCreated` β From: `referral-intake` on `vet.referral.inbound`
- Policy: Idempotent
π Storage Convention¶
blueprints/microservices/{service-name}/contracts/events/
βββ published/
β βββ ReferralAccepted.json
βββ subscribed/
β βββ ReferralCreated.json
βββ index.json
Each .json file contains schema, version, channel, and source trace metadata.
π§ Factory Use Cases¶
| Agent | Purpose |
|---|---|
π§ͺ QA Agent |
Runs contract conformance and event replay tests |
π‘ Observability Agent |
Auto-generates spans, metrics, and dead-letter alerts |
π Docs Agent |
Visualizes producer/consumer graphs and schemas |
π§ Replanning Agent |
Detects event drift or unmet contracts over time |
β Guarantees¶
- Every event is versioned, diffable, and semantically classified
- Subscriptions include policy hints (e.g., idempotency, retries)
- Contract validation is automated in the CI/CD pipeline
π§± Domain Entities & Aggregates Used¶
Every microservice in the Factory explicitly declares the domain entities and aggregate roots it owns or operates on. This section encodes the semantic structure of the service β ensuring that it aligns with Clean Architecture, DDD principles, and traceable domain modeling.
Aggregates are the backbone of business logic. Declaring them upfront lets the Factory build storage, tests, APIs, and events around a shared understanding.
π§© Whatβs Included¶
| Field | Description |
|---|---|
aggregateRoots |
Main domain objects the service owns/manages |
entities |
Supporting entities used within aggregates |
valueObjects |
Immutable types used in business logic |
externalReferences |
Domain objects this service reads but doesnβt own |
persistenceHints |
Storage preferences (e.g., relational, document, event-sourced) |
π§ Example JSON Block¶
{
"aggregateRoots": ["Referral"],
"entities": ["ReferralStatus", "ClinicMetadata"],
"valueObjects": ["ReferralDecision", "NotificationTarget"],
"externalReferences": ["VetProfile", "Appointment"],
"persistenceHints": {
"type": "relational",
"orm": "NHibernate",
"projectionModels": ["ReferralReadModel"]
}
}
π Markdown Format¶
## π§± Domain Aggregates & Entities
- **Aggregate Roots**: `Referral`
- **Entities**: `ReferralStatus`, `ClinicMetadata`
- **Value Objects**: `ReferralDecision`, `NotificationTarget`
- **Reads From (External)**: `VetProfile`, `Appointment`
- **Persistence Strategy**:
- Type: Relational
- ORM: NHibernate
- Projections: `ReferralReadModel`
π Storage Structure¶
blueprints/microservices/{service-name}/domain/
βββ aggregates/
β βββ Referral.json
βββ entities/
β βββ ReferralStatus.json
β βββ ClinicMetadata.json
βββ value-objects/
β βββ ReferralDecision.json
βββ index.json
Each definition includes validation rules, lifecycle methods, and memory embedding metadata.
π§ Agent and Template Uses¶
| Consumer | Use Case |
|---|---|
βοΈ CLI Template Engine |
Uses aggregates to scaffold Domain/ folder and persistence boundaries |
π§ͺ QA Agent |
Generates BDD-style tests and mock data factories |
π Docs Agent |
Visualizes entity relationships and behavior rules |
π§ Memory System |
Embeds domain models in vector DB and DDD maps |
β Guarantees¶
- Aggregates and value objects are semantically defined and versioned
- External references are read-only by design and must be declared
- ORM strategies are inferred from template metadata or declared explicitly
βοΈ Technology Stack & Runtime Profile¶
Each microservice blueprint includes a declared technology stack and runtime configuration β ensuring that the service is generated consistently, deployed correctly, and monitored reliably across environments. These declarations align the blueprint with available CLI templates, DevOps tooling, and observability instrumentation.
In the AI Software Factory, a service is not just what it does, but how it runs β this block makes it explicit.
π₯οΈ Technology Fields¶
| Field | Description |
|---|---|
language |
Programming language and version |
framework |
Runtime environment or framework used |
templateId |
CLI template this service is generated from |
database |
Preferred persistence provider(s) |
messagingBus |
Message/event broker technologies |
orchestration |
Hosting strategy (e.g., Kubernetes, Azure Functions) |
additionalLibs |
Shared packages or frameworks integrated |
π§ Example JSON Block¶
{
"language": ".NET 8",
"framework": "ASP.NET Core",
"templateId": "connectsoft.microservice-v2",
"database": "SQL Server",
"messagingBus": "Azure Service Bus",
"orchestration": "Azure Kubernetes Service",
"additionalLibs": [
"ConnectSoft.Domain.Primitives",
"ConnectSoft.Messaging",
"ConnectSoft.Observability"
]
}
π Markdown Format¶
## βοΈ Technology & Runtime Profile
- **Language**: .NET 8
- **Framework**: ASP.NET Core
- **Template ID**: `connectsoft.microservice-v2`
- **Database**: SQL Server
- **Messaging Bus**: Azure Service Bus
- **Orchestration**: Azure Kubernetes Service
- **Integrated Libraries**:
- `ConnectSoft.Domain.Primitives`
- `ConnectSoft.Messaging`
- `ConnectSoft.Observability`
π§© CLI Template Alignment¶
Declared stack maps to a registered CLI template:
templates/
βββ microservice/
βββ connectsoft.microservice-v2/
βββ template.json
βββ postgen.cake
βββ artifacts/
Template selection is deterministic based on tech stack and blueprint ID.
π§ Agent Use Cases¶
| Agent | Purpose |
|---|---|
π§ Generator Agent |
Selects template and resolves DI, logging, and middleware scaffolding |
βοΈ DevOps Agent |
Builds Dockerfile, Helm chart, pipeline YAML |
π‘ Observability Agent |
Determines what telemetry sources to auto-inject |
π§ͺ QA Agent |
Selects correct test harness and BDD tooling |
β Guarantees¶
- Stack is always explicit and versioned
- Only templates in the registry are accepted β no manual overrides
- Library references are used to inject preconfigured behaviors and traits
π Observability, Health & Metrics¶
This section defines the runtime introspection characteristics of the microservice β how it exposes health, emits telemetry, and participates in monitoring dashboards. It encodes observable contracts, enabling automatic wiring of logs, metrics, traces, alerts, and health checks into the platform-wide observability mesh.
Observability is declarative and traceable β built into the blueprint, not bolted on later.
π Observability Metadata¶
| Field | Description |
|---|---|
healthChecks |
Declared endpoints for liveness/readiness |
metrics |
Business or system metrics emitted |
traces |
Span categories or operations this service generates |
loggingScopes |
Logical areas of structured logging |
dashboardProfiles |
Predefined Grafana or Azure Monitor dashboard fragments linked |
alertAnchors |
Conditions or rules for alert policies |
π§ Example JSON Block¶
{
"healthChecks": ["/healthz", "/readyz"],
"metrics": ["referral.accepted.count", "referral.processing.time"],
"traces": ["ReferralAcceptedHandler", "NotificationPublisher"],
"loggingScopes": ["Application", "Infrastructure", "Domain"],
"dashboardProfiles": ["standard-service-overview", "referral-events"],
"alertAnchors": ["referral.failed.count > 5 in 10m", "no-accepted-events-in-1h"]
}
π Markdown Format¶
## π Observability, Health & Metrics
- **Health Endpoints**:
- `/healthz` (Liveness)
- `/readyz` (Readiness)
- **Metrics Emitted**:
- `referral.accepted.count`
- `referral.processing.time`
- **Tracing Spans**:
- `ReferralAcceptedHandler`
- `NotificationPublisher`
- **Logging Scopes**:
- `Application`, `Infrastructure`, `Domain`
- **Dashboards**:
- `standard-service-overview`
- `referral-events`
- **Alert Anchors**:
- `referral.failed.count > 5 in 10m`
- `no-accepted-events-in-1h`
π§ Integration with Observability Systems¶
| Component | Usage |
|---|---|
π‘ Observability Agent |
Injects probes, spans, metrics; registers alerts and dashboards |
π§ Memory Graph |
Tags blueprint with observability lineage |
βοΈ DevOps Pipelines |
Adds monitoring setup in Helm charts and deployment templates |
π Studio UI |
Visualizes live telemetry wiring |
π Related Files¶
blueprints/microservices/{service}/observability/
βββ metrics.json
βββ traces.json
βββ health-checks.json
βββ alerting-rules.yaml
β Guarantees¶
- Every service has at least one health check endpoint
- All metrics and alerts are defined upfront and scaffolded
- Dashboards are linked by profile and autogenerated if missing
π Security & Authentication Interfaces¶
This section defines how the microservice participates in the platformβs security model, including authentication, authorization, data protection, and access control. Security is not optional β it is declared, validated, and injected at generation time to enforce platform-wide protection standards.
Security boundaries must be known before any endpoint or contract is exposed β this ensures Factory-wide compliance and zero-trust readiness.
π Security Metadata¶
| Field | Description |
|---|---|
authMode |
Type of authentication required (OAuth2, API Key, None, etc.) |
authorizationScopes |
Required claims/roles for each capability or endpoint |
encryptionZones |
Declared zones where data-at-rest or in-transit is encrypted |
sensitiveFields |
Fields that must be masked, encrypted, or excluded from logs |
tokenValidation |
Configuration for token issuer, audience, and metadata resolution |
securityAnnotations |
Hints used by agents for scanning, threat modeling, and hardening |
π§ Example JSON Block¶
{
"authMode": "OAuth2",
"authorizationScopes": {
"/referrals/accept": ["referral:write"],
"/referrals/reject": ["referral:write"]
},
"encryptionZones": ["ReferralDecision", "VetProfile"],
"sensitiveFields": ["reason", "contactPhone"],
"tokenValidation": {
"issuer": "https://auth.connectsoft.ai",
"audience": "referral-api",
"jwksUri": "https://auth.connectsoft.ai/.well-known/jwks.json"
},
"securityAnnotations": ["PII", "auditable", "role-guarded"]
}
π Markdown Format¶
## π Security & Authentication
- **Auth Mode**: OAuth2
- **Scopes**:
- `POST /referrals/accept` β `referral:write`
- `POST /referrals/reject` β `referral:write`
- **Encrypted Fields**:
- `ReferralDecision`, `VetProfile`
- **Sensitive Fields**:
- `reason`, `contactPhone`
- **Token Validation**:
- Issuer: `https://auth.connectsoft.ai`
- Audience: `referral-api`
- JWKS URI: `/.well-known/jwks.json`
- **Security Tags**: `PII`, `auditable`, `role-guarded`
π Runtime Behavior¶
| Layer | Enforcement Mechanism |
|---|---|
| Gateway/API | Verifies tokens, scopes, and blocks unauthenticated access |
| Application | Applies fine-grained attribute or middleware-based checks |
| Telemetry | Ensures sensitive fields are never logged |
| Storage | Encrypts declared zones with KMS-integrated secrets |
π§ Agent & Pipeline Consumers¶
| Agent/System | Purpose |
|---|---|
π‘οΈ Security Agent |
Validates blueprint for missing controls, adds policies |
βοΈ DevOps Agent |
Injects identity provider config, secrets, and gateway auth |
π§ͺ QA Agent |
Generates negative and privilege-based test cases |
π Docs Agent |
Exposes scopes and policies for documentation portals |
β Guarantees¶
- Every public endpoint must declare auth and authorization metadata
- Tokens and keys are not stored in blueprint, only referenced via metadata
- Audit and logging respect declared sensitivity annotations
π§ͺ Testability & Quality Anchors¶
This section defines the test surface area, test strategies, and quality anchors of the microservice β enabling autonomous test generation, pipeline wiring, and QA observability. The blueprint declares what should be tested, how it should behave, and where resilience and coverage are expected.
Quality is not an afterthought. It is modeled into the microservice from its blueprint.
π§ͺ Quality Metadata¶
| Field | Description |
|---|---|
testStrategy |
Overall QA approach (BDD, unit-first, contract-first, etc.) |
testCoverageGoals |
Targeted areas of behavior (e.g., events, APIs, edge cases) |
failureModes |
Known failure points and expected behavior |
resilienceScenarios |
Retry, timeout, or failover situations to validate |
ciPipelineTests |
Tests to run per CI/CD stage |
manualTestingHints |
Areas where human validation is expected or required |
π§ Example JSON Block¶
{
"testStrategy": "contract-first",
"testCoverageGoals": ["event publishing", "happy path APIs", "access control failures"],
"failureModes": ["event bus outage", "invalid referral ID", "permission denied"],
"resilienceScenarios": ["retry on transient DB failure", "graceful degraded state"],
"ciPipelineTests": {
"unit": true,
"contract": true,
"integration": true,
"load": false
},
"manualTestingHints": ["notification rendering", "clinic lookup fallback"]
}
π Markdown Format¶
## π§ͺ Testability & Quality
- **Strategy**: Contract-First
- **Coverage Goals**:
- Event publishing and schema compliance
- API happy paths and auth failures
- PII masking and audit logs
- **Failure Modes**:
- Event bus unavailability
- Invalid or missing referral ID
- Insufficient permissions
- **Resilience Scenarios**:
- Retry on transient DB failure
- Fallback when external clinic lookup fails
- **CI Pipeline Tests**:
- β
Unit
- β
Contract
- β
Integration
- β Load
- **Manual Testing**:
- Notification layout validation
- Clinic fallback logic review
π§ͺ How Agents Use This Block¶
| Agent | Behavior |
|---|---|
π§ͺ QA Agent |
Generates test specs, BDD stories, mocks, and failure injection scenarios |
π Docs Agent |
Creates /tests section in Studio and documentation output |
βοΈ DevOps Agent |
Wires test stages into CI/CD pipeline YAML based on declaration |
π§ Resiliency Agent |
Triggers chaos scenarios or stress tests aligned to resilience metadata |
𧬠Memory and Trace Graph¶
All test-related elements are tagged in:
memory/tests/traces/qa/{blueprintTraceId}alerts/coverage/{service-name}
β Guarantees¶
- Every service must declare at least 1 failure mode and 1 coverage goal
ciPipelineTestsmust be consistent with observed test runners in pipeline- All test specs are auto-synced with semantic memory and QA dashboards
π Retry, Timeout & Resilience Config¶
This section encodes the fault-tolerance strategy of the microservice β including retries, timeouts, circuit breakers, and fallback policies. It ensures services are resilient by default, consistently recovering from transient failures, respecting time constraints, and surfacing meaningful errors.
Resilience isnβt optional β itβs modeled, implemented, and tested from the blueprint forward.
π Resilience Fields¶
| Field | Description |
|---|---|
retryPolicies |
Retry rules per external dependency or operation |
timeouts |
Timeout durations for critical operations |
circuitBreakers |
Definitions of open/close thresholds for unstable systems |
fallbackStrategies |
Backup logic (cached response, default value, skip logic, etc.) |
resilienceAnnotations |
Metadata for chaos injection, observability, or hardening agents |
π§ Example JSON Block¶
{
"retryPolicies": {
"eventBus": { "maxAttempts": 3, "intervalMs": 500, "backoff": "exponential" },
"clinicLookup": { "maxAttempts": 2, "intervalMs": 1000 }
},
"timeouts": {
"externalApiCalls": "5s",
"databaseTransactions": "10s"
},
"circuitBreakers": {
"clinicLookup": { "failureThreshold": 5, "duration": "60s" }
},
"fallbackStrategies": {
"clinicLookup": "returnCachedClinicInfo"
},
"resilienceAnnotations": ["resilient", "chaos-tested"]
}
π Markdown Representation¶
## π Resilience Configuration
- **Retry Policies**:
- `eventBus`: 3 attempts, 500ms exponential backoff
- `clinicLookup`: 2 attempts, 1s interval
- **Timeouts**:
- External API Calls: 5s
- Database Transactions: 10s
- **Circuit Breakers**:
- `clinicLookup`: Open after 5 failures, resets after 60s
- **Fallbacks**:
- `clinicLookup`: Return cached clinic info
- **Annotations**: `resilient`, `chaos-tested`
π Blueprint Files¶
blueprints/microservices/{service}/resilience/
βββ retry-policies.json
βββ timeouts.json
βββ circuit-breakers.json
βββ fallback-strategies.json
π€ Agent Integration¶
| Agent | Usage |
|---|---|
π§ Generator Agent |
Inserts policies into code templates and DI registration |
βοΈ DevOps Agent |
Injects config into Helm charts or appsettings |
π‘ Observability Agent |
Adds resilience metrics and circuit breaker alerts |
π§ͺ QA Agent |
Builds failure and retry scenarios into test suites |
β Guarantees¶
- Every external call must have a declared retry policy or fallback
- Circuit breakers are agent-monitored and dashboard-visible
- Timeouts are enforced through code and config generation
π§ Memory, Traceability & Semantic Embeddings¶
Every microservice blueprint in the AI Software Factory is embedded into the Factoryβs Memory Graph, enabling semantic search, agent reuse, prompt injection, and system-wide traceability. This section declares how the blueprint participates in long-term memory, observability lineage, and traceable provenance.
Memory is what allows agents to reason, compare, refactor, and regenerate β this section makes the blueprint retrievable by meaning, context, and usage.
π§ Memory Metadata Fields¶
| Field | Description |
|---|---|
traceId |
Unique ID linking this blueprint to orchestrated events |
semanticTags |
Keywords, domain labels, capability clusters |
embeddingVectors |
Location of semantic vector for this blueprint |
traceAnchors |
Downstream artifacts linked to this blueprint (e.g., repo, deployment, tests) |
versionLineage |
Historic trail of blueprint versions and evolution events |
agentProvenance |
Chain of agents involved in generation, correction, and approval |
π§ Example JSON Block¶
{
"traceId": "svc-referral-0039",
"semanticTags": ["referral", "veterinary", "event-driven", "secure"],
"embeddingVectors": "vectorstore://blueprints/svc-referral-0039",
"traceAnchors": ["repo://git/referral-api", "dashboards://grafana/referral"],
"versionLineage": ["v1", "v2", "v2.1"],
"agentProvenance": ["vision-architect-agent", "microservice-generator-agent", "qa-agent"]
}
π Markdown Format¶
## π§ Memory & Traceability
- **Trace ID**: `svc-referral-0039`
- **Semantic Tags**: `referral`, `veterinary`, `event-driven`, `secure`
- **Embedding Location**: `vectorstore://blueprints/svc-referral-0039`
- **Anchored Artifacts**:
- Git Repo: `repo://git/referral-api`
- Dashboard: `dashboards://grafana/referral`
- **Version History**: `v1` β `v2` β `v2.1`
- **Generated by Agents**:
- Vision Architect Agent
- Microservice Generator Agent
- QA Agent
𧬠Memory Graph Behavior¶
| Type | Behavior |
|---|---|
| Vector Memory | Allows similarity search: βFind blueprints like Referralβ |
| Trace Memory | Connects this blueprint to QA results, tests, repos, metrics, etc. |
| Provenance Memory | Allows agents to explain βwho created what, when, and whyβ |
π€ Agent Consumption¶
| Agent | Purpose |
|---|---|
π§ Replanning Agent |
Recommends blueprint changes based on trace gaps or diff analysis |
π Docs Agent |
Renders lineage and agent provenance in audit views |
Observability Agent |
Adds trace correlation to spans and logs |
π οΈ Engineering Copilots |
Retrieve relevant blueprints for context-enhanced completion |
β Guarantees¶
- Every blueprint has a unique traceId
- Semantic embeddings are stored at generation time
- Downstream links (repos, tests, dashboards) are automatically updated
βοΈ DevOps, CI/CD & Environment Profiles¶
This section specifies how the microservice integrates into the Factoryβs DevOps pipeline, including its build, release, deployment environments, and infrastructure characteristics. The blueprint declares environment-specific variations, CI/CD stages, artifact outputs, and GitOps configurations β enabling zero-manual deployment automation.
In the AI Software Factory, DevOps is code-generated β pipelines are formed from blueprints, not copy-pasted scripts.
π§ DevOps Metadata Fields¶
| Field | Description |
|---|---|
ciStages |
Stages to execute in continuous integration (e.g., test, lint, package) |
cdStages |
Stages to execute in delivery (e.g., deploy to staging, prod) |
environments |
Declared environments with config overlays |
containerProfile |
Docker image name, tags, base image, and runtime config |
helmChart |
Helm chart reference used for Kubernetes deployment |
iacProfile |
Terraform/Bicep module name, parameters, and linked environment file |
π§ Example JSON Block¶
{
"ciStages": ["build", "test", "package", "lint", "publish-artifacts"],
"cdStages": ["deploy-dev", "deploy-staging", "deploy-prod"],
"environments": ["dev", "staging", "production"],
"containerProfile": {
"image": "ghcr.io/connectsoft/referral-api",
"tags": ["latest", "v2.1.0"],
"baseImage": "mcr.microsoft.com/dotnet/aspnet:8.0",
"envVars": ["ASPNETCORE_ENVIRONMENT", "Telemetry__ConnectionString"]
},
"helmChart": {
"name": "connectsoft/service-chart",
"version": "1.3.4"
},
"iacProfile": {
"tool": "bicep",
"module": "referral-api.bicep",
"envFiles": {
"dev": "referral-api.dev.bicep",
"prod": "referral-api.prod.bicep"
}
}
}
π Markdown Format¶
## βοΈ DevOps & Deployment
### CI/CD Stages
- CI: `build`, `test`, `package`, `lint`, `publish-artifacts`
- CD: `deploy-dev`, `deploy-staging`, `deploy-prod`
### Environments
- `dev`, `staging`, `production`
### Container
- Image: `ghcr.io/connectsoft/referral-api`
- Tags: `latest`, `v2.1.0`
- Base: `dotnet/aspnet:8.0`
- Env Vars: `ASPNETCORE_ENVIRONMENT`, `Telemetry__ConnectionString`
### Helm
- Chart: `connectsoft/service-chart@1.3.4`
### IaC
- Tool: `bicep`
- Module: `referral-api.bicep`
- Environment Files:
- Dev: `referral-api.dev.bicep`
- Prod: `referral-api.prod.bicep`
π Blueprint-Linked Artifacts¶
blueprints/microservices/{service}/devops/
βββ ci.yml
βββ cd.yml
βββ container.json
βββ helm-values/
β βββ staging.yaml
β βββ production.yaml
βββ iac/
βββ referral-api.bicep
βββ referral-api.dev.bicep
π€ Agent Responsibilities¶
| Agent | Role |
|---|---|
βοΈ DevOps Agent |
Generates pipelines, container files, deployment specs |
π‘ Observability Agent |
Adds telemetry and alerting wiring |
π οΈ Engineering Agent |
Syncs blueprint CI/CD state with GitHub Actions or Azure DevOps |
β Guarantees¶
- Every blueprint includes a deployable pipeline for all declared environments
- Container image and chart metadata are trace-linked to the blueprint
- DevOps config is versioned and environment-aware
π API Gateway & Routing Profile¶
This section defines how the microservice is exposed externally via the API Gateway β including routing, authentication passthrough, CORS settings, rate limits, and base path configurations. It allows the Factory to automatically register services in the gateway layer, configure secure routes, and apply observability and throttling policies centrally.
The API Gateway is not manually configured β every route stems from blueprint declarations.
π Gateway Metadata Fields¶
| Field | Description |
|---|---|
exposeViaGateway |
Boolean flag indicating public exposure |
basePath |
Base route under which all endpoints will be exposed |
pathPrefix |
Versioned or tenant-aware prefix to group API paths |
authPassthrough |
Whether JWT or OAuth tokens are forwarded to downstream service |
rateLimit |
Request rate thresholds (e.g., 100 req/min) |
corsPolicy |
Allowed origins, headers, and methods |
tags |
Tags for routing maps, dashboards, and OpenAPI indexing |
π§ Example JSON Block¶
{
"exposeViaGateway": true,
"basePath": "/api/referrals",
"pathPrefix": "/v1",
"authPassthrough": true,
"rateLimit": {
"limit": 100,
"windowSeconds": 60
},
"corsPolicy": {
"allowedOrigins": ["*"],
"allowedMethods": ["GET", "POST", "OPTIONS"],
"allowedHeaders": ["Authorization", "Content-Type"]
},
"tags": ["referral", "api", "public"]
}
π Markdown Format¶
## π API Gateway & Routing
- **Expose via Gateway**: β
- **Base Path**: `/api/referrals`
- **Path Prefix**: `/v1`
- **Auth Passthrough**: β
- **Rate Limit**: 100 requests/min
- **CORS**:
- Origins: `*`
- Methods: `GET`, `POST`, `OPTIONS`
- Headers: `Authorization`, `Content-Type`
- **Routing Tags**: `referral`, `api`, `public`
π§© Routing & Discovery¶
Registered in the Service Registry:
This enables:
- Service mesh discovery
- OpenAPI aggregation
- Routing graph for Studio UI
π€ Agent Consumers¶
| Agent | Role |
|---|---|
π§ Generator Agent |
Adds routing metadata to OpenAPI & gateway configs |
βοΈ DevOps Agent |
Applies ingress rules and gateway YAML files |
π‘ Observability Agent |
Anchors metrics (latency, errors) to route maps |
π Docs Agent |
Renders endpoint and route list for consumers |
β Guarantees¶
- All exposed routes are rate-limited and CORS-aware
- Auth passthrough is validated against the security profile
- Gateway exposure is trace-linked and monitored by default
π Inter-Service Communication & Contracts¶
This section defines the explicit communication contracts between the microservice and other services in the platform β including both synchronous and asynchronous interactions. It ensures declarative dependencies, traceable message flows, and stable integration points, enabling cross-service reliability and alignment with Clean Architecture principles.
Contracts are declared, not inferred β enabling versioning, mocking, test generation, and reuse.
π Inter-Service Communication Fields¶
| Field | Description |
|---|---|
syncCalls |
Direct HTTP/gRPC calls to other services |
asyncTriggers |
Events or messages emitted that may be picked up by other services |
contractsUsed |
Interfaces, schemas, or client packages imported from shared libraries |
versionDependencies |
Version numbers pinned for contracts or APIs |
integrationMode |
Invocation pattern (request-reply, fire-and-forget, pub-sub) |
communicationPolicies |
Timeouts, retry limits, and fallback behavior for each service call |
π§ Example JSON Block¶
{
"syncCalls": [
{
"targetService": "clinic-directory",
"endpoint": "/api/clinics/{id}",
"method": "GET",
"timeout": "3s",
"retries": 2
}
],
"asyncTriggers": ["ReferralAccepted", "ReferralFailed"],
"contractsUsed": ["IVetProfileServiceClient", "ReferralDecisionEvent"],
"versionDependencies": {
"clinic-directory": "v1.2.0",
"referral-contracts": "v1.0.5"
},
"integrationMode": "request-reply"
}
π Markdown Format¶
## π Inter-Service Communication
- **Synchronous Calls**:
- `GET /api/clinics/{id}` β `clinic-directory`
- Timeout: 3s
- Retries: 2
- **Async Triggers**:
- `ReferralAccepted`
- `ReferralFailed`
- **Used Contracts**:
- Interface: `IVetProfileServiceClient`
- Event: `ReferralDecisionEvent`
- **Dependency Versions**:
- `clinic-directory`: `v1.2.0`
- `referral-contracts`: `v1.0.5`
- **Integration Mode**: `request-reply`
π Contract Artifacts¶
blueprints/microservices/{service}/contracts/
βββ sync/
β βββ IVetProfileServiceClient.cs
βββ async/
β βββ ReferralDecisionEvent.json
βββ versions.json
π€ Agent Use Cases¶
| Agent | Behavior |
|---|---|
π§ Generator Agent |
Auto-generates client proxies or SDK usage |
π‘ Observability Agent |
Monitors call latency, errors, and inter-service spans |
π§ͺ QA Agent |
Builds mocks/stubs for contracts, runs contract test suites |
π Docs Agent |
Publishes inter-service dependency map |
β Guarantees¶
- All synchronous dependencies are versioned and timeout-bound
- Contract interfaces are traceable, testable, and mockable
- Interactions are observable and semantically typed
π§© Reuse of Shared Templates, Libraries & Codegen¶
This section captures how the microservice leverages shared assets from the Factory β including reusable templates, NuGet libraries, and code-generation primitives. It enables consistent behavior across services while reducing boilerplate, enhancing maintainability, and enforcing architectural rules.
Reuse is not ad-hoc β it's declarative, tracked, and scaffolded via blueprint-driven composition.
π Reuse Metadata Fields¶
| Field | Description |
|---|---|
usedTemplates |
CLI templates applied during generation (e.g., microservice, endpoint) |
sharedLibraries |
NuGet packages or internal libraries used |
codegenModules |
Reusable source generators or Roslyn analyzers integrated |
featureInjectors |
Declarative injection of cross-cutting features (e.g., logging, caching) |
templateOverrides |
Local overrides for base templates |
π§ Example JSON Block¶
{
"usedTemplates": ["connectsoft.microservice-v2", "connectsoft.endpoint.rest"],
"sharedLibraries": [
"ConnectSoft.Observability",
"ConnectSoft.Messaging",
"ConnectSoft.Storage.Sql"
],
"codegenModules": ["AuditableEntityGenerator", "ApiContractValidator"],
"featureInjectors": ["Logging", "Telemetry", "ExceptionHandling"],
"templateOverrides": {
"Domain/Aggregates": "custom/referral-aggregate.cs"
}
}
π Markdown Format¶
## π§© Reuse & Shared Components
- **Templates Used**:
- `connectsoft.microservice-v2`
- `connectsoft.endpoint.rest`
- **Shared Libraries**:
- `ConnectSoft.Observability`
- `ConnectSoft.Messaging`
- `ConnectSoft.Storage.Sql`
- **Code Generators**:
- `AuditableEntityGenerator`
- `ApiContractValidator`
- **Injected Features**:
- Logging
- Telemetry
- Exception Handling
- **Template Overrides**:
- `Domain/Aggregates`: `custom/referral-aggregate.cs`
π Directory Layout¶
blueprints/microservices/{service}/reusables/
βββ templates-used.json
βββ libraries.json
βββ codegen-modules.json
βββ overrides/
βββ referral-aggregate.cs
π€ Agent Usage¶
| Agent | Role |
|---|---|
π§ Generator Agent |
Composes microservice from layered templates and injectors |
π Docs Agent |
Documents which parts came from where |
π§ͺ QA Agent |
Knows where shared logic must be stubbed/tested differently |
Memory System |
Tracks usage patterns and recommends reuse in new blueprints |
β Guarantees¶
- All reuse is declared and trace-linked
- Feature injectors enforce standardization of cross-cutting concerns
- Template overrides are scoped and registered at generation time
πͺͺ Identity, Ownership & Access Metadata¶
This section defines the governance and access control metadata for the microservice β including who owns it, who can modify it, and what access levels exist for runtime, editing, or approvals. It supports tenant-aware access, team accountability, and agent permission scoping, critical for large-scale multi-agent collaboration in the Factory.
Every service must be traceable to a responsible owner β human or agent β for accountability and lifecycle governance.
π·οΈ Ownership Metadata Fields¶
| Field | Description |
|---|---|
ownedBy |
Agent(s), team(s), or persona responsible for this microservice |
createdBy |
Source of generation (agent, orchestrator, user prompt) |
accessScopes |
Roles or personas allowed to view/edit/test this blueprint |
approvalStatus |
Current approval state (draft, reviewed, approved, deprecated) |
changeLog |
Annotated history of blueprint edits or version transitions |
π§ Example JSON Block¶
{
"ownedBy": ["engineering-team/referrals"],
"createdBy": "microservice-generator-agent",
"accessScopes": ["Product Manager", "DevOps Engineer", "QA Agent"],
"approvalStatus": "approved",
"changeLog": [
{ "version": "v1", "note": "Initial generation", "by": "microservice-generator-agent" },
{ "version": "v2", "note": "Refined event contracts", "by": "product-manager-agent" }
]
}
π Markdown Format¶
## πͺͺ Identity & Access
- **Owner**: `engineering-team/referrals`
- **Created By**: `microservice-generator-agent`
- **Access Scopes**:
- Product Manager
- DevOps Engineer
- QA Agent
- **Approval Status**: β
Approved
- **Change Log**:
- `v1` β Initial generation (by Microservice Generator Agent)
- `v2` β Event contract refinement (by Product Manager Agent)
π§© Governance Implications¶
| Mechanism | Behavior |
|---|---|
| Access Control | Studio enforces read/write access by declared scopes |
| Audit Logging | Changes are logged with trace IDs and agent signatures |
| Ownership Routing | Bug reports, questions, and tests are routed to responsible agent/team |
| Reuse Signals | Memory graph aligns reuse recommendations with owner match |
π Governance Files¶
blueprints/microservices/{service}/ownership/
βββ access-scopes.json
βββ changelog.md
βββ metadata.json
β Guarantees¶
- Every blueprint has a declared owner and creator
- Edits and regenerations are logged with agent provenance
- Access is enforced by persona, role, and agent capability scope
π§ Versioning, Diffing & Regeneration Model¶
This section defines how the microservice blueprint is versioned, compared, and regenerated β enabling safe iteration, explainable change tracking, and automatic agent reconciliation. It powers intelligent diffs, rollbacks, and blueprint evolution workflows within the AI Software Factory.
Every blueprint is a living document β versions must be explicit, traceable, and regenerable on demand.
π Versioning & Diffing Fields¶
| Field | Description |
|---|---|
currentVersion |
Active version of the blueprint (v1, v2.1, etc.) |
versionHistory |
All historical versions with change notes |
diffStrategy |
Algorithm or policy for computing diffs (line, semantic, contract) |
regenerationTriggers |
Events or signals that should cause this blueprint to regenerate |
immutabilityZones |
Declared sections that should not be overwritten by auto-regeneration |
diffAnchors |
Points of interest tracked between versions (e.g., api, events) |
π§ Example JSON Block¶
{
"currentVersion": "v2.1",
"versionHistory": [
{ "version": "v1", "note": "Initial scope" },
{ "version": "v2", "note": "Domain modeling updates" },
{ "version": "v2.1", "note": "Security enhancements" }
],
"diffStrategy": "semantic",
"regenerationTriggers": ["domain-model-change", "vision-update"],
"immutabilityZones": ["Domain/Aggregates", "Security"],
"diffAnchors": ["api", "events", "devops"]
}
π Markdown Format¶
## π§ Versioning & Diffing
- **Current Version**: `v2.1`
- **History**:
- `v1` β Initial scope
- `v2` β Domain modeling updates
- `v2.1` β Security enhancements
- **Diff Strategy**: `semantic`
- **Triggers for Regeneration**:
- Domain model change
- Vision blueprint update
- **Immutable Sections**:
- `Domain/Aggregates`
- `Security`
- **Tracked Anchors**:
- API
- Events
- DevOps
π Regeneration Lifecycle¶
| Stage | Description |
|---|---|
triggered |
A change signal (prompt, event, upstream blueprint) occurs |
diffed |
System compares current and new blueprint using declared strategy |
reviewed |
Human or agent reviews diffs in Studio or CI |
committed |
Blueprint vN+1 created, immutability zones enforced |
π€ Agent Roles¶
| Agent | Function |
|---|---|
π§ Generator Agent |
Applies diff-aware regeneration workflows |
π Docs Agent |
Highlights changes and semantic shifts visually |
π§ͺ QA Agent |
Revalidates test coverage and behavior assumptions post-regeneration |
π‘ Observability Agent |
Compares metrics and spans across blueprint versions |
β Guarantees¶
- All blueprints are version-controlled and traceable
- Diffs are semantic and anchor-based, not just textual
- Blueprint regenerations respect declared immutability zones
π§± Domain Modeling & Aggregate Inclusion¶
This section documents how the microservice participates in the domain model β including its aggregates, entities, value objects, and their boundaries. It ensures the microservice adheres to Domain-Driven Design (DDD) principles and aligns with the Clean Architecture layer structure (Domain β Application β Infrastructure).
Domain objects are first-class citizens β theyβre generated, validated, and reused across the platform.
π§± Domain Metadata Fields¶
| Field | Description |
|---|---|
aggregates |
Core domain aggregates owned or modified by this microservice |
entities |
Entities involved in the domain model |
valueObjects |
Reusable non-identity domain objects |
domainEvents |
Events emitted or handled that represent state transitions |
boundedContext |
The bounded context this microservice belongs to |
domainReferences |
Imports or usages of other domain models (read-only or collaborative) |
π§ Example JSON Block¶
{
"aggregates": ["Referral"],
"entities": ["Vet", "Clinic", "ReferralDecision"],
"valueObjects": ["ContactInfo", "ReferralType"],
"domainEvents": ["ReferralAccepted", "ReferralRejected"],
"boundedContext": "Referrals",
"domainReferences": ["VetProfiles", "Clinics"]
}
π Markdown Format¶
## π§± Domain Model Participation
- **Aggregates**:
- `Referral`
- **Entities**:
- `Vet`, `Clinic`, `ReferralDecision`
- **Value Objects**:
- `ContactInfo`, `ReferralType`
- **Domain Events**:
- `ReferralAccepted`
- `ReferralRejected`
- **Bounded Context**: `Referrals`
- **References**: `VetProfiles`, `Clinics` (read-only)
π Domain Artifacts¶
blueprints/microservices/{service}/domain/
βββ aggregates/
β βββ Referral.cs
βββ entities/
β βββ Vet.cs
β βββ Clinic.cs
βββ value-objects/
β βββ ContactInfo.cs
βββ events/
β βββ ReferralAccepted.cs
β βββ ReferralRejected.cs
βββ context.json
π§ Agent Impact¶
| Agent | Responsibility |
|---|---|
π§ Generator Agent |
Injects aggregates and events into the domain layer |
π Docs Agent |
Renders bounded context maps and domain object graphs |
π§ͺ QA Agent |
Validates transitions and emits tests for domain events |
Knowledge Graph Builder |
Embeds relationships between contexts, events, and aggregates |
β Guarantees¶
- Domain objects are generated in their correct layer (Domain, not Infrastructure)
- Domain events are observable, semantically tagged, and stored in memory graph
- Aggregate ownership ensures no ambiguity in state transitions or business rules
β Final Summary & Blueprint Guarantees¶
This final section synthesizes all blueprint dimensions into a concise summary table and enumerates the platform-wide guarantees that stem from having a complete Agent Microservice Standard Blueprint. It ensures that each microservice is traceable, testable, observable, deployable, and regenerable β aligned with ConnectSoftβs clean, event-driven, and modular standards.
π§Ύ Blueprint Summary Table¶
| Aspect | Included |
|---|---|
| π Identity & Naming | β |
| π§© Responsibilities | β Domain-specific business capability defined |
| π Contracts (API + Events) | β REST, gRPC, and pub/sub messages declared |
| π§± Domain Participation | β Aggregates, Entities, Events defined |
| π Resilience | β Retry, timeout, fallback policies |
| π§ͺ Testability | β Strategy, CI stages, resilience tests |
| βοΈ DevOps & Infra | β Pipelines, containers, Helm, IaC |
| π API Gateway | β Exposure, routing, rate limit, CORS |
| π Inter-Service Links | β Versioned, traceable service dependencies |
| π§© Reuse & Templates | β CLI templates, shared libs, generators |
| πͺͺ Governance & Access | β Owners, roles, change log |
| π§ Versioning & Diffs | β Immutable zones, semantic diffing |
| π§ Memory & Traceability | β Vector embeddings, trace ID, lineage |
π‘οΈ Blueprint Guarantees (Platform-Level)¶
β Regenerable: Any service can be regenerated with full trace, constraints, and override preservation β Diffable: Every version is diffable by semantic anchors and agent-aided visualization β Observable: Every span, event, API call is anchored to blueprint-defined metadata β Composable: All services can be composed into flows, clusters, and systems based on domain & comms β Auditable: Agents, humans, prompts, and artifacts are traceable to a single blueprint lineage β Portable: Blueprint defines Helm/IaC/container structure for runtime movement across environments β Memory-Synced: Full blueprint available in vector DB, memory graph, and observability backend
π§ Where It Lives¶
blueprints/microservices/{service}/
βββ microservice-blueprint.md β Main human-readable file
βββ microservice-blueprint.json β Machine-readable structure
βββ memory/
β βββ vector.embedding
βββ contracts/
βββ domain/
βββ devops/
βββ ownership/
βββ changelog.md
π Lifecycle Control¶
- Generated by:
π§ Microservice Generator Agent - Maintained by: Product, Architecture, QA, DevOps Agents
- Triggered by: Vision + Product Blueprint + Architecture Context