lint_project and project_report return unbounded, pretty-printed findings

Đang mở
#129 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api, performance

Hướng nghiên cứu

Start by reading src/tools/lint.ts and src/tools/scenes.ts at the cited locations, then inspect src/tools/result.ts and the generated tool definitions. Compare the response shape with the acceptance criteria: lint_project should cap findings by default and include the total and truncation flag, while summary mode should return counts only. Run npm run generate:tools after changes.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

help wanted performance severity: medium

Summary

lint_project and project_report return every finding in one pretty-printed text block, with no limit, paging or summary mode. On a realistic untyped project this is tens of megabytes, far beyond what an MCP client or LLM context can take.

Where

  • src/tools/lint.ts:65, src/tools/scenes.ts:100
  • src/tools/result.ts:9 (JSON.stringify(data, null, 2))

Details

A synthetic project with 3000 scripts produced 108k lint findings: 90k untyped-declaration, which is on by default, plus 6k stringly-nodepath. JSON output was 37.3 MB for lint and 39.5 MB for report. Even 10k findings is about 3.5 MB. The server-side cost (sort 264 ms, stringify 154 ms) is small; the problem is the size of the response.

Impact

On real projects that do not use static typing, the main MCP tools return responses that clients truncate or reject, so agents cannot use them.

Suggested fix

  • Add maxFindings (default for example 500, with truncated: true and the total count in the payload) and offset.
  • Add a summary mode that returns counts per rule and per file.
  • Drop the indentation in ok().
  • Run npm run generate:tools afterwards.

Acceptance criteria

  • By default, lint_project on a project with more findings than the limit returns at most the limit, plus totalFindings and a truncation flag.
  • Summary mode returns counts only.

Filed by repo-audit/full-audit at e836036. Severity: medium. Effort: M. audit-key: performance|src/tools/result.ts|ok

Ngôn ngữ chính
TypeScript
Star
0
Fork
6
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/godot-correctness-mcp

Tất cả issue của TMHSDigital/godot-correctness-mcp

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.