text/renderer: enforce explicit wrapper outcomes#28
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36787bb843
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Refactors the text renderer state machine so request success/failure is driven by explicit runtime error context and explicit publish-success/publish-error states (rather than wrapper is(state<...>) checks), while also switching renderer setup from external detokenizer injection (bind) to internal detokenizer initialization (initialize).
Changes:
- Replace
bindwithinitializeand update renderer events/callback types accordingly. - Rework renderer SM transitions to route outcomes through explicit
*_publish_success/*_publish_errorstates and returnaccepted && runtime_ctx.err == none. - Update renderer context to own a
detokenizer::sminstance and update unit tests to match the new initialization/orchestration.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/text/renderer/renderer_tests.cpp | Updates tests from bind-based setup to initialize-based setup; adds new initialization coverage and adjusts guard/action-path tests. |
| src/emel/text/renderer/sm.hpp | Replaces bind/idle model with initialize/publish states and updates wrapper return semantics to use runtime error context. |
| src/emel/text/renderer/guards.hpp | Renames bind guards to initialize guards and updates backend/reported error predicates and render validation. |
| src/emel/text/renderer/events.hpp | Renames binding events to initialize events; introduces event::initialize (vocab by reference). |
| src/emel/text/renderer/context.hpp | Moves renderer to own an internal emel::text::detokenizer::sm and removes bind-time injected dispatch pointers/state. |
| src/emel/text/renderer/actions.hpp | Implements initialize dispatch via internal detokenizer SM, adds explicit publish actions for initialize/render/flush, and updates error mapping/outcome handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
is(state<done>)) and return success via explicit dispatch-local error context.accepted && runtime_ctx.err == k_none.*_publish_errorbranches) rather than inspecting final state.event::initialize,initialize_*); this is a deliberate API-breaking refactor used by this PR.Validation
ctest --test-dir build -R emel_tests --output-on-failureNotes