Skip to content

feat(quota): feed the C4 prediction log into the forecast backtest - #16847

Merged
dezren39 merged 1 commit into
mainfrom
felix/13258-backtest-predictions
Nov 29, 2026
Merged

dezren39 merged 1 commit into
mainfrom
felix/13258-backtest-predictions

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Part of epic #13256 (C4 quota forecasting), slice #13258 (C4.2).

What was actually missing

Criterion 3's scorer has been in production since #15824, and scoreable prediction/outcome pairs have existed since 2026-11-28 — but no production path ever fed predictions to the scorer: quota-forecast-backtest.ts (the script that publishes the accuracy ledger) and quota-weekly-review.ts both call buildForecastAccuracyLedger without resetDurationPredictions, so the ledger's C4.2 section permanently read "unmeasured". Verified live 2026-11-29: feeding the live prediction log to the merged scorer yields 15 scored facts.

Change

scripts/quota-forecast-backtest.ts gains a strict --predictions <jsonl> option (argument contract #3352: declared, parsed before any file I/O, usage error exit 2). It loads the prediction log's reset_duration records and passes them to the ledger builder. Loader honesty: other kinds are skipped (not this scorer's input), malformed reset_duration records are counted and named on stderr, and a non-JSON line fails the run loudly (corrupt log). Without the option, behavior is byte-for-byte the old behavior.

Verification

  • New oracle test in test/quota-forecast-backtest-argv.test.ts: fixture store whose resetsAt transition (bracketed by readings at 01:00/02:00) realizes at the 01:30 midpoint; the predicted range [01:00, 02:00] must score covered with width exactly 3,600,000 ms, the no_basis record stays unscored, a malformed record is reported skipped, and a bare run stays unmeasured.
  • Live publication run (this branch's script against the live laptop store, 22,163 records + 3,778 reset_duration records): 15 scored reset-duration predictions. The published accuracy record (forecast-accuracy-ledger.json + forecast-accuracy-report.md beside the store) now carries the C4.2 baseline: _openai.alt / 5h / reset_cadence / c4-meth:4 — 15 scored / 10 unscored, coverage 100.0% (target ~80%), mean width 3683.6m. Full evidence on C4.2 — Reset-duration predictions as ranges in Drew's formats #13258.

Issue disposition

With this merged, #13258's three acceptance criteria are all met (criteria 1–2 landed via #13352, #14487, #15824; criterion 3's first scored outcomes are published — evidence on the issue), so this PR carries the closing keyword deliberately: merging closes #13258.

Closes #13258

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T15:55:34Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…13258)

The backtest script published the accuracy ledger without ever
passing resetDurationPredictions, so the C4.2 reset-duration
section was permanently unmeasured even though the scorer and
15 scoreable live predictions exist. Add a strict --predictions
option (#3352 contract) that loads the prediction log's
reset_duration records (malformed ones counted on stderr, corrupt
JSON fails loudly) and feeds them to buildForecastAccuracyLedger.

Oracle: the argv test's fixture outcome — a resetsAt transition
bracketed by readings at 01:00/02:00 realizes at the 01:30
midpoint; the predicted range [01:00, 02:00] covers it, width 1h.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5ab78487-8238-410b-bd77-5ef618a3209e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39

Copy link
Copy Markdown
Member

Lane 0952-C (bravo SUSTAIN LANDINGS) — merging after firsthand verification. Full diff read: adds --predictions to quota-forecast-backtest.ts — strict #3352 arg contract extended, C4 reset_duration records loaded explicitly (other kinds skipped, malformed reset_duration records counted and named on stderr, non-JSON line fails loudly), fed to buildForecastAccuracyLedger's existing resetDurationPredictions option. Verified on head dc57946 that quota-forecast-accuracy.ts already exports ResetDurationPredictionInput and the resetDuration ledger section (the scorer landed earlier; this PR is the feeder). New argv test names its oracle (production scorer over a known fixture: realized 01:30 midpoint, [01:00,02:00] covers, width 1h) and asserts the no-flag path stays unmeasured. Fresh reads at unchanged head dc57946: GraphQL MERGEABLE/CLEAN + REST mergeable=true/clean agree. CI is not a gate per Drew 2026-11-29; merging on the diff read. Key: 0952-C

@dezren39
dezren39 merged commit 16bbeca into main Nov 29, 2026
2 checks passed
@dezren39
dezren39 deleted the felix/13258-backtest-predictions branch November 29, 2026 16:14
@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Verification (fleet-command run 46280917243, this branch): 3 pass / 0 fail in test/quota-forecast-backtest-argv.test.ts (30 expect() calls), including the new #13258 oracle test. Package typecheck could not run: tsconfig.json(6,5): error TS5102: Option 'baseUrl' has been removed — the pre-existing TS7 config defect tracked as #16835 (claimed by another lane); tsc exits at config load before checking any file, so it neither passes nor implicates this change. — Felix lane 0640-AJ

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C4.2 — Reset-duration predictions as ranges in Drew's formats

1 participant