Skip to content

A window that changes only TypeScript files outside every member runs no indexer - #1976

Merged
zlareb1 merged 3 commits into
ClickHouse:mainfrom
KaloyanNaumov:pr/ts-unowned-no-rerun
Dec 2, 2026
Merged

zlareb1 merged 3 commits into
ClickHouse:mainfrom
KaloyanNaumov:pr/ts-unowned-no-rerun

Conversation

@KaloyanNaumov

@KaloyanNaumov KaloyanNaumov commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1961
Related: #1782

Changelog category (leave one):

  • Performance Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

With a TypeScript project list or an umbrella root, a commit that changes only TypeScript files outside every project (root *.config.ts, scripts/, tools/) no longer reindexes every project; the pass runs no indexer and writes the same delta as before.

Why

Case 1 of #1961. A changed TypeScript path that no member owns made select_projects_for_delta return the whole member list. The merge keeps a document only from a member that owns it, so no member's index can hold such a path: the pass reindexed every member and converted nothing for it. On a repository with 222 members, 17 of its last 100 commits were of this kind.

Such a path now selects no member when nothing else in the window selects one. The harness then runs no indexer and converts an empty index, so the delta carries the window's deletions as before. An empty selection with a member list writes an empty index instead of falling through to the indexer run on the checkout root (the third smaller gap in #1961); a checkout without a member list still takes that run.

Beside a path that selects a member, or beside an unowned manifest, the full set stays. The converter reads definition kinds from the members it indexes: a reference to an arrow-function constant becomes a calls edge only when the index holds the constant's definition. With members src, src/infra and pkg/b and the real scip-typescript, an edit to src/infra/net.ts beside an unowned tools/build.ts writes net -> helper and net -> twice when every member runs, and neither when src/infra runs alone. Narrowing those windows waits on the kind gap in #1958.

Scope and risk

scripts/scip_harness/scip_ts_projects.py (select_projects_for_delta), run_typescript_delta.sh (index_workspace's branch for no targets reads ALL_PROJECTS), the architecture page's TypeScript row, and tests.

The deltas are the same as main writes when its pass completes. In a window this changes, every changed TypeScript file is one no member owns, no manifest changed, and main converted with --changed-files: no document of any member index matched, so its delta held no files and the window's deletions, which an empty index gives too.

Measured on a repository with 222 members from 15 directory patterns, replaying the last 100 first-parent commits as one-commit windows through the filter and the harness's decisions:

main this branch
indexer runs over the 100 windows 4,574 800
windows that rerun all 222 members 20 3
windows that run no indexer 14 31

The 3 full reruns left are mixed windows, kept for the reason above. With the real scip-typescript 0.4.0 and a 24 GiB heap, on the window of one commit that changes a single test/vitest/*.mjs file: main had indexed 5 of the 222 members when the worker's default code_scip_ts_delta_timeout_seconds of 3,600 s ran out (src alone took 976 s); this branch exits 0 after 0.3 s with no indexer run and a delta of 0 files. For scale, a window that indexes ui alone took 938 s and 1,109 s on the two trees with byte-identical deltas; the host ran other indexing jobs at the time.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting brings back the full reruns; nothing is stored.

Tests

  • tests/unit/test_scip_ts_projects.py::test_a_typescript_path_no_member_owns_selects_no_member: tools/build.ts alone, and beside a README, selects none. Fails on main (every member).
  • tests/unit/test_scip_ts_projects.py::test_an_unowned_path_beside_a_selecting_one_keeps_the_full_set: an owned edit beside outside.ts, and tools/build.ts beside tools/package.json, keep the full set.
  • tests/unit/test_run_typescript_delta_umbrella.py::test_delta_with_only_an_unowned_typescript_path_runs_no_indexer: the harness runs no indexer, neither the members nor the checkout root, calls the converter with --changed-files and writes the delta. On main it runs both members; with the filter change alone it runs the indexer on the checkout root (index --output …/index.scip), which is why index_workspace changes too.
  • Run on the branch cut from main at 3058a5816: test_scip_ts_projects.py, test_run_typescript_delta_umbrella.py, test_scip_merge_indexes.py, test_run_typescript_delta_projects.py, test_scip_harness_windows.py (93 passed) and test_tunable_constants.py. ruff check, ruff format --check, the function-length gate (52, baseline 52), scripts/gates/mypy_gate.py (0 errors), shfmt 3.10.0 on the harness and Prettier on the page pass. mypy on scip_ts_projects.py alone reports the same five errors as on main. The full unit suite was not run here; CI runs it.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and the tests. Checked: I reviewed the whole diff and its tests; the runs listed under Tests are the agent's.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: none are affected.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited: no migration.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version: no plugin file changed.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed: it did not.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes: the TypeScript row of docs/architecture/code-index-architecture.md.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

Note

Low Risk
Harness-only selection and shell branching for SCIP TypeScript deltas; output is intended to match prior deltas for these windows while avoiding unnecessary indexing.

Overview
Commits that touch only TypeScript paths no umbrella member owns (e.g. tools/, root configs) no longer trigger a full multi-member scip-typescript reindex.

select_projects_for_delta now returns an empty project set for that window instead of every member. When the window also selects a member or changes a manifest/lockfile, the full member set is still used so calls edges for owned files stay complete.

run_typescript_delta.sh treats an empty filter as a real empty selection: it writes an empty index.scip and skips both per-member and checkout-root indexing when a member list exists (ALL_PROJECTS), while still converting the window delta with --changed-files.

Architecture docs and unit/umbrella harness tests document and lock in the new behavior.

Reviewed by Cursor Bugbot for commit 95f1a89. Bugbot is set up for automated code reviews on this repo. Configure here.

KaloyanNaumov and others added 3 commits December 1, 2026 23:05
With a member list, a changed TypeScript file outside every member (a root
`*.config.ts`, `scripts/*.ts`, `tools/**`) made the filter return the whole
list. The merge keeps a document only from a member that owns it, so none of
those indexes could hold the file: the pass reindexed every member and
converted nothing for it.

Such a path now selects no member. A window holding only paths no member
owns runs no indexer and converts an empty index, so its delta still carries
the window's deletions. An empty selection no longer falls through to the
indexer run on the checkout root, which is the run a member list exists to
avoid; a checkout without a member list still takes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The converter reads definition kinds from the members it is given: a
reference to an arrow-function constant becomes a `calls` edge only when the
index holds that constant's definition. With the full set, the window's owned
files got those edges into every member; with only their owners, a reference
into another member lost them. Measured with scip-typescript on members
`src`, `src/infra` and `pkg/b`: an edit to `src/infra/net.ts` beside an
unowned `tools/build.ts` writes `net -> helper` and `net -> twice` with the
full set and neither with `src/infra` alone.

So an unowned TypeScript path selects no member only when nothing else in the
window selects one, the case in which no file is converted either way. Beside
a selected member, or beside an unowned manifest, the full set stays as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The architecture row said a window whose only TypeScript changes lie
outside every project indexes none. A window with such a file beside a
changed manifest or lockfile still runs every member, so the row now says a
window whose only changes are TypeScript files outside every project. The
module and function docstrings in scip_ts_projects.py and a comment in
run_typescript_delta.sh named the same case without the manifest and
lockfile condition; they now carry it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 2, 2026 3:42am UTC
loom-telemetry Ready Ready Preview Dec 2, 2026 3:42am UTC

Request Review

@zlareb1 zlareb1 self-assigned this Dec 2, 2026

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The empty selection keeps the root indexer idle and still emits the changed and deleted window. The mixed and shared-config cases retain their existing selection. All 35 focused project-filter and umbrella-harness tests passed.

@zlareb1
zlareb1 merged commit 897a1d6 into ClickHouse:main Dec 2, 2026
80 checks passed
@KaloyanNaumov
KaloyanNaumov deleted the pr/ts-unowned-no-rerun branch December 2, 2026 09:33
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.

2 participants