Skip to content

fix(share): preserve complete provider model history - #3817

Open
steipete wants to merge 1 commit into
mainfrom
triage/20260921-shared-usage-card
Open

steipete wants to merge 1 commit into
mainfrom
triage/20260921-shared-usage-card

Conversation

@steipete

Copy link
Copy Markdown
Owner

One unpriced or incomplete USD provider could erase every provider's model breakdown from a shared usage snapshot. The builder now uses the dashboard's existing per-provider completeness metadata, retains complete providers' families, and labels omitted history PARTIAL on the image and Top models (partial) in copied text. Complete rankings keep BY USAGE.

Day-scoped models stay out of full-window rankings; only proven-zero totals qualify for the idle exception. Checked family aggregation replaces the private accumulator while preserving missing costs and overflow behavior. Production code decreases by 24 lines.

This is a credited rewrite of @Chipagosfinest's partial-card presentation from #3747, including the incomplete-request case that its currency-wide filter still excluded.

Validation

CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 CODEXBAR_SHARE_STATS_SCREENSHOT_DIR="$PWD/.build/share-proof-after" swift test --jobs 2 --filter 'ShareStats|ProviderArchitectureGatekeeperTests'

Result: 69 tests in 4 suites passed, zero failures.

make check

Result: passed; SwiftLint reported 0 violations in 2511 files. An initial run hit a process-cleanup fixture timeout under shared-host load; subsequent complete checks passed.

The original builder produced 22 failed regression assertions. Additional selected-day regressions reproduced 2 failures for an empty selected day and 6 for unavailable full-window totals before correction; all now pass. Coverage includes the three-provider USD group, complete rankings, copied text, multiple accounts, explicit zero totals, missing costs, and token/cost overflow. Final independent review found no actionable P0–P2 issues.

Synthetic before / after

Rendered through the production builder and PNG renderer, with the same three USD providers and unpriced Antigravity history. Both complete captures were inspected; they contain synthetic aggregate data only.

Before After
Before: healthy models disappear After: complete providers retained with PARTIAL

Fixes #3714
Closes #3747

Filter shared model rankings by provider and label omitted history as partial.
Keep day-scoped models out of full-window rankings, preserving unknown totals.
Reuse checked aggregation without changing missing-cost or overflow behavior.

Fixes #3714
Closes #3747

Co-authored-by: Alec Gutman <44984861+Chipagosfinest@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 3:37 AM ET / 07:37 UTC.

ClawSweeper review

What this changes

Shared usage cards and copied statistics retain complete providers’ model families, label incomplete rankings, and exclude day-scoped models from full-window summaries.

Merge readiness

Ready for maintainer review

Keep open: this remains useful work, and no actionable patch defect was found. The owner-authored proposal explicitly revises the earlier all-or-nothing sharing policy while preserving conservative provider eligibility.

Priority: P2
Reviewed head: a67c1e6bba942528fbd254166981ef0cbf6cb20f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with useful regression coverage and directly inspected visual evidence; no blocking defect was found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The ordinary contributor proof gate does not apply to this OWNER-authored PR. Inspected synthetic before/after images corroborate the production builder and native PNG renderer’s retained-model and PARTIAL presentation; live-account collection is not demonstrated.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor proof gate does not apply to this OWNER-authored PR. Inspected synthetic before/after images corroborate the production builder and native PNG renderer’s retained-model and PARTIAL presentation; live-account collection is not demonstrated.
Evidence reviewed 9 items Introduced change inspected: The pinned merge-base-to-head diff changes seven files: two production sharing files, three test files, the changelog, and UI documentation. Provider filtering, partial presentation, selected-day exclusion, and aggregation replacement were inspected.
Current main still suppresses whole groups: Fetched main still requires complete currency-group model history and zero incomplete requests before collecting any models. The requested provider-specific sharing behavior is therefore not already implemented.
Latest release retains the old behavior: The supplied latest release, v0.63.0, contains the same currency-wide exclusion.
Findings None None.
Security None None.

How this fits together

CodexBar’s sharing subsystem converts Usage & Spend dashboard aggregates into local images and copied text. Provider completeness and reporting-window metadata determine which model families appear.

flowchart LR
 A[Provider usage history] --> B[Usage and Spend dashboard]
 B --> C[Provider completeness checks]
 C --> D[Full reporting window check]
 D --> E[Sanitized model families]
 E --> F[Shared image]
 E --> G[Copied statistics]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test LOC Production −24 net lines; tests +223 net lines The patch replaces a private accumulator with existing checked aggregation while expanding completeness regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #3714
Summary: This PR is a candidate implementation for the reported currency-wide suppression and incorporates the related partial-card proposal.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep complete-provider model families shareable with explicit partial coverage, unchanged privacy sanitization, and consistent reporting-window semantics.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes that one incomplete provider suppresses healthy model rows in the same currency group on current main. No runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes: reusing provider completeness metadata is a narrow solution, and explicit partial labeling preserves honest ranking semantics under the owner’s revised sharing policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6f59667e12c2.

Labels

Label changes:

  • add P2: This improves shared model summaries with limited scope; provider totals and the dashboard remain available.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary contributor proof gate does not apply to this OWNER-authored PR. Inspected synthetic before/after images corroborate the production builder and native PNG renderer’s retained-model and PARTIAL presentation; live-account collection is not demonstrated.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor proof gate does not apply to this OWNER-authored PR. Inspected synthetic before/after images corroborate the production builder and native PNG renderer’s retained-model and PARTIAL presentation; live-account collection is not demonstrated.

Label justifications:

  • P2: This improves shared model summaries with limited scope; provider totals and the dashboard remain available.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor proof gate does not apply to this OWNER-authored PR. Inspected synthetic before/after images corroborate the production builder and native PNG renderer’s retained-model and PARTIAL presentation; live-account collection is not demonstrated.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary contributor proof gate does not apply to this OWNER-authored PR. Inspected synthetic before/after images corroborate the production builder and native PNG renderer’s retained-model and PARTIAL presentation; live-account collection is not demonstrated.

Evidence

What I checked:

  • Introduced change inspected: The pinned merge-base-to-head diff changes seven files: two production sharing files, three test files, the changelog, and UI documentation. Provider filtering, partial presentation, selected-day exclusion, and aggregation replacement were inspected. (Sources/CodexBar/ShareStatsPayload.swift:232, a67c1e6bba94)
  • Current main still suppresses whole groups: Fetched main still requires complete currency-group model history and zero incomplete requests before collecting any models. The requested provider-specific sharing behavior is therefore not already implemented. (Sources/CodexBar/ShareStatsPayload.swift:279, 6f59667e12c2)
  • Latest release retains the old behavior: The supplied latest release, v0.63.0, contains the same currency-wide exclusion. (Sources/CodexBar/ShareStatsPayload.swift:279, f3e718c897d5)
  • Existing completeness owner reused: Dashboard construction already records incomplete providers across their input summaries. The sharing builder consumes that set, adds providers with incomplete requests, and rejects selected-day rows because provider totals cover the whole reporting window. (Sources/CodexBar/SpendDashboardModel.swift:526, a67c1e6bba94)
  • Prior policy and current owner direction: GitHub confirms that Fix partial model history aggregation #2308 merged with an explicit policy excluding partial shared rankings. This PR’s captured OWNER-authored body deliberately replaces that policy with complete-provider subsets, PARTIAL labeling, and nonnumeric markers; another product-approval request is unnecessary. (bddbc9aff14e)
  • Prepared before/after images inspected: Inspected both downloaded attachments from the captured PR body, sourceRevision 7b5013b02a654a5e1405b8eaa341d5c533a05b43a3f4fe6963f2a9b79076242f. The before image has no model rows; the after image retains GPT/Codex and Claude with PARTIAL and dot markers. The body identifies synthetic aggregates rendered through the production builder and PNG renderer; these images do not establish live-account collection. (Tests/CodexBarTests/ShareStatsCompletenessTests.swift:23, a67c1e6bba94)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Chipagosfinest: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

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

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared usage cards: one incomplete request erases the model breakdown for every provider in the currency group

1 participant