Skip to content

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

Open

Description

@dezren39

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

  1. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    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.

  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    effort/mMedium: expected under 1 day of work
    mode/onlineFully doable remotely: design, config, code, cloud
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 29, 2026
  5. 21 remaining items

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Parked: OpenChamber scheduled lane parked task 2989 for 30 minutes — invoice gate still closed.

  7. added
    queue/claimedQueue 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 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    user/escalatedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Escalated to Drew — task 2989 blocked (escalated-to-user).

    • Agent: repo-worker-code (OpenChamber scheduled lane); OpenCode session ses_e5e634c10e8ffeUqtVDNsozNcl
    • Fresh state: feat(usage-hub): v3 invoice reconciliation — Cloudflare Nov 2 first, monthly billed-vs-estimated #1056 remains OPEN, has no hard-stop labels, and no matching PR was found. The laptop snapshot store has no invoice record. feat(usage-hub): v2 Cloudflare live collector — hourly analytics feed + billing scope #1048 documents that the billing API route is 403 and billing is invoice-only.
    • Access needed: Please provide the authoritative Cloudflare invoice document or settled Oct 24–25 Workers AI / AI Gateway amount from the Cloudflare console. This lane has no console access, so the Cloudflare-first implementation cannot safely record an invented figure. No worktree or code changes were made.
    • Resume condition: authoritative invoice evidence is available; then resume task 2989 and implement the pinned shape (Cloudflare + Meta reconciliation, variance/stale-estimate card behavior, stewardship pass).
    • Queue: task 2989 blocked as escalated-to-user; labels are user/escalated, queue/blocked, status/blocked.}
  11. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · escalated

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

Metadata

Metadata

Assignees

Labels

effort/mMedium: expected under 1 day of workmeta/follow-upFollow-up spun out of earlier workmode/onlineFully doable remotely: design, config, code, cloudqueue/blockedQueue or user escalation statequeue/queuedHas a queued task in the Supabase agent queuestatus/blockedQueue or user escalation stateuser/escalatedQueue or user escalation state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions