{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://stayi.co/model-schema.json","title":"Stayi agent model submission","description":"Canonical home-building/1 geometry and reported dimension evidence. All lengths are feet; X/Z share an origin; Y is up. This is not architectural approval.","type":"object","properties":{"building":{"type":"object","properties":{"schemaVersion":{"enum":["home-building/1"]},"units":{"enum":["feet"]},"projectId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"revisionId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"address":{"type":"string","minLength":1,"maxLength":300},"source":{"type":"object","properties":{"kind":{"enum":["assistant-draft"]},"fileName":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","fileName"],"additionalProperties":false},"review":{"enum":["Unreviewed AI reconstruction; original source not verified by Home Preview."]},"scope":{"type":"string","minLength":1,"maxLength":300},"issues":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":40,"minItems":0},"levels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"name":{"type":"string","minLength":1,"maxLength":300},"elevationFeet":{"type":"number","minimum":-1000,"maximum":1000},"heightFeet":{"type":"number","minimum":0,"maximum":1000},"clearHeightFeet":{"type":"number","minimum":0,"maximum":1000},"slabThicknessFeet":{"type":"number","minimum":0,"maximum":1000},"footprint":{"type":"array","items":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"maxItems":100,"minItems":3},"holes":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"maxItems":100,"minItems":3},"maxItems":20,"minItems":0},"walls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"role":{"enum":["exterior","interior"]},"start":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"end":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"dimensions":{"type":"object","properties":{"lengthFeet":{"type":"number","minimum":0,"maximum":1000},"widthFeet":{"type":"number","minimum":0,"maximum":1000},"heightFeet":{"type":"number","minimum":0,"maximum":1000}},"required":["lengthFeet","widthFeet","heightFeet"],"additionalProperties":false},"openings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"hostWallId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"kind":{"enum":["door","window","passage","slider","garage"]},"offsetFeet":{"type":"number","minimum":0,"maximum":1000},"sillFeet":{"type":"number","minimum":0,"maximum":1000},"hinge":{"enum":["start","end"]},"swingSide":{"enum":[1,-1]},"dimensions":{"type":"object","properties":{"lengthFeet":{"type":"number","minimum":0,"maximum":1000},"heightFeet":{"type":"number","minimum":0,"maximum":1000}},"required":["lengthFeet","heightFeet"],"additionalProperties":false}},"required":["id","kind","offsetFeet","sillFeet","dimensions"],"additionalProperties":false},"maxItems":30,"minItems":0}},"required":["id","start","end","dimensions","openings"],"additionalProperties":false},"maxItems":80,"minItems":1},"rooms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"name":{"type":"string","minLength":1,"maxLength":300},"usage":{"type":"string","minLength":1,"maxLength":300},"polygon":{"type":"array","items":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"maxItems":100,"minItems":3},"holes":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"maxItems":100,"minItems":3},"maxItems":20,"minItems":0},"labelPosition":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2}},"required":["id","name","usage","polygon","labelPosition"],"additionalProperties":false},"maxItems":30,"minItems":1},"sourceSheet":{"type":"string","minLength":1,"maxLength":300},"sourcePage":{"type":"integer","minimum":1,"maximum":100}},"required":["id","name","elevationFeet","heightFeet","clearHeightFeet","slabThicknessFeet","footprint","holes","walls","rooms"],"additionalProperties":false},"maxItems":6,"minItems":1},"stairs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"name":{"type":"string","minLength":1,"maxLength":300},"fromLevel":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"toLevel":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"widthFeet":{"type":"number","minimum":0,"maximum":1000},"flights":{"type":"array","items":{"type":"object","properties":{"start":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"end":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"risers":{"type":"integer","minimum":1,"maximum":60},"bottomFeet":{"type":"number","minimum":0,"maximum":1000},"topFeet":{"type":"number","minimum":0,"maximum":1000}},"required":["start","end","risers","bottomFeet","topFeet"],"additionalProperties":false},"maxItems":20,"minItems":1},"landings":{"type":"array","items":{"type":"object","properties":{"polygon":{"type":"array","items":{"type":"array","items":{"type":"number","minimum":-1000,"maximum":1000},"maxItems":2,"minItems":2},"maxItems":100,"minItems":3},"elevationFeet":{"type":"number","minimum":0,"maximum":1000}},"required":["polygon","elevationFeet"],"additionalProperties":false},"maxItems":20,"minItems":0}},"required":["id","name","fromLevel","toLevel","widthFeet","flights","landings"],"additionalProperties":false},"maxItems":10,"minItems":0}},"required":["schemaVersion","units","projectId","revisionId","source","review","scope","issues","levels"],"additionalProperties":false},"evidence":{"type":"object","maxProperties":6,"additionalProperties":{"type":"object","properties":{"sheet":{"type":"string","minLength":1,"maxLength":300},"dimensions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":300},"feet":{"type":"number","minimum":0.1,"maximum":1000},"axis":{"enum":["x","z"]},"basis":{"enum":["printed","user-provided"]},"modelSpan":{"type":"object","properties":{"from":{"type":"object","properties":{"kind":{"enum":["footprint","room","wall"]},"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"index":{"type":"integer","minimum":0,"maximum":99}},"required":["kind","id","index"],"additionalProperties":false},"to":{"type":"object","properties":{"kind":{"enum":["footprint","room","wall"]},"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$"},"index":{"type":"integer","minimum":0,"maximum":99}},"required":["kind","id","index"],"additionalProperties":false}},"required":["from","to"],"additionalProperties":false}},"required":["label","feet","axis","basis","modelSpan"],"additionalProperties":false},"maxItems":10,"minItems":2},"assumptions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":12,"minItems":0}},"required":["sheet","dimensions","assumptions"],"additionalProperties":false}}},"required":["building","evidence"],"additionalProperties":false}