These are written into persisted history, so a rung id is immutable once
shipped. A rung whose movement changes gets a NEW id; renaming or reusing
one orphans real training records. The template type enforces only the pattern
prefix; client/src/domain/ladders.ts owns the rest of the convention.
── Why RungId is here and Rung is not ───────────────────────────────────
This split looks arbitrary. It is not, and the deciding question is never "is
this a type or is it behaviour" — everything in this file is a type. It is
does the service have to understand this value to do its job?
RungId appears inside ExerciseRecord, which appears inside SessionResult,
which is what history is made of — and the service validates the document it
stores. So a rung id is part of the wire contract: both ends have to agree on
what one looks like, and validateRungId in the client codec and the service's
shallow check are both, ultimately, checking a shape declared here.
Rung, Ladder and Modifier are the opposite case. The server never sees a
rung. It stores a document containing rung ids and never resolves one to
the movement it names — no route reads cues, figureId, range or
safetyCritical, and none ever should, because interpreting the programme is
the client's job. Moving them here would be free today and would quietly make
the service a consumer of training content, so that the next person to add a
ladder would have to wonder whether the API changed. It did not, and this split
is what keeps that true.
The short version: ids cross the wire, content does not.
Stable rung identifier, e.g.
push-04-full.These are written into persisted history, so a rung id is immutable once shipped. A rung whose movement changes gets a NEW id; renaming or reusing one orphans real training records. The template type enforces only the pattern prefix;
client/src/domain/ladders.tsowns the rest of the convention.── Why
RungIdis here andRungis not ───────────────────────────────────This split looks arbitrary. It is not, and the deciding question is never "is this a type or is it behaviour" — everything in this file is a type. It is does the service have to understand this value to do its job?
RungIdappears insideExerciseRecord, which appears insideSessionResult, which is whathistoryis made of — and the service validates the document it stores. So a rung id is part of the wire contract: both ends have to agree on what one looks like, andvalidateRungIdin the client codec and the service's shallow check are both, ultimately, checking a shape declared here.Rung,LadderandModifierare the opposite case. The server never sees a rung. It stores a document containing rung ids and never resolves one to the movement it names — no route readscues,figureId,rangeorsafetyCritical, and none ever should, because interpreting the programme is the client's job. Moving them here would be free today and would quietly make the service a consumer of training content, so that the next person to add a ladder would have to wonder whether the API changed. It did not, and this split is what keeps that true.The short version: ids cross the wire, content does not.