not_ready carries two different meanings, and FamiliarsReadsShell renders
both as "Loading…". Today only the harmless one is reachable; the misleading one
becomes reachable when CaveFamiliarsSource lands.
The two meanings
The shell's own pre-fetch initial state. All five results start at the
NOT_READY constant (src/familiars/reads-shell.tsx:41, used at lines 122–131)
before any read is issued. "Loading…" is accurate here.
The adapter's "no usable client". createQueryAdapter returns not_ready
when it is disposed or getClient() yields nothing
(src/lib/sdk/query-adapter.ts:87 and :217). Here the app is disconnected or
torn down and no request is in flight, so "Loading…" tells the user something is
happening when nothing is.
statusMessage maps both to the same string
(src/familiars/reads-shell.tsx:43-47, where not_ready falls through to
loading).
Why it is latent rather than broken
The shell is currently only ever driven by MockFamiliarsSource, which never
returns not_ready (zero occurrences in src/familiars/mock-source.ts). So the
only reachable case today is the initial one, where the copy is correct.
It becomes reachable when CaveFamiliarsSource drives the shell through
QueryAdapter — the deferred half of the Stage 1 work, currently on #86, which
is blocked on the SDK release cut and its contract-canary re-pin.
Suggested fix
Distinguish the two at the point where they differ, rather than by string:
- give the shell its own initial sentinel (an
idle status, or a hasLoaded
flag) so the pre-fetch state is not spelled not_ready; or
- give the adapter's
not_ready its own message, something nearer
"Not connected to Cave." than "Loading…".
The first is probably cleaner, since the shell's initial state is genuinely a
different thing from the adapter's, and conflating them is what produced the
ambiguity.
Notes
Raised by Copilot on #89 (thread on src/familiars/reads-shell.tsx) and
deliberately not fixed there: with no way to reach the state, the change would
have been untestable and speculative. Filed here rather than tracked on #86
because #89 absorbed reads-shell.tsx into main, so #86 no longer touches the
file and would merge without ever visiting it.
Best fixed alongside, or immediately after, the change that makes
CaveFamiliarsSource drive the shell, when the state can actually be exercised
in a test.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KacEJmkX5GhkViPUhx9Mie
not_readycarries two different meanings, andFamiliarsReadsShellrendersboth as "Loading…". Today only the harmless one is reachable; the misleading one
becomes reachable when
CaveFamiliarsSourcelands.The two meanings
The shell's own pre-fetch initial state. All five results start at the
NOT_READYconstant (src/familiars/reads-shell.tsx:41, used at lines 122–131)before any read is issued. "Loading…" is accurate here.
The adapter's "no usable client".
createQueryAdapterreturnsnot_readywhen it is disposed or
getClient()yields nothing(
src/lib/sdk/query-adapter.ts:87and:217). Here the app is disconnected ortorn down and no request is in flight, so "Loading…" tells the user something is
happening when nothing is.
statusMessagemaps both to the same string(
src/familiars/reads-shell.tsx:43-47, wherenot_readyfalls through toloading).Why it is latent rather than broken
The shell is currently only ever driven by
MockFamiliarsSource, which neverreturns
not_ready(zero occurrences insrc/familiars/mock-source.ts). So theonly reachable case today is the initial one, where the copy is correct.
It becomes reachable when
CaveFamiliarsSourcedrives the shell throughQueryAdapter— the deferred half of the Stage 1 work, currently on #86, whichis blocked on the SDK release cut and its contract-canary re-pin.
Suggested fix
Distinguish the two at the point where they differ, rather than by string:
idlestatus, or ahasLoadedflag) so the pre-fetch state is not spelled
not_ready; ornot_readyits own message, something nearer"Not connected to Cave." than "Loading…".
The first is probably cleaner, since the shell's initial state is genuinely a
different thing from the adapter's, and conflating them is what produced the
ambiguity.
Notes
Raised by Copilot on #89 (thread on
src/familiars/reads-shell.tsx) anddeliberately not fixed there: with no way to reach the state, the change would
have been untestable and speculative. Filed here rather than tracked on #86
because #89 absorbed
reads-shell.tsxintomain, so #86 no longer touches thefile and would merge without ever visiting it.
Best fixed alongside, or immediately after, the change that makes
CaveFamiliarsSourcedrive the shell, when the state can actually be exercisedin a test.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KacEJmkX5GhkViPUhx9Mie