mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-03 13:18:58 +00:00
fix: the model-invariants CLI accepts the unhosted degraded opening of model v9 (#316, review r3 M1)
Since #316 §3.3 an unhosted contour opening is a valid v9 state — the migration keeps an opening with no in-place carrier as data. The CLI still reported it as an opening_host violation for every model_version >= 8; the requirement now applies to model v8 documents only. The regression test is proven able to fail on the old comparison (executed red), and the reviewer's CLI reproduction now finishes clean. Issue: #316 User-Visible: no
This commit is contained in:
@@ -225,7 +225,7 @@ export function checkReferences({ config, layout = {} } = {}, { notes = [] } = {
|
||||
'комнаты назначения не существует в том же пространстве');
|
||||
}
|
||||
}
|
||||
if (Number(config?.model_version || 0) >= 8) {
|
||||
if (Number(config?.model_version || 0) === 8) {
|
||||
const wallIds = Array.isArray(room?.wall_ids) ? room.wall_ids : [];
|
||||
const poly = roomPolygon(room) || [];
|
||||
if (wallIds.length !== poly.length) {
|
||||
@@ -246,7 +246,11 @@ export function checkReferences({ config, layout = {} } = {}, { notes = [] } = {
|
||||
for (const opening of space?.openings || []) {
|
||||
const host = opening?.host;
|
||||
if (!host) {
|
||||
if (Number(config?.model_version || 0) >= 8) {
|
||||
// #316 §3.3: since model v9 an unhosted contour opening is a valid
|
||||
// degraded state (the migration keeps an opening with no in-place
|
||||
// carrier as data, inert until re-placed). Only model v8 documents
|
||||
// still require an explicit host on every opening.
|
||||
if (Number(config?.model_version || 0) === 8) {
|
||||
add('opening_host', `${spaceId}:${opening?.id ?? '?'}`, '?',
|
||||
'в model v8 у проёма нет явной стены-хоста');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user