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): v3 invoice reconciliation — Cloudflare Nov 2 first, monthly billed-vs-estimated · Issue #1056 · developing-today/code

feat(usage-hub): v3 invoice reconciliation — Cloudflare Nov 2 first, monthly billed-vs-estimated #1056

New issue
Copy link
New issue
Copy link
Closed
Closed
feat(usage-hub): v3 invoice reconciliation — Cloudflare Nov 2 first, monthly billed-vs-estimated#1056
Copy link
Assignees
dezren39
Labels
effort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)meta/follow-upFollow-up spun out of earlier workmode/onlineFully doable remotely: design, config, code, cloudstatus:done

Description

@dezren39
dezren39
opened on Oct 27, 2026
Issue body actions

Part of epic #1047. Hub design §5 v3.

Invoice reconciliation for the Usage & billing hub:

  • First target: the Cloudflare invoice landing Nov 2, 2026 — it is authoritative for the Oct 24-25 Workers AI / AI Gateway accrual, where the two estimates disagree ($29.60 budget-alert vs $45.10 gateway-attribution). Reconcile, record the settled figure in the snapshot store as source=invoice, and correct the PAYG card.
  • Meta PAYG: reconcile the Oct 19-25 accrual ($23.92 accrued / $23.91 collected, Visa ending 7535) the same way.
  • Generalize: a monthly "billed vs estimated" pass folded into stewardship — every PAYG line shows estimate vs invoiced with the variance, and estimates older than one invoice cycle are flagged.
    Acceptance: Nov 2 Cloudflare figure reconciled and visible on /quota; the monthly pass exists in the stewardship body/docs with the first run logged.

Activity

Next
  1. dezren39
    added
    meta/follow-upFollow-up spun out of earlier work
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-201

  3. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Oct 29, 2026
  5. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane D
    • Session / ID: queue task 2323
    • Found via: queue claim
    • Task: Triage issue feat(usage-hub): v3 invoice reconciliation — Cloudflare Nov 2 first, monthly billed-vs-estimated #1056 — verify no invoice reconciliation exists at current main (estimates still unresolved, no monthly billed-vs-estimated pass), then route as scoped follow-up or close with evidence
    • Expectation: s — triage verdict backed by code citation at HEAD
    • Links: n/a yet
  6. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane D
    • Session / ID: queue task 2323
    • Found via: queue claim
    • Task: Triage verdict for feat(usage-hub): v3 invoice reconciliation — Cloudflare Nov 2 first, monthly billed-vs-estimated #1056 — CONFIRMED at current main; first target is time-gated to Nov 2
    • Expectation: done — verdict below, follow-up routed with a Nov 2 gate

    Verdict: CONFIRMED — no invoice reconciliation exists at HEAD a3cdf6c9a35df1ff8b88b7a02d62e5c04ca4c94a. The two Cloudflare estimates still stand unresolved, no invoice-source record has ever been written, and stewardship has no billed-vs-estimated pass.

    Evidence (fresh reads of current main, not the issue text):

    • pm-stack/aggregator/src/saas-extract.ts, extractPaygLines: the Cloudflare AI Gateway line carries accruedUsd: null and an estimate pair (budget-alert vs gateway-attribution) with the note "Budget alert vs gateway cost attribution disagree — both shown; the Nov 2 invoice is authoritative", and unbilledUsd computed as the high estimate × 1.2. The function's own header comment: "the Cloudflare gateway accrual the two sources price differently — shown, not resolved."
    • The Meta PAYG line in the same function is an Oct 25 console read (accrued / collected, sourceClass: "console") — shown, but never settled as an invoice-class record.
    • pm-stack/aggregator/src/snapshots.ts already allows source: "invoice" in its SOURCES set — but a grep of the aggregator's writers (saas-extract.ts, snapshot-records.ts, quota-gather-map.ts) finds no writer that emits an invoice record and no reconciliation logic; render.ts mentions invoice only as a display label for the source class.
    • The stewardship skill (~/workspace/custom-skills/stewardship/SKILL.md, CHARTER.md) contains no invoice or billed-vs-estimated step at all — the monthly pass this issue asks to fold in does not exist.

    Routing: follow-up enqueued as queue task 2989 (small_fix, dedupe repo-health:v1:fix:developing-today/code:issue:1056, packet queue-packets/packet-1056-fix.json) with not_before 2026-11-02T12:00Z, because its first target — the Cloudflare invoice — does not exist before Nov 2. The packet pins: settled Cloudflare figure recorded with source: "invoice" and the PAYG card corrected to the invoiced figure with both estimates and the variance kept visible; the Meta Oct 19–25 line reconciled the same way; the monthly billed-vs-estimated pass written into the stewardship skill with a stale-estimate flag (period ended >1 invoice cycle ago, no invoice record) rendered on the card; read-only throughout — no payments, billing changes, or token creation (the #1048 billing-API 403 means the invoice document/console is the expected source, and the packet says so). This issue stays open and is labelled queue/queued for that task.

  7. dezren39
    added
    queue/queuedHas a queued queue task
    effort/mMedium: expected under 1 day of work
    mode/onlineFully doable remotely: design, config, code, cloud
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 29, 2026
  8. dezren39
    added a parent issue on Nov 1, 2026
    • epic(usage-hub): SaaS/cloud services completion — v2 live collectors, daily console reads, v3 reconciliation #1047
  9. 54 remaining items

  10. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 15, 2026
  11. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: picked-up
    task: 2989
    lane: any-a (repo-worker-code)
    Resuming from checkpoint implementation_complete / awaiting_ci: PR #10433 is open and MERGEABLE; its dispatched CI run 43683898187 has sat queued with no runner pickup since 2026-11-15T06:05Z. Codex gate already dispositioned on the PR (review failed on Codex usage limits, zero findings). This shift will disposition the 5 undispositioned CodeRabbit findings (4 minor in the new reconciliation code + 1 major: feed path in live.ts returns before settlement reconciliation), fix the valid ones in the worktree, re-run the aggregator targeted tests on the laptop, push, and then merge/close per the standing criteria.

  12. dezren39
    added 2 commits that reference this issue on Nov 15, 2026

    fix(usage-hub): disposition CodeRabbit findings on invoice reconcilia…

    249603e

    feat(usage-hub): invoice reconciliation render + stale-estimate flag (#…

    5b419f0
  13. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: done
    task: 2989
    lane: any-a (repo-worker-code)
    outcome: fixed_merged — PR #10433 MERGED (squash 5b419f0, 2026-11-15T07:27:54Z).

    What landed across the two shifts on this task: the Nov 2 Cloudflare invoice settled the Oct 24–25 gateway accrual at $46.86 (snapshot-store record, source: invoice); Meta PAYG Oct 19–25 reconciled (accrued $23.92 vs settled $23.91, variance −$0.01); the aggregator renders settled figures with both estimates + variance and flags stale estimates (>1 invoice cycle, unreconciled); the stewardship monthly billed-vs-estimated pass is documented (SKILL.md §B.7) with its first run logged in the stewardship cycle log (2026-11-15).

    This shift additionally dispositioned all 5 CodeRabbit findings on PR #10433 (commit 249603e, replied on each thread): settlement selection compares timestamps as instants; the Meta remainder is computed against the authoritative settlement; the gateway note derives the closer estimate from the actual variances; PaygLine.settledTs preserves the settlement instant through write-back; and the live.ts feed path now reconciles feed-built PAYG lines via applyPaygSettlements before attention flags are built. Codex gate was dispositioned earlier on the PR (review failed on Codex usage limits, zero findings).

    Verification: bun test test/usage.test.ts 64 pass / 0 fail (5 new tests); full aggregator suite 2499 pass / 20 fail / 1 error vs clean-main baseline 2493 / 21 / 1 (no new failures; failing names are the known pre-existing set in unrelated areas); bunx tsc --noEmit clean. The dispatched CI run 43683898187 sat queued with no runner pickup since 2026-11-15T06:05Z — laptop verification stands in per the packet's tests line. Read-only throughout: no payment, billing change, or token creation.

    Redeploy: the amd NixOS switch from the primary clone at the merge commit is IN FLIGHT on the laptop (detached; log /tmp/lane-any-a-20261115-0110/switch.log; generation was system-555 when last checked). First attempt hung childless for 17 min and was killed; the retry is progressing through cache fetches/build. Whoever reads this next: confirm readlink /nix/var/nix/profiles/system advanced past system-555-link and pm-aggregator.service restarted on the new closure; if the switch failed, re-run nixos-rebuild switch --flake ~/git/code#amd from the clean primary.

  14. dezren39
    closed this as completedon Nov 15, 2026
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 15, 2026
  16. developing-today
    added
    status:done
    on Nov 15, 2026
  17. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026 – with ChatGPT Codex Connector
    MemberAuthor
    More actions

    Read-only deployment verification: amd is on system generation 556 and pm-aggregator.service is active with a new start at 08:23:49 UTC. The deployed /api/quota.json gateway PAYG row now has the expected invoice settlement (settledUsd $46.86, settledSource invoice), a settlement timestamp, and the estimate. This confirms the deployed payload, not a separate visual-card test. No deployment or billing action taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

effort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)meta/follow-upFollow-up spun out of earlier workmode/onlineFully doable remotely: design, config, code, cloudstatus:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.