Skill's compile-time divergence tripwire is only half-enforced #31

Closed
opened 2026-08-27 14:59:47 +00:00 by logaritmisk · 1 comment
Owner

The #19 design relies on constructing Skill field-by-field in TimeSlice::filtered_step, so that adding a field to Skill becomes a compile error there rather than a silently-defaulted wrong answer. That holds in filtered_step.

But TimeSlice::add_events still constructs Skill { forward, elapsed, ..Default::default() }. So a new field added to Skill would break the build in filtered_step while being silently absorbed at the other construction site — which is the site that feeds production convergence.

Either construct field-by-field there too, or record why the asymmetry is acceptable. Found during the final whole-branch review of the #19 branch; the code is correct today, this is about the tripwire the design depends on.

The #19 design relies on constructing `Skill` field-by-field in `TimeSlice::filtered_step`, so that adding a field to `Skill` becomes a compile error there rather than a silently-defaulted wrong answer. That holds in `filtered_step`. But `TimeSlice::add_events` still constructs `Skill { forward, elapsed, ..Default::default() }`. So a new field added to `Skill` would break the build in `filtered_step` while being silently absorbed at the other construction site — which is the site that feeds production convergence. Either construct field-by-field there too, or record why the asymmetry is acceptable. Found during the final whole-branch review of the #19 branch; the code is correct today, this is about the tripwire the design depends on.
Author
Owner

Fixed in eeb43e3. TimeSlice::add_events now spells out all four Skill fields instead of ..Default::default(), so a new field is a compile error at both construction sites rather than only in filtered_step.

The values are unchanged — backward: N_INF, likelihood: N_INF is exactly what Skill::default() supplied — so this is purely about restoring the tripwire the design leans on.

Fixed in `eeb43e3`. `TimeSlice::add_events` now spells out all four `Skill` fields instead of `..Default::default()`, so a new field is a compile error at both construction sites rather than only in `filtered_step`. The values are unchanged — `backward: N_INF, likelihood: N_INF` is exactly what `Skill::default()` supplied — so this is purely about restoring the tripwire the design leans on.
logaritmisk added the testing label 2026-09-07 13:53:35 +00:00
Sign in to join this conversation.