@ataraxy-labs/sem 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,92 @@ All notable changes to sem are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.15.0] - 2026-06-30
8
+
9
+ ### Changed
10
+
11
+ - Whole-repo commands (`sem graph`) now skip the file-discovery walk when git proves the cache is fresh (HEAD unchanged and the working tree clean), serving the cached topology directly. On a 200K-file repo this is about 9x faster with git fsmonitor and about 4.5x faster without it; small repos and non-git repos are unchanged. The oracle only ever declines to accelerate, never serves stale results, and the `git status` check is time-bounded (`SEM_FRESHNESS_TIMEOUT_MS`) with `SEM_FRESHNESS=scan|git|auto` to override.
12
+
13
+ ### Added
14
+
15
+ - `sem xref` lists cross-repo dependencies across your indexed repos: entities in one repo that depend on entities in another. A single-repo local graph can't see this, so it's a cloud feature (requires `sem login`) and is gated to the team/enterprise tier. Adds `cross_deps()` to the shared cloud client.
16
+ - `sem diff` now prints a one-line hint, when run interactively and logged out, that `sem login` reveals what your changes break across repos (a cross-repo question a local single-repo diff can't answer). It is heavily throttled (at most once a week), shown only on a terminal with real entity changes, and stays completely silent in CI, pipes, `--json`/non-terminal output, and for logged-in users.
17
+
18
+ ### Performance
19
+
20
+ - Cache freshness checks now run the per-file `stat` + content-hash scan in parallel (rayon) instead of sequentially (#351). On touched-file cache hits over large repos, the freshness scan was the dominant remaining cost (~42ms of sequential filesystem/hash work on a 5K-file touched scenario); it now scales across cores. SQLite reads stay serial (the connection isn't shared across threads) and fingerprint-refresh writes remain serial and best-effort — only the pure filesystem+hash work is parallelized, so cache-hit validity is unchanged.
21
+
22
+ ### Documentation
23
+
24
+ - The bundled `/sem` agent skill no longer hardcodes a language count. It said "31 languages", which went stale as grammars were added and disagreed with the README ("32") and the crate description ("28"); it now says "30+ languages" so it can't drift, and an en-dash was replaced with a hyphen.
25
+ - README: documented the optional cloud acceleration flow (`sem login` serves `impact`/`context`/`entities` from a warm pre-built graph for large repos; local is unchanged and `SEM_LOCAL=1` forces local), and added Lua to the supported-languages table.
26
+
27
+ ### Added
28
+
29
+ - Lua support, via the `tree-sitter-lua` grammar (gated behind the `lang-lua` feature in `grammar-all`). Extracts global, `local`, table (`t.f`), and method (`t:f`) functions. Thanks @mmgeorge for the request (#393).
30
+ - `SemanticEntity` now carries optional `start_byte`/`end_byte` offsets, populated from the underlying tree-sitter node during code extraction. A consumer can slice the exact original bytes of an entity out of a file given only its `file_path` and span, without re-parsing. Persisted through the entity cache and surfaced in `sem entities --json`. Thanks to Thomas J. for the request.
31
+
32
+ ### Added
33
+
34
+ - `npx @ataraxy-labs/sem-skill`: one-command setup of sem for coding agents. Installs the sem skill into `~/.claude/skills/` and registers the `sem mcp` server, so an agent uses sem (impact / context / orient / diff) over grep for structural questions without manual setup. Builds on the skill contributed in #376.
35
+
36
+ ### Added
37
+
38
+ - An agent skill (`skills/sem/SKILL.md`) documenting sem's semantic diff, impact, blame, history, context, and graph workflows for coding agents. Thanks @linhlban150612 for the contribution (#376).
39
+ - `self-update` Cargo feature (on by default) gates the built-in `sem update` and the background update-available check. Distro and package-manager builds that own the binary's lifecycle can opt out with `cargo build --no-default-features`; `sem update` then prints a "update through your package manager" message instead of replacing the binary. Thanks @0323pin (pkgsrc/NetBSD) for the request (#390).
40
+
41
+ ### Added
42
+
43
+ - `sem context --hops N` bounds the related entities to N graph hops from the target (instead of filling to the token budget), so you can ask for "the entity and just its immediate neighborhood." The `sem_context` MCP tool gains the same `hops` parameter. 0 (the default) keeps the existing unbounded, budget-driven behavior.
44
+
45
+ ### Changed
46
+
47
+ - The `sem mcp` instructions now tell agents to read code with `sem_context` (which returns an entity's full source plus its callers/callees, addressed by name) rather than opening the file, reserving direct file reads for editing and non-code. Reading by entity is robust to line drift and arrives with the dependency context.
48
+
49
+ ## [0.14.1] - 2026-06-23
50
+
51
+ ### Fixed
52
+
53
+ - Release pipeline: the Intel macOS cross-build failed on `openssl-sys` (no target-arch OpenSSL when cross-compiling on Apple Silicon). It now builds OpenSSL from source via `--features vendored-openssl`, the same approach the Linux arm64 cross-build uses. 0.14.0's binaries never published because of this; 0.14.1 is the first release to ship binaries for every platform, including Intel macOS (#374).
54
+
55
+ ## [0.14.0] - 2026-06-23
56
+
57
+ ### Added
58
+
59
+ - `sem orient <query>` finds the entities most relevant to a query, structural code search for when you're dropped into an unfamiliar codebase and don't know the symbol name yet (e.g. `sem orient "where is the retry logic"`). Two-pass ranking: lexical score over entity name (subtoken + prefix/stem + substring), file path, and signature line, then a graph-centrality re-rank so a central, widely-used entity outranks a trivially-named helper. Results show the entity, its `file:line`, signature, and dependent count. `--json` and `--limit` supported. This is the structural counterpart to grep: grep finds text, orient finds the entity and how connected it is.
60
+ - The `sem_entities` MCP tool accepts a `query` parameter for the same intent search, so agents can find code by what it does (not just by name) without falling back to grep. The ranking is shared with the CLI (`sem_core::parser::orient`).
61
+ - `sem orient` down-weights entities in test files so implementation outranks an equivalently-named test. Test functions often match a query strongly by name, but the implementation is almost always what you want; tests stay findable, just below the real code.
62
+ - `sem entities` accepts `--only <kind>` and `--except <kind>` (both repeatable) to filter the listing by entity kind, e.g. `sem entities --only function --only struct` or `sem entities --except import`. The two flags are mutually exclusive. Because entity kinds are language-dependent, an unknown kind reports the kinds actually found in the scanned files rather than guessing a static list. Thanks @aleclarson for the request (#378).
63
+ - `SEM_WIDTH` sets the terminal-diff box width. sem's per-file box was a fixed 55 columns with no TTY attached, so it didn't match the surrounding pane when used as a pager (e.g. `lazygit`). Set `SEM_WIDTH=<columns>` to control it. Thanks @franky47 for the request (#380).
64
+
65
+ ### Fixed
66
+
67
+ - The Intel macOS binary now builds reliably. The release built `x86_64-apple-darwin` on a native Intel `macos-13` runner, which GitHub is retiring, so the job could queue indefinitely and stall the whole release (0.13.1's binaries never published for this reason). It now cross-compiles on Apple Silicon `macos-14`, where runners are plentiful. 0.14.0 is the first release to ship Intel macOS binaries.
68
+
69
+ ## [0.13.1] - 2026-06-23
70
+
71
+ ### Added
72
+
73
+ - `sem impact` can answer direct dependency queries from a fresh SQL topology cache without rebuilding the entity graph.
74
+ - `sem entities` reports phase timings and listing counters when `SEM_TIMINGS` is enabled.
75
+ - Optional OSC8 terminal hyperlinks on entity names in `sem diff`, so a supporting terminal (kitty, WezTerm, iTerm2, Ghostty, ...) renders them clickable and can open the definition at `file:line`. Off by default; enable with `SEM_HYPERLINK` set to an editor preset (`vscode`, `cursor`, `windsurf`, `zed`, `idea`, `file`) or a raw URI template using `{file}` and `{line}` (e.g. `SEM_HYPERLINK="vscode://file/{file}:{line}"`). Strictly TTY-only, so pipes, JSON output, and MCP/agent sessions never see escape codes. Force off with `SEM_NO_HYPERLINKS=1`. Thanks @olejorgenb for the request (#381).
76
+
77
+ ### Changed
78
+
79
+ - The `sem mcp` server now sends usage guidance to the agent instead of a bare tool list. The instructions tell the agent to prefer `sem_impact`/`sem_context`/`sem_entities` over grep/find for structural questions (what calls X, understand X, where is X) and to keep grep for text search and non-code files. Availability alone wasn't changing agent behavior; this biases agents toward the entity graph the moment the server connects, with no extra setup.
80
+ - `sem impact --deps` can reuse fresh caches when unrelated files change by validating the cached source set, hashes, and import metadata before falling back to a graph rebuild.
81
+ - `sem impact --deps` narrows cache freshness checks to the queried entity, direct dependencies, and relevant JavaScript/TypeScript imports when the query scope is explicit.
82
+ - Source scans skip default-excluded high-volume paths such as generated source directories, fixture/vendor/benchmark trees, generated file suffixes, CSS module declarations, and asset declarations; pass `--no-default-excludes` to include them.
83
+ - `sem entities` accepts `--file-exts` for large directory scans and avoids duplicate directory-listing post-processing.
84
+ - `sem entities` can list entities from a fresh SQLite topology cache instead of reparsing matching directory scans.
85
+ - `sem entities --json` streams rows to stdout instead of materializing an intermediate JSON value array.
86
+ - `sem entities` uses listing-only extraction so local listings do not retain source text or entity hashes.
87
+
88
+ ### Fixed
89
+
90
+ - Intel macOS (`x86_64-apple-darwin`) is now built and published. The release matrix only produced Apple Silicon (`arm64`) macOS binaries, so Intel Mac users got a 404 from `install.sh` and "Unsupported platform darwin:x64" from npm. Added the `x86_64-apple-darwin` target to the release build and the `darwin:x64` mapping to the npm wrapper. Thanks @stark-bit for the report (#374).
91
+ - TOML array-of-tables entries no longer collapse to a single entity in `sem diff`. Repeated `[[array]]` headers all reduced to the same id (`...::property::array`), so appending an entry showed up as a modification of the previous one instead of an addition. Each `[[key]]` entry now gets an index-based identity (`key/0`, `key/1`, ...) and is hashed independently, mirroring the JSON array-index handling. This also stops a `[key]` table and a `[[key]]` array-of-tables with the same name from colliding. Thanks @Arpafaucon for the report and analysis (#362).
92
+
7
93
  ## [0.13.0] - 2026-06-16
8
94
 
9
95
  ### Fixed
package/README.md CHANGED
@@ -173,7 +173,7 @@ sem impact authenticateUser --json
173
173
  # Disambiguate by file
174
174
  sem impact authenticateUser --file src/auth.ts
175
175
 
176
- # Include generated/build directories that repo-wide scans skip by default
176
+ # Include default-excluded paths such as generated, fixture, vendor, benchmark, and build trees
177
177
  sem impact authenticateUser --no-default-excludes
178
178
  ```
179
179
 
@@ -220,7 +220,7 @@ sem entities src/auth.ts
220
220
  sem entities --json
221
221
  sem entities src/auth.ts --json
222
222
 
223
- # Include generated/build directories that repo-wide scans skip by default
223
+ # Include default-excluded paths such as generated, fixture, vendor, benchmark, and build trees
224
224
  sem entities --no-default-excludes
225
225
  ```
226
226
 
@@ -238,7 +238,7 @@ sem context authenticateUser --budget 4000
238
238
  # JSON output
239
239
  sem context authenticateUser --json
240
240
 
241
- # Include generated/build directories that repo-wide scans skip by default
241
+ # Include default-excluded paths such as generated, fixture, vendor, benchmark, and build trees
242
242
  sem context authenticateUser --no-default-excludes
243
243
  ```
244
244
 
@@ -258,9 +258,26 @@ To disable and go back to normal git diff:
258
258
  sem unsetup
259
259
  ```
260
260
 
261
+ ## Cloud acceleration (optional)
262
+
263
+ sem builds an entity dependency graph to answer `impact`, `context`, and `entities`. On a small or medium repo that's instant. On a very large codebase, building the graph locally can take hundreds of milliseconds to a few seconds.
264
+
265
+ `sem login` connects sem to sem cloud, which keeps a warm, pre-built graph for your registered repos. When you're logged in, those queries are served from the warm cache instead of rebuilt locally, so they stay fast no matter how big the repo gets.
266
+
267
+ ```bash
268
+ sem login # GitHub device flow, one time
269
+ sem impact myFunc --file src/foo.rs # served from the cloud's warm graph
270
+ ```
271
+
272
+ It is fully optional and transparent:
273
+
274
+ - Not logged in, or the cloud is unreachable? sem computes locally and prints the exact same output. No failures, no difference in results.
275
+ - `SEM_LOCAL=1` forces local computation even when logged in.
276
+ - Small repos see no change, local is already fast. The win is for large codebases where rebuilding the graph each time is the bottleneck.
277
+
261
278
  ## What it parses
262
279
 
263
- 31 programming languages with full entity extraction via tree-sitter:
280
+ 32 programming languages with full entity extraction via tree-sitter:
264
281
 
265
282
  | Language | Extensions | Entities |
266
283
  |----------|-----------|----------|
@@ -278,6 +295,7 @@ sem unsetup
278
295
  | Swift | `.swift` | functions, classes, protocols, structs, enums, properties |
279
296
  | Elixir | `.ex` `.exs` | modules, functions, macros, guards, protocols |
280
297
  | Bash | `.sh` | functions |
298
+ | Lua | `.lua` | functions (global, local, table, and method forms) |
281
299
  | HCL/Terraform | `.hcl` `.tf` `.tfvars` | blocks, attributes (qualified names for nested blocks) |
282
300
  | Kotlin | `.kt` `.kts` | classes, interfaces, objects, functions, properties, companion objects |
283
301
  | Fortran | `.f90` `.f95` `.f` | functions, subroutines, modules, programs |
@@ -348,6 +366,12 @@ Add it once, then talk to your agent normally. It calls the tools on its own.
348
366
  claude mcp add sem -- sem mcp
349
367
  ```
350
368
 
369
+ Or one command that also installs the skill, so the agent knows *when* to reach for sem:
370
+
371
+ ```bash
372
+ npx @ataraxy-labs/sem-skill
373
+ ```
374
+
351
375
  **Cursor, Claude Desktop, or any client with an `mcpServers` config:**
352
376
 
353
377
  ```json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ataraxy-labs/sem",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "npm wrapper for the sem CLI. Downloads the matching release binary and exposes the sem command in node_modules/.bin.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -34,11 +34,13 @@ export function resolveReleaseArtifact({
34
34
  return 'sem-linux-arm64.tar.gz';
35
35
  case 'darwin:arm64':
36
36
  return 'sem-darwin-arm64.tar.gz';
37
+ case 'darwin:x64':
38
+ return 'sem-darwin-x86_64.tar.gz';
37
39
  case 'win32:x64':
38
40
  return 'sem-windows-x86_64.tar.gz';
39
41
  default:
40
42
  throw new Error(
41
- `Unsupported platform ${key}. Supported targets: linux/x64, linux/arm64, darwin/arm64, win32/x64.`,
43
+ `Unsupported platform ${key}. Supported targets: linux/x64, linux/arm64, darwin/x64, darwin/arm64, win32/x64.`,
42
44
  );
43
45
  }
44
46
  }