V48, plain clauses: 100 at familiarity 4
After V46 and V47 reached 100 under the stricter readings, both at familiarity 3, the question was whether the strict rules had made a familiar 100 impossible. My answer was that they hadn’t. The strict readings target two Phoenix defaults, the generated FormComponent and a folder name, and neither asks a team to learn anything. The familiarity cost had always come from my wiring machinery. V48 tests that claim on the smallest change that could prove it.
Two changes, nothing else
V45 lost exactly 1.5 points to the 2026-10-02 readings, so V48 makes exactly two changes to it.
State, notFeatures. Spray’s features are compositions: “Each feature creates instances of domain abstractions, configures the instances with feature specific details, and connects them together” (§2.2). V45’sCart,UndoandCheckoutare state and rules with ports, so they’reGoodDeal.Statenow. It’s a rename, and V45’s suite passed it unchanged.- A record form instead of
FormComponent. The product pages place a genericrecord_formfunction component and wire a smallRecordEditstate toSaveProduct, with the samewire/3clauses and runner as the cart page. It’s the code V46’s product pages already ran.
Everything else is V45: plain LiveView pages, {state, outputs} modules in the page’s assigns, one wire/3 clause per port, named store-work instances, and a one-line coverage test per page.
Why it needs no Features layer
Spray adds features when the application “will go over the 500 line complexity limit” (§2.2). V48’s cart page is 484 lines with its template, and its portal 308. Neither is over the limit, so the rules don’t ask for stories, and V48 doesn’t add them. A page that grows past the limit would split the way V46 splits.
What it scores
| V45 | V48 | V46 | |
|---|---|---|---|
| Full checklist, by hand (2026-10-02 readings) | 99 | 100 | 100 |
ala_lint default / --strict / --super-strict | 100 / 100 / 99 | 100 / 100 / 99 | 100 / 100 / 99 |
Rules met under --strict (of 10 checked) | 9 | 10 | 10 |
| Message hops | 0 | 0 | 0 |
| Tests | 116 | 119 | 124 |
| Mean / median time per test | 4.8 / 0.9 ms | 5.8 / 1.2 ms | 6.0 / 1.2 ms |
Non-blank lines in lib/ | 4,254 | 4,326 | 4,868 |
| Familiarity | 4 | 4 | 3 |
The walk finds nothing to deduct, and super-strict’s one finding is the shared Cart aggregate, the judgement call every storefront variant makes the same way.
What it shows
A full score under Spray’s strict rules doesn’t require new machinery. What V48 asks of a Phoenix developer beyond phx.gen.live is what V45 asked: features as {state, outputs} modules, a small runner, and one clause per port. V49 goes one step further, to familiarity 5, by dropping the runner and using LiveComponents.
The cart page, drawn from its clauses
Paradigms.Drawing.mermaid/1 reads the page’s own source: each wire/3 clause, each handle_async/3 clause and the undo timer’s clause. A run in a clause is a solid arrow to the feature whose input it calls, and a feed names what it asks on the way. Any other call is a dotted arrow to the page effect it lands on. It reads clauses by the shape this page writes them in, so a clause written another way wouldn’t be drawn. A test checks the edges a reader would look for first.
flowchart LR
payment -->|"done → succeeded"| checkout
payment -->|"done → failed"| checkout
timer_undo -->|"fired → expire"| undo
cart -.->|"rows"| page_stream["page: stream"]
cart -.->|"summary"| page_assign["page: assign"]
cart -.->|"changed"| call_apply_change["call Carts.apply_change"]
cart -->|"removed → capture"| undo
cart -->|"saved → stash"| saved
cart -.->|"saved"| page_put_flash["page: put_flash"]
cart -->|"line → toggle"| wishlist
cart -.->|"promo_applied"| page_assign["page: assign"]
cart -.->|"promo_applied"| page_put_flash["page: put_flash"]
cart -.->|"promo_rejected"| page_assign["page: assign"]
cart -.->|"promo_rejected"| page_put_flash["page: put_flash"]
cart -->|"checkout_started → start"| checkout
cart -->|"checkout_requested → pay"| checkout
undo -.->|"captured"| page_assign["page: assign"]
undo -.->|"captured"| timer_undo["timer undo"]
undo -.->|"restored"| timer_undo["timer undo"]
undo -.->|"restored"| page_assign["page: assign"]
undo -->|"restored → receive"| cart
undo -.->|"restored"| page_put_flash["page: put_flash"]
undo -.->|"expired"| page_assign["page: assign"]
undo -->|"expired → confirm_removal"| cart
saved -.->|"rows"| page_stream["page: stream"]
saved -.->|"count"| page_assign["page: assign"]
saved -->|"moved → receive"| cart
saved -.->|"moved"| page_put_flash["page: put_flash"]
wishlist -.->|"rows"| page_stream["page: stream"]
wishlist -.->|"count"| page_assign["page: assign"]
wishlist -.->|"ids"| page_assign["page: assign"]
wishlist -.->|"added"| page_put_flash["page: put_flash"]
wishlist -.->|"dropped"| page_put_flash["page: put_flash"]
wishlist -->|"taken via add_line → receive"| cart
wishlist -.->|"taken"| page_put_flash["page: put_flash"]
ui -.->|"tab"| page_assign["page: assign"]
checkout -.->|"step"| page_assign["page: assign"]
checkout -.->|"step"| page_patch["page: patch"]
checkout -.->|"form"| page_assign["page: assign"]
checkout -.->|"address"| page_assign["page: assign"]
checkout -.->|"blocked"| page_put_flash["page: put_flash"]
checkout -.->|"ready_to_pay"| payment["task charge"]
checkout -.->|"done"| call_settle["call settle"]
checkout -.->|"done"| page_push_navigate["page: push_navigate"]
Rescored 2026-10-03: 99
Spray’s §6.17.2 is now read strictly under R10. The small fix is in: checkout gets the cart’s id and stored lines, {cart_id, items}, not the cart, and owns the readiness rule. What remains is the shared entity: the portal’s order lines are built on the storefront’s cart, which carries promo, gift-wrap and shipping state, one use case’s data in a struct another use case shares (−1). The fix is to split the storefront’s concerns out of the struct the portal uses; no variant has done that yet. 100 becomes 99. Lint under --strict is 99, meeting 9 of 10 rules: the linter now scores the shared aggregate from --strict up.
Rescored 2026-10-03 (later): 100
The shared entity is gone. The portal’s OrderLines has its own struct and pricing (subtotal, volume tier, shipping), and builds, like the storefront’s cart, on a new Lines domain abstraction: plain functions over a list of stored order lines (find, add, change a quantity, remove, set stock), holding no prices, codes or flags of any use case. The cart lost set_discount/2, which its own doc said was “added for the portal consumer”. With checkout already getting only {cart_id, items}, R10 is met, and 99 becomes 100. Lint under --strict is 100, meeting 10 of 10 rules. The linter needed one correction to read it: a story that only builds the cart (Cart.new) creates an instance, which a Spray feature does (§2.2), and doesn’t know its data, so it no longer counts as a reader.
The code is in ala_variants_elixir/v48-plain-clauses.