Conventions scratchpad · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/32544086-e7ce-428c-af87-cd5bf1297aca.md

#1 [high] Should fix: request_copy_match_stats duplicates request_history_proposal_with_match_len

File: helios/src/scheduler.rs:1099-1205. request_history_proposal_with_match_len (1112-1159) and request_copy_match_stats (1163-1205) repeat the same chain: same clamp (maximum.min(completion_token_capacity-1).min(COPY_DRAFT_CAPACITY)), same early exit on maximum == 0 || decoded_history.is_none(), same self.request(handle) lookup, same sam.propose(maximum), same out-of-vocabulary truncation (position(|&t| (t as usize) >= vocabulary)), same shared-ring query via DecodedHistory::lookup_with_match_len(request.tokens(), maximum), and the same "shared ring wins only on strictly longer match" rule. The second function differs only in returning (valid_len, match_len) instead of a padded vector. Precedent: the same PR follows the opposite (correct) pattern in helios/src/scheduler/decoded_history.rs:162-183, where lookup is a two-line wrapper over lookup_with_match_len, and the sole difference is the returned tuple. helios/src/scheduler/rounds.rs powered_curve/expected_speculative_tokens (537-557) also factor a cheap view out of the expensive computation rather than copying it. Risk beyond duplication: the two copies are already not identical. In request_history_proposal_with_match_len the shared-ring result is used unconditionally in the (None, Some(..)) arm (no count > 0 filter), whereas request_copy_match_stats filters .filter(|&(count, _)| count > 0) before the match; a zero-count shared result therefore yields (tokens, 0, 0) in one path and is skipped in the other. Any future fix to the vocabulary clip, the tie-break, or the count == 0 handling has to be made twice. Fix: express one on the other, e.g. request_copy_match_stats calls a shared private helper returning (match_len, valid_len, provider) and drops the padded build (an Option<&MatchProposal>-style return), so the clip and tie-break exist once.

#2 [high] Should fix: wide_copy_curve fallback duplicates CopyCalibration's own prior and is unreachable

File: helios/src/scheduler/rounds.rs:541-553 (wide_copy_curve). The else arm recomputes speculation::WIDE_COPY_PRIOR_RATE.powi(depth+1) over completion_token_capacity-1 depths, which is exactly what CopyCalibration::new(capacity).curve(generated, optimistic) returns when depths are all None (speculation.rs:121-151: prior = rate.powi(depth+1) for the None entry, with rate seeded at WIDE_COPY_PRIOR_RATE). The scoring structure the fix belongs to (wide_copy_curve/expected_copy_tokens wrapping powered_curve/expected_speculative_tokens) is the right precedent, but the fallback curve should live next to its owner. The branch is also unreachable in practice: LiveRequest.sam and LiveRequest.copy_calibration are set together from the same predicate self.decoded_history.is_some() at admission (scheduler.rs:1849-1856), enable_history_drafts must run before admission (scheduler.rs:1086-1092: rejects when self.submitted != Fence(0) || self.admissions != 0), and every caller of wide_copy_curve is already gated on self.decoded_history.is_none() == false (rounds.rs:759). So copy_calibration cannot be None where this arm runs. Fix: delete the else arm and use request.copy_calibration.as_ref().expect(...), or make CopyCalibration::curve the only source and give it a CopyCalibration::prior(capacity) constructor so no caller re-derives the geometric prior. This also removes the second hard-coded use of WIDE_COPY_PRIOR_RATE outside speculation.rs.

#3 [high] Remaining findings: doc staleness, cost.rs repetition, unwired public SAM API

Observations verified in the diff but not fully cross-checked against every convention precedent. Order by confidence. These were collected just before the time limit.

  1. Deviation from convention (should fix) — docs/scheduling-runtime-design.md:7-12 lists the scheduler modules that specify the design (policy.rs, utility.rs, service.rs, cost.rs, refresh.rs, learning.rs, rounds.rs, speculation.rs). The new helios/src/scheduler/sam.rs implements a mechanism the same document specifies (copy proposals, lines 39-41 and 102) but is not added to that module index, so a reader of the design document cannot find the implementation. Fix: add sam.rs (per-request prompt and output suffix automata for copy proposals) to the list.

  2. Deviation from convention (should fix) — docs/mtp-design.md:31-40 describes copy proposals solely as the shared 65,536-token ring with eight- and four-token indexes, and lines 22-29 say history drafting uses "shared decoded history" only. After this PR a request's proposals come first from a per-request prompt+output suffix automaton (scheduler.rs:1099-1159) with a six-token minimum match (sam.rs:22, raised from three) and a 131,072-token prompt plus 131,072-token output cap per request (sam.rs:25-28). docs/cli-design.md:742 likewise says only "shared decoded-history continuations". repo-prose SKILL.md:26-29 requires replacing stale present-state claims rather than layering; this is the file that owns copy-draft semantics.

  3. Nit — helios/src/scheduler/cost.rs:195, 199, 229, 239 plus rounds.rs:756 spell out estimate.draft_source != Some(ProposalSource::Copy) five times. A single small accessor on Estimate (the file already carries Estimate::fresh, cost.rs:111) would match local style and keep the meaning in one place; is_copy_only_step and max_mtp_draft_tokens read from it.

  4. Nit — cost.rs:287-296: refresh_order changed return type to (bool, u64) and lost the doc comment explaining the ordering, which now lives only in docs/scheduling-runtime-design.md:437-441. (true, attempt_ns) meaning "attempted while stale, no valid observation" is not self-evident; neighbouring helpers in cost.rs (lines 21-48, 210-213) carry their invariants in one-line doc comments.

  5. Nit — helios/src/scheduler/sam.rs:1236-1273: the test-only brute_force_oracle returns the production MatchProposal and re-implements build_proposal's source selection and token slicing (sam.rs:1191-1227), so the oracle can drift with production code. Precedent: the oracle helper in helios/src/scheduler/decoded_history.rs:228-252 returns the same plain (Vec<i64>, usize) the production lookup returns. The 120-trial randomized oracle (sam.rs:1402) is only as strong as its independence.

  6. Not a finding — DEFAULT_MIN_MATCH_LEN = 6 (sam.rs:22) and WIDE_COPY_MIN_MATCH_LEN = 6 (speculation.rs:18) are two constants for the same threshold; rounds.rs:776 requires both to pass. Since the SAM default governs the plain --history-drafts packing path too (packing.rs:395-407 → request_history_proposal → SamConfig::default(), sam.rs:53-62), the wide-copy constant could reference the SAM default rather than repeat 6. Neither is wired to a flag, so both satisfy the "no magic defaults" rule only if the value is argued in prose; docs/mtp-design.md currently justifies neither.

  7. Not a finding — helios/src/scheduler/sam.rs module doc (lines 7-17) and public API (PromptSAM::build, PromptOutputSAM::new, SamConfig, MatchProposal, MatchSource) do not use lifecycle labels, follow the SPDX header convention used across helios/src/scheduler/, and add "Flare community contributors" as a second copyright line (matching speculation.rs:3). propose_conditional_continuations and propose_for_context (sam.rs:1070, 1118) are public but have no caller outside the test module; propose_for_context is exercised only by sam.rs:1463. Consuming-only-in-tests public API is the kind of speculative surface AGENTS.md rejects ("Reject unsupported abstractions... Do not add frameworks, extension points... without a concrete requirement"), so this should be raised: either the 2-deep pipelined execution path that needs them lands in this PR, or the two functions and their tests should not ship as pub.

#5 [high] Should fix: draft_source is not part of prepared-shape identity

PR #540 adds GraphDescriptor::draft_source (helios/src/execution/manifest.rs:191-192) as a new graph discriminant, but the two places that define a prepared shape's identity were not extended, and both have a hard failure path when two graphs share a shape.

  1. helios/src/model/catalog.rs:279-293 (select_shape_with_drafts) filters manifest graphs on kind && batch_capacity && token_capacity && prefill_capacity && packed_token_capacity && draft_tokens && sampling_mode and returns Err("ambiguous prepared model graph capacity") when two match. draft_source is absent, so a copy-only speculative graph captured at the same B/D/W/P as an MTP graph fails catalog validation, even though the new validation at catalog.rs:94-131 specifically contemplates copy-only graphs.
  2. helios/src/scheduler/cost.rs:50-58 Key {drafts, kind, batch, tokens, prefill, packed} is the cost-table identity, and ActionCosts::prepared (cost.rs:151-169) returns Err("prepared graphs require unique shapes") on a duplicate key. The PR instead stores draft_source on the value side (Estimate.draft_source, cost.rs:81/169) and re-derives the source in is_copy_only_step (cost.rs:223-232) and max_mtp_draft_tokens (cost.rs:234-244). So two graphs identical except draft_source make the core fail to load with "prepared graphs require unique shapes".

Precedent for the correct identity, already in the tree and already updated for this PR: helios/src/runtime_core/selection.rs:250-251 treats a serving variant as (kind, sampling_mode, batch_capacity, token_capacity, prefill_capacity, packed_token_capacity, draft_tokens, draft_source, speculation_enabled) and rejects only true duplicates. The wire layer therefore accepts an MTP + copy pair at the same geometry, and the manifest/cost layers reject it — three identities for one object.

Why it matters: a copy-only graph at the same width/depth as the MTP graph is the natural capture for W=16 when MTP also has W=16 (ignition draft_source defaults to 1 and copy graphs use draft_tokens = width - 1, ignition/preparation/execution.py:32,87-92), so this is reachable as soon as the sibling recipe PRs capture copy-only graphs at an MTP width. It also contradicts the PR's compatibility claim that "existing W=8-only cores without copy-only wide graphs load" — those load, but a core that mixes the two at one geometry cannot.

Fix: add draft_source to cost::Key (and Key::from_step, which then needs the graph's source passed in or the step to carry it) and to the select_shape_with_drafts filter, so graph identity is stated once, as selection.rs:250-251 already states it. That also lets Estimate.draft_source, PackedRoundShape::draft_source and is_copy_only_step's inference be dropped.

Verified by reading catalog.rs:279-293, cost.rs:50-58/147-179/223-244, selection.rs:250-251.

#6 [high] Should fix: wide copy-only cohort loop duplicates the ordinary packed-round loop

RequestScheduler::packed_round_candidates (helios/src/scheduler/rounds.rs:737-1062) now contains two structurally identical cohort searches.

Copy-only block, rounds.rs:791-902:

Ordinary block, rounds.rs:925-1047, performs exactly the same steps: scores/gains from the forecast curve (929-956), base/base_zero/full/limits (964-976), the same three orderings with select_nth_unstable_by + truncate + sort_unstable_by + frontier trim + lane_terms + the identical best-mask predicate (981-1047), and the same Candidate construction with zero-duration expected (1048-1060).

The only real differences are the curve source (copy_curves vs curves/host_ranking) and that the copy block never uses host_ranking/surplus_table. That is a per-slot curve provider, not a separate algorithm.

Precedent inside the same file/PR: the function already factors cohort-independent helpers exactly this way — rank_prefixes (rounds.rs:505 and 800), fixed_round_candidate (rounds.rs:~690-735) which builds a Candidate once for all shapes sharing a ranking, host_prefix_ranking (rounds.rs:490-513), and wide_copy_curve/expected_copy_tokens wrapping powered_curve/expected_speculative_tokens (541-557). The reviewable unit is "one loop plus a curve closure", which is also what the existing comment "Lane forecasts stay fixed while shapes compete; evaluate each at most once" (rounds.rs:746) is about.

Cost of the duplication: ~100 lines, two copies of the frontier/host_lengths budget arithmetic (851-853 vs 1026-1030) and of the best-mask tie-break (868-873 vs 1040-1043) that must be kept in step; the copy block also silently lacks the surplus_table factor the ordinary block applies (1031-1037), so a future change to cohort pricing has two sites and one of them already differs.

Fix: extract the ordering/cohort search into one helper taking &[f64] per slot (or a fn(slot, position) -> f64 marginal-probability closure) and the per-slot limit, and call it from both blocks.

Verified by reading rounds.rs:737-1062.

#8 [high] Should fix: manifest.md and copy-draft design prose not updated for draft_source and the per-request SAM

Two documents that this PR makes stale were not updated, and both are the owning reference for a field the PR adds.

  1. helios/manifest.md:29-53 documents the Python graphs[] dictionary field by field (name, kind, sampling_mode, handle, batch_capacity, token_capacity, draft_tokens, packed_token_capacity, prefill_capacity, confidence_width, estimated_duration_ns, input_bindings, tuned_bindings). ignition/preparation/execution.py:316-319 now emits draft_source on every graph with an explicit draft_tokens, and heliopause/src/python.rs:225-233 reads it; the field is absent from the manifest reference. AGENTS.md:52-60 requires designed behavior to be stated as a specification, and this file is the specification of that dictionary.

  2. docs/mtp-design.md:22-40 still describes copy proposals as only the shared 65,536-token ring with eight- and four-token indexes returning up to seven continuations ("It requires speculative graphs that declare copy-token inputs ... Both settings use the same captured MTP graphs and buffers", lines 22-29; "each loaded model retains the most recent 65,536 committed generated tokens", lines 31-34). After this PR the primary path is the per-request prompt+output suffix automaton (helios/src/scheduler.rs:1099-1159), with a 131,072-token trailing prompt window, a 131,072-token output cap, a 512-token boundary overlap and a six-token minimum match (helios/src/scheduler/sam.rs:22-32), and the ring is only the fallback taken when its match is strictly longer (scheduler.rs:1144-1148). --history-drafts also now changes the retained graph set (helios/src/runtime_core/selection.rs:277-298,382-396), contradicting "Both settings use the same captured MTP graphs and buffers". docs/cli-design.md:741 says only "Augment learned drafts with shared decoded-history continuations".

Rule: .agents/skills/repo-prose/SKILL.md:26-29 — "Documentation is a present-state specification, not a changelog. Replace stale claims instead of layering history on top."

  1. docs/scheduling-runtime-design.md:6-12 enumerates the modules in helios/src/scheduler/ that implement the design (policy.rs, utility.rs, service.rs, cost.rs, refresh.rs, learning.rs, rounds.rs, speculation.rs) and omits the new sam.rs, which implements the copy-proposal mechanism the same document specifies at lines 39-41. A reader following the document's own pointer cannot reach the implementation.

Fix: add draft_source to helios/manifest.md:29-53 with its NO_DRAFT/MTP/COPY_DRAFT values and default; rewrite docs/mtp-design.md:22-41 to specify the per-request automaton first and the shared ring as the fallback (caps, six-token minimum, and that --history-drafts retains copy-only graphs); update docs/cli-design.md:741; add sam.rs to the docs/scheduling-runtime-design.md:6-12 list.

#9 [high] Remaining findings: dominance rule twice, expected-value pricing, SAM API surface, constants, oracle, refresh_order

Smaller findings, all verified in the code at head 14019718.

  1. Should fix (moderate) — the new padded-batch dominance rule exists twice in one function. helios/src/scheduler/policy.rs:143-165 adds a pairwise rule inside dominates_padding_with ("strictly narrower same-capacity same-depth GPU-allocated ragged batch whose packed_token_capacity >= min(lane_ceiling_sum, larger.packed_token_capacity) dominates"), and policy.rs:225-254 re-derives the same rule as a scan inside prune_padding over dominated[index]/other.batch. The two express one invariant in two code shapes with slightly different bounds: the pair version compares smaller.packed_token_capacity >= needed where needed = long.sum().min(larger.packed_token_capacity), while the scan uses other.packed_token_capacity >= length(index).sum().min(candidate.packed_token_capacity) and additionally requires other.batch >= lanes (the active-cohort guard, which the pair version gets implicitly from the shared mask check at line 134). Fix: have prune_padding rely on the pairwise rule only (with the other.batch >= lanes condition folded into dominates_padding_with), which is the pattern the pre-existing loop at policy.rs:215-220 already uses ("for each peer, ask dominates_padding_with"). That removes 30 lines and one place for the two thresholds to drift.

  2. Nit — the zero-duration expected value for a candidate is computed in four places: policy.rs:1083-1096 (ordinary candidate), policy.rs:1263-1295 (refresh_expected), rounds.rs:725-726 (fixed_round_candidate), rounds.rs:879-885 and rounds.rs:1048-1054 (copy and ordinary packed cohorts). Each spells out "sum values[slot].decode(expected_tokens, 0.0) over the mask". A single helper fn expected_value(&self, mask, tokens_per_slot: impl Fn(usize) -> f64, values) -> f64 would state the "expected value is priced at zero duration for refresh ranking" invariant once; today it is restated with a different closure shape five times, and policy.rs:1083-1096 already has to special-case duration_ns == 0 || kind.is_prefill() to avoid double counting.

  3. Nit — helios/src/scheduler/sam.rs:1070 (propose_for_context), sam.rs:1118 (propose_conditional_continuations), MatchSource/MatchProposal::source, PromptSAM::build, PromptOutputSAM::push_slice and the accessors prompt_sam/config/prompt_len/output_len/total_len/state_count/memory_bytes/dynamic_memory_bytes/state_count/transition_count have no caller outside the test module (production uses only PromptOutputSAM::new, push_token, propose, and sam() in tests; verified with search_code over the whole repository). docs/mtp-design.md and the module doc name a "2-deep pipelined execution" (sam.rs:1117) that exists nowhere. AGENTS.md:188-193 rejects "speculative compatibility, fallback layers, or configuration switches without a concrete requirement" and "extension points"; that applies to an unconsumed public API surface. Either the consumer lands in this PR or the surface should be private.

  4. Nit — helios/src/scheduler/speculation.rs:14-21 introduces five new unexplained constants (WIDE_COPY_PRIOR_RATE = 0.88, COPY_STEP_PRIOR_WEIGHT = 4.0, COPY_DEPTH_SHRINK_WEIGHT = 2.0) and rounds.rs:766 adds a bare base_mtp_drafts.saturating_add(3), plus sam.rs:22 DEFAULT_MIN_MATCH_LEN = 6 duplicates WIDE_COPY_MIN_MATCH_LEN = 6 (speculation.rs:18), both required by rounds.rs:776. The charter requires "Be explicit and pin everything. No magic defaults" and AGENTS.md:452-456 requires a setting to have one home; a constant with no derivation and no doc line does not satisfy either. The two 6s should be one constant (the SAM default also governs the plain --history-drafts packing path via packing.rs:395-407 → request_history_proposal → SamConfig::default()).

  5. Nit — the test-only brute_force_oracle (sam.rs:1236-1273) returns the production MatchProposal and re-derives build_proposal's source selection and token slicing (sam.rs:1191-1227), so the randomized 120-trial comparison at sam.rs:1402+ is not independent of the code it checks. Precedent for the opposite: the oracle helper in helios/src/scheduler/decoded_history.rs:228-252 returns the same plain (Vec<i64>, usize) the production lookup returns, so the comparison is of values, not of a shared struct.

  6. Nit — helios/src/scheduler/cost.rs:287-296: refresh_order changed to return (bool, u64) and now carries no comment. The meaning of the tuple ((true, attempt_ns) = "attempted while stale without a valid observation"; (false, 0) otherwise) exists only in docs/scheduling-runtime-design.md:435-441. Its neighbours in the same file state their invariant in one line (cost.rs:40-41, 110-113, 282-285), and repo-prose SKILL.md:38-39 asks comments to explain invariants.

  7. Conforming, checked: SPDX header and second copyright line in sam.rs:1-5 match speculation.rs:1-5; the wide_copy_curve/expected_copy_tokens wrapper structure mirrors powered_curve/expected_speculative_tokens (rounds.rs:528-557); the per-shape curve cache in the wide-copy block (rounds.rs:747-748, 794-795) follows the existing "Lane forecasts stay fixed while shapes compete" cache comment (rounds.rs:746); docs/scheduling-runtime-design.md:430-495 was correctly updated for the readiness-wait exclusion, retained idle credit and the two-tier refresh ordering.

#10 [high] Report of 2026-11-26, run 2 — conventions and duplication

Review — PR #540, lens: conventions and duplication

Verdict: should-fix issues; nothing blocking from this lens

Findings, in the order they should be addressed. Every one was checked in the code at head 14019718.

Should fix

  1. draft_source is not part of prepared-shape identity (entry #5). GraphDescriptor::draft_source (execution/manifest.rs:191-192) is a new discriminant, but catalog::select_shape_with_drafts (model/catalog.rs:279-293) and cost::Key (scheduler/cost.rs:50-58, with the duplicate rejection in ActionCosts::prepared at cost.rs:159-161) both omit it, and both fail hard on a duplicate shape ("ambiguous prepared model graph capacity" / "prepared graphs require unique shapes"). So an MTP and a copy graph at the same B/D/W/P cannot coexist, even though runtime_core/selection.rs:250-251 already treats draft_source as part of the serving-variant identity and the new checks at catalog.rs:94-131 and manifest.rs:845-846 contemplate copy-only graphs. Fix: add draft_source to Key/Key::from_step and to the select_shape_with_drafts filter; then Estimate.draft_source, PackedRoundShape::draft_source and is_copy_only_step's table probe (cost.rs:223-232) can go.

  2. The wide copy-only cohort loop duplicates the ordinary packed-round loop (entry #6). rounds.rs:791-902 repeats rounds.rs:925-1060 step for step — scores from curve * output_token, rank_prefixes, ranks_by_slot/slots_by_rank, the three orderings with select_nth_unstable_by/truncate/sort_unstable_by, the frontier trim against draft_budget, lane_terms, and the identical best-mask tie-break. Only the curve source differs. Precedent in the same function: rank_prefixes, fixed_round_candidate, host_prefix_ranking, and wide_copy_curve wrapping powered_curve are all factored that way. The copy branch also silently omits the ordinary branch's surplus_table factor (1031-1037), so the two copies already differ.

  3. Four hand-written draft_source wire ladders, one canonical parser (entry #7). serving.rs:58-63, python.rs:225-233, selection.rs:144-148 and model.rs:1095-1102 each spell the integer mapping; server/config.rs:188-194 uses ProposalSource::parse (speculation.rs:30-38). GraphKind, Dtype, SamplingMode and the contract enums all keep one TryFrom next to the type (manifest.rs:50-68,109-121,123-145; contract.rs:23), and the generated wire::DraftSource already exists (proto/runtime_core.proto:854). Add ProposalSource::from_wire/as_str and call it; the copies currently disagree on whether an unknown value is an error.

  4. Docs that own the changed field were not updated (entry #8). helios/manifest.md:29-53 omits draft_source, although ignition/preparation/execution.py:316-319 now emits it and heliopause/src/python.rs:225-233 reads it. docs/mtp-design.md:22-40 still describes copy proposals as only the 65,536-token shared ring ("Both settings use the same captured MTP graphs and buffers") when the primary path is the per-request SAM (scheduler.rs:1099-1159; sam.rs:22-32) and --history-drafts now also changes the retained graph set (selection.rs:277-298,382-396); docs/cli-design.md:741 likewise. docs/scheduling-runtime-design.md:6-12 omits sam.rs from the module index of the document that specifies copy proposals. Cite repo-prose SKILL.md:26-29 and AGENTS.md:52-60.

  5. The new padded-batch dominance rule is written twice in one function (entry #9, item 1). policy.rs:143-165 (pairwise, in dominates_padding_with) and policy.rs:225-254 (scan, in prune_padding) encode the same invariant with different threshold expressions and only the scan carries the other.batch >= lanes guard. Fold the guard into the pairwise rule and let the existing peer loop (policy.rs:215-220) be the only caller.

Nits

Checked and conforming

SPDX/second copyright line in sam.rs matches speculation.rs; the wide_copy_curve/expected_copy_tokens wrapper mirrors powered_curve/expected_speculative_tokens; the per-shape curve cache follows the existing lane-forecast cache comment; docs/scheduling-runtime-design.md:430-495 was updated correctly for readiness-wait exclusion, retained idle credit, and the two-tier refresh ordering; the draft_source Protobuf field defaults to MTP, preserving existing cores (AGENTS.md:437-440).

#11 [high] Research summary

Reviewed PR #540 through the conventions-and-duplication lens; all changed files were read in context and every finding verified at head 14019718. Full report is scratchpad entry #10, with supporting detail in entries #5–#9.

Verdict: should-fix issues, nothing blocking.

Should fix:

  1. draft_source (new GraphDescriptor field) is missing from both prepared-shape identities — catalog::select_shape_with_drafts (model/catalog.rs:279-293) and cost::Key (cost.rs:50-58, duplicate rejection at 159-161) — so an MTP and a copy graph at the same B/D/W/P fail to load, while runtime_core/selection.rs:250-251 already treats the field as part of the variant identity.
  2. The new wide copy-only cohort loop (rounds.rs:791-902) duplicates the ordinary packed-round loop (rounds.rs:925-1060) step for step, differing only in the curve source, and already lacks the ordinary block's surplus_table factor.
  3. Four hand-written draft_source integer ladders (serving.rs:58-63, python.rs:225-233, selection.rs:144-148, model.rs:1095-1102) where the repository keeps one TryFrom per enum and ProposalSource::parse already exists.
  4. helios/manifest.md:29-53 omits draft_source; docs/mtp-design.md:22-40 and docs/cli-design.md:741 still describe copy drafting as only the shared ring; docs/scheduling-runtime-design.md:6-12 omits sam.rs.
  5. The new padded-batch dominance invariant is encoded twice in policy.rs (143-165 pairwise, 225-254 as a scan), with only the scan carrying the active-cohort guard.

Nits: five-way repeated zero-duration expected-value pricing, unconsumed pub SAM API, five unexplained constants (plus the duplicated 6), a test oracle that shares production shapes, and refresh_order's undocumented (bool, u64). Conforming items (SPDX header, curve-wrapper structure, forecast caching, and the correctly updated refresh prose in docs/scheduling-runtime-design.md) are listed in the report.

#12 [high] Coverage, non-findings and open items for the #540 conventions review

Supplementary note for the final report on PR #540 (head 14019718). Complements entry #10 (the report) and #5–#9 (per-finding evidence).

Files read in context (all 25 changed files, at least around every hunk)

Deliberately not flagged (checked, conforming)

Only a test settles these two

  1. Whether catalog::select_shape_with_drafts/ActionCosts::prepared really reject an MTP + copy pair at identical B/D/W/P: reading the filters says yes (no draft_source term, explicit duplicate errors), but the new test at helios/src/model/tests.rs:1861-2075 uses distinct geometries and therefore does not exercise it. One graph pair plus Inputs::new would confirm.
  2. Whether LiveRequest.copy_calibration can ever be None where wide_copy_curve runs: admission sets sam and copy_calibration from the same decoded_history.is_some() predicate (scheduler.rs:1849-1856) and enable_history_drafts refuses after any admission (scheduler.rs:1086-1092), so the else arm looks dead. A test constructing sam: Some with copy_calibration: None would settle whether the invariant should be enforced structurally (one Option<PerRequestCopyState> holding both).

Scope note

The PR bundles four commits (cost-refresh recovery, prompt+output SAM, calibrated wide copy-verify, padding dominance). Findings are attributed per file; entries #5/#6 cover commits 3 and the rounds cost, entries #7/#8 cover the wire/doc surface across commits 2 and 3, entry #9 covers commit 4 (policy.rs dominance) plus nits. Live GPU evidence in the description was not re-verified — no hardware in this review.

#7 [medium] Should fix: four hand-written draft_source wire ladders, one canonical parser

The PR adds a fourth hand-written integer ladder for ProposalSource, while the same file family already has the canonical one.

Duplicated ladders:

Precedent: every other closed enum in this layer has one TryFrom<&str>/TryFrom<i32> impl next to the enum and callers use it — GraphKind::try_from (execution/manifest.rs:123-145), Dtype::try_from (manifest.rs:50-68), SamplingMode::try_from (manifest.rs:109-121), and the declare_conversion! macro generating TryFrom<i32> for contract enums (model/contract.rs:23). The wire enum itself is declared once, DraftSource { NO_DRAFT = 0; MTP = 1; COPY_DRAFT = 2; } (helios/proto/runtime_core.proto:854), and the generated wire::DraftSource already has try_from(i32) and as_str_name(), which runtime_core/describe.rs:534,778 use.

Fix: add impl ProposalSource { pub fn from_wire(i32) -> Result<Option<Self>> } (or TryFrom<wire::DraftSource>) plus as_str() beside the existing parse, and have serving.rs, python.rs, selection.rs and model.rs call it. That also keeps the "unknown draft source is an error" rule in one place, which matters because the four copies disagree today: python.rs and serving.rs reject unknown values, selection.rs/model.rs only know the config strings.

Severity: should fix (small, mechanical, and the divergence is already visible).