Domain

Architectural Context

The Domain Layer inside MILTON.DocumentGenerator consists of the core structural models that govern the shapes of document blocks, configuration overrides, and internal JSON properties.

Unlike a traditional monolithic relational domain, the Document Generator service uses these models purely for internal processing and message payload serialization. The true canonical state of a Document or a Content Block is owned by the main MILTON.Api service. Therefore, these models often mirror structures present in the API, relying on strict structural compatibility to operate correctly over the messaging boundary.

Intent and Architecture

The models defined in this namespace primarily support the claim-check messaging pattern and the internal property serialization for polymorphic content blocks. When the MILTON.Api dispatches generation work to the Document Generator, it includes JSON-serialized configurations or configurations in an S3 claim check.

These models represent the Deserialized Core of those operations.

classDiagram
    class RequirementModel {
        +String status
        +String safetyLevel
        +String? sourceFile
        +Int? lineNumber
        +String? requirementId
        +String? rationale
    }
    class ClusterModel {
        +List~String~ sourceFiles
        +String outputMode
        +String? contextDescription
        +String? moduleName
    }
    class LlmPresetConfig {
        +String id
        +String? apiKey
        +String? providerUrl
        +String? model
        +Double? temperature
    }
    
    RequirementModel ..> "JSON payload on ContentBlock" : Represents
    ClusterModel ..> "JSON payload on ContentBlock" : Represents
    LlmPresetConfig ..> "S3 Claim-Check" : Decrypted from API

Key Models

BlockTypes

Provides strongly typed constants mapping to polymorphic content block variations (e.g., Requirement, TestCase, Scanner). This ensures the Document Generator correctly branches its logic depending on the block type it was asked to process.

RequirementModel & ClusterModel

These classes define the JSON shape of PropertiesJson stored on Content Blocks.

  • RequirementModel tracks the structural breakdown of an individual requirement, including its safety level and source file mapping.
  • ClusterModel encapsulates the result of the MILTON.Clustering service, capturing grouped source files and logical module names.

LlmPresetConfig

Represents decrypted Large Language Model configuration overrides provided by the API. To keep the processing workers pure, the API resolves all hierarchical presets (tenant-level, project-level), decrypts necessary API keys, and passes a fully realized LlmPresetConfig within the S3 claim-check.

0 items under this folder.