Commit graph

773 commits

Author SHA1 Message Date
37be2d9505 fix(opencode): remove agent models and temperature 2026-05-06 15:33:11 +02:00
2941faa822 refactor(opencode): make workflow forge-agnostic and read TODO.md from bare repo
Drops all GitHub-specific tooling (gh CLI, draft PR creation) so the
workflow stops at git commit and leaves push/PR/MR to the user.

TODO.md is now expected to be a tracked file on the default branch.
Phase 1 verifies the repo is bare via `git rev-parse --is-bare-repository`,
resolves the default branch from HEAD / init.defaultBranch, and snapshots
TODO.md via `git show "$DEFAULT_BRANCH:TODO.md"` to a tempfile that @pm
reads in Phase 2. Phase 10 updates the live TODO.md inside the worktree
and commits the change separately. The /review command drops its PR
mode for the same reason; @pm documents the read-only-snapshot vs.
live-worktree path distinction.
2026-05-06 15:28:08 +02:00
4ec1561af4 feat(opencode): add multi-agent workflow agents and commands
Adds @check, @simplify, @test, @make, @pm subagents and the /workflow
and /review slash commands from the autonomous multi-agent workflow
gist by ppries.

@pm is rewritten to manage issues in a local ./TODO.md file instead of
Linear (file-only access, documented schema, structured JSON output).

/workflow is adapted: TODO.md-based issue context, generic worktree
paths (no hardcoded ~/repos/veo/sunstone), generic branch examples,
and a Phase 1 guard that verifies origin is on GitHub before any
work begins.
2026-05-06 14:56:42 +02:00
02b3c73376 fix(halo): fix systemd description for llama 2026-05-06 14:03:28 +02:00
7ebd97629d feat(halo): use am17an/Qwen3.6-27B-MTP-GGUF:Q8_0 with MTP spec 2026-05-06 14:01:31 +02:00
9c465ac9fa fix(halo): remove -DGGML_HIP_ROCWMMA_FATTN=ON 2026-05-06 13:08:45 +02:00
a95417da8b feat(halo): use unsloth/Qwen3.6-27B-GGUF:UD-Q8_K_XL 2026-05-06 13:02:20 +02:00
c9c7f6916a fix(llama-cpp-rocm): wire rocwmma include path for hipcc
rocwmma is header-only and ships no CMake config file, so
find_package(rocwmma) is not available. hipcc/clang also bypass the
nixpkgs cc-wrapper that would normally pick up headers from
buildInputs, so the rocwmma path was unreachable and the build failed
with:

  ggml-cuda/vendors/hip.h: 'rocwmma/rocwmma-version.hpp' file not found

Inject -I<rocwmma>/include via CMAKE_HIP_FLAGS (HIP TUs) and
CMAKE_CXX_FLAGS (C++ TUs that include hip.h transitively).
2026-05-06 09:22:05 +02:00
f62e8ac470 perf(llama-cpp-rocm): tune for Strix Halo (gfx1151)
- Restrict rocmGpuTargets to gfx1151 (Radeon 8060S, RDNA 3.5) — smaller
  closure, faster compile, no wasted device kernels.
- Enable GGML_HIP_ROCWMMA_FATTN: rocWMMA-backed flash attention is a
  major win on RDNA3+ for the GPU-offloaded attention path.
- Enable GGML_HIP_GRAPHS to lower per-token launch overhead.
- Add rocwmma to buildInputs to satisfy the WMMA path.

llama-server on halo runs with -ngl 99 --flash-attn on, so these flags
target the hot path. CPU-side AVX-512 was skipped intentionally — Zen 5
has it, but with full GPU offload the CPU paths barely run.
2026-05-06 09:13:54 +02:00
623a71f95f fix(overlays): correct llama-cpp-rocm src hash to include postFetch COMMIT
The previous hash was the bare tarball hash; postFetch writes a COMMIT
file into the source, so the final fixed-output hash differs. My local
machine masked the bug by reusing a cached pre-postFetch store path
with the same FOD path. Verified by deleting the cached path and
re-fetching.
2026-05-06 09:07:53 +02:00
55b74f0caf feat(overlays): pin llama-cpp-rocm to am17an/mtp-clean fork
Override the unstable llama-cpp-rocm src to track the am17an/llama.cpp
mtp-clean branch (rev 267f8af). Replaces upstream's leaveDotGit-based
COMMIT extraction with a direct postFetch write so the source hash is
deterministic without a git clone. The fork's webui package-lock differs
from upstream, so npmDepsHash is repinned.
2026-05-06 08:43:46 +02:00
927e575828 fix(opencode): require -- before prompt in ask-claude skill
Variadic flags like --allowedTools and --add-dir were silently swallowing
the trailing prompt, causing `claude -p` to fail with "Input must be
provided through stdin or as a prompt argument". Mandate a uniform
`claude -p [flags] -- "<prompt>"` shape and document the gotcha.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 14:43:18 +02:00
393ff652c7 fix: add ssh key 2026-05-05 14:20:00 +02:00
Harald Hoyer
471b5a4f11 feat: map ./config/claude to ~/.claude 2026-05-05 14:15:50 +02:00
Harald Hoyer
289920b726 feat: add opencode commands 2026-05-05 14:14:25 +02:00
Harald Hoyer
b4f1514df1 feat: opencode skills 2026-05-05 14:13:16 +02:00
Harald Hoyer
77b7cd6259 feat: add more claude skills 2026-05-05 14:09:42 +02:00
2a389a49b2 fix(claude-code): track empty skills dir so flake source resolves
Git doesn't track empty directories, so config/claude/skills was missing
from the Nix store source path, breaking home.file.".claude/skills"
evaluation. Add a .gitkeep to keep the directory present until real
skills are added.
2026-05-05 14:08:23 +02:00
ba396eed12 feat(claude-code): manage commands and skills via home-manager
Add a home-manager module that symlinks config/claude/commands and
config/claude/skills into ~/.claude, mirroring the opencode module.
Seed the commands directory with a /commit slash command.
2026-05-05 14:03:44 +02:00
5d0e1fcdd6 docs(opencode): steer ask-claude skill toward repo access for reviews
Add a "Code review pattern" section that tells the opencode agent to give
claude read-only access to the repo (Read/Grep/Glob plus a narrow git
allowlist) instead of gathering a full `git diff` and piping it in. The
piped-diff form loses surrounding-file context, bloats the prompt, and
falls over on large branches. Also adds a matching entry to "Don'ts" and
caveats the existing pipe-stdin example.

Motivated by an opencode run that collected the entire branch diff as
stdin instead of pointing claude at the working tree.
2026-05-05 13:56:40 +02:00
425ee187cf chore(opencode): re-order models 2026-05-05 13:43:27 +02:00
3a1cb7487a refactor(opencode): extract serve service into shared NixOS module
New `metacfg.services.opencode` module under modules/nixos/services/opencode/
with options for port, user, homeDir, sopsFile, and extraPackages. User and
homeDir default off `metacfg.user`. Host configs for amd and sgx reduce to
enabling the module and pointing at their respective sops file.

Service PATH gains jq, yq-go, python3, gh, gnutar, gzip, unzip, wget,
diffutils, patch, file, tree, bun, uv, ast-grep, claude-code, and tmux for
agent ergonomics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 13:43:27 +02:00
dbbb150bcc chore: refactor opencode service 2026-05-05 13:20:52 +02:00
da88a9b2d6 fix(halo): drop speculative HSA_OVERRIDE_GFX_VERSION from llama-server
Was set defensively without knowing the actual GPU arch; if ROCm
supports the card natively, the override is at best a no-op and at
worst masks the real arch. Add it back with the right value if the
service actually fails to detect the GPU.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:42:17 +02:00
b11e5c8356 feat(halo): add llama-server systemd unit for Qwen3.6-35B-A3B
Runs llama.cpp's ROCm build under DynamicUser, with the HF model cache
in StateDirectory (survives systemctl clean) and KV slot saves in
CacheDirectory. Listens on :8000.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:42:17 +02:00
Harald Hoyer
603e435db8 chore: fix opencode model config 2026-05-05 10:34:07 +02:00
624a72737c fix(opencode): narrow LD_LIBRARY_PATH to libstdc++ only
The full nix-ld library list shadowed nix's own curl, breaking
libnixstore.so with "CURL_OPENSSL_4 not found". The prebuilt node
watcher binding only needs libstdc++/libgcc_s, so use stdenv.cc.cc.lib
and let nix-built tools resolve their own deps via RUNPATH.
2026-05-04 08:58:37 +02:00
75d8b5354d chore: flake update 2026-05-04 08:44:12 +02:00
9f937cb789 chore(opencode): add disabled_providers config 2026-05-03 16:40:07 +02:00
0d5fb73022 fix(amd): opencode 2026-05-03 16:31:02 +02:00
8b205ea9f1 chore(opencode): switch to Qwen3-Coder-Next model 2026-05-03 16:29:56 +02:00
5693009488 fix(opencode): set LD_LIBRARY_PATH for prebuilt node bindings
The file watcher binding (and other node-precompiled .node modules
loaded via dlopen) failed with "libstdc++.so.6: cannot open shared
object file" because systemd services don't inherit the user shell's
LD path. Reuse the nix-ld library list so the service sees the same
common libraries unwrapped binaries get globally.
2026-05-03 16:29:24 +02:00
441df05d86 fix(opencode): add git and dev tools to service PATH
The opencode-serve unit ran with systemd's minimal default PATH, so
shell commands invoked by the agent (git, make, nix, node, rg, etc.)
were not found. Set systemd.services.opencode-serve.path on both sgx
and amd to a common dev toolset.
2026-05-03 16:09:31 +02:00
0e723e2da8 feat(amd): add opencode web server at opencode.amd.hoyer.world
Mirror of the sgx opencode setup: systemd service on port 4196 fronted
by nginx with a per-host ACME cert (DNS-01 via internetbs). Adds amd
key + path rule to .sops.yaml so secrets under .secrets/amd/ encrypt
for the host.
2026-05-03 15:55:15 +02:00
01f42c0851 feat(sops): trigger service restarts on secret rotation
Wire up restartUnits on secrets whose consumers cache them in memory
(daemons read at startup), so sops-nix restarts the affected unit on
activation when the decrypted content changes:

- firefly: app_key → phpfpm-firefly-iii;
  auto_import_secret + access_token → phpfpm-firefly-iii-data-importer
- searx: secret_key → uwsgi
- opencode: web password → opencode-serve
- mail: sasl_passwd → postfix
- forgejo: gitea_dbpass → forgejo; runner-token → gitea-runner-default

Secrets read on demand by oneshots/timers (firefly sparda_pin, ntfy
token, restic backup creds, acme dns creds, wg conf) are left as-is.
2026-05-03 15:23:40 +02:00
59480cdc79 chore: opencode pw 2026-05-03 15:14:54 +02:00
3453f412fc chore: opencode pw 2026-05-03 15:11:02 +02:00
0989b8ae46 feat(sgx): add opencode web server 2026-05-03 14:57:49 +02:00
f74928ce5f chore: nix fmt 2026-05-03 14:57:49 +02:00
38767905af chore: opencode pw 2026-05-03 14:57:15 +02:00
a63abebda3 feat(home): opencode module — link config/opencode → ~/.config/opencode
Adds metacfg.cli-apps.opencode (default enabled) which mounts the
in-repo opencode config (provider list, web-search skill) via
xdg.configFile, so all hosts pick it up automatically.
2026-05-03 14:30:33 +02:00
c4e6599803 chore: nix flake update 2026-05-03 13:49:14 +02:00
c99ea665d4 feat(sgx): add opencode 2026-05-03 13:47:39 +02:00
b2027bd283 sgx/network: open TCP 8000-8999 in firewall
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 13:47:39 +02:00
e96bf83dfd feat(halo): add python313Packages.huggingface-hub 2026-05-03 09:00:13 +02:00
73bf52dbaf sgx/firefly: bump fastcgi_read_timeout + PHP max_execution_time on both vhosts
Bulk imports of 100+ transactions per chunk hit the default 60s
fastcgi timeout on the main Firefly III vhost too — not just the
importer endpoint. The importer's per-transaction API call to Firefly's
/api/v1/transactions can take 20+s on a fresh DB without ANALYZE,
which compounds with the 30s PHP max_execution_time cap.

- nginx fastcgi_read_timeout=600s on both `firefly` and `firefly-import`
  vhosts
- php_admin_value[max_execution_time]=600 + memory_limit=512M on both
  PHP-FPM pools
- VANITY_URL on the importer now points to the main Firefly III URL
  (was wrongly pointing at the importer's own domain, breaking
  clickable transaction-show links in importer log messages)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 16:44:20 +02:00
491a7b38e4 sgx/firefly: switch Firefly III backend from sqlite to postgres
SQLite was slow under btrfs CoW, and the no-CoW migration path turned
out to be fragile (WAL deletion without checkpoint = data loss). Move
to PostgreSQL on Unix-socket peer auth — no password needed for the
local-host setup, NixOS provisions the database+user declaratively.

Drop the now-unused +C tmpfiles rule on the sqlite directory; the
leftover database.sqlite* files at /var/lib/firefly-iii/storage/database/
are harmless and can be removed manually after switch is verified.

Migration of existing Firefly III data is not preserved by this
commit — fresh-start path: re-register admin, re-issue PAT, re-POST
the bulk CSV through the importer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 21:49:08 +02:00
90324605b9 chore: update secret 2026-05-01 21:48:44 +02:00
c1503b56aa sgx/firefly: disable btrfs CoW on Firefly III sqlite directory
Random-write SQLite traffic fragments CoW filesystems quickly. The `h`
tmpfiles directive sets +C on the database directory; new SQLite files
(WAL, SHM, recreated main DB) inherit no-CoW automatically. No-op on
non-btrfs filesystems.

Migration of existing files must be done manually with checkpoint-first:
  systemctl stop phpfpm-firefly-iii.service
  sqlite3 .../database.sqlite 'PRAGMA wal_checkpoint(TRUNCATE);'
  # then recreate main file inside the +C dir
  systemctl start phpfpm-firefly-iii.service

Skipping the wal_checkpoint and naively deleting .sqlite-wal will lose
all writes that haven't been checkpointed (PHP-FPM SIGTERM does not
trigger a checkpoint).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 19:31:24 +02:00
81b9d2208c chore: secret update 2026-05-01 19:30:17 +02:00