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): add cny snapshot unit end-to-end + DeepSeek balance (#1052) by dezren39 · Pull Request #2370 · 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

Closes #1052 (with queue task 2987).

What

The snapshot store could not represent CNY anywhere on the writer→render path, so the DeepSeek PAYG reserve's balance had no history and no card value, and the v1 backfill skipped it rather than record yuan as USD.

  • Unit — cny is a first-class snapshot unit: SnapshotRecord.unit (src/model.ts), the store's UNITS validation set (src/snapshots.ts), UsageUnit and the extractor's UNIT_MAP (src/snapshot-records.ts). No currency field, no FX rate, no conversion anywhere.
  • Writer — recordsFromEntries (src/quota-gather-map.ts) emits a unit:'cny' record when a label-only window's label carries a ¥ balance (the DeepSeek provider answers credits_balance: { usedPercent: null, valueLabel: '¥44.29' }), with the same value-moved dedupe as pct windows. USD-labelled balances still yield no record.
  • Backfill — recordsFromDeepseekBalance derives the dated read from the quota-view DeepSeek section; the backfill script now appends it at its original date. The script's own line is ¥44.63 on 2026-10-25, so that is the value and date recorded; the issue's 2026-10-24 CNY 44.64 read is a different observation with no dated source line in the repo, and no record is invented for it.
  • Render — the PAYG card shows the newest cny record as ¥44.63 with its measured-at and source; fmtMetricValue renders yuan.

Tests

bun test in pm-stack/aggregator: 349 pass, 1 fail — the failure is test/actions.test.ts "pending + applied states render as badges; applied snooze lands in the Snoozed strip", reproduced identically on clean origin/main (pre-existing, unrelated to this diff). bunx tsc --noEmit clean.

New coverage: cny round-trip (validate → append → read), moved-vs-unmoved dedupe for the balance label, the backfill derivation (dated ¥ → cny at that date), the no-date/no-¥/no-section fail-soft cases, PAYG card rendering, and a guard that no DeepSeek record is stored with unit usd.


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): add cny snapshot unit end-to-end + DeepSeek balance (#…
b68ba88
…1052)

The snapshot store's unit enum had no CNY, so a yuan balance could not be
recorded at all: validation rejected it, the gatherer emitted nothing for
it, and the backfill skipped it rather than corrupt history by calling it
USD. 'cny' is now a first-class unit beside 'usd':

- model.ts: SnapshotRecord.unit admits 'cny'; UsageUnit too, so the
  extractor mapping can carry it (no currency field, no FX rate).
- snapshots.ts: the store's UNITS set accepts a cny record.
- snapshot-records.ts: UNIT_MAP maps cny; recordsFromDeepseekBalance holds
  the documented dated read (¥44.63, 2026-10-25 — the value on this
  script's own note; the issue's earlier 2026-10-24 CNY 44.64 read is a
  different observation with no dated source here, so none is invented).
- quota-gather-map.ts: recordsFromEntries turns a label-only window whose
  label carries ¥ into a cny record with the same value-moved dedupe as
  pct windows; USD-labelled balances still yield no record.
- render.ts: fmtMetricValue renders yuan; the PAYG card shows the newest
  DeepSeek cny record in ¥ with its own measured-at.
- tests: cny round-trip through the store, moved-vs-unmoved dedupe, the
  backfill derivation, PAYG card rendering, and a guard that no DeepSeek
  record is stored as usd.

Refs #1052
@dezren39
dezren39 requested a review from a team as a code owner October 29, 2026 15:46
@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 22 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: 22462cd9-fbc0-4033-ac94-64f659706f14
Commits

Reviewing files that changed from the base of the PR and between 6add000 and 9a96ac8.

Files selected for processing: 9
  • pm-stack/aggregator/scripts/backfill-usage-snapshots.ts
  • pm-stack/aggregator/src/model.ts
  • pm-stack/aggregator/src/quota-gather-map.ts
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/src/snapshot-records.ts
  • pm-stack/aggregator/src/snapshots.ts
  • pm-stack/aggregator/test/quota-gather-map.test.ts
  • pm-stack/aggregator/test/snapshot-writers.test.ts
  • pm-stack/aggregator/test/usage.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-30T05:20:40.234364Z 9a96ac8 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 dezren39 mentioned this pull request Oct 29, 2026
feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052
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 a conflict with the base branch Oct 29, 2026
@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Oct 29, 2026
@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@dezren39 dezren39 added queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition and removed queue/claimed Queue worker lifecycle state labels Oct 29, 2026
@dezren39

dezren39 commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · picked up (resume)

  • Agent: openchamber scheduled lane (queue worker repo-worker-code)
  • Session / ID: queue task 2987 (small_fix) — attempt 1, resumed from checkpoint stage awaiting_ci
  • Found via: queue claim
  • Task: CNY snapshot unit end-to-end + DeepSeek balance record/render for feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052 — this PR is the implementation; the remaining step is landing it.
  • Revalidated at 17:45Z: PR OPEN, CLEAN/MERGEABLE, head b68ba887, required check basic: proxy port fallbacks SUCCESS, no review findings; Codex round on b68ba887 still running since 15:46Z with no inline findings.
  • Expectation: s — done = merged with checks green, then task completes fixed_merged.
  • Links: feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370 · feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052
All reactions

Sorry, something went wrong.

Uh oh!

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

@dezren39

dezren39 commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked

  • Agent: openchamber scheduled lane (queue worker repo-worker-code)
  • Session / ID: queue task 2987 (small_fix) — parked 20 min
  • Reason: merge queue repo-wide stall (ci: Actions check runs stuck in queued across PRs — no runner pickup since ~05:00Z 2026-10-28 #1599). This PR is at merge-queue position 8 UNMERGEABLE while the PR itself is CLEAN/MERGEABLE with every required check green on b68ba887; the six entries ahead are all AWAITING_CHECKS and no merge has landed since ~10:57Z. Nothing in this diff is at fault, and re-enqueueing earlier did not move it (it was QUEUED at pos 8, now flagged UNMERGEABLE without a code change).
  • State of the work: implementation complete and pushed (queue/2987-1052-cny-snapshot-unit, b68ba887), targeted tests verified (349 pass, 1 pre-existing actions.test.ts failure reproduced on clean origin/main), tsc --noEmit clean.
  • Resume condition: if this PR shows MERGED, task 2987 completes fixed_merged with the merge SHA and labels come off feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052. If it is still UNMERGEABLE, enqueue once more as soon as the queue group produces a merge for the entries ahead.
  • Links: feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370 · feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052
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 a conflict with the base branch Oct 29, 2026
@dezren39

dezren39 commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · picked up

  • Agent: queue worker (repo-worker-code), Lane A shift
  • Session / ID: queue task 2987, shift 2026-10-29 13:04 CDT
  • Found via: queue claim (resume from awaiting_ci checkpoint)
  • Task: Resume PR feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370 merge for the CNY snapshot unit work; verify fresh state, disposition Codex (zero findings posted; review stuck running since 15:46Z), merge when criteria met or park again with reason.
  • Expectation: s — done = PR merged, task completes fixed_merged, labels stripped.
  • Links: feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370 · branch queue/2987-1052-cny-snapshot-unit
All reactions

Sorry, something went wrong.

Uh oh!

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

@dezren39 dezren39 added queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state and removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) labels Oct 29, 2026
@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
@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 commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked

  • Agent: queue worker (repo-worker-code), Lane A shift
  • Session / ID: queue task 2987, shift 2026-10-29 13:04 CDT — parked 20 min
  • Reason: merge queue repo-wide stall (ci: Actions check runs stuck in queued across PRs — no runner pickup since ~05:00Z 2026-10-28 #1599) re-confirmed with fresh evidence this shift. PR feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370 was enqueued twice: (1) pos 2 QUEUED → AWAITING_CHECKS, ejected by github-merge-queue[bot] at 18:09:49Z while its merge-group run 40927976402 later completed SUCCESS; (2) pos 1 QUEUED → AWAITING_CHECKS, its merge-group run 40929005698 completed SUCCESS at ~18:19:51Z, yet the PR was ejected again unmerged. Main is still 5a34fa7 — no merge has landed since 10:57Z despite multiple successful merge-group runs across PRs. Nothing in this diff is at fault.
  • State of the work: implementation complete and verified (branch queue/2987-1052-cny-snapshot-unit, head b68ba88; PR checks SUCCESS; tests per PR body 349 pass / 1 pre-existing failure reproduced on clean main; Codex round has posted zero findings — review stuck running since 15:46Z, no findings to disposition).
  • Resume condition: when the merge queue produces any merge on main (head moves past 5a34fa7), re-enqueue PR feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370; when it shows MERGED, complete task 2987 as fixed_merged with the merge SHA and strip the transient labels on feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052.
  • Links: feat(usage-hub): add cny snapshot unit end-to-end + DeepSeek balance (#1052) #2370 · feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052 · stall issue ci: Actions check runs stuck in queued across PRs — no runner pickup since ~05:00Z 2026-10-28 #1599
All reactions

Sorry, something went wrong.

Uh oh!

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

@dezren39 dezren39 added queue/parked Queue task is parked (waiting on CI, time, or an event) and removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Oct 29, 2026
@dezren39 dezren39 added the status/parked Deliberately paused with a recorded resume condition label Oct 29, 2026
@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@dezren39 dezren39 mentioned this pull request Oct 29, 2026
ci: Actions check runs stuck in queued across PRs — no runner pickup since ~05:00Z 2026-10-28 #1599
Closed
@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
@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
ci: merge queue ejects every PR — no merge since #2233 (10:57Z), entries dropped 2-6 min into AWAITING_CHECKS #2403
Closed
@dezren39
dezren39 added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 30, 2026
@dezren39
Merge remote-tracking branch 'origin/main' into queue/2987-1052-cny-s…
9a96ac8
…napshot-unit

# Conflicts:
#	pm-stack/aggregator/src/model.ts
#	pm-stack/aggregator/src/quota-gather-map.ts
#	pm-stack/aggregator/src/snapshots.ts
#	pm-stack/aggregator/test/quota-gather-map.test.ts
@dezren39
dezren39 merged commit b4b2f49 into main Oct 30, 2026
3 checks passed

Uh oh!

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

@dezren39
dezren39 deleted the queue/2987-1052-cny-snapshot-unit branch October 30, 2026 05:19
@dezren39 dezren39 mentioned this pull request Nov 1, 2026
aggregator(quota-extract): ClinePass extractor's measured-date anchor is never validated — an impossible measured date or a huge 'resets in' offset silently discards the pool's whole read, and a Feb-30 anchor rolls into March #2383
Closed
3 tasks
This was referenced Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
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

No reviews

Uh oh!

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

Assignees

@dezren39 dezren39

Labels

queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition work/assigned Queue worker lifecycle state

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store

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.