Skip to content

Allow drivers to access configured sources#658

Open
knoepfel wants to merge 9 commits into
Framework-R-D:mainfrom
knoepfel:update-hierarchy
Open

Allow drivers to access configured sources#658
knoepfel wants to merge 9 commits into
Framework-R-D:mainfrom
knoepfel:update-hierarchy

Conversation

@knoepfel

@knoepfel knoepfel commented Jun 23, 2026

Copy link
Copy Markdown
Member

Motivation

This PR updates deferred driver configuration so drivers can consume configured sources in a type-safe way and so driver-builder APIs are expressed with clearer concepts.

What Changed

Driver Function Concepts

  • Added is_driver_like_with_sources<F, FirstArg> to model driver callables that:
    • are invocable with a first argument (data_cell_cursor or data_cell_yielder), and
    • have trailing parameters derived from phlex::experimental::source.
  • Reused this for:
    • is_driver_like_with_cursor
    • is_driver_like_with_yielder
  • Updated is_driver_builder_like to require that driver_function() satisfies either is_driver_like_with_cursor or is_driver_like_with_yielder.

driver_proxy Source-Aware Invocation

  • driver_proxy now invokes user driver functions with typed source parameters resolved from configured sources.
  • Added detail::invoke_driver_with_sources and as_driver_source:
    • Source parameters are expanded via index-sequence machinery.
    • Runtime type mismatch reports expected/actual demangled types and source index.
  • Added source-count validation between declared driver source parameters and configured sources.
  • Empty builder check throws:
    • Cannot configure driver with an empty driver_builder.

Deferred Driver Wiring in framework_graph

  • Deferred mode requires explicit driver registration before execute().
  • Driver registration supports both:
    • direct driver_bundle, and
    • builder objects exposing hierarchy() and driver_function().

Layer Generator Integration

  • layer_generator is used through shared ownership (make() factory) and exposes driver_function() for graph driver registration.

Tests

  • Added/updated coverage for:
    • source-count mismatch for driver function parameters,
    • null driver builder handling,
    • source type mismatch diagnostics,
    • successful typed source injection into driver functions.
  • Updated wording checks to match current exception text (empty driver_builder).

@knoepfel knoepfel added this to the Prototype 0.3 milestone Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7e1ff28f-fdbc-4383-8b4c-42ca39581297

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

framework_graph replaces direct constructor-based driver injection with with_default_driver()/with_deferred_driver() factory methods and an explicit set_driver() call, storing the driver as std::optional. driver_proxy gains source-typed parameter dispatch via metaprogramming. layer_generator becomes a shared_ptr factory. fixed_hierarchy gains deduplication and update(). All tests and app wiring are migrated to the new API.

Changes

Deferred Driver Configuration

Layer / File(s) Summary
source_vector type and node_catalog::sources_for
phlex/core/source.hpp, phlex/core/node_catalog.hpp, phlex/core/node_catalog.cpp
Introduces source_vector (std::vector<source const*>) type alias and adds sources_for(vector<string>) to node_catalog for name-based source lookup consumed by driver_proxy.
fixed_hierarchy deduplication and update()
phlex/model/fixed_hierarchy.hpp, phlex/model/fixed_hierarchy.cpp, test/fixed_hierarchy_test.cpp
Adds unique_paths helper to deduplicate on construction, updates convert_vector_vector_string to use it, and introduces fixed_hierarchy::update() to union-merge additional paths post-construction; backed by three new test cases.
driver_proxy source-typed dispatch and generator concept
phlex/driver.hpp
Adds detail::invoke_driver_with_sources (index-sequence + dynamic_cast unpacking), source parameter type traits, is_driver_like_with_sources concept, redefines cursor/yielder concepts, adds is_driver_generator_like, and refactors driver_proxy::driver() overloads to use a private make_driver_bundle helper with source unpacking; adds generator overload rejecting null input.
layer_generator factory pattern and driver_function()
plugins/layer_generator.hpp, plugins/layer_generator.cpp, plugins/generate_layers.cpp
Moves layer_generator() constructor to private, adds [[nodiscard]] static make() returning shared_ptr<layer_generator>, implements driver_function() returning a yielder callable over indices(), removes driver_for_test(), and simplifies generate_layers.cpp to call d.driver(std::move(gen)).
framework_graph driver_mode, factory methods, optional driver, and set_driver()
phlex/core/framework_graph.hpp, phlex/core/framework_graph.cpp
Adds driver_mode enum, replaces old constructors with with_default_driver()/with_deferred_driver() factories, changes driver_ to std::optional<framework_driver>, adds driver_mode_ member, implements set_driver(driver_bundle) with three-way validation (wrong mode, already set, empty), adds templated set_driver(shared_ptr<Generator>) and driver_proxy(vector<string>) helper; execute() throws when no driver is configured and calls driver_->stop() in exception paths.
load_driver and run.cpp app wiring
phlex/app/load_module.hpp, phlex/app/load_module.cpp, phlex/app/run.cpp
load_driver signature changes to void(framework_graph&, config), reads optional uses_sources, constructs the driver via g.driver_proxy(required_sources) and registers it with g.set_driver(). run() now calls with_deferred_driver() then load_driver(g, driver_config) as a two-step initialization.
Test migration to new API
test/framework_graph.cpp, test/layer_generator.cpp, test/filter.cpp, test/fold.cpp, test/provider_test.cpp, test/...
All test files migrated from layer_generator stack allocation + driver_for_test() + direct framework_graph constructor to layer_generator::make(), with_deferred_driver()/with_default_driver(), and g.set_driver(gen). New framework_graph tests cover: executing without a driver throws, late set_driver after wiring is valid, and double set_driver throws.

Sequence Diagram

sequenceDiagram
    participant run as phlex::run()
    participant load_driver as load_driver()
    participant framework_graph as framework_graph
    participant driver_proxy as driver_proxy
    participant layer_generator as layer_generator

    run->>framework_graph: with_deferred_driver(max_parallelism)
    framework_graph-->>run: g (driver_ empty, mode=deferred)
    run->>load_driver: load_driver(g, driver_config)
    load_driver->>framework_graph: g.driver_proxy(required_sources)
    framework_graph->>driver_proxy: driver_proxy(sources_for(required_sources))
    driver_proxy-->>load_driver: d
    load_driver->>driver_proxy: d.driver(generator) or d.driver(hierarchy, fn)
    driver_proxy->>driver_proxy: make_driver_bundle / invoke_driver_with_sources
    driver_proxy-->>load_driver: driver_bundle result
    load_driver->>framework_graph: g.set_driver(result)
    framework_graph->>framework_graph: validate mode + not-yet-set + non-empty, store driver_

    Note over run,framework_graph: Providers and observers are wired after this point

    run->>framework_graph: g.execute()
    framework_graph->>framework_graph: assert driver_ configured
    framework_graph->>layer_generator: driver_() — pull data cells via yielder
    layer_generator-->>framework_graph: data_cell_index stream
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • greenc-FNAL
  • marcpaterno
  • sabasehrish
  • wwuoneway
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Allow drivers to access configured sources' directly describes the core change: extending the driver API to enable drivers to work with configured source data, which is reflected throughout the refactored load_driver, framework_graph, driver_proxy, and test updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@greenc-FNAL

greenc-FNAL commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

21 fixed, 0 new since branch point (0de5b7b)
21 fixed, 0 new since previous report on PR (a1eb67e)

✅ 21 CodeQL alerts resolved since the previous PR commit

  • Warning # 196 actions/untrusted-checkout-toctou/critical at .github/workflows/clang-tidy-fix.yaml:109:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 227 actions/untrusted-checkout-toctou/high at .github/workflows/clang-format-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 228 actions/untrusted-checkout-toctou/high at .github/workflows/python-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 229 actions/untrusted-checkout/high at .github/workflows/clang-format-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 230 actions/untrusted-checkout/high at .github/workflows/python-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 231 actions/untrusted-checkout-toctou/high at .github/workflows/cmake-format-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 232 actions/untrusted-checkout-toctou/high at .github/workflows/jsonnet-format-fix.yaml:95:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 233 actions/untrusted-checkout/high at .github/workflows/cmake-format-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 234 actions/untrusted-checkout/high at .github/workflows/jsonnet-format-fix.yaml:95:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 235 actions/untrusted-checkout/medium at .github/workflows/clang-format-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 236 actions/untrusted-checkout/medium at .github/workflows/actionlint-check.yaml:86:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 237 actions/untrusted-checkout/medium at .github/workflows/clang-tidy-check.yaml:59:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 238 actions/untrusted-checkout/medium at .github/workflows/cmake-format-check.yaml:79:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 239 actions/untrusted-checkout/medium at .github/workflows/cmake-build.yaml:159:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 240 actions/untrusted-checkout/medium at .github/workflows/header-guards-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 241 actions/untrusted-checkout/medium at .github/workflows/jsonnet-format-check.yaml:79:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 242 actions/untrusted-checkout/medium at .github/workflows/markdown-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 243 actions/untrusted-checkout/medium at .github/workflows/python-check.yaml:84:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 244 actions/untrusted-checkout/medium at .github/workflows/yaml-check.yaml:76:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 245 actions/untrusted-checkout-toctou/high at .github/workflows/coverage.yaml:386:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • ✅ …and 1 more alerts (see Code Scanning for the full list).

✅ 21 CodeQL alerts resolved since the branch point

  • Warning # 196 actions/untrusted-checkout-toctou/critical at .github/workflows/clang-tidy-fix.yaml:109:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 227 actions/untrusted-checkout-toctou/high at .github/workflows/clang-format-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 228 actions/untrusted-checkout-toctou/high at .github/workflows/python-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 229 actions/untrusted-checkout/high at .github/workflows/clang-format-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 230 actions/untrusted-checkout/high at .github/workflows/python-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 231 actions/untrusted-checkout-toctou/high at .github/workflows/cmake-format-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 232 actions/untrusted-checkout-toctou/high at .github/workflows/jsonnet-format-fix.yaml:95:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 233 actions/untrusted-checkout/high at .github/workflows/cmake-format-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 234 actions/untrusted-checkout/high at .github/workflows/jsonnet-format-fix.yaml:95:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 235 actions/untrusted-checkout/medium at .github/workflows/clang-format-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 236 actions/untrusted-checkout/medium at .github/workflows/actionlint-check.yaml:86:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 237 actions/untrusted-checkout/medium at .github/workflows/clang-tidy-check.yaml:59:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 238 actions/untrusted-checkout/medium at .github/workflows/cmake-format-check.yaml:79:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 239 actions/untrusted-checkout/medium at .github/workflows/cmake-build.yaml:159:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 240 actions/untrusted-checkout/medium at .github/workflows/header-guards-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 241 actions/untrusted-checkout/medium at .github/workflows/jsonnet-format-check.yaml:79:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 242 actions/untrusted-checkout/medium at .github/workflows/markdown-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 243 actions/untrusted-checkout/medium at .github/workflows/python-check.yaml:84:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 244 actions/untrusted-checkout/medium at .github/workflows/yaml-check.yaml:76:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 245 actions/untrusted-checkout-toctou/high at .github/workflows/coverage.yaml:386:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • ✅ …and 1 more alerts (see Code Scanning for the full list).

Review the full CodeQL report for details.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@phlex/core/framework_graph.hpp`:
- Around line 79-83: The driver_proxy method currently forwards the result of
nodes_.sources_for(strings) directly without validating that all requested
source names were actually resolved, which can cause unresolved keys to be
silently dropped and lead to incorrect positional source binding or runtime
failures. Add validation logic within the driver_proxy method to check that the
collection returned by nodes_.sources_for(strings) contains exactly the number
of sources corresponding to the requested strings, and raise an error or
exception if any source names failed to resolve before constructing and
returning the experimental::driver_proxy object.

In `@phlex/core/node_catalog.cpp`:
- Around line 62-65: The sources_for() function silently skips missing source
keys in the loop instead of failing when a configured source name cannot be
found. Modify the conditional logic in the loop over keys so that when
sources.get(key) returns null or empty for any key, throw an exception with a
descriptive error message indicating which source name is missing, rather than
just skipping it with the if statement. This ensures configuration errors are
caught immediately instead of silently dropping unknown source names.

In `@phlex/driver.hpp`:
- Around line 114-128: The driver method that accepts a Generator parameter
needs to validate that no sources have been configured, similar to how the
function-driver overload validates this. Add a validation check at the beginning
of the driver method (before the null generator check) to ensure that sources_
is empty, and throw an std::invalid_argument exception with an appropriate
message if sources have been configured, since generator-style drivers do not
consume sources and would silently drop any configured source list.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 36736741-8fb2-4555-a748-33dea01f4754

📥 Commits

Reviewing files that changed from the base of the PR and between a98ac3d and a08a772.

📒 Files selected for processing (34)
  • phlex/app/load_module.cpp
  • phlex/app/load_module.hpp
  • phlex/app/run.cpp
  • phlex/core/framework_graph.cpp
  • phlex/core/framework_graph.hpp
  • phlex/core/node_catalog.cpp
  • phlex/core/node_catalog.hpp
  • phlex/core/source.hpp
  • phlex/driver.hpp
  • phlex/model/fixed_hierarchy.cpp
  • phlex/model/fixed_hierarchy.hpp
  • plugins/generate_layers.cpp
  • plugins/layer_generator.cpp
  • plugins/layer_generator.hpp
  • test/allowed_families.cpp
  • test/cached_execution.cpp
  • test/class_registration.cpp
  • test/demo-giantdata/unfold_transform_fold.cpp
  • test/filter.cpp
  • test/fixed_hierarchy_test.cpp
  • test/fold.cpp
  • test/fold_duplicate_layer_name_test.cpp
  • test/framework_graph.cpp
  • test/function_registration.cpp
  • test/hierarchical_nodes.cpp
  • test/layer_generator.cpp
  • test/memory-checks/many_events.cpp
  • test/multiple_function_registration.cpp
  • test/output_products.cpp
  • test/product_selecting.cpp
  • test/provider_test.cpp
  • test/type_distinction.cpp
  • test/unfold.cpp
  • test/vector_of_abstract_types.cpp
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Framework-R-D/action-configure-cmake (auto-detected)
  • Framework-R-D/action-workflow-setup (auto-detected)
  • Framework-R-D/action-complete-pr-comment (auto-detected)
  • Framework-R-D/action-handle-fix-commit (auto-detected)
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: build (gcc, none)
  • GitHub Check: Analyze cpp with CodeQL
  • GitHub Check: coverage
  • GitHub Check: clang-tidy-check
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,cc,cxx,h,hpp}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{cpp,cc,cxx,h,hpp}: Use clang-format tool for all C++ code formatting (VS Code auto-formats on save); configuration defined in .clang-format with 100-character line limit and 2-space indentation
Follow clang-tidy recommendations defined in .clang-tidy

Files:

  • test/multiple_function_registration.cpp
  • plugins/generate_layers.cpp
  • test/function_registration.cpp
  • test/memory-checks/many_events.cpp
  • test/hierarchical_nodes.cpp
  • phlex/model/fixed_hierarchy.hpp
  • test/fold_duplicate_layer_name_test.cpp
  • phlex/core/node_catalog.hpp
  • test/type_distinction.cpp
  • test/product_selecting.cpp
  • test/vector_of_abstract_types.cpp
  • phlex/core/source.hpp
  • test/demo-giantdata/unfold_transform_fold.cpp
  • test/output_products.cpp
  • phlex/core/node_catalog.cpp
  • phlex/app/load_module.cpp
  • test/layer_generator.cpp
  • test/unfold.cpp
  • phlex/app/load_module.hpp
  • test/class_registration.cpp
  • test/allowed_families.cpp
  • test/fixed_hierarchy_test.cpp
  • plugins/layer_generator.cpp
  • test/cached_execution.cpp
  • test/fold.cpp
  • phlex/app/run.cpp
  • test/framework_graph.cpp
  • test/provider_test.cpp
  • phlex/core/framework_graph.hpp
  • test/filter.cpp
  • phlex/model/fixed_hierarchy.cpp
  • phlex/core/framework_graph.cpp
  • phlex/driver.hpp
  • plugins/layer_generator.hpp
**/*.{hpp,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{hpp,cpp}: Use .hpp for header files, .cpp for implementation, and *_test.cpp for test files in C++
Enforce 100-character line limit and 2-space indentation in C++ code via .clang-format
Use QualifierAlignment: Right (east-const) style: int const x not const int x in C++
Use PointerAlignment: Left in C++ (pointer * attached to type, not variable name)
All C++ identifiers must use lower_case naming: namespaces, classes, structs, enums, functions, variables, parameters, members, and constants
Exception to C++ naming: template parameters use CamelCase
Exception to C++ naming: macros use UPPER_CASE
Private, protected, and constant members in C++ must have a trailing underscore (_), no trailing underscore on anything else
Use enum class preferred over plain enum in C++
Use std::shared_ptr for shared ownership, std::unique_ptr for exclusive ownership, raw pointers for non-owning references only in C++
Use functors with agent-noun pattern: ModelEvaluator evaluate_model(...) in C++
Apply .clang-tidy checks for bugprone, cert, clang-analyzer, concurrency, cppcoreguidelines, misc, modernize, performance, portability, and readability as defined in the .clang-tidy configuration file
Use phlex:: namespace for core code, phlex::experimental:: for experimental features in C++

Files:

  • test/multiple_function_registration.cpp
  • plugins/generate_layers.cpp
  • test/function_registration.cpp
  • test/memory-checks/many_events.cpp
  • test/hierarchical_nodes.cpp
  • phlex/model/fixed_hierarchy.hpp
  • test/fold_duplicate_layer_name_test.cpp
  • phlex/core/node_catalog.hpp
  • test/type_distinction.cpp
  • test/product_selecting.cpp
  • test/vector_of_abstract_types.cpp
  • phlex/core/source.hpp
  • test/demo-giantdata/unfold_transform_fold.cpp
  • test/output_products.cpp
  • phlex/core/node_catalog.cpp
  • phlex/app/load_module.cpp
  • test/layer_generator.cpp
  • test/unfold.cpp
  • phlex/app/load_module.hpp
  • test/class_registration.cpp
  • test/allowed_families.cpp
  • test/fixed_hierarchy_test.cpp
  • plugins/layer_generator.cpp
  • test/cached_execution.cpp
  • test/fold.cpp
  • phlex/app/run.cpp
  • test/framework_graph.cpp
  • test/provider_test.cpp
  • phlex/core/framework_graph.hpp
  • test/filter.cpp
  • phlex/model/fixed_hierarchy.cpp
  • phlex/core/framework_graph.cpp
  • phlex/driver.hpp
  • plugins/layer_generator.hpp
**/*.hpp

📄 CodeRabbit inference engine (AGENTS.md)

Avoid boolean parameters in C++ interfaces; prefer enumerations instead

Files:

  • phlex/model/fixed_hierarchy.hpp
  • phlex/core/node_catalog.hpp
  • phlex/core/source.hpp
  • phlex/app/load_module.hpp
  • phlex/core/framework_graph.hpp
  • phlex/driver.hpp
  • plugins/layer_generator.hpp
🪛 Cppcheck (2.21.0)
plugins/generate_layers.cpp

[style] 26-26: The function 'PHLEX_REGISTER_DRIVER' is never used.

(unusedFunction)

phlex/app/load_module.cpp

[style] 116-116: The function 'load_driver' is never used.

(unusedFunction)

🔇 Additional comments (34)
phlex/model/fixed_hierarchy.hpp (1)

90-92: LGTM!

phlex/model/fixed_hierarchy.cpp (1)

16-25: LGTM!

Also applies to: 39-39, 51-64, 115-123

test/fixed_hierarchy_test.cpp (1)

74-80: LGTM!

Also applies to: 82-93, 95-105

phlex/core/framework_graph.hpp (1)

29-29: LGTM!

Also applies to: 42-63, 190-192, 201-201, 210-210

phlex/core/framework_graph.cpp (1)

18-34: LGTM!

Also applies to: 53-79, 102-121

phlex/app/run.cpp (1)

20-20: LGTM!

Also applies to: 41-43

test/layer_generator.cpp (1)

12-19: LGTM!

Also applies to: 24-34, 38-50, 54-66, 70-77, 84-103

test/allowed_families.cpp (1)

37-43: LGTM!

test/cached_execution.cpp (1)

55-61: LGTM!

test/demo-giantdata/unfold_transform_fold.cpp (1)

48-54: LGTM!

test/fold.cpp (1)

63-68: LGTM!

Also applies to: 107-112

phlex/app/load_module.hpp (1)

25-25: LGTM!

phlex/app/load_module.cpp (1)

116-127: LGTM!

test/framework_graph.cpp (1)

11-11: LGTM!

Also applies to: 16-17, 23-24, 30-31, 33-34, 45-45, 52-53, 55-56, 79-79, 90-91, 93-94, 114-114, 128-133, 135-156, 158-167

test/class_registration.cpp (1)

68-68: LGTM!

test/function_registration.cpp (1)

64-64: LGTM!

test/multiple_function_registration.cpp (1)

44-44: LGTM!

test/type_distinction.cpp (1)

46-50: LGTM!

test/vector_of_abstract_types.cpp (1)

42-46: LGTM!

test/filter.cpp (1)

105-108: LGTM!

Also applies to: 132-135, 155-158, 186-189, 213-216

test/fold_duplicate_layer_name_test.cpp (1)

60-66: LGTM!

test/hierarchical_nodes.cpp (1)

81-86: LGTM!

test/memory-checks/many_events.cpp (1)

17-21: LGTM!

test/output_products.cpp (1)

39-43: LGTM!

test/product_selecting.cpp (1)

31-34: LGTM!

test/provider_test.cpp (1)

68-72: LGTM!

Also applies to: 91-95, 111-111, 121-121, 140-140

test/unfold.cpp (1)

94-98: LGTM!

Also applies to: 162-166

phlex/core/source.hpp (1)

46-46: LGTM!

phlex/core/node_catalog.hpp (1)

32-33: LGTM!

phlex/core/node_catalog.cpp (1)

4-4: LGTM!

phlex/driver.hpp (1)

5-20: LGTM!

Also applies to: 32-110, 132-163

plugins/layer_generator.hpp (1)

19-24: LGTM!

Also applies to: 37-37, 50-50, 61-68

plugins/layer_generator.cpp (1)

14-17: LGTM!

Also applies to: 139-146

plugins/generate_layers.cpp (1)

22-30: LGTM!

Also applies to: 41-41

Comment thread phlex/core/framework_graph.hpp
Comment thread phlex/core/node_catalog.cpp
Comment thread phlex/driver.hpp Outdated
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.24561% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/driver.hpp 95.23% 0 Missing and 2 partials ⚠️
@@            Coverage Diff             @@
##             main     #658      +/-   ##
==========================================
+ Coverage   83.55%   83.83%   +0.27%     
==========================================
  Files         170      170              
  Lines        6283     6366      +83     
  Branches      706      717      +11     
==========================================
+ Hits         5250     5337      +87     
+ Misses        810      804       -6     
- Partials      223      225       +2     
Flag Coverage Δ
scripts 78.86% <ø> (ø)
unittests 86.30% <98.24%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
phlex/app/load_module.cpp 84.78% <100.00%> (+0.33%) ⬆️
phlex/app/run.cpp 88.88% <100.00%> (+0.65%) ⬆️
phlex/core/framework_graph.cpp 96.63% <100.00%> (+0.34%) ⬆️
phlex/core/framework_graph.hpp 100.00% <100.00%> (ø)
phlex/core/glue.hpp 98.43% <ø> (ø)
phlex/core/graph_proxy.hpp 91.66% <100.00%> (ø)
phlex/core/node_catalog.cpp 88.88% <100.00%> (+3.17%) ⬆️
phlex/core/node_catalog.hpp 100.00% <ø> (ø)
phlex/core/source.hpp 100.00% <ø> (ø)
phlex/model/fixed_hierarchy.cpp 88.63% <100.00%> (+13.63%) ⬆️
... and 6 more

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0de5b7b...5457bda. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Framework-R-D Framework-R-D deleted a comment from github-actions Bot Jun 24, 2026
@Framework-R-D Framework-R-D deleted a comment from github-actions Bot Jun 24, 2026
@Framework-R-D Framework-R-D deleted a comment from coderabbitai Bot Jun 24, 2026
@Framework-R-D Framework-R-D deleted a comment from github-actions Bot Jun 25, 2026
@Framework-R-D Framework-R-D deleted a comment from github-actions Bot Jun 25, 2026
@knoepfel knoepfel requested review from beojan and marcpaterno June 25, 2026 16:50
@Framework-R-D Framework-R-D deleted a comment from github-actions Bot Jun 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

Found 5504 issue(s); none are newly introduced by this patch.

All issues by check:

  • readability-identifier-naming: 2059
  • readability-redundant-member-init: 1282
  • portability-template-virtual-member-function: 563
  • performance-unnecessary-value-param: 504
  • readability-avoid-const-params-in-decls: 269
  • modernize-pass-by-value: 206
  • readability-braces-around-statements: 90
  • modernize-use-designated-initializers: 88
  • readability-convert-member-functions-to-static: 82
  • readability-const-return-type: 50
  • performance-move-const-arg: 29
  • modernize-use-auto: 27
  • performance-enum-size: 24
  • readability-redundant-control-flow: 23
  • readability-qualified-auto: 22
  • modernize-concat-nested-namespaces: 17
  • readability-math-missing-parentheses: 16
  • modernize-use-equals-default: 15
  • modernize-avoid-c-arrays: 15
  • modernize-use-using: 13
  • bugprone-branch-clone: 12
  • readability-static-definition-in-anonymous-namespace: 12
  • modernize-return-braced-init-list: 10
  • readability-function-size: 10
  • readability-isolate-declaration: 8
  • cppcoreguidelines-special-member-functions: 7
  • readability-container-size-empty: 7
  • modernize-use-starts-ends-with: 6
  • readability-inconsistent-declaration-parameter-name: 5
  • readability-redundant-access-specifiers: 5
  • modernize-use-ranges: 5
  • readability-container-contains: 5
  • readability-redundant-casting: 3
  • modernize-use-std-numbers: 3
  • clang-diagnostic-error: 3
  • modernize-use-integer-sign-comparison: 2
  • modernize-make-shared: 1
  • readability-simplify-boolean-expr: 1
  • readability-use-anyofallof: 1
  • performance-avoid-endl: 1
  • readability-redundant-string-init: 1
  • readability-else-after-return: 1
  • modernize-redundant-void-arg: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

@Framework-R-D Framework-R-D deleted a comment from github-actions Bot Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

Found 5502 issue(s); none are newly introduced by this patch.

All issues by check:

  • readability-identifier-naming: 2059
  • readability-redundant-member-init: 1282
  • portability-template-virtual-member-function: 563
  • performance-unnecessary-value-param: 504
  • readability-avoid-const-params-in-decls: 269
  • modernize-pass-by-value: 206
  • readability-braces-around-statements: 90
  • modernize-use-designated-initializers: 89
  • readability-convert-member-functions-to-static: 82
  • readability-const-return-type: 50
  • performance-move-const-arg: 29
  • modernize-use-auto: 27
  • performance-enum-size: 24
  • readability-redundant-control-flow: 23
  • readability-qualified-auto: 22
  • modernize-concat-nested-namespaces: 17
  • readability-math-missing-parentheses: 16
  • modernize-use-equals-default: 15
  • modernize-avoid-c-arrays: 15
  • modernize-use-using: 13
  • readability-static-definition-in-anonymous-namespace: 12
  • bugprone-branch-clone: 12
  • readability-function-size: 10
  • modernize-return-braced-init-list: 10
  • readability-isolate-declaration: 8
  • cppcoreguidelines-special-member-functions: 7
  • readability-container-size-empty: 7
  • modernize-use-starts-ends-with: 6
  • readability-inconsistent-declaration-parameter-name: 5
  • modernize-use-ranges: 5
  • readability-container-contains: 5
  • readability-redundant-access-specifiers: 5
  • readability-redundant-casting: 3
  • modernize-use-std-numbers: 3
  • modernize-use-integer-sign-comparison: 2
  • readability-simplify-boolean-expr: 1
  • readability-use-anyofallof: 1
  • modernize-make-shared: 1
  • modernize-redundant-void-arg: 1
  • readability-else-after-return: 1
  • readability-redundant-string-init: 1
  • performance-avoid-endl: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

class layer_generator : public std::enable_shared_from_this<layer_generator> {
public:
layer_generator();
[[nodiscard]] static std::shared_ptr<layer_generator> make();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a future modification of making make return a unique_ptr, which adds some flexibility and may allow other refactorings to simplify ownership. This should not block this PR.

int max_parallelism = oneapi::tbb::info::default_concurrency());
explicit framework_graph(driver_bundle bundle,
int max_parallelism = oneapi::tbb::info::default_concurrency());
[[nodiscard]] static framework_graph with_default_driver(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming to without_driver, to help emphasize that the graph lacks a driver, rather than having one that is somehow a "deferred driver".

Comment thread test/provider_test.cpp
.input_family(product_selector{.creator = "nonexistent_creator", .layer = "job"});

CHECK_THROWS_WITH(g.execute(),
ContainsSubstring("No provider found for the following required products:") &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider testing to ensure that the required product is listed in the expected format. This may be too much to deal with in release 0.3. If so, then consider creating an issue to say this should be done.

@marcpaterno marcpaterno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the various comments. None are blockers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants