#1 [high] Orientation: PR 548 scope and repo rules
PR #548 "Add request latency histograms and process metrics" (draft, head ebecef1, base main, 8 files +545/-20, no reviews, no CI; author WynnD, Discord oystersmiles). Closes issue #536 (which asks for vLLM-parity request histograms + standard process_* metrics).
Files: docs/api.md (+25/-3), helios/src/server.rs (+2), server/http.rs (+6/-1), server/latency.rs (+27/-8), server/metrics.rs (+228), server/metrics/process.rs (new, +184), server/runtime.rs (+38/-8), server/runtime/phase_tests.rs (+35). No other files.
Rules that govern a conventions review:
- AGENTS.md:188-193 "Reject unsupported abstractions and churn ... Refactoring must directly support the requested behavior".
- AGENTS.md:203-207 charter: "Keep the runtime small and model-agnostic"; AGENTS.md:1-27 repo map says eos/ "holds the host operating-system operations that Helios and Selene use".
- docs/design-review.md:16-26 principle 1 (Helios simplicity), :125-136 principle 15 (scope), :137-151 principle 16 (prose).
- docs/api.md:287-290 (unchanged by this PR) states "Counter and gauge names start with
flare_" — the new process_* series do not. - AGENTS.md:52-60 requires docs to state support as present qualification; process metrics are Linux-only and docs/api.md says so.
Lens assigned: conventions and duplication only.
#2 [high] Should fix: new Histogram/Buckets duplicates the two existing host-cache histogram implementations
PR adds Buckets<const N> (helios/src/server/metrics.rs:212-241), Histogram<const N> with observe (:259-271) and render (:273-297). Those are a third implementation of the same thing in one module:
- Host cost histograms: buckets
HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS(metrics.rs:200-210), observation inhost_lookup_cost(:670-692,limits.iter().position(...),bucket.fetch_add,host_cost_sums[index].fetch_add), rendering at :1029-1065 (+Infwhenlimit == u64::MAX,_bucket/_count/_sum). - Host retirement: incremental bucket gauges
host_retirement_buckets(:375), filled instore(:705-711), rendered at :851-876 with*ms as f64 / 1000.0.
The new Histogram supersedes (1) exactly: same fixed bounds, per-bucket AtomicU64 counts, one sum atomic. Nothing in the PR converts the existing sites, so the module now carries three bucket-encoding conventions (u64::MAX sentinel vs f64::INFINITY, ms-as-integer vs seconds-as-f64 bounds, and three different field orders: _count/_sum at :1060-1064, +Inf/_count/_sum at :867-876, _sum/_count at :291-296). Prometheus accepts all of them, but a reader maintaining one histogram family now has to know which of three forms it uses, and the u64::MAX sentinel form is strictly worse than f64::INFINITY (observe at metrics.rs:689 has an unchecked .unwrap() on position, which Histogram::observe avoids with unwrap_or(N - 1)).
Why it matters: AGENTS.md:188-193 rejects churn but also asks for "the smallest footprint in shared code" (charter "How We Work"); a second generic histogram next to two hand-rolled ones is the footprint that will be copied a fourth time. Report says the PR and #537 "add different regions" of metrics.rs, so the merge cost of migrating is low.
Fix: build the host cost histograms and the #537 page histograms on Histogram<N>/Buckets<N> (migrating host_missing_tokens/host_transfer_ns/host_prefill_ns and host_cost_sums to Histogram<8> instances is mechanical, and deletes :1029-1065 plus the host_lookup_cost bucket loop). If migration is out of scope for this PR, say so in the description rather than leaving the third form undocumented.
#3 [high] Should fix: process.rs re-implements OS helpers that already live in eos/ and helios::os
helios/src/server/metrics/process.rs (new) reads procfs and libc limits itself:
std::fs::read_dir("/proc/self/fd").ok().map(|entries| entries.filter_map(Result::ok).count() as u64)(process.rs:65-67) is character-for-characteropen_descriptors()in helios/src/runtime_core/protection.rs:290-302 (std::fs::read_dir("/proc/self/fd").ok().map(|entries| entries.filter_map(|entry| entry.ok()).count() as u64)), and near-duplicate of heliopause/src/export/transfer.rs:61-64 and selene's own accounting.libc::sysconf(libc::_SC_PAGESIZE)(process.rs:56) duplicateseos::page_size()(eos/src/unix.rs:73-75), which helios already re-exports ascrate::os::page_size()(helios/src/os.rs:8) and uses at helios/src/cuda.rs:425, :1450. Note the two differ in failure handling: eos falls back to 4096, process.rs omitsprocess_resident_memory_bytesentirely.libc::getrlimit(libc::RLIMIT_NOFILE, &mut limit)(process.rs:68-77) duplicates the call insideeos::raise_open_file_limit(eos/src/unix.rs:138-165), which is also re-exported throughcrate::osand used by helios/src/runtime_core/protection.rs:356. That function already returns the resulting soft limit asOption<u64>, i.e. exactlyprocess_max_fds; callingcrate::os::raise_open_file_limit(current)— or adding a smallopen_file_limit()getter beside it — gives the same number with no new unsafe block.
Why it matters: AGENTS.md repo map says "The eos/ crate holds the host operating-system operations that Helios and Selene use", helios/src/os.rs:6 repeats "Host operating-system operations for native serving" and re-exports flare_eos::*. So a new helios/src/server/metrics/process.rs that calls libc::sysconf/libc::getrlimit//proc/self/fd directly puts a fourth copy of the same OS layer in Helios instead of one line in the module the repository designates for it. The duplication is also already drifting (page-size fallback behaviour above).
Fix: add the missing getters (page_size() exists; add open_file_limit() -> Option<u64> and open_descriptors() -> Option<u64>) to eos/src/unix.rs next to raise_open_file_limit, or reuse crate::os from process.rs; keep only the /proc/self/stat and /proc/stat parsing in process.rs, since nothing parses those today (verified: search_code for btime|_SC_CLK_TCK|/proc/self/stat finds no prior implementation in Rust sources).
#9 [high] Research summary
Reviewed PR #548 through the conventions-and-duplication lens: every changed file (docs/api.md, helios/src/server.rs, server/http.rs, server/latency.rs, server/metrics.rs, server/metrics/process.rs, server/runtime.rs, server/runtime/phase_tests.rs) was read in context, including the callers of each changed function and the precedents cited against it.
Five confirmed findings recorded, plus one nit and a note of candidates I checked and dropped:
- Should fix —
Buckets/Histogram(metrics.rs:212-298) is a third Prometheus-histogram implementation in the same module, next toHOST_TIME_BUCKETS/HOST_TOKEN_BUCKETSwithhost_lookup_cost(metrics.rs:200-210, :670-692) and the rendered loops at :1029-1065 and the retirement buckets at :851-876. Three bucket-encoding conventions now coexist (u64::MAXsentinel vsf64::INFINITY, three different_count/_sumorders). - Should fix —
metrics/process.rsre-implements host OS helpers that already exist:open_descriptors()inruntime_core/protection.rs:290-302(verbatim identical/proc/self/fdcounting),eos::page_size()used viacrate::os::page_size()(eos/src/unix.rs:73-75, helios/src/cuda.rs:425 (not opened)), and thegetrlimit(RLIMIT_NOFILE)call insideeos::raise_open_file_limit(eos/src/unix.rs:138-165), which already returns exactly theprocess_max_fdsvalue. AGENTS.md:20-22 and helios/src/os.rs:6 designateeos/as the home for these. - Should fix —
flare_time_to_first_response_secondsis owned bylatency::FirstResponseSamplesand rendered by a separate hook from the route (server.rs:671), while its siblingrequest_e2elives inMetrics(metrics.rs:327) and every other request histogram is emitted byMetrics::render. Three assembly points for one text body. - Should fix — docs/api.md:287-290 still states "Counter and gauge names start with
flare_", which the six newprocess_*series contradict 27 lines later; the PR does not amend the sentence. - Should fix / nit — the e2e observation is written inline twice in one function in two styles (http.rs:614-616
metrics()in the non-streaming branch vs :631-632metrics_handle()in streaming), the file's own precedent being named helpers. - Nit —
process::metric(process.rs:42-49) duplicatesmetrics::metric(metrics.rs:1597-1602).
Verified non-findings: RequestTimes does not duplicate scheduler::RequestAccounting (the scheduler copy is reset at finish and does not survive park), the latency.rs Mutex<Samples> → {window, histogram} rename updates every use site, and the new SPDX header matches latency.rs:1.
#10 [high] Summary: findings list for the conventions and duplication report on #548
PR #548 (draft, head ebecef1, 8 files +545/−20, no reviews, no CI). Lens: conventions and duplication. Every changed file was read in context. Six findings, none blocking; three should fix on duplication, two should fix on documentation/placement convention, one nit.
-
SHOULD FIX (duplication, largest) — third histogram implementation in one module. New:
Buckets<const N>andHistogram<const N>(observe/render) at helios/src/server/metrics.rs:212-298; bucket constants at :219-241. Existing precedent 1:HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS(metrics.rs:200-210), observation inMetrics::host_lookup_cost(:670-692:limits.iter().position(...)+host_cost_sums[index].fetch_add), rendering at :1029-1065. Existing precedent 2: retirement histogram gauges filled instore(:705-711), rendered at :851-876 with*ms as f64 / 1000.0bounds. Consequence: three bucket encodings now coexist in one file (u64::MAXsentinel vsf64::INFINITY; ms-integer vs seconds-f64 bounds) and three_count/_sumorderings (:1059-1064, :867-876, :286-296). Also the old path'sposition(...).unwrap()at :689 vs the newunwrap_or(N - 1)at :268. Fix: rebuild the three host-cost histograms onHistogram<8>/Buckets<8>, deleting :1029-1065 and the bucket loop in host_lookup_cost; PR says it only touches the completion-counter region, so #537/#548 merge order is unaffected. -
SHOULD FIX (duplication) — process.rs re-implements existing OS helpers. New:
metrics/process.rs:65-67/proc/self/fdcounting,:56libc::sysconf(_SC_PAGESIZE),:68-77libc::getrlimit(RLIMIT_NOFILE). Existing:open_descriptors()at helios/src/runtime_core/protection.rs:290-302 is character-identical;eos::page_size()eos/src/unix.rs:73-75 re-exported ascrate::os::page_size()(helios/src/os.rs:8) and used at helios/src/cuda.rs:425,:1450;eos::raise_open_file_limiteos/src/unix.rs:138-165 performs the same getrlimit and returns the soft limit asOption<u64>— exactlyprocess_max_fds— and is re-exported throughcrate::os(used at protection.rs:356). Convention: AGENTS.md repo map ("Theeos/crate holds the host operating-system operations that Helios and Selene use"), helios/src/os.rs:6. Drift already visible: eos falls back to page size 4096, process.rs omits the metric. Fix: addopen_file_limit()/open_descriptors()besideraise_open_file_limitin eos/src/unix.rs and callcrate::os::page_size(); leave only the/proc/self/statand/proc/stat btimeparsing in process.rs (no prior Rust implementation of those exists — searched). -
SHOULD FIX (convention/placement) — TTFR histogram owned outside
Metrics, rendered from the route. helios/src/server/latency.rs:33-37 (histogramfield), :108-119 (double record: window + histogram), :122-131 (render_histogram), called at helios/src/server.rs:671. Contrast:request_e2eis aMetricsfield (metrics.rs:327), rendered byMetrics::renderat metrics.rs:1386-1430 alongside the runtime request histograms, and observed viametrics_handle()from http.rs:615/:632.metrics::process::renderis appended at server.rs:709. So/metricstext is now assembled at three points with no stated rule. Note the double bookkeeping (VecDeque + histogram for the same duration) is the accepted cost of keeping the 60 s median documented at docs/api.md:329-336; the finding is ownership/render asymmetry, not the double record. Fix: pick one ownership and state it (move the histogram besiderequest_e2e, or document inMetrics::renderthat HTTP-owned histograms are appended by the route). -
SHOULD FIX (documentation consistency) — docs/api.md:287-290 unmodified sentence "Counter and gauge names start with
flare_" is contradicted by the six newprocess_*series documented at docs/api.md:315-318 (emitted at metrics/process.rs:78-127). The names themselves are correct (standard Prometheus process collector names, which is what #536 asked for). Fix: one clause, e.g. "…start withflare_, except the standardprocess_*series below". Matters because the surrounding paragraphs invite{__name__=~"flare_.*"}scrape filters. -
SHOULD FIX (duplication, small) — the e2e observation is written inline twice in one function in two accessor styles: helios/src/server/http.rs:614-616 (
state.model.metrics()-derived clonemetrics) and :631-632 (state.model.metrics()). The file's own precedent is named helpers (failure_log,rejection,rejection_details,with_request_id, http.rs:39-69) and it already capturesstream_state/id.clone()into the closure (:384-385, :601).metrics_handle()here is its second caller in the tree (other: server.rs:511). Fix: oneobserve_e2e(&self, admitted_at)helper; it also drops the repeatedas_nanos() as u64andREQUEST_SECONDS. -
NIT —
process::metric(metrics/process.rs:42-49) duplicatesmetrics::metric(metrics.rs:1597-1602), differing only by theflare_prefix and theDisplayvalue type; the copy also skipsescape_prometheus_label(metrics.rs:1604-1615), which is fine today (no labels) but will not be inherited if a labelledprocess_*series is added. Fix: keep one emitter and pass the full name.
DROPPED after verification (entry 8): RequestTimes vs scheduler::RequestAccounting is not duplication (scheduler copy is reset by finish, does not survive park; CheckpointAccounting::initial_prefill_ns is a prediction, not a measurement); the latency.rs Mutex<Samples>→{window, histogram} rename updates every use site (:73, :111, tests :198/:213/:222); the one-line SPDX header at process.rs:1 matches latency.rs:1.
No blocking finding. The twelve times: Default::default() struct-literal additions (runtime.rs:913, :3254, phase_tests.rs:251) follow the existing pattern and needed no comment beyond the field doc at runtime.rs:193.
#12 [high] Update after commits d64c3ea3 + a34c4d06: which findings are fixed and which remain
Head moved ebecef1 -> a34c4d06 (commits d64c3ea3 "Exclude cancelled responses and reuse host helpers", a34c4d06 "Hoist completion values and tighten stat parsing"). Re-verified every finding against the new head.
FIXED by d64c3ea3:
- Finding 6 (docs/api.md:288-290) — now reads "...
flare_free_kv_pages, except the standardprocess_*series described below." (docs/api.md:287-290). Gone. - Finding 7 (duplicate e2e observation in http.rs) — both inline sites are gone; one observation now sits at helios/src/server/http.rs:598-605, guarded by
!count && !encoder.tool_limit_reached, immediately beforeyield Delivery::Complete(response); the streaming branch'sDelivery::Complete(_) => None(http.rs:621) and the non-streaming branch no longer observe.metrics_handle()clone removed from this function.metrics_handle()now has one caller (server.rs:511). - Finding 3 (OS-helper duplication) mostly — process.rs:61
crate::os::page_size(), :68crate::runtime_core::open_descriptors(), :70crate::os::raise_open_file_limit(0)("A zero target only reads the current soft limit"). Only/proc/self/stat, the state-char check andbtimeparsing remain local; no prior Rust implementation of those exists.
REFINEMENT of finding 3 (now nit): open_descriptors() still lives in helios/src/runtime_core/protection.rs:291-302 and was widened to pub(crate) plus re-exported at helios/src/runtime_core/mod.rs:58 so server metrics can reach it. AGENTS.md:20-21 names eos/ as the home of host OS operations that Helios and Selene use, and eos/src/unix.rs already exports page_size()/raise_open_file_limit; a metrics module importing a core-protection private helper is the wrong direction. Fix: move the function to eos/src/unix.rs (Linux-gated) and call it as crate::os::open_descriptors(), as the other two now are. eos already has the #[cfg(not(target_os = "linux"))] -> None shape precedent (runtime_core/protection.rs:298-301).
STILL OPEN:
- Finding 2 (should fix): three histogram implementations in helios/src/server/metrics.rs. New generic at :212-298; legacy host cost at :200-210 constants + :382
host_cost_sums+ :670-692 observation + :1029-1065 render; retirement gauges at :375 + :705-711 + :851-876. Nothing migrated by either new commit;HOST_*_BUCKETSstillu64::MAX-sentinel withposition(...).unwrap()at :689, and the retirement histogram still rendersms as f64 / 1000.0bounds from selene'sRETIREMENT_LATENCY_MS(selene/src/store.rs:21). Three_count/_sumorders coexist (:1060-1064, :871-876, :291-296). - Finding 5 (should fix):
flare_time_to_first_response_secondsstill owned byFirstResponseSamples(latency.rs:33-37, render_histogram :101-108) and appended to the text by the route at helios/src/server.rs:671, while its siblingrequest_e2eis aMetricsfield (metrics.rs:327) rendered byMetrics::render(metrics.rs:1389-1412). The new commits only relocated theimpl FirstResponseSamplesblock aboveFirstResponse(latency.rs:101-109); ownership asymmetry unchanged./metricstext is still assembled at three points (metrics::render, server.rs:671, server.rs:709). - Finding 4 (nit):
process::metricat metrics/process.rs:48-54 still duplicatesmetrics::metricat metrics.rs:1597-1602 (also unchanged in the two new commits), differing only by theflare_prefix andimpl Display; it still skipsescape_prometheus_label(metrics.rs:1604-1615).
New minor observation on the pushed diff (nit, same file): process.rs:81-98 now has two consecutive if let Some(stat) = stat blocks for process_virtual_memory_bytes and process_resident_memory_bytes, which could be one block; the earlier if let (Some(stat), Some(ticks)) for CPU is separate by necessity. Cosmetic only.
Also re-verified as clean at the new head: the hoisted prompt_tokens/generated_tokens locals in runtime.rs:1838-1846 and :1993-2001 are used by both request_completed and Finished, matching the existing Carried hoisting in park (runtime.rs:2104, :2115-2116); RequestTimes::default() in metrics.rs:1683 test replaced the impossible {None, Some} state.
#13 [high] Report of 2026-11-27, run 2: conventions and duplication on head a34c4d06
Verdict: should-fix issues only (two). Three of the six findings from the previous turn are fixed by d64c3ea3; head re-verified at a34c4d06.
Blocking: none.
Should fix:
- helios/src/server/metrics.rs:212-298 + :200-210, :382, :670-692, :1029-1065, :851-876 — the new generic
Buckets/Histogramis the third Prometheus-histogram implementation in one module. Precedents not migrated:HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETSwithhost_lookup_cost(u64::MAX sentinel,position(...).unwrap()at :689) and the retirement bucket gauges (flare_selene::RETIREMENT_LATENCY_MS, ms-integer bounds →*ms as f64 / 1000.0). Three bucket encodings and three_count/_sumorders now coexist (:1060-1064, :871-876, :291-296). Fix: rebuild the host-cost histograms onHistogram<8>/Buckets<8>, which deletes :1029-1065 and the bucket loop inhost_lookup_cost; or state the migration is deferred. - helios/src/server/latency.rs:33-37, :101-108, :116-127 (appended at helios/src/server.rs:671) —
flare_time_to_first_response_secondsis owned byFirstResponseSamplesand rendered through a route-side hook, while its siblingrequest_e2eis aMetricsfield (metrics.rs:327) rendered byMetrics::render(metrics.rs:1389-1412)./metricstext is assembled at three points (metrics.rs render, server.rs:671, server.rs:709) with no stated rule. Fix: pick one ownership and write it down.
Nits:
- helios/src/runtime_core/mod.rs:58 / protection.rs:291-302 —
open_descriptors()was widened and re-exported sometrics/process.rs:68can call it, but AGENTS.md:20-21 designateseos/as the home of host OS operations;page_size()andraise_open_file_limitare now reached throughcrate::os(process.rs:61, :70) while the fd count comes from a core-protection private helper. Move it to eos/src/unix.rs. - helios/src/server/metrics/process.rs:48-54 —
process::metricduplicatesmetrics::metric(metrics.rs:1597-1602), differing only by theflare_prefix andimpl Display, and does not inheritescape_prometheus_label(metrics.rs:1604-1615). - process.rs:81-98 — two consecutive
if let Some(stat) = statblocks for the two memory gauges could be one.
Verified non-findings (previous entry 8, still valid): RequestTimes vs scheduler::RequestAccounting (policy.rs:53-65) is not duplication — the scheduler copy is reset by finish and does not survive park; CheckpointAccounting::initial_prefill_ns is a prediction. The runtime.rs hoisted locals (:1838-1846, :1993-2001) match the existing Carried hoisting in park (:2104, :2115-2116). The e2e guard at http.rs:598-605 now matches the runtime's own cancelled accounting (runtime.rs:1338/:1360), which is what removed the strongest objection to that observation.
#14 [high] Research summary
Reviewed PR #548 at its new head a34c4d06 (after d64c3ea3 and a34c4d06) through the conventions-and-duplication lens. Every changed file was read in context (docs/api.md, helios/src/runtime_core/{mod,protection}.rs, server.rs, server/http.rs, server/latency.rs, server/metrics.rs, server/metrics/process.rs, server/runtime.rs, server/runtime/phase_tests.rs), with the precedents they duplicate.
Verdict: should-fix issues only, two of them. Three of the six findings from the previous turn are now fixed by the pushed commits: the docs/api.md sentence that claimed every counter and gauge starts with flare_ now carries the "except the standard process_* series" clause; the duplicated end-to-end observation in http.rs is now a single site (:598-605) guarded on !count && !encoder.tool_limit_reached, so metrics_handle() has one caller left; and process.rs now reaches the page size, the descriptor count and the file limit through existing helpers instead of re-implementing them — leaving only the /proc/self/stat and btime parsing, which has no prior implementation in the tree.
Still open: (1) the new generic Buckets/Histogram in metrics.rs is the third Prometheus-histogram implementation in that one module, beside HOST_*_BUCKETS + host_lookup_cost and the retirement bucket gauges, and nothing is migrated, so three bucket encodings and three _count/_sum orderings coexist; (2) flare_time_to_first_response_seconds is owned outside Metrics and appended to the scrape text by the route, while its sibling request_e2e is a Metrics field rendered by Metrics::render, so /metrics text is assembled at three points with no stated rule. Nits: open_descriptors was widened out of runtime_core::protection rather than moved to eos/, which AGENTS.md:20-21 designates as the home of host OS operations; process::metric duplicates metrics::metric and does not inherit the label escaper; two adjacent identical if let Some(stat) blocks in render_linux.
Nothing blocking. Details and line numbers are in scratchpad entries 12 and 13.
#15 [high] Verbatim evidence at head a34c4d06 for the two remaining should-fix findings
Quotes verified by reading the files at head a34c4d06, for direct citation in the final report.
FINDING 1 — three histogram implementations in helios/src/server/metrics.rs.
- New generic: :212-217 doc +
pub(super) struct Buckets<const N: usize> { bounds: [f64; N], scale: f64 }; :245-248pub(super) struct Histogram<const N: usize> { counts: [AtomicU64; N], sum: AtomicU64 }; :260-271observe("position(|bound| exposed <= *bound),unwrap_or(N - 1)"); :273-297renderwriting# HELP flare_{name},_bucket{le=...}, then_sumthen_count. - Precedent 1, host cost: :200-209
const HOST_TIME_BUCKETS: [u64; 8] = [100_000, ..., u64::MAX]; :210HOST_TOKEN_BUCKETS = [64, ..., u64::MAX]; :382host_cost_sums: [AtomicU64; 3]; :670-692host_lookup_costwhose inner loop islet bucket = limits.iter().position(|limit| value <= *limit).unwrap();(:689 — unchecked unwrap on a sentinel-terminated array); :1029-1065 the render loop that emits_bucket(:1058), then_count(:1060), then_sum(:1061-1064) — the reverse order from the newHistogram::render. - Precedent 2, retirement: :375
host_retirement_buckets: [AtomicU64; 8], filled instoreat :705-711, rendered at :851-876 where bounds are*ms as f64 / 1000.0overflare_selene::RETIREMENT_LATENCY_MS(selene/src/store.rs:21 =[10, 50, 100, 500, 1000, 5000, 15000, 30000]), then+Inf/_count/_sum(:869-876). - So: bounds as u64 sentinel vs f64 infinity vs integer ms; sums as raw integers vs the new
scaledivision; three orderings. Neither pushed commit touched any of the three sites (#2in entry 2 remains exactly true).
FINDING 5 — TTFR histogram owned outside Metrics.
- helios/src/server/latency.rs:33-37
pub(super) struct FirstResponseSamples { window: Mutex<Samples>, histogram: super::metrics::Histogram<21> }; :101-108render_histogram; :116-127FirstResponse::outputrecords the window entry and thenself.samples.histogram.observe(&super::metrics::REQUEST_SECONDS, now.saturating_duration_since(self.started).as_nanos() as u64). - helios/src/server.rs:671
state.first_response.render_histogram(&mut text);— i.e. aftermetrics::metricgauges (:661-670) and before input metrics (:672) andmetrics::process::render(:709). - Contrast: helios/src/server/metrics.rs:327
pub(super) request_e2e: Histogram<21>; rendered insideMetrics::renderin thefor (histogram, name, help) in [(&self.request_e2e, "request_e2e_seconds", ...), (&self.request_queue, ...), ...]loop at :1389-1412, thentime_per_output_token(:1413-1418) andrequest_prompt_tokens(:1419-1424). - d64c3ea3 only moved the
impl FirstResponseSamplesblock abovestruct FirstResponse(latency.rs:101-109); ownership and render path are unchanged.
FIXED (for the "changes since the last review" section), with the new text:
- docs/api.md:288-290 now: "Counter and gauge names start with
flare_, such asflare_generated_tokens_total,flare_active_requests, andflare_free_kv_pages, except the standardprocess_*series described below." - helios/src/server/http.rs:598-605:
// One observation per successful response: a tool-limit cancellation reaches this point but the runtime counts it as cancelled, so it is excluded.thenif !count && !encoder.tool_limit_reached { state.model.metrics().request_e2e.observe(&super::metrics::REQUEST_SECONDS, admitted_at.elapsed().as_nanos() as u64); }, immediately beforeyield Delivery::Complete(response);. The two old inline observations are gone (streaming arm is nowDelivery::Complete(_) => Noneat :621; non-streaming arm just builds the body, :635-644). - helios/src/server/metrics/process.rs:61
let page = crate::os::page_size() as u64;, :68let open_fds = crate::runtime_core::open_descriptors();, :69-70// A zero target only reads the current soft limit.let max_fds = crate::os::raise_open_file_limit(0);. The localsysconf(_SC_PAGESIZE),/proc/self/fdloop andgetrlimitblock are deleted. - The stat parser gained :24-28: rejects a line whose first post-
)token does not start with a state char from"RSDZTtWXxKPI", andutimemoved fromvalue(11)tovalue(10).
#17 [high] Report of 2026-11-27, run 4: re-verified at head a34c4d06, no new commits
Head is still a34c4d06 (git log shows a34c4d06 / d64c3ea3 / ebecef13 on top of f377dc85), the PR discussion has no comment newer than the bot's 06:15 review, and pr_files still reports the same 10 files (+548/−25). I re-read each changed site rather than reusing the earlier quotes:
- metrics.rs:200-210
HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS(u64::MAX sentinel), :382host_cost_sums, :670-692host_lookup_costwithposition(...).unwrap()at :689, :1029-1065 render loop emitting_bucket→_count→_sum; :851-876 retirement gauges rendering*ms as f64 / 1000.0overflare_selene::RETIREMENT_LATENCY_MS; :212-298 the newBuckets/Histogramemitting_sum→_count. Unchanged. (Note: the retirement series is a gauge refreshed fromMetrics::storeat :705-711, which is why it reads differently again from both hosts — extra evidence for finding 1.) - metrics.rs:327
pub(super) request_e2e: Histogram<21>rendered in the loop at :1389-1412; latency.rs:33-37 ownshistogram: Histogram<21>with the one-line forwarderrender_histogramat :101-108, andFirstResponse::outputat :116-127 observes it; server.rs:671 calls it between the median gauge andinput_metrics.metrics::process::renderat server.rs:709 is a fourth append point. Unchanged. - process.rs:47-54
metricduplicates metrics.rs:1597-1602; process.rs:81-89 and :90-98 are two consecutiveif let Some(stat)blocks; runtime_core/protection.rs:291-302open_descriptorsnowpub(crate)and re-exported at runtime_core/mod.rs:58 while process.rs:61/:70 callcrate::os::page_size()/crate::os::raise_open_file_limit(0)and helios/src/os.rs:8 ispub(crate) use flare_eos::*. Unchanged.
Conclusion: the report of entry #16 stands as written; no new finding and nothing retracted. Also re-checked and still clean: docs/api.md:288-290 now carves out process_*, http.rs:598-605 is the single e2e observation, and the SPDX header in process.rs matches its sibling latency.rs:1 (both /* SPDX-License-Identifier: Apache-2.0 */, the module-local short form used where the file is small; the full SPDX-FileCopyrightText block is the norm elsewhere in helios/src but the short form already exists in latency.rs and dashboard/prefill.rs, so it is not a new departure).
#18 [high] Evidence refinement at a34c4d06: histogram renderers differ in HELP emission and order; request_e2e is the only pub(super) histogram field
Re-verified at head a34c4d06 (no new commits). Extra evidence gathered this pass to make the two should-fix findings precise, plus one correction to how the fix should be framed under repository policy.
FINDING 1 additions — the three histogram implementations also disagree on series layout, not only on encoding:
- HELP lines: the new
Histogram::renderemits# HELP+# TYPE(metrics.rs:274-277); the host-cost renderer emits only# TYPE(metrics.rs:1049) and the retirement renderer only# TYPE(metrics.rs:851). So one scrape mixes histograms with and without HELP. - Order: new = buckets,
_sum(:291-295),_count(:296); host cost = buckets,_count(:1060),_sum(:1061-1064); retirement = buckets,+Inf(:867-870),_count(:871),_sum(:872-876). - Bounds source:
[f64; N]endingf64::INFINITYwith ascale(new) vs[u64; 8]endingu64::MAX(host cost, :200-210) vsflare_selene::RETIREMENT_LATENCY_MS(ms integers, selene/src/store.rs:21) rendered as*ms as f64 / 1000.0(metrics.rs:856-861). - CORRECTION on framing: I must not claim the host-cost
position(..).unwrap()at metrics.rs:689 can panic — theu64::MAXsentinel guarantees a match. It is inconsistent, not defective. And AGENTS.md:188-193 ("Reject unsupported abstractions and churn … Refactoring must directly support the requested behavior") cuts both ways, so the finding is "choose one": either migrate the two older sites ontoHistogram/Buckets(deletes ~80 lines: :200-210, :382, the loop at :670-692, :1029-1065, :375, :705-711, :851-876) or scope the new type so it does not present itself as the module's histogram abstraction (it ispub(super)and named generically) and state the deferral in the PR description.
FINDING 5 additions — the encapsulation break is exactly one field:
- metrics.rs:327
pub(super) request_e2e: Histogram<21>is the only histogram field with non-private visibility; the other five (:328-332) are private. It ispub(super)precisely so http.rs:601 can call.observe(&REQUEST_SECONDS, ...)on the field. The runtime's five go throughMetrics::request_completed(metrics.rs:452-478), i.e. the "one place" rule the PR description states is broken for the HTTP one. - Consequence for the fix: moving the TTFR histogram onto
Metricswould also let http.rs stop reaching into aMetricsfield, so both HTTP histograms would observe throughMetricsmethods and render at metrics.rs:1389-1425, andrender_histogram(latency.rs:101-108) plus the call at server.rs:671 disappear. - Related, not a separate finding: the same instants already feed the 60-second median window and the new histogram in one function (latency.rs:116-127), so a scrape now carries the same quantity twice in two shapes. docs/api.md:303-307 documents both without saying which an operator should use; the median cannot be reproduced from an all-time histogram, so keeping both is defensible — but it is another reason the ownership of the pair should be stated.
#19 [high] Research summary
Reviewed PR #548 at head a34c4d06 (unchanged since the last pass: git log still shows a34c4d06 / d64c3ea3 / ebecef13, no new PR comments, same 10 files +548/−25) through the conventions-and-duplication lens. Every changed file was read in context again this pass rather than reusing earlier quotes, and all findings were re-verified line by line.
Verdict: should-fix issues only. No blocking issues. Two should-fix, three nits.
Should fix:
helios/src/server/metrics.rs:212-298— the new genericBuckets/Histogramis the third Prometheus-histogram implementation in the module, and the two older ones (:200-210sentinelu64::MAXarrays +:382+:670-692+:1029-1065;:375+:705-711+:851-876overflare_selene::RETIREMENT_LATENCY_MS, selene/src/store.rs:21) are left in place. New detail this pass: they also differ in whether they emit# HELPand in_count/_sumorder, so one scrape mixes layouts. Fix is a choice — migrate the older sites ontoHistogram/Buckets(deletes ~80 lines) or scope the new type so it does not read as the module's histogram abstraction, and state the deferral.helios/src/server/latency.rs:33-37,:101-108,:116-127, appended athelios/src/server.rs:671—flare_time_to_first_response_secondsis owned byFirstResponseSamplesand rendered by a route-side hook, while its siblingflare_request_e2e_secondsis aMetricsfield (metrics.rs:327) rendered insideMetrics::render(:1389-1412).request_e2eis in fact the onlypub(super)histogram field, made visible so http.rs:601 can observe directly, which breaks the "record where the counter is recorded" rule the PR states./metricstext is assembled at four points with no stated rule.
Nits: open_descriptors() widened out of runtime_core::protection and re-exported rather than moved to eos/ (AGENTS.md:20-21; its two neighbours already go through crate::os); process::metric duplicates metrics::metric and skips escape_prometheus_label; two adjacent identical if let Some(stat) blocks in render_linux.
Fixed since the first review and recorded as such: the docs/api.md:288-290 sentence, the duplicated e2e observation in http.rs, and the re-implemented OS helpers. Verified non-findings: RequestTimes vs scheduler::RequestAccounting, the hoisted token locals in runtime.rs, the SPDX header (short form already used by latency.rs:1 and dashboard/prefill.rs:1 (not opened)).
Full report with quotes and line numbers is scratchpad entry #16; re-verification is #17 and the refinements above are #18. Open questions for the author: is migrating the two older histograms intended follow-up or out of scope, and is there a maintainer preference for where HTTP-observed histograms live?
#20 [high] Final report of 2026-11-27, run 5 (head a34c4d06, no new commits): two should-fix, three nits
Reviewed at head a34c4d06, which is still the head: git log shows a34c4d06 / d64c3ea3 / ebecef13 on top of f377dc85, the PR discussion has no comment newer than the bot's 06:15 review, and pr_files still reports 10 files (+548/−25). Every changed file was read again in context through the conventions-and-duplication lens, and every finding below was re-verified in the code at this head.
Verdict: should-fix issues only. No blocking issues. Two should-fix, three nits.
Should fix
1. Buckets/Histogram is the third Prometheus-histogram implementation in helios/src/server/metrics.rs, and the two older ones are left in place
New code metrics.rs:212-298 (Buckets<const N> with [f64; N] bounds ending f64::INFINITY plus a scale, Histogram<const N>, one observe at :260-271 and one render at :273-297). Precedents not migrated:
- host cost:
:200-210HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETSas[u64; 8]endingu64::MAX,:382host_cost_sums, observation loop:670-692, render loop:1029-1065; - host retirement:
:375host_retirement_buckets, filled fromMetrics::storeat:705-711, rendered at:851-876where bounds are*ms as f64 / 1000.0overflare_selene::RETIREMENT_LATENCY_MS(selene/src/store.rs:21=[10, 50, 100, 500, 1000, 5000, 15000, 30000]).
They disagree on more than encoding, and the disagreements show up in one scrape: the new renderer emits # HELP + # TYPE (:274-277) while both older ones emit only # TYPE (:1049, :851); the new one emits buckets → _sum (:291-295) → _count (:296), host cost emits buckets → _count (:1060) → _sum (:1061-1064), retirement emits buckets → +Inf (:867-870) → _count (:871) → _sum (:872-876); bounds are f64+scale vs u64 sentinel vs integer milliseconds.
Why it matters: AGENTS.md:188-193 rejects churn that does not remove a demonstrated cost, and docs/design-review.md:74 asks that duplicate representations be accounted for. A second, clearly better abstraction sitting beside two older ones makes the module read as mid-migration without being one, and a reader cannot tell which shape a new histogram should take. This is a code-shape decision, not a behaviour defect: the host-cost position(...).unwrap() at :689 cannot panic because u64::MAX terminates the array, and every emitted series is already pinned by existing tests, so a migration should be behaviour-preserving.
Fix (choose one): rebuild the host-cost and retirement histograms on Histogram<8>/Buckets<8> — which deletes :200-210, the bucket loop in host_lookup_cost (:688-691), the 37-line render loop (:1029-1065), and the retirement bucket gauges plus their renderer (:375, :705-711, :851-876) — or state in the PR description that the migration is deliberately deferred and scope the new type so it does not present itself as the module's histogram abstraction.
2. flare_time_to_first_response_seconds is owned outside Metrics while its sibling flare_request_e2e_seconds is a Metrics field
latency.rs:33-37 FirstResponseSamples { window: Mutex<Samples>, histogram: super::metrics::Histogram<21> }, observed in FirstResponse::output (latency.rs:116-127) and rendered by its own forwarder render_histogram (latency.rs:101-108), which the /metrics handler calls out of band at helios/src/server.rs:671. The sibling added by the same PR is a Metrics field — metrics.rs:327 pub(super) request_e2e: Histogram<21> — rendered inside Metrics::render in the loop at :1389-1412 alongside the five runtime histograms.
Two consequences worth citing:
request_e2eis the only histogram field with non-private visibility; the five others (:328-332) are private. It ispub(super)only sohttp.rs:601can call.observe(&REQUEST_SECONDS, ...)on the field, while the runtime's five go throughMetrics::request_completed(:452-478) — the "recorded where the counter is recorded" rule the PR states does not hold for the HTTP histogram.- The scrape text is now assembled at four points with no stated rule:
Metrics::render(:1389-1424),server.rs:661-671(first-response gauges, median, histogram),server.rs:672-707(input and HTTP gauges), andmetrics::process::renderatserver.rs:709.
Fix: move the TTFR histogram onto Metrics (observed from FirstResponseSamples::output via the existing state.model.metrics() handle, so both HTTP histograms render from the :1389 loop), which also retires render_histogram, the server.rs:671 call, and the pub(super) on request_e2e; or state in latency.rs why the window and its histogram must stay together.
Nits
open_descriptors()moved sideways, not down.helios/src/runtime_core/protection.rs:291-302keeps the/proc/self/fdcounter, nowpub(crate), re-exported athelios/src/runtime_core/mod.rs:58sohelios/src/server/metrics/process.rs:68can reach it, while its two neighbours go througheos/already —process.rs:61 crate::os::page_size(),:70 crate::os::raise_open_file_limit(0)(eos/src/unix.rs:73,:138;helios/src/os.rs:8ispub(crate) use flare_eos::*).AGENTS.md:20-21designateseos/as the home of host OS operations Helios and Selene use, andprotection.rs:298-301already has the#[cfg(not(target_os = "linux"))] -> Noneshape a move needs. Fix: move it toeos/src/unix.rsand callcrate::os::open_descriptors().process::metricduplicatesmetrics::metric.metrics/process.rs:47-54emits# HELP / # TYPE / valuefrom a full name;metrics.rs:1597-1602does the same withflare_prepended. Differences are the prefix andimpl Displayvsu64(needed: process values are f64). It also does not inheritescape_prometheus_label(metrics.rs:1604-1615), though no process name is dynamic. Fix: givemetrics::metricanimpl Displayvalue and a prefixed/unprefixed form, delete the copy.- Two adjacent identical guards.
process.rs:81-89and:90-98are consecutiveif let Some(stat) = statblocks for the two memory gauges; the separateif let (Some(stat), Some(ticks))at:72andif let (Some(stat), Some(btime), Some(ticks))at:99are justified by extra dependencies. Fix: one block emitting both gauges.
Changes since the first review (fixed — record, do not re-raise)
docs/api.md:288-290now reads "…flare_free_kv_pages, except the standardprocess_*series described below." The new prose at:297-321correctly separates Histograms from the JSON snapshot.- The e2e observation is one site:
helios/src/server/http.rs:598-605, guarded by!count && !encoder.tool_limit_reached, immediately beforeyield Delivery::Complete(response); the streaming arm is nowDelivery::Complete(_) => None(:621).metrics_handle()has one remaining caller (server.rs:511). - The local
sysconf(_SC_PAGESIZE),/proc/self/fdloop andgetrlimitcode inprocess.rsare gone; only/proc/self/statandbtimeparsing remain local, and no prior Rust implementation of those exists in the tree (checkedeos/,helios/,selene-manager/src/local.rs:705-710parses/proc/<pid>/statbut for a different field and is a different crate).
Verified non-findings
RequestTimes(metrics.rs:300-306) vsscheduler::RequestAccounting(scheduler/policy.rs:54-57): not duplication — the scheduler copy is reset byfinish, does not survivepark, andlast_output_nsmarks publication, not the last committed token.- The hoisted
prompt_tokens/generated_tokenslocals (runtime.rs:1837-1846,:1993-2001) follow the existingCarriedhoisting inpark(:2104,:2115-2116). - SPDX header:
process.rs:1uses the short/* SPDX-License-Identifier: Apache-2.0 */, but that exact form already exists athelios/src/server/latency.rs:1andhelios/src/server/dashboard/prefill.rs:1, so it is not a new departure. - The bucket constants
REQUEST_SECONDS/TOKEN_SECONDS/PROMPT_TOKENS(metrics.rs:219-241) are reused across every histogram of the same unit, including TTFR — the pattern the older sites fail to follow, i.e. finding 1 rather than a separate issue. metrics::process::render's shape matches the existing collaborator precedent:Metrics::renderalready delegates toengram::Stats::render(metrics.rs:1105-1107) andrender_persistent_worker_metrics(:1108-1110, defined:1617), so ametrics/processsubmodule appending its own series is conventional. The#[cfg(not(target_os = "linux"))] let _ = text;atprocess.rs:12-13also matches an existing pattern (flare/src/hub.rs:1749,helios/src/core/cache.rs:4399,heliopause/src/export/archive.rs:347).
Open questions for the author
- Is migrating
HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETSand the retirement histogram intended follow-up or out of scope? The description does not say; it names only #537 as an overlapping PR. - Is there a maintainer preference for where HTTP-observed histograms live? No doc states one;
request_e2e's placement is the only precedent, and this PR sets two.
Not checked here: the Windows build and the full helios suite (the description says CI covers both, and the head has no CI checks yet); the pre-existing messages_image_hints_end_after_expansion_... test needs FLARE_TEST_TEMPLATE_DIR. Nothing in this review depends on them.
#5 [medium] Should fix: time_to_first_response histogram is owned by latency.rs while the sibling request_e2e histogram is owned by Metrics
helios/src/server/latency.rs:108-131 records the same observation twice and stores its histogram outside the metrics registry:
-
FirstResponseSamples(latency.rs:33-37) now holdshistogram: super::metrics::Histogram<21>, andFirstResponse::output(:108-119) callssamples.record(...)(the rolling-window VecDeque) andself.samples.histogram.observe(&REQUEST_SECONDS, ...)for the samenow - started. Two stores of one measurement is the accepted cost of keeping the 60 s median (docs/api.md:329-336documents the JSONfirst_responseobject), but the histogram itself is arguably a request histogram and every other request histogram lives inMetrics. -
Rendering is a third route to
/metrics:Metrics::render(metrics.rs:797) emits the whole text;state.first_response.render_histogram(&mut text)is called from the route handler at helios/src/server.rs:671, aftermetrics.rs:1386-1430has already emitted the request histograms from theMetricsstruct and beforemetrics::process::renderat :709. So the text is now assembled from three places with no shared ordering rule. -
request_e2e— the other HTTP-layer histogram — went the opposite way: it lives inMetrics(pub(super) request_e2e: Histogram<21>, metrics.rs:327) and is observed from http.rs:615/:632 viametrics_handle(). So the two HTTP-observed histograms in one PR are owned by two different structs.
Why it matters: the precedent in this file/module is that a mouse-to-metrics gauge or counter is a field of Metrics sample-and-observed in place (Metrics::progress, Metrics::http_requests at http.rs:142, the dashboard gauges at server.rs:661-708 are computed at render because they are derived from HttpState). The first-response histogram is neither: it is an independent counter with its own lock-adjacent storage and its own render hook. A reviewer cannot tell from Metrics that flare_time_to_first_response_seconds exists, which is what the render() grouping is for.
Fix (either is fine, pick one and state the rule): move first_response histogram ownership beside request_e2e in Metrics and observe it from FirstResponse::output through a handle, or keep the current ownership and note in Metrics::render's doc comment that HTTP-owned histograms are appended by the route. The one thing worth changing is the asymmetry between request_e2e and time_to_first_response, which both measure the same kind of request-level latency.
#6 [medium] Should fix: docs/api.md still says every metric starts with flare_, six new ones do not
docs/api.md:287-290 (unmodified lines) says: "GET /metrics returns Prometheus text exposition format 0.0.4 by default. Counter and gauge names start with flare_, such as …". The PR adds six series that violate that sentence and does not amend it:
process_cpu_seconds_total, process_resident_memory_bytes, process_virtual_memory_bytes, process_start_time_seconds, process_open_fds, process_max_fds (helios/src/server/metrics/process.rs:78-127; documented in the new docs/api.md:315-318).
The new paragraph at docs/api.md:315-318 says only "On Linux the text also carries process_cpu_seconds_total, … for the serving process. Other platforms omit them." — an accurate statement of the new behaviour, but the document now contains one sentence saying every series starts with flare_ and 30 lines later six that do not, with no reconciliation. A reader writing a {__name__=~"flare_.*"} scrape filter, which the paragraph at :287-294 invites, silently loses all six.
Fix: change :288-289 to "Counter and gauge names start with flare_, except the standard process_* series below", or scope the sentence ("Flare's own counters and gauges…"). One clause.
Verified against the code: process.rs:78-127 emits exactly those unprefixed names and nothing else. Note the names themselves are correct — they are the standard Prometheus/prometheus_client process collector names, which is the point of #536 — so this is a documentation consistency finding, not a naming request.
#7 [medium] Nit/should fix: the e2e histogram observation is written inline twice in http.rs, in two accessor styles
helios/src/server/http.rs:614-616 and :631-632 write the same statement twice in two styles:
Delivery::Complete(_) => {
if !count { metrics.request_e2e.observe(&super::metrics::REQUEST_SECONDS, admitted_at.elapsed().as_nanos() as u64); }
None
}
vs
Delivery::Complete(body) => {
if !count { state.model.metrics().request_e2e.observe(&super::metrics::REQUEST_SECONDS, admitted_at.elapsed().as_nanos() as u64); }
(two single-line blocks, one after another in the same function). Both duplicate behaviour the closures' neighbours do not: the streaming branch already clones state (let stream_state = state.clone(); http.rs:384, used elsewhere) and id.clone() (:385, :601), and the same file's ordinary style for a shared helper is a named function (failure_log, rejection, rejection_details, with_request_id, all http.rs:39-69). Note also the inconsistency inside the new code: the streaming branch reaches metrics through state.model.metrics_handle() (which clones the Arc into the closure) while the non-streaming branch calls state.model.metrics() — so the file now shows both accessors for one field, and metrics_handle() gained its second caller in the tree (the other is server.rs:511, the dashboard).
Additionally the e2e observe is the one new metric observation placed inline in the route instead of behind a Metrics method, unlike the runtime histograms (Metrics::request_completed, metrics.rs:449-478) — so the "record in one place" argument the PR makes for the completion counter does not extend to the e2e histogram, which now has two inline call sites that must stay in step with the three delivery branches.
Fix: one fn observe_e2e(&self, admitted_at: Instant) (or a AdmittedAt::elapsed_seconds()), called from both branches; it also removes the as_nanos() as u64 and REQUEST_SECONDS repetition the file otherwise hides.
#8 [medium] Verified non-findings: RequestTimes vs RequestAccounting; SPDX header; latency rename
Checked and NOT a duplication to flag: RequestTimes (metrics.rs:300-306) versus scheduler::RequestAccounting (helios/src/scheduler/policy.rs:53-65). RequestAccounting already holds arrival_ns, last_progress_ns, last_output_ns: Option<u64>, terminal_since_ns and committed_output_tokens, and set_arrival (policy.rs:245-254) already carries the arrival stamp, so the new stamp fields look like a repeat. They are not: RequestAccounting is owned by the scheduler, is reset by finish, and is not readable after park → resume_decoded_sequence (runtime.rs:1556-1575 explicitly rebuilds the request from Parked), while a preempted request must keep its stamps. CheckpointAccounting::initial_prefill_ns (scheduler/checkpoints.rs:24) is a predicted cost, not a measurement. So there is no existing mechanism to reuse — verified in code, not just by comment.
Also not a finding: the ART/phase-test additions (times: Default::default() at runtime.rs:913, :3254, phase_tests.rs:251) match the existing struct-literal noise pattern; no duplication introduced.
Also checked and clean: FirstResponseSamples's Mutex<Samples> → { window, histogram } rename (latency.rs:33-37) touches every use site (latency.rs:73, :111, tests :198, :213, :222) — no stale .0 access left. render_histogram correctly passes REQUEST_SECONDS (latency.rs:128) rather than defining a fourth bucket set, and reuses the same 21 boundaries as the request histograms, which matches #536's request that TTFR "same start and end points as the current median gauge".
SPDX headers: new file helios/src/server/metrics/process.rs:1 is /* SPDX-License-Identifier: Apache-2.0 */, byte-identical to helios/src/server/latency.rs:1 and to the contributor-authored files under helios/src/server/protocol/decisions/. The newer convention for files that started as NVIDIA is the two-line Copyright form (metrics.rs:1-5). Matching latency.rs is defensible; a nit at most, not worth a finding.
#4 [low] Nit: process::metric duplicates metrics::metric line emitter
helios/src/server/metrics/process.rs:42-49 defines fn metric(text, name, kind, help, value) doing "# HELP {name} {help}\n# TYPE {name} {kind}\n{name} {value}", right beside metrics::metric at helios/src/server/metrics.rs:1597-1602 doing "# HELP flare_{name} {help}\n# TYPE flare_{name} {kind}\nflare_{name} {value}" — same three lines, same order, differing only in whether the flare_ prefix is applied and in the value type (impl Display vs u64). The prefix difference is precisely why the copy was written, but the generalisation is one line: metrics::metric could take the already-prefixed name, or gain a flare: bool/Display value parameter, and process::render would reuse it instead of carrying a second line-emitter.
Also note the new helper skips escape_prometheus_label (metrics.rs:1604-1615); no new series takes a label, so nothing is wrong today, but the second emitter will not inherit the escaping if a labelled process_* series is added (e.g. process_io_bytes_total{device=…}), while the shared one will.
Fix: keep one exposition helper in metrics.rs and pass it the full metric name; delete process::metric. Nit if the author prefers to defer.