feat(proof): seed provider usage snapshot for proof runs - #336
Open
Finesssee wants to merge 1 commit into
Open
Conversation
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds the
CODEXBAR_SEED_USAGE_JSONproof-harness helper so CUA proof captures can drive deterministic tray/menu states without a live Codex account:proof_harness.rs: seed DTO mirroring the bridgeProviderUsageSnapshotJSON shape (camelCase), validation (codex-only, warn-and-skip on malformed files — proof runs never crash on the seed), and mapping into the bridge structs. Unit test covers a full seeded snapshot incl. extra rate windows.main.rs: seeds the snapshot into the provider cache before the event loop / first WebView read; the cache timestamp counts as fresh so the first refresh-if-stale call does not evict it.commands/providers.rs: while a seed is configured, the provider cache is pinned against automatic refresh eviction for the whole run (forced/manual refresh still overwrites).AGENTS.md/docs/WINDOWS_PROOF.md: document the variable next toCODEXBAR_PROOF_MODE.Commands run
cargo fmt --allcargo clippyboth manifests--all-targets -- -D warningscargo test --manifest-path rust/Cargo.toml --lib— 1227 passedcargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml— 343 passed (incl. new seed test)pnpm --dir apps/desktop-tauri test— 257 passedpnpm --dir apps/desktop-tauri run build— okTesting evidence / notes
codexbarlib test binary intermittently dies withSTATUS_ACCESS_VIOLATIONatproviders::sub2api::tests::usage_request_includes_days_and_timezone. Verified reproducible on cleanorigin/main(526ad1b) and passing in isolation / in module-group runs; treat a one-off crash there as a rerun.Context
Salvaged from an interrupted local session whose checkout was 67 commits behind
origin/main. The redundant parts of that session (Codex identity scoping, Claude limits[]-session preference) were discarded — already landed as #276 and #334. This seed feature was the only unique remaining piece; it unblocks deterministic CUA proof for the upcoming upstream 0.49.x–0.50.1 port waves.