GeezerVison is showing github.com — aggregator(forecast): capped resampling trials are recorded as completions, publishing optimistic P50/P80 dates · Issue #6386 · developing-today/code
aggregator(forecast): capped resampling trials are recorded as completions, publishing optimistic P50/P80 dates #6386DescriptionFinding (from PR review)
Codex (chatgpt-codex-connector[bot]) raised this finding in its review of merged PR #6169 and it was never fixed or responded to:
- PR: aggregator(forecast): design §1 resampling estimator in deriveEpicEta (#5274) #6169 — "aggregator(forecast): design §1 resampling estimator in deriveEpicEta (aggregator(forecast): resampling estimator for epic ETA (design §1) — zero-median bursty buckets return no_measurable_pace #5274)" (MERGED 2026-11-05T09:08:34Z, merge commit f2a72d9, head 2c2a5e9)
- Comment: aggregator(forecast): design §1 resampling estimator in deriveEpicEta (#5274) #6169 (comment) (chatgpt-codex-connector[bot], 2026-11-05T09:10:10Z, P2, anchored at
pm-stack/aggregator/src/forecast.ts:152)
- Essence: "Keep unfinished trials out of completion-time quantiles. When remaining work cannot finish within the 100,000-week cap, this records unfinished trials as actual completions, making the forecast optimistic rather than conservative. For example, buckets
[1, 1, 1, 1] with 100,001 remaining units yield P50 and P80 at 100,000 weeks even though completion takes exactly 100,001 weeks. Preserve capped trials as censored observations and return an unavailable date with a limitation when the requested percentile exceeds the simulation horizon, rather than publishing a completion date before the work finishes."
No-response evidence
- The comment's review thread is unresolved (GraphQL
reviewThreads: isResolved=false) and contains only the single Codex comment — no replies (in_reply_to_id empty, no later inline comments in the thread).
- The review was submitted at 2026-11-05T09:10:10Z on the merged head 2c2a5e9, after the PR merged at 2026-11-05T09:08:34Z, so no fix commit followed it in the PR; the code on current main is unchanged in the relevant respect (below).
Still live on current main (verified 2026-11-05 by independent gh api raw reads)
pm-stack/aggregator/src/forecast.ts:125-130 (current main): RESAMPLE_MAX_WEEKS = 100_000, with a comment claiming "A capped trial reads as that many weeks, which is conservative for both percentiles" — for a trial whose true completion exceeds the cap, recording the cap value is the opposite: it pulls the percentile earlier than the true completion.
pm-stack/aggregator/src/forecast.ts:145-153: resampledWeeksToComplete pushes weeks unconditionally after the capped loop (samples.push(weeks)), so an unfinished trial (completed < remainingUnits) is indistinguishable from a trial that finished exactly at the cap.
pm-stack/aggregator/src/forecast.ts:420-425: the caller unconditionally converts the P50/P80 percentiles of those samples into ETA dates; there is no censored/unavailable path when a percentile falls beyond the simulation horizon.
- Repro by inspection from the reviewer's example: buckets
[1,1,1,1], remaining 100,001 units — every trial caps at 100,000 weeks with 100,000 of 100,001 units done, yet both percentiles return a date at 100,000 weeks, one week before the work can finish (and arbitrarily early for larger remaining counts).
- Dedupe: open and closed issues searched by "forecast percentile capped trial", "6169 forecast", "forecast.ts resampling", and the finding title — no issue covers censored/capped trials; the hits are the closed parent design issue aggregator(forecast): resampling estimator for epic ETA (design §1) — zero-median bursty buckets return no_measurable_pace #5274 and the closed epic-ETA issue aggregator: derive epic ETA bands and explainable stall risk #3982, neither of which names this defect.
Acceptance criteria
- Capped (unfinished) trials are preserved as censored observations, not recorded as completions at the cap; when a requested percentile exceeds the simulation horizon, the forecast returns an unavailable date with a stated limitation instead of a completion date before the work finishes.
- A regression test covers the reviewer's example shape (uniform buckets with remaining units beyond the cap) asserting no P50/P80 date earlier than true completion is published.
- Or: the finding is resolved on this issue by a documented decision with reasoning recorded.
Activitydeveloping-today commented on Nov 5, 2026 dezren39 commented on Nov 5, 2026 dezren39 commented on Nov 5, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 6, 2026 dezren39 commented on Nov 7, 2026
Picked up by repo-worker-code-i — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-i posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on Nov 7, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane code-i
- Session / ID: repo-queue-worker-shift-i, 2026-11-06 20:28 CST — FALLBACK MODE (queue backend down:
fleet queue health failed 3×, HTTP 503 PGRST002, exit 4; outage tracked as issue infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619). Fallback claim on issue aggregator(forecast): capped resampling trials are recorded as completions, publishing optimistic P50/P80 dates #6386; no broker task id exists in fallback mode. (The earlier broker task for this issue, task 10793, was handed off to the opencode claimant by many lanes on 2026-11-05/06 and never worked; fallback mode skips the §1b lane assignment, so this lane works it directly.)
- Found via: fallback scan (claimable, marker state free) — claim marker posted this shift
- Task: Triage → verify the Codex P2 finding from PR aggregator(forecast): design §1 resampling estimator in deriveEpicEta (#5274) #6169 against current main, reproduce it, and fix it if verified: capped resampling trials in
pm-stack/aggregator/src/forecast.ts are recorded as completions, publishing optimistic P50/P80 dates.
- Expectation: effort s — censored-trial fix + regression test, branch + PR, merge under the standing criteria if verified; otherwise a documented decision on this issue.
- Links: branch
queue/fallback-6386-censored-trials, laptop worktree ~/git/fleet/fb-6386
dezren39 commented on Nov 7, 2026
Progress from repo-worker-code-i: verified: forecast.ts on current main still pushes capped trials as completions (resampledWeeksToComplete, RESAMPLE_MAX_WEEKS=100_000); branch queue/fallback-6386-censored-trials + laptop worktree created; next: reproduce the reviewer example, then implement censored trials dezren39 commented on Nov 7, 2026
Progress from repo-worker-code-i: pr_opened: PR #6701 (branch queue/fallback-6386-censored-trials, commit ca8b06d rebased on main bc96489); targeted tests 33/33 pass on laptop, tsc clean, full-suite failures pre-existing on clean main; next: check PR CI + Codex findings, then merge under standing criteria dezren39 commented on Nov 7, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane code-i
- Session / ID: repo-queue-worker-shift-i, 2026-11-06 20:28 CST — FALLBACK MODE (queue backend down, issue infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619); fallback claim on issue aggregator(forecast): capped resampling trials are recorded as completions, publishing optimistic P50/P80 dates #6386
- Found via: fallback scan (claimable, marker state free)
- Task: Verify the Codex P2 finding from PR aggregator(forecast): design §1 resampling estimator in deriveEpicEta (#5274) #6169 against current main, reproduce it, and fix it.
- Outcome:
fixed_merged — PR aggregator(forecast): capped resampling trials are censored, not completions (#6386) #6701 merged (merge commit 4007b41); this issue auto-closed by the merge.
- Verified live on main:
resampledWeeksToComplete pushed capped trials as completions at the 100,000-week cap (pm-stack/aggregator/src/forecast.ts), with a comment calling that "conservative".
- Reproduced before the fix with the reviewer's exact example (buckets [1, 1, 1, 1], 100,001 remaining): P50 = P80 published at 100,000 weeks — one week before the work can finish — confidence medium, no limitation.
- Fix: capped trials are censored observations (null, sorted last); a percentile whose rank falls on a censored sample returns no date plus a limitation naming the censored share; both percentiles censored → confidence
unavailable. An exact early-censoring check ends hopeless trials without changing outcomes (the example now derives in ~0.3s vs ~1.9s). FORECAST_MODEL_VERSION bumped forecast/v2 → forecast/v3 with the reason at the definition.
- Tests: two new regressions (the reviewer example verbatim with an exact-arithmetic oracle; a partially censored distribution — P50 dated inside the horizon, P80 censored — with the exact binomial CDF as oracle).
bun test test/forecast-3982.test.ts 33/33 pass on the laptop, bunx tsc --noEmit clean. Full aggregator suite 1526 pass / 15 fail, with the failures (source-gate boot timeouts, program registry issue docs(dashboard): build out the Repo fleet project section (/program/repo-fleet) #1126, hook timeouts) verified pre-existing on clean main via a stash run — unrelated to this change.
- Codex review on PR aggregator(forecast): capped resampling trials are censored, not completions (#6386) #6701: zero findings (has_any_findings=false). PR checks: scripts-test still QUEUED at merge time (runner backlog; those checks do not exercise this TypeScript change) — merged under the standing criteria on the laptop verification above.
- Links: PR aggregator(forecast): capped resampling trials are censored, not completions (#6386) #6701 aggregator(forecast): capped resampling trials are censored, not completions (#6386) #6701 · branch
queue/fallback-6386-censored-trials · original finding aggregator(forecast): design §1 resampling estimator in deriveEpicEta (#5274) #6169 (comment)
dezren39 commented on Nov 7, 2026
Released by repo-worker-code-i (outcome: done). Outcome: fixed_merged. PR #6701 merged (merge commit 4007b41); issue #6386 auto-closed. Capped resampling trials in pm-stack/aggregator/src/forecast.ts are now censored observations: a percentile beyond the simulation horizon returns no date with a limitation naming the censored share (both censored = confidence unavailable); FORECAST_MODEL_VERSION forecast/v3. Verified: reviewer example reproduced pre-fix (P50/P80 at 100000 weeks for 100001 weeks of work) and fixed post-change; bun test forecast-3982 33/33 pass, tsc clean, Codex zero findings on PR #6701. Agent note: #6386 (done note posted this release).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|