You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C4 design section 4: compound range form unimplemented and day form unreachable in the shared formatter #13357
"mixed spans render compound: "2 days 4 hours to up to 3 days 16 hours"" — no landed code produces this form. renderPredictionRange in pm-stack/aggregator/src/quota-downtime.ts (the formatter C4.1 shipped and C4.2 now reuses) implements only the duration form, the decimal day form, and the calendar form.
The day form ("2.5 to 3.7 days") is specified for "span ≥ 48h", but in the shipped formatter the cross-day calendar check runs before the span check, and any range ≥48h wide necessarily crosses a Chicago day boundary — so the day-form branch is unreachable as ordered. (It can only fire for a ≥48h-wide range whose bounds share a Chicago calendar day, which cannot exist.)
Question for the design owner (#9572): is §4's text or the shipped formatter the intended behaviour?
If the formatter is right, §4's compound example and the day-form condition should be corrected in the design record so future C4 kinds don't re-derive them.
If the design is right, the formatter needs a compound form and a check order that lets the day form fire — a methodology-visible change (records' stored rendered strings are what the scorer grades, design §1), so it should ride a methodology-log entry (§6), not a silent edit.
Neither blocks #13258: C4.2 reuses the one shared formatter per §4's "produced by one formatter" rule rather than forking a second interpretation.
Lane ZV picking this up for premise verification and options analysis.
Note: the issue is framed as a question for the design owner (#9572) — whether §4's text or the shipped formatter is the intended behaviour — and no decision is on record in this thread. Plan: verify the defect first-hand against the shipped formatter, post an options analysis with ramifications and a recommendation, and stand down for the owner's call rather than guess the intended behaviour.
Lane ZV — premise verification + options analysis (standing down for the owner's decision)
Premise verdict: TRUE, verified first-hand at current main
renderPredictionRange in pm-stack/aggregator/src/quota-downtime.ts (the C4.1 formatter, #13257) orders its checks:
earliest/latest on different Chicago calendar days → calendar form
span ≥ 48h → day form
earliest ≤ issued → calendar form
else → duration form
A Chicago calendar day is 23–25h long, so any two instants ≥48h apart necessarily carry different day keys — check 1 always fires first and the day-form branch at check 2 is unreachable, exactly as filed. Live demonstration against the shipped code (issued Mon 2026-11-23 06:00 CST):
earliest +48h, latest +96h (span 48h) → "between Wednesday morning and Friday morning" (calendar form — not §4's day form, not compound)
No branch in the formatter produces the compound form ("2 days 4 hours to up to 3 days 16 hours"). The existing tests pin only the calendar and duration forms.
Additional verified findings the decision should reckon with
There are two shipped formatters with this name, diverging in opposite directions.quota-arrival.ts (C4.4, C4.4 — New model / plan arrival predictions (watch-based, honesty-first) #13260, model/plan arrival records) exports its own renderPredictionRange (millisecond args): span check only, no calendar form at all — its day form does fire and is test-pinned ("between 2.5 and 5.7 days from now"). §4 says rendered is "produced by one formatter"; the shipped reality is two, and neither implements the compound form.
§4 contradicts itself, not just the code. The day-form bullet assigns span ≥ 48h to the day form, but the calendar-form bullet says the calendar form is "preferred for downtime windows and any range whose latest bound falls on a different day than its earliest" — which covers every ≥48h range. Both bullets cannot govern downtime windows at once; one must yield.
Even where the day form fires, its shape differs from §4's example. §4: "2.5 to 3.7 days". Arrival formatter: "between 2.5 and 5.7 days from now".
Adjacent, out of this issue's scope but worth the owner's eye: §4 specifies the formatter input as (earliest, latest, likely, issued_at); neither shipped formatter takes a likely bound.
Option A — the shipped downtime behaviour is intended; correct §4.
Rewrite the day-form bullet so it no longer promises a form downtime windows can't produce, drop or re-scope the compound example, and restate the "one formatter" sentence to match the two shipped implementations. Ramifications: docs-only; no methodology impact; stored records and scoring continuity untouched. Cost: the compound form dies as a design idea unless another kind adopts it; §4 keeps kind-dependent rendering implicitly rather than saying so.
Option B — §4 is intended; change the downtime formatter.
Implement the compound form and reorder the checks so the day form can fire for ≥48h downtime ranges. Ramifications: methodology-visible — the stored rendered strings are what the scorer grades (§1), so this must ride a §6 methodology-log entry with a new methodology_version, never a silent edit; every ≥48h downtime prediction changes reader-facing shape (calendar dayparts → decimal/compound days); scoring comparability across the change is the owner's call. Also forces the convergence question for the arrival formatter. Largest blast radius.
Option C — scope split (recommended).
Amend §4 to say what the code already does, explicitly: the calendar preference governs downtime windows; the day and compound forms govern kinds whose formatter takes the span path (arrival today). Then implement the compound form in the arrival formatter for mixed spans, where the day form already fires — with a §6 entry if the owner judges the arrival rendering change methodology-visible. Why: §4's own calendar bullet already states the downtime preference, so the shipped downtime behaviour reads as the design's intent, not an accident; the compound form is a genuine readability gain for multi-day arrival ranges; and the amendment ends the self-contradiction instead of leaving future C4 kinds to re-derive it. Cost: kind-dependent rendering becomes permanent and must be documented as such.
Whichever option is picked, §4's text needs editing — as written it is internally inconsistent, independent of the code.
Disposition
This is a genuine owner decision (the implementation shape differs materially per option, and Option B/C touch the scoring methodology), so Lane ZV is standing down without implementing and releases the item. #13357 should stay open until the owner records the choice here; the chosen option then becomes a fresh, unambiguous implementation slice. Nothing here blocks #13258 (already landed, PR #13352).
Decision (decide-and-proceed, FDR-0013): the design is right, the formatter was wrong. Verified fresh against origin/main c8f3a5cf8: the day-form branch in the shared formatter (pm-stack/aggregator/src/quota-downtime.ts, renderPredictionRange) was provably unreachable — the cross-day calendar check ran first and every ≥48h-wide range crosses a Chicago day boundary — and no code produced the §4 compound form. The fix implements the design as written: day form (span ≥ 48h, future ranges) checked before calendar form; compound (2 days 4 hours to up to 5 days 4 hours) when either bound is not an exact tenth of a day, plain decimal days otherwise; in-progress ranges stay calendar. Methodology bumped to c4-meth:2 with a §6 log entry, since stored rendered strings are what the scorer grades.
Flagged for the design owner: the design's example numbers illustrate the forms' shapes, not the threshold — "2.5 to 3.7 days" is 28.8h wide, under the 48h width rule, so under the shipped code's (and this issue's) width reading of "span" it renders calendar, not day form. If §4 meant an offset-based span, the design text needs that correction; the PR keeps the width reading both formatters already implement.
Next slice: unify the second formatter — quota-arrival.ts has its own renderPredictionRange (duration/day only, no calendar/compound); filed as #13408.
Activity
developing-today commentedon Nov 23, 2026
CODE-4867
test(pm-stack): failing-first tests for C4 day/compound range forms (#…
dezren39 commentedon Nov 23, 2026
Lane ZV picking this up for premise verification and options analysis.
Note: the issue is framed as a question for the design owner (#9572) — whether §4's text or the shipped formatter is the intended behaviour — and no decision is on record in this thread. Plan: verify the defect first-hand against the shipped formatter, post an options analysis with ramifications and a recommendation, and stand down for the owner's call rather than guess the intended behaviour.
fix(pm-stack): implement C4 day/compound range forms, methodology c4-…
dezren39 commentedon Nov 23, 2026
Lane ZV — premise verification + options analysis (standing down for the owner's decision)
Premise verdict: TRUE, verified first-hand at current main
renderPredictionRangeinpm-stack/aggregator/src/quota-downtime.ts(the C4.1 formatter, #13257) orders its checks:A Chicago calendar day is 23–25h long, so any two instants ≥48h apart necessarily carry different day keys — check 1 always fires first and the day-form branch at check 2 is unreachable, exactly as filed. Live demonstration against the shipped code (issued Mon 2026-11-23 06:00 CST):
"between Wednesday morning and Friday morning"(calendar form — not §4's day form, not compound)"between Thursday morning and Sunday morning"(calendar form)No branch in the formatter produces the compound form (
"2 days 4 hours to up to 3 days 16 hours"). The existing tests pin only the calendar and duration forms.Additional verified findings the decision should reckon with
quota-arrival.ts(C4.4, C4.4 — New model / plan arrival predictions (watch-based, honesty-first) #13260, model/plan arrival records) exports its ownrenderPredictionRange(millisecond args): span check only, no calendar form at all — its day form does fire and is test-pinned ("between 2.5 and 5.7 days from now"). §4 saysrenderedis "produced by one formatter"; the shipped reality is two, and neither implements the compound form."2.5 to 3.7 days". Arrival formatter:"between 2.5 and 5.7 days from now".(earliest, latest, likely, issued_at); neither shipped formatter takes alikelybound.The decision (design owner, #9572)
Option A — the shipped downtime behaviour is intended; correct §4.
Rewrite the day-form bullet so it no longer promises a form downtime windows can't produce, drop or re-scope the compound example, and restate the "one formatter" sentence to match the two shipped implementations.
Ramifications: docs-only; no methodology impact; stored records and scoring continuity untouched. Cost: the compound form dies as a design idea unless another kind adopts it; §4 keeps kind-dependent rendering implicitly rather than saying so.
Option B — §4 is intended; change the downtime formatter.
Implement the compound form and reorder the checks so the day form can fire for ≥48h downtime ranges.
Ramifications: methodology-visible — the stored
renderedstrings are what the scorer grades (§1), so this must ride a §6 methodology-log entry with a newmethodology_version, never a silent edit; every ≥48h downtime prediction changes reader-facing shape (calendar dayparts → decimal/compound days); scoring comparability across the change is the owner's call. Also forces the convergence question for the arrival formatter. Largest blast radius.Option C — scope split (recommended).
Amend §4 to say what the code already does, explicitly: the calendar preference governs downtime windows; the day and compound forms govern kinds whose formatter takes the span path (arrival today). Then implement the compound form in the arrival formatter for mixed spans, where the day form already fires — with a §6 entry if the owner judges the arrival rendering change methodology-visible.
Why: §4's own calendar bullet already states the downtime preference, so the shipped downtime behaviour reads as the design's intent, not an accident; the compound form is a genuine readability gain for multi-day arrival ranges; and the amendment ends the self-contradiction instead of leaving future C4 kinds to re-derive it. Cost: kind-dependent rendering becomes permanent and must be documented as such.
Whichever option is picked, §4's text needs editing — as written it is internally inconsistent, independent of the code.
Disposition
This is a genuine owner decision (the implementation shape differs materially per option, and Option B/C touch the scoring methodology), so Lane ZV is standing down without implementing and releases the item. #13357 should stay open until the owner records the choice here; the chosen option then becomes a fresh, unambiguous implementation slice. Nothing here blocks #13258 (already landed, PR #13352).
dezren39 commentedon Nov 23, 2026
Lane xaltha — #13357 landed as PR #13406 (Closes #13357).
Decision (decide-and-proceed, FDR-0013): the design is right, the formatter was wrong. Verified fresh against origin/main
c8f3a5cf8: the day-form branch in the shared formatter (pm-stack/aggregator/src/quota-downtime.ts,renderPredictionRange) was provably unreachable — the cross-day calendar check ran first and every ≥48h-wide range crosses a Chicago day boundary — and no code produced the §4 compound form. The fix implements the design as written: day form (span ≥ 48h, future ranges) checked before calendar form; compound (2 days 4 hours to up to 5 days 4 hours) when either bound is not an exact tenth of a day, plain decimal days otherwise; in-progress ranges stay calendar. Methodology bumped toc4-meth:2with a §6 log entry, since storedrenderedstrings are what the scorer grades.Evidence: failing-first remote run https://github.com/developing-today/fleet/actions/runs/45203063978 (30 pass / 3 fail — the 3 new tests each got the calendar form), verify run https://github.com/developing-today/fleet/actions/runs/45204666137 (33 pass / 0 fail).
bun test src/quota-downtime.test.ts src/quota-reset-duration.test.tsvia the fleet-command.yml fallback (fleet queue dispatchblocked by #13185). No local builds/tests.Flagged for the design owner: the design's example numbers illustrate the forms' shapes, not the threshold — "2.5 to 3.7 days" is 28.8h wide, under the 48h width rule, so under the shipped code's (and this issue's) width reading of "span" it renders calendar, not day form. If §4 meant an offset-based span, the design text needs that correction; the PR keeps the width reading both formatters already implement.
Next slice: unify the second formatter —
quota-arrival.tshas its ownrenderPredictionRange(duration/day only, no calendar/compound); filed as #13408.