From f35c563dac0b634ae61fbaa1dc74e4ee2fd722cf Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Thu, 14 May 2026 19:49:14 -0400 Subject: [PATCH] Update class diagrams --- docs/pipeline/diagrams/current/class.puml | 48 +++++++++++++++++++++ docs/pipeline/diagrams/planned/class.puml | 52 ++++++++++++++--------- 2 files changed, 80 insertions(+), 20 deletions(-) diff --git a/docs/pipeline/diagrams/current/class.puml b/docs/pipeline/diagrams/current/class.puml index 76955e2..0bfb7f2 100644 --- a/docs/pipeline/diagrams/current/class.puml +++ b/docs/pipeline/diagrams/current/class.puml @@ -26,6 +26,7 @@ skinparam note { title The Biergarten Data Pipeline - Class Diagram class BiergartenDataGenerator { + - logger_ : std::shared_ptr - context_service_ : std::unique_ptr - generator_ : std::unique_ptr - exporter_ : std::unique_ptr @@ -36,6 +37,46 @@ class BiergartenDataGenerator { - LogResults() : void } +class LogLevel <> { + Debug + Info + Warn + Error +} + +class PipelinePhase <> { + Startup + UserGeneration + BreweryAndBeerGeneration + CheckinGeneration + RatingGeneration + FollowGeneration + Teardown +} + +struct LogEntry { + + timestamp : std::chrono::system_clock::time_point + + level : LogLevel + + phase : PipelinePhase + + message : std::string + + worker : std::optional +} + +interface ILogger <> { + + Log(entry : const LogEntry&) : void +} + +class LogProducer { + - channel_ : BoundedChannel& + + Log(entry : const LogEntry&) : void +} + +class LogDispatcher { + - channel_ : BoundedChannel& + + Run() : void + - ToSpdlogLevel(level) : spdlog::level::level_enum +} + interface IEnrichmentService <> { + GetLocationContext(loc : const Location&) : std::string } @@ -123,10 +164,17 @@ class SystemDateTimeProvider { } ' Structural Relationships / Dependency Injection +BiergartenDataGenerator *-- ILogger : owns BiergartenDataGenerator *-- IEnrichmentService : owns BiergartenDataGenerator *-- DataGenerator : owns BiergartenDataGenerator *-- IExportService : owns +LogEntry *-- LogLevel +LogEntry *-- PipelinePhase +ILogger <|.. LogProducer : implements +LogProducer ..> LogEntry : emits +LogDispatcher ..> LogEntry : consumes + IEnrichmentService <|.. WikipediaService : implements WikipediaService *-- WebClient : owns diff --git a/docs/pipeline/diagrams/planned/class.puml b/docs/pipeline/diagrams/planned/class.puml index ad1a819..0ad1e8b 100644 --- a/docs/pipeline/diagrams/planned/class.puml +++ b/docs/pipeline/diagrams/planned/class.puml @@ -1,4 +1,4 @@ -@startuml +@startuml class_diagram ' ========================================== ' CONFIGURATION & STYLING @@ -8,6 +8,8 @@ skinparam classAttributeFontSize 9 skinparam defaultFontSize 25 skinparam titleFontSize 30 +title Biergarten Data Pipeline — Class Diagram + package "Domain: Models" { class Location { @@ -141,7 +143,7 @@ package "Domain: Models" { LocationContext *-- Completeness } -@startuml + package "Domain: Application Configuration" { class SamplingOptions { + temperature: float = 1.0F @@ -167,12 +169,10 @@ package "Domain: Application Configuration" { + pipeline: PipelineOptions } - ' --- Domain Model Relationships --- ApplicationOptions *-- GeneratorOptions ApplicationOptions *-- PipelineOptions GeneratorOptions o-- SamplingOptions } -@endum package "Domain: Policy" { @@ -275,33 +275,29 @@ package "Infrastructure: Logging" { + level : LogLevel + phase : PipelinePhase + message : std::string - + city : std::optional - + entity_id : std::optional + worker : std::optional } - interface Logger <> { - + Log(level, phase, message,\n city, entity_id, worker) : void + interface ILogger <> { + + Log(entry : const LogEntry&) : void } - class PipelineLogger { - - log_ch_ : BoundedChannel& - + Log(level, phase, message,\n city, entity_id, worker) : void + class LogProducer { + - channel_ : BoundedChannel& + + Log(entry : const LogEntry&) : void } - class LogWorker { - - log_ch_ : BoundedChannel& + class LogDispatcher { + - channel_ : BoundedChannel& + Run() : void - - FormatTimestamp(tp) : std::string - ToSpdlogLevel(level) : spdlog::level::level_enum - - ToString(phase) : std::string } - ' --- Logging Relationships --- LogEntry *-- LogLevel LogEntry *-- PipelinePhase - PipelineLogger ..> LogEntry : emits - LogWorker ..> LogEntry : consumes + ILogger <|.. LogProducer + LogProducer ..> LogEntry : emits + LogDispatcher ..> LogEntry : consumes } package "Infrastructure: Pipeline Channel" { @@ -363,6 +359,22 @@ package "Infrastructure: Enrichment" { } +package "Infrastructure: Prompting" { + + interface IPromptDirectory <> { + + Load(key : std::string_view) : std::string + } + + class PromptDirectory { + - prompt_dir_ : std::filesystem::path + - cache_ : std::unordered_map + + PromptDirectory(prompt_dir : const std::filesystem::path&) + + Load(key : std::string_view) : std::string + } + + IPromptDirectory <|.. PromptDirectory +} + package "Infrastructure: Data Generation" { interface DataGenerator <> { @@ -386,6 +398,7 @@ package "Infrastructure: Data Generation" { - model_ : ModelHandle - context_ : ContextHandle - prompt_formatter_ : std::unique_ptr + - prompt_directory_ : std::unique_ptr - rng_ : std::mt19937 + GenerateBrewery(...) : BreweryResult + GenerateBeer(...) : BeerResult @@ -459,8 +472,6 @@ package "Infrastructure: Data Export" { } - - class BiergartenPipelineOrchestrator { - preloader_ : std::unique_ptr - enrichment_service_ : std::unique_ptr @@ -531,6 +542,7 @@ DateTimeProvider <|.. SystemDateTimeProvider WikipediaService *-- WebClient WikipediaService ..> ContextStrategy LlamaGenerator *-- PromptFormatter +LlamaGenerator *-- IPromptDirectory LlamaGenerator ..> GeneratorOptions SqliteExportService *-- DateTimeProvider