Skip to content

fix(pm-stack): render arrival predictions with the shared C4 formatter (#13408) - #13530

Merged
dezren39 merged 1 commit into
mainfrom
lane-au5-13408
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-au5-13408

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

Unifies the C4.4 arrival kind's stored rendered strings on the one shared §4 formatter, per #13408 (filed from the #13357 landing):

  • quota-arrival.ts deletes its own renderPredictionRange (ms-number signature; duration + day forms only — its header admitted the calendar form was "not yet") and calls renderPredictionRange from quota-downtime.ts at both bases (detector_history, vendor_cadence), adapting the call sites from ms numbers to ISO strings.
  • ARRIVAL_METHODOLOGY_VERSION bumps c4-meth:1 → c4-meth:2, with the §6 entry appended to c4-methodology-log.jsonl — the issue prescribes a version bump + log entry, not a silent edit. Record instants, bases, and scoring are unchanged.
  • quota-arrival.test.ts pins the shared forms for arrival-shaped ranges: duration form (same-day future range), calendar form (multi-day range crossing Chicago day boundaries; sub-48h range crossing midnight), and the detector-history record whose earliest bound precedes issuance now renders "between Wednesday evening and this evening" instead of a relative-day string.

One note on the issue's example: it sketched the 2.5–5.7 day range becoming "2.5 to 5.7 days"; the shared formatter as landed by #13357 renders cross-day ranges in calendar form ("between Saturday morning and Tuesday morning"), which is what the tests now pin — the kinds agree, which is the point of the unification.

Verification (laptop worktree off main a94634c68fd)

  • bun test on quota-arrival, quota-downtime, quota-reset-duration, quota-forecast-alerts, quota-forecast, quota-forecast-accuracy, quota-weekly-review: 98 pass / 0 fail
  • bun x tsc --noEmit in pm-stack/aggregator: clean

Closes #13408


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

#13408)

quota-arrival.ts carried its own renderPredictionRange (ms-number
signature, duration and day forms only — its header admitted the
calendar form was "not yet"), diverging from the one §4 formatter
the design names and the other C4 kinds already use.

- buildArrivalRecords now calls renderPredictionRange from
  quota-downtime.ts (ISO-string signature) at both bases; the local
  copy and its private helpers are deleted.
- ARRIVAL_METHODOLOGY_VERSION bumps c4-meth:1 -> c4-meth:2 with the
  §6 entry appended to c4-methodology-log.jsonl, per the issue's
  prescription (methodology-visible change, never a silent edit).
  earliest/latest/likely instants, bases, and scoring are unchanged.
- Arrival tests pin the shared forms: duration form for a same-day
  future range, calendar form for ranges crossing Chicago day
  boundaries (including the detector-history record whose earliest
  bound precedes issuance — previously rendered as a relative-day
  string).

Verification (laptop worktree): bun test on the C4 files
(quota-arrival, quota-downtime, quota-reset-duration,
quota-forecast-alerts, quota-forecast, quota-forecast-accuracy,
quota-weekly-review) — 98 pass / 0 fail; bun x tsc --noEmit clean.

Closes #13408
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 6fd7891c-9361-4415-9db7-50d49ac3ef59
Commits

Reviewing files that changed from the base of the PR and between c664a2f and 2ad02ec.

Files selected for processing: 3

  • pm-stack/aggregator/c4-methodology-log.jsonl
  • pm-stack/aggregator/src/quota-arrival.test.ts
  • pm-stack/aggregator/src/quota-arrival.ts
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:48:26.904316Z 2ad02ec PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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: quota-arrival.ts has its own renderPredictionRange without the §4 compound/calendar forms

1 participant