fix(mcp): range-check NDC arguments on the wire value before narrowing to f32
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- api, backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 4
- Fork
- 2
- Merge medio
- 1g 1h
- PR unite (30g)
- 225
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cristim/AztecCraft
-
fix(operations): the NoSelection message says 'before framing' for Delete and pivot resetForse già presa @calmasacow l’ha presa oggi. Apertaarea/ui-parity effort/xs impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cristim/AztecCraft#431 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area/ui-parity effort/s impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
cristim/AztecCraft#430 ·
I maintainer di solito rispondono entro 1 giorno
-
refactor(mcp): make the Keys error-code match exhaustive instead of a scene_error wildcardForse già presa @cristim l’ha presa 1 giorno fa. Apertaarea/mcp effort/xs impact/few priority/p3 severity/low triaged type/chore urgency/eventually
Difficoltà 3/5 Mezza giornata Idoneità per principianti 25/100
cristim/AztecCraft#420 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(viewport): use a vertex-relative signed area in polygon_overlaps_rectForse già presa @cristim l’ha presa 1 giorno fa. Apertaarea/selection effort/xs impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Difficoltà 3/5 Mezza giornata Idoneità per principianti 22/100
cristim/AztecCraft#418 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fix(viewport): report a native resource limit during view build as resource_limitForse già presa @cristim l’ha presa 1 giorno fa. Apertaarea/viewport effort/xs impact/few priority/p3 severity/low triaged type/bug urgency/eventually
Difficoltà 2/5 1-3 ore Idoneità per principianti 30/100
cristim/AztecCraft#415 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cristim/AztecCraft
Issue simili
-
ci javascript tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jonathanong/no-mistakes#3258 ·
I maintainer di solito rispondono entro 1 giorno
-
area: cpu-engines area: fuzzer good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 91/100
hffgzktbcc-blip/ounce-core#402 ·
I maintainer di solito rispondono entro 1 giorno
-
compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HerringtonDarkholme/hd-lang#1699 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
swc-project/swc-ai-issues#432 ·
-
SPLADE `/embed_sparse` output depends on the other inputs in the batch (candle BertModel / DistilBertModel)Forse già presa @0z5a l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
huggingface/text-embeddings-inference#979 ·
I maintainer di solito rispondono entro 1 giorno