Skip to content

Tests the three flow patterns composed - #690

Merged
johnnyt merged 1 commit into
mainfrom
sb-2qag-flow-patterns-compose
Oct 9, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sb-2qag-flow-patterns-compose

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

What

One new test module, test/statifier_blocks/flow_patterns_composed_test.exs, and one fixture, test/fixtures/documents/flow_patterns/composed.json, compose the three documents docs/guides/flow-patterns.md shows one by one:

  • a core.parallel of optional arms (complete: "all"), each lane guarded by its own one-arm core.branch;
  • in the confirm lane, the bounded step: a core.group carrying the deadline recipe (a delayed core.send at the head of the body, a core.on_event with outcome abandon on the rail) around a core.await;
  • in the shelf lane, the park: a core.group whose body is one core.wait and whose rail carries two abandoning handlers.

The world is the guide's library hold: a hold is placed, the desk may be asked to confirm it within a day, the item may wait on the hold shelf for seven days, and the hold is closed when both lanes are done.

What the test asserts

  • Publish.findings/3 reports no error finding, the compile succeeds with no warning, and the engine parses the chart.
  • Each pattern's timer and interrupt lines in the compiled chart are the guide's own lines byte for byte (each one is also asserted on the page), found inside that pattern's own group, and each group inside its own lane; the optional-arm lines carry this document's lanes and guards.
  • Run with both lanes asked, each lane arms its own timer; at the one-day bound the confirm lane finishes and cancels its timer while the shelf lane stays parked; a collection then closes the hold. Run with only the confirm lane asked, only its timer is armed and the bound alone closes the hold. Run with neither asked, the hold closes at once with no timer.
  • Describe names every arm (both guards, both otherwise arms, every handler), and the Map titles both lanes and draws every interrupt edge and the one timer edge.

The deadline-handler sabotage

The acceptance first asked that dropping the deadline handler make a finding appear. It does not, and the clause now reads "drop the deadline handler: the compiled chart's interrupt-transition assertion goes red" (ruled by the operator, 2026-10-09): the sabotage turns the interrupt-transition assertion red; no Publish finding exists for a dropped deadline handler. With the handler dropped, Publish.findings/3 returns no finding and the compile no warning; what goes red is the compiled-chart test (the deadline's interrupt transition), the two run tests that ask for the confirm lane (the handler is no longer armed) and the Describe test (the handler's line). The note above the compiled-chart test records this. No file under lib/ changes.

Sabotage, one row per check

Mutation Went red
Fixture: deadline handler dropped from the confirm group's rail compiled-chart, both confirm-lane run tests and Describe test, on assertions; the Publish test stayed green
Fixture: the parallel's complete set to "every" Publish test, on the error-finding assertion
Cancels.onexit: no cancel emitted run (both asked) test on the cancelled-timer assertion; compiled-chart test on the onexit line
Fixture: the shelf branch's condition set to true run (neither asked) test; compiled-chart and Describe tests
Fixture: the lane shelf renamed rack Describe test, on the Map's lane titles; compiled-chart test
Fixture: the two branches' conditions swapped run (only the confirm lane asked) test, on the armed timers; compiled-chart test
Fixture: the deadline's send moved out of the group, ahead of it in the branch arm compiled-chart test, on the send being inside the group; Describe test

Each mutation was restored from a copy and checked byte-equal before the next.

Review and gate

No contract surface and no file under lib/ changes; the test module itself is just over 300 lines, so the review tier is the conductor's call. The pre-request review round ran in-turn before this request opened, and its accepted points are in this commit: each pattern's lines are asserted inside their own group and lane, and a one-lane run was added.

Gate: full mix quality green on the committed tree (3,960 of 3,960 tests, 95.3% coverage, dialyzer clean, ADR cites green). No changelog fragment: changelog.d/README.md excludes test harness and fixtures.

The ADR-0002 typed-send Note does not ride this request: the reference host's typed-send step had not moved to lib/ when this request was written. It has since moved, so whether that Note's pointer needs a dated Note of its own is a follow-up for this repo.

One new test module and one fixture compose the flow-patterns guide's
three documents in one: a core.parallel of optional arms, each lane
guarded by a one-arm core.branch, with the bounded step (a core.group
carrying the deadline recipe around a core.await) in one lane and the
park (a core.group whose body is a core.wait, with handlers on its
rail) in the other. The world is the guide's library hold.

The test asserts Publish.findings/3 reports no error, the compile
succeeds with no warning, each pattern's timer and interrupt lines are
the guide's own lines byte for byte inside that pattern's group and
lane, the chart runs with the bound failing open inside its lane, and
Describe and the Map name every arm.

Dropping the deadline handler raises no Publish finding and no
compile warning: the compiled-chart test, the two confirm-lane run
tests and the Describe test go red instead, as the note above the
test records.

No file under lib changes. Tests take no changelog fragment.

Gate: full mix quality green on this tree (3,960 of 3,960 tests,
95.3% coverage, dialyzer clean, ADR cites green).

Refs: sb-2qag
@johnnyt
johnnyt merged commit 2e6240c into main Oct 9, 2026
2 checks passed
@johnnyt
johnnyt deleted the sb-2qag-flow-patterns-compose branch October 9, 2026 19:08
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