@ataraxy-labs/sem 0.20.0 → 0.22.1

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,51 @@ All notable changes to sem are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.22.1] - 2026-08-16
8
+
9
+ ### Added
10
+
11
+ - **`sem find` / `sem callers` / `sem refs`**: new query verbs that answer directly from the mmap `index.sem` — entity definitions, direct callers (reverse edges), and direct refs (forward edges) — without touching `cache.db`.
12
+ - **`sem grep <pattern>`**: trigram-accelerated text search over the mmap index. A required-trigram query against the index's `TRIGRAM` section narrows the candidate file set, each candidate is then verified with the real regex matcher against its *current* bytes (never stale stored content), and output is `rg`-compatible `file:line:text`. Beats `rg` 11-26x on giant repos (measured on the TypeScript monster and home-assistant-core corpora: 25-53ms vs. `rg`'s 283-980ms for the same pattern). Falls back to a full scan for patterns no trigram query can be derived from.
13
+ - **`sem review listen <diff-id-or-url> [--dry-run]`**: one-command agent attach to a hosted sem-cloud review. Resolves credentials, validates the diff exists, locates the review-listener plugin, and execs `claude` with the documented flags/env. `--dry-run` prints the assembled command with secrets masked, without launching or requiring `claude` to be installed.
14
+ - **Three new sem-cloud MCP tools** (`join_review`, `wait_for_branch`, `reply_to_branch`) let an agent join a hosted code review as a live listener: long-poll for reviewer questions anchored to lines of a diff, investigate them in the repo, and stream answers back. Ships with a Claude Code plugin (`integrations/claude-review-listener/`) that wires the tools up and adds a read-only Stop-hook backstop for headless sessions.
15
+ - **`sem diff`'s hosted upload no longer blocks on the local caller/callee relations pass.** With cloud consent on, the diff snapshot uploads immediately with empty relations; the server queues enrichment and replies "enrichmentQueued" (or, against an older server, the CLI runs the existing local pass and PUTs the result afterward). `SEM_RELATIONS_LOCAL=1` restores the old blocking single-upload behavior; the local relations pass's own budget is now adaptive to repo size.
16
+
17
+ ### Performance
18
+
19
+ - **Cold graph builds are 11-30% faster and peak RSS is down 17-40% on giant corpora, versus 0.21.** Measured end-to-end on the shipped release binary: home-assistant-core 5.9s, TypeScript monster 11.2s, dotnet-runtime 46.7s, llvm-project 34.7s, linux 35.2s cold full-CLI (warm rebuilds: 0.2-1.3s). Every corpus improved on both the engine-only and full-CLI metrics; full methodology and per-corpus numbers are in `RESOLUTION-PROFILE.md`'s FINALE section.
20
+ - **C#/C++ builds now skip re-parsing files whose facts are already known**, closing the last gap in precomputed-facts reuse (JS/TS/Python/Go/Java/Rust already had it). A per-file gate proves a corpus-wide invariant — no entity's parent lives in a different file — before trusting precomputed facts wholesale, so this needed no facts-schema change. Measured on dotnet-runtime: reparse time drops from 10.6s to 65ms.
21
+ - **Parsed file facts now persist to disk as a content-addressed corpus**, so a build that has seen a file's exact content before warm-starts it instead of re-parsing from scratch, even in a fresh process. Fixed a regression where checking a shared corpus against a large number of prior contributors got slower as the corpus grew (one repo's known-content rebuild was measured 332% slower against a 7.9GB shared corpus than a 556MB one); it now costs the same regardless of corpus size.
22
+ - **`sem context` regained a fast tier it had lost, by reading each entity's body from its own file at an indexed byte span instead of walking and hydrating the whole corpus.** A prior cascade of cache removals deleted the old fast path along with a correctness bug it had, but left `sem context` always doing a full corpus load — measured on the TypeScript monster 1.11s down to 48ms, on a mid-size repo 0.16-0.28s down to 4.6ms. Verified byte-identical against the always-correct full-load path across both entity- and file-scoped lookups; still declines (never approximates) on a stale cache, an ambiguous name, or any entity missing a span.
23
+
24
+ ### Changed
25
+
26
+ - **`sem mcp --resident`'s standing sidecar process is gone.** With index-backed queries answering in single-digit milliseconds from a cold process, the resident's whole reason for existing (avoiding a ~800ms SQLite hydrate) no longer applies — it measured 0% availability at scale, a 300ms tax, and 2.6GB of idle RSS. `SEM_NO_SIDECAR` and `SEM_NO_AUTOWARM` are gone with it; the `--resident` flag itself stays as a no-op for compatibility.
27
+
28
+ ### Fixed
29
+
30
+ - **`sem --version` now reports the correct version.** The `v0.21.1` tag only bumped `sem-core`, leaving `sem-cli`, `sem-mcp`, `sem-plugin`, and `sem-cloud-client` at `0.21.0`, so the binary still reported `0.21.0`. Bumped those crates (and their internal path dependencies) to `0.21.1` to match the tag. Thanks @chenrui333 (#480).
31
+ - **Building a graph over Svelte components no longer crashes (SIGSEGV) on Linux/glibc.** `sem graph`/`context`/`orient` over `.svelte` files deterministically exited 139 from an invalid free in the `tree-sitter-htmlx-svelte` 0.1.8 grammar's scanner, hit during parallel graph construction (macOS's allocator tolerated the bad free, so it only showed on Linux). Bumped the grammar to 0.1.16, which carries the scanner fixes; the existing version constraint already permitted it, so this is a lock-only dependency update. Added a parallel-Svelte-graph regression test. Thanks @XF-FW for the exhaustive isolation and the verified fix (#471).
32
+
33
+ ## [0.21.0] - 2026-07-10
34
+
35
+ ### Added
36
+
37
+ - **Cloud-enabled `sem diff` now creates an immutable, owner-private hosted review URL.** Snapshot uploads include changed-entity caller/callee relations and truthful Git provenance: branch, scope, base/head refs, and available SHAs. Working-tree reviews explicitly report `HEAD → WORKTREE` rather than implying that uncommitted changes exist on GitHub.
38
+ - **GitHub login can now be exchanged for a revocable CLI session.** Raw GitHub credentials are not persisted as sem credentials, and the CLI session resolves to the same stable principal used by web reviews.
39
+
40
+ ### Fixed
41
+
42
+ - **Hosted-review upload failures are visible without breaking the local diff.** `sem diff` still exits successfully with its complete local result, while stderr explains that the private review could not be uploaded.
43
+ - **Transitional cloud repository states refresh immediately.** `sem whoami` no longer leaves a repository stuck at a cached `pending` state after cloud indexing has completed.
44
+ - **`sem diff` now collapses contiguous line chunks on unsupported files into one summary line.** When a file has no grammar, sem falls back to fixed 20-line chunks, so deleting or adding one previously printed a wall of `⊖ chunk lines 1-20 [deleted]` / `21-40` / `41-60` … lines that ate context for no information. Contiguous chunks of the same change type now consolidate to a single line, e.g. `⊖ 13 chunks lines 1-246 [deleted]`. Verbose mode (`-v`) is unchanged, since it still prints per-chunk content. Thanks @graipher for the report (#466).
45
+
46
+ ### Performance
47
+
48
+ - **`sem context` now answers from an indexed point query instead of loading the whole graph, so it scales to millions of entities.** It previously hydrated every entity (plus decompressed bodies) just to answer about one, so on a 2.3M-entity repo each call took ~15s. The SQLite cache is already normalized and indexed, so when the git oracle proves the cache fresh (no filesystem walk) `sem context` now builds only the k-hop neighbourhood around the target straight from the store: batched `IN (...)` edge queries, bodies fetched per hop, stopping once there is enough content to cover the token budget so a hub entity's fan-out does not explode the fetch. It reuses the existing packer on that subgraph, so output is byte-for-byte identical to the full-graph path, and falls back to the full load whenever the oracle declines. On the Linux kernel (2.31M entities) `sem context` drops from ~15s to 0.44s per call; on Kubernetes (520k) from ~5s to ~1.2s.
49
+ - **Default (`All`-mode) `sem impact` now answers from the indexed cache too, instead of hydrating the whole graph.** A full cache stored entities and edges but not test flags, so All/Tests-mode impact (which includes the "covered by N tests" answer) fell through to a full-graph load — ~3.5s on Kubernetes, ~10.7s for an unbounded `--depth 0`, even for a tiny blast radius. The full save now records test flags (shared with the topology save) behind a metadata marker, so the existing point-query path can serve All-mode impact straight from indexed edge queries. Output is identical to the full-load path — verified byte-for-byte against it, including the tests field. On Kubernetes (520k entities) default `sem impact` drops from **~3.5s to 0.04s**, and `--depth 0` from **~10.7s to 0.04s**. Caches built before the marker still take the full path, so nothing regresses.
50
+ - **The resident MCP server no longer holds the whole graph in RAM by default, cutting idle memory dramatically.** It used to proactively build and keep the entire deserialized graph in memory on startup so the first query would be warm — ~671MB on Kubernetes, ~5GB on the Linux kernel. But `context` and `impact` now answer from the indexed cache directly, and the CLI's fast paths bypass the resident entirely, so that proactive hold is mostly wasted memory. Prewarm is now opt-in (`SEM_PREWARM`); by default the resident stays light and builds the full graph lazily, only when a query that genuinely needs it (graph/diff/text) runs. On Kubernetes an idle resident drops from **671MB to 10MB**.
51
+
7
52
  ## [0.20.0] - 2026-07-05
8
53
 
9
54
  ### Changed
package/README.md CHANGED
@@ -20,6 +20,7 @@
20
20
  <a href="#install">Install</a> ·
21
21
  <a href="#commands">Commands</a> ·
22
22
  <a href="#use-with-ai-agents-mcp">Agents (MCP)</a> ·
23
+ <a href="docs/cloud-consent.html">Cloud consent</a> ·
23
24
  <a href="https://github.com/Ataraxy-Labs/sem/releases/latest">Releases</a>
24
25
  </p>
25
26
 
@@ -35,6 +36,8 @@ sem is a semantic version control tool that works on top of Git. It parses your
35
36
 
36
37
  It works in any Git repo with no setup.
37
38
 
39
+ Cloud-backed queries are opt-in per repo: logging in does not upload a repo or send a query. See the [cloud consent flow](docs/cloud-consent.html) for the public/private repo states, preview screen, local audit log, and forget controls.
40
+
38
41
  <p align="center">
39
42
  <img src="assets/terminal.svg" alt="sem diff" width="800" />
40
43
  </p>
@@ -505,7 +508,7 @@ Want to add a new language? See [CONTRIBUTING.md](CONTRIBUTING.md) for a step-by
505
508
 
506
509
  ## Star History
507
510
 
508
- [![Star History Chart](https://api.star-history.com/svg?repos=Ataraxy-Labs/sem&type=Date)](https://star-history.com/#Ataraxy-Labs/sem&Date)
511
+ [![Star History Chart](assets/star-history.png)](https://star-history.com/#Ataraxy-Labs/sem&Date)
509
512
 
510
513
  ## License
511
514
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ataraxy-labs/sem",
3
3
  "mcpName": "io.github.Ataraxy-Labs/sem",
4
- "version": "0.20.0",
4
+ "version": "0.22.1",
5
5
  "description": "npm wrapper for the sem CLI. Downloads the matching release binary and exposes the sem command in node_modules/.bin.",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "type": "module",