fix(mcp): range-check NDC arguments on the wire value before narrowing to f32
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Read src/mcp/features/selection.rs, src/viewport/rect_pick.rs, and .project-docs/mcp.md, then check the linked pull request #427 for work already underway. First settle whether the range contract applies to the f64 wire value or the f32 value; done means documenting that decision and adding consistent tool descriptions and tests for every affected argument.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Raised by a CodeRabbit review of #404 and checked against the code. MCP tools that take normalised screen coordinates deserialise them as [f32; 2] (for example select_in_rect, src/mcp/features/selection.rs). serde rounds a value such as 1.00000001 to 1.0 before the range check (NdcRect::new in src/viewport/rect_pick.rs), so a value that is 1e-8 out of range is accepted as the boundary instead of returning invalid_params. The accepted rectangle is the same as the boundary, so the effect is negligible, but the contract says out-of-range values are refused.
This is the f32 convention across the MCP surface, so fixing it for one tool alone would be inconsistent.
Change
- Decide whether the range contract is on the f64 wire value or the f32 value, and document it in
.project-docs/mcp.md. - If the wire value: parse these fields as f64, check the range, then narrow, in one shared helper used by every tool with NDC or screen-fraction arguments; add a test with 1.00000001 for each.
- If the f32 value: state that in the tool descriptions and the docs, and pin it with a test so it is a decision and not an accident.
Related: #404, #390.
- Ngôn ngữ chính
- Rust
- Star
- 4
- Fork
- 2
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 225
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cristim/AztecCraft
-
fix(operations): the NoSelection message says 'before framing' for Delete and pivot resetCó thể đã có người làm @calmasacow đã nhận hôm nay. Đang mởarea/ui-parity effort/xs impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cristim/AztecCraft#431 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/ui-parity effort/s impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
cristim/AztecCraft#430 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor(mcp): make the Keys error-code match exhaustive instead of a scene_error wildcardCó thể đã có người làm @cristim đã nhận 1 ngày trước. Đang mởarea/mcp effort/xs impact/few priority/p3 severity/low triaged type/chore urgency/eventually
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 25/100
cristim/AztecCraft#420 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(viewport): use a vertex-relative signed area in polygon_overlaps_rectCó thể đã có người làm @cristim đã nhận 1 ngày trước. Đang mởarea/selection effort/xs impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 22/100
cristim/AztecCraft#418 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(viewport): report a native resource limit during view build as resource_limitCó thể đã có người làm @cristim đã nhận 1 ngày trước. Đang mởarea/viewport effort/xs impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
cristim/AztecCraft#415 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cristim/AztecCraft
Issue tương tự
-
ci javascript tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jonathanong/no-mistakes#3258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: cpu-engines area: fuzzer good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
hffgzktbcc-blip/ounce-core#402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compiler
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
HerringtonDarkholme/hd-lang#1699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
swc-project/swc-ai-issues#432 ·
-
SPLADE `/embed_sparse` output depends on the other inputs in the batch (candle BertModel / DistilBertModel)Có thể đã có người làm @0z5a đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
huggingface/text-embeddings-inference#979 ·
Maintainer thường phản hồi trong vòng 1 ngày