Skip to content

fix: represent absent and empty creator and suffix explicitly - #1009

Draft
marcpaterno wants to merge 4 commits into
stack/concept-registry/05-translator-integrationfrom
represent-creator-and-suffix-state-explicitly
Draft

marcpaterno wants to merge 4 commits into
stack/concept-registry/05-translator-integrationfrom
represent-creator-and-suffix-state-explicitly

Conversation

@marcpaterno

Copy link
Copy Markdown
Member
  • Model an unqualified creator's plugin and an empty suffix as
    explicit empty values instead of invalid empty identifiers.
  • Make a product specification's creator optional; provider
    construction now requires a present creator.
  • Reject empty algorithm names, empty plugin components, and an empty
    configured module_label instead of accepting them silently.
  • Rename the default source creator from "[Source]" to "phlex_source",
    which is a valid name under the new parser.
  • Return borrowed string views from handle creator() and suffix()
    accessors.
  • Add tests for parsing, equality/hashing, exact product lookup,
    provider construction, and handle views.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@marcpaterno
marcpaterno added this pull request to stack #1004 October 23, 2026 22:34
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch from f3fdc9b to 588cd43 Compare October 28, 2026 14:51
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                                 Coverage Diff                                  @@
##           stack/concept-registry/05-translator-integration    #1009      +/-   ##
====================================================================================
+ Coverage                                             91.49%   91.66%   +0.16%     
====================================================================================
  Files                                                   188      188              
  Lines                                                  6164     6165       +1     
  Branches                                                981      981              
====================================================================================
+ Hits                                                   5640     5651      +11     
+ Misses                                                  336      329       -7     
+ Partials                                                188      185       -3     
Flag Coverage Δ
amd64 91.66% <100.00%> (+0.16%) ⬆️
arm64 91.66% <100.00%> (+0.16%) ⬆️

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

Files with missing lines Coverage Δ
phlex/core/consumer.hpp 100.00% <ø> (ø)
phlex/core/detail/make_algorithm_name.cpp 100.00% <ø> (ø)
phlex/core/producer.hpp 100.00% <ø> (ø)
phlex/core/producer_catalog.cpp 93.80% <ø> (ø)
phlex/core/producer_catalog.hpp 100.00% <ø> (ø)
phlex/core/product_selector.cpp 89.47% <100.00%> (+1.75%) ⬆️
phlex/core/product_selector.hpp 100.00% <ø> (ø)
phlex/core/upstream_predicates.hpp 93.75% <ø> (ø)
phlex/model/algorithm_name.hpp 100.00% <ø> (ø)
phlex/model/handle.hpp 100.00% <ø> (ø)
... and 5 more

... 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 8dfc792...062189d. 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 28, 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/test/product_handle_test.cpp:182: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object
/__w/phlex/phlex/phlex-src/test/product_handle_test.cpp:238: warning: unchecked access to optional value
/__w/phlex/phlex/phlex-src/test/product_selector_test.cpp:93: warning: unchecked access to optional value
/__w/phlex/phlex/phlex-src/test/product_selector_test.cpp:101: warning: unchecked access to optional value
/__w/phlex/phlex/phlex-src/test/output_products_test.cpp:108: warning: unchecked access to optional value
/__w/phlex/phlex/phlex-src/test/products_test.cpp:38: warning: unchecked access to optional value
/__w/phlex/phlex/phlex-src/test/form/form_basics_test.cpp:808: warning: use designated initializer list to initialize 'const value_type' (aka 'const form::experimental::product_with_name')
/__w/phlex/phlex/phlex-src/test/form/form_basics_test.cpp:809: warning: use designated initializer list to initialize 'const value_type' (aka 'const form::experimental::product_with_name')
/__w/phlex/phlex/phlex-src/test/product_selecting_test.cpp:314: warning: comparison between 'signed' and 'unsigned' integers
/__w/phlex/phlex/phlex-src/test/product_selecting_test.cpp:330: warning: comparison between 'signed' and 'unsigned' integers

Download clang-tidy artifacts

@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch 2 times, most recently from 30b106b to 5063d91 Compare October 28, 2026 16:26
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch 2 times, most recently from 74241c2 to 6d978a5 Compare November 2, 2026 21:48
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch from 6d978a5 to 8a99bab Compare November 2, 2026 21:59
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch 2 times, most recently from 297c4e4 to 4357201 Compare November 3, 2026 17:56
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch from 4357201 to 95eb9d8 Compare November 3, 2026 21:58
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch 3 times, most recently from 3689f8c to b7f6e50 Compare November 4, 2026 16:18
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch 4 times, most recently from b73bfe2 to cccac05 Compare November 12, 2026 19:59
@knoepfel
knoepfel force-pushed the represent-creator-and-suffix-state-explicitly branch from cccac05 to ba390ef Compare November 12, 2026 20:14
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch from ba390ef to 0aef802 Compare November 14, 2026 16:04
@marcpaterno
marcpaterno removed this pull request from stack #1004 November 14, 2026 16:12
@marcpaterno
marcpaterno added this pull request to stack #1069 November 14, 2026 16:12
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch 12 times, most recently from e7b159b to c035308 Compare November 20, 2026 22:20
@knoepfel
knoepfel force-pushed the represent-creator-and-suffix-state-explicitly branch from c035308 to 5e6a7c8 Compare November 20, 2026 22:34
Document and test that a product specification's suffix is a
`suffix_t`, either `empty_string` or a named `identifier`. Text
parsing, `to_product_specifications()` conversion, equality, ordering
and hashing all keep that representation. The new tests cover:

- parsing `creator/suffix` text, including the trailing-slash empty
  suffix and rejection of text without a creator and slash
- converting fluent `output_product_suffixes` strings, and the default
  suffix, to specification suffixes
- exact-match lookup in `products` and `product_store`
- handle `creator()` and `suffix()` views, including that they borrow
  from the referenced specification

Behavior changes:

- Rename the default source creator from "Source" to "phlex_source".
  Its test now also covers inserting and looking up a product made by
  that creator.
- Document and test that `make_algorithm_name` rejects an empty
  configured `module_label` with `std::invalid_argument`, using the
  same uniform message as `algorithm_name::create` (the plugin label is
  missing). A null configuration still gives an absent plugin. A
  configuration without `module_label` is tested to throw
  `std::runtime_error` from the configuration.
- Document and test that `algorithm_name::create` rejects a leading
  colon (`:algorithm`) as a missing plugin label, throwing
  `std::invalid_argument`. `algorithm_name`'s default constructor is
  explicitly deleted. Tests cover empty, leading-colon, trailing-colon
  and lone-colon specifications.
- Add `consumer::plugin()`, returning `std::optional<identifier>
  const&`, and `consumer::algorithm()`, returning `identifier const&`.
  Both forward to `name()`. The plugin is `std::nullopt` for an
  unqualified name. This commit adds no tests for these accessors.

Add doc comments for `algorithm_name`, `product_specification`, the
handle views, `consumer`, `product_store::default_source()`, the
suffix conversion points, and exact lookup in `products`.
Document and test how product selectors, the producer catalog and the
FORM writer treat suffixes as suffix_t. An omitted selector suffix
matches any suffix. An explicit empty suffix matches only empty. A
named suffix matches only that name. Equality, ordering and
diagnostics keep all three states distinct.

Documentation:
- Add a "Product suffix text" section to form/README.md. FORM labels
  carry the suffix_t text, so empty text is written as "" and named
  text keeps its spelling. The persisted layout is unchanged:
  product_name holds the suffix text and container_name stays
  row_space/suffix.
- Document the creator criterion on product_selector. An omitted
  creator is unrestricted. A supplied name matches either the plugin
  or the algorithm of a specification's creator.
- Document the suffix semantics on product_selector, producer and
  producer_catalog.
- Declare the producer_catalog multimap key as suffix_t directly.

Tests:
- Add selector tests for suffix construction from literals, identifiers
  and runtime strings, for matching and to_string diagnostics across
  the three states, and for the creator criterion.
- Add graph tests for selecting empty, named and omitted suffixes,
  including ambiguity when an omitted suffix matches several products
  and when an empty or named suffix is produced by several creators.
- Extend the producer catalog test with an empty product, plugin-name
  lookup, ambiguity on an omitted suffix and a non-matching suffix.
- Add a FORM writer test that checks the finalized dictionary labels
  and container names for empty and named suffixes. A ROOT TTree
  round-trip section runs under USE_ROOT_STORAGE.
- Check that a typed product store lookup does not treat an untyped
  specification as a wildcard.
- Spell empty suffixes as empty_string{} in the transform node test.
Keep name() as the single accessor for a consumer's algorithm name
and its components. Callers that need the parts use name().plugin()
and name().algorithm() directly, so the duplicate forwarding
accessors and the now-unused <optional> includes are dropped.

Update the accessor contract comment on consumer to refer to
name().plugin(), which is absent for an unqualified name, and
name().algorithm().

Extend the transform_node test to check name(), plugin, algorithm,
and when() for a qualified name with ordered predicate metadata and
for an unqualified name with no predicates.
@marcpaterno
marcpaterno force-pushed the represent-creator-and-suffix-state-explicitly branch from 5e6a7c8 to 062189d Compare November 24, 2026 18:20

This branch has not been deployed

No deployments
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