GeezerVison is showing github.com — feat(aggregator): C4.3 day-type + spike-day forecast adjustments as shadow records (#13259 criterion 2) by dezren39 · Pull Request #14357 · developing-today/code
Conversation
dezren39
commented
Nov 24, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Criterion 2 of #13259: the C4 design §5 day-type and spike-day adjustments, implemented for the cells criterion 1 admitted (PR #13290: 51 of 2,583 — daypart and dayclass-weekday grains) and published as shadow records per the §5 earn-in rule. The published forecast is never modified; criterion 3 (the S2-harness accuracy comparison) decides whether they ever ship.
What lands
src/quota-daytype-adjustment.ts — per pool/window with a live v1 projection, a shadow record carrying the v1 wall verbatim plus the adjusted wall: v1 pace × the measured burn-rate ratio of the Chicago cell the issuance instant falls in, finest admitted grain first (weekday-daypart → daypart → weekday → dayclass; gate ≥8 independent samples counted exactly as criterion 1 counted them, over the same rename-joined series the S2 harness assembles). One shared interval estimator (within reset periods, ΣΔpct/ΣΔt, intervals attributed to their end reading's cell) serves cell rates, the overall rate, and the spike windows. Spike-day (S2.7): trailing-7d ≥10% light vs trailing-30d (long basis ≥14 distinct dates) predicts a spike day — stated explicitly: spike_day in inputs.adjustments, both rates and the light fraction on the record, spike wall at adjusted pace ×1.2. No admitted cell at any grain → adjustment_unavailable with the per-grain counts.
- Gatherer wiring (
scripts/gather-quota.ts): fail-soft block after shadow placement appending to quota-daytype-shadow.jsonl beside the forecast product — deliberately not the C4 prediction log or the quota-prediction ledger source, since shadow records are not the published forecast. Supersedes chain read from the file tail, downtime-style.
bun run shadow:daytype-adjustments — reproducible operator command over a fixed store copy + forecast product (strict-arg contract like the sufficiency command).
c4-methodology-log.jsonl: c4-meth:5 entry — the named methodology version every shadow record cites (§6).
quota-daytype-sufficiency.ts: cellsFor exported — the one cell-definition source, reused rather than copied.
Verification
- 23 new oracle-named tests (hand-derived ratios 234/147 and 4158/4230, the ≥8 gate boundary, grain precedence and dayclass fallback, the spike shape with hand-derived light fraction 5/14, uniform-burn and thin-basis controls, supersedes): 60/60 across the new, sufficiency, downtime, and forecast suites (
bun test, laptop worktree — the Actions exec runner has no access path to this repo's code: no clone credentials, no inbound file transfer; bun tests run in the worktree, no nix-store build involved).
- Typecheck (
bunx tsc --noEmit): no errors in any touched file; one pre-existing error in src/prompts.test.ts (untouched by this change).
- Live run over the real snapshot store (21,423 records) against the live forecast product: openai weekly adjusted by
daypart:morning at ratio 1.228 — wall 2026-11-24T23:32Z → 21:38Z.
Refs #13259 — criterion 2 of 3; the issue stays open for criterion 3.
{
"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-24T13:25:03Z",
"session_id": null,
"lane": null,
"host": "amd",
"worktree": "/home/user/wt-lane-23132-daytype",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/wt-lane-23132-daytype",
"repo": "developing-today/code",
"branch": "queue/23132-daytype-adjust",
"sha": "61abe6ca6cb7782f43cbe906000da11d628d29ad"
},
"auth_subject": "oc-code-06",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…hadow records (#13259 criterion 2)
Implements the C4 design section 5 models for the cells the
criterion-1 re-measure admitted (PR #13290: 51 of 2,583 cells,
daypart and dayclass-weekday grains):
- src/quota-daytype-adjustment.ts: per pool/window with a live
v1 projection, a shadow record carrying the v1 wall verbatim
and the adjusted wall — v1 pace x the measured burn-rate
ratio of the Chicago cell the issuance instant falls in,
finest admitted grain first (weekday-daypart, daypart,
weekday, dayclass; gate >=8 independent samples counted as
criterion 1 counted them). One shared interval estimator
(within reset periods, sum dPct / sum dt, intervals
attributed to their end reading's cell) for cell rates, the
overall rate, and the spike windows. Spike-day (S2.7):
trailing-7d >=10% light vs trailing-30d predicts a spike day,
stated explicitly (spike_day adjustment entry, both rates and
the light fraction on the record, spike wall at adjusted
pace x1.2). No admitted cell at any grain publishes
adjustment_unavailable with the per-grain counts.
- Earn-in (section 5): shadow only. Records append to
quota-daytype-shadow.jsonl beside the forecast product —
never the C4 prediction log, never the published forecast —
until criterion 3's S2-harness comparison earns them in.
- Gatherer wiring in scripts/gather-quota.ts (fail-soft block
after shadow placement, supersedes chain from the file tail),
a reproducible operator command
(bun run shadow:daytype-adjustments), and the methodology
log entry c4-meth:5 the records cite.
- quota-daytype-sufficiency.ts: cellsFor is now exported (the
one cell-definition source, reused by the adjustment module).
Tests: 23 new oracle-named tests (hand-derived ratios, gate
boundary, grain precedence and fallback, spike shape and
controls, supersedes) — 60/60 across the new, sufficiency,
downtime, and forecast suites. Typecheck: no errors in the
touched files (one pre-existing error in src/prompts.test.ts,
untouched). Live run over the real snapshot store (21,423
records): openai weekly adjusted by daypart:morning at ratio
1.228, wall 2026-11-24T23:32Z -> 21:38Z.
Refs #13259 (criterion 2 of 3; the issue stays open for the
criterion-3 earn-in comparison).
Uh oh!
There was an error while loading. Please reload this page.
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 25 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:
13e81662-a284-41fe-a2e4-eb1a8b836d7f
Commits
-
Reviewing files that changed from the base of the PR and between 9918646 and 61abe6c.
Files selected for processing: 7
-
pm-stack/aggregator/c4-methodology-log.jsonl
pm-stack/aggregator/package.json
pm-stack/aggregator/scripts/gather-quota.ts
pm-stack/aggregator/scripts/quota-daytype-shadow.ts
pm-stack/aggregator/src/quota-daytype-adjustment.test.ts
pm-stack/aggregator/src/quota-daytype-adjustment.ts
pm-stack/aggregator/src/quota-daytype-sufficiency.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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|