Skip to content

ci(test_reds): a Swift Testing line after a zero-width space still counts - #35609

Merged
austinywang merged 1 commit into
mainfrom
test-reds-zero-width
Nov 4, 2026
Merged

austinywang merged 1 commit into
mainfrom
test-reds-zero-width

Conversation

@austinywang

@austinywang austinywang commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

gh-merge-green refused #35296 even though its only reds also fail on main. The refusal said: 'macos / app-host unit tests (2/7)': 1 suite(s) started and never finished: "Cloud sidebar recorded interaction" (a crash or a cut-short run is never a base red).

That suite passed. Swift Testing printed its end line with a leading zero-width space (U+200B) right after interleaved app logs: ​✔ Suite "Cloud sidebar recorded interaction" passed after 0.001 seconds. (https://github.com/manaflow-ai/cmux/actions/runs/41848241642/job/126642789599, line 7772). SUITE_STARTED and SUITE_ENDED are anchored with ^, so the end line never matched.

lines_of now strips a leading U+200B, which fixes every anchored pattern at once. The unanchored ones were already immune.

Testing

  • python3 -m unittest tests.test_test_reds: 33 OK. The new test checks that a suite end after U+200B counts as whole, and that a suite which really never finished still reports as cut short.
  • Replayed the real shard-2 log through test_reds.read: truncated is now [].

🤖 Generated with Claude Code


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


Summary by cubic

Fixes test_reds so Swift Testing event lines prefixed with a zero-width space (U+200B) are still recognized. Previously the anchored suite patterns missed those lines, so gh-merge-green called a passing suite "never finished" and refused to excuse a base red.

  • lines_of strips a leading U+200B, fixing every anchored pattern at once.
  • Adds tests for a suite end after U+200B and for a suite that genuinely never finishes.

Written for commit bdf3de6. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Bug Fixes
    • Improved recognition of Swift Testing suite events that begin with an invisible character, helping completed and unfinished suites be reported correctly.

…unts

Swift Testing sometimes prints U+200B before an event line that follows
interleaved app output. SUITE_STARTED and SUITE_ENDED are anchored, so
'​✔ Suite "x" passed' never matched. gh-merge-green then called a
passing suite cut short and refused to excuse a base red on
#35296 (app-host shard 2).
lines_of now strips the leading zero-width space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

lines_of now removes a leading zero-width space from normalized log lines. A regression test checks that prefixed Swift Testing suite markers correctly identify completed and unfinished suites.

Changes: Swift Testing parser

Layer / File(s) Summary
Normalize suite markers and test parsing
scripts/ci/test_reds.py, tests/test_test_reds.py
lines_of strips leading U+200B characters before parsing. Tests check that a completed suite is not marked truncated and that an unclosed suite is reported as unfinished.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

  • manaflow-ai/cmux#22738: Adds the parser and its Swift Testing tests, which this change extends with zero-width-space normalization.
  • manaflow-ai/cmux#26783: Adds the classifier and wires it into base_red_excuse.py; this change fixes Swift Testing suite parsing in that classifier.
  • manaflow-ai/cmux#24489: Adds the classifier and tests that this change extends with zero-width-space normalization.

Suggested reviewers: teamleaderleo

Merge Risk: Minimal · up to bdf3d

No merge-blocking issue is identified in the suite-marker normalization change. Merge after normal checks pass.

Pre-merge checks: Passed 24 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 24 passed
Check name Status Explanation
Title check Passed The title names the actual fix: test_reds now recognizes Swift Testing event lines that begin with a zero-width space. The raw summary confirms that lines_of strips a leading U+200B and that a PerTest…
Description check Passed The description leads with the problem: gh-merge-green refused a PR because a passing suite was reported as never finished. It explains the mechanism (U+200B prefix on the suite end line, and anchored…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input Passed The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The changes normalize zero-width spaces in Swift Testing log lines and add regression coverage. No Cloud terminal…
Cmux Swift Actor Isolation Passed PASS: The pull request changes only Python code in scripts/ci/test_reds.py and Python tests in tests/test_test_reds.py. It introduces no production Swift changes, actors, @MainActor annotations,…
Cmux Swift Blocking Runtime Passed PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The diff contains no Swift production changes and introduces no blocking or timing-based synchronization.
Cmux Browser Automation Off-Main Passed PASS. The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The diff contains no browser.* socket commands, WebKit/AppKit routing, worker-lane changes, or policy-tes…
Cmux Expensive Synchronous Load Passed PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The diff adds Python log normalization and regression coverage. It adds no production Swift change and no s…
Cmux Cache Substitution Correctness Passed PASS: The pull request changes only Python files (scripts/ci/test_reds.py and tests/test_test_reds.py). It adds log normalization and regression coverage. It does not replace a fresh authoritative…
Cmux No Hacky Sleeps Passed PASS. The PR changes scripts/ci/test_reds.py to strip a leading U+200B and adds a regression test. The diff introduces no sleeps, timers, polling, fixed delays, retries, or wall-clock waits. It does…
Cmux Algorithmic Complexity Passed PASS. The PR changes only Python CI parsing code and Python tests. lines_of performs one linear pass over log lines and adds no nested collection scans, repeated rescans, sorting, filtering, or in-m…
Cmux Swift Concurrency Passed PASS. The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py, both Python files. The diff adds zero Swift code and does not introduce or expand any Swift concurrency pat…
Cmux Swift @Concurrent Passed The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It introduces no Swift code, async functions, actor isolation, @concurrent annotations, or Swift call sites. Th…
Cmux Swift Package Boundaries Passed PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It introduces no production Swift changes, so the Swift package boundary rule does not apply.
Cmux Swiftpm Lockfiles Passed The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It does not change a SwiftPM package, Xcode project, .gitignore, workflow, dependency declaration, or `Package.…
Cmux Swift Logging Passed PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It adds no Swift production code or logging statements, so the Swift logging rule does not apply.
Cmux User-Facing Error Privacy Passed PASS. The diff changes only the CI log parser in scripts/ci/test_reds.py and adds a regression test in tests/test_test_reds.py. It normalizes U+200B before matching Swift Testing markers. The chan…
Cmux Full Internationalization Passed The diff changes only the CI parser in scripts/ci/test_reds.py and regression tests in tests/test_test_reds.py. The added text is a developer comment and test fixture data. No user-facing Swift, w…
Cmux Swiftui State Layout Passed The pull request changes only Python files: scripts/ci/test_reds.py and tests/test_test_reds.py. It adds zero-width-space handling and a regression test. It introduces no SwiftUI code, state, `Geo…
Cmux Architecture Rethink Passed PASS: The pull request changes only Python log parsing and its Python regression test. It adds no Swift architecture, timing repair path, mutable state owner, observer, duplicate wiring, or UI lifecyc…
Cmux Swift Auxiliary Window Close Shortcuts Passed The PR changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It adds Python log normalization and regression coverage. It does not add or modify Swift user-visible windows, panels, con…
Cmux Source Artifacts Passed The diff changes only scripts/ci/test_reds.py and tests/test_test_reds.py. These are hand-written CI source and regression tests. No logs, caches, build output, screenshots, temp directories, or o…
Cmux No Test Or Debug Seam In Production Source Passed PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The authoritative diff contains no Swift file under a production Sources/ path, so it cannot introduce th…
Full details: Title check

Explanation

The title names the actual fix: test_reds now recognizes Swift Testing event lines that begin with a zero-width space. The raw summary confirms that lines_of strips a leading U+200B and that a PerTest regression test was added. The title is specific and matches the main change. The wording is slightly informal, but a teammate scanning history would understand the change.

Full details: Description check

Explanation

The description leads with the problem: gh-merge-green refused a PR because a passing suite was reported as never finished. It explains the mechanism (U+200B prefix on the suite end line, and anchored ^ patterns that do not match). It states the fix (stripping a leading U+200B in lines_of) and gives concrete testing evidence (33 OK, replayed shard-2 log yields truncated = []). It also names the new tests. The template asks for a Changelog section, which is absent. The Proof section (one line on why no visual proof is needed, e.g. CI only) and the Checklist are also missing. The Testing section does not use the 'Observed / Not run' split that the template asks for on bug fixes. These gaps are non-critical for a CI-only change, so the description is mostly complete.

Full details: Cmux Cloud Persistent Session And Early Input

Explanation

The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The changes normalize zero-width spaces in Swift Testing log lines and add regression coverage. No Cloud terminal creation, transport, renderer, input ownership, auth, idempotency, revision, or lease behavior changes are present.

Full details: Cmux Swift Actor Isolation

Explanation

PASS: The pull request changes only Python code in scripts/ci/test_reds.py and Python tests in tests/test_test_reds.py. It introduces no production Swift changes, actors, @MainActor annotations, Swift service protocols, or Swift reference types. The Swift actor-isolation check is therefore not applicable.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS. The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The diff contains no browser.* socket commands, WebKit/AppKit routing, worker-lane changes, or policy-test changes. The browser automation rule is therefore not applicable.

Full details: Cmux Expensive Synchronous Load

Explanation

PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The diff adds Python log normalization and regression coverage. It adds no production Swift change and no synchronous agent-history load or interactive-path call site.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS: The pull request changes only Python files (scripts/ci/test_reds.py and tests/test_test_reds.py). It adds log normalization and regression coverage. It does not replace a fresh authoritative read with a cache in production Swift, TypeScript, or JavaScript persistence, history, undo, or snapshot code.

Full details: Cmux No Hacky Sleeps

Explanation

PASS. The PR changes scripts/ci/test_reds.py to strip a leading U+200B and adds a regression test. The diff introduces no sleeps, timers, polling, fixed delays, retries, or wall-clock waits. It does not violate runtime-no-hacky-sleeps.md.

Full details: Cmux Algorithmic Complexity

Explanation

PASS. The PR changes only Python CI parsing code and Python tests. lines_of performs one linear pass over log lines and adds no nested collection scans, repeated rescans, sorting, filtering, or in-memory joins. The added test is test-only scaffolding.

Full details: Cmux Swift Concurrency

Explanation

PASS. The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py, both Python files. The diff adds zero Swift code and does not introduce or expand any Swift concurrency pattern covered by this check.

Full details: Cmux Swift `@Concurrent`

Explanation

The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It introduces no Swift code, async functions, actor isolation, @concurrent annotations, or Swift call sites. The Swift concurrency rule is therefore not applicable.

Full details: Cmux Swiftpm Lockfiles

Explanation

The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It does not change a SwiftPM package, Xcode project, .gitignore, workflow, dependency declaration, or Package.resolved file. The SwiftPM lockfile policy is therefore not applicable.

Full details: Cmux User-Facing Error Privacy

Explanation

PASS. The diff changes only the CI log parser in scripts/ci/test_reds.py and adds a regression test in tests/test_test_reds.py. It normalizes U+200B before matching Swift Testing markers. The change does not add or alter cmux app UI, product CLI, product API errors, alerts, or recovery copy. Any affected text is internal CI classification output, which the rule allows.

Full details: Cmux Full Internationalization

Explanation

The diff changes only the CI parser in scripts/ci/test_reds.py and regression tests in tests/test_test_reds.py. The added text is a developer comment and test fixture data. No user-facing Swift, web, metadata, API, markdown, changelog, or locale/catalog content changes.

Full details: Cmux Swiftui State Layout

Explanation

The pull request changes only Python files: scripts/ci/test_reds.py and tests/test_test_reds.py. It adds zero-width-space handling and a regression test. It introduces no SwiftUI code, state, GeometryReader, lazy/list row, or render-time mutation changes.

Full details: Cmux Architecture Rethink

Explanation

PASS: The pull request changes only Python log parsing and its Python regression test. It adds no Swift architecture, timing repair path, mutable state owner, observer, duplicate wiring, or UI lifecycle bridge. The change is a small local correctness fix: lines_of removes U+200B before the existing anchored suite patterns run, and the test covers both completed and unfinished suites.

Full details: Cmux Swift Auxiliary Window Close Shortcuts

Explanation

The PR changes only scripts/ci/test_reds.py and tests/test_test_reds.py. It adds Python log normalization and regression coverage. It does not add or modify Swift user-visible windows, panels, controllers, SwiftUI Window, or WindowGroup code. The auxiliary-window close-shortcut rule is therefore not applicable.

Full details: Cmux Source Artifacts

Explanation

The diff changes only scripts/ci/test_reds.py and tests/test_test_reds.py. These are hand-written CI source and regression tests. No logs, caches, build output, screenshots, temp directories, or other source-control artifacts enter the diff.

Full details: Cmux No Test Or Debug Seam In Production Source

Explanation

PASS: The pull request changes only scripts/ci/test_reds.py and tests/test_test_reds.py. The authoritative diff contains no Swift file under a production Sources/ path, so it cannot introduce the specified production test/debug seam.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4ce0f93 and bdf3de6.

Files selected for processing: 2
  • scripts/ci/test_reds.py
  • tests/test_test_reds.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@austinywang

Copy link
Copy Markdown
Contributor Author

Correctness review (fresh subagent), head bdf3de6: PASS

  • The strip only affects patterns anchored with ^. The run and suite start/end patterns (RUN_STARTED/RUN_ENDED/RUN_COUNT, SUITE_STARTED/SUITE_ENDED) are all anchored, so start and end counting stays symmetric. A suite that starts after a ZWSP and never ends is still reported, and the new test's second case covers that. HELPER_KILLED and SHELL_SIGNAL are checked before the test-line crash exemption, so a killed helper on a test line is still a crash.
  • lines_of is only used by read(). base_red_excuse.py has its own lines_of, which this change doesn't touch.
  • Order: ANSI codes are removed from the whole line before the strip. In the real log, all 460 ZWSPs sit right after the timestamp.
  • The new test fails against the origin/main test_reds.py and passes here (33 OK).
  • Replaying the real shard-2 log (https://github.com/manaflow-ai/cmux/actions/runs/41848241642/job/126642789599): truncated was the false "never finished" suite before and is now empty; failed and crashes are empty both before and after.

No findings to resolve. CI is green on this head (45/45).

@austinywang
austinywang merged commit ce57017 into main Nov 4, 2026
58 of 59 checks passed
@austinywang
austinywang deleted the test-reds-zero-width branch November 4, 2026 16:28
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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

Merge receipt for bdf3de6005: every check was green at merge (11 verified; 16 skipped by policy). Full suite runs on main after merge.

cmux-bot Bot pushed a commit that referenced this pull request Nov 4, 2026
…-space suite end (port from main) (#35892)

* test(test_reds): reproduce display-named Swift Testing reds and a zero-width-space suite end

Both read wrong on feat-cmux-next's copy, which the landers run for every base;
main already has the fixes (#35723, #35609).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8707001042ea634e8771

* ci(test_reds): read display-named Swift Testing reds; strip a leading zero-width space

Ports main's #35723 and #35609 to feat-cmux-next's copy, the canonical
base-red classifier the landers run for every base, so main's copy can be
the same bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8707001042ea634e8771

* test(base-red): reproduce a retried-green ci-status job excusing its run's reds, and a rate limit exiting 1

Review findings on #35893 (F1, F2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8707001042ea634e8771

* ci(base-red): a run rollup's exact job must be red too; exit 3 on a rate-limited read

A ci-status check-run can stay failed after its job was re-run green; the run
was then rescanned and its child reds could be excused. Check the exact job's
conclusion for run rollups as for routed ones. Where the evidence reader raises
RateLimited (main's), exit 3 so gh-merge-green reports a rate limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8707001042ea634e8771

* test(base-red): reproduce a pull_request_target run as base evidence, and an older red listed before a newer green

Review findings on #35893.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8707001042ea634e8771

* ci(base-red): the newest base run decides whatever order GitHub lists them; a pull_request_target run is never base evidence

Review findings on #35893 (F1, F2). main's older copy excluded both PR events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8707001042ea634e8771

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant