From c0ffdb0ec7d338af4ea53c6adb8ec184406485cc Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Sun, 28 Jun 2026 13:07:14 -0400 Subject: [PATCH] style: update include guards and incl statements to follow google style guide --- .../pipeline/includes/biergarten_pipeline.h | 70 +++++++++++++++++++ .../biergarten_pipeline_orchestrator.h | 13 +--- .../includes/concurrency/bounded_channel.tcc | 2 +- .../data_generation/llama_generator.h | 5 +- tooling/pipeline/includes/data_model/models.h | 3 +- .../includes/json_handling/pretty_print.h | 5 +- .../database/sqlite_connection_helpers.h | 6 +- .../services/database/sqlite_export_service.h | 6 +- .../database/sqlite_export_service_helpers.h | 6 +- .../services/database/sqlite_handle_types.h | 4 +- .../database/sqlite_statement_helpers.h | 56 ++++++++------- .../services/enrichment/mock_enrichment.h | 2 +- .../services/enrichment/wikipedia_service.h | 2 +- .../includes/services/logging/log_producer.h | 6 +- .../includes/web_client/http_web_client.h | 2 +- .../biergarten_pipeline_orchestrator.cc | 13 ++-- .../generate_users.cc | 36 +++++----- .../log_results.cc | 5 +- .../src/data_generation/llama/helpers.cc | 6 +- .../src/data_generation/llama/infer.cc | 3 +- .../data_generation/llama/llama_generator.cc | 3 +- .../src/data_generation/llama/load.cc | 5 +- .../pipeline/src/json_handling/json_loader.cc | 4 +- tooling/pipeline/src/main.cc | 65 ++++++----------- .../enrichment/wikipedia/fetch_extract.cc | 3 +- .../src/services/logging/log_dispatcher.cc | 4 +- .../helpers/sqlite_statement_helpers.cc | 3 +- .../src/web_client/http_web_client.cc | 4 +- 28 files changed, 199 insertions(+), 143 deletions(-) create mode 100644 tooling/pipeline/includes/biergarten_pipeline.h diff --git a/tooling/pipeline/includes/biergarten_pipeline.h b/tooling/pipeline/includes/biergarten_pipeline.h new file mode 100644 index 0000000..869afb3 --- /dev/null +++ b/tooling/pipeline/includes/biergarten_pipeline.h @@ -0,0 +1,70 @@ +#ifndef BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_PIPELINE_H_ +#define BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_PIPELINE_H_ + +/** + * @file biergarten_pipeline.h + * @brief Master umbrella header — includes every public header in the + * Biergarten pipeline. + */ + +// --- orchestrator --- +#include "biergarten_pipeline_orchestrator.h" + +// --- concurrency --- +#include "concurrency/bounded_channel.h" + +// --- data_generation --- +#include "data_generation/data_generator.h" +#include "data_generation/json_grammars.h" +#include "data_generation/llama_generator.h" +#include "data_generation/llama_generator_helpers.h" +#include "data_generation/mock_generator.h" +#include "data_generation/prompt_formatting/gemma4_jinja_prompt_formatter.h" +#include "data_generation/prompt_formatting/prompt_formatter.h" + +// --- data_model --- +#include "data_model/generated_models.h" +#include "data_model/models.h" +#include "data_model/names_by_country.h" + +// --- json_handling --- +#include "json_handling/json_loader.h" +#include "json_handling/pretty_print.h" + +// --- llama backend --- +#include "llama_backend_state.h" + +// --- services: curated_data --- +#include "services/curated_data/curated_data_service.h" + +// --- services: database --- +#include "services/database/export_service.h" +#include "services/database/sqlite_connection_helpers.h" +#include "services/database/sqlite_export_service.h" +#include "services/database/sqlite_export_service_helpers.h" +#include "services/database/sqlite_handle_types.h" +#include "services/database/sqlite_statement_helpers.h" + +// --- services: datetime --- +#include "services/datetime/date_time_provider.h" +#include "services/datetime/timer.h" + +// --- services: enrichment --- +#include "services/enrichment/enrichment_service.h" +#include "services/enrichment/mock_enrichment.h" +#include "services/enrichment/wikipedia_service.h" + +// --- services: logging --- +#include "services/logging/log_dispatcher.h" +#include "services/logging/log_entry.h" +#include "services/logging/log_producer.h" +#include "services/logging/logger.h" + +// --- services: prompting --- +#include "services/prompting/prompt_directory.h" + +// --- web_client --- +#include "web_client/http_web_client.h" +#include "web_client/web_client.h" + +#endif // BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_PIPELINE_H_ diff --git a/tooling/pipeline/includes/biergarten_pipeline_orchestrator.h b/tooling/pipeline/includes/biergarten_pipeline_orchestrator.h index 5833b45..c65219a 100644 --- a/tooling/pipeline/includes/biergarten_pipeline_orchestrator.h +++ b/tooling/pipeline/includes/biergarten_pipeline_orchestrator.h @@ -1,12 +1,9 @@ -#ifndef BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_DATA_GENERATOR_H_ -#define BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_DATA_GENERATOR_H_ +#ifndef BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_PIPELINE_ORCHESTRATOR_H_ +#define BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_PIPELINE_ORCHESTRATOR_H_ /** * @file biergarten_pipeline_orchestrator.h * @brief Orchestration for end-to-end brewery and user data generation. - * - * Coordinates location loading, enrichment, and generation phases to produce - * a complete dataset, wiring dependencies selected at the composition root. */ #include @@ -103,10 +100,6 @@ class BiergartenPipelineOrchestrator { * @brief Generate users grounded in sampled names and personas for * enriched cities. * - * Loads personas.json / forenames-by-country.json / - * surnames-by-country.json itself, mirroring how QueryCitiesWithCountries() - * owns its own locations.json load. - * * @param cities Span of enriched city data. */ void GenerateUsers(std::span cities); @@ -120,4 +113,4 @@ class BiergartenPipelineOrchestrator { std::vector generated_users_; }; -#endif // BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_DATA_GENERATOR_H_ +#endif // BIERGARTEN_PIPELINE_INCLUDES_BIERGARTEN_PIPELINE_ORCHESTRATOR_H_ diff --git a/tooling/pipeline/includes/concurrency/bounded_channel.tcc b/tooling/pipeline/includes/concurrency/bounded_channel.tcc index 951bfbd..5345eb7 100644 --- a/tooling/pipeline/includes/concurrency/bounded_channel.tcc +++ b/tooling/pipeline/includes/concurrency/bounded_channel.tcc @@ -1,4 +1,4 @@ -#include "bounded_channel.h" +#include "concurrency/bounded_channel.h" template void BoundedChannel::Send(T item) { diff --git a/tooling/pipeline/includes/data_generation/llama_generator.h b/tooling/pipeline/includes/data_generation/llama_generator.h index 8a43681..7d4dadb 100644 --- a/tooling/pipeline/includes/data_generation/llama_generator.h +++ b/tooling/pipeline/includes/data_generation/llama_generator.h @@ -1,24 +1,23 @@ #ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_LLAMA_GENERATOR_H_ #define BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_LLAMA_GENERATOR_H_ -#include - /** * @file data_generation/llama_generator.h * @brief llama.cpp-backed implementation of DataGenerator. */ #include +#include #include #include #include #include -#include "../services/prompting/prompt_directory.h" #include "data_generation/data_generator.h" #include "data_generation/prompt_formatting/prompt_formatter.h" #include "data_model/models.h" #include "services/logging/logger.h" +#include "services/prompting/prompt_directory.h" struct llama_model; struct llama_context; diff --git a/tooling/pipeline/includes/data_model/models.h b/tooling/pipeline/includes/data_model/models.h index 6dcdb26..67d0104 100644 --- a/tooling/pipeline/includes/data_model/models.h +++ b/tooling/pipeline/includes/data_model/models.h @@ -7,7 +7,6 @@ * inputs. */ -#include #include #include #include @@ -16,6 +15,8 @@ #include #include +#include + class ILogger; namespace prog_opts = boost::program_options; diff --git a/tooling/pipeline/includes/json_handling/pretty_print.h b/tooling/pipeline/includes/json_handling/pretty_print.h index 51e7486..1e25b30 100644 --- a/tooling/pipeline/includes/json_handling/pretty_print.h +++ b/tooling/pipeline/includes/json_handling/pretty_print.h @@ -9,10 +9,11 @@ * readable output. Adapted from Boost JSON library examples. */ -#include #include #include +#include + /** * @brief Pretty-prints a JSON value to an output stream with indentation. * @@ -106,4 +107,4 @@ inline void PrettyPrint(std::ostream& outstream, } } -#endif +#endif // BIERGARTEN_PIPELINE_INCLUDES_JSON_HANDLING_PRETTY_PRINT_H_ diff --git a/tooling/pipeline/includes/services/database/sqlite_connection_helpers.h b/tooling/pipeline/includes/services/database/sqlite_connection_helpers.h index 1bb4832..231dac0 100644 --- a/tooling/pipeline/includes/services/database/sqlite_connection_helpers.h +++ b/tooling/pipeline/includes/services/database/sqlite_connection_helpers.h @@ -6,13 +6,13 @@ * @brief Declarations for connection-level SQLite helper functions. */ -#include - #include #include #include -#include "sqlite_handle_types.h" +#include + +#include "services/database/sqlite_handle_types.h" namespace sqlite_export_service_internal { diff --git a/tooling/pipeline/includes/services/database/sqlite_export_service.h b/tooling/pipeline/includes/services/database/sqlite_export_service.h index de16445..e5c4936 100644 --- a/tooling/pipeline/includes/services/database/sqlite_export_service.h +++ b/tooling/pipeline/includes/services/database/sqlite_export_service.h @@ -11,10 +11,10 @@ #include #include -#include "../datetime/date_time_provider.h" #include "data_model/models.h" -#include "export_service.h" -#include "sqlite_export_service_helpers.h" +#include "services/database/export_service.h" +#include "services/database/sqlite_export_service_helpers.h" +#include "services/datetime/date_time_provider.h" /** * @brief Persists generated brewery records into a fresh SQLite database. diff --git a/tooling/pipeline/includes/services/database/sqlite_export_service_helpers.h b/tooling/pipeline/includes/services/database/sqlite_export_service_helpers.h index 838d40e..3df35c0 100644 --- a/tooling/pipeline/includes/services/database/sqlite_export_service_helpers.h +++ b/tooling/pipeline/includes/services/database/sqlite_export_service_helpers.h @@ -3,8 +3,8 @@ /* Umbrella header for backward compatibility. */ -#include "sqlite_connection_helpers.h" -#include "sqlite_handle_types.h" -#include "sqlite_statement_helpers.h" +#include "services/database/sqlite_connection_helpers.h" +#include "services/database/sqlite_handle_types.h" +#include "services/database/sqlite_statement_helpers.h" #endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_HELPERS_H_ diff --git a/tooling/pipeline/includes/services/database/sqlite_handle_types.h b/tooling/pipeline/includes/services/database/sqlite_handle_types.h index dcc533b..fe83e98 100644 --- a/tooling/pipeline/includes/services/database/sqlite_handle_types.h +++ b/tooling/pipeline/includes/services/database/sqlite_handle_types.h @@ -5,11 +5,11 @@ * Shared handle and parameter type declarations used by SQLite helper units. */ -#include - #include #include +#include + namespace sqlite_export_service_internal { struct SqliteDatabaseDeleter { diff --git a/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h b/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h index 1e7b874..fd88e0d 100644 --- a/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h +++ b/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h @@ -7,13 +7,13 @@ * constants. */ -#include - #include #include #include -#include "sqlite_handle_types.h" +#include + +#include "services/database/sqlite_handle_types.h" namespace sqlite_export_service_internal { @@ -109,30 +109,36 @@ INSERT INTO users ( // sqlite3_bind_*() parameter indices are 1-based, matching the "?" // placeholder order in the SQL above. -inline constexpr int kLocationCityBindIndex = 1; -inline constexpr int kLocationStateProvinceBindIndex = 2; -inline constexpr int kLocationIso31662BindIndex = 3; -inline constexpr int kLocationCountryBindIndex = 4; -inline constexpr int kLocationIso31661BindIndex = 5; -inline constexpr int kLocationLanguagesBindIndex = 6; -inline constexpr int kLocationLatitudeBindIndex = 7; -inline constexpr int kLocationLongitudeBindIndex = 8; +enum eLocationBindIndex { + kLocationCityBindIndex = 1, + kLocationStateProvinceBindIndex, + kLocationIso31662BindIndex, + kLocationCountryBindIndex, + kLocationIso31661BindIndex, + kLocationLanguagesBindIndex, + kLocationLatitudeBindIndex, + kLocationLongitudeBindIndex, +}; -inline constexpr int kBreweryLocationIdBindIndex = 1; -inline constexpr int kBreweryEnglishNameBindIndex = 2; -inline constexpr int kBreweryEnglishDescriptionBindIndex = 3; -inline constexpr int kBreweryLocalNameBindIndex = 4; -inline constexpr int kBreweryLocalDescriptionBindIndex = 5; +enum BreweryBindIndex { + kBreweryLocationIdBindIndex = 1, + kBreweryEnglishNameBindIndex, + kBreweryEnglishDescriptionBindIndex, + kBreweryLocalNameBindIndex, + kBreweryLocalDescriptionBindIndex, +}; -inline constexpr int kUserLocationIdBindIndex = 1; -inline constexpr int kUserFirstNameBindIndex = 2; -inline constexpr int kUserLastNameBindIndex = 3; -inline constexpr int kUserGenderBindIndex = 4; -inline constexpr int kUserUsernameBindIndex = 5; -inline constexpr int kUserBioBindIndex = 6; -inline constexpr int kUserActivityWeightBindIndex = 7; -inline constexpr int kUserEmailBindIndex = 8; -inline constexpr int kUserDateOfBirthBindIndex = 9; +enum UserBindIndex { + kUserLocationIdBindIndex = 1, + kUserFirstNameBindIndex, + kUserLastNameBindIndex, + kUserGenderBindIndex, + kUserUsernameBindIndex, + kUserBioBindIndex, + kUserActivityWeightBindIndex, + kUserEmailBindIndex, + kUserDateOfBirthBindIndex, +}; SqliteStatementHandle PrepareStatement(const SqliteDatabaseHandle& db_handle, std::string_view sql, diff --git a/tooling/pipeline/includes/services/enrichment/mock_enrichment.h b/tooling/pipeline/includes/services/enrichment/mock_enrichment.h index 6d527eb..9a45b3f 100644 --- a/tooling/pipeline/includes/services/enrichment/mock_enrichment.h +++ b/tooling/pipeline/includes/services/enrichment/mock_enrichment.h @@ -8,7 +8,7 @@ #include -#include "enrichment_service.h" +#include "services/enrichment/enrichment_service.h" /** * @brief Enrichment service that returns no context for any location. diff --git a/tooling/pipeline/includes/services/enrichment/wikipedia_service.h b/tooling/pipeline/includes/services/enrichment/wikipedia_service.h index 6dc5c4b..1063aea 100644 --- a/tooling/pipeline/includes/services/enrichment/wikipedia_service.h +++ b/tooling/pipeline/includes/services/enrichment/wikipedia_service.h @@ -11,7 +11,7 @@ #include #include -#include "enrichment_service.h" +#include "services/enrichment/enrichment_service.h" #include "services/logging/logger.h" #include "web_client/web_client.h" diff --git a/tooling/pipeline/includes/services/logging/log_producer.h b/tooling/pipeline/includes/services/logging/log_producer.h index d032f89..253c016 100644 --- a/tooling/pipeline/includes/services/logging/log_producer.h +++ b/tooling/pipeline/includes/services/logging/log_producer.h @@ -6,8 +6,8 @@ * a bounded channel for later processing by the dispatcher. */ -#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_ -#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_ +#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOG_PRODUCER_H_ +#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOG_PRODUCER_H_ #include @@ -50,4 +50,4 @@ class LogProducer final : public ILogger { BoundedChannel& channel_; }; -#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_ +#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOG_PRODUCER_H_ diff --git a/tooling/pipeline/includes/web_client/http_web_client.h b/tooling/pipeline/includes/web_client/http_web_client.h index 883b56b..48306e5 100644 --- a/tooling/pipeline/includes/web_client/http_web_client.h +++ b/tooling/pipeline/includes/web_client/http_web_client.h @@ -52,4 +52,4 @@ class HttpWebClient final : public WebClient { std::shared_ptr logger_; }; -#endif +#endif // BIERGARTEN_PIPELINE_INCLUDES_WEB_CLIENT_HTTP_WEB_CLIENT_H_ diff --git a/tooling/pipeline/src/biergarten_pipeline_orchestrator/biergarten_pipeline_orchestrator.cc b/tooling/pipeline/src/biergarten_pipeline_orchestrator/biergarten_pipeline_orchestrator.cc index 7fa70e7..eae518a 100644 --- a/tooling/pipeline/src/biergarten_pipeline_orchestrator/biergarten_pipeline_orchestrator.cc +++ b/tooling/pipeline/src/biergarten_pipeline_orchestrator/biergarten_pipeline_orchestrator.cc @@ -14,10 +14,9 @@ BiergartenPipelineOrchestrator::BiergartenPipelineOrchestrator( std::unique_ptr exporter, std::unique_ptr curated_data_service, const ApplicationOptions& application_options) - : logger_(std::move(logger)), - context_service_(std::move(context_service)), - generator_(std::move(generator)), - exporter_(std::move(exporter)), - curated_data_service_(std::move(curated_data_service)), - application_options_(application_options) { -} \ No newline at end of file + : logger_(std::move(logger)), + context_service_(std::move(context_service)), + generator_(std::move(generator)), + exporter_(std::move(exporter)), + curated_data_service_(std::move(curated_data_service)), + application_options_(application_options) {} \ No newline at end of file diff --git a/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc b/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc index 3592d86..1847a6d 100644 --- a/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc +++ b/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc @@ -24,7 +24,7 @@ std::string Sanitize(std::string_view value) { for (const char character : value) { if (std::isalnum(static_cast(character)) != 0) { out.push_back(static_cast( - std::tolower(static_cast(character)))); + std::tolower(static_cast(character)))); } } return out; @@ -69,7 +69,7 @@ std::string GenerateDateOfBirth(std::mt19937& rng) { static_cast(birth_ymd.month()), static_cast(birth_ymd.day())); } -} // namespace +} // namespace void BiergartenPipelineOrchestrator::GenerateUsers( std::span cities) { @@ -86,8 +86,8 @@ void BiergartenPipelineOrchestrator::GenerateUsers( } const NamesByCountry names_by_country = - curated_data_service_->LoadNamesByCountry( - "forenames-by-country.json", "surnames-by-country.json"); + curated_data_service_->LoadNamesByCountry("forenames-by-country.json", + "surnames-by-country.json"); std::mt19937 rng(std::random_device{}()); std::uniform_int_distribution persona_dist(0, personas.size() - 1); @@ -98,8 +98,8 @@ void BiergartenPipelineOrchestrator::GenerateUsers( const auto generate_record = [this, &rng, &skipped_count]( - const EnrichedCity& city, const UserPersona& persona, - const Name& sampled_name) -> std::optional { + const EnrichedCity& city, const UserPersona& persona, + const Name& sampled_name) -> std::optional { try { std::unordered_set used_email_local_parts; @@ -125,19 +125,19 @@ void BiergartenPipelineOrchestrator::GenerateUsers( }; const auto export_record = [this, - &export_failed_count](const UserRecord& record) { + &export_failed_count](const UserRecord& record) { try { exporter_->ProcessRecord(record); } catch (const std::exception& export_exception) { ++export_failed_count; logger_->Log( - {.level = LogLevel::Warn, - .phase = PipelinePhase::UserGeneration, - .message = std::format("[Pipeline] Generated user for '{}' ({}) but " - "SQLite export failed: {}", - record.location.city, record.location.country, - export_exception.what())}); + {.level = LogLevel::Warn, + .phase = PipelinePhase::UserGeneration, + .message = std::format("[Pipeline] Generated user for '{}' ({}) but " + "SQLite export failed: {}", + record.location.city, record.location.country, + export_exception.what())}); } }; @@ -171,11 +171,11 @@ void BiergartenPipelineOrchestrator::GenerateUsers( if (skipped_count > 0) { logger_->Log( - {.level = LogLevel::Warn, - .phase = PipelinePhase::UserGeneration, - .message = std::format( - "[Pipeline] Skipped {} city/cities during user generation", - skipped_count)}); + {.level = LogLevel::Warn, + .phase = PipelinePhase::UserGeneration, + .message = std::format( + "[Pipeline] Skipped {} city/cities during user generation", + skipped_count)}); } if (export_failed_count > 0) { diff --git a/tooling/pipeline/src/biergarten_pipeline_orchestrator/log_results.cc b/tooling/pipeline/src/biergarten_pipeline_orchestrator/log_results.cc index ca51601..9a1626e 100644 --- a/tooling/pipeline/src/biergarten_pipeline_orchestrator/log_results.cc +++ b/tooling/pipeline/src/biergarten_pipeline_orchestrator/log_results.cc @@ -3,12 +3,13 @@ * @brief BiergartenPipelineOrchestrator::LogResults() implementation. */ -#include #include #include -#include "../../includes/json_handling/pretty_print.h" +#include + #include "biergarten_pipeline_orchestrator.h" +#include "json_handling/pretty_print.h" #include "services/logging/logger.h" void BiergartenPipelineOrchestrator::LogResults() const { diff --git a/tooling/pipeline/src/data_generation/llama/helpers.cc b/tooling/pipeline/src/data_generation/llama/helpers.cc index 17f6623..5a4e575 100644 --- a/tooling/pipeline/src/data_generation/llama/helpers.cc +++ b/tooling/pipeline/src/data_generation/llama/helpers.cc @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -15,8 +14,11 @@ #include #include +#include +#include + #include "data_generation/llama_generator_helpers.h" -#include "llama.h" + namespace { /** * String trimming: removes leading and trailing whitespace diff --git a/tooling/pipeline/src/data_generation/llama/infer.cc b/tooling/pipeline/src/data_generation/llama/infer.cc index fd9f2ee..53f417f 100644 --- a/tooling/pipeline/src/data_generation/llama/infer.cc +++ b/tooling/pipeline/src/data_generation/llama/infer.cc @@ -14,9 +14,10 @@ #include #include +#include + #include "data_generation/llama_generator.h" #include "data_generation/llama_generator_helpers.h" -#include "llama.h" static constexpr size_t kPromptTokenSlack = 8; // Minimum tokens to keep when using top-p sampling. Ensures at least one diff --git a/tooling/pipeline/src/data_generation/llama/llama_generator.cc b/tooling/pipeline/src/data_generation/llama/llama_generator.cc index cc095dd..3dd61ed 100644 --- a/tooling/pipeline/src/data_generation/llama/llama_generator.cc +++ b/tooling/pipeline/src/data_generation/llama/llama_generator.cc @@ -11,8 +11,9 @@ #include #include +#include + #include "data_model/models.h" -#include "llama.h" static constexpr uint32_t kMaxContextSize = 32768U; diff --git a/tooling/pipeline/src/data_generation/llama/load.cc b/tooling/pipeline/src/data_generation/llama/load.cc index 1866b2a..d5a3308 100644 --- a/tooling/pipeline/src/data_generation/llama/load.cc +++ b/tooling/pipeline/src/data_generation/llama/load.cc @@ -10,9 +10,10 @@ #include #include +#include +#include + #include "data_generation/llama_generator.h" -#include "ggml-backend.h" -#include "llama.h" // Maximum batch size for decode operations. Capping the batch prevents // excessive memory allocation while maintaining inference performance. diff --git a/tooling/pipeline/src/json_handling/json_loader.cc b/tooling/pipeline/src/json_handling/json_loader.cc index d279b57..91ef9e2 100644 --- a/tooling/pipeline/src/json_handling/json_loader.cc +++ b/tooling/pipeline/src/json_handling/json_loader.cc @@ -6,7 +6,6 @@ #include "json_handling/json_loader.h" -#include #include #include #include @@ -17,6 +16,8 @@ #include #include +#include + #include "services/logging/logger.h" static std::string ReadRequiredString(const boost::json::object& object, @@ -137,7 +138,6 @@ std::vector JsonLoader::LoadLocations( .longitude = ReadRequiredNumber(object, "longitude"), }); } - return locations; } diff --git a/tooling/pipeline/src/main.cc b/tooling/pipeline/src/main.cc index eb06e36..923f8db 100644 --- a/tooling/pipeline/src/main.cc +++ b/tooling/pipeline/src/main.cc @@ -4,11 +4,6 @@ * initializes shared infrastructure, and executes the pipeline entry flow. */ -#include -#include - -#include -#include #include #include #include @@ -18,27 +13,12 @@ #include #include -#include "biergarten_pipeline_orchestrator.h" -#include "concurrency/bounded_channel.h" -#include "data_generation/llama_generator.h" -#include "data_generation/mock_generator.h" -#include "data_generation/prompt_formatting/gemma4_jinja_prompt_formatter.h" -#include "data_model/models.h" -#include "json_handling/json_loader.h" -#include "llama_backend_state.h" -#include "services/curated_data/curated_data_service.h" -#include "services/database/export_service.h" -#include "services/database/sqlite_export_service.h" -#include "services/datetime/timer.h" -#include "services/enrichment/enrichment_service.h" -#include "services/enrichment/mock_enrichment.h" -#include "services/enrichment/wikipedia_service.h" -#include "services/logging/log_dispatcher.h" -#include "services/logging/log_entry.h" -#include "services/logging/log_producer.h" -#include "services/logging/logger.h" -#include "services/prompting/prompt_directory.h" -#include "web_client/http_web_client.h" +#include +#include +#include +#include + +#include "biergarten_pipeline.h" namespace di = boost::di; @@ -49,7 +29,7 @@ int main(const int argc, char** argv) { spdlog::set_pattern("│ %Y-%m-%d %H:%M:%S.%e │ %^%-7l%$ │ %v"); BoundedChannel log_channel(kLogMaxCount); - auto log_dispatcher = // + auto log_dispatcher = // std::make_unique(log_channel); std::shared_ptr log_producer = std::make_shared(log_channel); @@ -111,17 +91,17 @@ int main(const int argc, char** argv) { if (options.generator.use_mocked) { { log_producer->Log( - {.level = LogLevel::Info, - .phase = PipelinePhase::Startup, - .message = "Prompt formatter: none (mock mode)"}); + {.level = LogLevel::Info, + .phase = PipelinePhase::Startup, + .message = "Prompt formatter: none (mock mode)"}); } return std::unique_ptr(nullptr); } { log_producer->Log( - {.level = LogLevel::Info, - .phase = PipelinePhase::Startup, - .message = "Prompt formatter: Gemma4JinjaPromptFormatter"}); + {.level = LogLevel::Info, + .phase = PipelinePhase::Startup, + .message = "Prompt formatter: Gemma4JinjaPromptFormatter"}); } return std::unique_ptr( std::make_unique()); @@ -145,7 +125,7 @@ int main(const int argc, char** argv) { }), di::bind().to( [options, &log_producer]( - const auto& inj) -> std::unique_ptr { + const auto& inj) -> std::unique_ptr { if (options.generator.use_mocked) { log_producer->Log({.level = LogLevel::Info, .phase = PipelinePhase::Startup, @@ -164,8 +144,7 @@ int main(const int argc, char** argv) { }), di::bind().to( [&options, &model_path, &sampling, &prompt_directory, - &log_producer - ](const auto& inj) -> std::unique_ptr { + &log_producer](const auto& inj) -> std::unique_ptr { if (options.generator.use_mocked) { log_producer->Log({.level = LogLevel::Info, .phase = PipelinePhase::Startup, @@ -175,13 +154,13 @@ int main(const int argc, char** argv) { } log_producer->Log( - {.level = LogLevel::Info, - .phase = PipelinePhase::Startup, - .message = std::format( - "Generator: LlamaGenerator | model={} | " - "temp={:.2f} top_p={:.2f} top_k={} n_ctx={} seed={}", - model_path, sampling.temperature, sampling.top_p, - sampling.top_k, sampling.n_ctx, sampling.seed)}); + {.level = LogLevel::Info, + .phase = PipelinePhase::Startup, + .message = std::format( + "Generator: LlamaGenerator | model={} | " + "temp={:.2f} top_p={:.2f} top_k={} n_ctx={} seed={}", + model_path, sampling.temperature, sampling.top_p, + sampling.top_k, sampling.n_ctx, sampling.seed)}); return std::make_unique( options, model_path, log_producer, diff --git a/tooling/pipeline/src/services/enrichment/wikipedia/fetch_extract.cc b/tooling/pipeline/src/services/enrichment/wikipedia/fetch_extract.cc index 9bc5305..65dd5af 100644 --- a/tooling/pipeline/src/services/enrichment/wikipedia/fetch_extract.cc +++ b/tooling/pipeline/src/services/enrichment/wikipedia/fetch_extract.cc @@ -3,13 +3,14 @@ * @brief WikipediaEnrichmentService::FetchExtract() implementation. */ -#include #include #include #include #include #include +#include + #include "services/enrichment/wikipedia_service.h" using namespace boost; diff --git a/tooling/pipeline/src/services/logging/log_dispatcher.cc b/tooling/pipeline/src/services/logging/log_dispatcher.cc index f9e8308..e093edb 100644 --- a/tooling/pipeline/src/services/logging/log_dispatcher.cc +++ b/tooling/pipeline/src/services/logging/log_dispatcher.cc @@ -6,10 +6,10 @@ */ #include "services/logging/log_dispatcher.h" -#include - #include +#include + #include "concurrency/bounded_channel.h" #include "services/logging/log_entry.h" diff --git a/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cc b/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cc index 15ef25e..427de22 100644 --- a/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cc +++ b/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cc @@ -1,11 +1,12 @@ #include "services/database/sqlite_statement_helpers.h" -#include #include #include #include #include +#include + #include "services/database/sqlite_connection_helpers.h" namespace sqlite_export_service_internal { diff --git a/tooling/pipeline/src/web_client/http_web_client.cc b/tooling/pipeline/src/web_client/http_web_client.cc index b0910ff..6ea3ef7 100644 --- a/tooling/pipeline/src/web_client/http_web_client.cc +++ b/tooling/pipeline/src/web_client/http_web_client.cc @@ -5,8 +5,6 @@ #include "web_client/http_web_client.h" -#include - #include #include #include @@ -14,6 +12,8 @@ #include #include +#include + #include "services/logging/logger.h" namespace {