Prose scratchpad · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/24722f40-06fd-4ad2-97e6-9615303c8071.md

#1 [high] Research summary

I ran out of time before I could write the scratchpad notes, so the findings are here in full, each one checked in the code at head 7ca5430.

What I checked

Repository rules (charter, AGENTS.md, docs/design-review.md, .agents/skills/repo-prose/SKILL.md), the PR description and its four-part structure, the changed documentation, and the diffs of docs/scheduling-runtime-design.md, helios/src/scheduler/{cost,refresh,policy,rounds,speculation,sam,decoded_history}.rs, runtime_core/selection.rs, model/catalog.rs, execution/manifest.rs, heliopause/src/python.rs, ignition/preparation/execution.py, with surrounding code and callers. I did not read the four commit message bodies (only their subject lines), and I did not run any tests, so nothing below is a claim about commit-message compliance or green test runs.

Findings

Blocking — user-facing CLI/protocol specs now contradict the code. docs/cli-design.md:200-202 still says "--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs." After commit 35ab143a, LoadOptions::select retains draft_source == 2 wide copy graphs only when retain_wide_copy (source mtp, history drafts enabled, no fixed width) and otherwise prunes them and narrows speculative_widths (helios/src/runtime_core/selection.rs:278-298, :382-396; test wide_copy_graphs_retain_only_when_history_drafts_enabled at :1876). The flag now changes the loaded graph set, kernel pruning and the reported widths. The same claim pattern survives in docs/mtp-design.md:22-29 ("requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do. Both settings use the same captured MTP graphs and buffers."). Fix: state that --history-drafts additionally elects copy-only wide graphs when the core provides them and they are retained only in adaptive mode, and update docs/cli-design.md:742's table entry accordingly.

Should fix — the design document does not specify the new copy-draft or copy-wide scheduling policy at all. docs/scheduling-runtime-design.md is the specification for Helios scheduling, yet the PR adds a whole policy surface it never describes: the per-request prompt+output suffix automaton (helios/src/scheduler/sam.rs, module list at doc lines 6-13 still omits it), the draft_source/copy-only graph family and its confidence_width == 0 / no-SpeculativePrefixLimit constraints (helios/src/model/catalog.rs:94-131, helios/src/execution/manifest.rs:841-851), the per-request CopyCalibration geometric prior WIDE_COPY_PRIOR_RATE = 0.88 with COPY_STEP_PRIOR_WEIGHT = 4.0 / COPY_DEPTH_SHRINK_WEIGHT = 2.0 (helios/src/scheduler/speculation.rs:14-21, :98-190), the WIDE_COPY_MIN_MATCH_LEN = 6 / copy_len >= base_mtp_drafts + 3 eligibility gate (helios/src/scheduler/rounds.rs:752-772), and the isolation of copy-only completions from MTP acceptance profiles and packed-round durations (helios/src/scheduler.rs:2795-2860, cost.rs:190-208). Repo-prose requires documentation to be a present-state specification and AGENTS.md:52-56 requires designed behavior to be stated; a reader of the design doc cannot learn any of this. Fix: add the copy-proposal and copy-wide selection section, with the prior, threshold and calibration constants named and their meaning explained before the identifiers.

Should fix — the padding-dominance paragraph no longer matches the rule. docs/scheduling-runtime-design.md:249-254 still says candidates "discard any physical shape whose capacities are all at least as large as an alternative, with at least one strictly larger capacity." The new second pass in prune_padding (helios/src/scheduler/policy.rs:221-254) dominates a candidate when another batch has other.packed_token_capacity >= needed, where needed = length(index).sum().min(candidate.packed_token_capacity) — i.e. the surviving shape's P may be strictly smaller than the discarded shape's P. The doc must state the "covers the cohort's needed target rows" condition and that the rule applies only to GPU-allocated ragged speculative candidates with equal (capacity, draft_tokens).

Should fix — stale "minimum across matching shapes" and shared-history text. docs/scheduling-runtime-design.md:396-399 says a (batch, width) lookup "takes the minimum positive measured duration across matching shapes". ActionCosts::refresh_packed_durations now skips copy-only shapes entirely whenever any MTP packed shape exists (helios/src/scheduler/cost.rs:192-201), so the stated rule does not hold. Likewise docs/mtp-design.md:31-40 still describes copy drafting as the shared 65,536-token ring with eight- and four-token indexes returning "up to seven observed continuation tokens"; the code now queries the per-request SAM first and only falls back to the ring when its match is strictly longer (helios/src/scheduler.rs:1099-1136), with DEFAULT_MIN_MATCH_LEN = 6 (sam.rs:22) and a 131,072-token prompt cap.

Should fix — the manifest format spec omits the field the loader now reads. helios/manifest.md:29-53 is the specification of the Python graph dictionary, and lists draft_tokens, packed_token_capacity, confidence_width — but not draft_source, which heliopause/src/python.rs:223-233 now reads (0 = none, 1 = MTP, 2 = COPY, absent defaults by kind) and which is validated as 1/2 in ignition/preparation/execution.py:102-108. A core author following the manifest doc would silently get the kind-derived default. Fix: add draft_source with its values, default and the copy-only constraints.

Should fix — the description leaves out the admission-path cost it itself measures. The "Result" section reports PromptSAM::build at 13.05 ms and 4.52 MiB for a 131,072-token prompt, but never says where the build happens. It happens at admission inside RequestScheduler::admit (helios/src/scheduler.rs:1849-1856, sam::PromptOutputSAM::new(&spec.prompt)), on the serving critical path, once per request and per prompt, allocating a heap automaton of up to ~4.5 MiB per live request. AGENTS.md:96-112 requires the claimed benefit to carry "its scope and material limitations attached", and repo-prose requires disclosing limits. Fix: state that the build is paid at admission, that its cost scales with prompt length, that the automaton is per-live-request host memory, and that no live measurement of admission latency with --history-drafts on long prompts was taken.

Nit — the title names three of four outcomes. The title lists "cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify" but the PR also changes padding dominance and raises DEFAULT_MIN_MATCH_LEN; the description itself concedes the padding/threshold change produced the max_b == C and +12.9% results. Either add it to the title or say in the description why it travels with the other three.

Nit — bundling is asserted, not argued. AGENTS.md:194-199 asks for "one coherent outcome". The description says the four gaps are "related" but never says whether commits 1 and 4 are independent of 2 and 3. If 3 (wide copy graphs) needs 2 (the SAM) but 1 and 4 do not, say so, so a reviewer knows what must land together and what could be split.

Things I looked for and did not find wrong

The description's four sections are present and in the required order; the claimed results distinguish combined-stack throughput from component measurements ("end-to-end throughput reflects the combined runtime, recipe, and kernel stack") and list unbenchmarked hardware and model scope, as AGENTS.md:96-112 demands. The rewritten timing-refresh paragraphs at docs/scheduling-runtime-design.md:425-463 and :477-486 match the code: idle() is now a documented no-op that retains credit (refresh.rs:95-99), abort still truncates positive credit (:101-105), ordinary credit uses observed_compute_duration_ns while acceptance credit keeps raw duration (:71-80), and the two-tier (bool, u64) refresh_order reproduces the documented partitioning (cost.rs:287-296). The Discord line is present with a username and no leading @.

#2 [high] Blocking: --history-drafts now changes the loaded graph set but docs say it does not

Severity: blocking.

What is wrong: docs/cli-design.md:200-202 still states "--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs. --no-history-drafts disables those proposals. Cores exported by Ignition record no history preference."

After commit 35ab143a the flag does change the selected graph set. helios/src/runtime_core/selection.rs:179-184 computes history_enabled and retain_wide_copy = source == 1 && history_enabled && fixed.is_none(); :277-298 retains only graphs where copy_wide is true (draft_source == 2, token_capacity > 1, confidence_width == 0, depth > drafts) and otherwise prunes every draft_source == 2 speculative graph; :382-396 writes the narrowed speculative_widths back into the server config; core.graphs.retain(...) at :375 then drops the pruned graphs' kernels. Test wide_copy_graphs_retain_only_when_history_drafts_enabled (selection.rs:1876-1940) asserts speculative_widths stays [1,6,16,24] with history drafts and narrows to [1,6] without, and asserts no draft_source == 2 graph survives without the flag.

Same claim pattern in docs/mtp-design.md:22-29: "History drafting ... It requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do. Both settings use the same captured MTP graphs and buffers."

Why it matters: the CLI flag table entry at docs/cli-design.md:742 and the runtime-option page are the user-facing contract for what a startup flag does. A user reading them cannot learn that enabling history drafts can load extra wide copy graphs, change which kernels load, or that fixed-width mode silently disables them.

Fix: in docs/cli-design.md:200-202 and docs/mtp-design.md:22-29, state that --history-drafts also elects optional COPY_DRAFT wide graphs when the core provides them, and that they are retained only in adaptive mode with no fixed width; update the :742 flag-table row to match.

Repository rules cited: .agents/skills/repo-prose/SKILL.md:26-29 (documentation is a present-state specification), AGENTS.md:52-56, and docs/design-review.md:172-176 (prose reviewed against four-part scheme).

#3 [high] Should fix: design doc never specifies the new copy-draft / copy-wide scheduling policy

Severity: should fix.

What is wrong: docs/scheduling-runtime-design.md is the specification for Helios scheduling (its opening lines name the implementing modules), yet this PR changes only the funded-refresh/acceptance paragraphs and never specifies the new mechanisms it adds:

Why it matters: AGENTS.md:52-56 requires designed behavior to be stated as present-state specification, and docs/design-review.md:137-150 (principle 16) requires changed prose to let a reviewer reconstruct the argument. A reader cannot learn from the design doc that copy drafts exist per request, when they override learned drafts, or what prior and thresholds price them.

Fix: add a section specifying the per-request SAM, the copy-proposal precedence rule against DecodedHistory, the copy-only graph contract, and the wide-copy eligibility/calibration constants with their meanings explained before the identifiers. Add sam.rs to the module list at lines 6-13.

#5 [high] Should fix: docs/scheduling-theory.md still states the retired idle-discard and last-attempt refresh order

Verified at head 14019718.

(a) docs/scheduling-theory.md:714-721: "It orders alternatives by the later of their last valid completion and last attempted dispatch, then by ordinary useful-value ranking." This is exactly the ordering the PR replaces with the two-tier (bool, u64) key in helios/src/scheduler/cost.rs:287-296 plus expected-useful-value ranking (policy.rs:1333-1338, 1369-1372). The PR updated the same paragraph in docs/scheduling-runtime-design.md:441-450 but left this one.

(b) docs/scheduling-theory.md:725-729: "Idle discards positive credit, so repeated shorter bursts can preserve stale estimates indefinitely." Also :577-579 ("Idle earns no credit and discards positive credit while retaining debt. Consequently, separate busy bursts shorter than 245 ms cannot fund a probe"). helios/src/scheduler/refresh.rs:95-99 is now pub fn idle(&mut self) {} — idle retains credit and debt, and docs/scheduling-runtime-design.md:437-438, 465-469 now say so and explain that credit accumulates across idle-separated requests. So the two documents contradict each other and the theory doc contradicts the code.

(c) The same paragraph :704-712 presents retained-refresh as the simulator policy that "models the retained-cost rule that Helios implements", and scripts/scheduling_sim/learning_policy.py:671 still does self.credit_ms = min(0.0, self.credit_ms) in idle(). Since the doc claims the simulator reproduces Helios, the simulator and the sentence describing the correspondence are both now stale — either the simulator must retain credit too, or the doc must state the divergence explicitly.

Why it matters: AGENTS.md:52-56 (documents specify the architecture; state support as present qualification) and the repo-prose skill:26-29 (documentation is a present-state specification; replace stale claims). docs/scheduling-theory.md is linked from AGENTS.md:231 as required reading for scheduling-policy changes, and it is where the 2,495 ms funding bound and the idle behaviour are argued.

Fix: update :577-579 and :714-729 to the retained-credit rule and the two-tier refresh order (or state the simulator divergence), and align scripts/scheduling_sim/learning_policy.py:671 if the simulator is meant to model Helios.

#6 [high] Blocking: docs/mtp-design.md promises draft_source carries the proposal source; the exporter overwrites it with MTP

Verified at head 14019718.

docs/mtp-design.md:359-360 lists the ExecutionGraph fields as "draft_tokens, verify_tokens, draft_source: draft depth D, verification width, and proposal source, on graphs that declare a draft depth". But heliopause/src/export/binding.rs:196-202 unconditionally overwrites draft_source with the string "MTP" for every speculative (and speculative-mixed) graph on the sole export path (called from heliopause/src/export/capture.rs:3158), while ignition/preparation/execution.py:316-319 emits draft_source=signature.draft_source, which may be 2 (COPY_DRAFT) per execution.py:102-108. So an exported copy-only wide graph reaches the wire as MTP and runtime_core/selection.rs:277-298 will prune it (copy_wide requires draft_source == 2; the MTP branch requires draft_tokens <= drafts). Wide copy-verify is therefore dead on exported cores, and the doc's claim that the field carries the proposal source is false for cores produced by ignition export.

Severity: blocking (behaviour, not only prose). The prose finding is that mtp-design.md:359 asserts a field contract the exporter overrides, and no document states the exporter's coercion. Fixing the exporter (derive "COPY_DRAFT" from 2 and reject unknown values) also makes the sentence true. Reported by the Autobot review comment at /p/540 as its single blocker; verified independently in binding.rs and selection.rs.

Note for the final report: this is outside the prose lens strictly, but it is a documented-contract vs. code contradiction, which is a prose finding at mtp-design.md:359-360 as well.

#7 [high] Final consolidated prose verdict at head 14019718

Verified at head 14019718. Carries forward the earlier run's findings that still hold after the four commits, plus what this run adds.

BLOCKING

  1. docs/cli-design.md:200-202 ("--history-drafts ... it does not change the graphs."), docs/cli-design.md:741 (table row), docs/mtp-design.md:22-28 ("Both settings use the same captured MTP graphs and buffers."): all three deny that the flag changes the loaded graph set. helios/src/runtime_core/selection.rs:182-184, 277-298, 375-396 retains draft_source == 2 wide copy graphs only when retain_wide_copy, prunes them otherwise, prunes kernels, and rewrites speculative_widths; test wide_copy_graphs_retain_only_when_history_drafts_enabled (selection.rs:1876+).
  2. docs/mtp-design.md:359-360 states draft_source carries the proposal source, but heliopause/src/export/binding.rs:201 overwrites it with "MTP" for every speculative/mixed-speculative graph on the only export route (capture.rs:3158), so a copy-only graph exported by ignition arrives as MTP and is pruned by selection.rs:277-298. See note #6.

SHOULD FIX (docs the PR leaves describing behaviour the code no longer has, or new behaviour no document specifies) 3. docs/scheduling-runtime-design.md:1-19, 31-115, 179-215: the scheduling specification describes none of the new mechanism — sam.rs (absent from the module list at :6-12), the draft_source copy-only graph family and its confidence_width == 0 / no-SpeculativePrefixLimit contract (helios/src/model/catalog.rs:93-131, execution/manifest.rs:840-851), per-request CopyCalibration with WIDE_COPY_PRIOR_RATE = 0.88, COPY_STEP_PRIOR_WEIGHT = 4.0, COPY_DEPTH_SHRINK_WEIGHT = 2.0 (scheduler/speculation.rs:14-21, 98-190), and the wide-copy eligibility gate WIDE_COPY_MIN_MATCH_LEN = 6 / copy_len >= base_mtp_drafts + 3 / limit > base_mtp_drafts + 1 (scheduler/rounds.rs:751-790). 4. docs/scheduling-runtime-design.md:249-254: padding dominance is described only as "capacities ... all at least as large as an alternative". scheduler/policy.rs:221-254 adds a second pass that discards a wider GPU-allocated ragged speculative candidate when a tighter batch with other.batch >= active_lanes, equal (capacity, draft_tokens) and packed_token_capacity >= needed exists — so the survivor's P may be strictly smaller. 5. docs/scheduling-runtime-design.md:396-399: "minimum positive measured duration across matching shapes" no longer holds; scheduler/cost.rs:190-208 skips every copy-only shape whenever any MTP packed shape exists. 6. docs/mtp-design.md:31-40: still describes only the shared 65,536-token ring with eight/four-token indexes returning up to seven continuations. The code queries the per-request PromptOutputSAM first and only falls back to the ring on a strictly longer match (scheduler.rs:1139-1158), threshold DEFAULT_MIN_MATCH_LEN = 6 (sam.rs:22), prompt cap 131,072 tokens (sam.rs:25), 512-token boundary overlap (sam.rs:32). 7. docs/scheduling-theory.md:577-579, 714-721, 725-729 — see note #5: idle credit retention and the two-tier refresh order are both reversed there, and scripts/scheduling_sim/learning_policy.py:671 still discards credit on idle while the doc claims that policy models Helios. 8. helios/manifest.md:29-53: the Python graph-dictionary spec omits draft_source, which heliopause/src/python.rs:225-233 now reads (0/1/2, absent defaults by kind) and ignition/preparation/execution.py:102-108 validates. 9. PR description "Result": reports PromptSAM::build at 13.05 ms / 4.52 MiB at 131,072 tokens without saying it is built synchronously at admission per request on the serving path (helios/src/scheduler.rs:1849-1852) with per-live-request host memory. AGENTS.md:96-102 requires limitations attached; repo-prose:35-37 requires disclosing missing measurements.

NITS 10. Title names three of the four outcomes; the padding/threshold commit (14019718) produced the headline max_b == C and +12.9% results. 11. Bundling is asserted, not argued: AGENTS.md:194-199 asks for "one coherent outcome"; the description never says which commits depend on which. 12. sam.rs:1112-1117 documents propose_conditional_continuations as feeding "conditional copy lookup tables in 2-deep pipelined execution", a mechanism that exists nowhere in the repository (only proposed_continuations and its own test call it: sam.rs:1505). This is a false definite reference under repo-prose:17-19; either name the caller or drop the sentence.

RULES CITED AGENTS.md:43-65 (required prose review), :52-60 (documents specify architecture), :72-112 (four required PR sections), :194-199 (one coherent outcome); .agents/skills/repo-prose/SKILL.md:13-29, 30-37, 40-43; docs/design-review.md.

CONFIRMED CORRECT (no finding)

COULD NOT SETTLE

#8 [high] Research summary

Reviewed PR #540 at head 14019718 through the prose lens against AGENTS.md, .agents/skills/repo-prose/SKILL.md (not opened) and the project charter, reading every changed doc plus the code each paragraph describes.

Verdict: changes requested — two blocking documentation contradictions. Both concern documentation that now states the opposite of the code: (1) docs/cli-design.md:200-202, its :741 table row and docs/mtp-design.md:22-28 still say --history-drafts "does not change the graphs" and that both settings "use the same captured MTP graphs and buffers", while helios/src/runtime_core/selection.rs:182-184, 277-298, 375-396 retains or prunes draft_source == 2 wide copy graphs, prunes kernels and rewrites speculative_widths by that flag; (2) docs/mtp-design.md:359-360 promises draft_source carries the proposal source, but heliopause/src/export/binding.rs:201 overwrites it with "MTP" on the only export route (capture.rs:3158), so an exported copy-only graph arrives as MTP and is silently pruned.

Should fix (seven). The scheduling specification (docs/scheduling-runtime-design.md:1-19, 31-115, 179-215) describes none of the new machinery: sam.rs (missing from the module list), the copy-only graph contract (model/catalog.rs:93-131, execution/manifest.rs:840-851), CopyCalibration and its 0.88/4.0/2.0 constants (scheduler/speculation.rs:14-21, 98-190), and the wide-copy gate at rounds.rs:751-790. Three untouched paragraphs now describe retired behaviour: padding dominance at :249-254 versus policy.rs:221-254, "minimum across matching shapes" at :396-399 versus cost.rs:190-208, and the shared-ring-only history description at docs/mtp-design.md:31-40 versus scheduler.rs:1139-1158 with min_match_len = 6. New this run: docs/scheduling-theory.md:577-579, 714-721, 725-729 — the document AGENTS.md:231 makes required reading for scheduling changes — still asserts the last-attempt refresh ordering and that idle discards positive credit, both reversed by refresh.rs:95-99 and cost.rs:287-296, and still claims scripts/scheduling_sim/learning_policy.py:671 models Helios. helios/manifest.md:29-53 omits draft_source, and the description reports the 13 ms / 4.52 MiB SAM build without saying it is paid at admission per request (scheduler.rs:1849-1852).

Nits (three): the title names three of four outcomes; the bundling is asserted rather than argued against AGENTS.md:194-199's "one coherent outcome"; and sam.rs:1112-1117 documents "conditional copy lookup tables in 2-deep pipelined execution", a mechanism that exists nowhere in the repository. The rewritten funded-refresh prose and the description's four-part structure and claim calibration are correct.

#11 [high] Research summary

Verdict after re-review at head e5a69669: no blocking prose issues remain. (Scratchpad could not be written this turn — findings are below in full and supersede #7/#10.)

Previously blocking, now fixed (verified in the code at e5a69669)

Remaining, should fix (small)

  1. docs/mtp-design.md:542-544 — implementation status still names only the shared ring. "Implemented for Qwen: … copy proposals from shared decoded history (helios/src/scheduler/decoded_history.rs (not opened))" omits helios/src/scheduler/sam.rs, the primary source per scheduler.rs:1122-1147, and omits the copy-only wide graph family. A reader of the status list concludes per-request prompt copying does not exist. Add sam.rs (per-request prompt+output suffix automaton) and the copy-only wide graphs to that list.

Nits

  1. docs/api.md:295-296 and docs/cli-design.md:1790 still describe flare_history_drafts_enabled / the core capability as "whether shared decoded history augments learned proposals" and "whether drafts can be copied from shared decoded history". Since --history-drafts now also enables the per-request SAM and selects copy-only graphs, both should say "copy proposals from the per-request suffix automaton and shared decoded history."
  2. docs/scheduling-runtime-design.md:429-433 says combined (batch, width) lookups "return zero only when covering shapes exist without a positive measurement"; cost.rs:240-251 returns None (not zero) when only an unmeasured COPY_DRAFT row exists and any MTP row anywhere is measured. The parenthetical hints at this but the sentence overstates. Say that a copy-only unmeasured row yields zero only when no MTP packed shape exists in the catalog.

Checked clean

Refresh/acceptance prose at docs/scheduling-runtime-design.md:465-520 matches refresh.rs:71-93 and cost.rs:21-38 (compute duration excludes readiness wait, wall_ns fallback only when GPU timing is absent); docs/cli-design.md:747 row is consistent with :200-208; the flagged-prose rule about untested work is satisfied by the description's Limits paragraph; no instruction-like or injected text appears in the PR body or comments. The @flare-autobot and @shieldstar items I could still check (sample per-lane forecast reuse, keying by draft_source, has_mtp removal) are all implemented as described. I did not run any test suite; all findings are from reading the code at e5a69669.

#12 [high] Report of 2026-11-27, run 1355 — no blocking prose issues at e5a69669

Verdict after re-review at head e5a69669: no blocking prose issues remain. Supersedes notes #2, #3, #5, #6, #7 and #10.

PREVIOUSLY BLOCKING, NOW FIXED (verified in code at e5a69669)

  1. --history-drafts graph selection now documented. docs/cli-design.md:200-208 and :747 row state the flag retains copy-only (draft_source = COPY_DRAFT) graphs and widths and that pruning drops kernels and rewrites widths; docs/mtp-design.md:26-34 agrees. Matches helios/src/runtime_core/selection.rs:184 (retain_wide_copy), :277-298 (copy_wide, prune), :382 (prune_kernels), :384-393 (retained_widths). The "it does not change the graphs" sentence is gone.
  2. draft_source no longer overwritten on export. heliopause/src/export/binding.rs:201-216 derives COPY_DRAFT from 2, defaults absent/0/1 to MTP, rejects unknown, rejects copy-only on non-speculative; round-trip test at binding.rs:1490-1498. docs/mtp-design.md:386-387 now true. ignition/preparation/execution.py:104-108 rejects draft_source == 2 on mixed/decode, matching selection.rs:244-247.
  3. Scheduling spec now specifies the new mechanism: docs/scheduling-runtime-design.md:6-15 (module list adds sam.rs, decoded_history.rs), :71-90 (new "Proposal sources and calibrated wide copy-verify": copy-only graph contract, retention gate, 6-token / base_mtp_drafts+3 / base_mtp_drafts+1 gates, CopyCalibration 0.88 / 4.0 / 2.0 / 128-token half-life) matching rounds.rs:882-916 and speculation.rs:14-37,136-222; :273-283 now describes the ragged dominance pass at policy.rs:239-256; :425-433 now describes per-source packed-duration tables and MTP-preferred aggregation at cost.rs:204-252.
  4. Theory doc now separates simulator from Helios: docs/scheduling-theory.md:576-582 (simulator idle discards credit; Helios retains, refresh.rs:95-99 has no idle) and :717-744 (two-tier unattempted-first order, cost.rs:324-333). scripts/scheduling_sim/learning_policy.py:668-673 still discards credit, which the doc now states as a deliberate divergence instead of denying.
  5. docs/mtp-design.md:36-66 now documents per-request PromptOutputSAM first with the ring as fallback (131,072-token caps, 512-token overlap, min_match_len 6) matching sam.rs:19-33 and scheduler.rs:1112-1178. helios/manifest.md:38 documents draft_source.
  6. PR description now states SAM builds synchronously at admission (scheduler.rs:1843-1846), keeps why/what/result/evidence order, labels combined-stack results, and names the untested hardware/model/export cases.

SHOULD FIX (remaining)

  1. docs/mtp-design.md:542-544 "Implementation status" still lists only "copy proposals from shared decoded history (helios/src/scheduler/decoded_history.rs)". Missing sam.rs (per-request prompt+output suffix automaton, the primary source per scheduler.rs:1122-1147) and the copy-only wide graph family. Fix: add both to the implemented list.

NITS 2. docs/api.md:295-296 (flare_history_drafts_enabled "whether shared decoded history augments learned proposals") and docs/cli-design.md:1790 ("whether drafts can be copied from shared decoded history") predate the SAM; reword to "copy proposals from the per-request suffix automaton and shared decoded history". 3. docs/scheduling-runtime-design.md:429-433 says combined (batch,width) lookups "return zero only when covering shapes exist without a positive measurement"; cost.rs:240-251 actually returns None when only an unmeasured COPY_DRAFT row exists and any MTP packed row is measured. Narrow the sentence.

CHECKED CLEAN

RULES CITED: AGENTS.md:43-65 (required prose review; every repo doc is a present-state specification), :72-112 (four required PR sections), .agents/skills/repo-prose/SKILL.md:13-37 (present-state specification, false definite references, disclose missing measurements), charter (PR descriptions need four parts; compatibility across supported matrix).

COULD NOT SETTLE / NOT RUN: no test suite or benchmark was run this turn; all findings are from reading code at e5a69669. Whether admission-time SAM build is a visible serving stall still needs a live ~128K-prompt --history-drafts run.

#14 [high] Should fix: helios/README.md still states idle discards positive credit and credit uses raw measured duration

Head 982a9ce3.

helios/README.md:432-437 reads:

"Ordinary valid execution earns refresh credit at 0.002 / 0.998 times its measured duration, capped at 5 ms. ... Refresh pays for one complete physical program, including its proposal and verification work. Another refresh waits for full credit. Idle discards positive credit and preserves debt."

Both clauses are now wrong for the merged code:

Same paragraph also lacks the abort/idle distinction now specified in docs/scheduling-runtime-design.md:443-444 and the readiness-wait exclusion at :436-442, and it still claims refresh "pays for one complete physical program" rather than compute duration with a fallback.

Why it matters: AGENTS.md:52-60 and .agents/skills/repo-prose/SKILL.md:26-29 make every repository document a present-state specification; readers of the Helios operator README get the retired rule. docs/scheduling-runtime-design.md was updated by this PR for exactly these two points, and helios/README.md:439 links to that section, so the two documents now disagree.

Fix: in the same paragraph, say credit is 0.002 / 0.998 of compute duration (measured readiness wait excluded, discarded when the device interval does not exceed readiness wait), that a funded refresh is charged the same compute duration with unexcluded physical/wall fallback, and that idle retains bounded earned credit while abort clears positive credit and keeps debt. Keep the pointer to the funded-timing-refresh section.

Severity: should fix (documents the reverse of the shipped rule in an operator-facing file changed behavior in this PR).

#16 [high] Nits: strict-positive-charge wording, unverified pre-existing failure name, ambiguous idle rationale

Head 982a9ce3. These are the remaining prose gaps I could confirm from the diff and surrounding code.

  1. Nit — helios/src/scheduler/cost.rs:47-52 doc comment on timing_refresh_duration_ns says the fallback "ensuring every validated refresh completion incurs a strictly positive charge". timing_refresh_duration_ns can still return 0: observed_compute_duration_ns returns None, observed_duration_ns returns None (no positive gpu_ns), and timing.wall_ns == 0. RefreshState::validate_completion (helios/src/scheduler/refresh.rs:63-69) rejects that combination before complete runs, so the code is safe, but the guarantee lives in the caller, not in this function. Fix: say the fallback is positive for every completion validate_completion accepts, or name that precondition. helios/src/scheduler/policy_tests.rs:6140-6180 shows exactly the accepted paths (gpu_ns <= wait_ns, wall_ns 0 and 130 ms).

  2. Nit — PR description "What" bullet for cost.rs repeats the same overstatement: "timing_refresh_duration_ns (falling back to unexcluded physical or wall duration so every refresh completion incurs a strictly positive charge)". Same fix; the guard is RefreshState::validate_completion at refresh.rs:63-69, which already rejects wall_ns == 0 with no measured interval.

  3. Nit — PR description "Evidence" cites a pre-existing upstream failure by test name: model::tests::packed_combined_budget_keeps_width_one_batches_without_a_useful_packed_shape. That test is helios/src/model/packed_round_tests.rs:68, included at helios/src/model/tests.rs:1640; the failure is asserted to exist on main and to be untouched here. The description does not say what the failure is or that it was confirmed on main by the same command, so a reviewer cannot check the "pre-existing" claim. AGENTS.md:103-112 requires the behavior, baseline, and result for each claim; fix by naming the failing assertion or the main commit where it reproduces.

  4. Nit — helios/src/scheduler.rs:1158-1162 new doc comment: "Timing-refresh and acceptance-learning ledgers retain bounded earned credit (<= CREDIT_CAP_NS) and negative debt across idle intervals because idle adds neither credit nor ordinary duration." The clause "because idle adds neither credit nor ordinary duration" reads as a justification for the retention rule but is the reason the bound still holds (P <= (0.002 / 0.998) * O + D), which is what docs/scheduling-runtime-design.md:470-474 says. Reword to "so the aggregate bound is unchanged" or split the two statements. Not a wrong statement, just ambiguous.

  5. Note, not a finding — the docs edits in this PR are limited to docs/scheduling-runtime-design.md:434-499 and docs/scheduling-theory.md:574-583, 727-738; helios/README.md (finding in entry #14) is the only present-state spec that still carries the retired idle rule for Helios. docs/direct-execution.md:111-114, docs/TODO.txt:110-114, and docs/mtp-design.md:400-402 were already correct and need no change.

#17 [high] Final consolidated prose verdict at head 982a9ce3

Head 982a9ce3. Supersedes notes #2-#7, #10, #12, #13. The earlier SAM / wide copy-verify / padding-pruning blockers are moot: those changes were removed from this PR, and pr_files now lists only docs/scheduling-runtime-design.md, docs/scheduling-theory.md, helios/src/scheduler.rs, helios/src/scheduler/cost.rs, helios/src/scheduler/policy_tests.rs, helios/src/scheduler/refresh.rs, scripts/scheduling_sim/learning.py, scripts/scheduling_sim/learning_policy.py, and the two Python scheduling tests. docs/mtp-design.md:542-544, docs/api.md:295-296, docs/cli-design.md:1790, and docs/scheduling-runtime-design.md:429-433 are all outside this diff now, so those earlier should-fix/nit items do not apply to this head.

Verdict: should fix (one), plus three nits.

Rules applied: AGENTS.md:43-65 (required prose review; every doc a present-state spec; unrun checks belong in docs/TODO.txt) and AGENTS.md:72-112 (four-part PR description: why / what / result / evidence, with limits visible); .agents/skills/repo-prose/SKILL.md:13-46 (describe the system as it exists, no chronology, evidence as conditions + result + limits); docs/design-review.md:190-201 (timing-estimation and funded-refresh changes must run the screening and 64-seed validation catalog).

What I read in context: helios/src/scheduler/refresh.rs in full (both at head and at main), helios/src/scheduler/cost.rs:1-360 and its new test block, helios/src/scheduler.rs:1140-1180 and :2630-2660 / :3042-3064, docs/scheduling-runtime-design.md:1-30, 360-500, docs/scheduling-theory.md:540-600, 660-700, 700-770, 760-879, helios/README.md:410-480, scripts/scheduling_sim/learning.py:76-160, 410-530, scripts/scheduling_sim/learning_policy.py:40-90, 655-690, scripts/scheduling_sim/learning_scenarios.py:1-157, tests/test_scheduling_learning_experiments.py and tests/test_scheduling_learning_policy.py diffs, AGENTS.md, docs/design-review.md:168-260, .agents/skills/repo-prose/SKILL.md, .githooks/commit-msg.

Confirmed findings:

Checked clean / no finding: entry #15.

Prose-quality points I judged acceptable and deliberately did not raise: the description's "Result" section distinguishes simulator results from live Helios behavior and explicitly lists unrun GPU/HTTP, pytest tests/cli, and cargo kani/cargo-mutants checks (AGENTS.md:103-112 satisfied for those claims); docs/scheduling-theory.md:577-583 correctly scopes the default-discard rule to the simulator and attributes retained credit to Helios; docs/scheduling-runtime-design.md:492 correctly distinguishes idle (retains) from abort (clears positive, keeps debt), matching refresh.rs:95-99.

No code or test run was performed this turn; no CI checks exist on 982a9ce3, so I judged the "Evidence" section against the emitted gate keys in learning.py and the recovery rule in scheduling-theory.md:831-832, not against a run.

#18 [high] Research summary

Verdict: should fix (one), plus three nits. No blocking prose issues.

Reviewed PR #540 at head 982a9ce3 through the prose lens, against AGENTS.md:43-65 (every repo doc is a present-state specification; review prose against .agents/skills/repo-prose/SKILL.md (not opened)) and AGENTS.md:72-112 (four-part PR description: why / what / result / evidence, with limits visible), plus docs/design-review.md:190-201 (timing-estimation and funded-refresh changes must run the screening and 64-seed validation catalog).

The PR has been narrowed since my last turn: pr_files now lists only 10 files — the two scheduling docs, helios/src/scheduler.rs, cost.rs, refresh.rs, policy_tests.rs, the two simulator modules, and the two Python scheduling tests. All earlier findings against docs/mtp-design.md (not opened), docs/api.md, docs/cli-design.md (not opened), and the packed-round-lookup text are moot because those files left the diff.

Should fix — helios/README.md:432-437 still states the retired rule: refresh credit is 0.002 / 0.998 of "measured duration", a refresh "pays for one complete physical program", and "Idle discards positive credit and preserves debt." The code now retains bounded earned credit across idle (helios/src/scheduler.rs:1158-1168; RefreshState::idle is gone), credits compute duration excluding readiness wait (refresh.rs:73-80), and charges timing_refresh_duration_ns (refresh.rs:86-88). This is an operator-facing file contradicting the two docs this PR did update.

Nits: the "strictly positive charge" claim in the cost.rs:47-52 doc comment and in the PR body's cost.rs bullet holds only via the validate_completion guard in refresh.rs:63-69, not in the function itself; the description names a pre-existing upstream test failure without saying what fails or where it reproduces on main; and the new scheduler.rs:1158-1162 comment's "because idle adds neither credit nor ordinary duration" reads as the justification for retention when it is the reason the aggregate bound survives.

Checked clean: the simulator's retain_idle_credit default and --retain-idle-credit gating match docs/scheduling-theory.md:577-583; the harm_alpha "idle clears positive balances" text at scheduling-theory.md:682 is simulator-only and untouched; the validation evidence matches the gate keys learning.py:561-573 actually emits and the recovery rule at scheduling-theory.md:831-832; and the new idle/abort split in scheduling-runtime-design.md:443-444, 492 matches refresh.rs:95-99. No checks were run this round and the head commit has no CI, so the evidence section was judged against the code paths that emit those gates rather than against a run. Full findings are in scratchpad notes #14, #16, and #17.

#9 [medium] Report assembly guide: which notes to read, verdict order, and what is already settled

Read note #7 first — it is the consolidated, de-duplicated set at head 14019718 and supersedes notes #2 and #3 (which were written at an earlier head and are the same two findings in longer form). Read note #6 for the exporter draft_source blocker in full, and note #5 for the scheduling-theory staleness in full.

Verdict order for the report:

  1. Blocking — --history-drafts now changes the loaded graph set while docs/cli-design.md:200-202, :741 and docs/mtp-design.md:22-28 deny it (note #2 / #7 item 1).
  2. Blocking — docs/mtp-design.md:359-360 promises draft_source carries the proposal source; heliopause/src/export/binding.rs:201 overwrites it with "MTP" on the only export path (note #6 / #7 item 2).
  3. Should fix x7 — scheduling-runtime-design.md module list and missing copy/SAM/wide-copy specification; :249-254 padding dominance; :396-399 packed-duration aggregation; mtp-design.md:31-40 ring-only history; scheduling-theory.md idle-credit and refresh-order contradictions plus the stale simulator claim; helios/manifest.md missing draft_source; PR description omitting the admission-time SAM build cost.
  4. Nits x3 — title omits the fourth outcome; bundling asserted not argued (AGENTS.md:194-199); sam.rs:1112-1117's "2-deep pipelined execution" false definite reference (repo-prose:17-19).
  5. Confirmed correct — rewritten funded-refresh/acceptance prose matches refresh.rs:71-105 and cost.rs:27-36, 287-296; description's four-part order and claim calibration; Discord line present.
  6. Could not settle — whether admission-time SAM construction stalls serving (needs a live ~128K-prompt run); which document should own the copy-only wide graph description (but one must, since cli-design.md denies the flag changes graphs); no tests run and no CI checks on the head commit.

Nothing else is outstanding; every finding above was re-verified in the code at 14019718 during this run.

#15 [medium] Checked clean: simulator defaults, harm_alpha idle text, validation evidence

Head 982a9ce3.

run its idle() at scripts/scheduling_sim/learning_policy.py:671-677 gates credit retention behind retain_idle_credit (default False), so the simulator default still discards positive credit; scripts/scheduling_sim/learning.py:436-440 exposes --retain-idle-credit with default=None and boolean validation at learning_policy.py:83-84; the simulator ledger credit_ms = min(credit_cap, credit_ms + alpha/(1-alpha)*duration) at :663-666 (no readiness exclusion exists in the model).

docs/scheduling-theory.md:577-583 and :730-736 describe this split accurately, including that --retain-idle-credit matches Helios. No conflict found.

docs/scheduling-theory.md:682 ("Idle clears positive balances and retains debt") is the harm_alpha targeted-policy balance. It is simulator-only: no harm_ state exists in helios/src (search for harm_credit|harm_alpha under helios/src returns nothing), and docs/scheduling-theory.md:669-670 introduces harm_alpha as an "alternative" in the simulator's policy-comparison section. This PR touches neither. Not a finding.

docs/design-review.md:196-201 requires timing-estimation or funded-refresh changes to be run against the screening and 64-seed validation catalog; the description reports 16-seed screen + 64-seed validate with --preset validate --reference ttl, 62 scenarios, complete_core_suite=true, complete_validation_suite=true, 35/35 core gates, 0/2,240 resets, 8/8 recovery groups with 64/64 recovered, and 0 spurious idle probes — consistent with the gate keys emitted by scripts/scheduling_sim/learning.py:561-573 (complete_core_suite, complete_validation_suite) and the recovery rule at docs/scheduling-theory.md:831-832 (61 of 64 seeds, 60 occupied seconds).

#19 [medium] Report-supporting details: commit/PR text assessment and the one evidence claim I could not verify

Head 982a9ce3. Supporting detail for the final report; the findings themselves are in notes #14 (should fix) and #16 (nits), and the verdict is note #17.

Commit message and PR title. The single commit subject is "Retain bounded timing-refresh credit across idle and exclude readiness wait" (search_history on helios/src/scheduler/refresh.rs shows 982a9ce3 as the only new commit to that file). It names both behavior changes, uses no lifecycle labels, and needs no conversation history to read — acceptable under .agents/skills/repo-prose/SKILL.md:40-43 and AGENTS.md:74-80. The PR title in the review request matches it.

PR description, four-part check against AGENTS.md:74-112:

Evidence claim I could not verify with the tools available. The description states that candidate 982a9ce3 is rebased onto origin/main at 353551e9, "which touches only docs/design-review.md relative to 3e2fcd27; all source, test, and scheduling-design files are byte-identical to the verified 3e2fcd27 tree," so the Rust results obtained on 3e2fcd27 transfer. I read only the PR's tree and its diff against the merge base, so I cannot confirm the byte-identity or the contents of 3e2fcd27 versus 353551e9. Nothing in the diff contradicts it: the changed files here are the ten listed by pr_files, and docs/design-review.md at head does contain the testing-hierarchy addition and the agent-refusal rule visible in the pasted docs/design-review.md diff. If the report repeats this claim, it should attribute it to the author's evidence rather than treat it as verified here.