New in-theme classes: Buyers computes a shopping-list total, PriceList
stands for the pricing service (random surge, flaky test). One loop, one
lambda-able expression — the third example teaches the move with nothing
else in the way. Pristine repo + reference solution (extract lambda,
slide, extract method with Func<IceCream,int> parameter, pure-lambda
test) + storyboard in the established style. Mirrors the kata's C#
setup (net7.0, MSTest); needs a build check on a machine with the SDK.
Demo on the messier sibling of the exercise method: three unwanted
dependencies in one loop (Scorer incl. static field write, System.out,
clock — clock stripped in 2-min prep). Same six mechanics with SVGs in
the storyboard style, ends green via overload + pure-lambda approval
test. Pointer added to the learning hour's demo section.
Step-by-step refactoring instructions as a single markdown handout with
one diagram per step (legend + steps 0-3, overload inset, pure test,
debrief slides for the dead call and the drift anti-pattern). Derived
from the pattern draft, the learning hour plan, and the rehearsal
findings; slide-ready for later.
Six scripted pi sub-agent runs (3 tool regimes × 2 models) rehearsed the
exercise; deterministic gate = solution test + approved file. Key results:
mandated CLI triples cost on the strong model (4:06 vs 0:39, PASS both);
weak model fails only under the mandate (A+Q), passes when free or optional.
Drift documented with code: scorer.updateSelection left inside the extracted
method (A+Q, C+Q). Harness in tools/rehearse; summary in
rehearsal-findings.md; per-run evidence in rehearsal-runs/; cheat sheet in
rehearse-with-agent.md corrected (lambda-typed parameters unsupported).
- Samman learning hour: 5/5/10/25/5 outline; pairs stop at extracted
method taking the lambda as a parameter
- exercise/java: pre-factored variant of the kata (Q1/Q4 dead branch
stripped, dates as constant), approval test red/flaky by design
- exercise/solution: collectExpectedWeather(LongFunction<Boolean>) +
no-arg overload; deterministic approval test (all-sunny lambda)
- rehearse-with-agent.md: rehearsal setup with qwen + java-refactoring-mcp
Joint work with Emily Bache, based on the IceCreamForecasting-Refactoring-Kata.
Names the mechanics (introduce lambda -> slide statement -> extract method
taking the lambda) used when plain Split Loop stalls because the variable
to slide is a function, not a value.
- Add OrderBookDomain: in-memory order book with Pending →
WaitingForPayment → Fulfilling → Delivered state machine, payment
window based on passed-in timestamps, cancellation rules
- Add OrderBookTests: 7 integration tests in given/when/then/when/then
anti-pattern style as starting material for the exercise
- Learning hour: add round 2 where participants create the example
themselves before showing it to the agent (no refactored test given)
- Fix sln: OrderTests Debug config was mapped to Release