Skip to content

feat(quota-plane): S7 weekly forecast-accuracy review job (#12701) - #13263

Merged
dezren39 merged 1 commit into
mainfrom
lane-us-12701
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-us-12701

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Stage-3 slice S7 (epic #12694; design §7, D7): the scheduled weekly job that scores the week's forecasts against realized outcomes and folds the accuracy record back into the rules — as a report and proposals, never in-place edits.

  • pm-stack/aggregator/src/quota-weekly-review.ts — the pure review core: week scoring over S2's scored facts (a forecast belongs to the week its reset period completed in; textbook precision/recall with S2's rounding and null rules; wall error via S2's errorDistribution), the §6 findings of the week, and the §5 fold rendered as the week's rule consequence — S6 proposals with their PRs, or an explicit no-change finding carrying the week's numbers (the design's anti-decay rule), or a plain statement that the fold was not evaluated. The pace_hold section names S4's absence until it lands.
  • pm-stack/aggregator/scripts/quota-weekly-review.ts — the job (package script review:quota-weekly). Builds the ledger from the snapshot store, replays the detectors, runs the S6 generator when --route-config is supplied (draft packs under --out-dir; --open-prs opens proposal PRs through S6's PR-only path), and with --post posts the report as a comment on epic epic(quota-plane): Stage 3 — predictive, self-tuning quota operations #12694. Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 argument contract.
  • pkgs/pm-aggregator — pm-aggregator-quota-weekly-review entry point.
  • nixos/services/pm-stack — quota-weekly-review service + timer (Mondays 07:20 local, Persistent) beside the weekly digest.
  • doc/fleet-schedule-registry.md — the job's §2b row with cadence and owner, marked Nix-configured pending deployment.

Evidence

  • New tests src/quota-weekly-review.test.ts: 7/7 pass, 32 assertions — hand-computed fixture oracles for week membership (half-open reset interval), precision/recall, wall-error quantiles, findings grouping, and the report's rule-consequence shapes.
  • Neighbouring quota suites in the same run: 88/88 pass across 7 files (weekly-review, forecast, forecast-accuracy, shadow-placement, anomaly, reweight, reweight-pr); bunx tsc --noEmit clean.
  • Remote dispatch attempted first (fleet queue dispatch, run 45174756027): failed with bun: command not found in the fleet-build container — the known container gap (fleet: fleet-command dispatch container cannot run nix develop out of the box (experimental features, nixbld group, homeless-shelter purity) #13159 family), not a test result; verification is the laptop route above.
  • nix build .#pm-aggregator succeeds; the packaged pm-aggregator-quota-weekly-review binary enforces the argument contract. NixOS eval of the amd configuration: systemd.user.timers.quota-weekly-review.Timer.OnCalendar = "Mon *-*-* 07:20:00", service Type = "oneshot", ExecStart renders to the packaged binary with the state-dir store, the checkout route config, --open-prs --post.
  • Dry run against the live store (no post, no PRs): week 2026-11-16 → 2026-11-23, 1,213 forecasts scored, 16 findings, and the S6 fold produced one proposal (caution-margin:NEAR_PCT:80->75) with its evidence gaps recorded. The first live run (report posted to epic(quota-plane): Stage 3 — predictive, self-tuning quota operations #12694 + proposal PR) follows this merge and is recorded on impl(quota-plane): stage-3 S7 — weekly forecast-accuracy review job: fold accuracy back into the rules #12701.

Merge Danger

Low. Purely additive: a new module, script, package entry point, and timer; no existing unit, route, or config changes behaviour. The timer activates only on the next laptop NixOS deploy from the primary, and the job itself never edits quota config — its only writes are the epic comment and S6 proposal PRs.

{
  "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-23T12:37:44Z",
    "session_id": null,
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/wt-lane-us-12701",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/wt-lane-us-12701",
      "repo": "developing-today/code",
      "branch": "lane-us-12701",
      "sha": "47728f458e9a166e2a84f650c2279e78185ff9e1"
    },
    "auth_subject": "oc-code-02",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

Stage-3 slice S7 (epic #12694; design §7, D7): the scheduled weekly
job that scores the week's forecasts against realized outcomes and
folds the accuracy record back into the rules — as a report and
proposals, never in-place edits.

- src/quota-weekly-review.ts: the pure review core. Week scoring
  over S2's scored facts (a forecast belongs to the week its reset
  period completed in), textbook precision/recall with S2's rounding
  and null rules, wall error via S2's errorDistribution; the §6
  findings of the week; the §5 fold rendered as the week's rule
  consequence — S6 proposals with their PRs, or an explicit
  no-change finding carrying the week's numbers (the design's
  anti-decay rule), or a plain statement that the fold was not
  evaluated. pace_hold section names S4's absence until it lands.
- scripts/quota-weekly-review.ts: the job (package script
  review:quota-weekly). Builds the ledger from the snapshot store,
  replays the detectors, runs the S6 generator when --route-config
  is supplied (draft packs under --out-dir; --open-prs opens the
  proposal PRs through S6's PR-only path), and with --post posts
  the report as a comment on epic #12694. #3352 argument contract.
- pkgs/pm-aggregator: pm-aggregator-quota-weekly-review entry point.
- nixos pm-stack module: quota-weekly-review service + timer
  (Mondays 07:20 local, Persistent) beside the weekly digest.
- doc/fleet-schedule-registry.md: the job's §2b row with cadence
  and owner (Nix-configured pending deployment).

Tests: src/quota-weekly-review.test.ts — hand-computed fixture
oracles for week membership (half-open reset interval), precision/
recall, wall-error quantiles, findings grouping, and the report's
rule-consequence shapes.
@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 59 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: cfa3bbd3-ceed-4ddf-8afb-9af91550c483
Commits

Reviewing files that changed from the base of the PR and between 03ebe52 and 47728f4.

Files selected for processing: 7

  • doc/fleet-schedule-registry.md
  • nixos/services/pm-stack/default.nix
  • pkgs/pm-aggregator/package.nix
  • pm-stack/aggregator/package.json
  • pm-stack/aggregator/scripts/quota-weekly-review.ts
  • pm-stack/aggregator/src/quota-weekly-review.test.ts
  • pm-stack/aggregator/src/quota-weekly-review.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-23T12:39:13.032127Z 47728f4 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.

1 participant