GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — impl(quota-plane): stage-3 S3 — shadow placement: forecast ordering logged beside live ordering (#12697) by dezren39 · Pull Request #12748 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Stage-3 S3 implementation for #12697 (epic #12694, design D3 in doc/2026-11-22T22-35-00Z_design_quota-plane-stage-3). Deliberately does not close #12697: its first acceptance criterion is one week of accumulated shadow diff records, which is calendar time after this lands and the laptop aggregator redeploys; the issue stays open for that, with the summary to be posted on #12694.

What lands

pm-stack/aggregator/src/quota-shadow-placement.ts — a pure per-tick projection (S1/pool-state idiom: no I/O, clock only through arguments) emitting the per-decision diff record:

  • Live ordering — burn-by-expiry from the measured data (quota-current) alone: tiers open → unknown → caution (≥85%, NEAR_PCT) → walled, soonest reset first within a tier. Unknown is not closed: an unreadable pool stays in the ordering, it just has no measured expiry to burn by.
  • Shadow ordering — the same ordering with one adjustment: an open-tier pool whose consumed forecast projects a wall before its reset is demoted into the caution tier — before it reaches the caution zone. That is the whole forecast effect.
  • The record (quota-shadow-placement.json latest + one appended line per tick in quota-shadow-placement-history.jsonl): both orderings, the decision point (gatherer tick + the current/forecast products' generatedAt stamps), and per pool the measured inputs, every forecast window row with its honesty state and whether it was consumed or excluded (and why), both ranks, and movement reasons — everything S7 needs to score shadow-vs-live after the fact.

Consumption rules, binding S2's findings (#12696):

  • The bare opencode-go pool's monthly forecast is never consumed — S2 showed that series is a cross-workspace mixing artifact (precision 0.054 vs 0.93–1.0 per-workspace); the exclusion is logged on the record. Per-workspace pools consume their monthly rows normally.
  • insufficient-history rows are logged with state + reason, never consumed — no ordering is invented from an unscoreable series.
  • A forecast window whose underlying reading is outside quota-current's freshness bounds degrades to no forecast for that window (the design's freshness contract), logged as an exclusion.
  • The forecast can never promote a measured demotion, never remove a pool, never close anything. Weekly projections running late (S2) is calibration knowledge for S7, not a consumption rule — v1 consumes the projection as published and lets the shadow record measure how the demotions fare.

scripts/gather-quota.ts — after the forecast block (i.e. after every live output is written), the tick builds the record from the in-process forecast (null if the forecast failed — the record still lands, shadow == live) and writes both files, fail-soft like the forecast and pool-state writes. QUOTA_SHADOW_PLACEMENT_PATH / QUOTA_SHADOW_PLACEMENT_HISTORY_PATH override the defaults beside QUOTA_CURRENT_PATH. No live path reads the record.

Evidence (sandbox venue)

  • Fail-before: the new suite on pristine origin/main fails with module-not-found (./quota-shadow-placement.ts), the expected whole-surface-missing failure.
  • Pass-after: quota-shadow-placement.test.ts 14/14 (63 expects), including the no-live-effect battery — live ordering identical across forecast variants (null, empty, every-pool-projected-to-wall, honesty-only, stale) and equal to the exported liveOrderingFor(current) — the demotion-before-caution case, the bare-opencode-go exclusion vs per-workspace consumption, and the permutation property (shadow never adds/removes a pool).
  • Neighbours: quota-forecast + quota-forecast-accuracy + pool-state + quota-analytics + quota-gather-map suites green (82/82 across the six files).
  • Full aggregator suite: 3,225 pass / 4 fail — the same 4 tests fail identically on pristine origin/main in the same venue (verified by a scratch-worktree run): deriveEpicEta censored-distribution (timing), charges feed-gate fallback, parsePhaseMapping real-file read, dashboard: clean up the page list (12 registered pages, overlaps to resolve) #1497 curation manifest. Zero new failures.
  • tsc --noEmit clean; biome check clean on the three changed files. No new dependencies.

What remains

  • The ≥1-week shadow accumulation (acceptance criterion 1) starts at the first laptop tick running this code — the same aggregator redeploy that deploy: babysitter pool-state feed not live on the laptop (aggregator predates #12689, no POOL_STATE_PATH) #12718 and S1's live acceptance are waiting on. After a week of records, the summary (how often the forecast ordering differed; whether realized outcomes favoured it, scored via the S2 ledger) posts on epic(quota-plane): Stage 3 — predictive, self-tuning quota operations #12694 and impl(quota-plane): stage-3 S3 — shadow placement: forecast-informed ordering logged beside live ordering #12697 can close.
  • S4 (live pace_hold, impl(quota-plane): stage-3 S4 — live forecast-driven admission: pace_hold from projected exhaustion #12698) consumes this record's evidence; S5–S7 untouched.

Prove it works
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.

All reactions
felix added 2 commits November 23, 2026 01:08
felix
quota-shadow-placement: forecast-informed ordering logged beside the …
28981fd
…live ordering (#12697)

Stage-3 S3 (design D3): a pure projection over the tick's
quota-current + quota-forecast that computes the live placement
ordering (burn-by-expiry, measured data only) and the shadow
ordering (an open pool projected to wall before its reset is
demoted into the caution tier, before the caution zone), and emits
the per-decision diff record S7 scores: both orderings, the
decision point, per-pool measured inputs, every forecast window
row with its honesty state and consumption verdict, both ranks,
movement reasons.

Consumption binds S2's findings: the bare opencode-go monthly
forecast (cross-workspace mixing artifact) is never consumed and
the exclusion is logged; insufficient-history rows are logged,
never consumed; a stale forecast reading degrades to no forecast.
The forecast can never promote a measured demotion, remove a
pool, or close anything; the live ordering is a function of the
measured data alone (pinned by tests across forecast variants:
null, empty, all-wall, honesty-only, stale).
felix
gather-quota: publish the shadow placement record per tick (#12697)
8675bbc
After the forecast block, each tick writes quota-shadow-placement
.json beside quota-current.json and appends the record to
quota-shadow-placement-history.jsonl (QUOTA_SHADOW_PLACEMENT_PATH
/ QUOTA_SHADOW_PLACEMENT_HISTORY_PATH override). Fail-soft like
the forecast: a shadow failure never fails the tick, and a failed
forecast still yields a record with shadow == live. No live path
reads the record.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 01:08
@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 48 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: a369c4d4-d25d-4d91-8a9c-bd1f42fe43e9
Commits

Reviewing files that changed from the base of the PR and between a7e088c and 8675bbc.

Files selected for processing: 3

  • pm-stack/aggregator/scripts/gather-quota.ts
  • pm-stack/aggregator/src/quota-shadow-placement.test.ts
  • pm-stack/aggregator/src/quota-shadow-placement.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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 23, 2026
impl(quota-plane): stage-3 S3 — shadow placement: forecast-informed ordering logged beside live ordering #12697
Closed
epic(quota-plane): Stage 3 — predictive, self-tuning quota operations #12694
Open
@dezren39
dezren39 merged commit a3a547e into main Nov 23, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the felix/12697-shadow-placement branch November 23, 2026 01:09
This was referenced Nov 23, 2026
Stage-3 S5: anomaly detectors — burn spike, schema drift, plan change (#12699) #12754
Merged
impl(quota-plane): stage-3 S5 — anomaly detectors: burn spike, adapter schema drift, vendor plan change #12699
Open
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
This was referenced Nov 24, 2026
Audit programme: seven-lane review of PRs, issues and designs (2026-11-23) #13871
Open
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:partial PR partially implemented; gap filed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

impl(quota-plane): stage-3 S3 — shadow placement: forecast-informed ordering logged beside live ordering

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.