Skip to content

Template & Library — aggregate roots

Generated from the architecture model

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

Aggregate Service Root entity Events Tables
BlueprintVersion BlueprintService BlueprintVersion BlueprintValidated, BlueprintSubmitted, BlueprintPublished BlueprintVersions, ValidationFindings
ContextMap BlueprintService ContextMap ContextMapDerived ContextMaps
DomainModel BlueprintService DomainModel DomainModelDerived DomainModels
GenerationRecipe GenerationRecipeService GenerationRecipe RecipeValidated, RecipeApproved, GenerationCompleted GenerationRecipes, ModulePlanEntries
GeneratedOutput GenerationRecipeService GeneratedOutput GeneratedOutputRecorded GeneratedOutputs
TemplateVersion TemplateRegistryService TemplateVersion TemplateVersionDiscovered, TemplateVersionPublished TemplateVersions
LibraryVersion TemplateRegistryService LibraryVersion LibraryVersionDiscovered LibraryVersions
CompatibilityEntry TemplateRegistryService CompatibilityEntry CompatibilityChecked CompatibilityEntries

BlueprintVersion (BlueprintService)

One version of one blueprint document of a kind for a project: the descriptor content as an artifact, its schema version, validation state and report, derived context map and domain model references, the asset release it became, and provenance to the run or person that authored it.

Field Type Required Description
blueprintId string yes
version string yes
tenantId string yes
projectId string yes
kind enum:BlueprintKind yes
schemaVersion string yes
documentRef string yes Artifact reference of the descriptor.
documentHash string yes
state enum:BlueprintState yes
validationReportRef string no
contextMapRef string no
domainModelRef string no
releaseId string no
authoredBy string yes user or run id
createdAt datetime yes

Invariants

  • A blueprint is Validated only when its document passes its kind's JSON Schema and every rule of the kind's validation rule set; findings carry rule ids.
  • Service and module blueprints must reference a context map and a domain model derived from them; a change to the document invalidates the derived artifacts.
  • Publication goes through Asset Publication (BC-04) and its evaluation gate; this service never marks Published on its own.

States (BlueprintState)

stateDiagram-v2
    Draft --> Validated : ValidationPassed
    Validated --> Draft : DocumentChanged
    Validated --> Submitted : SubmitForPublication
    Submitted --> Published : AssetReleasePublished
    Published --> Deprecated : AssetReleaseDeprecated
Hold "Alt" / "Option" to enable pan & zoom

Entities: ValidationFinding · Value objects: —

ContextMap (BlueprintService)

The bounded contexts, relationships (upstream, downstream, shared kernel, anti-corruption layer) and published-language events derived from a vision or service blueprint; the source of the generated product's bounded-context catalog.

Field Type Required Description
contextMapId guid yes
tenantId string yes
projectId string yes
blueprintId string yes
blueprintVersion string yes
contexts json yes
relationships json yes
publishedEvents json yes
derivedAt datetime yes

Invariants

  • Derived, never edited; a change is a blueprint change.

DomainModel (BlueprintService)

Aggregates, entities, value objects, invariants and events per bounded context derived from a service or module blueprint; the typed input of the entity-model, persistence and API generation.

Field Type Required Description
domainModelId guid yes
tenantId string yes
projectId string yes
blueprintId string yes
blueprintVersion string yes
contextId string yes
aggregates json yes
events json yes
derivedAt datetime yes

Invariants

  • Every aggregate has a root entity, an identity and at least one invariant; every event names its aggregate.

GenerationRecipe (GenerationRecipeService)

The complete, validated instruction set for generating a product or module: blueprint version, template versions per module, library versions, switches and parameters per module, target repository layout, pipeline generation settings, and the compatibility evidence it was validated against.

Field Type Required Description
recipeId guid yes
tenantId string yes
projectId string yes
version int yes
blueprintId string yes
blueprintVersion string yes
modules json yes module plan: kind, context, template id and version, switches, parameters, path
libraries json yes Library versions pinned for all modules.
repositoryLayout json yes mono-repo or repo per module; branch; pipelines
compatibilityEvidence json yes
state enum:RecipeState yes
approvedBy string no
createdAt datetime yes

Invariants

  • Every module references a Published template version whose switches accept the module's parameters; every library is Published and Compatible with every template that consumes it, with evidence.
  • A recipe is immutable once Approved; a change is a new version that supersedes it.
  • Generation executes as a Factory run (sandbox class for scaffolding, shared-write for the change proposal); this service never writes code.

States (RecipeState)

stateDiagram-v2
    Draft --> Validated : PlanValidated
    Validated --> Draft : Changed
    Validated --> Approved : Approved
    Approved --> Executing : RunSubmitted
    Executing --> Generated : RunCompleted
    Executing --> Approved : RunFailed
    Approved --> Superseded : NewVersion
    Generated --> Superseded : NewVersion
Hold "Alt" / "Option" to enable pan & zoom

Entities: ModulePlanEntry · Value objects: —

GeneratedOutput (GenerationRecipeService)

Provenance of one generated module at one commit: the recipe version, the Factory run and attempt, the agent release, the template version and manifest hash, the files generated and preserved, the pipeline definitions written, and the change proposal that carried it.

Field Type Required Description
outputId guid yes
tenantId string yes
projectId string yes
recipeId guid yes
recipeVersion int yes
moduleName string yes
runId guid yes
attemptId guid yes
agentReleaseId string yes
templateId string yes
templateVersion string yes
manifestHash string yes
generatedFiles json yes Paths and hashes.
preservedFiles json yes Paths left untouched per the manifest.
proposalId guid no
commit string no
generatedAt datetime yes

Invariants

  • Generated files are listed with hashes so a re-scaffold can tell generated from hand-edited content; preserved paths are never overwritten.

TemplateVersion (TemplateRegistryService)

A pinned manifest of one template version: short name, layer, projects and their roles (EntityModel … InfrastructureModel), template switches with allowed values, generated and preserved paths, pipelines, docs, consumers, the repository and commit it was read from, and its asset release.

Field Type Required Description
templateId string yes Short name from .template.config (the templates catalog id).
version string yes
tenantId string yes Platform tenant; templates are platform assets.
layer enum:TemplateLayer yes
repository string yes
commit string yes
manifest json yes projects, switches, generated/preserved paths, pipelines, docs
manifestHash string yes
state enum:CatalogState yes
releaseId string no
discoveredAt datetime yes

Invariants

  • A manifest is read from the template repository at a commit and pinned by hash; it is never edited in the catalog.
  • Only Published versions may be selected by a generation recipe; Deprecated versions may be upgraded from, never generated with.

LibraryVersion (TemplateRegistryService)

One version of one library (the libraries catalog id): packages and their versions on the feed, layer, capability area, options sections and registration API as read from the repository, and the templates that consume it.

Field Type Required Description
libraryId string yes
version string yes
tenantId string yes
layer enum:TemplateLayer yes
area string yes
packages json yes
optionsSections json no
consumers list:string yes
state enum:CatalogState yes
discoveredAt datetime yes

Invariants

  • Package versions come from the feed; a library version without a published package is Discovered, not Published.

CompatibilityEntry (TemplateRegistryService)

One cell of the compatibility matrix: a template version with a library version, a runtime (for example .NET 9 or 10), a Factory edition or a topology, the result and its evidence (a pipeline run that built it, a conformance run).

Field Type Required Description
entryId guid yes
tenantId string yes
subjectKind string yes template
subjectId string yes
subjectVersion string yes
withKind string yes library
withId string yes
withVersion string no
result enum:Compatibility yes
evidenceRef string no
checkedAt datetime yes

Invariants

  • Compatible needs evidence (a build or conformance run); without evidence the result is Unknown.