writeModelSurfaceStamp function
Writes surface to the stamp file. Called by bin/generate_som.dart, never
by a test — a test that could re-stamp would only ever agree with itself.
Implementation
void writeModelSurfaceStamp(
ModelSurface surface, {
required String clitoolRoot,
}) {
final file = File(p.join(clitoolRoot, modelSurfaceStampPath))
..parent.createSync(recursive: true);
const encoder = JsonEncoder.withIndent(' ');
file.writeAsStringSync('${encoder.convert(surface.toJson())}\n');
}