Commit graph

14 commits

Author SHA1 Message Date
Mikael Hugo
15269f4176 sf snapshot: uncommitted changes after 202m inactivity 2026-05-08 13:31:08 +02:00
Mikael Hugo
aa46a29cdd docs(runtime): align source docs with node 26 2026-05-08 07:17:33 +02:00
Mikael Hugo
426fea7334 fix: reload sf source runtime on extension changes 2026-05-07 10:31:34 +02:00
Mikael Hugo
d73a73d7f3 chore: node 24 native APIs, import.meta.dirname, parsers rename, dep updates
- Replace fileURLToPath(import.meta.url) with import.meta.dirname across
  scripts and extensions
- Rename parsers-legacy.ts → parsers.ts
- Remove deleted plan/spec docs (cicd-pipeline)
- Update package.json engines and deps across workspace packages
- Update web/package-lock.json

💘 Generated with Crush

Assisted-by: GLM-5.1 via Crush <crush@charm.land>
2026-05-02 06:18:25 +02:00
Mikael Hugo
e90298f2e0 sf snapshot: pre-dispatch, uncommitted changes after 120m inactivity 2026-04-30 17:44:03 +02:00
Mikael Hugo
085d3b7705 fix: Show headless source startup progress 2026-04-30 12:19:52 +02:00
Mikael Hugo
50975c19e0 Automate source resource rebuild for SF 2026-04-30 09:35:59 +02:00
Mikael Hugo
6e342a8875 fix(sf-from-source): switch from bun to node — clean from-source path
bun was the wrong runtime for our environment, two ways:

1. bun doesn't ship node:sqlite. sf-db.ts falls back through node:sqlite
   → better-sqlite3 → null. Result: 'No SQLite provider available' and
   degraded-mode filesystem-state derivation, even though sqlite is
   actually available (node:sqlite under node, bun:sqlite under bun —
   both valid, but our code only knows the node names).

2. bun's loader doesn't inherit the system library search path under
   Nix. libz.so.1 isn't found for forge_engine.node, so the native
   addon falls through to JS implementations (slower).

Both warnings ("Native addon not available", "DB unavailable —
degraded mode") were the symptom of "we're running under bun".

Fix: use node + the existing src/resources/extensions/sf/tests/
resolve-ts.mjs loader hook (which already handles .js → .ts
import-specifier remapping for runtime resolution) +
--experimental-strip-types (node 22+, native in 24).

Result: from-source via node loads cleanly. No native warning.
No sqlite warning. No degraded mode. Exec: `./bin/sf-from-source
--print "..."` returns the model output and nothing else.

Drops the LD_LIBRARY_PATH zlib-injection hack that was added in
4912f6ea8 — that was working around the bun native-loader issue
that doesn't exist under node.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:07:24 +02:00
Mikael Hugo
4912f6ea80 fix(sf-from-source): inject Nix-store zlib into LD_LIBRARY_PATH
bun's loader doesn't inherit the same library search path as node under
Nix, so require('forge_engine.linux-x64.node') fails with
'libz.so.1: cannot open shared object file' even when the native addon
exists at the expected path. Result: sf-from-source ran in
JS-fallback mode, and we'd been working around it by switching to
node dist/loader.js — which forces a manual `npm run copy-resources`
after every src/ change to keep dist in sync.

This wraps sf-from-source to find a Nix-store zlib at startup and
prepend it to LD_LIBRARY_PATH before exec'ing bun. The native addon
loads cleanly; from-source becomes the reliable default again; no
more dist drift to worry about.

Find pattern: /nix/store/*-zlib-*/lib/libz.so.1 at maxdepth 4
(maxdepth 2 was too shallow — the hash dir is depth 1, lib is depth 2,
the .so.1 file is depth 3, plus we want the parent dir for
LD_LIBRARY_PATH so '%h' on a depth-3 match gives the lib dir).

Outside Nix (no /nix/store), this is a no-op and falls through to
the existing exec.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:01:55 +02:00
ace-pm
9d739dfa5d Rename GSD→SF: complete rebrand from fork origin
- All gsdDir/gsdRoot/gsdHome → sfDir/sfRootDir/sfHome
- GSDWorkspace* → SFWorkspace* interfaces
- bootstrapGsdProject → bootstrapProject
- runGSDDoctor → runSFDoctor
- GsdClient → SfClient, gsd-client.ts → sf-client.ts
- .gsd/ → .sf/ in all tests, docs, docker, native, vscode
- Auto-migration: headless detects .gsd/ → renames to .sf/
- Deleted gsd-phase-state.ts backward-compat re-export
- Renamed bin/gsd-from-source → bin/sf-from-source
- Updated mintlify docs, github workflows, docker configs
2026-04-15 18:33:47 +02:00
ace-pm
6b0ac484ba refactor: update log prefixes and string values from gsd- to sf- namespace
Updates channel prefixes, log messages, comments, and configuration values
across daemon, mcp-server, and related packages to complete the rebrand from
gsd to sf-run naming.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 15:37:12 +02:00
ace-pm
35dc87ef53 chore: sync workspace state after rebrand
- Rebrand commits already in history (gsd → forge)
- Sync pre-existing doc, docker, and CI config updates
- All rebrand artifacts verified in place:
  * Native crates: forge-engine, forge-ast, forge-grep
  * Log prefixes: [forge] across 22+ files
  * Binary: ~/bin/sf-run
  * Workspace scopes: @sf-run/*, @singularity-forge/*
  * Nix flake: Rust toolchain ready

System ready for: nix develop && bun run build:native

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:54:20 +02:00
Mikael Hugo
2f2f1845f7 fix(source): resolve symlink before computing SCRIPT_DIR
When gsd-from-source is invoked via a symlink (e.g. ~/.bun/bin/gsd-real
pointing at it so `gsd` resolves to source without further indirection),
BASH_SOURCE[0] is the symlink path, not the real file. The previous
dirname-of-BASH_SOURCE[0] approach resolved SCRIPT_DIR to the symlink's
parent dir (e.g. ~/.bun/bin) and tried to bun-run ~/.bun/src/loader.ts,
which doesn't exist.

Wrapping BASH_SOURCE[0] in readlink -f resolves the physical path first,
so SCRIPT_DIR always points at bin/ inside the gsd source checkout
regardless of how the script is reached.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:07:00 +02:00
ace-pm
80ce0f4855 feat(source): enable running gsd directly from source checkout
Adds bin/gsd-from-source shell wrapper that bun-runs src/loader.ts, so
local commits are live without reinstalling gsd-pi. Patches loader.ts
to respect a pre-set GSD_BIN_PATH (previously it clobbered the env var
with process.argv[1], forcing subagent spawns to point at the .ts
loader path which child_process.spawn can't execute).

Why: working on fixes like #4251 required full `bun install -g --trust
gsd-pi` cycles plus longcat shim re-patching for every iteration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:01:18 +02:00