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 — feat(pm-stack): C4.1 complete-downtime window records on gatherer ticks (#13257) by dezren39 · Pull Request #13295 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

What

Implements acceptance criteria 1 and 3 of #13257 (C4.1, component of #9572): complete-downtime window predictions, published on gatherer ticks in the C4 design's record format.

Design conformance note: the C4 design (c4-forecasting-design.md, PR #13268) landed while this slice was in flight. This PR was reconciled to it before merge — record schema (§1), storage (the quota-predictions.jsonl log + Turso mirror under source quota-prediction), basis enum, honesty states, and §7's derivation are all the design's, not a parallel shape.

  • pm-stack/aggregator/src/quota-downtime.ts (new): pure derivation over one tick's Stage-3 forecast product (quota-forecast.json, impl(quota-plane): stage-3 S1 — forecast product: per-tick quota-forecast from the analytics pace math #12695). Per-pool wall intervals [wall, reset) are intersected across every routing pool (canonical provider id; a provider is down while any of its pool rows' windows is down). Each record: earliest = the last member wall, latest = the earliest member reset (the first reopening), basis = since_last_reset with detail, inputs (series/samples/span, adjustments: []), the §4 rendered string produced at issuance by the shared formatter (renderPredictionRange: duration / day / calendar forms, America/Chicago), methodology_version: c4-meth:1, and the supersedes link.
  • pm-stack/aggregator/c4-methodology-log.jsonl (new): the §6 methodology log's first entry, versioned into the repo with the code change that implements it.
  • pm-stack/aggregator/scripts/gather-quota.ts: fail-soft block after the forecast publication — derives the tick's records, appends them to quota-predictions.jsonl beside the forecast product (path overridable via QUOTA_PREDICTIONS_PATH), and mirrors them into the ledger via the existing forecast Turso sink. The supersedes chain reads the log's tail (fail-soft). A null forecast derives nothing; previous records stand and age with the previous forecast. Advisory only: no placement path reads these records.
  • Tests: src/quota-downtime.test.ts (15 tests) plus a new assertion block in test/gather-quota.test.ts proving the tick appends the downtime record beside the forecast product.

Honesty rules (§1, criterion 3)

  • A predicted window is asserted only from known wall intervals. Providers the forecast cannot project (insufficient-history windows) can only add downtime, so a known overlap still publishes as predicted with the unknown providers named in the basis detail — but unknowns veto a no-window verdict: no known overlap + any unknown provider publishes an insufficient_history record with a named reason, never a silent absence and never an invented range.
  • An all-walled overlap that no member reset bounds is an honesty state, not an unbounded prediction.
  • A defensible no-window tick publishes no record — per §3 scoring, absence is the no-prediction signal (a realized downtime with no prediction scores as a miss).

Verification (laptop route)

  • bun test src/quota-downtime.test.ts — 15 pass / 0 fail.
  • Mutation check: flipping the intersection quantifier (every → some) fails 9 of 15 tests; restored, all green.
  • bun test test/gather-quota.test.ts src/quota-forecast.test.ts src/quota-forecast-accuracy.test.ts — 38 pass / 0 fail.
  • bunx tsc --noEmit — 0 errors (worktree node_modules symlinked from the primary checkout; a bare worktree lacks the bun type definitions).
  • Remote dispatch attempted (run 45178762980, handle fp_696c5e6b26f9d0b684d51b10efaa9778): failed at the "Execute target command" step — the fleet-build container has no bun (the fleet: fleet-command dispatch container cannot run nix develop out of the box (experimental features, nixbld group, homeless-shelter purity) #13159 environment-gap family), so it is not a test result; the laptop runs above are the verifying route.

Remaining on #13257

Criterion 2 — scoring downtime windows per §3 (start/end error, interval overlap) in the accuracy ledger — is the next slice; the records mirrored here are its input. The issue stays open.

Refs #13257, #9572.

Sorry, something went wrong.

Uh oh!

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

All reactions
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

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

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 39 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: e1d14026-ee3f-4dda-8ad3-5d650b90b82f
Commits

Reviewing files that changed from the base of the PR and between 1845798 and 6569d04.

Files selected for processing: 5

  • pm-stack/aggregator/c4-methodology-log.jsonl
  • pm-stack/aggregator/scripts/gather-quota.ts
  • pm-stack/aggregator/src/quota-downtime.test.ts
  • pm-stack/aggregator/src/quota-downtime.ts
  • pm-stack/aggregator/test/gather-quota.test.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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

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

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-23T13:16:42.437318Z 6569d04 New commits
ℹ️ 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.

All reactions

Sorry, something went wrong.

Uh oh!

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

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 23, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b11b655e9b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pm-stack/aggregator/src/quota-downtime.ts Outdated
const spans: DowntimePoolSpan[] = [];
let latest = -Infinity;
for (const intervals of perPool) {
const iv = covers(intervals, start) as WallInterval;

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for every binding limit in the latest reopening

When a pool has multiple overlapping wall intervals, covers() selects only the first one, so latest ignores other limits that still block that pool. For example, a single pool with two already-walled windows resetting at +1h and +10h produces reopening.earliest = +10h but reopening.latest = +1h; reversing the window order changes the result. This publishes an inverted reopening range and an incorrect full-restoration bound in both the JSON product and ledger. Compute the bound from all relevant blocking intervals rather than the first covering window.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pm-stack/aggregator/src/quota-downtime.test.ts Outdated
Comment on lines +45 to +46
describe("deriveDowntimeWindow", () => {
test("overlapping walls predict a window with the intersection range and named basis", () => {

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add generated coverage for the downtime interval model

This suite contains only hand-written examples, although the new engine has union/intersection, maximal-window, and input-order invariants. AGENTS.md requires “property tests” where code has invariants and “model-based tests” where a model exists; acceptance examples alone do not satisfy that requirement. Add generated pool/window combinations checked against an independent interval-set oracle, including overlapping limits within a pool and permutation invariance—the current examples miss the order-dependent reopening calculation.

AGENTS.md reference: AGENTS.md:L37-L39

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
@dezren39
feat(pm-stack): C4.1 complete-downtime window prediction records (#13257
6569d04
)

Publish downtime_window prediction records on gatherer ticks, in
the C4 design's record format (doc/2026-11-13T15-12-00Z_design_
reporting-architecture-event-driven/c4-forecasting-design.md §1/§7,
landed by PR #13268): appended to quota-predictions.jsonl beside
the forecast product and mirrored into the Turso ledger under the
C4 source "quota-prediction".

src/quota-downtime.ts derives each record from the tick's Stage-3
forecast product (#12695): per-pool wall intervals [wall, reset)
intersected across every routing pool (canonical provider id);
earliest = the last member wall, latest = the earliest member
reset; basis since_last_reset, named with its detail; the §4
range rendering stored at issuance; supersedes linked from the
log's tail. Honesty per §1 and #13257 criterion 3: providers the
forecast cannot project publish insufficient_history with a named
reason (and veto a no-window verdict); an overlap no member reset
bounds is an honesty state, not an unbounded prediction; a
defensible no-window tick publishes no record — absence is the
scored no-prediction signal. First methodology entry c4-meth:1
recorded in c4-methodology-log.jsonl (§6).

Acceptance: criteria 1 (records published on gatherer ticks) and
3 (honesty state) of #13257. Criterion 2 (scoring per §3 in the
accuracy ledger) is the next slice; the mirrored records are its
input.

Tests: src/quota-downtime.test.ts (15 tests: record shape,
intersection range, in-progress windows, union within a provider,
disjoint overlaps, honesty states, supersedes, §4 rendering,
ledger mirror), mutation-checked; the gather-quota integration
test now also asserts the tick appends the downtime record.
Oracle: the C4 design §1/§7 over the #12695 forecast product.
@dezren39
dezren39 force-pushed the lane-wa-13257 branch from b11b655 to 6569d04 Compare November 23, 2026 13:13
@dezren39
dezren39 merged commit 619b7e5 into main Nov 23, 2026
1 check passed

Uh oh!

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

@dezren39
dezren39 deleted the lane-wa-13257 branch November 23, 2026 13:15
This was referenced Nov 23, 2026
C4.1 — Complete-downtime window prediction (all pools walled at once) #13257
Closed
C4 — Quota forecasting: exhaustion, downtime, and reset-duration predictions, tracked until accurate #9572
Open
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 23, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6569d04a58

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pm-stack/aggregator/src/quota-downtime.ts
Comment on lines +276 to +278
const bounded = overlaps.filter((o) => Number.isFinite(o.end));
if (bounded.length > 0) {
return bounded.map((o) => {

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the honesty state for an unbounded trailing overlap

When a tick contains both a finite complete-downtime interval and a later unbounded one, this early return silently drops the unbounded interval and bypasses the insufficient_history branch below. For example, a single provider with windows [+1h, +2h) and [+3h, Infinity) publishes only the first prediction, without disclosing that another all-walled interval cannot be bounded. Preserve an honesty record for the unbounded overlap even when finite predictions also exist, so the JSONL log and ledger distinguish an unbounded forecast from no prediction.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pm-stack/aggregator/scripts/gather-quota.ts
const records = deriveDowntimeWindowRecords(forecast, previous);
if (records.length) {
await mkdir(dirname(predictionsPath), { recursive: true });
await appendFile(predictionsPath, records.map((r) => JSON.stringify(r)).join("\n") + "\n", "utf8");

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Separate new records from a torn log tail before appending

If a previous append was interrupted before its terminating newline, the parser skips the torn final line, but this append concatenates the next tick's first record directly onto that fragment. The resulting line is invalid JSON, so the first new prediction is also lost from the readable log and cannot become a subsequent supersedes target; for the usual single-record tick, this loses the entire tick locally even though the ledger write proceeds. Repair or delimit an unterminated tail before appending new records so the intended torn-log recovery preserves the next prediction.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pm-stack/aggregator/src/quota-downtime.ts
): C4PredictionRecord[] {
const issuedAt = forecast.generatedAt;
const issuedMs = Date.parse(issuedAt);
const providerIds = Object.keys(forecast.pools).sort();

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict the downtime intersection to enabled routing providers

The forecast's provider keys are not exclusively routing pools: gather-quota.ts:264–278 explicitly requests quota for disabled doors, and collectRuns() retains those results in the entries passed to buildQuotaForecast(). In the checked .opencode/opencode.jsonc:350–363, _commandcode and deepseek are disabled but still explicitly gathered. Consequently, when every enabled routing provider is walled but one of these disabled providers has a no-wall-before-reset forecast, its empty down-set makes this function return no downtime prediction, even though that provider cannot serve as a fallback. Pass the enabled routing set into the derivation and intersect only those providers, while retaining disabled-provider measurements in the broader forecast product.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 24, 2026
C4.6 — Downtime-window demonstration against a known wall (Sunday-evening reopening set) #13262
Open
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

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.

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.