You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(model): store concept translator registrations - #1002
PR 4 of the five-PR concept-registry stack; review against stack/concept-registry/03-concept-registry.
Extend the experimental concept model with conversion registration records
between its concrete data-product types.
concept.translators[(source_type, target_type)]
translator name
type-erased callable (std::any)
result storage: owned | borrowed
register -> require distinct types, both in the concept, and unused ordered pair
find -> return registration or nullptr
A -> B and B -> A are separate registrations
Add result_storage, translator_registration, add_translator, and find_translator.
Reject same-type, nonmember-type, and duplicate ordered-pair registrations.
Preserve the owned/borrowed declaration: a borrowed result refers to input
storage, so its caller must keep the source alive.
Keep concept equality based on name and concrete types; callable records do
not participate. Duplicate-name registry insertion still merges concrete
types only, not conversion records.
This is record storage and retrieval, not automatic translation. Callable types
are not checked against the declared pair, and storage lifetime declarations are
not enforced. No graph execution, discovery, or input-metadata change is included.
Evidence
Before: Concepts record membership but no conversion functions. After:data_product_concept passes 36 assertions in 15 cases, covering
retrieval/invocation, storage declarations, ordered and reverse pairs, and
rejection of invalid or duplicate registrations.
The callable round-trip test explicitly documents that its callable direction
differs from the declared pair: it demonstrates retrieval/invocation, not
signature validation.
Full configured build and all 119 boundary CTests passed.
All three changed files passed existing hooks and whitespace checks.
Local macOS/AppleClang evidence, not CI or sanitizer approval. The before/after
describes the API delta; it is not a claim of a failing parent suite.
Merge Danger
Door: Two-way
Additive in-memory registration APIs; no persisted-format change or automatic
execution path. Later callers must be removed or adapted if this is reverted.
Blast Radius: Model
Incorrect callable types can survive registration and fail when retrieved or
used. Declaring a result borrowed does not retain its source; using it after
source release can dangle. Graph translators do not consume these records.
Code: Added result_storage and translator_registration to store translator names, type-erased callables, and owned-or-borrowed result declarations.
Code: Added add_translator and find_translator. Registration rejects identical types, types outside the concept, and duplicate ordered pairs. Reverse-direction pairs are separate registrations.
Code: Concept equality compares only the name and concrete types. Translator callables are stored, not invoked automatically; their signatures and borrowed-result lifetimes are not checked or enforced.
Tests: Added coverage for lookup, callable retrieval, storage declarations, ordered pairs, and invalid or duplicate registrations.
Validation: The supplied report says 36 assertions across 15 cases passed, along with 119 boundary CTests and existing hooks and whitespace checks on local macOS/AppleClang. CI and sanitizer results were not supplied.
Review: Current review severity counts are unavailable.
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: 85feb6ee-2b3c-4212-ab96-073b7f2f79b1
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.
Walkthrough
The change adds translator registration and lookup to data_product_concept. Registrations use ordered concrete-type pairs and record a name, callable, and result-storage mode. Registration validates the types and rejects duplicate pairs. Tests cover lookup, storage modes, and error cases.
Adds result_storage and translator_registration, plus APIs to register and find translators. The concept stores registrations by ordered type pair. Equality compares the concept name and concrete types, excluding translators.
Registration and lookup implementation phlex/model/data_product_concept.cpp
Registration rejects identical types, types outside the concept, and duplicate pairs. Lookup returns the registration or nullptr.
Adds translator fixtures and tests for lookup, callable and storage metadata, ordered pairs, invalid registrations, and duplicate registration. Updates existing concrete-type tests to use the new fixtures.
No merge-blocking issue was established; the change is ready for normal merge checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% 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. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "feat(model): store concept translator registrations" matches the main change. The changeset adds translator registration records to data_product_concept, keyed by ordered concrete type pair…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat(model): store concept translator registrations" matches the main change. The changeset adds translator registration records to data_product_concept, keyed by ordered concrete type pairs, with validation and lookup via find_translator. The title is short, specific, and in conventional commit style. It names the scope (model) and the primary change (storing translator registrations), so a teammate scanning history would understand the main point.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% 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 3 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
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
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 5a0e5b1b-a13f-4a17-9513-108469ee9383
Commits
Reviewing files that changed from the base of the PR and between f613d3e and 7c02e20.
Files selected for processing: 3
phlex/model/data_product_concept.cpp
phlex/model/data_product_concept.hpp
test/data_product_concept_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.
Add result storage metadata and type-erased conversion functions to data
product concepts, with validation for concrete types, identical types, and
duplicate ordered pairs.
Add tests covering registration lookup, conversion round-tripping, storage
semantics, and validation failures.
- Add missing <any> and <cstdint> includes
- Set std::uint8_t as the underlying type of result_storage
- Use designated initializers for translator_registration
- Separate the registry source's own header include group
Replace the concept factory helper with add_both_types, which populates a
caller-owned concept because data_product_concept is neither movable nor
assignable. Use the soa_vertices and aos_vertices types in the
add_concrete_types self-insertion test, and make the translator input const.
- Split the unknown-type case into sections for an empty registry and a
registry whose concepts all lack the queried type.
- Add a non-matching distractor concept to the multi-concept lookup test so
an implementation that returns an arbitrary concept fails. Require a
non-null result and check that it contains the queried type and is not
the distractor.
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
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.
Summary
PR 4 of the five-PR concept-registry stack; review against
stack/concept-registry/03-concept-registry.Extend the experimental concept model with conversion registration records
between its concrete data-product types.
result_storage,translator_registration,add_translator, andfind_translator.storage, so its caller must keep the source alive.
not participate. Duplicate-name registry insertion still merges concrete
types only, not conversion records.
This is record storage and retrieval, not automatic translation. Callable types
are not checked against the declared pair, and storage lifetime declarations are
not enforced. No graph execution, discovery, or input-metadata change is included.
Evidence
After:
data_product_conceptpasses 36 assertions in 15 cases, coveringretrieval/invocation, storage declarations, ordered and reverse pairs, and
rejection of invalid or duplicate registrations.
differs from the declared pair: it demonstrates retrieval/invocation, not
signature validation.
Local macOS/AppleClang evidence, not CI or sanitizer approval. The before/after
describes the API delta; it is not a claim of a failing parent suite.
Merge Danger
Door: Two-way
Additive in-memory registration APIs; no persisted-format change or automatic
execution path. Later callers must be removed or adapted if this is reverted.
Blast Radius: Model
Incorrect callable types can survive registration and fail when retrieved or
used. Declaring a result borrowed does not retain its source; using it after
source release can dangle. Graph translators do not consume these records.
Stack created with GitHub Stacks CLI • Give Feedback 💬
result_storageandtranslator_registrationto store translator names, type-erased callables, and owned-or-borrowed result declarations.add_translatorandfind_translator. Registration rejects identical types, types outside the concept, and duplicate ordered pairs. Reverse-direction pairs are separate registrations.