Skip to content

R9

What to build

Small serialized reports cannot trigger billions of bootstrap score visits.

Source and evidence

Repository scientific/architectural review, snapshot 86c8517, item R9. Classification: confirmed defect; medium severity.

Per-field ceilings do not impose a joint resampling work budget. A legal plan with 100 trials, 256 Measurements, and 100,000 bootstrap resamples requests 2.56 billion score draws in report validation alone. Each replicate also validates and sorts its scores for the median. Evaluation first computes those intervals and then the report constructor recomputes them, repeating this work. The 16 MiB input byte cap does not meaningfully bound this amplification.

Experiment: construct constant-score trial/summary evidence at those accepted ceilings; temporarily replace the report module's bootstrap function with a counting function returning the correct constant interval. Construction accepted 256 calls with total len(scores) * samples == 2,560,000,000; serialized size was 892,841 bytes. Restore the function in finally. This measures requested work at the real validation seam, not actual execution of billions of draws.

A separate real bounded call (100 scores, 1,000 resamples, seed 1) took 0.019124 seconds locally. This single observation is characterization only; no production capacity estimate or large-workload runtime extrapolation follows from it.

Acceptance criteria

  • [ ] The 100-trial/256-measurement/100000-resample cross product is rejected before bootstrap calls exceed a fixed documented aggregate budget.
  • [ ] Budgets account for overall and slice intervals, retained estimates and validation recomputation.
  • [ ] Valid below-budget reports and evaluation plans retain deterministic intervals and imported-summary verification.
  • [ ] Tests count requested operations and check exact boundary acceptance/rejection without executing billions of draws.
  • [ ] Preserve Consumer-owned meaning, payload-free evidence, disabled optional-import isolation, safe diagnostics and the non-relaxable Safety Floor.
  • [ ] Run the narrowest observable contract, then applicable committed Make gates. Record every command and outcome; update specifications/compatibility evidence for changed public or wire contracts. Run native Collector verification for changed Collector assets and build for packaging changes.

Design guidance

Use a shared work-accounting value/policy analogous to paired resampling. Preflight before effects or expensive computation. Any trusted assembly path must preserve the same publication invariants and must not admit unvalidated imported summaries.

Keep prefactoring narrow and verifiable in this slice. Reuse established owners and structural interfaces; introduce a pattern only when it clarifies a real responsibility or variation point. Do not add consumer vocabulary or private payloads to platform code or evidence. Mocked/local results must not claim hosted, production, accelerator or release qualification.

Blocked by

None (can start immediately). Shared-area coordination is useful, but no other review fix is a genuine prerequisite for this slice.

Verification scope

Convert the described counterexample or investigation oracle into an observable test at the lowest suitable public boundary. Prefer bounded operation-count or deterministic interleaving evidence to flaky timing assertions; timing guarantees need a declared tolerance and independently owned cleanup. This ticket authorizes remediation/research, not publication or deployment.