|
1 | | -# PS: Don't ask claude code to make your pull request like a maniac. |
2 | | - |
3 | 1 | # Contributing to Core Monitor |
4 | 2 |
|
5 | | -Core Monitor is a macOS utility with privileged-helper fan control, real-time monitoring, menu bar surfaces, alerts, onboarding, and optional Touch Bar support. |
6 | | - |
7 | | -That mix makes small regressions easy to ship unless contributors stay disciplined about scope and verification. |
8 | | - |
9 | | -## Start here |
10 | | - |
11 | | -Before editing code, read: |
12 | | - |
13 | | -1. [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) |
14 | | -2. [`docs/HELPER_DIAGNOSTICS.md`](docs/HELPER_DIAGNOSTICS.md) if your change touches helper install, signing, or fan control |
15 | | -3. the closest existing tests for the feature you are about to change |
16 | | - |
17 | | -## Local prerequisites |
18 | | - |
19 | | -- Xcode with the macOS SDK used by the project |
20 | | -- a macOS machine for app builds and runtime verification |
21 | | -- a signed build only if you need to validate the full privileged-helper trust path end to end |
22 | | - |
23 | | -You can build and test most of the app without installing the helper. |
24 | | - |
25 | | -## Core build and test commands |
26 | | - |
27 | | -Build: |
28 | | - |
29 | | -```bash |
30 | | -xcodebuild -project Core-Monitor.xcodeproj -scheme Core-Monitor -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build |
31 | | -``` |
32 | | - |
33 | | -Test: |
34 | | - |
35 | | -```bash |
36 | | -xcodebuild -project Core-Monitor.xcodeproj -scheme Core-Monitor -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO test |
37 | | -``` |
38 | | - |
39 | | -When a feature has focused regression tests, run those too: |
40 | | - |
41 | | -```bash |
42 | | -xcodebuild -project Core-Monitor.xcodeproj -scheme Core-Monitor -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO test -only-testing:Core-MonitorTests/HelperDiagnosticsReportTests |
43 | | -``` |
44 | | - |
45 | | -## Change strategy |
46 | | - |
47 | | -Prefer the smallest owner of the behavior: |
48 | | - |
49 | | -- monitoring regressions: `SystemMonitor.swift` |
50 | | -- helper or fan-write trust issues: `SMCHelperManager.swift`, `SMCHelperXPC.swift`, or `smc-helper/` |
51 | | -- alert threshold/evaluation issues: `AlertEngine.swift` |
52 | | -- menu bar visibility or density: `MenuBarSettings.swift`, `MenubarController.swift`, `MenuBarExtraView.swift` |
53 | | -- onboarding or helper explanation problems: `WelcomeGuide.swift` |
54 | | - |
55 | | -If a change crosses multiple layers, document why in the commit message and worklog. |
56 | | - |
57 | | -## Helper and fan-control safety rules |
58 | | - |
59 | | -- Do not weaken validation inside the privileged helper. |
60 | | -- Do not assume the app process is a sufficient trust boundary for privileged behavior. |
61 | | -- Keep “monitoring works without the helper” true. |
62 | | -- Keep “System Auto returns control to macOS” language accurate anywhere fan modes are described. |
63 | | -- If you change helper trust or installation behavior, update both user-facing copy and support intake docs. |
64 | | - |
65 | | -## UI and product verification |
66 | | - |
67 | | -For user-visible changes: |
68 | | - |
69 | | -1. Build the app |
70 | | -2. Launch it |
71 | | -3. Inspect the affected surface directly |
72 | | -4. Capture screenshots when the change affects onboarding, menu bar behavior, alerts, or dashboard layout |
73 | | - |
74 | | -Do not claim a UI improvement without looking at the actual runtime result. |
75 | | - |
76 | | -## Tests and regression coverage |
| 3 | +Core Monitor is a macOS system monitor. Keep changes small, clear, and easy to review. |
77 | 4 |
|
78 | | -- Add focused tests when changing: |
79 | | - - helper diagnostics or helper trust behavior |
80 | | - - fan curve validation or interpolation |
81 | | - - alert evaluation logic |
82 | | - - permission-gating behavior such as weather/location startup handling |
83 | | -- Keep tests close to the feature boundary instead of relying only on full-suite coverage. |
| 5 | +## Local setup |
84 | 6 |
|
85 | | -## Issues and bug reports |
| 7 | +Use Xcode on macOS. Build the app before submitting code changes. Run relevant tests when a change touches monitoring, alerts, onboarding, or the menu bar. |
86 | 8 |
|
87 | | -If a bug touches fan control, helper install, helper reachability, or signing mismatch: |
| 9 | +## Change style |
88 | 10 |
|
89 | | -- ask for the exported helper diagnostics report |
90 | | -- use the GitHub bug form in `.github/ISSUE_TEMPLATE/bug_report.yml` |
91 | | -- avoid debugging those reports from screenshots alone |
| 11 | +- Keep commits focused. |
| 12 | +- Avoid unrelated rewrites. |
| 13 | +- Update docs when user-facing behavior changes. |
| 14 | +- Add focused tests for regressions. |
| 15 | +- Verify UI changes in the running app. |
92 | 16 |
|
93 | | -## Pull request expectations |
| 17 | +## Pull requests |
94 | 18 |
|
95 | | -- Keep commits atomic and specific |
96 | | -- include verification notes |
97 | | -- call out any runtime limitation you could not validate |
98 | | -- avoid unrelated refactors in high-risk files such as `ContentView.swift` and `SystemMonitor.swift` |
| 19 | +- Describe what changed. |
| 20 | +- Include verification notes. |
| 21 | +- Call out any runtime behavior that could not be tested. |
99 | 22 |
|
100 | | -Core Monitor benefits more from a steady stream of verified improvements than from large speculative rewrites. |
| 23 | +Core Monitor is easier to maintain when improvements are steady, scoped, and verified. |
0 commit comments