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).
86 lines
4.2 KiB
Diff
86 lines
4.2 KiB
Diff
Only in /tmp/rehearsal/runs/B+Q/workspace: AGENTS.md
|
|
diff -ru '--exclude=target' /tmp/rehearsal/pristine/src/main/java/codingdojo/LongRangeForecasts.java /tmp/rehearsal/runs/B+Q/workspace/src/main/java/codingdojo/LongRangeForecasts.java
|
|
--- /tmp/rehearsal/pristine/src/main/java/codingdojo/LongRangeForecasts.java 2026-09-27 14:58:14.139167804 +0000
|
|
+++ /tmp/rehearsal/runs/B+Q/workspace/src/main/java/codingdojo/LongRangeForecasts.java 2026-09-27 15:20:44.058440673 +0000
|
|
@@ -3,19 +3,23 @@
|
|
import java.time.Instant;
|
|
import java.time.temporal.ChronoUnit;
|
|
import java.util.*;
|
|
+import java.util.function.LongFunction;
|
|
|
|
public class LongRangeForecasts {
|
|
|
|
private final Scorer scorer = new Scorer();
|
|
|
|
- public Map<IceCream, Integer> longRangeForecast(String quarter) {
|
|
+ public Map<IceCream, Integer> longRangeForecast() {
|
|
+ return longRangeForecast(
|
|
+ days -> {
|
|
+ scorer.updateSelection();
|
|
+ return scorer.lookupWeather(days);
|
|
+ });
|
|
+ }
|
|
+
|
|
+ public Map<IceCream, Integer> longRangeForecast(LongFunction<Boolean> dayOffsetToWeather) {
|
|
|
|
var result = new HashMap<IceCream, Integer>();
|
|
- if (Objects.equals(quarter, "Q1") || Objects.equals(quarter, "Q4")) {
|
|
- for (IceCream flavour : IceCream.values()) {
|
|
- result.put(flavour, 5);
|
|
- }
|
|
- }
|
|
for (IceCream flavour : IceCream.values()) {
|
|
result.put(flavour, 0);
|
|
}
|
|
@@ -25,14 +29,8 @@
|
|
Instant.parse("2023-06-05T14:00:00.000-07:00"),
|
|
Instant.parse("2023-06-23T14:00:00.000-07:00")
|
|
);
|
|
- List<Boolean> expectedWeather = new ArrayList<>();
|
|
- for (Instant interestingDate : interestingDates) {
|
|
- scorer.updateSelection();
|
|
- var forecastDate = Instant.parse("2023-04-26T14:00:00.000-07:00");
|
|
- long daysForward = ChronoUnit.DAYS.between(forecastDate, interestingDate);
|
|
- Boolean lookupWeather = scorer.lookupWeather(daysForward);
|
|
- expectedWeather.add(lookupWeather);
|
|
- }
|
|
+
|
|
+ List<Boolean> expectedWeather = collectExpectedWeather(interestingDates, dayOffsetToWeather);
|
|
|
|
for (IceCream flavour : result.keySet()) {
|
|
result.put(flavour, result.get(flavour) + 10);
|
|
@@ -46,4 +44,16 @@
|
|
}
|
|
return result;
|
|
}
|
|
+
|
|
+ private List<Boolean> collectExpectedWeather(
|
|
+ List<Instant> interestingDates,
|
|
+ LongFunction<Boolean> dayOffsetToWeather) {
|
|
+ List<Boolean> expectedWeather = new ArrayList<>();
|
|
+ for (Instant interestingDate : interestingDates) {
|
|
+ var forecastDate = Instant.parse("2023-04-26T14:00:00.000-07:00");
|
|
+ long daysForward = ChronoUnit.DAYS.between(forecastDate, interestingDate);
|
|
+ expectedWeather.add(dayOffsetToWeather.apply(daysForward));
|
|
+ }
|
|
+ return expectedWeather;
|
|
+ }
|
|
}
|
|
diff -ru '--exclude=target' /tmp/rehearsal/pristine/src/test/java/codingdojo/DailyForecastsTest.salesForecast.received.txt /tmp/rehearsal/runs/B+Q/workspace/src/test/java/codingdojo/DailyForecastsTest.salesForecast.received.txt
|
|
--- /tmp/rehearsal/pristine/src/test/java/codingdojo/DailyForecastsTest.salesForecast.received.txt 2026-09-27 14:58:16.443126144 +0000
|
|
+++ /tmp/rehearsal/runs/B+Q/workspace/src/test/java/codingdojo/DailyForecastsTest.salesForecast.received.txt 2026-09-27 15:20:48.113390371 +0000
|
|
@@ -1,4 +1,4 @@
|
|
Forecast at: 2026-09-27
|
|
Steve score: 9
|
|
-Julie score: 9
|
|
+Julie score: 3
|
|
Francis score: 3
|
|
diff -ru '--exclude=target' /tmp/rehearsal/pristine/src/test/java/codingdojo/LongRangeForecastsTest.longRangeForecast.received.txt /tmp/rehearsal/runs/B+Q/workspace/src/test/java/codingdojo/LongRangeForecastsTest.longRangeForecast.received.txt
|
|
--- /tmp/rehearsal/pristine/src/test/java/codingdojo/LongRangeForecastsTest.longRangeForecast.received.txt 2026-09-27 14:58:16.402126886 +0000
|
|
+++ /tmp/rehearsal/runs/B+Q/workspace/src/test/java/codingdojo/LongRangeForecastsTest.longRangeForecast.received.txt 2026-09-27 15:20:37.371523442 +0000
|
|
@@ -1 +1 @@
|
|
-{Strawberry:10, Chocolate:10, Vanilla:10, }
|
|
\ No newline at end of file
|
|
+{Strawberry:12, Chocolate:12, Vanilla:12, }
|
|
\ No newline at end of file
|