fix(mcp): restore >0 validation and reject ambiguous numbers in measurement()
Adversarial-review follow-ups to the lingo measurement() field:
- Add a `positive` option (strict > 0) and use it for the non-zero dimension
params. Swapping z.number().positive() → measurement(..,{min:0}) had started
admitting 0 (the core node schemas have no positivity backstop), so a zero-size
wall/opening/roof could be created. Inclusive-0 fields (overhang, sill height,
knee-wall height, opening offset, roof pitch) keep min:0.
- Escalate AMBIGUOUS_NUMBER to error so "1,234" fails instead of silently reading
as 1234 — a 1000x hazard for European decimals. Matches lingo's own /ai fields.
- roofLevelElevation reverted to z.number() (it's a level ordinal, not meters);
radians fields now advertise radian-appropriate examples.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f66dcd438b
commit
3273aac551
@@ -12,8 +12,11 @@ export const createWallInput = {
|
||||
levelId: NodeIdSchema,
|
||||
start: Vec2Schema,
|
||||
end: Vec2Schema,
|
||||
thickness: measurement('length', 'm', { min: 0, description: 'Wall thickness.' }).optional(),
|
||||
height: measurement('length', 'm', { min: 0, description: 'Wall height.' }).optional(),
|
||||
thickness: measurement('length', 'm', {
|
||||
positive: true,
|
||||
description: 'Wall thickness.',
|
||||
}).optional(),
|
||||
height: measurement('length', 'm', { positive: true, description: 'Wall height.' }).optional(),
|
||||
}
|
||||
|
||||
export const createWallOutput = {
|
||||
|
||||
Reference in New Issue
Block a user