Skip to content

chore(sync): drop the hidden --profile alias and name the store in every message - #407

Merged
entelecheia merged 2 commits into
mainfrom
chore/394-store-peer
Nov 9, 2026
Merged

entelecheia merged 2 commits into
mainfrom
chore/394-store-peer

Conversation

@entelecheia

@entelecheia entelecheia commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Part of #394 (row: hidden dot sync --profile, from #380).

Removes the hidden persistent --profile flag on dot sync, the fallback that read it (syncStoreFrom), the stderr deprecation warning, and the PersistentPreRunE that refused two conflicting values. dot sync --profile now fails with unknown flag, which is the end of the one-release alias window opened in #380.

Every command dot prints or runs on the peer moves to --store: the owner-mismatch refusal (dot sync owner --store=<p> --set-self, dot sync pull --store=<p>), the NFD fix that dot peer doctor and the peer inventory report, the handover and fence messages, noLocalOwnerFix, the "list them with" hint at the end of dot peer sync, the launchd plist and systemd unit the scheduler renders, and the launchd spawn-failed reload line. remotePeerNormalizeCommand now executes sync names normalize --store=peer --yes on the peer; the comment that hedged for a peer running a dot that knew only --profile no longer holds.

--profile on apply, diff, config, status, init, watchdog setup|notify and container setup is untouched: that flag selects a dotfiles profile and has nothing to do with the sync store. The codex --profile launch argument in internal/aipolicy is also untouched.

Installed scheduler units

A unit stores the whole command line and the service manager replays it on every tick, and neither dot update nor dot apply rewrites an installed unit, so a scheduler installed for a non-default store kept running dot sync push --profile=<store> and failed with unknown flag on every tick after this change. Both halves of the fix are here:

  • dot sync resume (the command documented as the one that re-arms installed units) rewrites a stale unit from --profile= to --store= before the reload it already performs, and prints ✓ rewrote the installed scheduler unit to call dot sync --store=<store>. The rewrite changes only the flag, so store, mode, interval, --home and log paths stay exactly as installed; a fresh render would re-apply setup's current settings and could silently re-time or re-enable a scheduler. Under --dry-run it prints the rewrite it would make.
  • dot sync status stays read-only and names an installed unit that still calls the retired flag, together with the dot sync --store=<store> pause && dot sync --store=<store> resume pair that heals it.

The peer store is exempt from both: com.dotfiles.peer.plist belongs to dot peer setup (it runs dot peer sync and renders no store argument), and dot sync --store=peer is refused, so rewriting that file would leave a command that cannot run.

Scheduler units checked: every dotfiles unit installed on this Mac (~/Library/LaunchAgents/com.dotfiles.sync.plist, com.dotfiles.peer.plist, com.dotfiles.noindex.plist) carries no store argument, so none of them is affected and none can exercise the migration against a live unit; the new tests do it against real template renders spelled the old way. The peer Mac was unreachable over WARP at review time, so its units are unverified.

Known ceiling: the detection is train-only (a unit whose store argument was written some other way than --profile=/--store= is left alone), and a hand-edited unit that names no store keeps working as before.

Evidence and checks

On 2026-11-09 both Macs run dot 2.80.1 (dot version locally and over ssh on the peer), which knows --store. No peer can be left on a release that only accepts --profile.

  • make docs: regenerates nothing (the flag was hidden, so docs/commands never listed it; no overlap left with refactor(cli)!: remove hidden --include-secrets flag #402).
  • go test ./internal/syncer/...: pass, real-rsync parity tests included (303s).
  • go test ./internal/cli/...: pass, 25s. The TestJSONGoldens/ai_policy_* failure from the previous round was an exported CLAUDE_CONFIG_DIR in the shell; with env -u CLAUDE_CONFIG_DIR the whole suite is green.
  • make lint: 0 issues. make build: ok.
  • New tests: TestSchedulerMigratesUnitsInstalledWithTheRetiredStoreFlag (old-style fixture rendered from the current templates with --store= spelled --profile=, for both the launchd plist and the systemd service, byte-identical to a fresh render after migrating and a no-op on a second pass), TestSchedulerLeavesUnitsWithoutAStoreArgumentAlone, TestSchedulerLeavesThePeerSchedulerUnitAlone, TestRetiredStoreInReadsArgumentBoundaries, TestSyncResumeMigratesAUnitInstalledWithTheRetiredStoreFlag (resume rewrites then reloads, service-manager argv is exactly the state query plus the resume), and TestSyncReportsAUnitInstalledWithTheRetiredStoreFlag (status warns, stays read-only, resume heals it, status is quiet afterwards).

Release note: dot sync no longer accepts the deprecated --profile alias, and the guidance it prints and the jobs it installs use --store; dot sync status now names an installed scheduler unit still running the retired flag and dot sync resume rewrites it in place. Action needed: if dot sync status --store=<store> warns about the installed unit, run dot sync resume --store=<store> (or dot sync --store=<store> pause && dot sync --store=<store> resume), or re-install it with dot sync setup --store=<store> --push-interval=<DUR> / --pull-interval=<DUR>.

…ery message

dot sync accepted --profile as a deprecated alias of --store for one
release after #380. That release is out (v2.80.1 knows --store), so the
alias is removed: `dot sync --profile` now fails with "unknown flag"
instead of warning on stderr, and the fallback that read the flag, the
conflict refusal between the two names, and syncStoreFrom are gone.

Everything dot prints and everything it runs on the peer moves to
--store too: the owner-mismatch and fence refusals, the NFD fix that
peer doctor and peer inventory report, the handover messages, the
conflicts hint at the end of `dot peer sync`, the launchd plist and
systemd unit the scheduler renders, and the spawn-failed reload line.
remotePeerNormalizeCommand now sends --store=peer to the peer; the
comment that hedged for a peer whose dot knew only --profile is no
longer true, because the peer runs the same release as this Mac.

--profile on apply, diff, config, status, init, watchdog setup|notify
and container setup is untouched: that flag picks a dotfiles profile and
is unrelated to the sync store.

Part of #394
Copilot AI balanced review requested due to automatic review settings November 9, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T12:52:59.335194Z 7c007cd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c007cd029

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/sync_cmd.go Resolved
A unit stores the whole command line and the service manager replays it
on every tick, and neither `dot update` nor `dot apply` rewrites an
installed unit. A scheduler installed for a non-default store therefore
kept invoking `dot sync push --profile=<store>` after the alias removal
of #394 and failed with "unknown flag" on every run, silently.

`dot sync resume` is the command that re-arms installed units, so it now
rewrites the retired argument to --store before the reload that follows,
which is what makes the service manager read the new line. The rewrite
changes only the flag: store, mode, interval, --home and log paths stay
exactly as the operator installed them, because a fresh render would
re-apply setup's current settings and could silently re-time or
re-enable a scheduler. `dot sync status` stays read-only and names the
installed unit plus the `dot sync --store=<store> pause && ... resume`
pair that heals it.

The peer store is exempt: com.dotfiles.peer.plist belongs to
`dot peer setup` (it runs `dot peer sync` and renders no store argument),
and `dot sync --store=peer` is refused, so rewriting that file would
leave a command that cannot run.

Verified: this Mac's com.dotfiles.sync.plist carries no store argument
(default store). The peer Mac was unreachable over WARP at review time,
so its units are unverified. The migration was exercised against real
template renders spelled the old way, for both the launchd plist and the
systemd service.

Part of #394
@entelecheia
entelecheia merged commit 6085a41 into main Nov 9, 2026
14 checks passed
@entelecheia
entelecheia deleted the chore/394-store-peer branch November 9, 2026 13:47
entelecheia added a commit that referenced this pull request Nov 9, 2026
Covers #399, #400, #401, #402, #404, #405, #407 and #409. #406 (spec
docs) and #408 (test isolation) are left out per the release-note rules.

Claude-Session: https://claude.ai/code/session_01Vb48Vt5iGMfc7MJWPTCWCL
entelecheia added a commit that referenced this pull request Nov 9, 2026
* chore(release): add v2.81.0 release notes

Covers #399, #400, #401, #402, #404, #405, #407 and #409. #406 (spec
docs) and #408 (test isolation) are left out per the release-note rules.

Claude-Session: https://claude.ai/code/session_01Vb48Vt5iGMfc7MJWPTCWCL

* chore(release): v2.81.0 notes, apply review findings

Name the resume reload fix (#411), the peer pair upgrade, the exact anchor
scope, the dot sync target change and the dot admit wait.

Claude-Session: https://claude.ai/code/session_01Vb48Vt5iGMfc7MJWPTCWCL
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.

2 participants