Skip to content

swift-logic table: rows for 38 false counts since 2b3d7cd2a848 (36 PLATFORM, 2 MIXED) - #34217

Merged
cmux-bot[bot] merged 2 commits into
feat-cmux-nextfrom
rewrite/swift-logic-false-counts-2
Nov 3, 2026
Merged

cmux-bot[bot] merged 2 commits into
feat-cmux-nextfrom
rewrite/swift-logic-false-counts-2

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The tip watcher's swift_logic_lines row is red (green reference 415,218 at 25c69ee; it stays the reference). After #33986 fixed the false counts up to 2b3d7cd, the count rose again. Both ends counted with the tip's table: 428,194 at 2b3d7cd and 434,349 at a25b4d9 (+6,155 of code; the lead's +2,563 is the net after #33986's -3,592).

A per-declaration diff of that range finds 38 declarations that the default rule counts in full (no row). 36 hold no product state and no product rule and get a PLATFORM row with a reason; the review found that 2 of them hold the Release favicon rule, so they get MIXED rows (below):

Every real rise stays counted, for example CloudTunnelController, GitHubAppLease, CloudStartRuns, CloudCodexBroker, ImportHistoryPageProvider, ChiefTeleportRunner, MemoryImportFlow and the Swift wg-quick parser (CloudTunnelConfiguration, CloudTunnelCIDR). REWRITE R-SWIFT-MIRRORS names the wave and the target date that move each one to Rust (its DESIGN.md section 11 and STATUS).

Testing

  • python3 -I scripts/cmux-next/swift-logic-lines.py --rev a25b4d999200 --json, with the base table and then with --table of this PR: swift_logic_lines 434,349 -> 432,321 (-2,028); mirror_lines 71,741 (no change).
  • The same at the PR base bc91cc5: 434,349 -> 432,321; table_rows_invalid 0; table_rows_missing 11 (the same 11 as the base).
  • At 2b3d7cd with this table: 428,194 (none of the 38 declarations exists there), so the range's code rise is +4,127 after this PR.
  • python3 -I scripts/cmux-next/tests/test_swift_logic_lines.py: 16 tests OK.
  • prepush-gate.py: no new violations.
  • Review: FIX at 83e1ea0 (comment): two favicon rows hid the Release favicon rule and its hand copy of the WCAG rule. Repaired in 697418f with the review's shares.

Observed / Not run

  • Observed: the counts above.
  • Not run: no build; this changes one data file that only the report script reads.

Changelog

none

Proof

No capture: a data file for a report script, no app change.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.



The per-declaration diff of swift_logic_lines between 2b3d7cd and
a25b4d9 (both counted with the tip's table) found 38 declarations that
the default rule counts in full but that hold no product state and no product
rule: DEV and NIGHTLY Debug playgrounds (Sidebar States, All Themes), a
#if DEBUG playground (Chief Teleport), the #if DEBUG || CMUX_BENCH_HOOKS frame
strip recorder, AppKit and Core Animation views and menus, favicon image
drawing, the NetworkExtension wrapper of the Cloud Tunnel, and the theme
contrast audit that only the playground and a test read. Each row says why.

Data only. swift_logic_lines at bc91cc5: 434,349 -> 432,245 (-2,104);
mirror_lines 71,741 (no change). Rows invalid 0, rows missing 11 (as before).
scripts/cmux-next/tests/test_swift_logic_lines.py: 16 tests OK.
@lawrencecchen lawrencecchen added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 697418f: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr34217 -f ref=rewrite/swift-logic-false-counts-2 -f platform=macos -f backend_mode=local

Shipped in:

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (claude-review-34217): FIX at 83e1ea0

36 of the 38 rows are correct. Two favicon rows hide the Release favicon rule, which also copies the shared contrast rule by hand.

Blocking: SidebarFaviconInk and SidebarFaviconStyle (swift-logic-classes.tsv:11959-11960)

The rule ships in every build. sidebar.faviconStyle is a Debug tunable, but Release and RC always draw its default (TunableStore.swift:5-14). That default is .adaptive (SidebarFaviconStyle.swift:12-14, 38-41). SidebarFaviconRenditions is "the one path every sidebar surface draws a page favicon through" (SidebarFaviconRenditions.swift:4-6, 50-52). Its callers are SidebarItemRowView.swift:70, SidebarIconView.swift:16 and WorkspaceTabHoverCardRow.swift:21. So treatment(for:ground:) (SidebarFaviconStyle.swift:43-63) is product behaviour for every user: a monochrome favicon under 3:1 on its ground draws as a template in the label colour. The title of 0806940 says this: "fix(sidebar): low-contrast monochrome favicons draw in the label colour". The reasons say "no product rule" and "(the Debug tunable: each case is a pixel treatment, not an app behaviour)". Neither is true for .adaptive.

It copies a rule that is already owned somewhere else. layer-ownership.md §1 item 4 says such a rule lives once and is never hand-copied.

  • SidebarFaviconInk.relativeLuminance and contrast(onGround:) (SidebarFaviconInk.swift:60-70) repeat Rust Rgb::relative_luminance and Rgb::contrast (cmux-tui/crates/cmux-theme-tokens/src/rgb.rs:55-67). Swift already has the same rule in ThemeRGB.relativeLuminance and contrast(with:) (Packages/Shared/CmuxTheme/Sources/CmuxTheme/ThemeRGB.swift:82-96).
  • SidebarFaviconStyle.minimumContrast = 3.0 (SidebarFaviconStyle.swift:44) repeats theme.constants.minimumMarkContrast (plans/cmux-next/spec-proposals/visuals/design-tokens.json:100). Rust has it as MINIMUM_MARK_CONTRAST (tokens.rs:208) and Swift as ThemeTokens.minimumMarkContrast.
  • The copy has already drifted. It linearizes at 0.03928 (SidebarFaviconInk.swift:68); Rust and ThemeRGB use 0.04045.
  • The monochrome test is a rule with thresholds, not a platform call: chroma 0.18, 6 % coloured share, 0.12 spread, 85 % one ink (SidebarFaviconInk.swift:15-26, 39-57).

The table counts this kind of code elsewhere. GhosttyThemeColors+Contrast.swift is LOGIC "Theme contrast math" (tsv:11405-11406). This PR also leaves the same-day 3:1 mark rule counted: StatusDotHue and ThemeTokens+StatusDotHue.swift from c0230ef. That rule even uses the shared ThemeTokens.minimumMarkContrast.

Classes to use:

  • SidebarFaviconInk: MIXED 85/0. Only the CoreGraphics bitmap read (SidebarFaviconInk.swift:30-38, 9 of 63 lines) is platform.
  • SidebarFaviconStyle: MIXED 40/0. The rule, its two constants (SidebarFaviconStyle.swift:43-63) and the .adaptive case are logic. The variant titles and the tunable descriptor (26-41) are Debug tooling.
  • Both reasons: say that the .adaptive default is the Release favicon rule and that it copies the WCAG rule and minimumMarkContrast.

With these two shares the head counts swift_logic_lines 432,321 (-2,028), not 432,245. Mirror stays 71,741, invalid 0 and missing 11. I ran the counter with an edited copy of the table.

Non-blocking

  • The other three favicon rows (SidebarFaviconRenditions, SidebarFaviconTreatment, SidebarFaviconDrawing) can stay PLATFORM. They are a bitmap cache and drawing values, like IconRasters (tsv:11898). Their reason should not say "Debug ... treatment", because this is the Release favicon path. Also, SidebarFaviconRenditions.groundLuminance (SidebarFaviconRenditions.swift:71-74) calls the copied formula.
  • PR body: two claims need the change above: "38 declarations ... hold no product state and no product rule" and "Image drawing: the five favicon types". I did not check the "REWRITE R-SWIFT-MIRRORS ... DESIGN.md section 11 and STATUS" reference, because it is not in this repository. The only path that names it is handoff/rewrites/R-SWIFT-MIRRORS/DESIGN.md, in cmux-tui/crates/cmux-view-rows/src/lib.rs:6, and there is no handoff/ folder at the head.

Checked and correct (the other 36 rows)

  • Keys: All 38 rows have 9 fields, module = the folder after Sources/, ordinal 0 and PLATFORM 0/0. Each one matches exactly one declaration that is unlisted at the base. The --sites unlisted diff from base to head removes these 38 and nothing else, and their spans add up to 2,104.
  • Sidebar States Playground (13 rows): debug.sidebarStatesPlayground is isDebugOnly (SettingsActionCatalog.swift:528-532). ActionRegistry.swift:395 and DevTools.swift make it DEV and NIGHTLY only. Only SidebarStatesPlaygroundAction.swift:20-26 binds it; all other callers are tests. The rows are fixture data, drawing and pixel measure, the same class as the Tab Bar Playground rows (tsv:11918).
  • All Themes Playground (4 rows): debug.allThemesPlayground is isDebugOnly (SettingsActionCatalog.swift:517-521). Only HomeDebugActions.swift:33 binds it. AllThemesPlaygroundModel holds a sorted, searched and filtered list, but only inside this DEV/NIGHTLY tool, like McpConnectPlaygroundModel (tsv:11907). "Demo variants" is not an exact reason for it, but the class is correct.
  • Theme audit (6 rows): The only callers are the playground and EveryThemeElementContrastTests (git grep). The audit uses the shared ThemeRGB.contrast(with:) and ThemeTokens.minimum*Contrast, so it copies no rule.
  • ChiefTeleportPlayground: The whole file is in #if DEBUG (lines 1-156), and the binding is in #if DEBUG too (HomeDebugActions.swift:37-53).
  • WindowFrame+ScreenCaptureKit (4 rows): #if DEBUG || CMUX_BENCH_HOOKS covers lines 1-269.
  • NativePopupContent+Keys and +Rail: 6f7f953 (feat(popup): the native popup draws the picker's four harness placements #32827) moved handleKey and enabledRows out of the PLATFORM class in NativePopupContent.swift. The rest is AppKit layout and key routing.
  • ChiefTeleportMenuBuilder, LiveTunnelManager, SidebarRevealFlash: ChiefTeleportMenuBuilder makes an NSMenu from the counted ChiefTeleportMenu rows. LiveTunnelManager only calls NETunnelProviderManager and NEVPNConnection. SidebarRevealFlash is a Motion-gated CALayer.
  • Hashes: Each cited hash is the commit that added its files (git log --diff-filter=A).

Counts I ran

All with python3 -I scripts/cmux-next/swift-logic-lines.py --json:

  • bc91cc5: 434,349 logic, 71,741 mirror.
  • 83e1ea0: 432,245 logic, 71,741 mirror. table_rows go from 11,936 to 11,974, invalid stays 0, and the same 11 rows are missing (the --missing diff is empty).
  • a25b4d9: 434,349 with its own table, 432,245 with this PR's --table.
  • 2b3d7cd: 428,194 with either table. Missing goes from 5 to 43 because none of the 38 declarations exist there.
  • 25c69ee: 415,218.
  • python3 -I scripts/cmux-next/tests/test_swift_logic_lines.py: 16 tests OK.

Not run: prepush-gate.py. No build, because this PR only changes a data file.

…IX on #34217)

Review comment 6614795877 at 83e1ea0: sidebar.faviconStyle is a Debug
tunable, but Release and RC always draw its default .adaptive, so
SidebarFaviconStyle.treatment and SidebarFaviconInk's monochrome test are the
Release favicon rule, and SidebarFaviconInk hand-copies the WCAG luminance and
contrast rule (Rust cmux-theme-tokens rgb.rs, Swift ThemeRGB; this copy uses
0.03928, the owners 0.04045). SidebarFaviconInk becomes MIXED 85/0 (only the
CoreGraphics bitmap read is platform), SidebarFaviconStyle MIXED 40/0 (the
rule, its constants and .adaptive are logic; the other cases, titles and the
tunable descriptor are Debug tooling). The three drawing rows stay PLATFORM
with reasons that say this is the Release drawing path.

swift_logic_lines at bc91cc5: 434,349 -> 432,321 (-2,028); mirror_lines
71,741 (no change); rows invalid 0, missing 11.
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (claude-review-34217): SHIP at 697418f

The repair fixes my FIX at 83e1ea0 (comment 6614795877).

Delta (git diff 83e1ea0d0cc 697418f040a)

One commit changes one file: the 5 favicon rows. No other row changed.

  • SidebarFaviconInk is now MIXED 85/0 and SidebarFaviconStyle is MIXED 40/0. Both shapes are valid. The keys and shares are the ones I proposed.
  • The new reasons are true, and the line ranges they name match the code:
    • SidebarFaviconInk.swift:15-26 and 39-57 are the thresholds and the monochrome test.
    • SidebarFaviconInk.swift:60-70 is the WCAG copy, and 30-38 is the bitmap read.
    • SidebarFaviconStyle.swift:43-63 is the rule and its constants.
  • The 0.03928 vs 0.04045 claim and the minimumMarkContrast / MINIMUM_MARK_CONTRAST claim match rgb.rs:55-67, ThemeRGB.swift:82-96, tokens.rs:208 and design-tokens.json:100.
  • SidebarFaviconRenditions, SidebarFaviconTreatment and SidebarFaviconDrawing stay PLATFORM. Their reasons now say they are the Release drawing path. It is true that groundLuminance calls the copy (SidebarFaviconRenditions.swift:71-74).

Counts I ran

All with python3 -I scripts/cmux-next/swift-logic-lines.py --json:

  • 697418f: swift_logic_lines 432,321 and mirror_lines 71,741. table_rows 11,974, invalid 0, and the same 11 missing rows as the base.
    • --sites: SidebarFaviconInk 54 of 63 lines (MIXED 85%), SidebarFaviconStyle 22 of 56 lines (MIXED 40%).
  • bc91cc5: 434,349, so the PR lowers the count by 2,028.
  • a25b4d9 with this table: 432,321.
  • 2b3d7cd with this table: 428,194 (missing 43), so the range rises by 4,127.
  • python3 -I scripts/cmux-next/tests/test_swift_logic_lines.py: 16 tests OK.

The PR body's summary, its favicon item and its Testing numbers are correct.

Non-blocking

  • The PR title still says "38 PLATFORM rows", but there are now 36 PLATFORM rows and 2 MIXED rows. The squash commit takes the title, so change the title before it lands. A title edit does not change the head.
  • I still did not check the "REWRITE R-SWIFT-MIRRORS ... DESIGN.md section 11 and STATUS" reference, because that file is not in this repository.

Not run: prepush-gate.py. No build.

@lawrencecchen lawrencecchen changed the title swift-logic table: 38 PLATFORM rows for false counts since 2b3d7cd2a848 swift-logic table: rows for 38 false counts since 2b3d7cd2a848 (36 PLATFORM, 2 MIXED) Nov 3, 2026
@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 3, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs
test_the_attestation_reserves_budget_and_its_retry_shares_the_ledger (main.Workflow
Tests.test_the_attestation_reserves_budget_and_its_retry_shares_the_ledger)/
test_the_attestation_reserves_budget_and_its_retry_shares_the_ledger (main.Workflow
Tests.test_the_attestation_reserves_budget_and_its_retry_shares_the_ledger)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Non-green checks on head 697418f, classified (this PR changes only plans/cmux-next/swift-logic-classes.tsv):

No check is red because of this PR.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Two more non-green checks on head 697418f, classified:

  • plan (backend-migrations): infrastructure. The job was cancelled at its 10-minute limit in the step "Changed files and head migrations" (20:49:22Z to 20:56:17Z, "The operation was canceled", orphan git-remote-https processes at shutdown). This PR changes no file under backend/. Rerun on the same SHA (run 41715007527, attempt 2).
  • backend migrations applied: wrapper of plan ("migration plan cancelled").

@cmux-bot
cmux-bot Bot merged commit 0ead152 into feat-cmux-next Nov 3, 2026
179 of 202 checks passed
@cmux-bot
cmux-bot Bot deleted the rewrite/swift-logic-false-counts-2 branch November 3, 2026 21:23

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 697418f0 Deployed Nov 3, 2026 by lawrencecchen via cmux-tui tree preflight #107588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:low Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant