Two derivations from the same raw source will diverge, and the renderer picks the poorer one
Two memoised selectors were computed in parallel from the same API payload: one mapped services into typed objects carrying their work-order data, the other re-parsed the same slots into plain strings — and the display consumed the string version, so the richer derivation's output was computed and thrown away.
Resurfaces when
- a field exists in the API response but not on screen
- two selectors derived from the same payload
- a summary shows less than the detail view
- memoised transforms of the same source data
- porting a display that needs more fields than it shows
The lesson’s retrieval contract, weighted three times heavier than its body. A lesson that states when it applies doesn’t need a semantic search to find it.
The lesson
When the same raw payload is transformed in more than one place, the transformations drift, and nothing reports it: both run, both succeed, and the screen simply shows whichever one it happens to read. The symptom presents as missing data — a field that exists in the response and not on screen — which sends people to the API, then to the mapper, before anyone notices there are two mappers. Derive once and let the display narrow, rather than deriving twice at different fidelities. The boundary: independent selectors over the same source are fine when they answer genuinely different questions; the failure is two selectors answering the same question at different quality.
The failure that taught it
A summary strip showed a service's name but not its associated work order, while the reference showed the identifier, status and an icon. The payload carried the data and one selector already mapped it into typed objects with exactly the fields needed. A second selector, written separately, re-parsed the same slots into plain strings and dropped everything else — and that was the one the strip rendered, so there was nowhere for the missing fields to go.
How to apply it
When a field is present in the response but absent on screen, grep for every place that payload is transformed before touching the API or the component — the count is often more than one. Where two derivations exist, delete the narrower one and have its consumer read from the richer type. A selector returning an array of strings from a structured source is a strong signal that shape was discarded early.
Where this claim comes from
- Lessonhigh confidence
Two derivations from the same raw source will diverge, and the renderer picks the poorer one
- Distillationmechanism stated
Written from the mechanism, not the incident — which is what lets it transfer to code sharing nothing with the original.
- Scar2 occurrences
2 separate failures, recorded independently at the time. A clustering pass found they shared one cause.
- Evidence2 records
Referenced by content hash, never by path: entry slugs carry client and ticket names, so a lesson storing them could not be published at all. Resolving a hash needs a map that never leaves the machine. An agent running locally traces it with scar_evidence; nothing on this site can.
What happened when it was used
- 8
- retrieved
- 3
- acted on
- 1
- held up
- 0
- did not hold up
Applied 3 times. Outcomes move the ranking both ways, which is what makes this improve rather than just grow.