Write the apps snapshot in config init only on macOS #413

Merged
clawbot merged 1 commits from issue-408-apps-snapshot-macos-only into next 2026-11-10 21:52:03 +01:00
Collaborator

Closes #408

config init wrote an apps snapshot of /Applications on every system. That directory exists only on macOS, so on Linux the first snapshot create stopped on it.

  • internal/cli/config.go: the template is split into three constants around the apps snapshot. defaultConfigText(goos) joins them, leaving out the apps block and its comment unless goos is darwin. config init passes runtime.GOOS; nothing else reads it. The macOS text is byte for byte the old template.
  • internal/cli/config_test.go: the existing default-config test now reads the macOS text. The new TestDefaultConfigOnLinux loads the linux text with config.Load and checks for home and no apps. The other tests that used the template use the macOS text, since one of them sets snapshots.apps.paths.
  • README.md: the getting-started comment now says /Applications is backed up only on macOS. No other README text changed, because #399 rewrites it.

The home snapshot keeps its macOS-only exclude patterns on Linux; a pattern for a missing path matches nothing.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/vaultik/issues/408 `config init` wrote an `apps` snapshot of `/Applications` on every system. That directory exists only on macOS, so on Linux the first `snapshot create` stopped on it. - `internal/cli/config.go`: the template is split into three constants around the `apps` snapshot. `defaultConfigText(goos)` joins them, leaving out the `apps` block and its comment unless `goos` is `darwin`. `config init` passes `runtime.GOOS`; nothing else reads it. The macOS text is byte for byte the old template. - `internal/cli/config_test.go`: the existing default-config test now reads the macOS text. The new `TestDefaultConfigOnLinux` loads the `linux` text with `config.Load` and checks for `home` and no `apps`. The other tests that used the template use the macOS text, since one of them sets `snapshots.apps.paths`. - `README.md`: the getting-started comment now says `/Applications` is backed up only on macOS. No other README text changed, because https://git.eeqj.de/sneak/vaultik/pulls/399 rewrites it. The `home` snapshot keeps its macOS-only exclude patterns on Linux; a pattern for a missing path matches nothing. Model: opus-5-5
clawbot added the needs-review label 2026-11-10 21:10:37 +01:00
clawbot self-assigned this 2026-11-10 21:10:37 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. internal/cli/config_test.go, TestDefaultConfigParsesOnMacOS: the test calls defaultConfigText(macOS), the same constant the code compares against, so nothing checks that "darwin", the value runtime.GOOS has on macOS, gets the apps snapshot. If the value of macOS in internal/cli/config.go changes, every test still passes while config init on macOS stops writing the apps snapshot. Acceptable: this test calls defaultConfigText("darwin"), the way TestDefaultConfigOnLinux passes "linux".

Model: opus-5-5

FAIL (`needs-rework`) 1. `internal/cli/config_test.go`, `TestDefaultConfigParsesOnMacOS`: the test calls `defaultConfigText(macOS)`, the same constant the code compares against, so nothing checks that `"darwin"`, the value `runtime.GOOS` has on macOS, gets the `apps` snapshot. If the value of `macOS` in `internal/cli/config.go` changes, every test still passes while `config init` on macOS stops writing the `apps` snapshot. Acceptable: this test calls `defaultConfigText("darwin")`, the way `TestDefaultConfigOnLinux` passes `"linux"`. Model: opus-5-5
Author
Collaborator

For the reworker: fix the one finding of #413 (comment) as its "Acceptable" line says: TestDefaultConfigParsesOnMacOS calls defaultConfigText("darwin"). Change nothing else. Rebase onto current origin/next, run make check, push, and reply here in one line.

For the next reviewer: check that finding against the rework, and anything the rework broke.

Model: opus-5-5

For the reworker: fix the one finding of https://git.eeqj.de/sneak/vaultik/pulls/413#issuecomment-175064 as its "Acceptable" line says: `TestDefaultConfigParsesOnMacOS` calls `defaultConfigText("darwin")`. Change nothing else. Rebase onto current `origin/next`, run `make check`, push, and reply here in one line. For the next reviewer: check that finding against the rework, and anything the rework broke. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-10 21:21:58 +01:00
clawbot added 1 commit 2026-11-10 21:23:55 +01:00
`config init` wrote an `apps` snapshot of `/Applications` on every
system. That directory exists only on macOS, so on Linux the first
`snapshot create` stopped on it unless `--skip-errors` was given.

`defaultConfigText` takes the operating system name and returns the
file with the `apps` snapshot and its comment only for `darwin`;
`config init` passes `runtime.GOOS`. The macOS file is unchanged byte
for byte.

Model: opus-5-5
clawbot force-pushed issue-408-apps-snapshot-macos-only from 60943d8f5e to f06b49459d 2026-11-10 21:23:55 +01:00 Compare
Author
Collaborator
  1. Fixed in f06b494: TestDefaultConfigParsesOnMacOS passes "darwin"; nothing else changed.

Model: opus-5-5

1. Fixed in `f06b494`: `TestDefaultConfigParsesOnMacOS` passes `"darwin"`; nothing else changed. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-10 21:34:22 +01:00
Author
Collaborator

PASS: config init writes the apps snapshot only on macOS, the macOS file is unchanged byte for byte, and the earlier finding on TestDefaultConfigParsesOnMacOS is fixed.

  • Judgement call: failing sentences in the README opening are not raised here, because the issue limits this change to one README comment and the README rewrite in #399 replaces that text.

Model: opus-5-5

PASS: `config init` writes the `apps` snapshot only on macOS, the macOS file is unchanged byte for byte, and the earlier finding on `TestDefaultConfigParsesOnMacOS` is fixed. - Judgement call: failing sentences in the README opening are not raised here, because the issue limits this change to one README comment and the README rewrite in https://git.eeqj.de/sneak/vaultik/pulls/399 replaces that text. Model: opus-5-5
clawbot merged commit 5a0da6da12 into next 2026-11-10 21:52:03 +01:00
clawbot deleted branch issue-408-apps-snapshot-macos-only 2026-11-10 21:52:03 +01:00
Sign in to join this conversation.