Exercise: One Task, Two Skeletons
An experiment you can run with any agent. Same task, same prompt, two different skeletons.
The task for both runs: “Implement the bodies: record a vehicle test session, add distance samples, mark completion, and report total distance in km.”
Skeleton A
pub struct Session {
pub id: String,
pub state: String, // "created" | "running" | "done"
pub samples: Vec<f64>, // unit not stated
pub done: bool,
}
pub fn add_sample(s: &mut Session, v: f64) -> bool { todo!() }
pub fn finish(s: &mut Session) -> bool { todo!() }
pub fn total_km(s: &Session) -> f64 { todo!() }
Skeleton B
pub struct Meters(pub f64);
pub struct SessionId(u64);
pub struct Running { id: SessionId, samples: Vec<Meters> }
pub struct Finished { id: SessionId, total: Meters }
impl Running {
pub fn add_sample(&mut self, d: Meters) { todo!() }
pub fn finish(self) -> Finished { todo!() } // consumes the session
}
impl Finished {
pub fn total_km(&self) -> f64 { todo!() }
}
In pairs: list every defect that’s possible in the code generated for A and impossible in B. Work through the lifecycle of a session: creation, sampling, finishing, reporting.