@floless/app 0.124.1 → 0.125.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24940,11 +24940,11 @@ var require_clean = __commonJS({
24940
24940
  "node_modules/semver/functions/clean.js"(exports2, module2) {
24941
24941
  "use strict";
24942
24942
  var parse = require_parse2();
24943
- var clean = (version, options) => {
24943
+ var clean2 = (version, options) => {
24944
24944
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
24945
24945
  return s ? s.version : null;
24946
24946
  };
24947
- module2.exports = clean;
24947
+ module2.exports = clean2;
24948
24948
  }
24949
24949
  });
24950
24950
 
@@ -26333,7 +26333,7 @@ var require_semver2 = __commonJS({
26333
26333
  var identifiers = require_identifiers();
26334
26334
  var parse = require_parse2();
26335
26335
  var valid = require_valid();
26336
- var clean = require_clean();
26336
+ var clean2 = require_clean();
26337
26337
  var inc = require_inc();
26338
26338
  var diff = require_diff();
26339
26339
  var major = require_major();
@@ -26372,7 +26372,7 @@ var require_semver2 = __commonJS({
26372
26372
  module2.exports = {
26373
26373
  parse,
26374
26374
  valid,
26375
- clean,
26375
+ clean: clean2,
26376
26376
  inc,
26377
26377
  diff,
26378
26378
  major,
@@ -54611,7 +54611,7 @@ function appVersion() {
54611
54611
  return resolveVersion({
54612
54612
  isSea: isSea2(),
54613
54613
  sqVersionXml: readSqVersionXml(),
54614
- define: true ? "0.124.1" : void 0,
54614
+ define: true ? "0.125.1" : void 0,
54615
54615
  pkgVersion: readPkgVersion()
54616
54616
  });
54617
54617
  }
@@ -54627,7 +54627,7 @@ function resolveChannel(s) {
54627
54627
  function appChannel() {
54628
54628
  return resolveChannel({
54629
54629
  isSea: isSea2(),
54630
- define: true ? "0.124.1" : void 0,
54630
+ define: true ? "0.125.1" : void 0,
54631
54631
  // argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
54632
54632
  // carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
54633
54633
  modulePath: process.argv[1]
@@ -57734,8 +57734,8 @@ function clearProjectThumbnail(id) {
57734
57734
  return removed;
57735
57735
  }
57736
57736
  function exportFilename(name) {
57737
- const clean = name.replace(/[^a-z0-9\-_. ]+/gi, " ").replace(/\s+/g, " ").trim().slice(0, 60);
57738
- return clean || "project";
57737
+ const clean2 = name.replace(/[^a-z0-9\-_. ]+/gi, " ").replace(/\s+/g, " ").trim().slice(0, 60);
57738
+ return clean2 || "project";
57739
57739
  }
57740
57740
  function suggestedProjectArchiveFilename(name) {
57741
57741
  return `${exportFilename(name)}.floless.zip`;
@@ -60178,8 +60178,8 @@ function sanitizeRecipe(raw) {
60178
60178
  }
60179
60179
  }
60180
60180
  if (!gridCountsInteger(params)) return void 0;
60181
- const clean = { ...params, ...neutral };
60182
- return Object.keys(clean).length ? { kind: r.kind, params: clean } : void 0;
60181
+ const clean2 = { ...params, ...neutral };
60182
+ return Object.keys(clean2).length ? { kind: r.kind, params: clean2 } : void 0;
60183
60183
  }
60184
60184
  if (r.kind === "shear-plate") {
60185
60185
  const params = {};
@@ -60199,8 +60199,8 @@ function sanitizeRecipe(raw) {
60199
60199
  const regHi = Math.max(edgeU, w - edgeU), regLo = Math.min(12.7 + edgeU, regHi);
60200
60200
  if (Math.min(params.boltColPitch, (regHi - regLo) / (cols - 1)) < 2 * params.boltDia) return void 0;
60201
60201
  }
60202
- const clean = { ...params, ...neutral };
60203
- return Object.keys(clean).length ? { kind: r.kind, params: clean } : void 0;
60202
+ const clean2 = { ...params, ...neutral };
60203
+ return Object.keys(clean2).length ? { kind: r.kind, params: clean2 } : void 0;
60204
60204
  }
60205
60205
  return Object.keys(num6).length ? { kind: r.kind, params: num6 } : void 0;
60206
60206
  }
@@ -60710,8 +60710,24 @@ var MODEL_V2_TOL = Object.freeze({
60710
60710
  // ...and above this is refused: beyond drafting drift = a different grid
60711
60711
  ROTATION_REFUSE_DEG: 0.05,
60712
60712
  // secondary ceiling (the binding gate is induced displacement)
60713
- SCALE_REFUSE_FRAC: 2e-3
60713
+ SCALE_REFUSE_FRAC: 2e-3,
60714
60714
  // secondary ceiling, 0.2%
60715
+ // How far a HAND-READ registration control may land from the grid intersection it names. These two are
60716
+ // in DISPLAY POINTS, and that unit is the whole point (#590): a sheet's display px are PDF points —
60717
+ // 1/72" of the PRINTED drawing — so a tolerance stated in them means the same thing at every drawing
60718
+ // scale and on every size of building, which a tolerance in mm does not. At 1/4"=1'-0" one point is
60719
+ // 33.87 mm on the ground, so judging a pixel pick by the 6.35 mm de-dup distance demanded 0.19 pt of
60720
+ // reading accuracy and refused every photographed drawing ever read.
60721
+ //
60722
+ // They bound the pick, NOT the registration: the transform is fitted from the grid, so a pick within
60723
+ // tolerance moves nothing. What they bound is the evidence — the picks are the only measurement that
60724
+ // sees the drawing at all, and so the only check on `grid.origin` and `pt_per_ft`. Two picks a
60725
+ // baseline apart therefore bound a scale error to ±(REFUSE_PT / baselinePt), which is why the reader
60726
+ // skill tells the AI to choose the FURTHEST intersection: a longer baseline is a better measurement.
60727
+ CONTROL_CHECK_REPORT_PT: 2,
60728
+ // 1/36" on the printed sheet — past ordinary reading error, worth saying
60729
+ CONTROL_CHECK_REFUSE_PT: 9
60730
+ // 1/8" on the printed sheet — nobody misses a grid bubble by this much
60715
60731
  });
60716
60732
  function isUnknownElev(e) {
60717
60733
  return !!e && e.unknown === true;
@@ -60913,6 +60929,8 @@ function remapPropLabels(v1, ctx) {
60913
60929
  const placement = enumOr(p.placement, ["start", "mid", "end"], "$.prop_labels.placement", issues);
60914
60930
  if (placement) out.placement = placement;
60915
60931
  if (typeof p.selected_only === "boolean") out.selected_only = p.selected_only;
60932
+ if (typeof p.vis2d === "boolean") out.vis2d = p.vis2d;
60933
+ if (typeof p.vis3d === "boolean") out.vis3d = p.vis3d;
60916
60934
  const ids = [];
60917
60935
  for (const raw of arr2(p.ids)) {
60918
60936
  const id = str2(raw);
@@ -61405,6 +61423,18 @@ function sheetPointsLocalMm(plan, f) {
61405
61423
  function rootDatumAuthored(v1) {
61406
61424
  return isObj2(v1) && v1.datum !== void 0 && v1.datum !== null;
61407
61425
  }
61426
+ function toSheetPx(f, p) {
61427
+ return [clean(f.originPx[0] + p[0] / f.k), clean(f.originPx[1] - p[1] / f.k)];
61428
+ }
61429
+ function clean(n) {
61430
+ const q = Math.round(n * 1e9) / 1e9;
61431
+ return Object.is(q, -0) ? 0 : q;
61432
+ }
61433
+ function inverseSimilarity(t, w) {
61434
+ const c = Math.cos(t.rotationRad) / t.scale, s = Math.sin(t.rotationRad) / t.scale;
61435
+ const dx = w[0] - t.translation[0], dy = w[1] - t.translation[1];
61436
+ return [dx * c + dy * s, -dx * s + dy * c];
61437
+ }
61408
61438
  function registerSheets(v1, boot) {
61409
61439
  const issues = [];
61410
61440
  const registrations = [];
@@ -61416,15 +61446,13 @@ function registerSheets(v1, boot) {
61416
61446
  const xs = samples.filter((s) => s.dir === "x").sort((a, b) => a.modelMm - b.modelMm);
61417
61447
  const ys = samples.filter((s) => s.dir === "y").sort((a, b) => a.modelMm - b.modelMm);
61418
61448
  if (!f || xs.length < 2 || ys.length < 2) {
61419
- registrations.push({ sheet, verdict: "refuse", reasons: ["insufficient-axis-labels"], source: "grid-bootstrap", transform: null });
61449
+ registrations.push({ sheet, verdict: "refuse", reasons: ["insufficient-axis-labels"], controlCheck: null, derivedControls: null, transform: null });
61420
61450
  continue;
61421
61451
  }
61422
61452
  const nodes = xs.flatMap((x) => ys.map((y) => ({ local: [x.localMm, y.localMm], world: [x.modelMm, y.modelMm] })));
61423
61453
  const d1 = toLocalMm(f, p.datum_at), d2 = toLocalMm(f, p.control2_at);
61424
61454
  const r1 = intersectionRef(p.datum_ref), r2 = intersectionRef(p.control2_ref);
61425
- let controls = [];
61426
- let extra = [];
61427
- let source = "grid-bootstrap";
61455
+ let authored = [];
61428
61456
  const worldOf = (ref) => {
61429
61457
  const x = xs.find((s) => s.label === ref.x), y = ys.find((s) => s.label === ref.y);
61430
61458
  return x && y ? [x.modelMm, y.modelMm] : null;
@@ -61445,11 +61473,8 @@ function registerSheets(v1, boot) {
61445
61473
  }
61446
61474
  const w1 = r1.state === "valid" ? worldOf(r1) : datumFailed ? null : [0, 0];
61447
61475
  const w2 = worldOf(r2);
61448
- if (w1 && w2) {
61449
- controls = [{ local: d1, world: w1 }, { local: d2, world: w2 }];
61450
- extra = nodes;
61451
- source = "authored";
61452
- } else if (!(r1.state === "absent" && datumFailed)) {
61476
+ if (w1 && w2) authored = [{ local: d1, world: w1, key: "datum_at" }, { local: d2, world: w2, key: "control2_at" }];
61477
+ else if (!(r1.state === "absent" && datumFailed)) {
61453
61478
  const failing = [!w1 ? `datum_ref (${spell(r1, "datum_ref")})` : null, !w2 ? `control2_ref (${spell(r2, "control2_ref")})` : null].filter(Boolean).join(" and ");
61454
61479
  issues.push({ code: "control-ref-unresolved", severity: "decision", sheet, message: `sheet "${sheet}" names a control that does not resolve to model grid axes \u2014 ${failing}; the label bootstrap is proposed instead and must be confirmed` });
61455
61480
  }
@@ -61458,18 +61483,16 @@ function registerSheets(v1, boot) {
61458
61483
  } else if (d1 || d2 || r1.state === "valid" || r2.state === "valid") {
61459
61484
  issues.push({ code: "control-incomplete", severity: "decision", sheet, message: `sheet "${sheet}" carries only part of an authored control pair; the label bootstrap is proposed instead and must be confirmed` });
61460
61485
  }
61461
- if (source === "grid-bootstrap") {
61462
- let fit = [0, 1], span = -1;
61463
- for (let i = 0; i < nodes.length; i++) for (let j = i + 1; j < nodes.length; j++) {
61464
- const d = Math.hypot(nodes[j].world[0] - nodes[i].world[0], nodes[j].world[1] - nodes[i].world[1]);
61465
- if (d > span) {
61466
- span = d;
61467
- fit = [i, j];
61468
- }
61486
+ let fit = [0, 1], span = -1;
61487
+ for (let i = 0; i < nodes.length; i++) for (let j = i + 1; j < nodes.length; j++) {
61488
+ const d = Math.hypot(nodes[j].world[0] - nodes[i].world[0], nodes[j].world[1] - nodes[i].world[1]);
61489
+ if (d > span) {
61490
+ span = d;
61491
+ fit = [i, j];
61469
61492
  }
61470
- controls = [nodes[fit[0]], nodes[fit[1]]];
61471
- extra = nodes.filter((_, i) => i !== fit[0] && i !== fit[1]);
61472
61493
  }
61494
+ const controls = [nodes[fit[0]], nodes[fit[1]]];
61495
+ const extra = nodes.filter((_, i) => i !== fit[0] && i !== fit[1]);
61473
61496
  const xLo = xs[0], xHi = xs[xs.length - 1], yLo = ys[0], yHi = ys[ys.length - 1];
61474
61497
  const axesVec = {
61475
61498
  localX: [xHi.localMm - xLo.localMm, 0],
@@ -61491,9 +61514,40 @@ function registerSheets(v1, boot) {
61491
61514
  max: [Math.max(...allPts.map((q) => q[0])), Math.max(...allPts.map((q) => q[1]))]
61492
61515
  };
61493
61516
  const res = registerSheet({ controls, axes: axesVec, samples: extra, bounds });
61494
- registrations.push({ sheet, verdict: res.verdict, reasons: res.reasons, source, transform: res.transform });
61495
- if (res.verdict === "refuse") issues.push({ code: "sheet-registration-refused", severity: "block", sheet, message: `sheet "${sheet}" cannot be registered onto the model frame: ${res.reasons.join(", ")}` });
61496
- else if (res.verdict === "report") issues.push({ code: "sheet-registration-report", severity: "report", sheet, message: `sheet "${sheet}" registers with reservations: ${res.reasons.join(", ")}` });
61517
+ let verdict = res.verdict, reasons = res.reasons, transform4 = res.transform;
61518
+ let controlCheck = null;
61519
+ let derivedControls = null;
61520
+ if (authored.length === 2 && transform4) {
61521
+ let worstPt = 0;
61522
+ const derived = {};
61523
+ for (const a of authored) {
61524
+ const q = applySimilarity(transform4, a.local);
61525
+ worstPt = Math.max(worstPt, Math.hypot(q[0] - a.world[0], q[1] - a.world[1]) / f.k);
61526
+ derived[a.key] = toSheetPx(f, inverseSimilarity(transform4, a.world));
61527
+ }
61528
+ controlCheck = { offsetPt: worstPt, offsetMm: worstPt * f.k };
61529
+ const say = `${worstPt.toFixed(2)} display pt (${(worstPt * f.k).toFixed(1)} mm on the ground)`;
61530
+ if (worstPt > MODEL_V2_TOL.CONTROL_CHECK_REFUSE_PT) {
61531
+ verdict = "refuse";
61532
+ reasons = [...reasons, "control-pick-off-grid"];
61533
+ transform4 = null;
61534
+ } else if (worstPt > MODEL_V2_TOL.CONTROL_CHECK_REPORT_PT) {
61535
+ issues.push({
61536
+ code: "control-off-grid",
61537
+ severity: "report",
61538
+ sheet,
61539
+ message: `sheet "${sheet}" registers, but its hand-read control points sit ${say} from the grid intersections they name. The sheet is positioned by its grid, so nothing has moved \u2014 this is how far the reading was out`
61540
+ });
61541
+ }
61542
+ if (verdict !== "refuse") derivedControls = derived;
61543
+ }
61544
+ registrations.push({ sheet, verdict, reasons, controlCheck, derivedControls, transform: transform4 });
61545
+ if (verdict === "refuse") {
61546
+ const why = reasons.includes("control-pick-off-grid") && controlCheck ? `cannot be registered onto the model frame: its hand-read control points sit ${controlCheck.offsetPt.toFixed(2)} display pt (${controlCheck.offsetMm.toFixed(1)} mm on the ground) from the grid intersections they name, past the ${MODEL_V2_TOL.CONTROL_CHECK_REFUSE_PT} pt (1/8" on the printed sheet) ceiling. Re-read datum_at/control2_at, or check this sheet's pt_per_ft and grid.origin \u2014 a wrong drawing scale looks exactly like this` : `cannot be registered onto the model frame: ${reasons.join(", ")}`;
61547
+ issues.push({ code: "sheet-registration-refused", severity: "block", sheet, message: `sheet "${sheet}" ${why}` });
61548
+ } else if (verdict === "report") {
61549
+ issues.push({ code: "sheet-registration-report", severity: "report", sheet, message: `sheet "${sheet}" registers with reservations: ${reasons.join(", ")}` });
61550
+ }
61497
61551
  }
61498
61552
  return { registrations, issues };
61499
61553
  }
@@ -61568,15 +61622,26 @@ function materializeMembers(v1, boot, regs) {
61568
61622
  const coincidentXY = Math.hypot(from.x - to.x, from.y - to.y) <= MODEL_V2_TOL.DEDUP_MM;
61569
61623
  const zeroHeight = za !== null && zb !== null && Math.abs(zb - za) <= MODEL_V2_TOL.CUT_PLANE_MM;
61570
61624
  const marker = role === "column" && zeroHeight && coincidentXY;
61571
- if (role === "column" && zeroHeight && !coincidentXY) {
61625
+ if (role === "column" && !coincidentXY) {
61572
61626
  const spanMm = Math.hypot(from.x - to.x, from.y - to.y);
61573
- issues.push({
61574
- code: "column-zero-height",
61575
- severity: "decision",
61576
- sheet,
61577
- path,
61578
- message: `column "${v1Id}" reads with its base and its top at the same elevation, so it has no height \u2014 but it spans ${spanMm.toFixed(0)} mm in plan, so it is not a foundation footprint and is kept as a member rather than turned into evidence. A column of zero height cannot be built: confirm the reading, or give it a real top elevation, before commit`
61579
- });
61627
+ const spanTxt = spanMm.toFixed(spanMm < 10 ? 1 : 0);
61628
+ if (zeroHeight) {
61629
+ issues.push({
61630
+ code: "column-zero-height",
61631
+ severity: "decision",
61632
+ sheet,
61633
+ path,
61634
+ message: `column "${v1Id}" reads with its base and its top at the same elevation, so it has no height \u2014 but it spans ${spanTxt} mm in plan, so it is not a foundation footprint and is kept as a member rather than turned into evidence. A column of zero height cannot be built: confirm the reading, or give it a real top elevation, before commit`
61635
+ });
61636
+ } else {
61637
+ issues.push({
61638
+ code: "column-plan-offset",
61639
+ severity: "decision",
61640
+ sheet,
61641
+ path,
61642
+ message: `column "${v1Id}" has its two ends ${spanTxt} mm apart in plan, so it does not stand over a single point the way a column must. Usually that means a beam or brace was read as a column; less often it is a genuine raking column. Confirm which this is, or correct the member, before commit`
61643
+ });
61644
+ }
61580
61645
  }
61581
61646
  members.push({ sheet, v1Id, v1Index: mi, role, from, to, kind: marker ? "footprint-marker" : "physical", fromKind, toKind, ends, raw: m });
61582
61647
  });
@@ -61586,7 +61651,7 @@ function materializeMembers(v1, boot, regs) {
61586
61651
  var memberKey = (m) => JSON.stringify([m.sheet, m.v1Id]);
61587
61652
  var zOf = (e) => "known" in e ? e.known : null;
61588
61653
  var same = (a, b) => JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
61589
- var MEMBER_FIELDS = ["material", "rot", "position", "section", "bf", "mf", "rfi", "verified"];
61654
+ var MEMBER_FIELDS = ["material", "rot", "position", "positionH", "section", "bf", "mf", "rfi", "verified"];
61590
61655
  var END_FIELDS = ["conn", "connVerified", "note", "detail"];
61591
61656
  function crossingDistance(marker, span) {
61592
61657
  const mz = zOf(marker.from.z), lo = zOf(span.from.z), hi = zOf(span.to.z);
@@ -61805,6 +61870,7 @@ var DISPOSITIONS = {
61805
61870
  material: "copied",
61806
61871
  memberType: "copied",
61807
61872
  position: "copied",
61873
+ positionH: "copied",
61808
61874
  rot: "copied",
61809
61875
  section: "copied",
61810
61876
  bf: "copied",
@@ -61857,9 +61923,11 @@ var DISPOSITIONS = {
61857
61923
  placement: "copied",
61858
61924
  selected_only: "copied",
61859
61925
  ids: "transformed",
61860
- vis2d: "unmapped",
61861
- vis3d: "unmapped"
61862
- // real, and NOT in v2's closed prop_labels
61926
+ // Were `unmapped` while v2's closed prop_labels had no home for them, which meant migrating a
61927
+ // project silently turned its label chips off and reported the loss as a decision. v2 carries both
61928
+ // flags now (#614), so they cross like every other display key.
61929
+ vis2d: "copied",
61930
+ vis3d: "copied"
61863
61931
  },
61864
61932
  // Every one of these is blocked with the placement that carries it — see dims3d/detail_placements above.
61865
61933
  "$.detail_placements[]": { id: "blocked", sheet: "blocked", detailName: "blocked", anchorId: "blocked", pos: "blocked", u: "blocked", n: "blocked", rotZ: "blocked", size: "blocked", opacity: "blocked" }
@@ -61971,6 +62039,8 @@ function previewMigration(v1, ctx) {
61971
62039
  if (isObj2(r.brace)) out.brace = clone(r.brace);
61972
62040
  const position = enumOr(r.position, ["top", "middle", "bottom"], `$.members[${m.sheet}/${m.v1Id}].position`, issues, m.sheet);
61973
62041
  if (position) out.position = position;
62042
+ const positionH = enumOr(r.positionH, ["left", "middle", "right"], `$.members[${m.sheet}/${m.v1Id}].positionH`, issues, m.sheet);
62043
+ if (positionH) out.positionH = positionH;
61974
62044
  const ends = m.ends.map((e) => {
61975
62045
  const o = {};
61976
62046
  for (const k of ["note", "detail"]) if (str2(e[k])) o[k] = str2(e[k]);
@@ -62052,6 +62122,7 @@ function previewMigration(v1, ctx) {
62052
62122
  if (legacyProvenance) {
62053
62123
  issues.push({ code: "legacy-provenance-assumed", severity: "decision", message: `${legacyProvenance} record(s) carry no recognised source.kind; their observations are recorded as 'auto-read' because a steel.takeoff/v1 document is by definition reader output, but that assumption must be confirmed before commit` });
62054
62124
  }
62125
+ const derivedFor = (sheet, key) => reg2.registrations.find((r) => r.sheet === sheet)?.derivedControls?.[key];
62055
62126
  const plans = arr2(doc.plans).filter(isObj2).map((p) => {
62056
62127
  const sheet = str2(p.sheet) ?? "";
62057
62128
  const out = { sheet, viewKind: "plan", memberObservations: obsBySheet.get(sheet) ?? [] };
@@ -62087,7 +62158,7 @@ function previewMigration(v1, ctx) {
62087
62158
  }
62088
62159
  return;
62089
62160
  }
62090
- out[atKey] = at;
62161
+ out[atKey] = derivedFor(sheet, atKey) ?? at;
62091
62162
  if (parsed.state === "valid") out[refKey] = canonicalRef(parsed);
62092
62163
  };
62093
62164
  refPair(["datum_at", "datum_ref"]);
@@ -62441,11 +62512,11 @@ function planBlockerSummary(candidate, cap = 8) {
62441
62512
  return `plan-uneditable:${code} on ${sheets.length === 1 ? "sheet" : "sheets"} ${shown}${more}`;
62442
62513
  });
62443
62514
  }
62444
- function blockingIssueDetails(report, cap = 8) {
62515
+ function blockingIssueDetails(report, cap = 8, severity = "block", noun = "blocking issue(s)") {
62445
62516
  const byLine = /* @__PURE__ */ new Map();
62446
62517
  const order = [];
62447
62518
  for (const issue of report.issues) {
62448
- if (issue.severity !== "block") continue;
62519
+ if (issue.severity !== severity) continue;
62449
62520
  const sheet = typeof issue.sheet === "string" && issue.sheet.trim() ? issue.sheet.trim() : null;
62450
62521
  const path = typeof issue.path === "string" && issue.path.trim() ? issue.path.trim() : null;
62451
62522
  const parts = [sheet ? `sheet ${sheet}` : null, path].filter(Boolean);
@@ -62475,7 +62546,7 @@ function blockingIssueDetails(report, cap = 8) {
62475
62546
  const render = (row) => row.count > 1 ? `${row.line} (\xD7${row.count})` : row.line;
62476
62547
  if (ordered.length <= cap) return ordered.map(render);
62477
62548
  const cut = ordered.slice(cap).reduce((n, row) => n + row.count, 0);
62478
- return [...ordered.slice(0, cap).map(render), `and ${cut} more blocking issue(s)`];
62549
+ return [...ordered.slice(0, cap).map(render), `and ${cut} more ${noun}`];
62479
62550
  }
62480
62551
  function migrationBlockingCodes(report, candidate) {
62481
62552
  const projectionCodes = planBlockers(candidate).map((b) => `plan-uneditable:${b.code}`);
@@ -64296,6 +64367,7 @@ var REGISTRY = /* @__PURE__ */ new Map([
64296
64367
  ["$.members[].memberType", { disposition: "propose" }],
64297
64368
  ["$.members[].rot", { disposition: "propose" }],
64298
64369
  ["$.members[].position", { disposition: "propose" }],
64370
+ ["$.members[].positionH", { disposition: "propose" }],
64299
64371
  ["$.members[].from", { disposition: "propose" }],
64300
64372
  ["$.members[].to", { disposition: "propose" }],
64301
64373
  ["$.members[].section", { disposition: "propose" }],
@@ -65427,12 +65499,14 @@ function inferSupport(beam, end, memberGeo) {
65427
65499
  best = m;
65428
65500
  }
65429
65501
  }
65430
- return best && supportReaches(end, best) ? best : void 0;
65502
+ return best && supportReaches(end, best, latSlack(beam)) ? best : void 0;
65431
65503
  }
65432
- function supportReaches(end, support) {
65504
+ function supportReaches(end, support, latSlackMm = 0) {
65433
65505
  if (!finite3(support.from) || !finite3(support.to) || !support.dims) return false;
65434
- return distPointSeg(end, support.from, support.to) <= Math.max(support.dims.w, support.dims.d);
65506
+ const slack = isFinite(latSlackMm) ? Math.abs(latSlackMm) : 0;
65507
+ return distPointSeg(end, support.from, support.to) <= Math.max(support.dims.w, support.dims.d) + slack;
65435
65508
  }
65509
+ var latSlack = (m) => m && typeof m.latOffset === "number" && isFinite(m.latOffset) ? Math.abs(m.latOffset) : 0;
65436
65510
  function flangeThk(profile, d) {
65437
65511
  return profileKind(profile) === "I" ? Math.min(d * 0.5, Math.max(d * 0.1, 6)) : d / 2;
65438
65512
  }
@@ -66043,7 +66117,7 @@ function expandJoints(joints, memberGeo) {
66043
66117
  return;
66044
66118
  }
66045
66119
  const beamEnd = j.at === "end1" ? beam.to : beam.from;
66046
- if (nativeSupport && !supportReaches(beamEnd, nativeSupport)) {
66120
+ if (nativeSupport && !supportReaches(beamEnd, nativeSupport, latSlack(beam))) {
66047
66121
  skipped.push(j.id);
66048
66122
  return;
66049
66123
  }
@@ -66091,7 +66165,7 @@ function expandJoints(joints, memberGeo) {
66091
66165
  refuseBrace("named-support-unusable", { supportId: nativeSupport.id });
66092
66166
  return;
66093
66167
  }
66094
- if (nativeSupport && !supportReaches(braceEnd, nativeSupport)) {
66168
+ if (nativeSupport && !supportReaches(braceEnd, nativeSupport, latSlack(braceMember))) {
66095
66169
  refuseBrace("named-support-out-of-reach", { supportId: nativeSupport.id });
66096
66170
  return;
66097
66171
  }
@@ -67449,6 +67523,24 @@ function depthPosition(explicit, dzMm, horizMm, isVerticalBrace = false) {
67449
67523
  if (isVerticalBrace) return "middle";
67450
67524
  return dzMm > horizMm * 0.5774 ? "middle" : "top";
67451
67525
  }
67526
+ function planePosition(explicit) {
67527
+ return explicit === "left" || explicit === "right" ? explicit : "middle";
67528
+ }
67529
+ function lateralHalfExtent(dims, rotDeg, round) {
67530
+ if (round) return dims.w / 2;
67531
+ const th = (typeof rotDeg === "number" && isFinite(rotDeg) ? rotDeg : 0) * Math.PI / 180;
67532
+ return Math.abs(dims.w / 2 * Math.cos(th)) + Math.abs(dims.d / 2 * Math.sin(th));
67533
+ }
67534
+ var NO_PLANE_OFFSET = { dx: 0, dy: 0, signed: 0 };
67535
+ function planeOffset(positionH, ax, ay, bx, by, dims, rotDeg, standardSection) {
67536
+ const pos2 = planePosition(positionH);
67537
+ if (pos2 === "middle" || !standardSection) return NO_PLANE_OFFSET;
67538
+ const planLen = Math.hypot(bx - ax, by - ay);
67539
+ if (!(planLen >= DEGENERATE_MM)) return NO_PLANE_OFFSET;
67540
+ const half = lateralHalfExtent(dims, rotDeg, dims.round === true);
67541
+ const signed = pos2 === "left" ? -half : half;
67542
+ return { dx: -(by - ay) / planLen * signed, dy: (bx - ax) / planLen * signed, signed };
67543
+ }
67452
67544
  function contractWithExportScopedMemberIds(contract) {
67453
67545
  const occurrences = /* @__PURE__ */ new Map();
67454
67546
  (contract.plans ?? []).forEach((plan, planIndex) => {
@@ -67516,26 +67608,26 @@ function profileDimsIn(profile) {
67516
67608
  const nums = m[2].split("X").map(parseDim).filter((n) => n != null);
67517
67609
  if (nums.length === 0) return null;
67518
67610
  if ((prefix === "HSS" || prefix === "TUBE" || prefix === "L") && nums.length >= 3) {
67519
- return { d: nums[0], w: nums[1], approx: false };
67611
+ return { d: nums[0], w: nums[1], approx: false, round: false };
67520
67612
  }
67521
67613
  if (prefix === "HSS" || prefix === "PIPE") {
67522
67614
  const dia = nums[0];
67523
- return { d: dia, w: dia, approx: false };
67615
+ return { d: dia, w: dia, approx: false, round: true };
67524
67616
  }
67525
67617
  if (/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)) {
67526
67618
  const actual = sectionDimsIn(p);
67527
- if (actual) return { d: actual.d, w: actual.bf, approx: false };
67619
+ if (actual) return { d: actual.d, w: actual.bf, approx: false, round: false };
67528
67620
  const d = nums[0];
67529
67621
  const bf = BF_IN[p.replace(/\s+/g, "")];
67530
- if (bf !== void 0) return { d, w: bf, approx: false };
67622
+ if (bf !== void 0) return { d, w: bf, approx: false, round: false };
67531
67623
  const ratio = prefix === "C" || prefix === "MC" ? 0.28 : 0.42;
67532
- return { d, w: d * ratio, approx: true };
67624
+ return { d, w: d * ratio, approx: true, round: false };
67533
67625
  }
67534
67626
  return null;
67535
67627
  }
67536
67628
  function profileDims(profile) {
67537
67629
  const din = profileDimsIn(profile);
67538
- return din ? { w: din.w * IN_TO_MM2, d: din.d * IN_TO_MM2, approx: din.approx } : null;
67630
+ return din ? { w: din.w * IN_TO_MM2, d: din.d * IN_TO_MM2, approx: din.approx, round: din.round } : null;
67539
67631
  }
67540
67632
  var SCENE_DEFAULT_PAL = ["#60a5fa", "#94a3b8", "#f59e0b", "#34d399", "#f472b6", "#a78bfa", "#fb7185", "#22d3ee", "#facc15", "#4ade80"];
67541
67633
  function pickColor(profile, idx, contract) {
@@ -67647,7 +67739,8 @@ function contractToScene(contractInput) {
67647
67739
  const defaultTosMm = (plan.default_tos ?? 0) * IN_TO_MM2;
67648
67740
  for (const m of plan.members ?? []) {
67649
67741
  const explicit = m.section && typeof m.section.w === "number" && m.section.w > 0 && typeof m.section.d === "number" && m.section.d > 0 ? { w: m.section.w, d: m.section.d, approx: false } : null;
67650
- const dims = profileDims(m.profile) ?? explicit;
67742
+ const stdDims = profileDims(m.profile);
67743
+ const dims = stdDims ?? explicit;
67651
67744
  if (!dims || !Array.isArray(m.wp) || m.wp.length < 2) {
67652
67745
  skipped.push(m.id);
67653
67746
  continue;
@@ -67665,6 +67758,7 @@ function contractToScene(contractInput) {
67665
67758
  let workFrom;
67666
67759
  let workTo;
67667
67760
  let posOffset = 0;
67761
+ let lat = NO_PLANE_OFFSET;
67668
67762
  if (m.role === "column") {
67669
67763
  const bos = m.col?.bos != null ? m.col.bos * IN_TO_MM2 : 0;
67670
67764
  const tos = m.col?.tos != null ? m.col.tos * IN_TO_MM2 : defaultTosMm;
@@ -67675,13 +67769,14 @@ function contractToScene(contractInput) {
67675
67769
  } else {
67676
67770
  const z0 = m.ends?.[0]?.tos != null ? m.ends[0].tos * IN_TO_MM2 : defaultTosMm;
67677
67771
  const z1 = m.ends?.[1]?.tos != null ? m.ends[1].tos * IN_TO_MM2 : defaultTosMm;
67678
- workFrom = [ax, ay, z0];
67679
- workTo = [bx, by, z1];
67680
67772
  const pos2 = depthPosition(m.position, Math.abs(z1 - z0), Math.hypot(bx - ax, by - ay), mIsBrace && m.brace?.type === "vertical");
67681
67773
  const zoff = pos2 === "top" ? -dims.d / 2 : pos2 === "bottom" ? dims.d / 2 : 0;
67682
67774
  posOffset = zoff;
67683
- from = [ax, ay, z0 + zoff];
67684
- to = [bx, by, z1 + zoff];
67775
+ lat = planeOffset(m.positionH, ax, ay, bx, by, dims, m.rot, stdDims !== null);
67776
+ workFrom = [ax + lat.dx, ay + lat.dy, z0];
67777
+ workTo = [bx + lat.dx, by + lat.dy, z1];
67778
+ from = [ax + lat.dx, ay + lat.dy, z0 + zoff];
67779
+ to = [bx + lat.dx, by + lat.dy, z1 + zoff];
67685
67780
  }
67686
67781
  if (m.role === "column" && Math.abs(to[2] - from[2]) < 1) {
67687
67782
  skipped.push(m.id);
@@ -67691,7 +67786,7 @@ function contractToScene(contractInput) {
67691
67786
  skipped.push(m.id);
67692
67787
  continue;
67693
67788
  }
67694
- memberGeo.set(m.id, { id: m.id, role: m.role === "column" ? "column" : "beam", from: workFrom, to: workTo, dims: { w: dims.w, d: dims.d }, profile, posOffset, isBrace: mIsBrace, ...typeof m.rot === "number" ? { rot: -m.rot } : {} });
67789
+ memberGeo.set(m.id, { id: m.id, role: m.role === "column" ? "column" : "beam", from: workFrom, to: workTo, dims: { w: dims.w, d: dims.d }, profile, posOffset, isBrace: mIsBrace, ...lat.signed ? { latOffset: lat.signed } : {}, ...typeof m.rot === "number" ? { rot: -m.rot } : {} });
67695
67790
  const role = mIsBrace ? "brace" : m.role === "column" ? "column" : "beam";
67696
67791
  const material = m.material && m.material.trim() || inferMaterial(profile);
67697
67792
  elements.push({
@@ -68039,7 +68134,8 @@ function sceneFromModel(view) {
68039
68134
  for (const vm of view.members) {
68040
68135
  const m = vm.raw;
68041
68136
  const explicit = m.section && typeof m.section.w === "number" && m.section.w > 0 && typeof m.section.d === "number" && m.section.d > 0 ? { w: m.section.w, d: m.section.d, approx: false } : null;
68042
- const dims = profileDims(m.profile) ?? explicit;
68137
+ const stdDims = profileDims(m.profile);
68138
+ const dims = stdDims ?? explicit;
68043
68139
  if (!dims) {
68044
68140
  skipped.push(m.id);
68045
68141
  continue;
@@ -68062,19 +68158,21 @@ function sceneFromModel(view) {
68062
68158
  let workFrom;
68063
68159
  let workTo;
68064
68160
  let posOffset = 0;
68161
+ let lat = NO_PLANE_OFFSET;
68065
68162
  if (m.role === "column") {
68066
68163
  from = [ax, ay, z0];
68067
68164
  to = [bx, by, z1];
68068
68165
  workFrom = from;
68069
68166
  workTo = to;
68070
68167
  } else {
68071
- workFrom = [ax, ay, z0];
68072
- workTo = [bx, by, z1];
68073
68168
  const pos2 = depthPosition(m.position, Math.abs(z1 - z0), Math.hypot(bx - ax, by - ay), mIsBrace && braceType === "vertical");
68074
68169
  const zoff = pos2 === "top" ? -dims.d / 2 : pos2 === "bottom" ? dims.d / 2 : 0;
68075
68170
  posOffset = zoff;
68076
- from = [ax, ay, z0 + zoff];
68077
- to = [bx, by, z1 + zoff];
68171
+ lat = planeOffset(m.positionH, ax, ay, bx, by, dims, m.rot, stdDims !== null);
68172
+ workFrom = [ax + lat.dx, ay + lat.dy, z0];
68173
+ workTo = [bx + lat.dx, by + lat.dy, z1];
68174
+ from = [ax + lat.dx, ay + lat.dy, z0 + zoff];
68175
+ to = [bx + lat.dx, by + lat.dy, z1 + zoff];
68078
68176
  }
68079
68177
  if (Math.hypot(workTo[0] - workFrom[0], workTo[1] - workFrom[1], workTo[2] - workFrom[2]) < DEGENERATE_MM) {
68080
68178
  skipped.push(m.id);
@@ -68089,6 +68187,7 @@ function sceneFromModel(view) {
68089
68187
  profile,
68090
68188
  posOffset,
68091
68189
  isBrace: mIsBrace,
68190
+ ...lat.signed ? { latOffset: lat.signed } : {},
68092
68191
  ...typeof m.rot === "number" ? { rot: m.rot } : {}
68093
68192
  });
68094
68193
  const role = mIsBrace ? "brace" : m.role === "column" ? "column" : "beam";
@@ -68921,7 +69020,9 @@ function registerRevisionRoutes(app) {
68921
69020
  const version2 = listVersions(project.id).find((row) => row.n === committed.versionN);
68922
69021
  broadcast(contractChangedWithReason(project.app, project.id, "revision-read"));
68923
69022
  deleteRequest(request.id);
68924
- return { ok: true, version: version2, contractType: STEEL_V2 };
69023
+ const notes = blockingIssueDetails(committed.report, 8, "report", "note(s)");
69024
+ if (notes.length) req.log.info({ project: project.id, notes: blockingIssueDetails(committed.report, 1e3, "report", "note(s)") }, "first read committed with notes");
69025
+ return { ok: true, version: version2, contractType: STEEL_V2, ...notes.length ? { notes } : {} };
68925
69026
  } catch (error) {
68926
69027
  if (error instanceof ContractTransactionError) {
68927
69028
  const expectedRace = error.code === "contract-changed" || error.code === "history-already-exists";
@@ -85370,11 +85471,24 @@ async function startServer() {
85370
85471
  if (getProject(r.project)?.app !== r.appId) return void 0;
85371
85472
  return storedContractType(r.appId, r.project, memo);
85372
85473
  };
85373
- const requestView2 = (r) => r === null ? null : { ...r, appTemplateId: r.appId ? resolveTemplateId(r.appId) : void 0, contractType: requestContractType(r) };
85474
+ const requestProjectName = (r, memo) => {
85475
+ if (!r.project) return void 0;
85476
+ if (memo?.has(r.project)) return memo.get(r.project);
85477
+ const name = getProject(r.project)?.name;
85478
+ memo?.set(r.project, name);
85479
+ return name;
85480
+ };
85481
+ const requestView2 = (r) => r === null ? null : { ...r, appTemplateId: r.appId ? resolveTemplateId(r.appId) : void 0, contractType: requestContractType(r), projectName: requestProjectName(r) };
85374
85482
  const requestViews = (list) => {
85375
85483
  const root5 = templateIdResolver();
85376
85484
  const typeMemo = /* @__PURE__ */ new Map();
85377
- return list.map((r) => ({ ...r, appTemplateId: r.appId ? root5(r.appId) : void 0, contractType: requestContractType(r, typeMemo) }));
85485
+ const nameMemo = /* @__PURE__ */ new Map();
85486
+ return list.map((r) => ({
85487
+ ...r,
85488
+ appTemplateId: r.appId ? root5(r.appId) : void 0,
85489
+ contractType: requestContractType(r, typeMemo),
85490
+ projectName: requestProjectName(r, nameMemo)
85491
+ }));
85378
85492
  };
85379
85493
  app.get("/api/projects", async () => ({ ok: true, projects: projectViews(listProjects()) }));
85380
85494
  app.post(
@@ -160,6 +160,7 @@
160
160
  "role": { "enum": ["beam", "column"], "description": "Authored role. Defaults to beam when absent. NOT derived from geometry." },
161
161
  "memberType": { "type": "string", "description": "Member category driving the legend (beam, ledger, brace, …). 'brace' is excluded from every beam-only path." },
162
162
  "position": { "enum": ["top", "middle", "bottom"], "description": "Profile placement relative to the work-line — the section's depth position." },
163
+ "positionH": { "enum": ["left", "middle", "right"], "description": "Profile placement ACROSS the work-line — the section's plan position, the horizontal companion to `position`. Named for where the LINE sits on the section, exactly as `position` is: left = the section's left face is on the line (so the steel is to its right), right = the mirror, middle = centred (the default, and what every member did before this field existed). Left/right are read looking from `from` to `to` with Z up — the same sense as reading the plan from above. Absent = middle. Ignored for a member with no plan direction (a plumb column or brace has no left or right) and for one with no resolved AISC designation (a CUSTOM / traced `section` box, whose section axes the viewer does not align to the plan). A width the section tables did not supply — a per-series ratio estimate — is NOT ignored: the member is already drawn and exported at that width, so flushing to the face it actually has is self-consistent, and the editor says the width is estimated." },
163
164
  "rot": { "type": "number", "description": "Section rotation about the member axis, degrees. Present on real v1 contracts but never declared by the v1 schema — enumerated here so migration cannot silently drop it." },
164
165
  "section": {
165
166
  "type": "object",
@@ -661,11 +662,13 @@
661
662
  "propLabels": {
662
663
  "type": "object",
663
664
  "additionalProperties": false,
664
- "description": "Draft-only display state. CLOSED because `ids` holds member ids that identity migration must remap.",
665
+ "description": "Draft-only display state. CLOSED because `ids` holds member ids that identity migration must remap — closed to keep IDS accountable, never to withhold display state, which is why the two visibility flags below belong here rather than in a browser-local store (#614).",
665
666
  "properties": {
666
667
  "props": { "type": "array", "items": { "type": "string" }, "description": "Checked property registry keys to show as labels." },
667
668
  "placement": { "enum": ["start", "mid", "end"] },
668
669
  "selected_only": { "type": "boolean" },
670
+ "vis2d": { "type": "boolean", "description": "Show the label chips on the 2D plan. ABSENT MEANS ON — the default the MIGRATED case needs: v1 stores these flags, but only once its editor has saved, so a v1 document whose user never touched the toggle carries neither and migration has nothing to hand across. Reading that as 'off' would convert a project into one whose ticked properties draw nothing. (Not a claim about existing v2 documents: those had the feature disabled outright, and this is what turns it on.) The property SELECTION (`props`) stays shared across 2D and 3D — only show/hide is per view." },
671
+ "vis3d": { "type": "boolean", "description": "Show the label chips in the 3D view. Absent means on, for the same reason as vis2d." },
669
672
  "ids": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Member ids the labels pin to, used only when selected_only is true." }
670
673
  }
671
674
  },