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(usage-hub): GitHub billing collector on the unified usage endpoint (#1051) by dezren39 · Pull Request #2236 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 29, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

GitHub billing collector for the usage hub (#1051, GitHub half)

Queue task 2986 (resume of the 06:26Z park, whose design groundwork this PR executes). Triage task 2315 established the premise: the old per-product billing endpoints are gone (410), but the unified endpoint answers with the existing gh OAuth token.

What lands

  • scripts/collect-github-billing.ts — the daily collector: GET /users/{user}/settings/billing/usage?year&month via gh api, appends per-day §4 snapshot records to the writers' outbox (same drain path as append-usage-snapshots.ts). --print dry-runs; records carry their usage date so re-runs dedupe in the store.
  • src/sources/github-billing.ts — pure aggregation (group-by date): Actions minutes, Codespaces core-hours, storage GB-hours, gross/net USD, under service github with card metric ids where they exist (codespaces-hours).
  • Unit extension (design decision (a) from the park note): snapshot units gain minutes / hours / gb-hours (model.ts, snapshots.ts UNITS) and snapshot-records.ts UNIT_MAP gains minutes/hours — the GitHub card's minutes/hours metrics were previously skipped by the snapshot pipeline. gb-hours is deliberately its own unit: the endpoint bills storage in GB-hours, which is not GB, and silently storing it as gb (or minutes as count) would corrupt the series.

Verification

  • New tests (test/github-billing.test.ts, 5): aggregation, month totals, record shape/zero-skipping, store validation of the new units. All pass (laptop).
  • Full aggregator suite on the laptop: 346 pass / 1 fail — the one failure (actions.test.ts, attention badges) also fails on clean main (verified separately); pre-existing, unrelated.
  • Typecheck clean (laptop, worktree with node_modules linked from the primary).
  • Live endpoint (sandbox gh, 2026-10-29 ~10:40Z): 104 items for Oct 2026, Actions minutes 3,973 (accrual since the 3,629 @02:22Z triage read and 3,661 @07:10Z), net $0.00 — the collector's aggregates are checked against this read in the task completion.

Runtime home — one finding

The endpoint needs gh's user scope (404 without it). The sandbox gh has it; the laptop's gh does not (gist/read:org/repo/workflow), so the collector's daily run belongs in the sandbox-side writer context (like append-usage-snapshots under stewardship) until the laptop auth gains user interactively. Noted in the script header; the script's error message names the scope when gh fails.

Out of scope

The Vercel half of #1051 stays blocked on Drew connecting the Vercel connector; #1051 keeps user/escalated for that half. The October baseline entry is already recorded in provider-quota-registry.md (prior holder, verified).


View with [code]smith Autofix with [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.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dezren39
feat(usage-hub): GitHub billing collector on the unified usage endpoi…
b71ab82
…nt (#1051)

Daily collector for the usage hub (hub design §2.2/§5): scripts/collect-github-billing.ts reads GET /users/{user}/settings/billing/usage via the existing gh OAuth token (user scope; the old per-product billing endpoints are gone, 410) and appends per-day snapshot records to the writers outbox. Aggregation lives in src/sources/github-billing.ts (pure): Actions minutes, Codespaces core-hours, storage GB-hours, gross/net USD per day under service github.

Snapshot units extended with minutes/hours/gb-hours (model.ts, snapshots.ts UNITS) and snapshot-records UNIT_MAP gains minutes/hours, so the GitHub card minutes/hours metrics stop being skipped by the snapshot pipeline. GB-hours is deliberately its own unit: the endpoint bills storage in GB-hours, which is not GB.

Runtime home: a context whose gh carries the user scope (today the sandbox-side writer home, like append-usage-snapshots); the laptop gh lacks it and 404s — noted in the script header.
@dezren39
dezren39 requested a review from a team as a code owner October 29, 2026 10:36
@coderabbitai

coderabbitai Bot commented Oct 29, 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 34 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: d8038358-cede-4607-93b8-c2164c27fa2a
Commits

Reviewing files that changed from the base of the PR and between 24901e7 and c77b017.

Files selected for processing: 6
  • pm-stack/aggregator/scripts/collect-github-billing.ts
  • pm-stack/aggregator/src/model.ts
  • pm-stack/aggregator/src/snapshot-records.ts
  • pm-stack/aggregator/src/snapshots.ts
  • pm-stack/aggregator/src/sources/github-billing.ts
  • pm-stack/aggregator/test/github-billing.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

Comment @coderabbitai help to get the list of available commands.

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 Oct 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T12:25:12.686996Z c77b017 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.

@dezren39
fix(usage-hub): round the collector summary storage total
71ac816
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 29, 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: b71ab823c1

ℹ️ 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/sources/github-billing.ts Resolved

Uh oh!

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

Comment thread pm-stack/aggregator/src/sources/github-billing.ts Resolved

Uh oh!

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

@dezren39 dezren39 mentioned this pull request Oct 29, 2026
feat(usage-hub): v2 Vercel first read + GitHub billing collector (billing-scoped token) #1051
Closed
@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@github-actions github-actions Bot assigned dezren39 Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 29, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.

Uh oh!

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

@dezren39
fix(usage-hub): Codespaces core-hour multiplier + case-insensitive bi…
c77b017
…lling classification (Codex P2 x2 on #2236)
@dezren39
dezren39 enabled auto-merge October 29, 2026 12:28
This was referenced Oct 29, 2026
docs: document the merge-queue pilot in ci-policy #2255
Merged
mcpx: take the pool's session key from the request (_meta["ai.opencode/sessionID"]), not the daemon's pid #1932
Closed
ci: Actions check runs stuck in queued across PRs — no runner pickup since ~05:00Z 2026-10-28 #1599
Closed
@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@dezren39

dezren39 commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

Parked again — merge queue stalled repo-wide (queue task 2986, openchamber scheduled lane)

Head c77b0179, mergeStateStatus: CLEAN, Codex re-review clean, both P2 threads resolved, targeted tests 7/7 on the laptop. The PR has been at merge-queue position 3 since 12:35Z (AWAITING_CHECKS), and this is not specific to it: across the repo's last 30 workflow runs zero are in_progress, while merge_group nix ci runs for queue heads (2220, 2252, 2236, 2293, 2297, 2303) have sat queued 15+ minutes. GitHub PR-branch runs (e.g. 40868118355 for #1820) are likewise 23/28 jobs queued.

So the remaining step is purely runner availability. Resume: when PR 2236 shows MERGED, complete the queue task as fixed_merged for the GitHub half, strip queue/* and status/* from #1051, and leave the Vercel half on user/escalated (connector not_connected — Drew's action).

— repo-worker-code (openchamber scheduled lane), queue task 2986

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 29, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.

Uh oh!

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

@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 29, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.

Uh oh!

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

@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@dezren39 dezren39 mentioned this pull request Oct 29, 2026
id: investigate: Durable Object jurisdiction / data-location pinning for per-user stores #2061
Closed
3 tasks
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 29, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.

Uh oh!

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

@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 29, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.

Uh oh!

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

@dezren39 dezren39 mentioned this pull request Oct 29, 2026
id: pkgs/id/src/meta_client.rs is not rustfmt-clean on main — every PR inherits three failing fmt checks #2151
Closed
@dezren39
dezren39 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 69091a5 Oct 30, 2026
3 checks passed

Uh oh!

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

@dezren39
dezren39 deleted the queue/2986-1051-github-billing-collector branch October 30, 2026 01:00
@dezren39 dezren39 mentioned this pull request Oct 30, 2026
aggregator(github-billing): billing items never validated — an impossible date discards the whole month's collection, negative amounts are stored as usage #2493
Closed
5 tasks
This was referenced Nov 9, 2026
chore(nix): bump opencode pin to ff9858ae — codex sync instance-door fix (#7991) #8067
Merged
watchdog: reopen issues the bot wrongly closes on merges #10105
Closed
This was referenced Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
AUDIT-7 Lane 2 — Closed-Issues Review (past month, since 2026-10-23) #13878
Closed
Audit programme: seven-lane review of PRs, issues and designs (2026-11-23) #13871
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

@dezren39 dezren39

Labels

None yet

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.