SP6 Task 2: the recurrent (secondary) caries transition on a FILLED surface.
The CARS group of the contextual popup drives the caries state-machine on a
surface that carries a filling:
score 0 (Sound) → remove the caries from the surface (revert to a plain
filling) and clear its severity;
score > 0 → add the caries to the surface (becomes recurrent /
subcaries-{surface}) and store the CARS value as its severity.
Guarded on the filling actually being present, so a CARS score never lands
on a surface without a filling (that would be primary caries, authored via
the depth group instead). Mutates state.caries (Set of caries-{surface})
and state.cariesSeverity (Map surface→0..6). Extracted so the two
transitions are unit-testable without the DOM.
SP6 Task 2: the recurrent (secondary) caries transition on a FILLED surface. The CARS group of the contextual popup drives the caries state-machine on a surface that carries a filling:
subcaries-{surface}) and store the CARS value as its severity. Guarded on the filling actually being present, so a CARS score never lands on a surface without a filling (that would be primary caries, authored via the depth group instead). Mutatesstate.caries(Set ofcaries-{surface}) andstate.cariesSeverity(Map surface→0..6). Extracted so the two transitions are unit-testable without the DOM.