Skip to content

fix(pm-stack): implement C4 day/compound range forms, methodology c4-meth:2 (#13357) - #13406

Open
dezren39 wants to merge 2 commits into
mainfrom
xaltha/13357-c4-compound-day-form
Open

dezren39 wants to merge 2 commits into
mainfrom
xaltha/13357-c4-compound-day-form

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Closes #13357

Summary

The design (§4) specifies the day form for span ≥ 48h and the compound form for mixed spans, but the shared formatter in pm-stack/aggregator/src/quota-downtime.ts implemented neither: the cross-day calendar check ran before the span check, and every ≥48h-wide range crosses a Chicago day boundary, so the day-form branch was provably unreachable; no code produced the compound form.

This slice decides the design is right and fixes the formatter:

  • Check order: the day form (span ≥ 48h, future ranges) is checked before the calendar form, so it can fire.
  • Compound form: when either bound is not an exact tenth of a day, both bounds render as whole days + whole hours — 2 days 4 hours to up to 5 days 4 hours — per the design's quoted shape; otherwise plain decimal days (2.5 to 5 days).
  • In-progress guard: ranges already in progress (earliest at or before issuance) still render calendar form — the day form has no "from now" anchor for a past start.
  • Methodology: this changes stored rendered strings, so it rides a methodology-log entry (§6): version bumped to c4-meth:2 (C4_METHODOLOGY_VERSION, shared by the downtime and reset-duration kinds) with a c4-meth:2 entry appended to pm-stack/aggregator/c4-methodology-log.jsonl.

Decisions recorded (decide-and-proceed, FDR-0013): "span" is the range width (latest − earliest), as both shipped formatters and the issue read it; the design's example numbers ("2.5 to 3.7 days", width 28.8h) illustrate the forms' shapes, not the threshold — if the design owner meant an offset-based span, §4 needs that correction, flagged on the issue. quota-arrival.ts keeps its own separate renderPredictionRange (duration/day only); unifying the two formatters is a follow-up, not this slice.

Evidence

Failing-first, then fixed, by remote dispatch (fleet-command.yml workflow; fleet queue dispatch is blocked by #13185):

Not built or tested locally; no laptop or sandbox builds/tests (per the remote-dispatch directive).

Merge Danger

  • Stored rendered strings change for future ≥48h-wide ranges (calendar → day/compound). That is the intended, methodology-visible change (hence c4-meth:2); the scorer grades stored strings, so records issued before/after this PR are attributable by methodology_version.
  • No change to ranges under 48h or to in-progress ranges (existing calendar/duration tests pass unchanged).
  • Reset-duration records now carry c4-meth:2 (they share the constant); arrival records still carry c4-meth:1 (that formatter is untouched).
{
  "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-23T15:31:19Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code-13357",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code-13357",
      "repo": "developing-today/code",
      "branch": "xaltha/13357-c4-compound-day-form",
      "sha": "ad98345d82aed8ffced52ff4752b685887fe071a"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

…13357)

The day-form branch of the shared formatter is unreachable and no
code produces the design §4 compound form. These tests pin the
specified behaviour first; the formatter fix follows.
…meth:2 (#13357)

The shared §4 formatter checked the calendar form before the day
form, and every ≥48h-wide range crosses a Chicago day boundary, so
the day-form branch could never fire and no code produced the
design's compound form. Check the day form (span ≥ 48h, future
ranges) first; render compound days+hours when either bound is not
an exact tenth of a day, plain decimal days otherwise; in-progress
ranges stay calendar. Bumps the methodology to c4-meth:2 with a log
entry (§6) — stored rendered strings are what the scorer grades.
@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 42 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: a5e622b5-1309-43dd-b404-4b8b9ffe643e
Commits

Reviewing files that changed from the base of the PR and between 1310027 and ad98345.

Files selected for processing: 5

  • pm-stack/aggregator/c4-methodology-log.jsonl
  • pm-stack/aggregator/src/quota-downtime.test.ts
  • pm-stack/aggregator/src/quota-downtime.ts
  • pm-stack/aggregator/src/quota-reset-duration.test.ts
  • pm-stack/aggregator/src/quota-reset-duration.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-23T15:35:18.779587Z ad98345 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.

This branch has not been deployed

No deployments
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 design section 4: compound range form unimplemented and day form unreachable in the shared formatter

1 participant