Skip to content

fix(switch): handle platform plugins and dotagents - #2283

Merged
shunkakinoki merged 1 commit into
mainfrom
codex/fix-switch-fff-dotagents
Aug 6, 2026
Merged

fix(switch): handle platform plugins and dotagents#2283
shunkakinoki merged 1 commit into
mainfrom
codex/fix-switch-fff-dotagents

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use fff.nvim's Darwin target triple and .dylib extension, including Apple Silicon normalization, in activation and post-switch plugin paths.
  • Initialize the dotagents submodule when needed and use a checked-in-content sync for make switch, keeping optional external skill installation on the explicit make sync path.
  • Add focused ShellSpec coverage for both switch boundaries.

Validation

  • shellspec spec/activate_neovim_spec.sh spec/make_switch_spec.sh (21 examples, 0 failures)
  • shellcheck home-manager/programs/neovim/activate-build-plugins.sh
  • make nix-format-check
  • make nix-lint
  • make nix-flake-check reaches the Darwin configurations successfully but cannot build required x86_64-Linux derivations from this aarch64-Darwin host (docker.service.drv, exit 2).
  • Probed the pinned fff release: aarch64-apple-darwin.dylib returns 200; the previously requested arm64-unknown-linux-gnu.so returns 404.

Summary by cubic

Fixes platform handling for fff.nvim by using the Darwin target and .dylib on macOS, and updates switch behavior to sync only checked-in dotagents content after auto-initializing the submodule.

  • Bug Fixes
    • fff.nvim: Normalize arch to aarch64/x86_64, use apple-darwin on macOS, and select .dylib vs .so in the Makefile and activation script.
    • dotagents: Add dotagents-prepare to init the submodule; switch uses dotagents-switch-sync with DOTAGENTS_SKIP_SYNC=1. Full external skill install remains on make sync (skipped in CI).
    • Tests: Add ShellSpec for Darwin triple and .dylib, and for switch using dotagents-switch-sync and submodule init.

Written for commit 115440e. Summary will update on new commits.

Review in cubic

@indent-zero

indent-zero Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Fixes make switch to be robust across two axes: (1) support Darwin/aarch64 when downloading the fff.nvim prebuilt native binary, and (2) tolerate an uninitialized dotagents/ submodule while narrowing switch-time dotagents sync to the CI-safe subset. Also fixes a latent bug where the top-level make sync invoked $(MAKE) -C dotagents sync even though the child sync target was hidden by the parent-forced DOTAGENTS_SKIP_SYNC := 1.

  • Makefile: rewrote nvim-plugins-install to normalize arch (arm64→aarch64, amd64→x86_64) and select .dylib/apple-darwin on Darwin, .so/unknown-linux-{musl,gnu} on Linux, and skip on unsupported OSes.
  • Makefile: added dotagents-prepare that lazy-initializes the dotagents submodule when dotagents/Makefile is missing, and hard-fails if it's still unavailable.
  • Makefile: added dotagents-switch-sync (used by switch) which runs ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync with DOTAGENTS_SKIP_SYNC=1, skipping the external skills install / ruler-apply-global step.
  • Makefile: dotagents-sync now depends on dotagents-prepare and explicitly passes DOTAGENTS_SKIP_SYNC= to the sub-make so the child sync target is actually defined.
  • home-manager/programs/neovim/activate-build-plugins.sh: mirrored the arch normalization and OS-case (Darwin/Linux/*), gating the download on a non-empty triple.
  • home-manager/programs/neovim/default.nix: libExt = if pkgs.stdenv.isDarwin then "dylib" else "so".
  • spec/: new make_switch_spec.sh asserting the new Makefile targets; added ShellSpec cases for aarch64, apple-darwin, and dylib in the neovim spec.

Issues

3 potential issues found:

  • On Darwin, libExt = "dylib" is applied to all three plugins in activate-build-plugins.sh, but telescope-fzf-native and vscode-diff produce .so even on macOS (their upstream Makefile/build.sh do not switch extension). Combined with keymaps.lua hard-coding libfzf.so (line 490) and libvscode_diff*.so (line 510), the activation script's [ ! -f "$fzf_dir/build/libfzf.${LIB_EXT}" ] and ls libvscode_diff*.${LIB_EXT} checks will never match on Darwin and will trigger make clean all / build.sh on every make switch. Scope the dylib extension to the fff.nvim download only and keep so for the other two. → Autofix
  • activate-build-plugins.sh logs "Downloading fff.nvim native binary..." before the OS case decides whether the platform is supported, so unsupported OSes print "Downloading..." immediately followed by "unsupported platform, skipping download". The Makefile equivalent already gates the "Downloading" message on a valid _LIB_EXT; consider moving the echo inside the [ -n "$_triple" ] guard for consistency. → Autofix
  • In nvim-plugins-install, the if [ -n "$$_LIB_EXT" ] guard also swallows the "fff.nvim binary already present" branch on unsupported platforms — purely cosmetic since the download would fail anyway, but it means the recipe reports nothing about an already-cached binary on those OSes. → Autofix

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added platform-aware downloads for the fff.nvim native plugin on supported macOS and Linux systems.
    • Added support for macOS .dylib libraries alongside Linux .so libraries.
    • Added dedicated dotagents preparation and switch synchronization steps.
  • Bug Fixes

    • Unsupported platforms now skip native plugin downloads safely.
  • Tests

    • Added coverage for Apple Silicon, Darwin builds, library extensions, and switch synchronization behavior.

Walkthrough

The change adds platform-aware fff.nvim binary selection and Darwin library handling. It also separates dotagents preparation from switch synchronization and adds tests for both workflows.

Changes

Neovim platform support

Layer / File(s) Summary
Native plugin activation
Makefile, home-manager/programs/neovim/activate-build-plugins.sh, home-manager/programs/neovim/default.nix, spec/activate_neovim_spec.sh
The activation flow selects architecture, Darwin or Linux targets, and musl or glibc. It skips unsupported platforms. Neovim uses dylib on Darwin and so elsewhere. Tests cover Apple Silicon and Darwin behavior.

Dotagents synchronization

Layer / File(s) Summary
Switch synchronization workflow
Makefile, spec/make_switch_spec.sh
dotagents-sync prepares and validates the submodule. dotagents-switch-sync synchronizes checked-in content with external synchronization disabled. ShellSpec tests cover the new targets and ordering.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: enhancement

Poem

A rabbit checks the targets bright,
Darwin binaries hop into sight.
Musl and glibc take their turn,
Dotagents sync as switches burn.
With tests in place, the burrow’s right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the switch and platform plugin changes in the pull request.
Description check ✅ Passed The description accurately covers the platform handling, dotagents synchronization, tests, and validation results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-switch-fff-dotagents

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 237-238: Update the Makefile switch target so nvim-plugins-install
is no longer a parallel prerequisite; invoke it in the switch recipe after
nix-switch and the other prerequisite targets have completed, preserving the
existing switch behavior while serializing native-plugin installation.

In `@spec/make_switch_spec.sh`:
- Around line 7-9: Update the checks in the switch target tests to scope each
assertion to its exact Makefile target declaration rather than searching
arbitrary context ranges. Assert that switch depends on dotagents-switch-sync
and excludes dotagents-sync, dotagents-switch-sync depends on dotagents-prepare,
and the sync target preserves the expected skip variable; use target-aware
parsing or anchored extraction instead of fixed grep -A ranges.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed64f237-7e34-41e4-9ae0-ca7c6ff46784

📥 Commits

Reviewing files that changed from the base of the PR and between 02e0dde and 115440e.

📒 Files selected for processing (5)
  • Makefile
  • home-manager/programs/neovim/activate-build-plugins.sh
  • home-manager/programs/neovim/default.nix
  • spec/activate_neovim_spec.sh
  • spec/make_switch_spec.sh

Comment thread Makefile
Comment on lines 237 to +238
.PHONY: switch
switch: nix-switch services nvim-plugins-install dotagents-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
switch: nix-switch services nvim-plugins-install dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Serialize native-plugin installation after nix-switch.

If make runs with -j, it can start nvim-plugins-install before nix-switch. The plugin scan can then find no new pack directory and exit successfully. The target does not retry after nix-switch completes.

Run nvim-plugins-install from the switch recipe after its prerequisites complete.

Proposed fix
-switch: nix-switch services nvim-plugins-install dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
+switch: nix-switch services dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
+	@$(MAKE) nvim-plugins-install
 	@$(MAKE) refresh
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 237 - 238, Update the Makefile switch target so
nvim-plugins-install is no longer a parallel prerequisite; invoke it in the
switch recipe after nix-switch and the other prerequisite targets have
completed, preserving the existing switch behavior while serializing
native-plugin installation.

Comment thread spec/make_switch_spec.sh
Comment on lines +7 to +9
It 'uses a switch-specific checked-in dotagents sync'
When run grep 'dotagents-switch-sync' "$MAKEFILE"
The output should include 'dotagents-switch-sync'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert target relationships, not only target text.

Line 8 searches the entire Makefile. It passes if dotagents-switch-sync exists, even when switch: no longer depends on it.

Line 13 checks the recipe text but not the dotagents-switch-sync: dotagents-prepare prerequisite. Line 18 checks the skip variable but not that switch: uses dotagents-switch-sync instead of dotagents-sync.

Scope each check to the exact target declaration. Assert the prerequisite edges and assert that switch: excludes dotagents-sync. Avoid fixed grep -A8 and grep -A2 ranges because unrelated line changes can make these checks unreliable.

Based on the supplied Makefile contract, switch includes dotagents-switch-sync in Makefile, Lines 237-239, and the sync targets use dotagents-prepare in Makefile, Lines 341-364.

Also applies to: 12-14, 17-19

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/make_switch_spec.sh` around lines 7 - 9, Update the checks in the switch
target tests to scope each assertion to its exact Makefile target declaration
rather than searching arbitrary context ranges. Assert that switch depends on
dotagents-switch-sync and excludes dotagents-sync, dotagents-switch-sync depends
on dotagents-prepare, and the sync target preserves the expected skip variable;
use target-aware parsing or anchored extraction instead of fixed grep -A ranges.

Comment thread Makefile
_LIB_EXT="so" ;; \
*) _LIB_EXT=""; _TRIPLE=""; echo "fff.nvim: unsupported platform, skipping download" ;; \
esac; \
if [ -n "$$_LIB_EXT" ]; then \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cosmetic: This if [ -n "$$_LIB_EXT" ] gate wraps not just the download but also the [ ! -f "$$FFF_BINARY" ] / "fff.nvim binary already present" branch. On unsupported OSes we won't report a cached binary either. Consider moving the _LIB_EXT guard to wrap only the download block so the "already present" message still fires:

FFF_BINARY="$$FFF_DIR/target/libfff_nvim.$${_LIB_EXT:-so}"; \
if [ ! -f "$$FFF_BINARY" ]; then \
    if [ -n "$$_LIB_EXT" ]; then \
        ...download...; \
    fi; \
else \
    echo "fff.nvim binary already present"; \
fi

Strictly optional — not blocking.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 issues found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="spec/make_switch_spec.sh">

<violation number="1" location="spec/make_switch_spec.sh:8">
P3: These new specs only check that particular substrings exist somewhere in the Makefile (or within a fixed `grep -A` window) rather than asserting the actual target/prerequisite relationships. For example, the first test would still pass even if `switch:` no longer listed `dotagents-switch-sync` as a prerequisite, since `dotagents-switch-sync` also appears in its own target declaration elsewhere in the file. Consider scoping each assertion to the exact target declaration line (e.g., anchoring the grep to `^switch:`) and asserting prerequisite edges directly instead of relying on fixed-size `-A` windows.</violation>
</file>

<file name="home-manager/programs/neovim/default.nix">

<violation number="1" location="home-manager/programs/neovim/default.nix:22">
P2: Changing libExt to dylib on Darwin is applied globally, so the telescope-fzf-native and vscode-diff presence checks now look for a `.dylib` that those builds never produce (they emit `libfzf.so` / `libvscode_diff*.so`, as keymaps.lua also expects). Result: on every `make switch` on macOS those two plugins are force-rebuilt (`make clean all`) even when nothing changed. Scope the dylib handling to fff.nvim's download only and keep `so` for the telescope-fzf-native and vscode-diff checks.</violation>
</file>

<file name="Makefile">

<violation number="1" location="Makefile:238">
P2: Listing `nvim-plugins-install` as a parallel prerequisite of `switch` means that under `make -j`, it can run concurrently with (or before) `nix-switch` finishes, potentially finding no pack directory yet and exiting successfully without retrying. Consider running `nvim-plugins-install` explicitly from the `switch` recipe body after its prerequisites complete, rather than as a parallel prerequisite.</violation>

<violation number="2" location="Makefile:364">
P3: The new `dotagents-switch-sync` target duplicates the exact recipe already present in the CI branch of `dotagents-sync` (the `DOTAGENTS_SKIP_SYNC=1 ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync` invocation). This is the 'sync checked-in dotagents content only' behavior now used in two places, so any future change to which sub-targets a checked-in-only sync runs (or to the skip flag) must be applied twice and can easily drift. Consider extracting a shared helper target, e.g. `dotagents-sync-checked`, that both `dotagents-sync`'s CI branch and `dotagents-switch-sync` depend on, so the recipe lives in one place.</violation>
</file>

<file name="spec/activate_neovim_spec.sh">

<violation number="1" location="spec/activate_neovim_spec.sh:71">
P3: The two new tests are tautological: they grep the script source for the literal strings `aarch64` / `apple-darwin`, which exist verbatim in the implementation, so they pass unconditionally and provide false confidence. They can't detect a regression in the actual platform dispatch (e.g., a wrong arch/triple pairing, a dropped Darwin guard, or a broken download URL construction) because they assert the presence of a static string, not the resulting behavior. Consider asserting on the constructed output instead — for instance, running the arch/triple resolution logic and checking the produced URL/triple, or testing the branch decision — so these tests actually pin the Darwin behavior they claim to cover.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

pkgs.gcc
];
libExt = "so";
libExt = if pkgs.stdenv.isDarwin then "dylib" else "so";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Changing libExt to dylib on Darwin is applied globally, so the telescope-fzf-native and vscode-diff presence checks now look for a .dylib that those builds never produce (they emit libfzf.so / libvscode_diff*.so, as keymaps.lua also expects). Result: on every make switch on macOS those two plugins are force-rebuilt (make clean all) even when nothing changed. Scope the dylib handling to fff.nvim's download only and keep so for the telescope-fzf-native and vscode-diff checks.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/programs/neovim/default.nix, line 22:

<comment>Changing libExt to dylib on Darwin is applied globally, so the telescope-fzf-native and vscode-diff presence checks now look for a `.dylib` that those builds never produce (they emit `libfzf.so` / `libvscode_diff*.so`, as keymaps.lua also expects). Result: on every `make switch` on macOS those two plugins are force-rebuilt (`make clean all`) even when nothing changed. Scope the dylib handling to fff.nvim's download only and keep `so` for the telescope-fzf-native and vscode-diff checks.</comment>

<file context>
@@ -19,7 +19,7 @@ let
         pkgs.gcc
       ];
-  libExt = "so";
+  libExt = if pkgs.stdenv.isDarwin then "dylib" else "so";
 in
 {
</file context>

Comment thread Makefile

.PHONY: switch
switch: nix-switch services nvim-plugins-install dotagents-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
switch: nix-switch services nvim-plugins-install dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Listing nvim-plugins-install as a parallel prerequisite of switch means that under make -j, it can run concurrently with (or before) nix-switch finishes, potentially finding no pack directory yet and exiting successfully without retrying. Consider running nvim-plugins-install explicitly from the switch recipe body after its prerequisites complete, rather than as a parallel prerequisite.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 238:

<comment>Listing `nvim-plugins-install` as a parallel prerequisite of `switch` means that under `make -j`, it can run concurrently with (or before) `nix-switch` finishes, potentially finding no pack directory yet and exiting successfully without retrying. Consider running `nvim-plugins-install` explicitly from the `switch` recipe body after its prerequisites complete, rather than as a parallel prerequisite.</comment>

<file context>
@@ -200,37 +200,42 @@ nvim-plugins-install: ## Download/build missing Neovim native plugin binaries (f
 
 .PHONY: switch
-switch: nix-switch services nvim-plugins-install dotagents-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
+switch: nix-switch services nvim-plugins-install dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
 	@$(MAKE) refresh
 
</file context>
Suggested change
switch: nix-switch services nvim-plugins-install dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
switch: nix-switch services dotagents-switch-sync ## Apply Nix config, refresh services/plugins, and refresh agent daemons.
@$(MAKE) nvim-plugins-install

Comment thread spec/make_switch_spec.sh
MAKEFILE="$PWD/Makefile"

It 'uses a switch-specific checked-in dotagents sync'
When run grep 'dotagents-switch-sync' "$MAKEFILE"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: These new specs only check that particular substrings exist somewhere in the Makefile (or within a fixed grep -A window) rather than asserting the actual target/prerequisite relationships. For example, the first test would still pass even if switch: no longer listed dotagents-switch-sync as a prerequisite, since dotagents-switch-sync also appears in its own target declaration elsewhere in the file. Consider scoping each assertion to the exact target declaration line (e.g., anchoring the grep to ^switch:) and asserting prerequisite edges directly instead of relying on fixed-size -A windows.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At spec/make_switch_spec.sh, line 8:

<comment>These new specs only check that particular substrings exist somewhere in the Makefile (or within a fixed `grep -A` window) rather than asserting the actual target/prerequisite relationships. For example, the first test would still pass even if `switch:` no longer listed `dotagents-switch-sync` as a prerequisite, since `dotagents-switch-sync` also appears in its own target declaration elsewhere in the file. Consider scoping each assertion to the exact target declaration line (e.g., anchoring the grep to `^switch:`) and asserting prerequisite edges directly instead of relying on fixed-size `-A` windows.</comment>

<file context>
@@ -0,0 +1,21 @@
+MAKEFILE="$PWD/Makefile"
+
+It 'uses a switch-specific checked-in dotagents sync'
+When run grep 'dotagents-switch-sync' "$MAKEFILE"
+The output should include 'dotagents-switch-sync'
+End
</file context>

Comment thread Makefile
.PHONY: dotagents-switch-sync
dotagents-switch-sync: dotagents-prepare ## Sync checked-in dotagents content during switch.
@echo "🔄 Syncing checked-in dotagents content..."
@$(MAKE) -C dotagents DOTAGENTS_SKIP_SYNC=1 ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The new dotagents-switch-sync target duplicates the exact recipe already present in the CI branch of dotagents-sync (the DOTAGENTS_SKIP_SYNC=1 ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync invocation). This is the 'sync checked-in dotagents content only' behavior now used in two places, so any future change to which sub-targets a checked-in-only sync runs (or to the skip flag) must be applied twice and can easily drift. Consider extracting a shared helper target, e.g. dotagents-sync-checked, that both dotagents-sync's CI branch and dotagents-switch-sync depend on, so the recipe lives in one place.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 364:

<comment>The new `dotagents-switch-sync` target duplicates the exact recipe already present in the CI branch of `dotagents-sync` (the `DOTAGENTS_SKIP_SYNC=1 ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync` invocation). This is the 'sync checked-in dotagents content only' behavior now used in two places, so any future change to which sub-targets a checked-in-only sync runs (or to the skip flag) must be applied twice and can easily drift. Consider extracting a shared helper target, e.g. `dotagents-sync-checked`, that both `dotagents-sync`'s CI branch and `dotagents-switch-sync` depend on, so the recipe lives in one place.</comment>

<file context>
@@ -334,13 +339,29 @@ upgrade-dev: ## Upgrade inside the Nix dev shell (mirrors CI).
+.PHONY: dotagents-switch-sync
+dotagents-switch-sync: dotagents-prepare ## Sync checked-in dotagents content during switch.
+	@echo "🔄 Syncing checked-in dotagents content..."
+	@$(MAKE) -C dotagents DOTAGENTS_SKIP_SYNC=1 ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync
 
 .PHONY: codex-security-sync
</file context>

The output should include 'aarch64'
End

It 'uses the Darwin fff.nvim target triple'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The two new tests are tautological: they grep the script source for the literal strings aarch64 / apple-darwin, which exist verbatim in the implementation, so they pass unconditionally and provide false confidence. They can't detect a regression in the actual platform dispatch (e.g., a wrong arch/triple pairing, a dropped Darwin guard, or a broken download URL construction) because they assert the presence of a static string, not the resulting behavior. Consider asserting on the constructed output instead — for instance, running the arch/triple resolution logic and checking the produced URL/triple, or testing the branch decision — so these tests actually pin the Darwin behavior they claim to cover.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At spec/activate_neovim_spec.sh, line 71:

<comment>The two new tests are tautological: they grep the script source for the literal strings `aarch64` / `apple-darwin`, which exist verbatim in the implementation, so they pass unconditionally and provide false confidence. They can't detect a regression in the actual platform dispatch (e.g., a wrong arch/triple pairing, a dropped Darwin guard, or a broken download URL construction) because they assert the presence of a static string, not the resulting behavior. Consider asserting on the constructed output instead — for instance, running the arch/triple resolution logic and checking the produced URL/triple, or testing the branch decision — so these tests actually pin the Darwin behavior they claim to cover.</comment>

<file context>
@@ -63,6 +63,16 @@ When run bash -c "grep 'uname -m' '$SCRIPT'"
+The output should include 'aarch64'
+End
+
+It 'uses the Darwin fff.nvim target triple'
+When run grep 'apple-darwin' "$SCRIPT"
+The output should include 'apple-darwin'
</file context>

pkgs.gcc
];
libExt = "so";
libExt = if pkgs.stdenv.isDarwin then "dylib" else "so";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perpetual rebuilds on macOS: libExt is threaded through activate-build-plugins.sh and used for all three plugins, but only fff.nvim actually publishes/produces a .dylib on Darwin. Both telescope-fzf-native and vscode-diff produce .so even on macOS:

  • telescope-fzf-native.nvim's upstream Makefile unconditionally sets TARGET := libfzf.so on non-Windows.
  • keymaps.lua in this repo also hard-codes .so in the presence check:
    • home-manager/programs/neovim/lua/config/keymaps.lua:490filereadable(fzf_dir .. "/build/libfzf.so")
    • home-manager/programs/neovim/lua/config/keymaps.lua:510glob(vsd_dir .. "/libvscode_diff*.so")

With libExt = "dylib", activate-build-plugins.sh will check libfzf.dylib / libvscode_diff*.dylib on Darwin, find nothing, force make -C "$fzf_dir" clean all and re-run build.sh on every make switch. The rebuild still produces .so, so the cache check will fail again next switch — a perpetual clean-rebuild loop.

Suggested fix: keep libExt = "so" globally and localize the Darwin extension inside activate-build-plugins.sh (and the Makefile nvim-plugins-install recipe) to the fff.nvim block only, e.g. a fff_ext variable derived from uname -s.

@shunkakinoki
shunkakinoki merged commit 230f3d6 into main Aug 6, 2026
39 checks passed
@shunkakinoki
shunkakinoki deleted the codex/fix-switch-fff-dotagents branch August 6, 2026 12:51
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