<!-- SOLID CITY · part 3600 -->
Math.max(...angles):null;
  // Deterministic interior barycentric probes, distinct from vertices.
  const weights=[[0.19,0.31,0.50],[0.43,0.37,0.20],[0.29,0.52,0.19],[1/3,1/3,1/3]];
  const stride=Math.max(1,Math.ceil(ts.length*Math.min(weights.length,Math.max(1,samplesPerTriangle))/maxSamples));
  for(let i=0;i<ts.length;i+=stride){
    const t=ts[i];if(t.verts.some(v=>v.some(n=>!finite(n))))continue;
    for(let j=0;j<Math.min(weights.length,Math.max(1,samplesPerTriangle));j++){
      const p=mix(...t.verts,weights[j]);
      if(horizontalHeight(t,p[0],p[2])==null)continue; // vertical projected triangle
      if(standAt){
        const y=standAt(p[0],p[2],p[1],{name,mesh,triangle:t.id});
        if(!finite(y))out.standMissing++;
        else standErrors.push(Math.abs(y-p[1]));
      }
      if(referenceSurface){const y=referenceSurface(p[0],p[2]);if(finite(y))refErrors.push(Math.abs(y-p[1]));}
      out.sampled++;
    }
  }
  out.standMaxDelta=standErrors.length?Math.max(...standErrors):null;
  out.standP95Delta=quantile(standErrors,0.95);
  out.referenceSamples=refErrors.length;
  out.referenceMaxDelta=refErrors.length?Math.max(...refErrors):null;
  if(out.degenerate)out.findings.push('DEGENERATE_TRIANGLES');
  if(out.nonFinite)out.findings.push('NONFINITE_COORDINATES');
  if(out.windingConflicts)out.findings.push('INCONSISTENT_ADJACENT_WINDING');
  if(out.nonManifoldEdges)out.findings.push('NONMANIFOLD_EDGES');
  if(expectedUp===true && out.down)out.findings.push('DOWNWARD_TRIANGLES');
  if(expectedUp===false && out.up)out.findings.push('UPWARD_TRIANGLES');
  if(out.standMissing)out.findings.push('MISSING_STANDING_PROBES');
  if(out.standMaxDelta!=null && out.standMaxDelta>standTolerance)out.findings.push('STANDING_MISMATCH');
  out.limits.push('Coincident-edge matching uses quantization and can miss T-junctions and partial overlaps.');
  out.limits.push('Interior probes are finite, not a global surface or collision proof.');
  out.limits.push('No clearance, grade, traversability, registry priority, or mobile frame-time certification.');
  return out;
}
/**
 * Cross-mesh seam: explicit ordered world-space edge polylines supplied by Solid.
 * Edges must represent the SAME physical seam and have matching direction.
 * Samples both piecewise-linear edge elevations at normalized arc fractions.
 */
export function auditSharedSeam({name='seam',edgeA,edgeB,samples=33,planTolerance=0.05,heightTolerance=0.01}={}){
  function check(e){if(!Array.isArray(e)||e.length<2||e.some(p=>!Array.isArray(p)||p.length!==3||p.some(v=>!finite(v))))throw Error('ordered [x,y,z] edge points required');}
  check(edgeA);check(edgeB);
  function sample(e,f){
    const d=e.slice(1).map((p,i)=>Math.hypot(p[0]-e[i][0],p[2]-e[i][2]));
    const total=d.reduce((a,b)=>a+b,0);if(total<=0)throw Error('zero-length edge');
    let remaining=f*total;
    for(let i=0;i<d.length;i++){if(remaining<=d[i]||i===d.length-1){const t=Math.max(0,Math.min(1,remaining/d[i]));return e[i].map((v,k)=>v*(1-t)+e[i+1][k]*t);}remaining-=d[i];}
  }
  let maxPlan=0,maxHeight=0,worst=null;
  for(let i=0;i<samples;i++){
    const f=i/(samples-1),a=sample(edgeA,f),b=sample(edgeB,f);
    const plan=Math.hypot(a[0]-b[0],a[2]-b[2]),dy=Math.abs(a[1]-b[1]);
    if(plan>maxPlan||dy>maxHeight)worst={fraction:f,plan,height:dy};
    maxPlan=Math.max(maxPlan,plan);maxHeight=Math.max(maxHeight,dy);
  }
  return {name,samples,maxPlanGap:maxPlan,maxHeightGap:maxHeight,worst,
    withinProposedTolerances:maxPlan<=planTolerance&&maxHeight<=heightTolerance,
    note:'Fraction-aligned polyline sampling is diagnostic, not a minimum-distance or watertightness proof.'};
}
export function auditBatch(specs){return specs.map(s=>auditStructure(s));}


===== FILE: public/city/tunnel-bore-place.js =====
/* Solid City — places THE BORE (public/city/tunnel-bore.js): the 800m tunnel
   from Kauhale Mauna's upper terrace through the mountain to the Starwell.
   Lazy: imported after the city is built; any import/build error is caught and
   the city carries on. The floor height is read from the village at runtime
   (terrace A top), so the road flows into the mouth with no step, no gap.
   Adds: wall collision (long axis-aligned boxes, exact), radar blip, Hyper POI,
   Watch caption. No narration — the geometry is the guide. */
(function () {
'use strict';
if (!window.SC || !SC.api) return;
var A = SC.api, S = A.S;
var POS = { x: 2000, z: 1880 }, LEN = 800; // mouth; bore runs north (-z) to z=1080
var M = { state: 'idle', group: null, wait: 6.0, floorY: 22 };
function villageFloor() {
  try {
    var V = window.CityVillageMauna;
    if (!V || V.state() !== 'ready') return null;
    var g = V.group(); if (!g) return null;
    return g.position.y + 1.1; // terrace A top (village-local topY 1.1)
  } catch (e) { return null; }
}
function addBox(cx, cz, w, d, rot, y0, y1) {
  var nx = Math.max(1, Math.ceil(w / 2.5)), nz = Math.max(1, Math.ceil(d / 2.5)), cw = w / nx, cd