Full Review — PR #560 "Emit vLLM-compatible per-request metrics from runtime instants"
Head 046aaef, base main, 22 files, +1757/−77. Stacked on the still-open #548 (its commits are in this branch, so the diff against main mixes both); reviewed as the layer above #548, as the description instructs.
Recommendation: changes requested. Counts: 1 Blocker, 6 Should fix, 6 Subtract/Simplify, 5 Nits.
The mechanism is right-sized and in the right place: the worker owns every instant, the encoder owns placement, no HTTP-layer clock is read, and with the option off nothing is emitted or requested. Two findings from the previous head (ce44060) are genuinely fixed and are not re-reported (RequestTimes is now public/exported at metrics.rs:326 (not opened), server.rs:33 (not opened); Timing::streaming and record_commit are gone — Timing is {arrival_ns, times, generated}, encode.rs:73-79, with record_times at :243-247 its only writer), and the previous round's "false cost claim" blocker is withdrawn because commit 66245920 ("Reuse GraphKind::samples for model-step metrics and stamp scheduled time after packing") belongs to #548, exactly as the description states — it survives only as nit N1. What remains is one user-facing break of the documented enable path (the Blocker), reachability/doc gaps, and roughly 180 removable lines, most of them in one test file.
Key findings
- Blocker — the documented way to enable the feature fails every Ignition command.
docs/api.md:1007-1008anddocs/cli-design.md:1318,1349tell users to write[server] per_request_metrics = true, butignition/cli/config.py:23-24has no such key and:112-114raisesunknown key per_request_metrics in [server]. Every Ignition command loads and validates that same file. - Should fix — authorization is still unconfirmed, though the evidence gap is now closed. #551 is a reproducible defect report (llama-swap showing
-1rates) and the PR carries a live 40-check matrix, so the charter's "reproducible bug" gate is plausibly satisfied; but #551 is authored by the same contributor with no maintainer reply, and #552/#553 were stopped by review on charter grounds. One maintainer line settles it. - Should fix — the flag cannot express an explicit false, so a
[server] per_request_metrics = truefile or a saved Orbit group cannot be overridden for one run, contrary todocs/cli-design.md:1321-1322and:1337-1338. - Should fix — three documentation claims are wrong or unreadable from the document that makes them: the
docs/cli-design.md:736default for a flag shared byflare orbit run(which has no configuration path), thedocs/api.md:1040-1043null paragraph (a permanently-null field described as an unreached instant; then > 1null overstated), anddocs/api.md:1045-1050referencing aperformance/token_timestamps_nsshape the file never defines. - ~180 lines removable with no behaviour lost, ~110 of them in
phase_tests.rs: two new HTTP-level tests re-assert encoder rules and hand-roll plumbingserved_through_workeralready provides. A further ~37 lines are available if maintainers prefer the other consistent state for the config key (see B1, option 2). - Verified sound: placement for all four protocols, the
first_scheduled_nsearliest-value fold,RequestTimeslifetime through preemption,GraphKind::samples()equivalence, the option-off wiring, and theFinished-field-only event change.
Blockers
B1. The documented [server] per_request_metrics key is rejected by the Ignition schema, breaking every Ignition command
Where: docs/api.md:1007-1009; docs/cli-design.md:1318 (native flare run key list), :1349 (sample config block); ignition/cli/config.py:21-33 (_SECTIONS, server entry at :23-24), :37-53 (_BUILT_IN), :108-120 (_validate), :183-215 (write_initial). Loaders: ignition/cli/serve.py:127 (not opened),174,264,431,590; ignition/cli/bench.py:144 (not opened); ignition/cli/publishing.py:31 (not opened),73,174,194.
What is wrong.
docs/api.md:1007-1008: "flare run --enable-per-request-metrics, or[server] per_request_metrics = truein the host configuration".docs/cli-design.md:1343-1349puts# per_request_metrics = falseinside the[server]sample of the file thatdocs/cli-design.md:1311-1313says both readers share.ignition/cli/config.py:23-24defines_SECTIONS["server"]as exactly{host, port, api_key, thinking_token_budget, scheduler_checkpoint_extra_work_fraction}. Verified at head: noper_request_metrics.ignition/cli/config.py:112-114iterates every key and raisesUsageError(f"{path}: unknown key {key} in [{section}]")for anything outside the schema;:115-118would then demand a type entry (bool)._BUILT_IN(:37-53) has no default either (server entries are only:38-40), so aconfiguration.get("server.per_request_metrics")wouldKeyErroruntil both are added.docs/cli-design.md:1313states "Ignition and native Flare read this file";:1385-1387states "Ignition rejects any section or key outside its schema. Native Flare ignores keys it does not use, except in[prefix_cache]…". The file the new docs tell the user to edit is the file Ignition validates, and the key is outside its schema.- Every Ignition command loads it:
serve.py:127(not opened) (export),:174(_export_hosts),:264(_prepare),:431(debug-serve),:590(join);bench.py:144(not opened);publishing.py:31 (not opened),73,174,194(convert/edit/sign/combine). Following the new documentation therefore makesignition export— the model-preparation step that precedes any serving — fail withUsageError: unknown key per_request_metrics in [server].write_initial(config.py:183-215) also omits the key even thoughdocs/cli-design.md:1311-1312says the file is generated "with the resolved values present as comments".
Why it matters. This is not a doc typo: the enable path the PR documents is unusable for anyone who also prepares cores with Ignition, which is the supported workflow (docs/cli-design.md:1311-1313). The neighbouring keys show the required chain, and the new key copies only the Rust half: thinking_token_budget spans schema :23, built-in :39, validator, serve.py:486 (not opened) and template :192; scheduler_checkpoint_extra_work_fraction spans schema :24, built-in :40, validator :119-120, serve.py:487 (not opened) and docs/cli-design.md:1348. tests/cli/test_config.py:152-171 (not opened) already parametrizes unknown-key rejection, so CI would catch the omission the moment the key is added to the template without the schema entry — and catches nothing today. A repository-wide search finds per_request_metrics only in docs/, flare-cli/src/, flare/src/ and helios/src/: zero hits under ignition/ or tests/cli/. CI on the head commit reports no checks.
Requested change (one of two consistent states; the first is smaller in effort, the second in code).
- Add
"per_request_metrics": boolto_SECTIONS["server"](ignition/cli/config.py:23-24),"server.per_request_metrics": Falseto_BUILT_IN(:37-53), the commented line towrite_initial(:188-192),options["per_request_metrics"] = …besideignition/cli/serve.py:486-487(not opened), and one positive load test beside the existing negatives (tests/cli/test_config.py:152-171(not opened)). This introduces the first[server]key Ignition accepts but does not consume, so add the sentence that says so. Reproduce with oneignition exportwhile the config carries the documented line. - Or delete the file key rather than extending the strict reader: drop
flare/src/configuration.rs:34(not opened),flare/src/settings.rs:32(not opened) and:224(plus its test:76-87),flare/src/controller.rs:2566(not opened),flare-cli/src/config.rs:73-75(plus its test:222-234), thedocs/cli-design.md:736,1318,1349rows and thedocs/api.md:1007clause, keepingflare-cli/src/main.rs:355-357(not opened) andhelios/src/server/config.rs:353-357(not opened) (the flag still writes the value the runtime reads). That is ~37 fewer lines and also dissolves the file half of S2, but it removes the only non-CLI path — the desktop controller throughflare settings, which the description names — hence a product call, not a pure simplification.
Should Fix
S1. A maintainer still has to confirm that per-request response metrics are in scope
Where: charter "What gets merged"; AGENTS.md:165-169 (not opened), :188-193, :201-205; #551; #536; #548; #552; #553.
The charter merges PRs that address "a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs". #551 describes a reproducible defect — llama-swap v250 reads prompt/decode rates from a response-body object and shows -1 for Flare — and the PR now carries a 40-check live matrix plus llama-swap rates, so the evidence half of the gate is met. What is missing is authorization: #551 was opened by the same contributor (GitHub association NONE) on 2026-11-27 with zero comments, and the maintainer-authored issue in this area, #536, asks for Prometheus latency histograms and process_* collectors, delivered by #548 — not for a response-body object. Both predecessors were halted by review on exactly this ground (#553: "Review Stopped … low value or does not align with the project charter", 2026-11-27; #552 likewise), and the charter's roadmap (in-process Rust SDK #6, Engram tables #267, FlashInfer fix #215) does not include response-body metrics. vLLM appears under "Alternatives / Competitors", so "vLLM has it" is not itself a merge reason. Requested change (no code): a maintainer comment on #551 or in the PR confirming the scope, and a description that leads with the llama-swap defect rather than with vLLM field parity.
S2. The flag cannot express an explicit false
Where: flare-cli/src/cli.rs:646-649 (not opened) (OrbitRun) and :860-863 (Run) — plain bool, no negating form; flare-cli/src/config.rs:73-75; flare-cli/src/cli.rs:698-700 (not opened) (rank_zero_options emits the flag only when true); docs/cli-design.md:1321-1322, :1337-1338.
if !run.enable_per_request_metrics {
run.enable_per_request_metrics = self.server.per_request_metrics.unwrap_or(false);
}
With per_request_metrics = true in a node's file there is no flag that turns it off for one run, and because rank_zero_options only re-emits the flag when true (and flare-cli/src/orbit/controller.rs:691-692 (not opened) merges saved group options above defaults), an Orbit group that ever captured --enable-per-request-metrics keeps it. This contradicts the documented precedence: "Flags override these defaults, including explicit zero limits and values equal to the built-in defaults" (:1321-1322) and "saved group options and explicit flags take precedence" (:1337-1338). The mechanism already exists next door: --kv-cache-limit memory is re-emitted when matches.value_source("kv_cache_limit") == Some(CommandLine) (cli.rs:662-667 (not opened)). Related path: flare-cli/src/main.rs:355-357 (not opened) writes config["per_request_metrics"] only when the flag is true, while flare/src/controller.rs:2566 (not opened) always writes it from settings — so a core whose exported server config says true (helios/src/server/config.rs:353-357 (not opened)) stays on under flare run even when the operator's file says false; latent today only because Ignition cannot emit the key (B1). Fix: tri-state (Option<bool> via num_args(0..=1)) or --no-enable-per-request-metrics with overrides_with, forwarded to rank zero, and write the override unconditionally in main.rs (not opened); at minimum document the limitation beside the flag. flare-cli/src/config.rs:222-234 today tests only omission, true, and false-in-file-turned-on.
S3. docs/cli-design.md:736 claims a configuration default that flare orbit run does not honor
The new row reads "--enable-per-request-metrics … | [server] per_request_metrics, otherwise off", and the flag is declared on both Run (cli.rs:857-863 (not opened)) and OrbitRun (:646-649), with docs/cli-design.md:170-173 listing it among the flags Orbit applies to rank zero. But the configuration fallback lives in Configuration::apply, whose branch matches only cli::Command::Run (flare-cli/src/config.rs:57-58, key applied at :73-75); OrbitRun gets its value from the flag alone, and the Orbit arm (config.rs:141-151) only sets cache paths. An operator who sets the key, launches flare orbit run, and trusts the table gets no metrics and no error. Fix: write "[server] per_request_metrics for native flare run, otherwise off" in the configuration column, the phrasing :1317-1318 already uses. Secondary, same row: neither --help string names the configuration key (cli.rs:646-648 (not opened), :860-862), so one clause ("default: [server] per_request_metrics") makes --help and the table agree.
S4. ignition debug-serve and the generated template ignore the key, and one sentence is now stale
Where: ignition/cli/serve.py:485-487 (not opened), ignition/cli/config.py:183-215, docs/cli-design.md:1385-1387.
debug-serve forwards thinking_token_budget and scheduler_checkpoint_extra_work_fraction from the config into the runtime options (serve.py:486-487 (not opened)) and does not set per_request_metrics, so once B1 is fixed it will silently ignore a setting flare run honors while honoring its two neighbours. write_initial omits the key from the template that docs/cli-design.md:1311-1312 says carries "the resolved values present as comments". And docs/cli-design.md:1385-1387 ("Native Flare ignores keys it does not use, except in [prefix_cache]") gains a second exception once native flare run reads a key Ignition's schema previously rejected. Fix: add the key to serve.py (not opened)'s options dict and to the template, and reword that sentence (or, under B1 option 2, drop its premise instead).
S5. docs/api.md:1040-1043 misdescribes a permanently-null field and overstates the n > 1 null
Three problems in one paragraph.
- "a field is null when the request did not reach the instants it spans, such as
mean_itl_msfor a single generated token" — buttime_to_first_content_token_msis "Always null" in the table atdocs/api.md:1020and hard-coded athelios/src/server/protocol/encode.rs:263. A field that never has a value is not an unreached instant; telling llama-swap and billing clients (the audience the PR names) that it is a supported-but-unavailable measurement invites them to wait for a value that will not arrive before #562. Say plainly that the key is present for vLLM shape compatibility and is always null until #562. - "With
ngreater than onemetricsis null" —helios/src/server/protocol/decode.rs:753-755(not opened) rejectschoices != 1for every protocol except Completions, so Chat/Responses/Messagesn > 1is a 400, never a null. Restrict the sentence to Completions, matching the encoder arm that produces the null (encode.rs:238,:252-253). - The zero-token shape is undocumented:
encode.rs:257-273(notelet last = first.map(...)at:259) nulls TTFT, generation, queue time, tokens/s andmean_itl_mstogether when no instants were recorded, andhelios/src/server/protocol/tests.rs:2445-2448pins that all-null object for a zero-token output-limited response. One clause closes it.
S6. docs/api.md:1045-1050 compares against a shape the HTTP API reference never defines
The paragraph says the instants are "on the same process-local origin as choices[0].token_timestamps_ns", but a whole-file search finds token_timestamps_ns only at :1048 and return_token_timestamps only at :992. The file never states that the token instants sit beside choices[0].token_ids (one metadata-only chunk per token on a stream: helios/src/server.rs:915 (not opened), helios/src/server/http.rs:603 (not opened), helios/model-contract.md:328-342 (not opened)), that return_token_timestamps: true is rejected without return_token_ids: true (helios/src/server/observation.rs:37-39 (not opened)), or that performance accompanies only timed responses (observation.rs:70-74 (not opened)). The ../helios/model-contract.md (not opened)#token-and-timing-observation anchor resolves (model-contract.md:326 (not opened)), so nothing dangles, but the HTTP reference should define the fields it uses. Fix: one sentence at docs/api.md:991-992 — "return_token_timestamps requires return_token_ids: true; it places per-token instants in choices[0].token_timestamps_ns, aligned with choices[0].token_ids, and adds a top-level performance object on buffered responses" — then let the new paragraph point at it (see SUB3).
Subtract / Simplify
Net ≈180 lines removable (~9% of the ~1,180 source/test/doc lines once #548's contribution is set aside), ~110 of them in one test file. No item asks to remove the option itself: #551 is a reproducible client gap and the charter merges PRs that fix one. (A further ~37 lines are available through B1 option 2, deleting the config-file key path; that is counted under B1 because it is a choice between two consistent states, not a pure simplification.)
SUB1 — should fix, ~110 lines: helios/src/server/runtime/phase_tests.rs:4731-4850
Two new HTTP-level tests re-assert rules already decided and pinned at the encoder, and re-implement plumbing that served_through_worker (:4563-4610) already provides.
- Already asserted by
per_request_metrics_follow_vllm_placement_and_null_rules(helios/src/server/protocol/tests.rs:2346-2449): the six exact values and the carrier frame (:2375-2389), top-level JSON placement (:2391-2398), no carrier withoutinclude_usage(:2400-2406), Messages omitted (:2408-2414),n>1→nulland several prompts → omitted (:2416-2430), single-token and no-instant nulls (:2432-2448). per_request_metrics_reach_completions_and_responses_where_vllm_places_them(:4731-4777) re-asserts the usage-chunkchoices == [](:4762),response.incomplete(:4764), body placement (:4765) and the content-TTFT null (:4774); its only timing claim,generation >= 3.0(:4771), is made rigorously by the kept test immediately above it (:4685-4728,within(...)step bounds at:4719-4721;mean_itl_ms == generation_time_msat:4724).per_request_metrics_are_absent_without_the_option_and_null_for_several_choices(:4780-4850): the first loop (:4782-4794, ~13 lines) is the one genuinely new fact —state.per_request_metricsreachesEncoder::enable_request_metrics(helios/src/server/http.rs:387-389(not opened)). The second half (:4795-4849, ~55 lines) hand-buildshttp_state_forstate, takes an ingress slot, spawnshttp::generate, receives the group, writesFinishedwith hand-madeRequestTimes(:4830-4834), then splits SSE — all of whichserved_through_worker(:4563-4610) does, parameterised byper_request_metrics, path, body and samples — to re-prove theSuppressedarm.
Smaller version (~125 → ~25 lines). Delete both tests and keep the flag's reach with one test over the existing helper:
#[tokio::test]
async fn per_request_metrics_reach_the_encoder_only_when_enabled() {
for enabled in [false, true] {
let (_, values) = served_through_worker(
|| Fixture::new().text_inputs(), enabled, "/v1/completions",
json!({"model":"qwen-worker-phases","prompt":"a","max_tokens":2}), &[1, 2]).await;
assert_eq!(values[0].get("metrics").is_some(), enabled);
}
}
Keep what only HTTP can show: this on/off gate, the step-bound provenance at :4717-4726/:4767-4772, response.incomplete at :4764 if the end-to-end arm is wanted, and mean_itl_ms == generation_time_ms at :4773. Note the sample vector &[1, 2] holds only if both choices commit in one step — a test run settles it. Nothing is lost: placement and the null rules stay tested where they are decided (encode.rs:232-275), and the runtime-instant proof stays in the two kept tests (:4613-4647, :4685-4728).
SUB2 — should fix, ~30 lines, shared with #548: docs/api.md:305-386
Four new paragraphs (:305-309, :311-326, :328-346, :348-364) walk every histogram series with the same populations the Prometheus HELP strings already ship on every scrape (helios/src/server/metrics.rs:1548-1642 (not opened)) and that the correspondence table maps one-to-one (docs/api.md:475-517). Reduce to ~8 lines naming the groups plus the one rule the HELP strings do not carry ("successful completions only; only flare_time_to_first_response_seconds can observe a response that later fails", :361-364). This block arrives through #548, so it is one cut for the stacked pair rather than this PR's own — agree it with that PR. Materially larger than the subtraction lens's estimate only because the block is #548's prose, not this PR's.
SUB3 — nit, ~10 lines: docs/api.md:1040-1050
:1040-1043's first sentence restates table rows :1018-1022 and the encoder's own nulls; keep only the n > 1 / several-prompts sentence. :1045-1050 re-describes fields defined normatively at helios/model-contract.md:344-355 (not opened), which the same paragraph links; replace with the one-sentence pointer from S6. Keep :1025-1029 and :1031-1038: they are the only place in the docs stating the step-completion instant, the queue-arrival boundary and the include_usage gap. This is S5/S6 expressed as a trim, not as more prose.
SUB4 — nit, ~7 lines: helios/src/server/protocol/tests.rs:2334-2344 and :2366-2374
metered_generation's doc comment says "Feed one generation that reasons and then answers" and it applies Event::Reasoning("think"), an empty Content(String::new()), Content("answer") and Content(" more"), but every assertion in per_request_metrics_follow_vllm_placement_and_null_rules reads only the carrier frame's type/choices/usage or metrics_value(), which depends only on times and generated — the content instant is the constant Value::Null (encode.rs:263) and its measurement moved to #562. One apply(0, vec![Event::Content("answer".into())]) before record_times(1_000_000, times, 4) keeps the fixture honest and deletes a misleading comment. Second cut in the same function: the carriers closure (:2366-2374) clones whole frames (frame.data.clone(), metrics.clone()) to read three fields; collect (&Value, &Value) as phase_tests.rs:4751-4758 already does.
SUB5 — nit, ~12 lines, marginal: helios/src/server/config.rs:727-739 (not opened)
The strict-type rejection loop (1, "true", null) guards a key whose only writer emits a literal true (flare-cli/src/main.rs:355-357 (not opened)). The absent→false assertion and the shipped CLI test (flare-cli/src/cli.rs:1378-1401 (not opened)) already cover the behaviour; the loop tests a path no product reaches. Keep :727-733.
SUB6 — optional, ~9 lines: helios/src/server/protocol/encode.rs:67-79 and :232-241
Absent/suppressed/single are equally expressible as Option<Timing> plus a suppressed: bool, which drops RequestMetrics::Suppressed (:69-70) and its match arm (:252-255); and enable_request_metrics(&mut self, streaming: bool) (:233) takes the value already passed at helios/src/server/http.rs:388 (not opened), two lines after the same decoded.stream went to set_logprobs. Two lenses argue for the current shape (the three-state enum reads better than Option<Option<Timing>>; Encoder::streaming is written only by set_logprobs, so folding it in would couple placement to that field), so take this only if the maintainer wants the smaller surface. Do not delete generate_observed/enqueue (helios/src/server/runtime.rs:837-844 (not opened)): they are identical to main (runtime.rs:828-835 (not opened)) and outside this diff.
Nits
N1. The Cost sentences should name #548's commit and say "per step, shared by its lanes"
The description's "This PR adds no clock read; the one monotonic read per scheduled model step comes from #548" is accurate — verified: commit 66245920 is in pr/548 history and in this branch, and helios/src/server/runtime.rs:2272 (not opened) is its line — but a reviewer reading this PR's diff against main sees the call arrive (runtime.rs:2269-2285 (not opened)), especially since the preceding bullet says performance gains first_scheduled_ns. Name the commit, and say the read is per step, shared by every lane through get_or_insert (runtime.rs:2273-2285 (not opened)), so the cost is neither over- nor under-stated. docs/api.md:1025-1026 already says this about completion instants.
N2. mean_itl_ms is not exactly vLLM's on speculative cores
encode.rs:266-268 divides first→last by generated - 1. A speculative step commits several tokens that share one completion instant (docs/api.md:1025-1026), so the true interval count is smaller and the mean is understated relative to vLLM. The count already exists — RequestRecord::tokens_committed observes one interval per committing step (helios/src/server/metrics.rs:348-362 (not opened), called at runtime.rs:1798-1802 (not opened)) — but since the table row at docs/api.md:1022 already defines the field as the code computes it, the cheaper and subtractive fix is one clause in that row ("intervals are counted per generating step, so a speculative step is one interval") rather than carrying a new field in RequestTimes.
N3. first_scheduled_ns now follows image conditioning, and still precedes a submission that can fail
The stamp sits after pack_vision/conditioned_inputs_ready (helios/src/server/runtime.rs:2228-2268 (not opened), stamp at :2272), which is right for the failed-pack case, but it changes what the instant means on the vision path: queue_time_ms (encode.rs:265) now includes image conditioning and time_to_first_token_ms (:262) starts after it — while docs/api.md:1018 defines queue time as "Model-queue arrival to the first model step that includes the request" (the paragraph at :1025-1029 accepts "which can be a vision step" but does not say conditioning precedes the instant). The stamp also precedes only submit's guards (runtime.rs:2289-2299 (not opened)), which can still fail for that step, so the comment at :2269-2271 covers the pack but not the submit. Either stamp before the vision pack (a failed pack leaves it null anyway) or state in docs/api.md/helios/model-contract.md:343-355 (not opened) that for image requests the instant follows image conditioning.
N4. Three copies of the placement/null rule, two of them in the encoder
encode.rs:232 (pointer line), :242-243 (restates the signature) and :248-250 (restates placement, the six-key rule and the content null) repeat what docs/api.md:1015-1043 states and what enable_request_metrics states executably at :233-241. Three copies invite divergence, and AGENTS.md:190-192 (not opened) does not count comment expansion as a contribution. Keep one pointer line each — "The metrics object or why it is omitted. See docs/api.md#per-request-metrics."
N5. timed_pass adds a third copy of the step-generates predicate
helios/src/server/runtime/phase_tests.rs:4541-4543:
let generates = matches!(step.kind, GraphKind::Decode | GraphKind::Resume)
|| (step.kind == GraphKind::Prefill
&& lane.start_position + lane.tokens as u64 == live.prompt_tokens as u64);
The identical expression already exists at :452-454 (budget_pass) and :5028-5030. The authoritative semantics live in the scheduler, so if the sampling graph set changes, three test loops silently disagree with production — including the one this PR's evidence relies on. Extract one helper beside completion (:372) and call it from all three sites, or have timed_pass reuse budget_pass's predicate.
Verified sound (recorded so it need not be redone)
- Placement. Non-stream bodies get
response["metrics"]only when!streamingand the encoder holds a value (helios/src/server/http.rs:606-615(not opened)); Chat/Completions carry it on the final usage chunk (encode.rs:711-719), Responses onresponse.completed/response.incomplete(encode.rs:731-744); Messages never, becauseenable_request_metricssetsself.metrics = NoneforProtocol::Messages(encode.rs:235-236). The gate ishttp.rs:387-389(not opened) onstate.per_request_metrics, default false (helios/src/server.rs:127-129(not opened),:148,:333). first_scheduled_nsfold.http.rs:538(not opened) isfirst_scheduled_ns.into_iter().chain(times.first_scheduled_ns).min()— earliest value, so the earlier last-writer-wins concern is gone; the response-levelperformanceathttp.rs:605-611(not opened) matchesObservationOptions::finish(helios/src/server/observation.rs:70-74(not opened)).- Lifetime through preemption.
RequestTimesispub(metrics.rs:326(not opened)), exported besideSnapshot(server.rs:33(not opened)); the record travels withIncomingthrough park/readmission (runtime.rs:196-198(not opened),:2116-2157,:2647-2675), so the instants survive preemption andlast_token_nsspans the park.Finishedcarriesarrival_ns+timeson all three terminal paths (runtime.rs:298-307(not opened),:1884-1896,:2057-2072). - Option-off wiring.
http.rs:384-389(not opened) never callsenable_request_metrics,record_timesnever runs, and the only added work is copying aCopyRequestTimesand au64into the terminal event.RequestMetrics/Timingallocate nothing when the option is off (RequestRecordisDefault). GraphKind::samples()(helios/src/execution/manifest.rs:90-101(not opened)) reproduces the previous inline seven-variantmatches!exactly (Init,Restore,Snapshot,Visionexcluded in both) atruntime.rs:1727-1729(not opened).- Configuration plumbing follows
thinking_token_budgetone-for-one on the Rust side:flare/src/configuration.rs:34(not opened) (#[serde(default)], nodeny_unknown_fields),flare/src/settings.rs:32(not opened)/:224,flare/src/controller.rs:2566(not opened),flare-cli/src/config.rs:73-75,flare-cli/src/main.rs:355-357(not opened),helios/src/server/config.rs:353-357(not opened), andBootstraprejects a non-boolean rather than dropping it (test:727-739). The CLI flag reaches rank zero the way--api-key-filedoes (flare-cli/src/cli.rs:671-701(not opened), test:1378-1402). The complaint is only where the key was documented, not that it is absent. - Desktop/controller path.
flare-winui/bridge/src/lib.rs:1367-1399(not opened) buildsflare::settings::RuntimeSettings, so the app inherits the key throughSettings::resolve(flare/src/settings.rs:120-127(not opened),:224) and applies it atflare/src/controller.rs:2566(not opened); no WinUI edit is needed (Windows build not run). - Event shape.
Finishedgains twoCopyfields rather than a new variant, so the event budget (runtime.rs:62-84(not opened)) andemit'spublishesclassification (:365-389) need no change. - Docs honesty.
docs/api.md:1025-1038records theinclude_usagegap, thatqueue_time_msincludes the channel send and worker pickup, and that Flare has no--enable-force-include-usagecounterpart;helios/model-contract.md:343-358(not opened) extends the existingperformanceparagraph normatively. Documenting a limitation instead of hiding it is whatAGENTS.md:194-199(not opened) asks. - No per-model special cases, no env vars, no model-specific branches — complies with the charter's "No per-model special cases or flags" and "Keep the runtime small and model-agnostic".
Editorial reconciliation (which lens finding won)
- Subtraction preferred where lenses conflicted. The two HTTP-level phase tests are deleted in favour of one helper-driven test (SUB1) — that takes precedence over the Conventions lens' proposal to factor them into a third harness, over Simplicity's finding 3, and over Correctness' request to keep the
n = 2end-to-end guard. Correctness'api.mditems are kept but expressed as trims in SUB3, not as more prose. - Additions dropped as additions. Conventions'
fn boolean()helper besideinteger(), and its suggestion to migrate the three host-cache histograms onto the newHistogram<N>/Buckets<N>(metrics.rs:199-209(not opened),:819-841,:1198-1214vs:211-322), are not requested: both add or expand code, and two histogram mechanisms coexisting is a follow-up, not a defect. Likewise Simplicity's proposal to foldEncoder::streamingintoenable_request_metricsis declined (SUB6 keeps it optional) because it would couple placement to a field onlyset_logprobswrites. - Out of scope, dropped as a finding.
generate_observed/enqueue(runtime.rs:837-844(not opened)) are identical tomain(runtime.rs:828-835(not opened)) with no hunk in this diff. - Prose-only items combined, none promoted. No
Discord:omission exists. The--help/table wording and thecli-design.md:1385-1387staleness are folded into S3/S4 rather than given separate entries; Blockers stay reserved for the one real compatibility break. - Withdrawn from the previous round. The "false cost claim" blocker is gone: commit
66245920is #548's. It survives only as N1.
Open questions / not verified
- Authorization (S1) — one maintainer line on #551 closes it.
- Whether the desktop controller needs the config key decides B1 option 1 versus option 2, and with it whether S2's file half exists at all.
- Whether Orbit should read
[server] per_request_metricsis a design call; the doc fix in S3 stands either way. - Whether the phase-test carrier assertions were deliberate end-to-end drift guards — settles the size of SUB1 (if yes, it shrinks to the
n = 2block plus the plumbing). - Whether
helios/model-contract.md(not opened) is the canonical definition oftoken_timestamps_ns— if so, S6 shrinks to one clause, but thereturn_token_idsrequirement still belongs indocs/api.md, the surface a client reads. - Magnitude of the extra span in
queue_time_ms(group validation + channel send + worker pickup) is a measurement question; the docs state the boundary without asserting a size. - Not verified here: no GPU, exported core, live server, llama-swap run, Windows or multi-GPU build, no
cargo test, nopytest, noignitioninvocation; the head commit reports no CI checks. The PR's live matrix (40/40 request checks, 15.4–15.9 s vs 16.0–16.3 s CPU per 16×512-token run) and llama-swap rates are taken at face value. Every finding above is read from the code and docs at046aaef. - #548 remains open, so this PR's own delta is the encoder, the four
Finishedemit sites, the config chain and the docs; merge order must be #548 first, and #548's own open items (first_scheduled_nsorigin,last_token_nson reasoning-close) may move these fields — re-review after it lands.