Repository navigation
Description
Child of EPIC_REF (concurrency conformance across the zoolutions gems). Depends on conformance-kit (Phase 0 of the epic).
Problem / Goal
phlex-forms keeps its component maps and configuration in lazy class ivars — Theme.@daisy ||= / @plain ||= (lib/phlex_forms/theme.rb:56,74), PhlexForms.@configuration ||= (lib/phlex_forms.rb:42-56), Configuration lazies incl. an icon_renderer lambda (configuration.rb:50,58,68) — idempotent races today, unreadable from a non-main Ractor. Goal: Tier 1–2 gates green; PhlexForms.finalize! builds both themes and the configuration eagerly and Ractor.make_shareables them (the icon_renderer default becomes a method object / Ractor.shareable_lambda on 4.0, a capture-free lambda below); the kit's canary runs field inference (Forms::Field option resolution from a literal model-like Struct) inside a non-main Ractor on Ruby 4.0; rendering stays pending on yippee-fun/phlex#1055 (per-Ractor attribute cache; tag() registries are a further follow-up); audit passes; probes report-only. Floor 3.4 (store_if_absent available; still reach it through the kit shim for uniformity). Add a 4.0 lane (matrix is ["3.4"]).
Context
lib/phlex_forms.rb:42-56,65-95(configuration memo,reset_configuration!, manual Zeitwerk loader,require "phlex/reactive"rescue),lib/phlex_forms/theme.rb:56,74+reactive_roles(defined?(Phlex::Reactive)probe),lib/phlex_forms/configuration.rb:50,58,68,lib/forms/base.rb:24-40(form_optionsclass ivars, class-body time),lib/phlex_forms/inline_icons.rb:14-16(frozen SVG constants — already shareable),lib/phlex_forms/engine.rb:31.- Labels: core, theme, devops.
Decision
Finalize-at-boot (engine after_initialize, or end of configure when Rails is absent); themes become frozen, shareable Hashes of classes; configuration frozen; reset_configuration! stays for tests. The daisyui/phlex-reactive defined? probes are evaluated once at finalize.
Steps (TDD)
- Kit dev dep + rubocop inherit. 2.
spec/phlex_forms/finalize_spec.rb("a boot-finalized configuration"overTheme.daisy,Theme.plain, everyConfigurationreader) RED → GREEN. 3.spec/phlex_forms/contention_spec.rb(thread + Async examples overTheme.component_for). 4.spec/phlex_forms/ractor_canary_spec.rb(:ractor; pending render canary with the Phlex reason). 5..conformance.yml(Forms::Baseclass-body ivars → main_only). 6. CI callers + 4.0 lane; CHANGELOG.
Gates
bundle exec rspec green (3.4/4.0; --tag ractor on 4.0); rubocop clean; conformance-audit --strict 0; probes artifact.
Out of scope
Rendering in a Ractor (Phlex upstream); the validation→Stimulus client bridge.
Execution
/lfg <this issue> after the kit exists.
Update 2026-10-14: conformance-kit 0.1.0 is on RubyGems; the Gemfile reference (
gem "conformance-kit", "~> 0.1", require: false, plusrequire "conformance_kit/rspec"where RSpec is used) is in #43 (open until the branch ruleset's CodeQL requirement is sorted). Start from the remaining steps.
Update 2026-10-14 (conformance-kit 0.2.0, zoolutions/conformance-kit#6): this supersedes the CI step above ("call the kit's
ractor.yml+probes.yml" / "CI callers"). 0.2 removed those workflows: one zoolutions org ruleset now requires the kit'sconformance.ymlon every repo whoseconformanceproperty isenforced, and this repo is flipped once this issue closes clean. Instead:
- Write
.conformance.yml0.2:audit.require(must eager-load the gem),audit.namespace,audit.strict_autoloads: true,ractor.test_command,probes.gem_name.- Bump to
gem "conformance-kit", "~> 0.2"(plusgem "rubocop-thread_safety", ">= 0.8", andinherit_gem: { conformance-kit: config/rubocop.yml }in.rubocop.yml;conformance-kit doctorchecks all three).bundle exec conformance-kit checkgreen on Ruby 4.0.- Do not add caller jobs.
Update 2026-10-15 (supersedes the 2026-10-14 conformance-kit 0.2.0 note above; zoolutions/conformance-kit#10): there will be no org ruleset. Each repo calls the kit's workflow itself, so this replaces "Do not add caller jobs". Once conformance-kit v0.3.0 is released:
- Add
.github/workflows/conformance.ymlwith the caller from the kit README's Enforcement section:uses: zoolutions/conformance-kit/.github/workflows/conformance.yml@v0.3.0onpull_request+merge_group,permissions: contents: read.- Bump to
gem "conformance-kit", "~> 0.3". The workflow's version check fails while the lockfile resolves anything older than the caller's tag.- Add
.github/dependabot.ymlwith thegithub-actionsandbundlerecosystems, as in the kit README's "Staying current", so both pins keep moving.- Once
bundle exec conformance-kit checkis green on Ruby 4.0, addconformance / Conformance settingsandconformance / Conformance (Ruby 4.0)to this repo's branch ruleset as required status checks.- The rest of the 0.2 note still applies: the
.conformance.yml0.2 keys,rubocop-thread_safety >= 0.8,inherit_gem, and the repo-specific line.
Activity
chore(deps): reference conformance-kit as a development dependency (#43)
chore(ci): inherit conformance-kit's RuboCop config
fix(theme): build the themes without phlex-reactive
feat(core): finalize the configuration and themes at boot
test(theme): theme resolution under thread and fiber contention
fix(builder): form_options stores Ractor-shareable copies
fix(validation): the live macros store Ractor-shareable settings
refactor(components): render <lexxy-editor> through tag()
test(core): Ractor canary for field inference and form settings
chore(ci): .conformance.yml with a strict, eager-loading audit
docs: finalize-at-boot configuration in the README and CHANGELOG
chore(ci): call conformance-kit's conformance workflow at v0.4.0
test(core): the engine finalizes the configuration at Rails boot
fix(core): finalizing keeps a non-Proc icon renderer as given
docs: the 0.5.0 changelog and how finalizing hooks in
fix(core): configure finalizes outside Rails with phlex-reactive bundled
fix(core): configure returns its block's value again
fix(core): field_variants set to nil stays an appendable list
docs: Ractors read the configuration when every setting is shareable
feat(core): concurrency conformance via conformance-kit v0.4.0 (#45)
mhenrixon commentedon Oct 16, 2026
Done in #45, released in v0.5.0 (conformance-kit 0.4).
bundle exec conformance-kit checkpasses on Ruby 4.0 and in CI.conformance / Conformance settingsandconformance / Conformance (Ruby 4.0)are now required checks onmain.Left upstream: rendering inside a non-main Ractor waits on yippee-fun/phlex#1055 (tracked in zoolutions/phlex-reactive#363).
https://claude.ai/code/session_01Pu6VAMxKeUE1gfNwDrbPZ4