Skip to content

fix(bootstrap): explain macos defaults type differences - #13096

Merged
jdx merged 3 commits into
mainfrom
codex/macos-defaults-type-status
Sep 11, 2026
Merged

jdx merged 3 commits into
mainfrom
codex/macos-defaults-type-status

Conversation

@jdx

@jdx jdx commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner

macOS defaults status can display identical desired and current values while reporting differs, because comparison includes the property-list type. Show the actual and expected types when they differ: an integer KeyRepeat = 2 against a stored real now reports 2 (real; expected integer) in Current. Strict comparison and apply behavior remain unchanged; same-type value differences keep their existing display.

Validation: focused defaults unit tests, a macOS E2E test using an isolated preference domain, scoped hk checks, and Rust formatting. The E2E test verifies text and JSON output, read-only status, and string-to-integer correction through apply.

Native testing also exposed an existing write limitation: CFPreferences can retain a real 2.0 when applying integer 2. This PR explains the resulting status mismatch; it does not change that write behavior.

AI-assisted β€” Tool: Codex; model: openai/unavailable; version: unavailable.


Note

Low Risk
Read-only change to status messaging and tests; macOS defaults matching and write paths are untouched.

Overview
macOS defaults status now explains why a preference shows as differs when the printed value looks the same as config: strict matching already required matching property-list types, but Current only showed the raw value.

When the stored type does not match the expected type, Current is now annotated like 2 (real; expected integer) or 15 (string; expected integer). Same-type value mismatches keep the plain value display. Compare/apply behavior is unchangedβ€”this is status output only.

Coverage adds unit tests for display_difference and a Darwin-only E2E that seeds mismatched types in an isolated preference domain, checks text/JSON status, read-only --missing, and that apply still corrects a string stored as an integer.

Reviewed by Cursor Bugbot for commit 315f291. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Preference status output now identifies both current and expected property-list types when a value has the wrong type.
    • Applying system defaults corrects compatible type mismatches while preserving values that should not be changed.
    • Read-only status checks preserve existing preference values and types without modifying them.
  • Tests
    • Added macOS coverage for detecting, displaying, and applying preference type mismatches, including numeric and string values.

jdx added 2 commits September 11, 2026 14:33
Entire-Checkpoint: 01M28ZCM3JGQMTPVGW7CCM3E2N
Entire-Checkpoint: 01M28ZHQFF9B0W4CF0NZ856HS2
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: e1888c13-d716-4725-ae92-4ece752c012f

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 24d458d and 315f291.

πŸ“’ Files selected for processing (1)
  • src/system/defaults.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


πŸ“ Walkthrough

Walkthrough

The defaults status flow derives expected type names from DefaultsValue variants. A macOS end-to-end test validates mismatch reporting, JSON output, read-only behavior, and apply behavior.

Changes

Defaults type reporting

Layer / File(s) Summary
Type-aware difference display
src/system/defaults.rs
display_difference maps each DefaultsValue variant to its expected type name without creating a temporary plist value.
Status integration and macOS validation
e2e/cli/test_system_defaults_types
The macOS end-to-end test checks mismatched type output, JSON status, read-only preservation, and correction of the string value during apply. The float value remains unchanged.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: azohra

Merge Risk: βšͺ Minimal Β· up to 315f2

The PR improves macOS defaults mismatch reporting without changing apply behavior, and the relevant output and apply paths are covered by tests.

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly summarizes the main change: improving macOS defaults output to explain type differences.
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.
  • Fix all pre-merge checks with AI

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

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding correctness, security, or repository-rule issues identified.

Summary

  • Preserves existing comparison and apply behavior.
  • Keeps same-type value differences unchanged.
  • Adds focused unit coverage and a Darwin-only end-to-end workflow covering text output, JSON output, read-only status, and apply behavior.

Reviews (2) Β· Last reviewed commit: "fix(bootstrap): format defaults types on..."

greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 11, 2026
Entire-Checkpoint: 01M2906Q717RC1J5V09YX2ANHX
@greptile-apps
greptile-apps Bot dismissed their stale review September 11, 2026 19:48

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@jdx
jdx merged commit 8527fa4 into main Sep 11, 2026
44 checks passed
@jdx
jdx deleted the codex/macos-defaults-type-status branch September 11, 2026 20:30
@github-actions

Copy link
Copy Markdown
Contributor

Instruction counts

The comparison never ran β€” an earlier step failed.

315f2910ecec vs `` Β· measured on the runner, not pushed to the history.

jdx pushed a commit that referenced this pull request Sep 12, 2026
### πŸš€ Features

- **(bootstrap)** declare Dock applications in order by @azohra in
[#13075](#13075)
- **(brew)** implement `mise bootstrap packages where` for keg-only
packages by @himkt in [#13083](#13083)
- **(cli)** add configurable output truncation by @jdx in
[#13112](#13112)
- **(daemons)** manage project daemons and database presets with
pitchfork by @jdx in [#13085](#13085)
- **(doctor)** add project diagnostic checks by @jdx in
[#13062](#13062)
- **(dotfiles)** infer variant sources from dotfiles root by @jdx in
[#13087](#13087)
- **(fmt)** sort lists whose order carries no meaning by @jrandolf in
[#13058](#13058)
- **(vfox)** add backend tool discovery by @jdx in
[#13111](#13111)

### πŸ› Bug Fixes

- **(asdf)** avoid recursive compatibility dispatch by @jdx in
[#13114](#13114)
- **(bootstrap)** explain macos defaults type differences by @jdx in
[#13096](#13096)
- **(bootstrap)** find ssh and tar on Windows for remote bootstrap by
@JamBalaya56562 in [#13117](#13117)
- **(brew)** link keg-only-on-macOS formulae on Linux by @lil-lon in
[#13108](#13108)
- **(config)** merge monorepo settings across overlays by @jdx in
[#13084](#13084)
- **(config)** scope runtime lockfile lookup to effective tool config by
@nettlesh in [#13042](#13042)
- **(doctor)** align project check roots, dir expansion, schema, and
signals by @jdx in [#13089](#13089)
- **(dotfiles)** honor global yes setting when tracking files by
@nettlesh in [#13072](#13072)
- **(dotfiles)** warn when tracking a symlink without its source by @jdx
in [#13095](#13095)
- **(http)** make shared extraction opt-in by @jdx in
[#13059](#13059)
- **(lockfile)** allow packslip to replace legacy provenance by @jdx in
[#13105](#13105)
- **(nushell)** wrap hide-env in try instead of in-env guard by @i-api
in [#13071](#13071)
- **(packslip)** skip unsupported lockfile targets by @jdx in
[#13102](#13102)
- **(schema)** model dotfiles manifests by @risu729 in
[#12741](#12741)
- **(task)** auto-install tools for run task references by @jdx in
[#13086](#13086)
- **(upgrade)** detect letter-suffixed version updates by @jdx in
[#13119](#13119)
- extract structured flight steps from tap casks by @jdx in
[#13060](#13060)

### πŸ“š Documentation

- **(agents)** write PR titles and descriptions for release notes by
@jdx in [#13090](#13090)
- **(task)** organise task-running guidance by @azohra in
[#13077](#13077)
- diagram tracked dotfile synchronization by @jdx in
[#13069](#13069)
- diagram artifact cache execution by @jdx in
[#13068](#13068)
- diagram tool configuration precedence by @jdx in
[#13067](#13067)
- illustrate bootstrap machine resources by @jdx in
[#13066](#13066)
- illustrate project environment switching by @jdx in
[#13065](#13065)
- prevent landing tabs from shifting content by @jdx in
[#13107](#13107)
- prohibit drive-by AI discussion spam by @jdx in
[#13110](#13110)

### ⚑ Performance

- **(lockfile)** avoid scheduling cached generation targets by @jdx in
[#13101](#13101)
- **(lockfile)** skip generation for current warm installs by @jdx in
[#13103](#13103)
- **(oci)** leave same-repository base layers remote during push by @jdx
in [#13055](#13055)
- **(oci)** cache local tool layers across image builds by @jdx in
[#13056](#13056)

### πŸ“¦οΈ Dependency Updates

- update rust crate aube-registry to v2.2.14 by @renovate[bot] in
[#13015](#13015)
- update communique to v1.4.0 by @jdx in
[#13104](#13104)
- update rattler by @renovate[bot] in
[#12966](#12966)
- update rust crate aube to v2.2.14 by @renovate[bot] in
[#13014](#13014)
- update rust crate usage-lib to v6.9.0 by @renovate[bot] in
[#12892](#12892)
- update rust crate usage-cli to v6.9.0 by @renovate[bot] in
[#12891](#12891)

### πŸ“¦ Registry

- add mpv (conda:mpv) by @i-api in
[#13049](#13049)
- use conda for postgres, redis, and mongodb by @jdx in
[#13061](#13061)
- add agent-browser by @3w36zj6 in
[#13088](#13088)
- add himalaya
([github:pimalaya/himalaya](https://github.com/pimalaya/himalaya)) by
@i-api in [#13091](#13091)
- fix editorconfig-checker 4.0.1 by @jdx in
[#13098](#13098)
- fix mc downloads from MinIO releases by @jdx in
[#13113](#13113)

### Chore

- **(ci)** replace actionlint with zizmor by @jdx in
[#13097](#13097)

### Ci

- increase vfox runner memory by @jdx in
[#13118](#13118)

### New Contributors

- @lil-lon made their first contribution in
[#13108](#13108)

## πŸ“¦ Aqua Registry Updates

### New Packages (1)

- [`getgaal/gaal`](https://github.com/getgaal/gaal)

### Updated Packages (1)

- [`yadm-dev/yadm`](https://github.com/yadm-dev/yadm)
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