Skip to content

Phrases events only where they are events - #171

Merged
johnnyt merged 1 commit into
mainfrom
se-7e84-event-phrasing-once
Sep 30, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-7e84-event-phrasing-once

Conversation

@johnnyt

@johnnyt johnnyt commented Sep 30, 2026

Copy link
Copy Markdown
Member

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/1 now 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/1 built one pattern per known name with Regex.compile!/1 on every render.

Evidence

  • Every sentence of every fixture on the page, drawn through 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.
  • Tests pin a delayed send, a known name outside event position (a decision's arm, a set path, a name after a duration), and a set step and a decision drawn through a real view model. Each new test carries a one-line sabotage note; putting back the earlier any-position rule turns the two outside-position tests red, and narrowing the send rule to a capital "Send" turns the delayed-send test red.
  • Full mix quality green 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 -> whole in phrased/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 as When "<suffix>", and statifier_blocks' Core.Branch accepts only arm_[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 through sentence/1 was out of date - they take phrase/1 - and now says so.

Provenance

  • The fix takes the event-position rule rather than only a test pinning a decision (both halves of the acceptance hold). Decided under the bead's acceptance by the worker, 2026-09-29.
  • The map and the description region read phrase/1 through 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.

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
johnnyt force-pushed the se-7e84-event-phrasing-once branch from af4ff22 to 69a4b04 Compare September 30, 2026 00:25
@johnnyt
johnnyt merged commit 372a9cc into main Sep 30, 2026
3 checks passed
@johnnyt
johnnyt deleted the se-7e84-event-phrasing-once branch September 30, 2026 00:28
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