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
Exercise project with Order domain and NUnit tests demonstrating
the 'show, don't tell' pattern for guiding coding agents.
- 1 refactored test using custom matcher (the example)
- 5 unrefactored tests with multiple asserts (the practice)
- OrderStateConstraint custom matcher for NUnit 3
- Skill now reflects actual patterns: single 35-min practice (65%),
two rounds (23%), with demo (28%)
- Average times per block type from library analysis
- Output format matches Samman Markdown convention
- README updated with statistics
- New pi skill to guide creation of Samman-style learning hours
through learning goals, timetable, and the 4 C's
- Updated README with links to Samman resources and 4C model