Skip to content

Harden toolchain guard and crash marker; split AppModel - #42

Merged
Reedtrullz merged 1 commit into
mainfrom
codex/review-fixes-toolchain-marker-appmodel-split
Aug 12, 2026
Merged

Harden toolchain guard and crash marker; split AppModel#42
Reedtrullz merged 1 commit into
mainfrom
codex/review-fixes-toolchain-marker-appmodel-split

Conversation

@Reedtrullz

Copy link
Copy Markdown
Owner

What changed

  • Toolchain guard: new scripts/check-toolchain.sh, wired into verify, test-fast, test-full, app, pkg, install, install-dev-adhoc, and run-app. When the active developer directory is Command Line Tools (which lacks SwiftUI macro plugins), builds now fail with the exact one-time fix instead of cryptic SwiftUIMacros errors. An explicit DEVELOPER_DIR is honored.
  • Crash-recovery marker durability: ManualControlMarker.markActive() now writes through a same-directory temporary file (O_EXCL), fsyncs the file and parent directory, then renames into place; clear() fsyncs the parent after removal. Both return Bool, and the fan-control coordinator surfaces a visible status warning when entering manual mode without a writable marker, so an unclean exit can no longer silently lose its recovery evidence.
  • AppModel decomposition (F29 / plan Task 11): AppModel.swift reduced from 2612 to 526 lines by relocating methods into seven same-target extension files (Lifecycle, Polling, Control, Profiles, Fans, MenuBar, Notifications). Pure mechanical relocation; start() and primeMenuBarStatusItemTelemetry stay in the main file so the source-inspection architecture tests pass unchanged.
  • Test contract updates: MakefileTrustGateTests pins the new guarded target lines; ManualControlMarkerTests asserts the new return values and covers a deterministic write-failure path.

Why

These are the actionable findings from the 2026-08-12 deep review: the local make verify gate was unusable out of the box on a CLT-only machine, the unclean-exit marker was not crash-durable and swallowed write failures, and AppModel remained the largest maintainability debt in the remediation inventory.

Impact

No behavior change for users. Build/install targets now fail fast with actionable toolchain guidance on machines where Xcode is not selected, and manual fan control warns before leaving the machine without crash-recovery evidence.

Validation

  • make verify green: 1344 tests / 0 failures, warnings-as-errors build, release app bundling, plist lint, deep code-sign verification, viftyctl identifier checks.
  • scripts/check-toolchain.sh exits 1 with guidance under Command Line Tools and exits 0 under Xcode 27.

- Add scripts/check-toolchain.sh and wire it into verify/test/app/install targets so a Command Line Tools-only developer directory fails with the exact fix instead of cryptic SwiftUIMacros errors.
- Make ManualControlMarker writes crash-durable (same-directory temp file + fsync + rename + directory fsync), return success, and surface a status warning when the manual-mode recovery marker cannot be written.
- Split AppModel.swift (2612 -> 526 lines) into seven same-target extension files by concern (Lifecycle, Polling, Control, Profiles, Fans, MenuBar, Notifications); pure relocation, no behavior change.
- Update MakefileTrustGateTests and ManualControlMarkerTests for the new contracts.

Verified: make verify green (1344 tests, 0 failures), warnings-as-errors build, app bundling, plist/codesign, viftyctl identifier checks.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Reedtrullz
Reedtrullz merged commit cc4c944 into main Aug 12, 2026
1 check passed
@Reedtrullz
Reedtrullz deleted the codex/review-fixes-toolchain-marker-appmodel-split branch August 12, 2026 14:04
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