Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jobs:
- name: Check installer symlink safety
run: ./scripts/check-install-symlinks.sh

- name: Check gs sync runs gentle-ai sync
run: bash scripts/test-gs-sync.sh

- name: Check Nix Home Manager preflight contracts
run: bash scripts/test-nix-preflight.sh

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ El preflight es de solo lectura y sin red: usa `--offline` y `--no-write-lock-fi
| Zsh y Ghostty | Configuración actual, sin cambios |
| `~/.config/fish/conf.d/99-local.fish` | Host; reservado para secretos/estado privado futuro, no creado ni gestionado por Nix |
| `flake.nix` y `nix/home.nix` | Base inactiva de Home Manager |
| Linux | La configuración pura para Linux es `homeConfigurations.jbarbat-linux`: usa `x86_64-linux`, `/home/jbarbat` y declara solo `fish` y `starship` como runtime mínimo. |
| Fish compartido | Home Manager mapea cada archivo declarado de forma explícita; no gestiona el directorio completo, historial ni variables Fish. |

El bootstrap queda explícitamente diferido a un work unit revisado. Después de instalar Nix por fuera de este repositorio, ese trabajo podrá generar el lock con:

Expand Down
23 changes: 21 additions & 2 deletions bin/gs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ gs - gentle-shell on main, plus one disposable worktree per PR
gs review <repo> <pr> Check out someone else's PR to test or review it
gs base <repo> Clean origin/main worktree, to compare failures
gs run [pi args...] Run gentle-shell --link with this worktree as --package-root
gs sync Bring gentle-shell, gentle-ai and engram to main and check
compatibility (workshop: local clones; elsewhere: GitHub)
gs sync Bring gentle-shell, gentle-ai and engram to main, run
gentle-ai sync for managed configs, and check compatibility
(workshop: local clones; elsewhere: GitHub)
GS_SYNC_AGENTS=a,b scopes gentle-ai sync to those runtimes;
GS_SKIP_AI_SYNC=1 skips it (binaries only)
gs ls List open worktrees
gs done Remove the current worktree and its merged local branch
(drops odd/tasks records; refuses if real work would be lost)
Expand Down Expand Up @@ -342,6 +345,22 @@ cmd_sync() {
ln -sfn "$ai_bin" "$HOME/.local/bin/gentle-ai"
ln -sfn "$bin/engram" "$HOME/.local/bin/engram"

# New binaries are not enough: gentle-ai sync materializes the managed configs
# (agents, skills, plugins, engram instructions) every runtime reads.
# GS_SYNC_AGENTS scopes runtimes per host (local env); empty = gentle-ai default.
if [ "${GS_SKIP_AI_SYNC:-}" = 1 ]; then
printf ' %-34s skipped (GS_SKIP_AI_SYNC=1)\n' 'gentle-ai sync'
else
local ai_sync=(sync)
[ -n "${GS_SYNC_AGENTS:-}" ] && ai_sync+=(--agents "$GS_SYNC_AGENTS")
run_quiet 'gentle-ai sync' "$ai_bin" "${ai_sync[@]}"
fi
# gs sync is the only upgrade path; older homemade scripts drift the hosts apart.
for name in "$HOME/.local/bin/gentle-maintainer-upgrade" "$HOME/.local/bin/gentle-sync.sh" \
/usr/bin/gentle-sync.sh /usr/local/bin/gentle-upgrade.sh /bin/gentle-upgrade.sh; do
[ -e "$name" ] && printf 'WARN: legacy upgrade script %s; use gs sync only and remove it\n' "$name"
done

# Versions after the sync decide the closing message: restart only on change.
local shell_after ai_after engram_after changed
shell_after=$(shell_version); ai_after=$(ai_version); engram_after=$(engram_version)
Expand Down
6 changes: 6 additions & 0 deletions fish/conf.d/10-core.fish
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ else
alias la 'ls -lah -A'
end

# gentle-ai's managed launchers (OpenCode background subagents) must win on PATH;
# gentle-ai cannot persist PATH for fish login shells by itself.
if test -d "$HOME/.gentle-ai/bin"
fish_add_path --path --move "$HOME/.gentle-ai/bin"
end

if status is-interactive; and command -q starship
starship init fish | source
end
4 changes: 4 additions & 0 deletions fish/conf.d/99-local.fish.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
# set -gx GIT_WORKDEV_EMAIL "you@company.invalid"
# set -gx GIT_PERSONALDEV_NAME "Your personal name"
# set -gx GIT_PERSONALDEV_EMAIL "you@personal.invalid"
# gs sync runs gentle-ai sync after updating binaries. Scope it to this host's runtimes:
# set -gx GS_SYNC_AGENTS claude-code,opencode,pi
# Binaries only, no managed-config sync:
# set -gx GS_SKIP_AI_SYNC 1
54 changes: 54 additions & 0 deletions fish/functions/gbarbatdev.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Open an isolated Ghostty instance with the Barbatdev profile. Usage: gbarbatdev [ghostty args...]
function gbarbatdev --description 'Open Ghostty with the Barbatdev profile'
if not command -q open
printf 'gbarbatdev: macOS open command is not available\n' >&2
return 127
end

set -l ghostty /Applications/Ghostty.app/Contents/MacOS/ghostty
if not test -x "$ghostty"
printf 'gbarbatdev: Ghostty.app is not installed in /Applications\n' >&2
return 1
end

set -l base "$HOME/.config/ghostty/config"
set -l profile "$HOME/.config/ghostty/profiles/barbatdev.conf"
if not test -r "$base"
printf 'gbarbatdev: missing readable config: %s\n' "$base" >&2
return 1
end
if not test -r "$profile"
printf 'gbarbatdev: missing readable config: %s\n' "$profile" >&2
return 1
end

set -l tmp_dir (command mktemp -d)
set -l mktemp_status $status
if test $mktemp_status -ne 0
return $mktemp_status
end
if test -z "$tmp_dir"
return 1
end

set -l config "$tmp_dir/config.ghostty"
printf 'config-file = "%s"\nconfig-file = "%s"\n' "$base" "$profile" > "$config"
set -l compose_status $status
if test $compose_status -ne 0
command rm -rf -- "$tmp_dir"
return $compose_status
end

"$ghostty" +validate-config --config-file="$config"
set -l validate_status $status
if test $validate_status -ne 0
printf 'gbarbatdev: composed Ghostty config is invalid\n' >&2
command rm -rf -- "$tmp_dir"
return $validate_status
end

open -W -na Ghostty --args --config-default-files=false --config-file="$config" --working-directory="$PWD" $argv
set -l ghostty_status $status
command rm -rf -- "$tmp_dir"
return $ghostty_status
end
54 changes: 54 additions & 0 deletions fish/functions/grefactoria.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Open an isolated Ghostty instance with the RefactorIA profile. Usage: grefactoria [ghostty args...]
function grefactoria --description 'Open Ghostty with the RefactorIA profile'
if not command -q open
printf 'grefactoria: macOS open command is not available\n' >&2
return 127
end

set -l ghostty /Applications/Ghostty.app/Contents/MacOS/ghostty
if not test -x "$ghostty"
printf 'grefactoria: Ghostty.app is not installed in /Applications\n' >&2
return 1
end

set -l base "$HOME/.config/ghostty/config"
set -l profile "$HOME/.config/ghostty/profiles/refactoria.conf"
if not test -r "$base"
printf 'grefactoria: missing readable config: %s\n' "$base" >&2
return 1
end
if not test -r "$profile"
printf 'grefactoria: missing readable config: %s\n' "$profile" >&2
return 1
end

set -l tmp_dir (command mktemp -d)
set -l mktemp_status $status
if test $mktemp_status -ne 0
return $mktemp_status
end
if test -z "$tmp_dir"
return 1
end

set -l config "$tmp_dir/config.ghostty"
printf 'config-file = "%s"\nconfig-file = "%s"\n' "$base" "$profile" > "$config"
set -l compose_status $status
if test $compose_status -ne 0
command rm -rf -- "$tmp_dir"
return $compose_status
end

"$ghostty" +validate-config --config-file="$config"
set -l validate_status $status
if test $validate_status -ne 0
printf 'grefactoria: composed Ghostty config is invalid\n' >&2
command rm -rf -- "$tmp_dir"
return $validate_status
end

open -W -na Ghostty --args --config-default-files=false --config-file="$config" --working-directory="$PWD" $argv
set -l ghostty_status $status
command rm -rf -- "$tmp_dir"
return $ghostty_status
end
48 changes: 48 additions & 0 deletions fish/functions/hbarbatdev.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Run Herdr with the Barbatdev profile. Usage: hbarbatdev [herdr args...]
function hbarbatdev --description 'Run Herdr with the Barbatdev profile'
if set -q HERDR_ENV
printf 'hbarbatdev: launch this preview from an external Fish shell or window, not from within Herdr\n' >&2
return 1
end

if not command -q herdr
printf 'hbarbatdev: herdr is not available\n' >&2
return 127
end

set -l base "$HOME/.config/herdr/config-base.toml"
set -l profile "$HOME/.config/herdr/profiles/barbatdev.toml"
if not test -r "$base"
printf 'hbarbatdev: missing readable config: %s\n' "$base" >&2
return 1
end
if not test -r "$profile"
printf 'hbarbatdev: missing readable config: %s\n' "$profile" >&2
return 1
end

set -l tmp_dir (command mktemp -d)
set -l mktemp_status $status
if test $mktemp_status -ne 0
return $mktemp_status
end
if test -z "$tmp_dir"
return 1
end

set -l config "$tmp_dir/config.toml"
set -l server_socket "$tmp_dir/herdr.sock"
set -l client_socket "$tmp_dir/herdr-client.sock"

command cat -- "$base" "$profile" > "$config"
set -l cat_status $status
if test $cat_status -ne 0
command rm -rf -- "$tmp_dir"
return $cat_status
end

env HERDR_CONFIG_PATH="$config" HERDR_SOCKET_PATH="$server_socket" HERDR_CLIENT_SOCKET_PATH="$client_socket" herdr --no-session $argv
set -l herdr_status $status
command rm -rf -- "$tmp_dir"
return $herdr_status
end
48 changes: 48 additions & 0 deletions fish/functions/hrefactoria.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Run Herdr with the RefactorIA profile. Usage: hrefactoria [herdr args...]
function hrefactoria --description 'Run Herdr with the RefactorIA profile'
if set -q HERDR_ENV
printf 'hrefactoria: launch this preview from an external Fish shell or window, not from within Herdr\n' >&2
return 1
end

if not command -q herdr
printf 'hrefactoria: herdr is not available\n' >&2
return 127
end

set -l base "$HOME/.config/herdr/config-base.toml"
set -l profile "$HOME/.config/herdr/profiles/refactoria.toml"
if not test -r "$base"
printf 'hrefactoria: missing readable config: %s\n' "$base" >&2
return 1
end
if not test -r "$profile"
printf 'hrefactoria: missing readable config: %s\n' "$profile" >&2
return 1
end

set -l tmp_dir (command mktemp -d)
set -l mktemp_status $status
if test $mktemp_status -ne 0
return $mktemp_status
end
if test -z "$tmp_dir"
return 1
end

set -l config "$tmp_dir/config.toml"
set -l server_socket "$tmp_dir/herdr.sock"
set -l client_socket "$tmp_dir/herdr-client.sock"

command cat -- "$base" "$profile" > "$config"
set -l cat_status $status
if test $cat_status -ne 0
command rm -rf -- "$tmp_dir"
return $cat_status
end

env HERDR_CONFIG_PATH="$config" HERDR_SOCKET_PATH="$server_socket" HERDR_CLIENT_SOCKET_PATH="$client_socket" herdr --no-session $argv
set -l herdr_status $status
command rm -rf -- "$tmp_dir"
return $herdr_status
end
28 changes: 28 additions & 0 deletions fish/tests/w7-gentle-ai-path.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env fish
# gentle-ai's managed launcher dir (~/.gentle-ai/bin) must lead PATH when present,
# because gentle-ai cannot persist PATH for fish login shells itself.

set -l repo_root (cd (dirname (dirname (status filename))); and pwd)
set -l core "$repo_root/conf.d/10-core.fish"
set -l fish_bin (status fish-path)
set -l ws (mktemp -d)

function fail
printf 'FAIL: %s\n' "$argv" >&2
exit 1
end

set -l probe 'source $argv[1]; string join "|" $PATH'

mkdir -p "$ws/with/.gentle-ai/bin" "$ws/without"
set -l with (env -i HOME="$ws/with" PATH=/usr/bin:/bin "$fish_bin" --no-config -c "$probe" "$core")
string match -q "$ws/with/.gentle-ai/bin|*" -- "$with"; or fail "launcher dir not first in PATH: $with"

set -l twice (env -i HOME="$ws/with" PATH="$ws/with/.gentle-ai/bin:/usr/bin:/bin" "$fish_bin" --no-config -c "$probe" "$core")
test (count (string match -a -- "$ws/with/.gentle-ai/bin" (string split '|' -- "$twice"))) -eq 1; or fail "launcher dir duplicated: $twice"

set -l without (env -i HOME="$ws/without" PATH=/usr/bin:/bin "$fish_bin" --no-config -c "$probe" "$core")
string match -q '*gentle-ai*' -- "$without"; and fail "missing launcher dir added to PATH: $without"

rm -rf -- "$ws"
printf 'gentle-ai path checks passed\n'
41 changes: 41 additions & 0 deletions fish/themes/barbatdev.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Barbatdev Fish colors.

set -l base "#0B0B0A"
set -l panel "#171512"
set -l text "#F8F1E7"
set -l selection_text "#FFF7ED"
set -l accent "#F97316"
set -l active_orange "#FB923C"
set -l gold "#FBBF24"
set -l soft_orange "#FDBA74"
set -l bright_blue "#BAE6FD"
set -l error "#EF4444"
set -l muted "#B9AD9C"
set -l dim "#8C8173"
set -l selection "#7A3500"
set -l search_background "#3A1D0C"

# Syntax highlighting colors.
set -g fish_color_normal $text
set -g fish_color_command --bold $accent
set -g fish_color_keyword --bold $active_orange
set -g fish_color_quote $gold
set -g fish_color_redirection $bright_blue
set -g fish_color_end $soft_orange
set -g fish_color_error --bold $error
set -g fish_color_param $soft_orange
set -g fish_color_comment $dim
set -g fish_color_selection --background=$selection $selection_text
set -g fish_color_search_match --background=$search_background $selection_text
set -g fish_color_operator $bright_blue
set -g fish_color_escape $active_orange
set -g fish_color_autosuggestion $muted
set -g fish_color_option $soft_orange

# Completion pager colors.
set -g fish_pager_color_progress $dim
set -g fish_pager_color_prefix --bold $accent
set -g fish_pager_color_completion $text
set -g fish_pager_color_description $muted
set -g fish_pager_color_selected_background --background=$selection $selection_text
set -g fish_pager_color_secondary_background --background=$panel
25 changes: 25 additions & 0 deletions ghostty/profiles/barbatdev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Barbatdev terminal palette. Loaded after the shared Ghostty config.
background = #0B0B0A
foreground = #F8F1E7
cursor-color = #F97316
cursor-text = #0B0B0A
selection-background = #7C2D12
selection-foreground = #F8F1E7

# Accessible ANSI colors for the graphite background.
palette = 0=#8B8378
palette = 1=#F87171
palette = 2=#34D399
palette = 3=#FBBF24
palette = 4=#60A5FA
palette = 5=#C084FC
palette = 6=#2DD4BF
palette = 7=#F8F1E7
palette = 8=#B8AEA0
palette = 9=#FCA5A5
palette = 10=#6EE7B7
palette = 11=#FCD34D
palette = 12=#93C5FD
palette = 13=#D8B4FE
palette = 14=#5EEAD4
palette = 15=#FFFFFF
Loading
Loading