Skip to content

aggregator(forecast): resampling estimator for epic ETA (design §1) — zero-median bursty buckets return no_measurable_pace #5274

Open

Description

@dezren39

aggregator(forecast): resampling estimator for epic ETA (design §1) — zero-median bursty buckets return no_measurable_pace

Found by Codex review round 4 on PR #5236 (finding comment 4463375210), dispositioned there as a follow-up because it is an estimator redesign, not a defect fix in that PR's scope.

Problem. deriveEpicEta in pm-stack/aggregator/src/forecast.ts derives P50/P80 from the median / lower-quartile weekly pace. When the four complete primary weeks are [0, 0, 0, 4] closures and work remains, the local evidence floor passes (4 completions, 4 weeks) but the median weekly bucket is zero, so the result is no_measurable_pace with no dates despite positive measured throughput. Batch-delivery scopes (sufficient evidence, bursty weeks) get no forecast.

Contract. The forecasting design (doc/2026-11-01T21-07-00Z_design_pm-stack_forecasting/2026-11-01T21-07-00Z_design_pm-stack_forecasting.md §1, line 36) specifies: "Estimator: resample complete weekly completion buckets (including observed zero weeks) to estimate a distribution for remaining units / weekly throughput. Publish P50 and a conservative P80 completion range… If no weekly pace is measured, emit 'no measurable pace'". The current median/lower-quartile implementation is a simplification that does not implement the resampling estimator.

Acceptance criteria.

  • Deterministic (seeded) resampling over the complete weekly completion buckets, zero weeks included, estimating the distribution of weeks-to-complete for the remaining units; P50 and conservative P80 derived from that distribution.
  • [0, 0, 0, 4] with remaining work returns a forecast with finite P50 <= P80 instead of no_measurable_pace.
  • A truly zero total pace (all buckets zero) still returns no_measurable_pace with no dates.
  • Pinned tests updated with rationale where behavior changes (notably "zero lower-quartile pace: P50 present, P80 explicitly unmeasurable" in pm-stack/aggregator/test/forecast-3982.test.ts); new tests cover the bursty case and determinism (same input → same output).
  • Decide and record whether the estimator change bumps FORECAST_MODEL_VERSION (forecast/v1).
  • Full aggregator suite green (bun test in pm-stack/aggregator).

Links: PR #5236 · issue #3982 · queue task 8962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions