Files
learning-hour-maker/ideas/split-loop-with-lambda/exercise/rehearsal-runs/B+Q/measure.txt
T
Your Name b993f25c53 Add agent rehearsal harness, findings, and per-run evidence for split-loop-with-lambda
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).
2026-09-27 17:36:19 +00:00

36 lines
1.7 KiB
Plaintext

--- Run B+Q ---
session file: /tmp/rehearsal/runs/B+Q/session/2026-09-27T15-19-54-490Z_01a0e373-8779-7024-b65c-e6e4e01334b3.jsonl
model: Qwen/Qwen3.6-35B-A3B
session span: 72.5 s
assistant messages: 17
tool calls: 17 total
bash 8
read 5
edit 4
tokens input: 253072
tokens output: 6343
tokens cacheRead: 0
tokens cacheWrite: 0
tokens reasoning: 637
tokens TOTAL (sum): 260052
--- /usr/bin/time -v (wall clock + max RSS) ---
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:12.70
Maximum resident set size (kbytes): 255980
Exit status: 0
--- pi stdout (last 15 lines) ---
All three steps are complete. The code compiles successfully. Here's a summary of the refactoring:
---
## Final Diff for `LongRangeForecasts.java`
| Change | Description |
|--------|-------------|
| **Import** | Added `java.util.function.LongFunction` |
| **New no-arg overload** | `longRangeForecast()` — wraps the scorer in a lambda and delegates to the parameterized version |
| **Signature change** | `longRangeForecast(String quarter)` → `longRangeForecast(LongFunction<Boolean> dayOffsetToWeather)` — removed `quarter` param and its Q1/Q4 block |
| **Lambda extraction** | Removed the internal `dayOffsetToWeather` lambda definition; it's now passed as a method parameter |
| **New helper method** | `collectExpectedWeather(List<Instant>, LongFunction<Boolean>)` — extracted weather-collection loop, receives the dependency-injected lambda |
The key outcome is that `Scorer` is no longer directly invoked inside `longRangeForecast`. Its behavior is injected via the `LongFunction<Boolean>` parameter, making the method testable and decoupled from the external dependency.