Skip to content

Dotfile and symlink management - #3

Merged
Colin23 merged 4 commits into
mainfrom
dotfiles-symlinks
Apr 30, 2026
Merged

Colin23 merged 4 commits into
mainfrom
dotfiles-symlinks

Conversation

@Colin23

@Colin23 Colin23 commented Apr 30, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation

    • Restructured guides with new setup and contribution documentation
    • Removed legacy implementation and testing strategy documents
  • New Features

    • Added zoxide to core CLI tools
    • Enhanced bootstrap workflow with explicit step-by-step instructions
    • Updated SSH key generation workflow with named personal GitHub key
    • Enhanced dotfiles module with development directory structure
  • Chores

    • Removed archived application and package configurations
    • Updated test scripts to skip SSH and dotfiles modules in Docker tests

…ifests and improve dotfiles strategy documentation
@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Colin23 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 3 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d81377b5-7eaf-4a05-8285-8440554e2e78

📥 Commits

Reviewing files that changed from the base of the PR and between 4b65d83 and e782fb2.

📒 Files selected for processing (4)
  • README.md
  • docs/architecture.md
  • docs/tool-inventory.md
  • runs/10-core-cli
📝 Walkthrough

Walkthrough

This PR removes archived installation configurations, reorganizes project documentation with clearer structured guides, and enhances the bootstrap workflow with improved SSH key management and dotfiles handling. Multiple runner scripts are refactored to strengthen security practices and idempotency.

Changes

Cohort / File(s) Summary
Archive cleanup
archive/installation/applications/*, archive/installation/packages/*, archive/runs/asdf
Removes all archived application configs (keepassxc, obsidian, onlyoffice, zen), package definitions (arch-based, programming-tools/*), and the asdf bootstrap script. Also deletes archive/installation/packages/todo.txt.
Documentation reorganization
docs/00-vision.md, docs/01-architecture.md, docs/02-operating-model.md, docs/03-implementation-plan.md, docs/04-testing-strategy.md, docs/05-platform-roadmap.md, docs/07-definition-of-done.md, docs/08-milestone-1-arch-mvp.md
Removes legacy phase/milestone-based planning documents and architecture specs, consolidating into a cleaner documentation structure.
New architecture & contributing guides
docs/architecture.md, docs/contributing.md, docs/new-machine-setup.md
Introduces three new documentation files: revised architecture covering vision/components/contracts, contribution procedures with testing matrices, and a step-by-step new-machine bootstrap guide with timing and prerequisites.
Documentation updates
docs/09-bootstrap-and-onboarding.md, docs/tool-inventory.md, tests/README.md, README.md
Transforms onboarding outline into detailed runbook; simplifies tool inventory by removing automation/milestone columns; updates test documentation with skip matrices and VM workflows; expands README with quick-start examples and repo structure diagram.
SSH key & dotfiles workflow enhancements
runs/30-git-ssh, runs/80-dotfiles, runs/99-manual
Refactors git-ssh module to use named personal-github-key, adds SSH connectivity verification, removes interactive git config (deferred to dotfiles). Enhances dotfiles module to default to SSH URLs, gate on SSH auth, add $HOME/development directory structure, explicit symlink mappings, and comprehensive verification checks. Updates manual step to reference new key path.
Core tooling & test updates
runs/10-core-cli, tests/docker-arch, tests/docker-ubuntu, run
Adds zoxide to core-cli toolset across platforms with platform-specific verification. Extends Docker skip lists to exclude git-ssh and dotfiles from all test runs. Adds --help usage example to run script.

Sequence Diagram(s)

The changes primarily consist of archive cleanup, documentation reorganization, and incremental enhancements to existing runner scripts. While individual modules (git-ssh, dotfiles) gain additional logic, the overall changes do not introduce a new integrated feature with 3+ distinct components and a clear sequential flow that would warrant visualization beyond the documentation already provided.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 The archive gathers dust as we leap ahead,
New docs light the path, old phases shed,
Keys named with purpose, dotfiles in sync—
A cleaner machine setup, barely a blink! 🔑✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Dotfile and symlink management' is partially related to the changeset. While the PR does include significant dotfiles and symlink management changes (runs/80-dotfiles script, runs/30-git-ssh changes, tests/docker-arch/ubuntu updates), it encompasses a much broader scope including archive removals, documentation restructuring, core CLI tooling updates, and new architecture guides. Consider a more comprehensive title that captures the primary intent, such as 'Refactor bootstrap runbook and symlink management' or similar, to better reflect the scope of documentation rewrites and archive cleanup alongside dotfiles changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dotfiles-symlinks

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
Review rate limit: 0/1 reviews remaining, refill in 44 minutes and 3 seconds.

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

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
runs/30-git-ssh (1)

46-99: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Respect DRY_RUN for interactive and network operations.

Dry-run currently still executes interactive prompts (Line 51), reads/prints key material (Line 62), and performs live SSH connectivity checks (Line 89). This can fail in dry-run and violates the runner contract.

Proposed fix
 if [[ -f "$SSH_KEY_PATH" ]]; then
     log_info "SSH key already exists: $SSH_KEY_PATH"
 else
+    if [[ "${DRY_RUN:-0}" == "1" ]]; then
+        log_info "would generate personal SSH key at: $SSH_KEY_PATH"
+    elif [[ -t 0 ]]; then
-    if [[ -t 0 ]]; then
         log_info "Generating personal SSH key ($SSH_KEY_NAME)..."
         run_cmd mkdir -p "$HOME/.ssh"
         run_cmd chmod 700 "$HOME/.ssh"
@@
-            cat "${SSH_KEY_PATH}.pub"
+            cat "${SSH_KEY_PATH}.pub"
@@
-    else
+    else
         log_warn "Non-interactive shell — skipping SSH key generation (run interactively to set up)"
     fi
 fi
@@
 log_info "Testing SSH connectivity to GitHub..."
-ssh_output="$(ssh -T git@github.com 2>&1 || true)"
+if [[ "${DRY_RUN:-0}" == "1" ]]; then
+    log_info "would test SSH connectivity to GitHub"
+else
+    ssh_output="$(ssh -T git@github.com 2>&1 || true)"
 
-if echo "$ssh_output" | grep -qi "successfully authenticated"; then
-    log_success "SSH authentication to GitHub working"
-else
-    log_warn "SSH authentication to GitHub failed — key may not be registered yet"
-    log_info "Add your key at: https://github.com/settings/ssh/new"
-    if [[ -f "${SSH_KEY_PATH}.pub" ]]; then
-        log_info "Public key: $(cat "${SSH_KEY_PATH}.pub")"
+    if echo "$ssh_output" | grep -qi "successfully authenticated"; then
+        log_success "SSH authentication to GitHub working"
+    else
+        log_warn "SSH authentication to GitHub failed — key may not be registered yet"
+        log_info "Add your key at: https://github.com/settings/ssh/new"
+        if [[ -f "${SSH_KEY_PATH}.pub" ]]; then
+            log_info "Public key: $(cat "${SSH_KEY_PATH}.pub")"
+        fi
     fi
-fi
+fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@runs/30-git-ssh` around lines 46 - 99, The script currently ignores DRY_RUN
when doing interactive prompts, printing key material, and network tests; update
the interactive/key-generation block (around read -rp, ssh-keygen, and cat
"${SSH_KEY_PATH}.pub") and the SSH connectivity/test block (ssh -T
git@github.com, ssh-agent/ssh-add invocations) to first check DRY_RUN (e.g. if
[[ "${DRY_RUN:-}" == "true" ]] then skip prompts, generation, printing and
network tests), and when DRY_RUN is set only log what would have been done (use
log_info/log_warn) instead of running ssh-keygen, ssh-add, ssh-agent, cat, or
ssh -T so no interactive or network operations execute during dry runs.
🧹 Nitpick comments (1)
runs/80-dotfiles (1)

137-146: 💤 Low value

Non-symlink files are warned but don't cause failure.

When a path exists but is not a symlink (line 140-141), it's logged as a warning but doesn't increment the error count. This means the module will succeed even if ensure_symlink failed to replace a file with a symlink.

If ensure_symlink ran successfully, this case shouldn't occur (it backs up existing files before symlinking). However, if the user manually created a file after the symlink was made, or if ensure_symlink silently failed, the verification would pass with just a warning.

Consider incrementing errors here to enforce that all paths must be symlinks for the module to succeed.

💡 Optional: treat non-symlinks as errors
     if [[ -L "$link" ]]; then
         log_success "symlink OK: $link"
     elif [[ -e "$link" ]]; then
-        log_warn "exists but not a symlink: $link"
+        log_error "exists but not a symlink: $link"
+        errors=$((errors + 1))
     else
         log_error "missing: $link"
         errors=$((errors + 1))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@runs/80-dotfiles` around lines 137 - 146, The verification loop over
VERIFY_LINKS currently treats existing non-symlink paths as warnings only;
update the elif branch (the check using [[ -e "$link" ]]) to treat this as a
failure by incrementing errors (errors=$((errors + 1))) and/or switching the
call from log_warn to log_error so a non-symlinked path causes the module to
fail; this ensures mismatches after ensure_symlink (or silent failures) are
surfaced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/06-tool-inventory.md`:
- Line 58: Update the zoxide row in docs/06-tool-inventory.md so the Ubuntu
install method reflects the actual behavior in runs/10-core-cli: change the
"manual" entry to "apt/manual" (or "apt → manual") to indicate it attempts apt
install first and falls back to manual; reference the table row containing
"zoxide" and the workflow file runs/10-core-cli for consistency.

In `@docs/09-bootstrap-and-onboarding.md`:
- Around line 163-164: Update the Docker section text to match current test
behavior: change the claim that "80-dotfiles" is safe in Docker to state that
the "80-dotfiles" script is currently skipped by Docker smoke tests, while
"99-manual" remains safe (prints text); reference the test entries that perform
the skip (tests/docker-arch and tests/docker-ubuntu) and adjust the wording so
documentation reflects that "80-dotfiles" is not run in Docker smoke tests.

In `@run`:
- Line 9: There is a typo in the usage comment string "#   ./run --help         
# sprints available flags" — change "sprints available flags" to "prints
available flags" so the comment reads "#   ./run --help                    #
prints available flags"; update the exact comment text in the run script where
that string occurs.

---

Outside diff comments:
In `@runs/30-git-ssh`:
- Around line 46-99: The script currently ignores DRY_RUN when doing interactive
prompts, printing key material, and network tests; update the
interactive/key-generation block (around read -rp, ssh-keygen, and cat
"${SSH_KEY_PATH}.pub") and the SSH connectivity/test block (ssh -T
git@github.com, ssh-agent/ssh-add invocations) to first check DRY_RUN (e.g. if
[[ "${DRY_RUN:-}" == "true" ]] then skip prompts, generation, printing and
network tests), and when DRY_RUN is set only log what would have been done (use
log_info/log_warn) instead of running ssh-keygen, ssh-add, ssh-agent, cat, or
ssh -T so no interactive or network operations execute during dry runs.

---

Nitpick comments:
In `@runs/80-dotfiles`:
- Around line 137-146: The verification loop over VERIFY_LINKS currently treats
existing non-symlink paths as warnings only; update the elif branch (the check
using [[ -e "$link" ]]) to treat this as a failure by incrementing errors
(errors=$((errors + 1))) and/or switching the call from log_warn to log_error so
a non-symlinked path causes the module to fail; this ensures mismatches after
ensure_symlink (or silent failures) are surfaced.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3a59e6b-a6a2-41d6-bf94-6812cd962838

📥 Commits

Reviewing files that changed from the base of the PR and between 2a1c65b and ec34863.

📒 Files selected for processing (38)
  • archive/installation/applications/keepassxc.toml
  • archive/installation/applications/obsidian.toml
  • archive/installation/applications/onlyoffice.toml
  • archive/installation/applications/zen.toml
  • archive/installation/packages/arch-based.toml
  • archive/installation/packages/programming-tools/_missing-compose.toml
  • archive/installation/packages/programming-tools/_missing-docker.toml
  • archive/installation/packages/programming-tools/_missing-hcloud.toml
  • archive/installation/packages/programming-tools/_missing-packer.toml
  • archive/installation/packages/programming-tools/_missing-php.toml
  • archive/installation/packages/programming-tools/_missing-uv.toml
  • archive/installation/packages/programming-tools/elixir.toml
  • archive/installation/packages/programming-tools/erlang.toml
  • archive/installation/packages/programming-tools/gleam.toml
  • archive/installation/packages/programming-tools/go.toml
  • archive/installation/packages/programming-tools/gradle.toml
  • archive/installation/packages/programming-tools/java.toml
  • archive/installation/packages/programming-tools/kotlin.toml
  • archive/installation/packages/programming-tools/maven.toml
  • archive/installation/packages/programming-tools/node.toml
  • archive/installation/packages/programming-tools/opentofu.toml
  • archive/installation/packages/programming-tools/terraform.toml
  • archive/installation/packages/todo.txt
  • archive/runs/asdf
  • docs/03-implementation-plan.md
  • docs/04-testing-strategy.md
  • docs/06-tool-inventory.md
  • docs/08-milestone-1-arch-mvp.md
  • docs/09-bootstrap-and-onboarding.md
  • docs/10-dotfiles-strategy.md
  • run
  • runs/10-core-cli
  • runs/30-git-ssh
  • runs/80-dotfiles
  • runs/99-manual
  • tests/README.md
  • tests/docker-arch
  • tests/docker-ubuntu
💤 Files with no reviewable changes (20)
  • archive/installation/applications/zen.toml
  • archive/installation/applications/obsidian.toml
  • archive/installation/applications/keepassxc.toml
  • archive/installation/packages/programming-tools/elixir.toml
  • archive/installation/applications/onlyoffice.toml
  • docs/03-implementation-plan.md
  • archive/installation/packages/programming-tools/maven.toml
  • archive/installation/packages/programming-tools/kotlin.toml
  • archive/installation/packages/programming-tools/gradle.toml
  • docs/04-testing-strategy.md
  • archive/installation/packages/todo.txt
  • archive/installation/packages/programming-tools/java.toml
  • archive/installation/packages/programming-tools/terraform.toml
  • archive/installation/packages/programming-tools/opentofu.toml
  • archive/installation/packages/arch-based.toml
  • archive/installation/packages/programming-tools/go.toml
  • archive/installation/packages/programming-tools/erlang.toml
  • archive/installation/packages/programming-tools/node.toml
  • archive/installation/packages/programming-tools/gleam.toml
  • archive/runs/asdf

Comment thread docs/06-tool-inventory.md Outdated
| fzf | cli ux | 10-core-cli | pacman | apt | brew | `fzf --version` | m1 |
| starship | shell prompt | 20-shell | pacman | apt | brew | `starship --version` | m1 |
| eza | cli ux | 10-core-cli | pacman | manual | brew | `eza --version` | m1 |
| zoxide | cli ux | 10-core-cli | pacman | manual | brew | `zoxide --version` | m1 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align Ubuntu zoxide method with current module behavior.

Line 58 lists Ubuntu as manual, but runs/10-core-cli (Lines 41–43) does attempt apt install first and falls back to manual. Consider documenting this as apt/manual (or equivalent) to match actual behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/06-tool-inventory.md` at line 58, Update the zoxide row in
docs/06-tool-inventory.md so the Ubuntu install method reflects the actual
behavior in runs/10-core-cli: change the "manual" entry to "apt/manual" (or "apt
→ manual") to indicate it attempts apt install first and falls back to manual;
reference the table row containing "zoxide" and the workflow file
runs/10-core-cli for consistency.

Comment thread docs/09-bootstrap-and-onboarding.md Resolved
Comment thread run Resolved

@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: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/architecture.md`:
- Around line 24-32: The fenced code block in docs/architecture.md (the
directory layout block starting with "setup/") lacks a language specifier;
update the opening fence to include a language identifier (e.g., ```text or
```bash) so it matches README.md and satisfies markdown lint rules, ensuring the
block that lists "setup/", "lib/common", "runs/NN-name", "scripts/lint",
"tests/", and "docs/" is changed accordingly.

In `@docs/tool-inventory.md`:
- Line 32: Replace the incorrect lowercase "macos method (future)" header with
the proper Apple-branded capitalization "macOS method (future)" in the three
table headers where it appears; update each occurrence of the header text (exact
match "macos method (future)") to "macOS method (future)" in
docs/tool-inventory.md so all tables show the correct "macOS" capitalization.
- Around line 9-12: Remove or update the stale bullet "In which implementation
phase each item will be automated" in the docs/tool-inventory.md header so it
matches the current table structure (which no longer has automation/phase
columns); specifically edit the list of bullets at the top (the one containing
"What should exist on the machine", "How each item is installed", "How
installation is verified", and the stale "In which implementation phase each
item will be automated") to either delete that final bullet or replace it with a
bullet that reflects the current table columns.

In `@README.md`:
- Around line 31-39: The fenced code block in README.md showing the repository
tree is missing a language specifier; update the opening triple-backtick for
that block to include a plain text language (e.g., change ``` to ```text) so the
block becomes a labeled plaintext block and satisfies the linter without
altering the repository tree content (affecting the fenced code block around the
setup/ tree).

In `@runs/10-core-cli`:
- Around line 40-43: The zoxide branch currently only logs a warning when
has_cmd zoxide returns false; change it to attempt installation by calling
pkg_install zoxide and only emit log_warn if that installation fails (or if
pkg_install indicates apt is unavailable). Update the snippet around the has_cmd
check to call pkg_install "zoxide", check its exit/result, and call log_warn
"zoxide not available via apt — install manually" only on failure, using the
existing functions has_cmd, pkg_install, and log_warn to locate and modify the
logic.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 973a5cc8-8260-49b4-8317-4d8175d01f2b

📥 Commits

Reviewing files that changed from the base of the PR and between ec34863 and 4b65d83.

📒 Files selected for processing (18)
  • README.md
  • docs/00-vision.md
  • docs/01-architecture.md
  • docs/02-operating-model.md
  • docs/03-implementation-plan.md
  • docs/04-testing-strategy.md
  • docs/05-platform-roadmap.md
  • docs/07-definition-of-done.md
  • docs/08-milestone-1-arch-mvp.md
  • docs/architecture.md
  • docs/contributing.md
  • docs/new-machine-setup.md
  • docs/tool-inventory.md
  • run
  • runs/10-core-cli
  • runs/30-git-ssh
  • runs/80-dotfiles
  • tests/README.md
💤 Files with no reviewable changes (8)
  • docs/07-definition-of-done.md
  • docs/04-testing-strategy.md
  • docs/05-platform-roadmap.md
  • docs/02-operating-model.md
  • docs/00-vision.md
  • docs/03-implementation-plan.md
  • docs/01-architecture.md
  • docs/08-milestone-1-arch-mvp.md
✅ Files skipped from review due to trivial changes (2)
  • run
  • docs/new-machine-setup.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/README.md
  • runs/30-git-ssh

Comment thread docs/architecture.md Resolved
Comment thread docs/tool-inventory.md Resolved
Comment thread docs/tool-inventory.md Resolved
Comment thread README.md Resolved
Comment thread runs/10-core-cli Resolved
@Colin23
Colin23 merged commit b2af84b into main Apr 30, 2026
1 check passed
@Colin23
Colin23 deleted the dotfiles-symlinks branch April 30, 2026 17:22
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