Commit graph

59 commits

Author SHA1 Message Date
Lex Christopherson
580823c154 2.22.0 2026-03-16 15:27:24 -06:00
Lex Christopherson
b6b9f44758 2.21.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 12:54:52 -06:00
Lex Christopherson
2966be30cb 2.20.0 2026-03-16 12:16:27 -06:00
Lex Christopherson
da1a77d723 2.19.0 2026-03-16 08:33:07 -06:00
Lex Christopherson
95849c46fd 2.18.0 2026-03-16 07:18:55 -06:00
Lex Christopherson
1d1b91f428 2.17.0 2026-03-15 22:26:55 -06:00
Lex Christopherson
acb598c4b8 2.16.0 2026-03-15 20:29:48 -06:00
Flux Labs
c8b42ed2ae feat: native perf optimizations — deriveState, JSONL, paths, parsing (#576)
Four native Rust optimizations to eliminate hot-path bottlenecks:

1. deriveState raw content (gsd_parser.rs, state.ts):
   - Added rawContent field to ParsedGsdFile in batch parser
   - Eliminates 43-line frontmatter re-serialization loop in state.ts
   - Batch cache now stores original file content directly

2. JSONL streaming parser (gsd_parser.rs, session-forensics.ts):
   - Added parseJsonlTail() — reads from file tail with constant memory
   - Handles arbitrary file sizes (no more 10MB OOM risk)
   - synthesizeCrashRecovery and readLastActivityLog use native first

3. Native directory tree index (gsd_parser.rs, paths.ts):
   - Added scanGsdTree() — walks .gsd/ tree once, returns all entries
   - paths.ts builds lookup map from native scan
   - cachedReaddirWithTypes/cachedReaddir check native cache first
   - Eliminates 20-50 readdirSync calls per dispatch

4. Native plan/summary parsers (gsd_parser.rs, files.ts):
   - Added parsePlanFile() — parses tasks, must-haves, estimates
   - Added parseSummaryFile() — parses frontmatter, sections, files
   - files.ts calls native first, falls back to JS regex parsers
   - 3-5x faster per file, ~20 files per deriveState

All optimizations follow the established pattern: native-first with
JS fallback when native module unavailable.
2026-03-15 20:16:42 -06:00
Flux Labs
343a43f028 feat: move git operations to Rust via git2 crate (#572)
* feat: move git operations to Rust via git2 crate (#524)

Eliminates ~70 execSync/execFileSync git CLI calls across 15 TypeScript
files by implementing native libgit2 operations in Rust and routing all
consumers through the native-git-bridge.

Rust (native/crates/engine/src/git.rs):
- Added 28 new NAPI functions covering both read and write operations
- Read: git_is_repo, git_has_staged_changes, git_diff_stat,
  git_diff_name_status, git_diff_numstat, git_diff_content,
  git_log_oneline, git_worktree_list, git_branch_list,
  git_branch_list_merged, git_ls_files, git_for_each_ref,
  git_conflict_files, git_batch_info
- Write: git_init, git_add_all, git_add_paths, git_reset_paths,
  git_commit, git_checkout_branch, git_checkout_theirs,
  git_merge_squash, git_merge_abort, git_rebase_abort,
  git_reset_hard, git_branch_delete, git_branch_force_reset,
  git_rm_cached, git_rm_force, git_worktree_add,
  git_worktree_remove, git_worktree_prune, git_revert_commit,
  git_revert_abort, git_update_ref

TypeScript (native-git-bridge.ts):
- Added 35 bridge functions with native-first + execSync fallback
- New types: GitDiffStat, GitNameStatus, GitNumstat, GitLogEntry,
  GitWorktreeEntry, GitBatchInfo, GitMergeResult

Consumer migrations (15 files):
- worktree-manager.ts: removed local runGit/getMainBranch, all ops native
- auto-worktree.ts: merge, checkout, conflict resolution all native
- git-service.ts: smart staging, commits, snapshots all native
- auto.ts, guided-flow.ts: repo init/bootstrap native
- auto-supervisor.ts: working tree detection native
- git-self-heal.ts: merge/rebase abort, reset all native
- doctor.ts: health checks, branch listing, worktree cleanup native
- commands.ts: branch/snapshot cleanup native
- session-forensics.ts: diff stat queries native
- auto-recovery.ts: merge state reconciliation native
- gitignore.ts, undo.ts, worktree-command.ts: remaining ops native

Kept as execSync (by design):
- git push (credential handling too complex for libgit2)
- native-git-bridge.ts fallbacks (graceful degradation)
- runPreMergeCheck (runs arbitrary user commands)

Closes #524

* fix: restore getMainBranch export from worktree-manager

The agent migration removed getMainBranch from worktree-manager.ts but
worktree-command.ts still imports it. Re-add as a thin wrapper around
nativeDetectMainBranch.

* fix: address PR #572 review feedback — security, correctness, error handling

CRITICAL:
- Path traversal protection via validate_path_within_repo() for
  git_rm_force and git_checkout_theirs
- git_branch_delete defaults to safe delete (force=false)

HIGH:
- Replace silent .ok() with proper error propagation in git_commit,
  git_merge_abort, git_rebase_abort, git_rm_force, git_checkout_theirs
- nativeDiffStat fallback parses numeric stats from git output
- nativeBatchInfo fallback counts staged/unstaged from porcelain status

MEDIUM:
- Wire up dead force param in removeWorktree()
- Read MERGE_MSG/SQUASH_MSG when commit message empty
- nativeLsFiles uses gitFileExec without fragile quote wrapping
- Fix operator precedence in git_ls_files
2026-03-15 20:02:10 -06:00
Lex Christopherson
0dbed163bb 2.15.1 2026-03-15 18:54:45 -06:00
Lex Christopherson
c09dcfc380 2.15.0 2026-03-15 17:33:43 -06:00
Lex Christopherson
b873f8112f 2.14.4 2026-03-15 15:46:16 -06:00
Lex Christopherson
ce78c2a7d5 2.14.3 2026-03-15 15:34:13 -06:00
Lex Christopherson
b333d450a3 2.14.2 2026-03-15 15:22:41 -06:00
Lex Christopherson
484524b528 2.14.1 2026-03-15 15:11:01 -06:00
Lex Christopherson
8737b509c1 2.14.0 2026-03-15 14:35:52 -06:00
Lex Christopherson
9f12e6a8c3 2.13.1 2026-03-15 09:30:52 -06:00
Lex Christopherson
eaf909cd4b 2.13.0 2026-03-15 08:44:31 -06:00
Lex Christopherson
861a06cf34 2.12.0 2026-03-14 21:19:54 -06:00
TÂCHES
c2a063bddd release: v2.11.1 — urgent fix for auto-mode loop on research-slice/plan-slice 2026-03-14 18:52:05 -06:00
Lex Christopherson
7d3c5bfd6f 2.11.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 16:03:46 -06:00
Flux Labs
f981d5aa79 perf: optimize discovery and interactive hot paths 2026-03-14 16:03:44 -05:00
TÂCHES
33cf0dcabd feat(native): add libgit2-backed git read operations for dispatch hotpath (#388) 2026-03-14 13:07:02 -06:00
TÂCHES
c69be2078f fix: npx fails — loader creates workspace symlinks at runtime (#380)
npx runs with --ignore-scripts, skipping postinstall. The loader now
creates node_modules/@gsd/* symlinks pointing to packages/* before
importing cli.js, so @gsd/* packages resolve without postinstall.

Bumps to v2.10.12.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 11:38:33 -06:00
TÂCHES
a4a909aaf5 fix: hoist workspace deps — ERR_MODULE_NOT_FOUND on install (#376)
v2.10.10 removed bundleDependencies but didn't promote transitive deps
(anthropic SDK, openai, undici, chalk, etc.) into root dependencies.
Users got ERR_MODULE_NOT_FOUND on install.

Adds all 28 workspace package deps to root dependencies so npm installs
them. Bumps to v2.10.11.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 11:16:14 -06:00
TÂCHES
098ed35a50 fix: broken npm install — remove bundleDependencies, use postinstall symlinks (#369)
* fix: remove @gsd/* cross-deps that break npm install (#hotfix)

Workspace packages declared @gsd/* as dependencies in their own
package.json files. npm's bundleDependencies bundles packages into
node_modules/ but still tries to resolve sub-dependencies from the
registry — causing 404s for the unpublished @gsd/* scope.

- Remove @gsd/* from all dependencies (root and workspace packages)
- Add validate-pack.sh: tests tarball installability before publish
- Wire validate-pack into CI (every PR) and publish pipeline
- Bump to v2.10.10
- Update changelog

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: drop bundleDependencies, use postinstall symlinks instead

bundleDependencies with workspace packages causes npm to resolve
@gsd/* from the registry during install — 404 since they're not
published. Replace with a postinstall script that creates
node_modules/@gsd/* symlinks pointing to packages/*.

- Remove @gsd/* from dependencies and bundleDependencies
- Add link-workspace-packages.cjs (CJS, runs before ESM postinstall)
- Update validate-pack to verify symlinks after install
- Include link script in files array

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: robust validate-pack + fallback workspace linking

- Keep @gsd/* in bundleDependencies (for npm pack bundling)
- Remove @gsd/* from root dependencies (prevents 404 registry lookups)
- Add link-workspace-packages.cjs fallback for when bundled symlinks
  aren't created
- Simplified validate-pack with better error diagnostics

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove bundleDependencies — use postinstall symlinks only

npm 10.x fetches packument metadata for ALL deps including bundled ones.
@gsd/* packages don't exist on npm → 404 → hard install failure.

bundleDependencies is fundamentally broken for unpublished workspace
packages. Replace with:
- packages/ shipped via files array (already was)
- link-workspace-packages.cjs creates node_modules/@gsd/* symlinks in
  postinstall, pointing to packages/*
- No @gsd/* in dependencies or bundleDependencies at all

Tarball drops from 40M to 3M (no bundled node_modules).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add .npmignore to prevent .gitignore from excluding dist/

.gitignore contains /dist/ and packages/*/dist/ which are needed in
the published tarball. Without .npmignore, npm pack respects .gitignore
and excludes them — even though "files" in package.json should override.

An empty .npmignore causes npm to ignore .gitignore entirely, letting
the "files" field control what's packed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: avoid SIGPIPE in validate-pack on Linux

tar | grep -q causes SIGPIPE (exit 141) on Linux when grep closes the
pipe early. Write tar listing to a temp file and grep that instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 10:04:12 -06:00
TÂCHES
ff524caec9 release: v2.10.9 (#358)
* docs: update changelog for v2.10.9

* 2.10.9

* fix(ci): retry smoke test with backoff for npm propagation delay

The post-publish smoke test was failing because npm registry propagation
can take 30-90s. Replaced the fixed 15s sleep with a retry loop (5
attempts, 30s backoff).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 08:08:21 -06:00
Lex Christopherson
105fc0103a 2.10.6
Native Rust modules (truncation, hashing, bash stream), memory extraction pipeline, 1M context model, TUI crash fix, and rate limit improvements
2026-03-13 16:56:36 -06:00
TÂCHES
60a3607ff7 feat: native Rust output truncation module (#268)
* feat: add native Rust output truncation module

Line-boundary-aware truncation for tool outputs (bash, grep, file reads),
replacing JS byte-counting with native Rust via napi-rs. Supports head,
tail, and both modes. Counts by UTF-8 bytes, respects line boundaries,
uses memchr for fast newline scanning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove unsafe blocks and fix truncation message byte counts

Replace unsafe from_utf8_unchecked with safe from_utf8().expect() —
the invariant (splitting at newline boundaries) is sound but the perf
difference is negligible, so no reason to use unsafe.

Fix truncateOutput messages that reported the byte budget as "bytes
truncated" instead of the actual number of bytes removed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 16:48:49 -06:00
TÂCHES
b730ed87d0 feat: native Rust xxHash32 for hashline (#272)
* feat: replace pure-JS xxHash32 with native Rust implementation via napi

The hashline edit tool calls xxHash32 on every line of every file read/edit.
Moving this to a native Rust implementation (xxhash-rust crate) eliminates
JS overhead for this hot path. Hash output is identical -- verified by tests
comparing native vs JS reference across 11 input vectors including empty
strings, short/long inputs, unicode, and seeded variants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use typed native interface and remove version-drag comment in xxhash wrapper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 16:46:08 -06:00
TÂCHES
8a5465d901 feat: native Rust bash stream processor for single-pass chunk processing (#271)
Replaces the multi-pass JS pipeline (TextDecoder → stripAnsi → sanitizeBinaryOutput)
in bash-executor.ts with a single native Rust call that handles UTF-8 decoding,
ANSI stripping, binary sanitization, and CR removal in one pass.

Key features:
- StreamState tracks incomplete UTF-8 and ANSI sequences across chunk boundaries
- Standalone stripAnsiNative() and sanitizeBinaryOutputNative() for use elsewhere
- Comprehensive test coverage for split multibyte, split ANSI, binary data

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 16:34:17 -06:00
TÂCHES
8b9cfae9e9 feat: native Rust streaming JSON parser (#266)
* feat: add native Rust streaming JSON parser for LLM tool call argument parsing

Replaces the JS partial-json library with a Rust implementation exposed via napi-rs.
The parser handles incomplete JSON from streaming deltas by closing unclosed strings,
objects, arrays, removing trailing commas, and completing truncated literals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: handle truncated numbers and remove dead partial-json dependency

Adds truncated number recovery (e.g. `{"key": 12`, `{"key": 3.`, `{"key": 1e`)
to the Rust streaming JSON parser, and removes the now-unused `partial-json`
npm dependency from pi-ai.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 16:21:58 -06:00
Juan Francisco Lebrero
9b0f31e39a fix: use version ranges for native engine optional dependencies (#286)
The v2.10.5 release broke on darwin-arm64 because the main package
was published before the native CI built and published the platform
packages. With exact version pinning, npm silently skips the
optional dep when the version doesn't exist, causing a fatal crash.

Change to >=2.10.2 range so npm installs the latest available
binary. The native API is stable across patch versions.

Also stop sync-platform-versions.cjs from overwriting the ranges
back to exact versions during CI.
2026-03-13 16:20:44 -06:00
Lex Christopherson
16518a217e 2.10.5
Fix optionalDependencies version sync — 2.10.4 shipped with engine packages pinned to 2.10.2 (the broken version), so users never got the fixed binaries. Closes #276.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 15:59:24 -06:00
Lex Christopherson
b607a1df73 2.10.4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 15:13:35 -06:00
Lex Christopherson
1774d6e1f4 fix: use @gsd-build npm scope and remove committed binary
Rename all platform packages from @gsd/engine-* to @gsd-build/engine-*
to match the npm org. Remove the darwin-arm64 binary from git and
native/addon from files — production binaries come exclusively from
CI-published platform packages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 14:49:26 -06:00
Lex Christopherson
bd8380315c feat: per-platform optional dependencies for native binary distribution
Add the esbuild/swc pattern for distributing platform-specific native
binaries via npm optional dependencies. Each supported platform gets its
own @gsd/engine-{platform} package containing just the .node binary.

- 5 platform package stubs (darwin-arm64, darwin-x64, linux-x64-gnu,
  linux-arm64-gnu, win32-x64-msvc) with os/cpu filters
- Rewritten native loader: tries npm package first, then local build
- Version sync script keeps platform packages in lock-step with root
- GitHub Actions workflow for cross-platform build + publish on tag push

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 14:36:18 -06:00
Lex Christopherson
d49af589d0 fix: include darwin-arm64 native binary in npm tarball (Phase A hotfix)
The native .node binary was excluded from npm pack due to native/.gitignore
ignoring addon/. Add native/.npmignore (overrides .gitignore for npm) and
include native/addon in the files whitelist. Also improve the error message
in the native loader to list supported platforms and link to issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 14:33:37 -06:00
Lex Christopherson
341273e957 chore: update Cargo.lock 2026-03-13 14:21:14 -06:00
Lex Christopherson
064c4cfc1a feat: add native Rust GSD file parser for .gsd/ directory parsing
Implements a Rust napi-rs module that parses YAML-like frontmatter,
markdown sections, and roadmap structures from .gsd/ files. Provides
parseFrontmatter, extractSection, extractAllSections, batchParseGsdFiles,
and parseRoadmapFile functions exposed via @gsd/native. The JS parsers
in files.ts fall back transparently when the native module is unavailable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 14:12:17 -06:00
Lex Christopherson
4c97d59536 feat: add native Rust diff engine for edit tool
Move the edit tool's hot-path diffing operations from JS to native Rust:
- `normalizeForFuzzyMatch`: single-pass Unicode normalization (smart quotes,
  dashes, special spaces, trailing whitespace)
- `fuzzyFindText`: exact-then-fuzzy substring search with UTF-16 index
  conversion for JS compatibility
- `generateDiff`: unified diff generation using the `similar` crate
  (Myers' algorithm with optimizations)

The Rust module at `native/crates/engine/src/diff.rs` exposes three napi
functions. The TypeScript wrapper at `packages/native/src/diff/` follows
the existing module pattern. `edit-diff.ts` now delegates to native
implementations while keeping line-ending handling and file I/O in JS.

18 tests covering normalization, fuzzy matching (including UTF-16 index
correctness with emoji/surrogate pairs), and diff generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 14:11:40 -06:00
Lex Christopherson
ac34c7c283 feat: add native Rust TTSR regex engine via RegexSet
TTSR's checkDelta() runs O(rules x conditions) regex evaluations per
streaming token — the hottest path in GSD. This adds a Rust native
module that compiles all condition patterns into a single RegexSet,
testing them in one DFA pass instead of sequential JS RegExp iteration.

The TtsrManager transparently uses the native engine when available and
falls back to the existing JS regex loop when it is not.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 13:57:12 -06:00
Lex Christopherson
8ef2424324 merge: integrate native ast module (#239) 2026-03-13 13:22:29 -06:00
Lex Christopherson
5970ad74b2 merge: integrate native image module (#235) 2026-03-13 13:22:09 -06:00
Lex Christopherson
cd444eb0ea merge: integrate native fd module (#231) 2026-03-13 13:13:43 -06:00
Lex Christopherson
8fb8c6a16b merge: integrate native text module (#230) 2026-03-13 13:12:40 -06:00
Lex Christopherson
f1c848b429 merge: integrate native html module (#229) 2026-03-13 13:11:40 -06:00
Lex Christopherson
df39cea85e feat: add native ast module with ast-grep structural search and rewrite
Adds the `gsd-ast` crate providing AST-aware code search (`astGrep`) and
rewrite (`astEdit`) via ast-grep with tree-sitter grammars for 38+ languages.
Replaces Oh My Pi's fs_cache/task dependencies with the `ignore` crate for
.gitignore-respecting file walking. Includes TypeScript type declarations
and wrappers in packages/native.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 13:02:29 -06:00
Lex Christopherson
75fe5d3319 feat: add native image module — decode, encode, and resize via Rust image crate
Port image processing from Oh My Pi's pi-natives crate, adapted for napi-rs v2.
Exposes NativeImage class with async parse/encode/resize methods backed by the
Rust `image` crate (PNG, JPEG, WebP, GIF support).

Includes:
- task.rs: lightweight async task scheduling for libuv thread pool
- image.rs: NativeImage class with SamplingFilter enum
- TypeScript types and wrapper (parseImage, ImageFormat, SamplingFilter)
- 8 passing tests covering decode, encode, resize, round-trip, error cases

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 12:51:49 -06:00
TÂCHES
daca368ba2 feat: add native clipboard module with arboard backend (#228)
Cross-platform clipboard access (text read/write, image read) via the
arboard Rust crate. No external tools (pbcopy, xclip, etc.) required.

Ported from Oh My Pi's clipboard module with adaptations for GSD's
architecture (direct AsyncTask instead of task::blocking wrapper).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 12:48:27 -06:00