Amendments to the case file for PR #692 — "helios: count output-layer stream failures under requests_failed_total"
Appended to my report of 2026-12-02 (run 3064). Only amendments are below. Everything in the base report not explicitly amended here — the defect in #679, the mechanism, the related-work analysis (#548/#560/#691/#689, and why #133 is a different defect), the people section, the charter mapping, and the open questions about the parallel_tool_calls: false divergence — stands unchanged. I re-read the PR, its full discussion, and the head files to produce this.
Key findings (what changed)
- The head moved twice and the PR grew by three files: head is now
7f2986984e2898f39c97d9ce9ccac8c7db459027(7f298698), 7 files, +968/−46 (previously 4 files, +1068/−32 at348c06c). New files in scope:helios/src/server/metrics.rs(+3/−3),docs/api.md(+9/−2),helios/src/server/runtime/response_lifecycle_tests.rs(+2/−2).runtime.rsshrank from +443/−15 to +362/−22 purely by refactor. - My finding "no doc change is required" is superseded — the PR now changes the docs and the HELP strings.
docs/api.md:330,:332, a brand-new paragraph:349-354, andmetrics.rs:1077-1079,:1087-1089were all rewritten. The newcancelledprose atdocs/api.md:349-354closes an operator-facing gap I had not flagged:flare_requests_cancelled_totalhad no prose definition at all before this PR. - Labels and description changed: labels went from none to
area:api, bug, priority:P2, triage:review; the body now carries all four charter sections and documents the metrics/docs work (I had already scored it compliant; it is now compliant and complete). - A full review round happened and every item was fixed and verified by me in the head files — Autobot review at 21:50 (
Changes Requested, 0 blockers, 2 should-fix, 2 subtract/simplify, 3 nits, "technically sound … no correctness or concurrency blockers"), author reply at 22:18, and a refactor follow-through (singletransition()helper,event_budget_exceeded,wait_for_admitted). - My conformance gap is now half-closed, not closed. The
ResponseLifecycleobserved-edge harness and the terminal-frame retention test now call the productionemit_finished(response_lifecycle_tests.rs:155,:372) — but the harness still admits viagenerate_many(:120-141,defer_completion = false), so the deferredGENERATED → COMPLETED/CANCELLED/FAILEDhalf, the half the PR exists for, still has no TLA+/observed-edge coverage (docs/design-review.md:241-246). - Evidence is still self-reported and now partly un-CI-able: the re-verification numbers are byte-identical to the pre-fix run, no CI has run on
7f298698, and I confirmed.github/workflows/helios-lifecycle.yml:33-34(not opened) runscheck.pywithout--mutations, so the 40-mutation claim cannot be reproduced by CI at all. The author also ran at 512 MiB memlock where gating CI uses 64 MiB (native-serving.yml:56-63). - The
parallel_tool_calls: falsedivergence I flagged is untouched, with new line numbers: the note moved fromdocs/api.md:700-702to:706-709and still says the request is "counted cancelled rather than completed, despite the successful API response". The doc commit did not fix it, and did not make it wrong.
1. Head, size, labels, description
| Base report | Now | |
|---|---|---|
| Head | 348c06c |
7f298698 |
| Size | 4 files, +1068/−32 | 7 files, +968/−46 |
| Labels | none | area:api, bug, priority:P2, triage:review |
| Reviews/comments | none | Autobot review 21:50 (Changes Requested, 0 blockers) + author reply 22:18 |
Per-file at head: helios/src/server/runtime.rs +362/−22, helios/src/server/runtime/phase_tests.rs +552/−0, helios/src/server/http.rs +20/−9, helios/src/server/protocol/decisions/mod.rs +20/−8, docs/api.md +9/−2, helios/src/server/metrics.rs +3/−3, helios/src/server/runtime/response_lifecycle_tests.rs +2/−2. http.rs and decisions/mod.rs are unchanged since the pre-fix head, so every finding I made about those two files stands verbatim, only renumbered.
2. Documentation and HELP changes (new; supersedes "no doc change is required")
docs/api.md:330—completednow reads "Served HTTP and Decisions requests whose generation and output validation completed successfully; direct in-processModelRuntime::generate*callers count model-generation completion". Previously "Requests whose generation completed successfully".docs/api.md:332—failednow reads "…including output-decoding rejections and terminal event-budget overflow". This makes the doc track the implementation (event_budget_exceeded,runtime.rs:493-501) rather than only restating the old contract.docs/api.md:349-354— new paragraph, the first prose definition offlare_requests_cancelled_total: "queued, active, or unread served HTTP and Decisions requests cancelled or disconnected before output validation completes, and direct in-processModelRuntime::generate*requests cancelled before model generation completes. Each request increments at most one of …completed…, …cancelled…, or …failed…". This is the operator-facing half of the fix: before, the counter an operator reads had no definition at all, which is also why nobody had noticed the trend (see the base report's note that #541's dashboard plots onlycompletedandfailed).metrics.rs:1077-1079—requests_completed_totalHELP now names output validation and the direct in-process exemption;:1087-1089— newrequests_cancelled_totalHELP with the "queued, active, or unread … before output validation completes" wording;metrics.rs:91—Snapshot::completeddoc aligned.- Asymmetry worth a reviewer's attention (new finding):
requests_failed_totalHELP atmetrics.rs:1092-1094was not expanded — it still says only "Model requests failed by admission, execution, grammar, or output processing" — whiledocs/api.md:332now adds "output-decoding rejections and terminal event-budget overflow". The two strings an operator can read disagree in specificity; the author's reply claims the failed detail was added todocs/api.mdonly, and that is what the diff does. Harmless but inconsistent, and trivially droppable.
3. ResponseLifecycle conformance: gap half-closed (amends open question #1)
helios/src/server/runtime/response_lifecycle_tests.rs:152-164(observed-edge harness action 3) and:372-379(terminal_stream_frames_retain_http_admission_after_native_retirement) now call.emit_finished(GenerationEvent::Finished { … })instead of raw.emit(...), so the 365,508-transitionResponseLifecycle.tlarun now exercises the production terminal entry point (runtime.rs:465-492), including its suppress-after-failure andtry_reservebehaviour.- Still not modelled: the harness admits through
runtime.generate_many(...)atresponse_lifecycle_tests.rs:120-141, i.e.defer_completion = false, so theGENERATEDparking state and the consumer-sidecomplete_output()/fail_output()/on_reader_drop()settlements —runtime.rs:158-206,:259-268,:289-294— never appear in the model, the fixtures, or the observed edges.docs/design-review.md:241-246("keep formal bounds aligned … additional lifecycle transitions") therefore remains unsatisfied for the half that is the point of the PR. The author'scheck.py --mutationsfigure does not cover this: it passes because the new states are simply unreachable in the harness.
4. Review round and refactor (verified in the head files, not just claimed)
The author's 22:18 reply claims all seven items fixed. I verified each:
- Single CAS helper
RequestOutcome::transitionatruntime.rs:138-156(Acquire load, AcqRel/Acquire CAS,fetch_add(Relaxed)on success only);record_generated:158-168,record_completed:170-177,record_cancelled:179-186,record_failed:188-195,on_reader_drop:197-206all route through it. Replaces the five duplicated loops of the pre-fix head. - Shared
Incoming::event_budget_exceededatruntime.rs:493-501, used byemit_finished(:488-490) and byemit(:545-547). record_cancelledfolded intoIncoming::finish_cancelledatruntime.rs:434-443(records before emittingFinished), with directrecord_cancelled()retained on the pending-drop paths (:464, worker sites:1652,:1563,:1583,:1595).wait_for_admitted(&mut worker, count)atphase_tests.rs:8632-8645(5 s timeout) replaces the 7 duplicated polling loops.- Comment on the
Closedarm atruntime.rs:482-487documenting READER_DROPPED settlement for deferred vs direct callers. Nothing in the review identified a correctness or concurrency defect, and I found none in the refactor: the terminal-state table is unchanged in behaviour, only in structure.
5. Line-number remap (supersedes citations in the base report)
| Site | Base report | Head 7f298698 |
|---|---|---|
RequestOutcome |
runtime.rs:109-296 |
runtime.rs:109-207 (states :109-114, struct :116-127, helpers :138-206) |
Generation outcome field / settle / drop |
:348-357, :378-383 |
:219, complete_output :259-261, fail_output :263-268, Drop :289-294 |
Incoming::emit_finished |
:553-582 |
:465-492 |
finish_error FAILED ordering |
:583-595 |
:508-513 |
generate_for_output |
:1145-1151 |
:1058-1064 |
generate_observed #[cfg(test)] |
:1131-1134 |
:1044-1047 |
| Worker cancellation sites | :1647-1653/:1667-1671/:1680-1690/:1735-1740 |
:1563, :1583, :1595, :1648-1654 |
Terminal emissions via emit_finished |
old worker sites | :2209, :2506 |
| Unit tests | — | :4383-4484, :4486-4560 |
docs completed / failed |
:330 / :332 |
:330 / :332 (text changed) |
| docs parallel-tool-limit note | :700-702 |
:706-709 |
metrics.rs HELP |
:1092-1095 |
completed :1076-1080, cancelled :1086-1090, failed :1091-1095 |
http.rs submission / settlement / failures |
:328-334, :561-566, :402-410, :426-434, :445-450, :582-590 |
same numbers, now :328-338, unchanged |
decisions score() |
:838-886 |
:830-893, settle at :838-841, :844-847, :850-856, :864-871, :878-888 |
| integration tests | phase_tests.rs:8437-9020 |
:8647, :8707, :8775, :8808; helpers :8441-8645 |
6. Evidence status (amends "Claims and evidence")
Unchanged in substance, sharper in detail:
- Re-verified as 1,884 passed / 0 failed / 84 ignored (helios
runtime-core,server), 254/4 (flare), 245/3 (flare-cli), andcheck.py --tlc-jar … --mutationsexit 0 with 40 mutations detected (13 TLA+, 26 Rust guards, 1 observed-edgeDispatchRing SlotReuseSafe). The numbers are byte-identical to the pre-fix run, which is the tell that the re-run is a re-statement, not independent corroboration — and no CI has run on7f298698either. - New: the mutation claim is structurally un-CI-able.
.github/workflows/helios-lifecycle.yml:33-34(not opened) invokescheck.py --tlc-jar "$RUNNER_TEMP/tla2tools.jar"with no--mutations, on PRs touchinghelios/**,selene/**,eos/**,verification/helios-lifecycle/**. So the TLA+/conformance half will be CI-checked on this PR, the 40-mutation half never will be. - New: environment divergence. Gating Rust tests run with
prlimit --memlock=67108864:67108864(.github/workflows/native-serving.yml:56-63(not opened), Linux;:64-68Windows;:69-73flare-cli;:74-77flare) while the author verified at 512 MiB. The author's justification (parallel Engram staging tests) is plausible but means local results are not what CI will run. - Narrowed (not removed): the Python counter suites I flagged are
FLARE_API_TEST_URL-gated (tests/server/test_protocols.py:22-24,tests/server/test_decisions.py:16-18) and therefore skipped bypython-cpu.yml:30-33(pytest tests/ -q,CUDA_VISIBLE_DEVICES=""). The assertions still encode pre-change semantics (test_protocols.py:676n=4 disconnect → cancelled rises;test_decisions.py:230/:257decision disconnect → cancelled rises). I checked the paths:score()always settles viafail_output()on a droppedGeneration, but a cancelled child still reachescancelledonly throughon_reader_dropPENDING→READER_DROPPED →record_cancelled, which is preserved (runtime.rs:179-186,:197-206). So no test change is strictly required — but nothing exercises it. - New gap confirmed: the zero-token finish arm at
http.rs:445-450aborts the decoder and does not callfail_output(); that is correct, because zero-token choices are excluded from the enqueue set athttp.rs:305-316and so hold noGeneration. Worth stating in the PR so a future reader does not read it as a missed settlement.
7. Still open (unchanged or newly opened)
- Deferred-half conformance — see §3. This is the one item of
docs/design-review.md:241-246still unmet. - CI is the real gate now. Two of the review's should-fixes are done; the third ("get CI green on head") is not, and the mutation result cannot be CI-green by construction (
helios-lifecycle.yml:34). parallel_tool_calls: falsedivergence (docs/api.md:706-709) is still documented as intentional and still untouched:http.rs:571-575still callsgeneration.cancel()onencoder.tool_limit_reached, so that path still reports cancelled on a successful API response. #692's deferral does not change it, and the docs still describe it correctly — but the doc change was an opportunity to reconcile the two and did not take it.- HELP/docs asymmetry for
failed—metrics.rs:1092-1094vsdocs/api.md:332(§2). - Conflict surface unchanged and now larger by one file:
#691(same author) touches the sameIncoming/Generationandwait_for_first_token;#548/#560touch the same counters andGenerationEvent::Finished.response_lifecycle_tests.rsandmetrics.rsare new files to keep in mind when #548 rebases. - Not found / not verifiable by me: any CI run on
348c06cor7f298698; any independent confirmation of the 1,884/254/245 counts; whether7f298698actually re-ran the suites after the refactor rather than re-stating the earlier numbers; and the 84/4/3 GPU- and checkpoint-gated ignored tests plus liveflare runserving, which the author states were not run.