E0121: skeleton_lock
E0121 skeleton_lock — a skeleton differs from the one skeleton.lock holds (frozen with soma skeleton --freeze).
A compile-time error of soma check, the checker of the Soma programming language (soma explain E0121).
The rule
soma skeleton app.cell --freeze writes skeleton.lock, and from then on soma check refuses with E0121 any program in that directory whose skeletons differ from the frozen ones, printing the changed lines. Here a body wrote log outside its frame, and the frame was widened (writes log added to signal pay) to make that error go away. Restore the frozen skeleton and fix the body instead; when the design itself must change, accept it on purpose with soma skeleton app.cell --amend.
A program that triggers it
wrong.cell
skeleton Orders {
memory {
log: Map<String, String> [persistent]
}
state flow {
initial: placed
placed -> paid
paid -> shipped
}
face {
signal pay(id: String) -> String moves placed -> paid writes log
signal ship(id: String) -> String moves paid -> shipped writes log
}
}
flesh Orders {
on pay(id) {
transition(id, "placed", "paid")
log.set(id, "paid")
return "paid"
}
on ship(id) {
transition(id, "paid", "shipped")
log.set(id, "shipped")
return "shipped"
}
}What soma check prints:
$ soma check wrong.cell
error: skeleton `Orders` differs from skeleton.lock:
- signal pay(id: String) -> String moves placed -> paid
+ signal pay(id: String) -> String writes log moves placed -> paid
(in `Orders`: signal pay)
the skeleton is frozen: restore it, or accept the change on purpose with `soma skeleton right.cell --amend`
= code: E0121
✗ 1 error(s), 0 warning(s).The fix field of soma check --json: skeleton `Orders` differs from skeleton.lock:
- signal pay(id: String) -> String moves placed -> paid
+ signal pay(id: String) -> String writes log moves placed -> paid
(in `Orders`: signal pay)
the skeleton is frozen: restore it, or accept the change on purpose with `soma skeleton right.cell --amend`
The fix
On line 11, signal pay(id: String) -> String moves placed -> paid writes log becomes signal pay(id: String) -> String moves placed -> paid; line 19 is removed.
wrong.cell → right.cell
--- wrong.cell
+++ right.cell
@@ -9,5 +9,5 @@
}
face {
- signal pay(id: String) -> String moves placed -> paid writes log
+ signal pay(id: String) -> String moves placed -> paid
signal ship(id: String) -> String moves paid -> shipped writes log
}
@@ -17,5 +17,4 @@
on pay(id) {
transition(id, "placed", "paid")
- log.set(id, "paid")
return "paid"
}With the fix, soma check accepts the program:
$ soma check right.cell
✓ All checks passed.