Skip to content

Derive source extensions from sem's code plugin; bump sem-core to 0.29 - #28

Merged
rs545837 merged 5 commits into
Ataraxy-Labs:mainfrom
alycda:dart-via-sem-registry
Nov 7, 2026
Merged

rs545837 merged 5 commits into
Ataraxy-Labs:mainfrom
alycda:dart-via-sem-registry

Conversation

@alycda

@alycda alycda commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #27.

  • is_source_file is now derived from CodeParserPlugin::extensions(). I didn't use the whole registry because it brings in lockfiles and docs, and those deflate every risk score. The commit message has the measurement.
  • sem-core goes 0.5.3 → 0.25 → 0.29, as two commits so each blast-radius shift can be bisected on its own. The only API change is that GraphEntity::id is now EntityId.
  • jj colocated repos now open: inspect 0.1.1 fails on them with unsupported extension name extensions.relativeworktrees. Tests pin the commit-tree and staged-index paths.

🤖 Generated with Claude Code

alycda and others added 4 commits September 21, 2026 19:54
Pinned at 0.5.3 against 0.25.0 on crates.io. Compiles clean - no API
breakage for inspect's usage across that range - and brings
tree-sitter-dart 0.1.0 -> 0.2.0 with it, which is what gives Dart real
entities on the diff path (the path that does not go through
is_source_file).

Split from the is_source_file change that follows so it can be bisected
on its own: it independently shifts TypeScript blast numbers. On a
fixture with real cross-file edges, `method hello` moves from blast 2 /
deps 0/2 to blast 1 / deps 0/1. Real edges survive - `function run`
still reports deps 2/0 - but the numbers are not identical across the
bump, and that is worth being able to revert separately.

Drops one import the bump makes unused.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes Ataraxy-Labs#27. is_source_file was a hand-written list of 13 extensions; the
tree-sitter code plugin claims 85. The languages in between - Dart,
Swift, Kotlin, Elixir, Bash, Lua and the rest - never entered the
dependency graph, because all three of this function's call sites gate
repo materialization rather than triage.

That split is what made the gap quiet rather than loud. Changed entities
in those languages were still triaged, so you got chunk entities scored
by line count and a blast_radius of 0 that reads as "safe" instead of
"not measured".

Derived from CodeParserPlugin::extensions(), NOT the whole registry. The
issue suggested the registry, and that was my first cut, but it is
actively harmful: the registry also carries json/yaml/toml/csv/markdown/
latex, and compute_risk_score normalizes blast radius by total graph
entity count. Admitting documentation and dependency metadata therefore
deflates every score in the report. Measured on an otherwise identical
change, with one realistic 670 KB package-lock.json in the repo:

    registry-derived:  MEDIUM  function a   738ms  (16005 entities)
    code-plugin only:  HIGH    function a    11ms  (2 entities)

A full risk band, silently. Worse, two of the three call sites -
materialize_index_source and materialize_source_files - never apply
is_noise_file, so lockfiles noise.rs explicitly names were being written
out and parsed. Happy to widen if you want the doc formats, but the
denominator in risk.rs needs handling first.

Every code extension is single-part, so matching is on the final dot,
with a test that fails if sem-core ever adds a multi-part one. Uses
Path::file_name rather than splitting on '/' because CI runs Windows.

On the Flutter branch from the issue, 61 chunks + 1 section becomes
1 class + 1 getter + 7 methods + 4 orphans + 1 section + 16 chunks. The
9 Dart entities match what `sem diff` independently reports; the
residual chunks are a justfile and gradle.properties, which no plugin
claims.

Known limit, unchanged by this: sem also detects by shebang, so an
extensionless `#!/usr/bin/env python` script still yields entities on
the diff path while never entering the graph. Dart blast_radius also
stays 0 - sem-core extracts Dart entities but emits no edges for them
(Ataraxy-Labs/sem#491).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Brings inspect level with sem's current release so its parser, grammar
set and git handling match what `sem` itself reports. Two things ride
along that matter for inspect specifically:

- sem-core 0.15.1 made GitBridge::open tolerate the
  extensions.relativeworktrees key that every jj colocated repo sets.
  libgit2 otherwise refuses to open those repos at all.
- Every grammar sem has added since 0.25 reaches inspect's graph with
  no inspect change, via the code-plugin-derived is_source_file in the
  previous commit.

The only API break in the range is GraphEntity::id becoming an
EntityId newtype (Arc-backed) instead of String. inspect keeps its own
changed-entity set as HashSet<String>, so lookups go through
EntityId::as_str() and the Borrow<str> impl, and dependency_edges take
an owned copy. No behaviour change intended; the existing analyze and
source_file_selection tests pass unchanged.

Kept as its own commit on top of the 0.25 bump rather than amending
it: the 0.25 commit is already on the fork, and a separate step keeps
any blast-radius shift from this range bisectable on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every jj colocated repo sets core.repositoryformatversion = 1 and
extensions.relativeWorktrees = true. libgit2 refuses to open a repo
that names an extension it was not told to tolerate, so inspect 0.1.1
fails on all of them before doing any work:

    error: git error: unsupported extension name
    extensions.relativeworktrees; class=Repository (6)

No production change is needed here. sem-core 0.15.1 added
ensure_git_extensions_supported to GitBridge::open, and every local
entry point (diff, file, predict, review, pr in local mode) goes
through build_context, which calls GitBridge::open before either of
inspect's own Repository::discover calls in materialize_tree_source
and materialize_index_source. inspect and sem-core resolve to the same
git2 0.20.4, so the process-wide tolerance covers both. I checked for a
second opt-in in inspect and left it out: it would duplicate sem's
OnceLock and its extension list, which set_extensions replaces rather
than appends to.

The two tests cover the commit-tree path and the staged-index path, the
two places inspect opens libgit2 itself. They catch sem-core dropping
the tolerance. They do not catch a future inspect path that opens a raw
Repository before GitBridge::open, because another test in the same
binary usually installs the setting first; the comment on the tests
says so.

Verified on a real jj repo (ask-claude): installed inspect 0.1.1 fails
with the error above; this branch's release build returns function and
orphan reviews for HEAD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@inspect-review inspect-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inspect review

Triage: 25 entities analyzed | 0 critical, 0 high, 9 medium, 16 low
Verdict: standard_review

Findings (0)


Reviewed by inspect | Entity-level triage found 0 high-risk changes

@vercel

vercel Bot commented Nov 5, 2026

Copy link
Copy Markdown

@alycda is attempting to deploy a commit to the rs545837's projects Team on Vercel.

A member of the Team first needs to authorize it.

@inspect-review inspect-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inspect review

Triage: 25 entities analyzed | 0 critical, 0 high, 9 medium, 16 low
Verdict: standard_review

Findings (0)


Reviewed by inspect | Entity-level triage found 0 high-risk changes

@rs545837
rs545837 merged commit 23fdac0 into Ataraxy-Labs:main Nov 7, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Dart support — .dart files fall back to 20-line chunks (sem-core already parses Dart)

2 participants