Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ reviews:
Apply `.github/review-bot-rules/react-base-ui-accessibility.md` during review. For custom React UI, require `@base-ui-components/react` or an existing local component when it provides the relevant dialog, popover, menu, checkbox, select, switch, tabs, tooltip, combobox, focus, or keyboard behavior. Pass for native semantic controls and for cases with no relevant primitive where the PR owns complete accessibility and keyboard behavior.
- path: "**/Package.swift"
instructions: |
Apply the cmux custom Swift lint rules in `.github/review-bot-rules/`, especially the concurrency modernization, actor isolation, blocking runtime, file/package boundary, and architectural rethink rules.
Apply the cmux custom Swift lint rules in `.github/review-bot-rules/`, especially the concurrency modernization, actor isolation, blocking runtime, package boundary, and architectural rethink rules.
- path: "**/Package.resolved"
instructions: |
Apply `.github/review-bot-rules/swiftpm-package-resolved.md` during review. cmux-owned SwiftPM lockfiles are intentional source-of-truth files, not accidental artifacts; dependency pin changes must be visible in PR diffs.
Expand Down Expand Up @@ -142,10 +142,10 @@ reviews:
mode: error
instructions: |
For Swift changes, fail when the diff violates `.github/review-bot-rules/swift-concurrent-annotation.md`: missing `@concurrent` on `nonisolated async` work that should leave the caller actor, invalid `@concurrent` on synchronous or actor-isolated functions, or CPU/file/network-heavy async helpers called from UI isolation without an explicit hop. Pass for intentionally UI-bound async work.
- name: "cmux Swift file and package boundaries"
- name: "cmux Swift package boundaries"
mode: error
instructions: |
For production Swift changes, fail when the diff violates `.github/review-bot-rules/swift-file-package-boundaries.md`: new oversized files, large additions to already oversized files, mixed UI/state/persistence/network/parsing/protocol responsibilities in one file, or independently testable feature logic kept in the app target when it should live behind a small SwiftPM package target. Pass for existing oversized files touched incidentally, small UI/AppKit/Ghostty glue, generated/vendored/prototype/test code, and focused bug fixes that preserve a clear extraction path.
For production Swift changes, fail when the diff violates `.github/review-bot-rules/swift-package-boundaries.md`: independently testable or reusable domain logic is kept in the app target when it should live behind a small SwiftPM package target. Pass for small UI/AppKit/Ghostty glue, generated/vendored/prototype/test code, and app-lifecycle composition.
- name: "cmux SwiftPM lockfiles"
mode: error
instructions: |
Expand Down
2 changes: 1 addition & 1 deletion .github/review-bot-rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Current rules:
- `swift-concurrency-modernization.md`
- `swift-concurrent-annotation.md`
- `swift-expensive-sync-load.md`
- `swift-file-package-boundaries.md`
- `swift-package-boundaries.md`
- `swift-logging.md`
- `swiftui-state-layout.md`
- `user-facing-errors.md`
Expand Down
34 changes: 0 additions & 34 deletions .github/review-bot-rules/swift-file-package-boundaries.md

This file was deleted.

24 changes: 24 additions & 0 deletions .github/review-bot-rules/swift-package-boundaries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Swift Package Boundaries

Flag Swift changes that keep independently testable feature logic inside the app target when it should be isolated behind a SwiftPM package boundary.

Report a failure when the diff introduces or materially expands:

- A feature implemented directly in the app target/module's root `Sources/` path when its core logic is independent of cmux app lifecycle and can compile/test without AppKit, SwiftUI view state, Ghostty globals, or process-wide singletons.
- Reusable domain logic used by more than one surface (Mac app, CLI, daemon, tests, previews, debug tooling, future iOS/shared code) without a small SwiftPM package target.
- Provider, auth, protocol, parsing, persistence, logging, or workstream logic that needs isolated fakes, fixtures, or unit tests but is hidden behind app-target globals.

Package-boundary signals:

- The code has a stable domain noun and public API that can be expressed without view types.
- The code needs tests that should run without launching cmux or constructing app UI.
- The code owns data formats, network/provider contracts, socket messages, credentials, persistence schemas, or cross-surface state transitions.
- The feature would be safer if callers depended on a small protocol or value API instead of a concrete app singleton.

Allowed cases:

- Small UI-only views, AppKit bridges, app delegates, menu wiring, and Ghostty integration glue that are inherently app-target code.
- Generated files, vendored code, prototypes, and test fixtures.
- New package creation that starts small and intentionally leaves app-specific UI composition in the app target/module-root `Sources/` directory.

When reporting, include the feature boundary and the smallest extraction cut. Name the proposed package target and the first public type or protocol it should expose.
Loading
Loading