Skip to content

feat(model): store concept translator registrations - #1002

Open
marcpaterno wants to merge 1 commit into
stack/concept-registry/03-concept-registryfrom
stack/concept-registry/04-conversion-records
Open

marcpaterno wants to merge 1 commit into
stack/concept-registry/03-concept-registryfrom
stack/concept-registry/04-conversion-records

Conversation

@marcpaterno

Copy link
Copy Markdown
Member

.

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.

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.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@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

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 641ef252-8961-4a45-970d-19a9638563c7
Commits

Reviewing files that changed from the base of the PR and between 98fb332 and f8c0211.

Files selected for processing: 3
  • phlex/model/data_product_concept.cpp
  • phlex/model/data_product_concept.hpp
  • test/data_product_concept_test.cpp
  • 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 96.87500% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/model/data_product_concept.cpp 96.87% 0 Missing and 1 partial ⚠️
@@                             Coverage Diff                             @@
##           stack/concept-registry/03-concept-registry    #1002   +/-   ##
===========================================================================
  Coverage                                       89.72%   89.72%           
===========================================================================
  Files                                             181      180    -1     
  Lines                                            6093     6124   +31     
  Branches                                         1008     1014    +6     
===========================================================================
+ Hits                                             5467     5495   +28     
  Misses                                            397      397           
- Partials                                          229      232    +3     
Flag Coverage Δ
amd64 89.72% <96.87%> (+<0.01%) ⬆️
arm64 89.72% <96.87%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
phlex/model/data_product_concept.cpp 97.50% <96.87%> (-2.50%) ⬇️

... and 2 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 98fb332...f8c0211. 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/model/data_product_concept.cpp:46: warning: no header providing "std::any" is directly included
/__w/phlex/phlex/phlex-src/phlex/model/data_product_concept.cpp:82: warning: use designated initializer list to initialize 'translator_registration'
/__w/phlex/phlex/phlex-src/phlex/model/data_product_concept.hpp:30: warning: enum 'result_storage' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size
/__w/phlex/phlex/phlex-src/test/data_product_concept_test.cpp:146: warning: variable 'input' of type 'aos_vertices' can be declared 'const'

Download clang-tidy artifacts

@marcpaterno
marcpaterno force-pushed the stack/concept-registry/04-conversion-records branch from 2f108b1 to 67942f7 Compare October 22, 2026 15:46
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/04-conversion-records branch 3 times, most recently from 71e72a8 to c25209d Compare October 28, 2026 16:26
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.
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/04-conversion-records branch from c25209d to f8c0211 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