Skip to content

perf(lint): bound the package fallback type graph - #160281

Merged
vincentkoc merged 2 commits into
mainfrom
perf/lint-core-graphs
Sep 28, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
perf/lint-core-graphs

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Type-aware lint of package TypeScript files without a matching leaf project falls back to the repository-wide graph. A real package inventory loaded 47,787 files before lint could start and exceeded a 7 GiB cap.

Related: #160010

Result

A discoverable package fallback inherits the shared source ambient contract. Existing package projects retain precedence. It preserves the old root's exclusion of JavaScript and the test-only session compatibility augmentation, while retaining all standard libraries, local declarations and required module augmentations.

Only two package commits are included. The plugin graph prerequisite #160327 and unrelated CI guard repair #160558 are merged into this base. No CI planner, compiler limit, runtime or public API change.

Validation

Head: 0e583a334350ced3f2c32c25a254c9eddf47d5a8; base: f010fc0b579071d151e8f4e4084a40ac0b219057. Both changed file blobs and stable patch ID cb7c9293e060fb6b3fa42c5493b2fceaa12feb8f match the prior head 4569f5a3804dbe878a5050f7ba37ff461ce6dd59. Fresh exact-head CI and ClawSweeper review are required before landing.

  • Native fixtures check existing leaf precedence, fallback tests, inferred JavaScript, module augmentations, asset declarations, session compatibility exclusion and complete typed-diagnostic parity.
  • A matched real package inventory fell from 47,787 to 15,002 files, preserving exactly 89 standard libraries and 31 local declarations. The old root's inventory-only probe required a separately admitted 10 GiB ceiling; candidate lint retained 7 GiB.
  • Package-containing core stripe 5 passed 4,428 files with zero diagnostics in 66.57 s / 5.49 GiB peak. A current-input repeat passed 4,429 files in 73.31 s / 5.93 GiB, under 7 GiB with zero diagnostics or OOM events.
  • Prior patch-identical remote proof passes all 19 configuration tests (4.36 s), the native declaration-boundary case (0.604 s), and tooling types. The complete command took 50.542 s with matching source fingerprints and no swap. Earlier measurement workflow provides the graph comparison.
  • Fresh independent P0–P2 review finds no actionable diff defect; its inherited-config context was unavailable. The primary directly inspected those owners and exercised the native configuration fixtures. Hosted exact-head review remains a separate gate.
  • Previous-head CI stopped only on the literal-import export-guard false positives; fix(tooling): stop reporting lazy imports as duplicate exports #160558 repairs that shared guard and is now included.

Config +13/-0 supplies the missing package graph owner; tests +192/-0. Runtime production +0.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling size: L labels Sep 28, 2026
@vincentkoc vincentkoc self-assigned this Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 1:11 PM ET / 17:11 UTC (Revision 6).

ClawSweeper review

What this changes

The branch adds a bounded TypeScript project for package files without a nearer project and a native lint test for project selection, ambient types, and diagnostic parity.

Merge readiness

✅ Ready for maintainer review

Keep this PR open. Current main does not contain the package fallback project, and the earlier export-guard failure was repaired by the merged #160558. The remaining change is useful and has no actionable introduced defect identified in this review.

Priority: P2
Reviewed head: 0e583a334350ced3f2c32c25a254c9eddf47d5a8

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The focused configuration change has native boundary coverage and detailed real-run measurements, with no identified correctness or security blocker.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The new package lint project is selected through native TypeScript project discovery. The captured PR body reports real package-containing lint runs under the 7 GiB limit with zero diagnostics and a smaller compiler inventory; the native before/after fixture checks selector and diagnostic parity. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The new package lint project is selected through native TypeScript project discovery. The captured PR body reports real package-containing lint runs under the 7 GiB limit with zero diagnostics and a smaller compiler inventory; the native before/after fixture checks selector and diagnostic parity. No stored-data contract changes.
Evidence reviewed 10 items Introduced package project: The pinned introduced diff adds a package-local fallback that inherits the shared source lint contract and excludes JavaScript roots and the test-only session augmentation.
Native boundary test: The test runs the installed type-aware linter before and after adding the package project, then checks selected-file counts, nearest-project selection, diagnostics, and expanded TypeScript roots.
Current-main lint boundary: The core lint project still includes packages; current main has no packages/tsconfig.json, so the branch's central package fallback is not implemented there.
Findings None None.
Security None None.

How this fits together

Developer and CI lint commands select package files for type-aware linting. The native linter finds a TypeScript project for each file and returns diagnostics; the size of that project also determines much of the lint memory use.

flowchart LR
A[Developer or CI lint] --> B[Selected package files]
B --> C{Nearest project}
C -->|Leaf project| D[Existing package project]
C -->|Fallback| E[Package fallback project]
D --> F[Type-aware lint]
E --> F
F --> G[Diagnostics and memory use]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +192, Config +13. Total +205 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 192 0 +192
Docs 0 0 0 0
Config 1 13 0 +13
Generated 0 0 0 0
Other 0 0 0 0
Total 2 205 0 +205

Review metrics

Metric Value Why it matters
Reported package graph 47,787 → 15,002 files (−68.6%) The matched native inventory reports a substantial reduction while the PR reports retained selected-file and diagnostic coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160010
Summary: This PR is a candidate fix for the package-graph portion of the broader type-aware lint memory issue; the issue records other remaining work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep package fallback lint bounded while preserving nearer package projects, selected files, and typed diagnostics.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main includes package files in the broad core lint project but lacks a package fallback, and the PR records a matched 47,787-file baseline. This read-only review did not rerun lint.

Is this the best way to solve the issue?

Yes. The native linter already discovers nearest TypeScript projects, so a package-local fallback uses the existing selection contract; the added native test checks that nearer projects and diagnostics remain intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 46a227c51867.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The new package lint project is selected through native TypeScript project discovery. The captured PR body reports real package-containing lint runs under the 7 GiB limit with zero diagnostics and a smaller compiler inventory; the native before/after fixture checks selector and diagnostic parity. No stored-data contract changes.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded developer and CI lint reliability improvement without a reported product-runtime regression.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The new package lint project is selected through native TypeScript project discovery. The captured PR body reports real package-containing lint runs under the 7 GiB limit with zero diagnostics and a smaller compiler inventory; the native before/after fixture checks selector and diagnostic parity. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The new package lint project is selected through native TypeScript project discovery. The captured PR body reports real package-containing lint runs under the 7 GiB limit with zero diagnostics and a smaller compiler inventory; the native before/after fixture checks selector and diagnostic parity. No stored-data contract changes.

Evidence

What I checked:

  • Introduced package project: The pinned introduced diff adds a package-local fallback that inherits the shared source lint contract and excludes JavaScript roots and the test-only session augmentation. (packages/tsconfig.json:2, 0e583a334350)
  • Native boundary test: The test runs the installed type-aware linter before and after adding the package project, then checks selected-file counts, nearest-project selection, diagnostics, and expanded TypeScript roots. (test/scripts/oxlint-config.test.ts:913, 0e583a334350)
  • Current-main lint boundary: The core lint project still includes packages; current main has no packages/tsconfig.json, so the branch's central package fallback is not implemented there. (config/tsconfig/oxlint.core.json:3, 46a227c51867)
  • Current-main absence check: Git reports that packages/tsconfig.json does not exist at the fetched current-main revision. (packages/tsconfig.json, 46a227c51867)
  • Shared source contract provenance: The shared ambient source project used by this PR was introduced by the earlier merged source-graph change; its raw recorded parent did not contain this file. (config/tsconfig/oxlint.source.json:21, 00b5cd4a8ba2)
  • Native project-selection contract: The pinned native linter resolves a matching tsconfig for each selected file, including ancestor search. This is an affirmative dependency signal because the added test executes tsgolint and asserts its project-selection output. (internal/utils/find_tsconfig.go:36, acd88e1b1ef8)

Likely related people:

  • Vincent Koc: Raw commit 00b5cd4 adds config/tsconfig/oxlint.source.json:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 00b5cd4a8ba2; files: config/tsconfig/oxlint.source.json)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-28T08:27:30.303Z sha ed359f57f80fd57ec89ca28824fb98bceda8f84c :: blocked before merge. :: none
  • reviewed 2026-09-28T08:43:01.848Z sha ba0f76def4ff8b7526d4e980f17e43c7e5cfc6b0 :: blocked before merge. :: none
  • reviewed 2026-09-28T09:15:42.483Z sha 80cf01ac3ea00d85e15fb75083a8406eba2c6371 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T09:29:37.161Z sha d81ecac :: needs changes before merge. :: none
  • reviewed 2026-09-28T16:38:39.325Z sha 4569f5a3804dbe878a5050f7ba37ff461ce6dd59 :: blocked before merge. :: none

@vincentkoc
vincentkoc force-pushed the perf/lint-core-graphs branch from ed359f5 to ba0f76d Compare September 28, 2026 08:33
@vincentkoc
vincentkoc marked this pull request as ready for review September 28, 2026 08:33
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head ba0f76def4ff8b7526d4e980f17e43c7e5cfc6b0. The PR body records native diagnostic and ambient parity, exact source inventories, capped memory proof and the remaining agents/UI selected-file work. Fresh 18 configuration tests, native declaration-boundary proof, tooling typecheck and independent P0–P2 review pass. No rule or selected-file reduction is intended.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc vincentkoc changed the title perf(lint): bound source and package type graphs perf(lint): bound the package fallback type graph Sep 28, 2026
@vincentkoc
vincentkoc changed the base branch from main to perf/lint-source-graphs September 28, 2026 08:58
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling size: L labels Sep 28, 2026
@vincentkoc
vincentkoc force-pushed the perf/lint-source-graphs branch from a01dab7 to 6c2e65f Compare September 28, 2026 09:03
@vincentkoc
vincentkoc force-pushed the perf/lint-core-graphs branch from ba0f76d to 80cf01a Compare September 28, 2026 09:03
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 28, 2026
@vincentkoc
vincentkoc changed the base branch from perf/lint-source-graphs to perf/lint-plugin-source-graph September 28, 2026 09:22
@vincentkoc
vincentkoc force-pushed the perf/lint-plugin-source-graph branch 2 times, most recently from 5523bf8 to c5a29b0 Compare September 28, 2026 16:08
Base automatically changed from perf/lint-plugin-source-graph to main September 28, 2026 16:21
@vincentkoc
vincentkoc force-pushed the perf/lint-core-graphs branch from d81ecac to 4569f5a Compare September 28, 2026 16:22
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head 4569f5a3804dbe878a5050f7ba37ff461ce6dd59 is now based on main after the plugin prerequisite landed as 2843ed7d7fd6c654dad9fc1747e982cec097782f. Only the two package commits remain; both changed file blobs and the complete patch are identical to the previously validated head. The PR body records retained native parity and bounded memory proof. Please review this exact head; fresh CI is running.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 28, 2026
@vincentkoc
vincentkoc force-pushed the perf/lint-core-graphs branch from 4569f5a to 0e583a3 Compare September 28, 2026 17:03
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 0e583a334350ced3f2c32c25a254c9eddf47d5a8, now based on actual main f010fc0b579071d151e8f4e4084a40ac0b219057. The plugin graph and literal-import guard prerequisites are merged. Only the two package commits remain; both changed file blobs and stable patch ID are unchanged from the previously validated package head. The body records native configuration/ambient/diagnostic parity, measured graph and memory reduction, the independent review limitation, and fresh exact-head CI. The old review reservation covers superseded head 4569f5a3804dbe878a5050f7ba37ff461ce6dd59.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@vincentkoc
vincentkoc merged commit fb1ca63 into main Sep 28, 2026
104 checks passed
@vincentkoc
vincentkoc deleted the perf/lint-core-graphs branch September 28, 2026 17:27
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
Use native nearest-project discovery to keep package fallback lint out of the repository-wide TypeScript graph while preserving package leaf precedence, ambient declarations and diagnostics.

Measured package inventory shrinks from 47,787 to 15,002 files. Native package-containing stripe passes 4,429 files in 73.31 seconds at 5.93 GiB peak under a 7 GiB/no-swap cap. Native selector, ambient and diagnostic fixtures pass; exact-head review has no findings or remaining moves.

Related: openclaw#160010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant