Skip to content

text/renderer: enforce explicit wrapper outcomes#28

Merged
gabewillen merged 2 commits into
mainfrom
fix/renderer-compliance-explicit-rpc
Mar 2, 2026
Merged

text/renderer: enforce explicit wrapper outcomes#28
gabewillen merged 2 commits into
mainfrom
fix/renderer-compliance-explicit-rpc

Conversation

@gabewillen

@gabewillen gabewillen commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove renderer wrapper state checks (is(state<done>)) and return success via explicit dispatch-local error context.
  • Keep wrapper outcomes aligned with graph/sampler pattern: accepted && runtime_ctx.err == k_none.
  • Make runtime outcome tracking explicit through initialized context (*_publish_error branches) rather than inspecting final state.
  • Rename public renderer request events from bind/initiation terminology to explicit initialize/setup naming (event::initialize, initialize_*); this is a deliberate API-breaking refactor used by this PR.

Validation

  • ctest --test-dir build -R emel_tests --output-on-failure

Notes

  • Existing renderer tests continue to pass and were extended with regression coverage for stop-latched state and deterministic default out-params on invalid requests.

Copilot AI review requested due to automatic review settings March 2, 2026 19:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/emel/text/renderer/sm.hpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 bind with initialize and update renderer events/callback types accordingly.
  • Rework renderer SM transitions to route outcomes through explicit *_publish_success / *_publish_error states and return accepted && runtime_ctx.err == none.
  • Update renderer context to own a detokenizer::sm instance 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.

Comment thread src/emel/text/renderer/actions.hpp
Comment thread src/emel/text/renderer/actions.hpp
Comment thread src/emel/text/renderer/sm.hpp
Comment thread src/emel/text/renderer/events.hpp
Comment thread src/emel/text/renderer/actions.hpp
@gabewillen gabewillen merged commit 37491e1 into main Mar 2, 2026
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.

2 participants