Skip to content

Enforce deterministic, warning-free builds#949

Open
robinebers wants to merge 3 commits into
mainfrom
codex/build-quality-gates
Open

Enforce deterministic, warning-free builds#949
robinebers wants to merge 3 commits into
mainfrom
codex/build-quality-gates

Conversation

@robinebers

@robinebers robinebers commented Jul 10, 2026

Copy link
Copy Markdown
Owner

TL;DR

Keep Swift builds warning-free and make local app launch verification deterministic. This compact replacement preserves the useful build-quality changes from #912 and #938 in three reviewable commits.

What was happening

  • SwiftPM builds emitted warnings without failing, allowing new warning debt to accumulate.
  • Pure rate-limit reset presentation logic lived inside a SwiftUI view, which made non-UI behavior actor-isolated and harder to test directly.
  • The build script requested process termination without waiting, then verified a replacement launch after one fixed sleep.
  • Process-name-only checks could mistake an unrelated executable named OpenUsage for the app.
  • Debugging docs overstated the isolation provided by the development bundle identifier.

What this changes

  • Treats warnings as errors for both the OpenUsage executable and test targets, and resolves the existing warning sites.
  • Moves reset timeline/count presentation into a 56-line Foundation model while leaving the SwiftUI view render-only.
  • Waits up to five seconds for existing OpenUsage.app processes to exit and polls the exact staged executable for up to five seconds.
  • Ignores unrelated same-name processes while still stopping installed and development app bundles.
  • Documents the warning policy, bounded lifecycle checks, process scope, and exact settings/credential isolation boundary.

Heads-up

Tests

  • bash -n script/build_and_run.sh
  • Focused reset and login-shell tests: 24 passed
  • swift test: 962 XCTest tests passed, 3 expected skips; 3 Swift Testing tests passed
  • Same-name regression: with two unrelated OpenUsage processes present, verify launched the exact staged app and build stopped only that app
  • ./script/build_and_run.sh verify: release build, staging, Apple Development signing, launch, and exact-process verification passed
  • codesign --verify --deep --strict dist/OpenUsage.app
  • git diff --check

Note

Low Risk
Mostly build hygiene, test refactors, and dev tooling; the presentation extraction is intended to be behavior-neutral for the Codex resets UI.

Overview
SwiftPM now treats warnings as errors for the app and test targets, with small fixes across providers (drop redundant await on synchronous ModelPricingStore.current()), Copilot date formatting (remove nonisolated(unsafe)), snapshot cache, and a concurrency-safe off-main-thread test.

Rate-limit reset popover logic moves from RateLimitResetsDetail into RateLimitResetsPresentation so timeline/count resolution stays testable without SwiftUI; the view only renders.

script/build_and_run.sh waits up to five seconds for prior OpenUsage app processes to exit, matches PIDs by staged bundle path (not name alone), and polls launch for verify. AGENTS.md and docs/debugging.md document the warning policy, lifecycle behavior, and that the dev bundle id isolates preferences while provider credentials stay shared.

Reviewed by Cursor Bugbot for commit ceb9b1d. Bugbot is set up for automated code reviews on this repo. Configure here.

@robinebers robinebers added the gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) label Jul 10, 2026 — with Cursor
@robinebers robinebers force-pushed the codex/build-quality-gates branch from fc6ee98 to ceb9b1d Compare July 10, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) provider tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant