Repository navigation
One DeviceFault classifier, four thin translations (T-021) - #31
Merged
Merged
Conversation
…(T-021) "What kind of failure was that?" was hand-rolled at four call sites, each re-deriving the same answered-and-read / answered-but-undecodable / didn't-answer decision from an identical `catch is DecodingError`, and leaking `KitchenSyncClientError`/`DecodingError` across the seam. Add a pure `DeviceFault.classify(Error) -> DeviceFault` (undecodable / notFound / rejected(Int) / unreachable), tested directly at its interface (DeviceFaultTests, 5 cases, test-first). The four sites — refreshStatus, loadConfig, apply, refreshAll — now translate one fault into their own presentation enum; none re-inspect the transport error types. Distinct signals preserved (T-009/T-010/T-016/T-018 not re-collapsed). Full suite green: 148 tests, 0 failures. Claude-Session: https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6
Skeyelab
enabled auto-merge (squash)
July 17, 2026 05:15
Skeyelab
added a commit
that referenced
this pull request
Aug 23, 2026
…(T-021) (#31) "What kind of failure was that?" was hand-rolled at four call sites, each re-deriving the same answered-and-read / answered-but-undecodable / didn't-answer decision from an identical `catch is DecodingError`, and leaking `KitchenSyncClientError`/`DecodingError` across the seam. Add a pure `DeviceFault.classify(Error) -> DeviceFault` (undecodable / notFound / rejected(Int) / unreachable), tested directly at its interface (DeviceFaultTests, 5 cases, test-first). The four sites — refreshStatus, loadConfig, apply, refreshAll — now translate one fault into their own presentation enum; none re-inspect the transport error types. Distinct signals preserved (T-009/T-010/T-016/T-018 not re-collapsed). Full suite green: 148 tests, 0 failures. Claude-Session: https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6 Co-authored-by: Eric Dahl <edahl@nd.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"What kind of failure was that?" was hand-rolled at four call sites, each re-deriving the same
three-way decision and leaking
KitchenSyncClientError/DecodingErrorinto every view model.Networking/DeviceFault.swift—classify(Error) -> DeviceFault(undecodable/notFound/rejected(Int)/unreachable), tested directly at its interface (5 cases, test-first).refreshStatus,loadConfig,apply(DeviceDetailViewModel) andrefreshAll(DeviceListViewModel)translate one fault into their local enum; none re-inspect the transport error types.
https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6