okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-clean-3 (321794636): docs and history (cleanup step 3, items 3.0-3.10); release manifest and capability table with checks, history/ with pointers, link check, tools/ split, bench index; owner OK'd the wording 11-082b36e8a02

main
4.4 KiB87 linesraw

05 · Serving

Route #/serving · File src/screens/Serving.tsx (329 lines)

The screen for people wiring Strata into something else. It is the most "developer" surface in the app, which makes it the one most likely to be skimmed by someone who does not read API documentation for fun.

What it is today

  • Local API card — base URL, OpenAI-compatible and Anthropic-compatible endpoint chips, a copy button, the model id, and a "Serving · bind locally" pill.
  • Access card — toggles for other devices and network access, an API key row with reveal/copy, and a plain-language reassurance line.
  • Requests table — time, client, endpoint, tokens in/out, duration, state. A row opens a detail drawer.
  • Metrics — running, waiting, and a few counters.
  • Empty state for a fresh install.

Where it falls short

  1. The endpoints are shown as chips, not as usable snippets. Fixed. The endpoint rows printed a path fragment in muted mono with no way to take it, so wiring a client meant reading /chat/completions off the screen and typing the host yourself. Each row now carries its full URL and its own copy button. (A base-URL copy button did already exist — the plan over-claimed there.)
  2. No example request. Fixed. A curl block, switched between OpenAI and Anthropic formats, with a copy button. Verified by running the copied command against the host: it returns real SSE completion chunks, and the JSON body parses.
  3. Security state is ambiguous. "Other devices" and "network access" toggles exist beside an API key, but nothing states plainly whether the server is reachable from outside this machine, which is the actual question.
  4. The requests table has no filtering or sorting. A hundred rows, no way to find the failed one — despite the state column having a colour.
  5. Failures are indistinguishable from successes at a glance. The state pill is the only signal, and it is small.
  6. The detail drawer is a dead end. It shows a request's facts and offers Cancel; it does not offer "copy as curl", which is what you want when debugging a call the model answered badly.
  7. The table does not say when it is empty because nothing has been asked vs when it is filtered to nothing.

The plan

Substance — make it pasteable

  1. Replace the endpoint chips with a copyable base URL block and a one-line example request beneath it, switched by a small OpenAI / Anthropic segmented control. One block, one copy button, no assembly.
  2. Add "Connect a client" with two or three concrete recipes — an editor, a CLI, a script — each copyable. This is the screen's real job.
  3. State the exposure plainly: Only this computer can reach it or Anyone on your network can reach it, as a sentence with a status dot, above the toggles rather than implied by them.
  4. Make the API key state visible at rest — present / not set — rather than requiring the reveal toggle to find out.

Hierarchy

  1. Order by intent, not by implementation: Connect to it → Who can reach it → What it has been doing. Today the layout is API, access, table, which is close but reads as three equal cards.

Fluidity

  1. Filter and sort the request table, with the state column as a filter rather than only a colour. Failed-only is the view people actually want.
  2. Row state gets an icon as well as a colour, so it survives greyscale.
  3. The detail drawer gains "Copy as cURL" and the full request/response payload, collapsed.

Motion

InteractionSpec
Endpoint protocol switchPanel cross-fade only, --st-t-control; never both visible
Copy confirmationCheck icon swap + a toast; the button does not move
Request row → drawerExisting drawer slide, --st-t-local; no shared-element morph — the sheet's own transform owns the motion
New row arrivingst-enter, --st-t-local, 6 px, capped at the newest 6 rows

Verification

  • Shipped and verified: every endpoint row copies a full URL, the request block copies a curl that executes, and the Anthropic format differs from the OpenAI one (max_tokens, /messages).
  • Assert the exposure sentence matches the toggle state in all four combinations.
  • Assert request rows expose state as both icon and colour.
  • flow serving: toggle each access switch, filter to failures, open a drawer.
1# 05 · Serving
2
3**Route** `#/serving` · **File** `src/screens/Serving.tsx` (329 lines)
4
5The screen for people wiring Strata into something else. It is the most
6"developer" surface in the app, which makes it the one most likely to be skimmed
7by someone who does not read API documentation for fun.
8
9## What it is today
10
11- **Local API card** — base URL, OpenAI-compatible and Anthropic-compatible
12  endpoint chips, a copy button, the model id, and a "Serving · bind locally"
13  pill.
14- **Access card** — toggles for other devices and network access, an API key row
15  with reveal/copy, and a plain-language reassurance line.
16- **Requests table** — time, client, endpoint, tokens in/out, duration, state.
17  A row opens a detail drawer.
18- **Metrics** — running, waiting, and a few counters.
19- **Empty state** for a fresh install.
20
21## Where it falls short
22
231. ~~The endpoints are shown as chips, not as usable snippets.~~ **Fixed.** The
24   endpoint rows printed a *path fragment* in muted mono with no way to take it,
25   so wiring a client meant reading `/chat/completions` off the screen and typing
26   the host yourself. Each row now carries its full URL and its own copy button.
27   (A base-URL copy button did already exist — the plan over-claimed there.)
282. ~~No example request.~~ **Fixed.** A `curl` block, switched between OpenAI and
29   Anthropic formats, with a copy button. Verified by *running* the copied
30   command against the host: it returns real SSE completion chunks, and the JSON
31   body parses.
323. **Security state is ambiguous.** "Other devices" and "network access" toggles
33   exist beside an API key, but nothing states plainly whether the server is
34   reachable from outside this machine, which is the actual question.
354. **The requests table has no filtering or sorting.** A hundred rows, no way to
36   find the failed one — despite the state column having a colour.
375. **Failures are indistinguishable from successes at a glance.** The state pill
38   is the only signal, and it is small.
396. **The detail drawer is a dead end.** It shows a request's facts and offers
40   Cancel; it does not offer "copy as curl", which is what you want when
41   debugging a call the model answered badly.
427. **The table does not say when it is empty because nothing has been asked** vs
43   when it is filtered to nothing.
44
45## The plan
46
47### Substance — make it pasteable
481. **Replace the endpoint chips with a copyable base URL block** and a
49   one-line example request beneath it, switched by a small OpenAI /
50   Anthropic segmented control. One block, one copy button, no assembly.
512. **Add "Connect a client" with two or three concrete recipes** — an editor,
52   a CLI, a script — each copyable. This is the screen's real job.
533. **State the exposure plainly**: `Only this computer can reach it` or
54   `Anyone on your network can reach it`, as a sentence with a status dot, above
55   the toggles rather than implied by them.
564. **Make the API key state visible at rest** — present / not set — rather than
57   requiring the reveal toggle to find out.
58
59### Hierarchy
605. **Order by intent, not by implementation**: *Connect to it* → *Who can reach
61   it* → *What it has been doing*. Today the layout is API, access, table, which
62   is close but reads as three equal cards.
63
64### Fluidity
656. **Filter and sort the request table**, with the state column as a filter
66   rather than only a colour. Failed-only is the view people actually want.
677. **Row state gets an icon as well as a colour**, so it survives greyscale.
688. **The detail drawer gains "Copy as cURL"** and the full request/response
69   payload, collapsed.
70
71## Motion
72
73| Interaction | Spec |
74|---|---|
75| Endpoint protocol switch | Panel cross-fade only, `--st-t-control`; never both visible |
76| Copy confirmation | Check icon swap + a toast; the button does not move |
77| Request row → drawer | Existing drawer slide, `--st-t-local`; no shared-element morph — the sheet's own transform owns the motion |
78| New row arriving | `st-enter`, `--st-t-local`, 6 px, capped at the newest 6 rows |
79
80## Verification
81
82- **Shipped and verified**: every endpoint row copies a full URL, the request
83  block copies a `curl` that executes, and the Anthropic format differs from the
84  OpenAI one (`max_tokens`, `/messages`).
85- Assert the exposure sentence matches the toggle state in all four combinations.
86- Assert request rows expose state as both icon and colour.
87- `flow serving`: toggle each access switch, filter to failures, open a drawer.