Phrases events only where they are events - #171
Merged
Merged
Conversation
The Plan panel read a known event name as words wherever it stood in a block's sentence, so a value a step sets or a decision's arm named like an event would have been reworded mid-sentence. It now reads a name as words only after "Send" (or a delayed "send"), after "Wait for", or after a rule's "When"; anything else stays as written. Every sentence of every fixture reads exactly as before. The match is one regex in a module attribute, compiled with the module, where it was built with Regex.compile! for every known name on every render. Tests pin a delayed send, a known name outside event position, and a set step and a decision drawn through a real view model, each with a one-line sabotage note. Refs: se-7e84
johnnyt
force-pushed
the
se-7e84-event-phrasing-once
branch
from
September 30, 2026 00:25
af4ff22 to
69a4b04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: se-7e84
What
The Plan panel draws a block's sentence through
StatifierExamplesWeb.EventPhrasing.sentence/1, which read a known event name as words wherever it stood in the sentence. A known name outside event position - a value a step sets, a decision's arm - would have been reworded mid-sentence.EventPhrasing.line/1now reads a name as words only in event position: after "Send" (or a delayed "send"), after "Wait for", or after a rule's "When". Anything else stays as written; the moduledoc's table says the same.The match is now one regex in a module attribute (
@event_position), compiled with the module. Before,line/1built one pattern per known name withRegex.compile!/1on every render.Evidence
sentence/1, reads the same before and after (a dump of every node of every fixture, compared byte for byte). Every phrased sentence in the two library documents already has its name in event position.mix qualitygreen on the committed tree: 634 of 634 tests, 84.8% coverage, Dialyzer and Credo clean. The commit was made on the byte-identical tree the gate ran on.Review
Tier: gate (an app module with no contract surface a host reads; under the size threshold). In-turn review: the diff was re-read against the bead's acceptance. Event position only: the regex's three alternatives and the fallback
nil -> wholeinphrased/4, pinned by the two outside-position tests. Compiled once:Regex.compile!no longer appears in the module; the one regex is@event_position. A decision's sentence names its arm asWhen "<suffix>", and statifier_blocks'Core.Branchaccepts onlyarm_[a-z][a-z0-9_]*slot names, so a decision's sentence cannot carry a dotted name today; its condition is never part of the sentence. The moduledoc sentence saying the map and description region draw throughsentence/1was out of date - they takephrase/1- and now says so.Provenance
phrase/1through statifier_blocks' own phrasing rules, which still read a known name in any position. No fixture sentence differs between the two today; bringing the package's rule to event position is a statifier_blocks change and is outside this PR.