Repository navigation
Index TypeScript monorepos by member project, not the umbrella root - #1782
Conversation
Expand a solution-style root tsconfig to its referenced projects so scip-typescript does not load the whole graph in one process. On a delta, index only the projects that contain the window's files, and fall back to the full set when a shared config or lockfile changes. Closes ClickHouse#1678 Signed-off-by: yuzhou <1991039819@qq.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
The harness skips the shared-config fallback and falls back to the root on valid inline JSONC. I reproduced both with the stub indexer. The existing threads cover those two cases. Shared config · Inline JSONC
zlareb1
left a comment
There was a problem hiding this comment.
The format job rejects the same docs/pages/adoption.astro assignment on this CI merge and on clean main. The pinned formatter passes with the existing repair. PR job · Main job · Repair #1706
Preserve explicit tsconfig file references through discovery and the indexer invocation. Parse JSONC with string-aware comment stripping so inline comments and paths globs like @/* still expand to members. Pass the full delta window (not only TypeScript globs) into the project filter so a shared config change falls back to every member, and do the same when any changed TypeScript path is unowned. Signed-off-by: yuzhou <1991039819@qq.com>
|
Pushed 315c4d7 to address the review notes: string-aware JSONC parsing, passing the full delta window into the shared-config fallback, preserving explicit tsconfig file references, and falling back when any changed TypeScript path is unowned. Added unit and harness coverage for each case. On the format job: agreed this is the same |
zlareb1
left a comment
There was a problem hiding this comment.
P1 — scripts/scip_harness/run_typescript_delta.sh:142 still sends every member to one indexer process on a full pass. The pinned indexer already walks root references one at a time and shares its source-file cache across them. Passing those same members as arguments retains the same cache and heap, so the change leaves the reported out-of-memory path in place. Bound the cache or isolate member runs, and validate the full pass on a monorepo that hits the current limit. Index loop · Source-file cache
scip-typescript shares its source-file cache across every target in one process, so a full umbrella pass that passed every member as arguments kept the same heap growth as indexing the root. Run one member per process and merge the indexes. Discover and filter print one path per line so a member directory with a space is not split in the shell. Signed-off-by: yuzhou <1991039819@qq.com>
|
Pushed c0d7465 for the notes from the 06:35 PT review.
The format job, the conflict-resolver attestation, and the other failures that also fail on clean main are unchanged; I left those alone here. |
zlareb1
left a comment
There was a problem hiding this comment.
P1 — A regular root tsconfig produces an empty index. I reproduced this on the full pass and on a delta that edits one TypeScript file. The harness exits successfully with zero indexer calls in both cases. Restore the workspace invocation when no member list is configured and cover both passes with the existing stub. Existing thread
All 21 focused tests passed, including the spaced path, mixed shared-config window, and one indexer process per member.
An empty member list wrote a zero-byte index and skipped scip-typescript, so a checkout with an ordinary root tsconfig produced no compiler symbols. Restore the workspace invocation for that case, and cover a full pass and a one-file delta with the stub indexer. Signed-off-by: yuzhou <1991039819@qq.com>
|
Pushed 7a6c9a2 (and merged current main at 11c0a52) for the empty-index note on a regular root tsconfig.
The unit-6 failure in |
Isolated scip-typescript runs follow project references, so a
dependency's documents can appear in more than one part. Merge by
relative_path and keep the copy from the owning member.
posix_path no longer uses lstrip("./"), which was stripping the
leading dot from hidden directories such as .storybook.
Signed-off-by: yuzhou <1991039819@qq.com>
zlareb1
left a comment
There was a problem hiding this comment.
All 28 focused tests pass, including both regular-root paths. A separate probe with two explicit tsconfigs in one directory kept only the test document and dropped the app document. The existing thread covers that loss. A config-only delta also skips indexing.
zlareb1
left a comment
There was a problem hiding this comment.
The three failures in these unit jobs reproduce on the CI base 196ef2fb1b. The extraction classification, adoption timeout, and sender census checks all pass on current main. Unit part 1 · Unit part 4 · Classification and timeout fix · Sender census fix
Explicit tsconfigs in the same directory share a project scope, so picking an owner by filename dropped the other sibling's documents. When the longest scope is tied, each member keeps what it emitted. A window that only changes a shared config selected every member, then exited before indexing because the TypeScript window was empty. Reindex the selected members and convert the full member indexes so module-resolution changes rebuild compiler rows. Signed-off-by: yuzhou <1991039819@qq.com>
zlareb1
left a comment
There was a problem hiding this comment.
The root package-only window now writes a delta. A mixed window still leaves affected compiler rows behind. I also reproduced the member README rebuild with the harness stub.
A shared-config change plus a TypeScript edit indexed every member, but the converter still received only the edited TypeScript path, so compiler rows in the other members could stay stale. Convert the full member indexes in that case and keep TypeScript deletions. A non-config change inside a member, such as a README, no longer selects that member for a full rebuild. Isolated merges also drop documents followed through project references when the owning package is not in the current run. Signed-off-by: yuzhou <1991039819@qq.com>
|
Pushed 2c7d09a (and merged current main) for the 6:35 PM PT review.
The focused harness and merge tests pass. I left the CI failures that also fail on clean main alone here. |
A root-level tsconfig owns every path, so a subset rebuild that indexes it alone could keep documents followed into other packages. Merge now uses the full discovered member set for ownership and drops those rows when a more specific member exists. An unowned package.json or tsconfig no longer leaves the filter empty while keeping the full project list, so it takes the empty-delta exit instead of reindexing every member. Signed-off-by: yuzhou <1991039819@qq.com>
…a-delta Picks up ClickHouse#1871, which moved MCP places limits into settings so test_no_new_tunable_constant no longer fails on this branch. Signed-off-by: yuzhou <1991039819@qq.com>
|
Addressed the two new Bugbot notes in 6e72312:
Also merged |
zlareb1
left a comment
There was a problem hiding this comment.
The root-level tsconfig and nested config-only paths now have coverage. The generated-tsconfig ownership finding remains on this head. The harness passes the generated config file as the indexed project and its parent directory as the known owner. The merge compares those strings and drops the member’s documents. Use the same project identity for both lists and cover a member with no original tsconfig.
The format job failed on `&& \` at the end of the line. Move the operator to the continued line so `shfmt -d` is clean. Signed-off-by: yuzhou <1991039819@qq.com>
zlareb1
left a comment
There was a problem hiding this comment.
The shell formatting fix leaves the generated-tsconfig ownership finding in place. A member indexed through a generated config still loses its documents when the merge compares the config path with the member directory.
Ownership compared the raw --project and --known-project strings, so a member named dir/tsconfig.scip.json dropped every document when the known project was dir. Compare project_scope instead. Signed-off-by: yuzhou <1991039819@qq.com>
zlareb1
left a comment
There was a problem hiding this comment.
The scope comparison keeps documents from a generated tsconfig. The merge still lets a broader project keep a referenced document when two narrower configs share its owning directory.
With a root tsconfig and two explicit configs under packages/app, _preferred_owner returned None on the tie, so a root index merged last could replace the app document. Return a longest-scope owner so sibling configs still keep their docs and the root is dropped. Signed-off-by: yuzhou <1991039819@qq.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit e8fbb33. Configure here.
A root scope '.' has string length 1, the same as a one-character member directory. Treating the root as specificity 0 keeps the member's documents even when the root is listed first. Signed-off-by: yuzhou <1991039819@qq.com>
zlareb1
left a comment
There was a problem hiding this comment.
The merge keeps the member document when two configs share its directory and when the owning directory has a one-character name. All 48 focused TypeScript project, harness, and SCIP merge tests pass.
zlareb1
left a comment
There was a problem hiding this comment.
The type gate rejects the streamed SCIP header adapter's dynamic annotation. The same error reproduces on clean main. Repair #1915 uses the model field annotation and keeps the header bounds.
|
Thanks for taking #1678 on. After the merge we ran the member split against six repositories: a small pnpm workspace, references-style and include-style monorepos, and trees with non-UTF-8 text and file names. The follow-ups are filed separately, so each can be discussed on its own:
Each issue has its reproduction and the measurements. |

Closes: #1678
Changelog category (leave one):
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):
The TypeScript tier expands an umbrella root tsconfig to its member projects, and a delta indexes only the projects that contain the changed files.
Why
Loading a solution-style root tsconfig (project references only) makes scip-typescript hold every member project in one V8 heap. On a large monorepo that OOMs, and even after listing
scip_ts_projectsby hand every delta re-indexes the full list because the changed-file list only bounds the converted output.Scope and risk
The change is in
run_typescript_delta.shand a new helper,scripts/scip_harness/scip_ts_projects.py. A root tsconfig is treated as an umbrella only when it hasreferencesand no files of its own (files: [], or an emptyinclude). Nested umbrellas are expanded. A regular root project is unchanged.On a delta, only members that own a changed or deleted path are indexed. A change to a root config (
package.json,tsconfig*.json, workspace manifests) or any lockfile falls back to the full member set. TypeScript changes that sit outside every named project also fall back, so the converter still sees them. The worker and watermark are unchanged; discovery happens from the checkout atgit_head.This was not measured against OpenClaw in this PR (that run needs the scip-typescript binary and the full tree). The tests use a stub indexer and check which project directories are passed to it.
Compatibility, rollout and rollback
scip_ts_projectslist still works and is also filtered on deltas. Repositories with an umbrella root and the setting unset start indexing member projects automatically.Tests
uv run --extra dev python -m pytest -q tests/unit/test_scip_ts_projects.py tests/unit/test_run_typescript_delta_umbrella.py tests/unit/test_run_typescript_delta_projects.py— 10 passed. ruff check and ruff format passed on the new files.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Grok Bot. I checked the umbrella detection against a solution-style
files: []root, the delta filter (including prefix isolation and lockfile fallback), the existing named-project harness test, and that a regular root tsconfig is not expanded.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
Medium Risk
Changes indexing scope and merge semantics for the TypeScript compiler tier; incorrect ownership could drop or duplicate symbols in monorepos, but regular single-project repos and watermarks are unchanged.
Overview
The TypeScript SCIP harness stops treating umbrella (solution-style) roots as one workspace. It discovers member projects from
tsconfigreferences viascip_ts_projects.py, runsscip-typescriptonce per member (isolating V8 heap), and merges partial indexes withscip_merge_indexes.pyusing directory ownership so project-reference spillover and subset rebuilds do not clobber other packages.On delta passes, only members that own changed TypeScript or member config are indexed; root lockfiles, shared configs, unowned
.tspaths, or config-only windows widen to all members and convert full member indexes (keeping deletions) instead of bounding with--changed-files.Architecture docs for
scip-typescriptare updated; unit tests cover discovery, merge ownership, and harness behavior including regular non-umbrella roots unchanged.Reviewed by Cursor Bugbot for commit d848bd1. Bugbot is set up for automated code reviews on this repo. Configure here.