Repository navigation
Commit 94527d5
authored
docs: make flux documentation match the code (#126)
* docs(runtime): describe runtime as engine-internal
The runtime package comment called runtime the recommended host entry
point, listed provider/catalog/config/credentials/setup/storage as the
packages hosts import, and claimed the registry holds 16 providers. The
host contract is engine/llm/graph/tools, rho imports none of those
packages directly, and catalog/registry defines 28 providers.
Rewrite the comment to say runtime is engine-internal and not covered by
engine.ContractVersion, and point at the registry instead of restating
its size (F294).
* docs: derive provider count, table and env example from the registry
AGENTS.md claimed "75+ LLM providers" while catalog/registry defines 28.
The README table said it was in registry SortOrder but was not, and
listed STEPFUN_API_KEY although StepFun reads STEP_API_KEY. .env.example
carried the same wrong StepFun variable plus FLUX_API_KEY, KIMI_API_KEY
and MINIMAX_API_KEY, which nothing in flux reads.
- AGENTS.md: state the 28 provider gateways in catalog/registry.
- README: reorder the table to real SortOrder, fix StepFun, add the
Z.AI and StepFun region options.
- .env.example: list exactly the registry CredentialEnv variables.
- catalog/registry/docs_test.go: fail when any provider count stated in
README, AGENTS.md, docs or runtime.go, the README table (IDs, order,
credential variables, fallbacks, regions) or the .env.example block
drift from registry.All() (F041, F294).
* fix(scripts): derive config-flow provider counts from the registry
test-config-flow.sh counted providers with `cd .. && grep flux/catalog/...`,
so any checkout not named "flux" reported 0 providers and failed, and it
printed "all 11 providers have live fetchers" while the registry holds 28.
`grep -c ... || echo 0` also produced "0\n0" on no match.
cd to the repo root once, compare the live-fetcher count to the registry
count instead of a hardcoded 11, and report the real numbers (F294).
* docs(grpc): describe the opt-in gRPC transport as it is
README called the gRPC surface a "dependency-free skeleton ... wired when
generated stubs are available" and the grpc.go package comment said flux
"does not currently import google.golang.org/grpc". In fact go.mod
requires google.golang.org/grpc directly (so it lands in consumers'
go.sum), server_grpc.go (tag grpc) serves flux.v1.ChatService/Chat with a
JSON codec and no protobuf stubs, and EngineChatService already adapts
conversation.Engine. The unit test comment also claimed the tagged test
covers the engine-backed round trip, but it uses a stub service.
- README: rewrite the section and the Quick Start dependency list.
- grpc.go / internal/grpc/README.md: state the real status (tagged JSON
transport, direct go.mod requirement, internal package, no caller
starts it) and drop the stale "until stubs are added" comments.
- grpc_engine_test.go: exercise EngineChatService over a store-backed
conversation.Engine without the build tag: aggregated deltas, saved
node ID, request fields forwarded, stream error surfaced, nil request
rejected (F042).
* docs(engine): document and guard the frozen engine-internal symbols
README and AGENTS.md said hosts depend only on engine/llm/graph/tools
and that credentials, provider and the rest are not shared contracts.
But the facade exposes engine-internal symbols: engine.MapStore,
DefaultStore and SetDefaultStore re-export credentials, Options.
SecretStore is a credentials.Store, OperationsGraphInput/Export alias
operationsgraph, and Options.RateLimitConfig/CacheConfig carry
provider/resilience and provider/cache structs (plus HeaderExtractor
and RateLimitHeaders transitively). Rho's import-path checks cannot see
through these aliases.
Narrowing the exports is not possible without breaking rho: its
production code uses engine.MapStore, DefaultStore, SetDefaultStore,
OperationsGraphInput and BuildOperationsGraph. So document the set as
frozen contract-v2 symbols instead:
- HOST-ENGINE-BOUNDARY.md: new "Frozen engine-internal types" table.
- README, AGENTS.md, engine/doc.go: point at it; replace the
nonexistent `client` package with `provider`.
- engine/host_surface_test.go: walk the exported surface of the four
contract packages with go/ast, follow engine-internal symbols through
struct fields, signatures and exported methods, and fail when the
reachable set differs from the frozen list or the doc omits one
(F043).
* docs(architecture): drop the nonexistent flux serve binary
docs/ARCHITECTURE.md advertised a Port 8080 badge, "Override: flux serve
<port>" and "Set via FLUX_API_KEY". flux is a library with no cmd/ and
no serve command, nothing reads FLUX_API_KEY, and internal/api's server
takes its key from api.Config.APIKey and its address from
ListenAndServe(addr); nothing in flux starts it.
Other claims in the same doc were also false: the provider-detection
table (openai is 19th, not 2nd, and detection reads the credential
store, not env vars), "blocking responses wrap the stream" (FluxClient.
Chat calls the provider's blocking Chat), sr.Events() (a field, not a
method), Retry-After "on 429 only", and the caching table (the exact
cache is provider/cache, the similarity cache is provider/embeddings).
docs/README.md listed docs/api/openapi.yaml (it is at the repo root),
three guides that do not exist, a Discussions link although Discussions
are disabled, and claimed the OpenAPI spec covers /v1/chat/completions,
/rerank and /ready, which it does not.
Rewrite those sections to match the code and note the OpenAPI gap
(F273).
* docs(agents): point AGENTS.md and the README tree at real files
AGENTS.md cited provider/stream.go, provider/resilience/fallback.go,
provider/errors.go and errors/errors.go (none exist), told contributors
to add providers as provider/<name>.go registered in
provider_registry.go, named provider.NewFluxClient and parseSSEStream
(neither exists), said DetectProvider checks env vars in
ANTHROPIC/OPENAI order, pointed "semantic caching" at the exact-match
cache, and described a parent graycode-eco/go.work that does not exist.
The README architecture tree listed errors/, catalog/legacy/ and
internal/version/ (none exist) and omitted the llm, graph and tools
contract packages.
- AGENTS.md: real paths and symbols, the actual add-a-provider flow
(registry spec, config profile, setup deployment case, live fetcher,
adapter only when not OpenAI-compatible), the real linter set, and
the no-go.work/no-replace rule.
- README: rebuild the architecture tree from the current layout.
- docs_paths_test.go: fail when a path cited in AGENTS.md or an entry in
the README.md / docs/README.md trees does not exist (F272).
* docs: correct five stale file paths in AGENTS.md
docs_paths_test.go asserts that every path-like token in AGENTS.md resolves to
a real file. Merging main's prose during the rebase reinstated citations that
had been fixed on this branch:
- provider/stream.go -> provider/core/stream.go
- provider/resilience/fallback.go -> router/router.go, router/deployment_router.go
- provider/errors.go -> provider/core/errors.go
- errors/errors.go -> types/errors.go
- provider/adapters/AnthropicClient -> provider/adapters/anthropic.go
---------1 parent 80371d9 commit 94527d5
15 files changed
Lines changed: 1089 additions & 181 deletions
File tree
- catalog/registry
- docs
- architecture
- engine
- internal/grpc
- runtime
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
| 15 | + | |
10 | 16 | | |
11 | | - | |
12 | 17 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
30 | 25 | | |
31 | | - | |
32 | | - | |
| 26 | + | |
33 | 27 | | |
34 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
80 | | - | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| |||
140 | 147 | | |
141 | 148 | | |
142 | 149 | | |
143 | | - | |
| 150 | + | |
144 | 151 | | |
145 | 152 | | |
146 | 153 | | |
147 | | - | |
| 154 | + | |
148 | 155 | | |
149 | | - | |
150 | | - | |
| 156 | + | |
| 157 | + | |
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
73 | | - | |
74 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
171 | 179 | | |
172 | 180 | | |
173 | 181 | | |
174 | | - | |
| 182 | + | |
175 | 183 | | |
176 | | - | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
| |||
199 | 207 | | |
200 | 208 | | |
201 | 209 | | |
202 | | - | |
| 210 | + | |
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
| 214 | + | |
| 215 | + | |
206 | 216 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | 217 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 218 | | |
223 | | - | |
224 | | - | |
225 | 219 | | |
226 | 220 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
230 | 225 | | |
231 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
232 | 229 | | |
| 230 | + | |
233 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
234 | 242 | | |
235 | | - | |
| 243 | + | |
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
| |||
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
292 | | - | |
293 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
294 | 305 | | |
295 | 306 | | |
296 | | - | |
297 | | - | |
298 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
299 | 315 | | |
| 316 | + | |
300 | 317 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
310 | 328 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
315 | 334 | | |
316 | 335 | | |
| 336 | + | |
317 | 337 | | |
318 | | - | |
319 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
320 | 341 | | |
321 | | - | |
322 | | - | |
323 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
324 | 348 | | |
325 | 349 | | |
326 | 350 | | |
| |||
0 commit comments