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): quota gatherer writes the babysitter pool-state feed (#1338) by dezren39 · Pull Request #12689 · developing-today/code

Conversation

@dezren39

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

Uh oh!

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

Copy link
Copy Markdown
Member

Summary

Lands #1338's remaining code slice — the pool-state.json quota feed — under epic #1334 (whose reconciliation is posted at #1334 (comment)).

The babysitter's verdict rounds (PR #12687) read pool wall state from pool-state.json in the claimant state dir, an input file nothing wrote: on a live install every round would record pool_state: "unread" and no pool could ever read walled, so a quota wall would still be misreadable as a stall. babysitter.py's own header named this wiring as the follow-up slice.

  • pm-stack/aggregator/src/pool-state.ts — pure projection of the gatherer's quota-current.json into the babysitter's shape, keyed by the canonical OpenCode provider id (the id a session names as model.providerID; the aggregator's service ids are a separate contract and never appear). Wall rule is derive.ts poolState's (any window ≥ 100%); a wall is asserted only from a fresh ok entry (quota-current.ts freshness bounds) — stale/errored entries surface as state with no wall and no percent, per quota-exhaustion.ts's stale_source honesty rule. Several credentials sharing a providerId: any fresh ok one at its limit walls the pool.
  • scripts/gather-quota.ts — writes the projection to the claimant state dir (POOL_STATE_PATH override, default ~/.local/state/opencode-claimant/pool-state.json) after quota-current.json, fail-soft like the Turso sink: a failed write warns and never fails the tick; a missing feed reads as "unread" on the claimant side, never as a false all-clear.
  • babysitter.py header now names the landed writer instead of the follow-up slice.

No schedule is created or changed (the writer rides the gatherer's existing 15-minute tick), so the schedule registry is untouched. No new dependencies.

Evidence (sandbox venue)

  • Fail-before: the new suite against pristine origin/main via git archive — load error, pool-state.ts absent.
  • Pass-after: pool-state.test.ts 11/11; neighbouring quota suites (quota-gather-map, quota-analytics) — 39/39 across the three files; claimant hermetic suite 203/203.
  • Cross-language contract check: a projection generated by the TS module was read back by babysitter.read_pool_state — status read; a fresh 100% pool lands walled: true, a 3-hour-stale 100% pool lands walled: false, state: "stale".
  • tsc --noEmit: no errors in the touched files (3 pre-existing errors about grist/seed/roadmap.json, absent from this sparse worktree, unrelated). Changed files formatted with the repo's pinned biome 2.3.2 / ruff per treefmt.

Remaining on #1338 after this

Deployment + live verification only: the laptop claimant and gatherer pick the code up on install; three live babysitter rounds with a live pool-state feed tick criteria 1–2's live arm. This PR does not close #1338.

Refs #1338, #1334.


Run Proof on this PR
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
feat(pm-stack): quota gatherer writes the babysitter pool-state feed (#…
690bbc7
…1338)

The claimant babysitter's verdict rounds read pool wall state from
pool-state.json in the claimant state dir, an input file nothing
wrote: on a live install every round recorded pool_state unread and
no pool could ever read walled. This lands the writer half of the
contract babysitter.py's header named as the follow-up slice.

- src/pool-state.ts: pure projection of quota-current.json into the
  babysitter shape, keyed by the canonical OpenCode provider id (the
  id a session names as model.providerID). A wall is asserted only
  from a fresh ok entry (quota-current freshness bounds) under
  derive.ts poolState's rule (any window >= 100%); stale/errored
  entries surface as state with no wall and no percent, per
  quota-exhaustion's stale_source honesty rule.
- gather-quota.ts: writes pool-state.json into the claimant state
  dir (POOL_STATE_PATH override) after quota-current.json,
  fail-soft like the Turso sink - a failed write warns and never
  fails the tick.
- babysitter.py header now names the landed writer.

Evidence (sandbox): fail-before on pristine origin/main (suite load
error, no pool-state.ts); pass-after pool-state 11/11, neighbouring
quota suites 39/39, claimant hermetic suite 203/203; cross-language
contract check - babysitter.read_pool_state reads the projection
back (fresh wall lands, stale wall does not). tsc clean for the
touched files (3 pre-existing grist/roadmap.json errors from the
sparse worktree, unrelated). No new dependencies.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 22:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 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-22T22:11:47.726453Z 690bbc7 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.

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Nov 22, 2026
Babysitter live: interval rounds over all OpenCode sessions with verdicts, quota, and pool attribution #1338
Closed
epic(fleet): pool & routing intelligence — lanes everywhere, live dispatch + babysitting, quota stewardship, reviewer oversight, AA + measured-speed model #1334
Open
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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.

@dezren39
dezren39 merged commit 2ce5c77 into main Nov 22, 2026
1 of 2 checks passed

Uh oh!

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

@dezren39
dezren39 deleted the felix/1334-pool-state-feed branch November 22, 2026 22:10
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 22, 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: 690bbc7e99

ℹ️ 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/pool-state.ts
Comment on lines +63 to +65
if (entry.state !== "ok") return false;
const t = Date.parse(entry.measuredAt);
return Number.isFinite(t) && t - nowMs <= QUOTA_CURRENT_FUTURE_SKEW_MS && nowMs - t <= QUOTA_CURRENT_FRESH_MS;

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 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 Exclude retained readings from fresh pool-wall decisions

When a provider fetch fails on the next 15-minute tick, markRetained() preserves the previous entry's state: "ok" and measuredAt while setting retainedFromFailedTick. That reading is still inside the 20-minute freshness bound, so this predicate accepts it and can publish its old 100% window as a current wall. By contrast, quota-current.ts explicitly classifies retained entries as stale immediately. If the quota has reset, the new feed incorrectly labels genuinely stalled sessions as walled, suppressing stall nudges. Reject entries with retainedFromFailedTick before applying the timestamp check.

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
Comment on lines +1019 to +1020
await writeAtomic(poolStatePath, JSON.stringify(projectPoolState(file), null, 2) + "\n").catch((err) =>
console.error(`quota-gatherer: pool-state write failed (${err}); babysitter pool state stays unread this tick`),

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 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 Expire published walls when the quota feed stops updating

After a successful tick publishes walled: true, a gatherer outage, early failTick() return, or subsequent write failure leaves that file in place indefinitely. babysitter.read_pool_state() ignores generatedAt and trusts the stored wall on every round, so the write failure does not make the state unread as this log claims. Once quota resets, genuinely stalled sessions can remain classified as walled indefinitely and never receive stall nudges. Add read-time expiry for the published snapshot, returning unknown/unread once its freshness bound is exceeded; checking freshness only during projection cannot protect against a stopped writer.

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/pool-state.ts
Comment on lines +73 to +75
const list = byProvider.get(entry.providerId) ?? [];
list.push(entry);
byProvider.set(entry.providerId, list);

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 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 configured OpenAI instance IDs in pool-state keys

For folded OpenAI quota results, entryFromResult() in quota-gather-map.ts preserves providerId: "_openai" but recovers the credential's actual instance ID into serviceId (_openai.main or _openai.alt). The configured openai-plan uses those two instance IDs (.opencode/opencode.jsonc:2635), and the babysitter looks up each session's exact model.providerID. Grouping solely by entry.providerId therefore publishes the OpenAI wall under the retired bare _openai key, so neither configured instance can read as walled and quota-blocked sessions can incorrectly receive stall nudges. Use the recovered instance ID for these folded OpenAI entries rather than collapsing them under _openai.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
This was referenced Nov 22, 2026
epic: fleet expansion & placement program (2026-10-28 directive, LIST 1–5) #2055
Closed
Shift batching, creator-style: lane handoff snapshots + supervision mode for queue lanes #2140
Closed
feat(keeper): binding-aware supervision for queue-spawned OpenCode sessions (OpenCode-half step 3) #1656
Closed
deploy: babysitter pool-state feed not live on the laptop (aggregator predates #12689, no POOL_STATE_PATH) #12718
Closed
investigate: OpenCode native scheduled tasks — creation, route choice, independence from Muse tokens #2019
Closed
pm-stack: pin POOL_STATE_PATH in the quota-gatherer unit (#12718) #12720
Merged
impl(quota-plane): stage-3 S1 — forecast product: per-tick quota-forecast from the analytics pace math #12695
Closed
feat(claimant): binding-aware intervention accounting in nudges (#1656 AC4) #12859
Merged
rollout(fleet): OpenCode-half pilot on the code queue + extension to opencode/openchamber/nix (OpenCode-half step 5) #1658
Open
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
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

@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:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Babysitter live: interval rounds over all OpenCode sessions with verdicts, quota, and pool attribution

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.