Skip to content

Commit ed632e5

Browse files
lawrencecchenclaude
andcommitted
Justify auto-attach policy namespaces for the conventions lint
Main's iOS package-conventions lint now flags all-static public types (both caseless namespace enums and static-only structs) repo-wide. MobileAutoAttachFlag, MobileAttachRoutePriority, and MobileAutoAttachTargetSelector are pure, stateless policy namespaces: deterministic transforms over values passed per call, no I/O and no injected dependencies, so there is nothing to instantiate. Carry the sanctioned inline lint:allow justification rather than forcing an artificial instance type onto pure functions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f730d29 commit ed632e5

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

Packages/CmuxMobileShellModel/Sources/CmuxMobileShellModel/MobileAttachRoutePriority.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public import CMUXMobileCore
99
/// the model package (not privately on the shell) so the pure auto-attach target
1010
/// selector can rank devices by their best reachable route without importing the
1111
/// shell.
12+
///
13+
/// Pure route-priority transform over values passed per call; the shared source
14+
/// of truth for route ordering holds no per-instance state, nothing to instantiate.
15+
// lint:allow namespace-type, namespace-enum — stateless policy namespace, see above.
1216
public enum MobileAttachRoutePriority {
1317
/// Whether `left` should be tried before `right`: lower `priority` wins, with
1418
/// the route `id` as a stable lexicographic tiebreak so the ordering is

Packages/CmuxMobileShellModel/Sources/CmuxMobileShellModel/MobileAutoAttachFlag.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ public import Foundation
77
/// the macOS beta-feature convention of a `UserDefaults`-backed boolean. The flag
88
/// is read once at the composition root and injected into the shell as a plain
99
/// `Bool`, so the shell stays testable without touching `UserDefaults`.
10+
///
11+
/// Pure flag-resolution policy with no per-instance state; its only dependency
12+
/// (`UserDefaults`) is passed per call, so there is nothing to instantiate.
13+
// lint:allow namespace-type, namespace-enum — stateless policy namespace, see above.
1014
public enum MobileAutoAttachFlag {
1115
/// The `UserDefaults` key. Present-and-set overrides the build default, so a
1216
/// dogfood Release build can opt in (or a DEBUG build can opt out) without a

Packages/CmuxMobileShellModel/Sources/CmuxMobileShellModel/MobileAutoAttachTargetSelector.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public import Foundation
1717
/// the registry is scoped to the signed-in user's team, so a different-account
1818
/// Mac never appears here, and even a stray route would be rejected at mint by
1919
/// the Mac's same-Stack-account authorization check.
20+
///
21+
/// Pure, deterministic target-selection policy over values passed per call (no
22+
/// I/O, no injected dependencies, no per-instance state), nothing to instantiate.
23+
// lint:allow namespace-type, namespace-enum — stateless policy namespace, see above.
2024
public enum MobileAutoAttachTargetSelector {
2125
/// A device that is a viable auto-attach target: a controllable host with at
2226
/// least one instance reachable on a supported route.

0 commit comments

Comments
 (0)