Refactor: move version.h from source_main to source_base#7611
Merged
mohanchen merged 1 commit intoJul 8, 2026
Merged
Conversation
version.h is a leaf header (a single VERSION macro) with no dependencies, but it lived in source_main (the top-level entry layer). This forced source_io to include upward into source_main (edge source_io -> source_main), a reverse dependency that violates the intended module layering. Move it to source_base (L0 infrastructure), which every module may depend on, and update the 6 include sites. No behavior change; header-only, so no CMake changes are needed (resolved via the existing source/ include root). This cuts the source_io -> source_main reverse edge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mohanchen
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
As part of an ongoing effort to clean up the dependency relationships between the
source_*modules (converging them toward a strictly-layered DAG where dependencies only point downward), this is a small, self-contained first step.source_main/version.his a leaf header containing only a single macro:Although it has no dependencies, it lived in
source_main— the top-level entry layer. This forcedsource_ioto#include "source_main/version.h", i.e. a lower/mid layer reaching upward into the entry layer. This is a reverse dependency (source_io -> source_main) that violates the intended layering.Change
version.hfromsource_main/tosource_base/(the L0 infrastructure layer that every module is allowed to depend on).source_main/version.h->source_base/version.h):main.cpp,driver.cpp,parse_args.cpp,module_json/general_info.cpp, and the two related unit tests.Notes
source/include root, exactly like every othersource_base/*.hinclude.source_io -> source_mainreverse edge.