Skip to content

feat(core): integrate translator nodes into the graph - #1003

Open
marcpaterno wants to merge 1 commit into
stack/concept-registry/04-conversion-recordsfrom
stack/concept-registry/05-translator-integration
Open

marcpaterno wants to merge 1 commit into
stack/concept-registry/04-conversion-recordsfrom
stack/concept-registry/05-translator-integration

Conversation

@marcpaterno

@marcpaterno marcpaterno commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

PR 5 of the five-PR concept-registry stack; review against
stack/concept-registry/04-conversion-records.

Add explicit translate registration for one-input/one-output algorithms using
the existing runtime-base and typed-node architecture.

framework_graph / graph_proxy.translate
  -> registration builder -> typed translator_node
  -> runtime declared_translator (consumer + independent producer)
  -> retrieve selected input -> invoke callable -> emit produced result

result metadata
  creator = translator algorithm       suffix = registered output suffix
  index   = input data-cell index      stage  = translator execution stage
  • Constrain translator callables to exactly one input parameter and one output
    object; expose registration through the framework graph and typed graph proxy.
  • Add translator storage/registration, consumer and producer collection,
    predicate-edge wiring, execution counting, and build entries.
  • Emit a new product store containing the produced result, reusing the input
    index and message ID, with translator output specifications and execution stage.
  • Add an end-to-end provider -> translator -> observer regression checking value,
    creator, suffix, layer, distinct input/output stages, index-pointer identity,
    and execution counts.

This does not connect execution to concept conversion records or enforce concept
membership. It does not add discovery, registration-only conversion, module-level
translate exposure, input creator/suffix/stage inheritance, or borrowed-source
lifetime retention. Existing upstream producer/selector behavior is preserved;
Python, FORM, and naming-consumer implementations are unchanged.

Evidence

  • Before: The parent has concept conversion records but no explicitly
    registered executable translator node in the computational graph.
    After: function_registration passes 26 assertions in 2 cases, including
    translation to 1.5, downstream consumption, and all metadata/count checks.
  • Full configured build passed, including Python and FORM targets.
  • Focused graph/catalog/selector/Python/FORM selection: 43/43 CTests passed.
    Configured py:phlex: 11 pytest cases passed, none skipped.
  • Full boundary suite: 119/119 CTests passed. Whole-stack reconciliation subsequently
    reran the final-tip build and all 119 CTests successfully.
  • All 13 changed files passed hooks and whitespace checks. Runtime and typed
    translator implementations match the preserved original source exactly.

The before/after is the feature delta, not a failing-parent test claim. Evidence
is local macOS/AppleClang with Python and FORM ROOT_TTREE; no Linux, sanitizer,
cppyy, coverage-instrumentation, or RNTuple claim. Predicate wiring is inspected,
but no dedicated translator predicate-filter or resource-arbitration regression
is claimed.

Merge Danger

Door: Two-way

No persisted-format migration. Reversion requires removing translator registrations
and dependent workflows; this is the broadest runtime change in the stack.

Blast Radius: Graph

Translators affect product routing, catalog participation, predicate edges, and
execution accounting. Outputs have the translator's identity and execution stage,
not the input's identity/stage. A conversion returning a borrowed view is not made
safe by this node: its new store does not retain the input store for that purpose.


Stack created with GitHub Stacks CLI • Give Feedback 💬

  • Code: Added translator registration through framework_graph, graph_proxy, and glue. Translator nodes consume one input, produce one output, and connect to product routing and predicate-filter edges.
  • Runtime: Added translator catalog entries for producer and consumer discovery, plus execution counts and per-layer product counts.
  • Test coverage: Added an end-to-end provider → translator → observer regression. It checks the translated value, product metadata, shared data-cell index, and execution counts.
  • Validation: The author reports passing local build, test, and hook checks. Linux, sanitizer, cppyy, coverage-instrumentation, and RNTuple were not tested. No dedicated translator predicate-filter or resource-arbitration regression is reported.

@marcpaterno
marcpaterno added this pull request to stack #1004 October 21, 2026 17:45
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bf78a7ee-c2ff-44f7-a3a6-9bbd3380e0ec

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

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5ae4bbab-9823-4355-8148-7573696c09d4
Commits

Reviewing files that changed from the base of the PR and between 71e72a8 and d9e39e0.

Files selected for processing: 13
  • phlex/core/CMakeLists.txt
  • phlex/core/concepts.hpp
  • phlex/core/declared_translator.cpp
  • phlex/core/declared_translator.hpp
  • phlex/core/framework_graph.cpp
  • phlex/core/framework_graph.hpp
  • phlex/core/glue.hpp
  • phlex/core/graph_proxy.hpp
  • phlex/core/node_catalog.cpp
  • phlex/core/node_catalog.hpp
  • phlex/core/registration_api.hpp
  • phlex/core/translator_node.hpp
  • test/function_registration_test.cpp

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Context from checks skipped due to timeout: 9
  • GitHub Check: coverage (arm64)
  • GitHub Check: coverage (amd64)
  • GitHub Check: clang-tidy-check
  • GitHub Check: cmake-format-check
  • GitHub Check: clang-format-check
  • GitHub Check: header-guards-check
  • GitHub Check: setup
  • GitHub Check: setup
  • GitHub Check: setup
Additional context used
Code guidelines: 2
.github/copilot-instructions.md — auto-discovered
AGENTS.md — auto-discovered
Path-based instructions: 3
Source excerpt: Use clang-format tool for all C++ code (VS Code auto-formats on save)

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

Files:

  • phlex/core/registration_api.hpp
  • phlex/core/graph_proxy.hpp
  • phlex/core/framework_graph.cpp
  • phlex/core/glue.hpp
  • phlex/core/declared_translator.cpp
  • phlex/core/framework_graph.hpp
  • phlex/core/node_catalog.hpp
  • phlex/core/concepts.hpp
  • phlex/core/node_catalog.cpp
  • phlex/core/declared_translator.hpp
  • test/function_registration_test.cpp
  • phlex/core/translator_node.hpp
Source excerpt: Header files: `.hpp`; implementation: `.cpp`; tests: `*_test.cpp`

CodeRabbit inference engine (AGENTS.md)

Files:

  • test/function_registration_test.cpp
Source excerpt: **Authoritative sources**: `.clang-format` and `.clang-tidy` are the ground truth for formatting and naming.

CodeRabbit inference engine (AGENTS.md)

Files:

  • phlex/core/registration_api.hpp
  • phlex/core/graph_proxy.hpp
  • phlex/core/framework_graph.cpp
  • phlex/core/glue.hpp
  • phlex/core/declared_translator.cpp
  • phlex/core/framework_graph.hpp
  • phlex/core/node_catalog.hpp
  • phlex/core/concepts.hpp
  • phlex/core/node_catalog.cpp
  • phlex/core/declared_translator.hpp
  • test/function_registration_test.cpp
  • phlex/core/translator_node.hpp
Learnings: 1
Learning: 2026-10-20T14:58:29.340Z
Learnt from: CR
Repo: Framework-R-D/phlex PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-10-20T14:58:29.340Z
Learning: Applies to **/*.{cc,cpp,cxx,h,hpp,hxx} : Source excerpt:
# GitHub Copilot Instructions for Phlex Project

## Code Formatting Standards

### C++ Files

- Use clang-format tool for all C++ code (VS Code auto-formats on save)

Applied to files:

  • phlex/core/node_catalog.hpp
Additional comments: 13
phlex/core/concepts.hpp: 1

23-28: LGTM!

Also applies to: 38-40, 85-87

phlex/core/declared_translator.hpp: 1

1-41: LGTM!

phlex/core/declared_translator.cpp: 1

1-25: LGTM!

phlex/core/CMakeLists.txt: 1

13-13: LGTM!

Also applies to: 53-53, 81-81

phlex/core/translator_node.hpp: 1

1-139: LGTM!

phlex/core/registration_api.hpp: 1

13-13: LGTM!

phlex/core/framework_graph.hpp: 1

141-147: LGTM!

phlex/core/graph_proxy.hpp: 1

100-104: LGTM!

Also applies to: 219-226

phlex/core/glue.hpp: 1

13-13: LGTM!

Also applies to: 150-169

phlex/core/node_catalog.hpp: 1

9-9: LGTM!

Also applies to: 27-27, 56-56, 115-115, 139-140

phlex/core/framework_graph.cpp: 1

233-233: LGTM!

phlex/core/node_catalog.cpp: 1

33-33: LGTM!

Also applies to: 55-57, 76-76

test/function_registration_test.cpp: 1

112-146: LGTM!

Walkthrough

The change adds translator registration to the graph API. It defines one-input, one-output translator callables, executes them as flow-graph nodes, and includes them in graph catalogs and predicate-filter connections.

Changes: Translator flow

Layer / File(s) Summary
Translator callable and consumer contract
phlex/core/concepts.hpp, phlex/core/declared_translator.hpp, phlex/core/declared_translator.cpp, phlex/core/CMakeLists.txt
New concepts define the translator callable shape. The declared translator class combines consumer and producer behavior and requires a product count.
Translator flow-graph execution
phlex/core/translator_node.hpp, phlex/core/registration_api.hpp, phlex/core/CMakeLists.txt
The translator node invokes the callable, wraps its result in a product store, forwards the input message ID, and tracks calls and per-layer product counts.
Graph registration and catalog integration
phlex/core/framework_graph.hpp, phlex/core/graph_proxy.hpp, phlex/core/glue.hpp, phlex/core/framework_graph.cpp, phlex/core/node_catalog.hpp, phlex/core/node_catalog.cpp, test/function_registration_test.cpp
The graph APIs register translators. Node catalogs include translator consumers and producers, execution counts include translator calls, and predicate filters connect to translators. The test checks translated output and execution counts.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant framework_graph
  participant glue
  participant translator_node
  participant translator_callable
  participant downstream_observer
  framework_graph->>glue: register translator
  glue->>translator_node: construct and register node
  translator_node->>translator_callable: invoke with input
  translator_callable-->>translator_node: return output
  translator_node->>downstream_observer: forward output with input message ID
Loading

Suggested reviewers: knoepfel, sabasehrish

Merge Risk: Low · previous review d9e39

The change is mergeable with a known limitation: translators should return owned results, because a result that borrows from its input can become invalid before an observer uses it.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 "feat(core): integrate translator nodes into the graph" matches the main change. The PR adds translator registration through framework_graph and graph_proxy, a new translator_node flow-graph…
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.
Full details: Title check

Explanation

The title "feat(core): integrate translator nodes into the graph" matches the main change. The PR adds translator registration through framework_graph and graph_proxy, a new translator_node flow-graph node, a declared_translator class, and node_catalog wiring. The title is short, specific, and follows a conventional-commit style. It does not mention the end-to-end test, but that is expected.

Full details: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 12 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.22034% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/core/translator_node.hpp 87.87% 4 Missing ⚠️
@@                               Coverage Diff                                @@
##           stack/concept-registry/04-conversion-records    #1003      +/-   ##
================================================================================
+ Coverage                                         89.72%   89.77%   +0.04%     
================================================================================
  Files                                               180      183       +3     
  Lines                                              6124     6183      +59     
  Branches                                           1014     1016       +2     
================================================================================
+ Hits                                               5495     5551      +56     
- Misses                                              397      401       +4     
+ Partials                                            232      231       -1     
Flag Coverage Δ
amd64 89.77% <93.22%> (+0.04%) ⬆️
arm64 89.77% <93.22%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
phlex/core/declared_translator.cpp 100.00% <100.00%> (ø)
phlex/core/declared_translator.hpp 100.00% <100.00%> (ø)
phlex/core/framework_graph.cpp 100.00% <100.00%> (ø)
phlex/core/framework_graph.hpp 100.00% <100.00%> (ø)
phlex/core/glue.hpp 100.00% <100.00%> (ø)
phlex/core/graph_proxy.hpp 100.00% <ø> (ø)
phlex/core/node_catalog.cpp 95.83% <100.00%> (+0.37%) ⬆️
phlex/core/node_catalog.hpp 100.00% <100.00%> (ø)
phlex/core/registration_api.hpp 100.00% <ø> (ø)
phlex/core/translator_node.hpp 87.87% <87.87%> (ø)

... and 1 file 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 f8c0211...b9bc87c. Read the comment docs.

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

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

Clang-tidy found the following issue(s) on lines changed by this pull request:

/__w/phlex/phlex/phlex-src/phlex/core/translator_node.hpp:38: warning: redundant 'typename'
/__w/phlex/phlex/phlex-src/phlex/core/translator_node.hpp:39: warning: redundant 'typename'

Download clang-tidy artifacts

@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from 97aff1d to 1c48cee Compare October 22, 2026 15:46
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 2 times, most recently from 4110bb2 to d9e39e0 Compare October 28, 2026 15:56
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from d9e39e0 to 371d585 Compare October 28, 2026 16:26
Register one-input, one-output translators as consumers and independent
producers on the runtime/typed-node architecture.

Preserve translator creator, registered suffix, input data-cell index,
and execution stage, with end-to-end observer regression coverage.
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from 371d585 to b9bc87c Compare October 28, 2026 16:38
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.

1 participant