Skip to content

Systematic code audit: 6 verified fixes (PRs), plus confirmed + candidate findings #912

Closed

Description

@ozymandiashh

Ran a systematic multi-agent audit of the codebase tonight and want to record the results so nothing is lost, and so the remaining real candidates get a second set of eyes.

Method

Every app source line was reviewed in overlapping chunks by a bug-hunting pass, then each finding went through: a skeptical verifier (refute-by-default, given the real code window), then a 2-lens adversarial pass (reproducibility + caller-contract, survive only if neither refutes), then my own manual verification with a mutation-checked test on anything I turned into a fix. Funnel: 553 raw -> 270 triaged -> 121 verify-confirmed -> 103 adversarial-unanimous survivors.

Key caveat for reviewers: the flash swarm kept known-false findings through all three automated stages (e.g. it insisted a SELECT DISTINCT ... ORDER BY <non-selected col> crashes SQLite - it does not; I confirmed empirically). Automated confirmation is NOT sufficient here; each survivor needs manual verification before it becomes a fix. That is exactly why the six fixes below each ship a mutation-checked test.

Fixed (PRs, each mutation-checked)

Confirmed real, not yet fixed

  • models.ts model-alias table: claude-4-sonnet-thinking aliases to claude-sonnet-4-5 (its non-thinking sibling maps to claude-sonnet-4). Zero money impact today because the two price identically, but it will misprice if they ever diverge. Worth a one-line correction.

Need a repro before I would touch them (plausible, subtle)

  • parser.ts ~3805: a provider-filtered cold run may set the whole-cache completeness marker with out-of-scope providers unscanned.
  • providers/antigravity.ts ~1098: the count-1 run skip interacting with the monotonic-delta snapshot logic.
  • 2 Swift money-path items in the menubar credential/cache path (I can't run the Swift suite here).

The full 103-survivor list with per-item verdicts is captured; happy to paste any slice. I did NOT open PRs for unverified survivors - the false-positive rate even post-adversarial was high enough that only manually-confirmed, test-backed fixes should land.

Activity

  1. avs-io commented on Aug 12, 2026

    @avs-io
    Collaborator

    I have a narrow, test-backed correction ready for the one confirmed unfixed alias item: map claude-4-sonnet-thinking to the Sonnet 4 family and pin the display identity independently of pricing (Sonnet 4 and 4.5 currently share rates). I opened this as a focused PR; it addresses this finding without closing the broader audit issue.

  2. earbona23 commented on Sep 1, 2026

    @earbona23
    Contributor

    Offering to take one of the three "need a repro before I would touch them" items — specifically:

    parser.ts ~3805: a provider-filtered cold run may set the whole-cache completeness marker with out-of-scope providers unscanned.

    Is that one unclaimed? I looked for an existing PR against it and did not find one, but I would rather ask than collide.

    Why this one: it is the same class as #874 and #899, one layer down. Those were a silent zero that lasted for a run; this one, if real, is a silent zero that gets written to disk and outlives the run — a cache stamped complete on the strength of a scan that never covered those providers, after which nothing re-derives them because the marker says there is nothing to do. The failure mode is not a wrong number, it is a wrong number that stops looking wrong.

    What I would deliver, and nothing more: a failing test that pins the behaviour, plus the verification that it is load-bearing — revert the condition, confirm the test dies, restore it, confirm it passes. No fix in the same change. Your own note on this issue is the reason:

    Automated confirmation is NOT sufficient here; each survivor needs manual verification before it becomes a fix.

    A repro that passes with and without the defect would just be another unverified survivor with a test file attached, so if I cannot make it die on demand I will report that instead — a refutation is a useful outcome for a candidate finding, and I would rather hand you that than a green test that proves nothing.

    Happy to work against main, keep it to one file, and open it as a draft if you prefer to see the repro before deciding whether the fix belongs in the same PR or a separate one.

    (Context, so you can weigh how much attention this needs from you: I do this shape of verification on my own tooling — the last one turned up a headline guarantee that had been passing on two empty sets for a while, because nothing in the fixture ever exercised it.)

  3. ozymandiashh commented on Sep 1, 2026

    @ozymandiashh
    CollaboratorAuthor

    Yes — this is unclaimed from my side. Please go ahead against current main. A narrow test-only draft that first proves or refutes the behavior is the right scope; no fix until the repro is mutation-sensitive. If it does not reproduce, reporting that here is equally useful. Thanks.

  4. added 2 commits that reference this issue on Sep 10, 2026
  5. added
    bug
    area: cli
    area: menubar
    help wanted
    on Sep 14, 2026
  6. added
    area: sync
    on Oct 1, 2026
  7. iamtoruk commented on Oct 7, 2026

    @iamtoruk
    Member

    All confirmed fixes from this audit are merged (#908 to #911, #982, #1229). The remaining candidates had no reproduction, so closing; open a new issue with a repro if one shows up. Thanks @ozymandiashh.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliarea: menubararea: syncbughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions