openai / gpt-6-luna / medium / medium effort preferred over openai / gpt-6-luna / none / none effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Source-backed audit of CodingUsage. The previous effort-comparison wave did not open the repository and produced no source-verified findings. The attached files are the evidence. Read them. Do not modify files. Do not repeat an evidence-limit disclaimer if the attached sources answer the question.
Answer with file and line citations from the attached sources:
1. Provenance. The menu bar is native Swift. helper/collector.mjs imports [REDACTED: home-relative path] and [REDACTED: home-relative path] and starts their refresh loops. Swift sets OpenCode 2 XDG dirs and does not call provider APIs. Separately verified outside this repo, do not re-derive if you cannot read those files: Claude fetches https://api.anthropic.com/api/oauth/usage; Codex fetches https://chatgpt.com/backend-api/wham/usage; Grok fetches https://cli-chat-proxy.grok.com/v1/billing using the xAI access token already in opencode.db and does not refresh it; Cursor uses Cursor dashboard APIs; OpenRouter fetches https://openrouter.ai/api/v1/credits using OPENROUTER_API_KEY from OpenCode service.json; DeepSeek fetches https://api.deepseek.com/user/balance. Say clearly whether displayed numbers are OpenCode's running process, native clients in this app, or plugin loops hosted by this app that call provider APIs with stored credentials.
2. Shareability verdict for another person. Cite concrete blockers in the attached files: all-or-nothing dynamic import, Node path list, ad-hoc codesign, personal bundle id, missing license, LaunchAgent installer, private plugin paths. Separate "another person who already has these exact local plugins" from "a general Mac app." Do not recommend vendoring secrets or private plugin source, and do not recommend this app refreshing tokens.
3. Security findings supported by the attached code only. Include stdout allowlisting, stderr discard, Codex refresh block, instance lock mode, and whether account labels can pass through. Flag only real issues.
4. Prioritized safe cleanup that stays in this repo, does not change the data source, and does not productize credential ownership. Rank by user impact. Call out whether a missing OpenRouter fetcher fails every provider. No rewrite.
Return a direct OpenCode-or-native answer, a shareability verdict, and a cleanup list another engineer could implement without a product decision.
openai / gpt-6-luna / medium / medium effort answer
## Provenance and where the numbers come from
**The menu bar and panel are a native Swift macOS app, but the usage data comes from plugin refresh loops hosted by this app—not OpenCode’s running process and not native provider clients.** Swift starts a Node helper, passes it OpenCode 2’s XDG/config directories, and decodes its JSON output; the Swift app itself does not call provider APIs in the supplied code (README.md:5, 14–18; Sources/CodingUsage/CodingUsageApp.swift:328–352, 421–438). The helper imports local plugin modules and starts their refresh loops on a 60-second interval (helper/collector.mjs:435–459, 480–529).
Per the stated external endpoint facts, those loops fetch Claude, Codex, Grok, Cursor, OpenRouter, and DeepSeek data from their respective provider APIs using stored credentials. The supplied code corroborates that the app reuses the installed plugins, OpenCode 2 directories, caches, and fetch locks rather than implementing its own OAuth client or writing `auth.json` (README.md:9–24). **In short: provider API data fetched by plugin loops hosted by this app.** Codex reset-credit detail is also fetched through the installed Codex OAuth client when the token is not expired (helper/collector.mjs:560–593).
## Shareability
- **For someone who already has these exact local plugins:** potentially usable as a personal tool, provided they have Node at one of the hard-coded paths and the expected OpenCode 2 directories. The helper depends on specific private plugin paths (helper/collector.mjs:7–14), and Swift checks only `/opt/homebrew/bin/node`, `/usr/local/bin/node`, and `/usr/bin/node` (Sources/CodingUsage/CodingUsageApp.swift:440–444). All modules are imported together; a missing module or required export makes loading fail as a whole (helper/collector.mjs:435–459, 480–490). The README explicitly describes the app as private and says those plugins must already be installed (README.md:3, 7–12).
- **For a general Mac app:** not ready to share as-is. It has private-plugin runtime dependencies and fixed local assumptions, an ad-hoc signature (`codesign --sign -`), a personal bundle identifier (`ai.utilityinsights.CodingUsage`), and a LaunchAgent installer targeting the installing user (scripts/build-app.sh:43–50; Support/Info.plist:9–10; scripts/install-login-item.sh:5–10, 27–70). The supplied README contains no license; absence in this packet does not establish the repository’s full licensing status. Do not solve portability by vendoring private plugin source or secrets, or by having this app refresh tokens.
## Security findings in the supplied code
- **Output filtering is a real safeguard, but not a full data-schema allowlist.** Stdout emits only JSON lines with recognized types and schema version, and snapshot lines are rejected if secret-like keys or values are found (helper/usage-helper.mjs:4–27, 30–44). However, accepted snapshot fields are otherwise not restricted to known usage fields; the helper’s own section mapper passes `accountLabel` through (helper/collector.mjs:95–107). This is not proof that a secret currently appears there, but it means the boundary relies on the heuristic secret detector rather than an explicit field allowlist.
- **Stderr is deliberately discarded** by the helper, and Swift drains but does not retain or display it (helper/usage-helper.mjs:45–49; Sources/CodingUsage/CodingUsageApp.swift:353–366). This reduces accidental log leakage but also hides diagnostics.
- **Codex refresh is blocked when a refresh could rotate a near-expiry token.** The helper stops the Codex loop and displays cached data (or an unavailable card) instead (helper/collector.mjs:470–477, 595–619; README.md:22–26). This is protective behavior, not a finding to remove.
- **Instance lock:** the app takes an exclusive, nonblocking `flock` on `instance.lock`, created with mode `0644` (Sources/CodingUsage/CodingUsageApp.swift:33–40). This coordinates concurrent launches; the supplied code does not show a credential stored in that file. The packet does not establish whether the containing directory’s permissions make the lock file accessible to other local users.
- **Account labels can pass through.** Claude and Codex labels are used directly as card titles (helper/collector.mjs:284–291, 359–366); the Swift model accepts `accountLabel` too (Sources/CodingUsage/UsageViews.swift:12–19), although the displayed card title comes from `title`. Codex credit expiry titles have length and `@` checks (helper/collector.mjs:304–317), but those checks do not sanitize account labels. No supplied evidence shows a label contains a credential; the concrete issue is that provider-supplied labels are not constrained at this boundary.
## Prioritized safe cleanup
1. **Make provider imports fault-isolated.** A missing OpenRouter fetcher does **not** merely fail OpenRouter: because it is included in the single `Promise.all` import and module validation, it currently causes `IMPORT_FAILED` before any refresh loops start, taking down every provider (helper/collector.mjs:435–459, 480–490). Isolate optional/provider-specific imports so unaffected providers can still report.
2. **Tighten the stdout schema.** Allow only explicitly expected snapshot and section/row fields and types, including a deliberate policy for `title` and account labels; retain the secret checks as defense in depth (helper/usage-helper.mjs:15–27; helper/collector.mjs:95–107, 284–291, 359–366).
3. **Make local prerequisites clearer and easier to diagnose.** Keep the data sources unchanged, but document/check the required Node locations and exact plugin paths before startup instead of presenting a general Mac app expectation (Sources/CodingUsage/CodingUsageApp.swift:332–335, 440–455; README.md:7–18).
4. **Clarify installation and distribution boundaries.** Label the build/signing and LaunchAgent installer as local personal-use tooling; do not change credential ownership or bundle private dependencies as a shortcut (scripts/build-app.sh:43–50; scripts/install-login-item.sh:5–10, 14–25, 27–70). A general distribution decision, including licensing, is outside a safe code-only cleanup.
**Confidence:** high for the runtime and failure-path conclusions from the supplied source; endpoint attribution relies on the external endpoint facts stated in the prompt. The packet does not include the plugin implementations, so their internal credential handling beyond those stated facts is not independently verifiable here.
openai / gpt-6-luna / none / none effort answer
## Direct answer
This is **a native Swift macOS menu-bar app that hosts Node plugin refresh loops**—not OpenCode’s running process and not a native provider client. Swift launches the helper with OpenCode 2 XDG directories and a fixed Node `PATH` (`Sources/CodingUsage/CodingUsageApp.swift:328–352`). The helper imports the listed installed plugins and starts their refresh loops (`helper/collector.mjs:7–14, 435–459, 493–529`). Swift does not call provider APIs in the supplied code; it receives JSON snapshots from the helper (`Sources/CodingUsage/CodingUsageApp.swift:353–358, 403–437`).
The separately supplied endpoint facts attribute provider calls to those plugin loops using stored credentials: Anthropic, Codex, Grok, Cursor, OpenRouter, and DeepSeek. The repo describes OpenRouter credentials as read by its installed V2 loop from OpenCode’s private service environment, and Grok’s already-refreshed OpenCode DB token as read without rotation (`README.md:20–24`). It also explicitly blocks the Codex refresh loop when a token might rotate (`README.md:24–26`; `helper/collector.mjs:470–477, 595–619`).
## Shareability verdict
- **For someone who already has these exact local plugins:** potentially usable, but tightly coupled to their paths, exports, behavior, and OpenCode 2 data layout. The imports are all-or-nothing: every module is loaded through one `Promise.all`, and import or required-export failure returns `IMPORT_FAILED` before loops start (`helper/collector.mjs:435–459, 480–491`). The Swift launcher only searches three hard-coded Node locations (`Sources/CodingUsage/CodingUsageApp.swift:440–444`) and supplies a fixed `PATH` (`:341–352`).
- **As a general Mac app:** not ready to share. It uses an ad-hoc signature (`scripts/build-app.sh:43–50`), a personal bundle identifier (`Support/Info.plist:9–10`), and a LaunchAgent installer that installs into the current user’s Applications and LaunchAgents directories (`scripts/install-login-item.sh:5–14, 27–70`). The README calls it private and documents the private plugin paths as runtime dependencies (`README.md:3, 7–18`). No license appears in the supplied scope.
- Do **not** vendor private plugin source or secrets, or make this app responsible for refreshing credentials. The current documented design avoids that (`README.md:20–26`).
## Security findings
- **Stdout allowlisting is present:** the helper forwards only accepted JSON lines; snapshots are rejected if the recursive secret-key or secret-pattern check matches (`helper/usage-helper.mjs:4–28, 30–44`). This is useful filtering, not a guarantee against every sensitive value or a substitute for reviewing plugin output.
- **Stderr is discarded by the helper**, and Swift drains its stderr pipe without logging it (`helper/usage-helper.mjs:45–49`; `Sources/CodingUsage/CodingUsageApp.swift:353–366`). This reduces accidental error disclosure but also hides diagnostics.
- **Codex refresh is guarded:** if account listing fails or a refresh-capable credential is near expiry, the Codex loop stops and cached data is shown as blocked (`helper/collector.mjs:470–477, 595–619`). The separate reset-detail fetch is attempted only with an access token and account ID and when the token is not expired (`:560–594`). The actual implementation of the imported fetcher is outside this packet, so its behavior cannot be verified here.
- **Instance lock permissions are broader than needed:** the lock file is created with mode `0644` (`Sources/CodingUsage/CodingUsageApp.swift:33–40`). This is a concrete least-privilege issue for a per-user lock file; prefer owner-only permissions.
- **Account labels can pass through.** Claude and Codex titles are taken directly from `account.label` when it is a nonempty string (`helper/collector.mjs:284–291, 359–366`), and the stdout filter does not redact arbitrary labels unless they match its limited secret checks (`helper/usage-helper.mjs:8–28`). Codex expiry titles are more constrained (`helper/collector.mjs:304–317`). This is a real privacy risk if labels contain personal or sensitive text.
## Prioritized safe cleanup
1. **Restrict instance-lock permissions** from `0644` to owner-only (`Sources/CodingUsage/CodingUsageApp.swift:33–40`).
2. **Sanitize account labels before emitting them**—or omit them—so provider-supplied labels cannot flow into snapshots and the UI (`helper/collector.mjs:284–291, 359–366`; `Sources/CodingUsage/UsageViews.swift:12–19, 181–190`).
3. **Improve safe diagnostics:** retain a bounded, redacted failure code or status for stderr/import failures rather than silently discarding all stderr (`helper/usage-helper.mjs:45–49`; `Sources/CodingUsage/CodingUsageApp.swift:364–366`). Do not log raw plugin errors.
4. **Make plugin dependency failures clearer and more isolated.** Today, a missing OpenRouter fetcher **fails every provider**: its import is inside the shared `Promise.all`, and `start()` returns on any import failure before starting any loop (`helper/collector.mjs:435–459, 480–491`). Handle/report that dependency explicitly while leaving the other loops running; do not change their data source.
5. **Clarify the sharing boundary in the README:** label the app as dependent on exact local plugins and Node paths, and distinguish personal ad-hoc/LaunchAgent installation from general distribution (`README.md:7–18`; `Sources/CodingUsage/CodingUsageApp.swift:440–444`; build and installer citations above). No rewrite or credential-ownership change is needed.
Primary judge's stated reason
A offers the slightly more defensible engineering order: restore unaffected providers before optional lock hardening, while avoiding an unsupported security-impact claim. This is a weak forced preference, not a proven material quality gap; an independent review could reasonably favor B's diagnostic detail.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 4ba7cb49-5416-45bf-8817-98135322db50. Pair: brp1_3eb67d0d1597794e3d0876c0220922e03ce77211772bb6453623e8a26858855f. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.