diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/model.d.mts r2/project/src/bc84/model.d.mts
--- project/src/bc84/model.d.mts	2026-11-10 10:37:25.761099402 +0800
+++ r2/project/src/bc84/model.d.mts	2026-11-10 14:46:49.858421345 +0800
@@ -7,7 +7,7 @@
 export interface RoadGrid {scale:6|8|16;coordinateSystem:string;lane:number|null;defaultByParcel:Record<ParcelId,Cell[]>;module?:number}
 export interface RoadSpaceUnit {id:string;parcelId:ParcelId;kind:'dedicated-public-road-space';economyCategory:null;activation:'owned-parcel';carriageCells:Cell[];sidewalkCells:Cell[];footprintCells:Cell[]}
 export interface PublicPlan {version:string;roadSpaceUnits?:RoadSpaceUnit[];roadCells?:Cell[];roadCellIds?:ParcelId[];carriageByRoadCell?:Record<ParcelId,Cell[]>;sidewalkByRoadCell?:Record<ParcelId,Cell[]>;vergeByRoadCell?:Record<ParcelId,Cell[]>;coreAnchors:{id:string;parcelId:ParcelId;cell:Cell}[];protectedRoadCells:Cell[];corridorByParcel:Record<ParcelId,Cell[]>;activation:string;buildingPermits:string}
-export interface WorldPlan {schema:string;versions:Record<string,string>;seed:string;worldProfileId:'island-orthogonal-v1'|'island-orthogonal-p1-v1'|'island-orthogonal-p1-v2'|'island-orthogonal-p1-compact-v3'|'island-orthogonal-p1-roadspace-v4'|'island-orthogonal-p1-roadcells-v5';planningProfileVersion?:string;visualContentProfileVersion?:string;parcels:Parcel[];blocks:{id:string;parcelIds:ParcelId[]}[];unlockGraph:Record<ParcelId,ParcelId[]>;planningPriority:Cell[];roadGrid:RoadGrid;publicPlan:PublicPlan;boundary:{mask:Cell[];entry:ParcelId}}
+export interface WorldPlan {schema:string;versions:Record<string,string>;seed:string;worldProfileId:'island-orthogonal-v1'|'island-orthogonal-p1-v1'|'island-orthogonal-p1-v2'|'island-orthogonal-p1-compact-v3'|'island-orthogonal-p1-roadspace-v4'|'island-orthogonal-p1-roadcells-v5'|'island-orthogonal-p1-roadcells-v6';planningProfileVersion?:string;visualContentProfileVersion?:string;parcels:Parcel[];blocks:{id:string;parcelIds:ParcelId[]}[];unlockGraph:Record<ParcelId,ParcelId[]>;planningPriority:Cell[];roadGrid:RoadGrid;publicPlan:PublicPlan;boundary:{mask:Cell[];entry:ParcelId}}
 export interface BuildingFootprint {x:number;y:number;width:number;height:number}
 export type Orientation=0|90|180|270;
 export interface VisualBuilding {id:VisualBuildingId;parcelId:ParcelId;footprint:BuildingFootprint;orientation:Orientation;setback:1;cells:Cell[];category:Category;skin:string;skinPreference:string;active:boolean;visualTier:number;contentVersion:string;modelVariant:string;seriesPreference:string;replaces:VisualBuildingId[]}
@@ -48,9 +48,10 @@
 export declare function fineAt(p:WorldPlan,parcelCell:Cell,x:number,y:number):Cell;
 export declare const ROADCELL_PROFILE:string;
 export declare const ROADCELL_WORLD_PROFILE:string;
-export declare const ROADCELL_SCALE:8;
+export declare const ROADCELL_SCALE:7;
 export declare const ROADCELL_MODULE:5;
 export declare const ROADCELL_VERSION:string;
+export declare const ROADCELL_BUILDING_FOOTPRINT:6;
 export declare function p5InitialOwned(p:WorldPlan):ParcelId[];
 export declare function p5OpenRoadIds(p:WorldPlan,ownedIds:ParcelId[]):ParcelId[];
 export declare function p5SidewalkCells(cell:Cell,scale?:number):Cell[];
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/model.d.ts r2/project/src/bc84/model.d.ts
--- project/src/bc84/model.d.ts	2026-11-10 10:37:25.761012249 +0800
+++ r2/project/src/bc84/model.d.ts	2026-11-10 14:46:49.858192096 +0800
@@ -7,7 +7,7 @@
 export interface RoadGrid {scale:6|8|16;coordinateSystem:string;lane:number|null;defaultByParcel:Record<ParcelId,Cell[]>;module?:number}
 export interface RoadSpaceUnit {id:string;parcelId:ParcelId;kind:'dedicated-public-road-space';economyCategory:null;activation:'owned-parcel';carriageCells:Cell[];sidewalkCells:Cell[];footprintCells:Cell[]}
 export interface PublicPlan {version:string;roadSpaceUnits?:RoadSpaceUnit[];roadCells?:Cell[];roadCellIds?:ParcelId[];carriageByRoadCell?:Record<ParcelId,Cell[]>;sidewalkByRoadCell?:Record<ParcelId,Cell[]>;vergeByRoadCell?:Record<ParcelId,Cell[]>;coreAnchors:{id:string;parcelId:ParcelId;cell:Cell}[];protectedRoadCells:Cell[];corridorByParcel:Record<ParcelId,Cell[]>;activation:string;buildingPermits:string}
-export interface WorldPlan {schema:string;versions:Record<string,string>;seed:string;worldProfileId:'island-orthogonal-v1'|'island-orthogonal-p1-v1'|'island-orthogonal-p1-v2'|'island-orthogonal-p1-compact-v3'|'island-orthogonal-p1-roadspace-v4'|'island-orthogonal-p1-roadcells-v5';planningProfileVersion?:string;visualContentProfileVersion?:string;parcels:Parcel[];blocks:{id:string;parcelIds:ParcelId[]}[];unlockGraph:Record<ParcelId,ParcelId[]>;planningPriority:Cell[];roadGrid:RoadGrid;publicPlan:PublicPlan;boundary:{mask:Cell[];entry:ParcelId}}
+export interface WorldPlan {schema:string;versions:Record<string,string>;seed:string;worldProfileId:'island-orthogonal-v1'|'island-orthogonal-p1-v1'|'island-orthogonal-p1-v2'|'island-orthogonal-p1-compact-v3'|'island-orthogonal-p1-roadspace-v4'|'island-orthogonal-p1-roadcells-v5'|'island-orthogonal-p1-roadcells-v6';planningProfileVersion?:string;visualContentProfileVersion?:string;parcels:Parcel[];blocks:{id:string;parcelIds:ParcelId[]}[];unlockGraph:Record<ParcelId,ParcelId[]>;planningPriority:Cell[];roadGrid:RoadGrid;publicPlan:PublicPlan;boundary:{mask:Cell[];entry:ParcelId}}
 export interface BuildingFootprint {x:number;y:number;width:number;height:number}
 export type Orientation=0|90|180|270;
 export interface VisualBuilding {id:VisualBuildingId;parcelId:ParcelId;footprint:BuildingFootprint;orientation:Orientation;setback:1;cells:Cell[];category:Category;skin:string;skinPreference:string;active:boolean;visualTier:number;contentVersion:string;modelVariant:string;seriesPreference:string;replaces:VisualBuildingId[]}
@@ -45,9 +45,10 @@
 export declare function fineAt(p:WorldPlan,parcelCell:Cell,x:number,y:number):Cell;
 export declare const ROADCELL_PROFILE:string;
 export declare const ROADCELL_WORLD_PROFILE:string;
-export declare const ROADCELL_SCALE:8;
+export declare const ROADCELL_SCALE:7;
 export declare const ROADCELL_MODULE:5;
 export declare const ROADCELL_VERSION:string;
+export declare const ROADCELL_BUILDING_FOOTPRINT:6;
 export declare function p5InitialOwned(p:WorldPlan):ParcelId[];
 export declare function p5OpenRoadIds(p:WorldPlan,ownedIds:ParcelId[]):ParcelId[];
 export declare function p5SidewalkCells(cell:Cell,scale?:number):Cell[];
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/model.mjs r2/project/src/bc84/model.mjs
--- project/src/bc84/model.mjs	2026-11-10 11:08:55.059324307 +0800
+++ r2/project/src/bc84/model.mjs	2026-11-10 14:14:54.386839784 +0800
@@ -29,7 +29,7 @@
 const category=c=>CATEGORIES.includes(c);
 export function fineAt(p,parcelCell,x,y){const scale=p.roadGrid.scale;if(!Number.isInteger(x)||!Number.isInteger(y)||x<0||y<0||x>=scale||y>=scale||!parcelByCell(p,parcelCell))throw Error('invalid parcel fine coordinate');const [px,py]=xy(parcelCell);return `${px*scale+x},${py*scale+y}`;}
 function containing(p,cell){const scale=p.roadGrid.scale;if(!coord(cell))return null;const [x,y]=xy(cell);return parcelByCell(p,`${Math.floor(x/scale)},${Math.floor(y/scale)}`)??null;}
-function localFoot(p,f,orientation=0){const scale=p.layoutScale??ROAD_SCALE;if(![0,90,180,270].includes(orientation)||!f||![f.x,f.y,f.width,f.height].every(Number.isSafeInteger)||f.width<1||f.height<1)return null;const width=orientation%180?f.height:f.width,height=orientation%180?f.width:f.height;if((scale===16&&(width<(p.profile4?4:6)||height<(p.profile4?4:6)))||f.x<1||f.y<1||f.x+width>scale-1||f.y+height>scale-1)return null;const [x,y]=xy(p.cell);const out=[];for(let i=0;i<width;i++)for(let j=0;j<height;j++)out.push(`${x*scale+f.x+i},${y*scale+f.y+j}`);return out;}
+function localFoot(p,f,orientation=0){const scale=p.layoutScale??ROAD_SCALE;if(![0,90,180,270].includes(orientation)||!f||![f.x,f.y,f.width,f.height].every(Number.isSafeInteger)||f.width<1||f.height<1)return null;const width=orientation%180?f.height:f.width,height=orientation%180?f.width:f.height;if(scale===16&&(width<(p.profile4?4:6)||height<(p.profile4?4:6)))return null;const edge=p.profile5===true?0:1;if(f.x<edge||f.y<edge||f.x+width>scale-edge||f.y+height>scale-edge)return null;const [x,y]=xy(p.cell);const out=[];for(let i=0;i<width;i++)for(let j=0;j<height;j++)out.push(`${x*scale+f.x+i},${y*scale+f.y+j}`);return out;}
 function allowedFoot(b,p){return b&&b.parcelId===p.id&&[0,90,180,270].includes(b.orientation)&&b.setback===1&&Array.isArray(b.cells)&&identical(b.cells,localFoot(p,b.footprint,b.orientation));}
 function roadDefaults(cell,lane,scale=ROAD_SCALE){const [x,y]=xy(cell);const out=[];
  // P3: dedicated 2-fine-cell carriageways entirely inside every owned Parcel.
@@ -76,15 +76,16 @@
 // OR a building cell (one economic parcel, exactly one main building).  The old
 // per-Parcel road corridor/multi-building template is never used for this profile.
 // ============================================================================
-export const ROADCELL_PROFILE='bc84-p1-orthogonal-roadcells-5';
-export const ROADCELL_WORLD_PROFILE='island-orthogonal-p1-roadcells-v5';
-export const ROADCELL_SCALE=8;
+export const ROADCELL_PROFILE='bc84-p1-orthogonal-roadcells-6';
+export const ROADCELL_WORLD_PROFILE='island-orthogonal-p1-roadcells-v6';
+export const ROADCELL_SCALE=7;
 export const ROADCELL_MODULE=5;
-export const ROADCELL_VERSION='p1-world-orthogonal-roadcells-5';
+export const ROADCELL_VERSION='p1-world-orthogonal-roadcells-6';
+export const ROADCELL_BUILDING_FOOTPRINT=6;
 const p5Seed=seed=>String(seed).startsWith(ROADCELL_PROFILE+':');
 const p5RoadLine=(x,y)=>x%ROADCELL_MODULE===0||y%ROADCELL_MODULE===0;
 export const p5ParcelRole=(x,y)=>p5RoadLine(x,y)?'road':'building';
-/** The two-cell carriageway centred inside every 8x8 road cell; intersections are a plus. */
+/** The two-cell carriageway centred inside every 7x7 road cell; intersections are a plus. */
 export function p5CarriageCells(cell,scale=ROADCELL_SCALE){const [x,y]=xy(cell),out=[],vertical=x%ROADCELL_MODULE===0,horizontal=y%ROADCELL_MODULE===0,lo=Math.floor(scale/2)-1,hi=lo+1;
  for(let i=0;i<scale;i++){
   if(vertical){out.push(`${x*scale+lo},${y*scale+i}`,`${x*scale+hi},${y*scale+i}`);}
@@ -130,8 +131,8 @@
  const entryCell=buildingSet.has('1,4')?'1,4':buildingSet.has('1,1')?'1,1':buildingCells[0]?.cell;
  if(!entryCell)throw Error('050 plan needs at least one building cell');
  const [entryX,entryY]=entryCell.split(',').map(Number);
- const publicPlan={version:'public-support-orthogonal-roadcells-v5',roadCells:roadCells.map(p=>p.cell),roadCellIds:roadCells.map(p=>p.id),
-  carriageByRoadCell,sidewalkByRoadCell,vergeByRoadCell,coreAnchors:[{id:'core:entry',parcelId:ids[entryCell],cell:`${entryX*8+1},${entryY*8+1}`}],protectedRoadCells:[],
+ const publicPlan={version:'public-support-orthogonal-roadcells-v6',roadCells:roadCells.map(p=>p.cell),roadCellIds:roadCells.map(p=>p.id),
+  carriageByRoadCell,sidewalkByRoadCell,vergeByRoadCell,coreAnchors:[{id:'core:entry',parcelId:ids[entryCell],cell:`${entryX*ROADCELL_SCALE+1},${entryY*ROADCELL_SCALE+1}`}],protectedRoadCells:[],
   corridorByParcel:Object.fromEntries(parcels.map(p=>[p.id,p.role==='road'?carriageByRoadCell[p.id]:[]])),
   activation:'adjacent-owned-building-cell',buildingPermits:'building-cell-owns-one-building-and-no-road'};
  return {schema:VERSIONS.schema,versions:VERSIONS,seed:String(seed),worldProfileId:ROADCELL_WORLD_PROFILE,
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/host/hud-model.mjs r2/project/src/bc84/p1/host/hud-model.mjs
--- project/src/bc84/p1/host/hud-model.mjs	2026-11-10 11:16:04.256629878 +0800
+++ r2/project/src/bc84/p1/host/hud-model.mjs	2026-11-10 14:54:29.473910630 +0800
@@ -100,8 +100,8 @@
   model.incomeText=formatRate(model.incomeMilli);
   model.coinsText = formatCoins(state.balances.coins);
   model.summary = p5
-    ? `${fixture ? '预拥有压力夹具 · ' : ''}${n} / ${economicCells} 个建筑格 · ${activeBuildings} 栋建筑 · 一格一栋${model.incomeMilli > 0 || state.config.income ? ` · ${model.incomeText}` : ''}`
-    : `${fixture ? '预拥有压力夹具 · ' : ''}${n} / ${size} 个地段 · ${activeBuildings} 栋建筑${model.incomeMilli > 0 || state.config.income ? ` · ${model.incomeText}` : ''}`;
+    ? `${fixture ? '全城预置 · 测试夹具 · ' : ''}${n} / ${economicCells} 个建筑格 · ${activeBuildings} 栋建筑 · 一格一栋${model.incomeMilli > 0 || state.config.income ? ` · ${model.incomeText}` : ''}`
+    : `${fixture ? '全城预置 · 测试夹具 · ' : ''}${n} / ${size} 个地段 · ${activeBuildings} 栋建筑${model.incomeMilli > 0 || state.config.income ? ` · ${model.incomeText}` : ''}`;
   model.stage = p5
     ? (n <= 4 ? STAGE_TEXT.initial : n < economicCells * 0.4 ? STAGE_TEXT.single : STAGE_TEXT.grown)
     : (n < 2 ? STAGE_TEXT.initial : n < size / 3 ? STAGE_TEXT.single : STAGE_TEXT.grown);
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/host/pick.mjs r2/project/src/bc84/p1/host/pick.mjs
--- project/src/bc84/p1/host/pick.mjs	2026-11-10 09:45:13.125153746 +0800
+++ r2/project/src/bc84/p1/host/pick.mjs	2026-11-10 14:33:57.413242024 +0800
@@ -30,7 +30,7 @@
       if (!projection) return null;
       setRay(x, y, w, h);
       const hit = ray.intersectObjects(projection.buildingPickables, false)[0];
-      return hit ? {kind: 'building', id: hit.object.userData.buildingId} : null;
+      return hit ? {kind: 'building', id: hit.object.userData.buildingId, distance: hit.distance} : null;
     },
     pickRoadSpaceAt(x,y,w,h){
       const projection=getProjection();if(!projection?.roadSpacePickables?.length)return null;
@@ -43,7 +43,7 @@
       const projection = getProjection(); if (!projection?.candidatePickables?.length) return null;
       setRay(x,y,w,h);
       const hit=ray.intersectObjects(projection.candidatePickables,false)[0];
-      return hit ? {kind:'parcel',id:hit.object.userData.parcelId} : null;
+      return hit ? {kind:'parcel',id:hit.object.userData.parcelId,distance:hit.distance} : null;
     },
     /** Parcel whose land cell contains the ground point, or null. */
     parcelAt(x, y, w, h, state) {
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/host/web-host.mjs r2/project/src/bc84/p1/host/web-host.mjs
--- project/src/bc84/p1/host/web-host.mjs	2026-11-10 11:08:55.059498443 +0800
+++ r2/project/src/bc84/p1/host/web-host.mjs	2026-11-10 14:40:05.296601398 +0800
@@ -28,16 +28,16 @@
   : (requestedSize === 96 ? 96 : 32);
 const seed = ((qs.get('seed') || (is050 ? '84-p5-preview-a' : '84-p1-a')).replace(/[^\w-]/g, '')) || (is050 ? '84-p5-preview-a' : '84-p1-a');
 const fixture = qs.has('dev') && qs.get('fixture') === 'full';
-// DDZ-BC84-048: v5 namespace keeps 044/046 saves separate.  Long seeds get a short FNV tag in
+// DDZ-BC84-050-r2: v7/r2 namespace is deliberately separate from R1 v6.  Long seeds get a short FNV tag in
 // the IndexedDB name so two distinct seeds cannot share a truncated namespace; the runtime also
 // refuses any loaded world whose worldId/seed does not exactly match this request.
 const seedTag = seed.length > 36 ? `${seed.slice(0, 24)}-${(() => { let h = 2166136261; for (let i = 0; i < seed.length; i++) { h ^= seed.charCodeAt(i); h = Math.imul(h, 16777619); } return (h >>> 0).toString(16).padStart(8, '0'); })()}` : seed;
-const dbName = `${is050 ? 'ddz-bc84-p1-v6-050' : 'ddz-bc84-p1-v5-048'}-${fixture ? 'FIXTURE-' : ''}${seedTag}-${size}`;
+const dbName = `${is050 ? 'ddz-bc84-p1-v7-050r2' : 'ddz-bc84-p1-v5-048'}-${fixture ? 'FIXTURE-' : ''}${seedTag}-${size}`;
 const dev = qs.has('dev');
 
 const data = {
   size, seed, city, events: [], frames: [], builds: [], errors: [], camera: [], rebuildCalls: 0,
-  contentProfile: is050 ? 'p1-orthogonal-roadcells-v5-test' : 'p1-roadspace-v4-test', boot: null,
+  contentProfile: is050 ? 'p1-orthogonal-roadcells-v6-r2-test' : 'p1-roadspace-v4-test', boot: null,
 };
 const worldUnit = () => {
   const s = runtime?.state();
@@ -149,7 +149,9 @@
   return viewMode;
 }
 function homeViewBox() {
-  const base = runtime?.projection?.framingBounds ?? runtime?.projection?.bounds;
+  // R2: always frame the real island footprint, not only the owned starter block.
+  // Otherwise "回到城市" on a 4-cell start zooms into two towers and hides the city.
+  const base = runtime?.projection?.bounds ?? runtime?.projection?.framingBounds;
   if (!base) return null;
   const state = runtime?.state();
   if (!state) return base;
@@ -403,14 +405,23 @@
     return;
   }
   const buildingHit = pick.pickBuildingAt(x, y, vw, vh);
+  const candidateHit = pick.pickCandidateAt(x, y, vw, vh);
+  // A grounded candidate stake sits in front of the owned building proxy; only let it
+  // win when its hit is actually nearer. A hidden/behind stake never steals a building tap.
+  if (candidateHit && (!buildingHit || candidateHit.distance < buildingHit.distance - 0.04)) {
+    const parcel = s.worldPlan.parcels.find(p => p.id === candidateHit.id);
+    clearPending();
+    selected = parcel ? {kind: 'parcel', id: parcel.id} : null;
+    updateUI();
+    return;
+  }
   if (buildingHit) {
     clearPending();
     selected = {kind: 'building', id: buildingHit.id};
     updateUI();
     return;
   }
-  const candidateHit=pick.pickCandidateAt(x,y,vw,vh);
-  const roadHit=!candidateHit?pick.pickRoadSpaceAt(x,y,vw,vh):null;
+  const roadHit=candidateHit?null:pick.pickRoadSpaceAt(x,y,vw,vh);
   if(roadHit){clearPending();selected={kind:'road-cell',id:roadHit.parcelId,roadSpaceId:roadHit.id,topology:roadHit.topology};record('road-cell-selected',{parcelId:roadHit.parcelId,topology:roadHit.topology});updateUI();return;}
   const parcel = candidateHit ? s.worldPlan.parcels.find(p=>p.id===candidateHit.id) : pick.parcelAt(x, y, vw, vh, s);
   clearPending();
@@ -569,11 +580,19 @@
   return {
     seed, size, city, profile: snap.profile, worldProfileId: snap.worldProfileId, cellCounts: snap.cellCounts,
     metrics: city === '050' && unit ? {
-      cellWorld: unit, fineWorld: unit / 8, buildingSlotWorld: 6 * unit / 8,
-      buildingSetbackWorld: unit / 8, renderedS40WidthWorld: '1.7–2.9 (native, not stretched)',
-      roadCarriageWorld: 2 * unit / 8,
-      sidewalkEachSideWorld: unit / 8, vergeEachSideWorld: 2 * unit / 8,
-      roadPavedBandWorld: 4 * unit / 8, roadCellWorld: unit, blockPitchWorld: 5 * unit,
+      cellWorld: unit, fineWorld: unit / 7, buildingSlotWorld: 6 * unit / 7,
+      // Actual post-fit setbacks in world units; the legal 3.6 slot is listed separately.
+      buildingSetbackWorld: snap.stats?.buildingBounds ? {
+        width: [(unit - snap.stats.buildingBounds.maxWidth) / 2, (unit - snap.stats.buildingBounds.minWidth) / 2],
+        depth: [(unit - snap.stats.buildingBounds.maxDepth) / 2, (unit - snap.stats.buildingBounds.minDepth) / 2],
+      } : null,
+      buildingLegalSetbackWorld: unit / 14,
+      renderedBuildingWidthWorld: snap.stats?.buildingBounds ? [snap.stats.buildingBounds.minWidth, snap.stats.buildingBounds.maxWidth] : null,
+      renderedBuildingDepthWorld: snap.stats?.buildingBounds ? [snap.stats.buildingBounds.minDepth, snap.stats.buildingBounds.maxDepth] : null,
+      renderedBuildingCount: snap.stats?.buildingBounds?.count ?? 0,
+      roadCarriageWorld: 2 * unit / 7,
+      sidewalkEachSideWorld: unit / 7, vergeEachSideWorld: 1.5 * unit / 7,
+      roadPavedBandWorld: 4 * unit / 7, roadCellWorld: unit, blockPitchWorld: 5 * unit,
     } : null,
     camera: rig.snapshot(), owned: snap.owned, deleted: snap.deleted,
     skins: snap.skins, manifest: snap.manifest, stats: snap.stats, topology: snap.topology,
@@ -647,6 +666,8 @@
         get port() { return runtime.port; },
         get session() { return runtime.session; },
         failPrepare() { runtime.setFailPrepare(true); },
+        pickCandidateAt: (x, y) => pick.pickCandidateAt(x, y, innerWidth, innerHeight),
+        pickBuildingAt: (x, y) => pick.pickBuildingAt(x, y, innerWidth, innerHeight),
       } : undefined,
       renderer, scene, camera, homeCamera,
       get cameraBounds() { return runtime.cameraBounds; },
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/host/wx-host.mjs r2/project/src/bc84/p1/host/wx-host.mjs
--- project/src/bc84/p1/host/wx-host.mjs	2026-11-10 09:52:33.169619559 +0800
+++ r2/project/src/bc84/p1/host/wx-host.mjs	2026-11-10 14:09:22.583243219 +0800
@@ -973,9 +973,9 @@
       buildHud();
       resizeHudCanvas(); // HUD 画布/正交相机/面片尺寸必须在画布创建之后再同步一次
 
-      // DDZ-BC84-048: v5 keys are namespaced by the full seed+size, so two saves cannot collide.
+      // DDZ-BC84-050-r2: v7/r2 keys are namespaced by the full seed+size, so R1/R2 saves cannot collide.
       // Legacy v4 keys are intentionally left untouched (never reinterpreted or migrated).
-      const prefix=profile==='050'?`bc84.p1.orthocells-v6-050:${seed}:${size}:`:`bc84.p1.roadspace-v5-048:${seed}:${size}:`;
+      const prefix=profile==='050'?`bc84.p1.orthocells-v7-050r2:${seed}:${size}:`:`bc84.p1.roadspace-v5-048:${seed}:${size}:`;
       const storageWx={getStorageSync:k=>wx.getStorageSync(prefix+k),
         setStorageSync:(k,v)=>wx.setStorageSync(prefix+k,v),
         removeStorageSync:k=>wx.removeStorageSync(prefix+k)};
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/road-visual.mjs r2/project/src/bc84/p1/road-visual.mjs
--- project/src/bc84/p1/road-visual.mjs	2026-11-10 11:08:55.059575750 +0800
+++ r2/project/src/bc84/p1/road-visual.mjs	2026-11-10 14:06:22.094055047 +0800
@@ -121,7 +121,7 @@
       dirs.length === 1 ? 'end' : 'isolated';
     spaces.push({id: `road-space:${parcel.id}`, parcelId: parcel.id, kind: 'complete-orthogonal-road-cell',
       authority: 'RoadState', topology, directions: dirs, carriageCells: carriage, sidewalkCells: sidewalk, vergeCells: verge,
-      footprintCells: [...sidewalk, ...carriage, ...verge].sort(), fullPlannedFootprint: 64,
+      footprintCells: [...sidewalk, ...carriage, ...verge].sort(), fullPlannedFootprint: 49,
       activation: 'open-road-cell-and-present-RoadState', nonEconomic: true});
   }
   return spaces;
@@ -130,15 +130,15 @@
 /** @param {any} state */
 export function roadVisualPlan(state) {
   const cells = state?.roads?.present ?? [];
-  if (state?.worldPlan?.worldProfileId === 'island-orthogonal-p1-roadcells-v5') {
+  if (state?.worldPlan?.worldProfileId === 'island-orthogonal-p1-roadcells-v6') {
     const rectangles = aggregateRoadCells(cells);
     const spaces = projectRoadCellSpaces(state);
     const junctions = spaces.filter(u => ['cross', 'tee', 'turn'].includes(u.topology) && u.carriageCells.length)
       .map(u => {
         const p = state.worldPlan.parcels.find(q => q.id === u.parcelId);
-        const x = p.coordinate.x * 8, y = p.coordinate.y * 8;
-        return {x1: x + 3, x2: x + 4, y1: y + 3, y2: y + 4, topology: u.topology, directions: u.directions,
-          fineCells: u.carriageCells.filter(c => { const [cx, cy] = xy(c); return cx >= x + 3 && cx <= x + 4 && cy >= y + 3 && cy <= y + 4; })};
+        const scale = state.worldPlan.roadGrid.scale, lo = Math.floor(scale / 2) - 1, x = p.coordinate.x * scale, y = p.coordinate.y * scale;
+        return {x1: x + lo, x2: x + lo + 1, y1: y + lo, y2: y + lo + 1, topology: u.topology, directions: u.directions,
+          fineCells: u.carriageCells.filter(c => { const [cx, cy] = xy(c); return cx >= x + lo && cx <= x + lo + 1 && cy >= y + lo && cy <= y + lo + 1; })};
       });
     const complete = spaces.map(u => ({id: u.id, parcelId: u.parcelId, topology: u.topology}));
     return {rectangles, junctions, completeRoadUnits: complete, roadSpaces: spaces};
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/scene.js r2/project/src/bc84/p1/scene.js
--- project/src/bc84/p1/scene.js	2026-11-10 11:16:04.256217262 +0800
+++ r2/project/src/bc84/p1/scene.js	2026-11-10 14:54:29.474385684 +0800
@@ -53,7 +53,7 @@
 export function buildingBlocks(s){return Object.values(s.buildings).filter(b=>b.active).map(b=>{
  const coords=b.cells.map(c=>c.split(',').map(Number)),minx=Math.min(...coords.map(a=>a[0])),maxx=Math.max(...coords.map(a=>a[0])),miny=Math.min(...coords.map(a=>a[1])),maxy=Math.max(...coords.map(a=>a[1]));
  const p=s.worldPlan.parcels.find(x=>x.id===b.parcelId),isCore=p.id===s.worldPlan.boundary.entry&&b.id.endsWith(':a'),cellScale=s.worldPlan.roadGrid.scale;
- return {id:b.id,kind:isCore?'civic':b.category==='green'?'park':b.category==='commercial'?'commercial':'residential',x:((minx+maxx+1)/2)*FINE_WORLD_UNIT,z:((miny+maxy+1)/2)*FINE_WORLD_UNIT,w:(maxx-minx+1)*FINE_WORLD_UNIT,d:(maxy-miny+1)*FINE_WORLD_UNIT,tier:isCore?2:/** @type {import('../../render/city/layout').Tier} */(Math.min(4,(stableHash(s.worldPlan.seed+':massing:'+b.id)%4===0?2:stableHash(b.id)%2)+b.visualTier)),variant:(stableHash(b.id+':'+b.skin+':'+b.modelVariant)%3),rot:b.orientation*Math.PI/180,row:p.coordinate.y*cellScale+miny%cellScale,col:p.coordinate.x*cellScale+minx%cellScale};
+ return {id:b.id,kind:isCore?'civic':b.category==='green'?'park':b.category==='commercial'?'commercial':'residential',x:(s.worldPlan.worldProfileId===P5_WORLD_PROFILE?p.coordinate.x*cellScale+cellScale/2:(minx+maxx+1)/2)*FINE_WORLD_UNIT,z:(s.worldPlan.worldProfileId===P5_WORLD_PROFILE?p.coordinate.y*cellScale+cellScale/2:(miny+maxy+1)/2)*FINE_WORLD_UNIT,w:(maxx-minx+1)*FINE_WORLD_UNIT,d:(maxy-miny+1)*FINE_WORLD_UNIT,tier:isCore?2:/** @type {import('../../render/city/layout').Tier} */(Math.min(4,(stableHash(s.worldPlan.seed+':massing:'+b.id)%4===0?2:stableHash(b.id)%2)+b.visualTier)),variant:(stableHash(b.id+':'+b.skin+':'+b.modelVariant)%3),rot:b.orientation*Math.PI/180,row:p.coordinate.y*cellScale+miny%cellScale,col:p.coordinate.x*cellScale+minx%cellScale};
  });}
 function skinAccents(s){const group=new THREE.Group();group.name='individual-VisualBuilding-skin';const parts=[];
  for(const b of Object.values(s.buildings).filter(x=>x.active)){
@@ -76,17 +76,46 @@
  const slabEdgeGeo=new THREE.EdgesGeometry(slabGeo);
  const slabMat=new THREE.MeshStandardMaterial({color:0x9fd6dc,transparent:true,opacity:.30,roughness:1,depthWrite:false});
  const slabEdgeMat=new THREE.LineBasicMaterial({color:0x56b7c4,transparent:true,opacity:.65});
+ // R2 candidate affordance: a bright survey stake on the OWNED cell's south-east corner
+ // (the camera side in the default oblique view). It never stands on unowned ground and
+ // never covers a building. One stake per owned cell keeps the pick proxy unambiguous;
+ // the full purchase list remains canonical for every candidate.
+ const stakeMat=new THREE.MeshStandardMaterial({color:0xff2f8e,emissive:0x5a002a,emissiveIntensity:1.0,roughness:.42});
+ const stakeDiamondMat=new THREE.MeshStandardMaterial({color:0xf7ffff,emissive:0x2a5a66,emissiveIntensity:.55,roughness:.35});
+ const stakeRingGeo=new THREE.TorusGeometry(.16,.018,8,18);
+ const stakePostGeo=new THREE.CylinderGeometry(.024,.034,1.32,5);
+ const stakeTipGeo=new THREE.OctahedronGeometry(.13,0);
+ const stakeTargetGeo=new THREE.BoxGeometry(.30,1.50,.30);
+ const stakedOwned=new Set();
+ function candidateStake(p,ownedNeighbor){
+  // Direction from the owned cell q toward the candidate p, used only for the flag.
+  const [dx,dy]=[p.coordinate.x-ownedNeighbor.coordinate.x,p.coordinate.y-ownedNeighbor.coordinate.y];
+  const inset=unit*.04;
+  const g=new THREE.Group();g.name=`candidate-survey-stake:${p.id}`;
+  g.position.set((ownedNeighbor.coordinate.x+1)*unit-inset,0,(ownedNeighbor.coordinate.y+1)*unit-inset);
+  const ring=new THREE.Mesh(stakeRingGeo,stakeMat);ring.rotation.x=Math.PI/2;ring.position.y=.028;g.add(ring);
+  const post=new THREE.Mesh(stakePostGeo,stakeMat);post.position.y=.66;g.add(post);
+  const tip=new THREE.Mesh(stakeTipGeo,stakeDiamondMat);tip.position.y=1.38;g.add(tip);
+  const hit=new THREE.Mesh(stakeTargetGeo,pickMaterial);hit.position.y=.75;hit.name=`pick.candidate.${p.id}`;hit.userData={kind:'candidate',parcelId:p.id};g.add(hit);
+  return {group:g,hit};
+ }
  for(const p of s.worldPlan.parcels){if(s.owned.includes(p.id)){
   const m=new THREE.Mesh(new THREE.BoxGeometry(unit,.015,unit),pickMaterial);
   m.position.set((p.coordinate.x+.5)*unit,.095,(p.coordinate.y+.5)*unit);
   m.userData={kind:'parcel',parcelId:p.id,owned:true};m.name=`pick.${p.id}`;group.add(m);pickables.push(m);
   continue;
  }
- const p5=s.worldPlan.worldProfileId?.endsWith('-v5');
- // 050: do not draw any 3D marker on an unowned cell. A full-cell pad or an edge beacon
- // would either fake terrain or be occluded/mispicked; the purchase list is the canonical
- // candidate affordance and every listed cell still has a full orthogonal buildable edge.
- if(p5)continue;
+ const p5=s.worldPlan.worldProfileId?.endsWith('-v6');
+ // 050 R1 deleted every 3D hint; R2 keeps the explicit purchase list AND restores a
+ // grounded owned-side survey stake. No marker is drawn on unowned sky/land.
+ if(p5){
+  const ownedNeighbor=p.entryEdges.map(id=>s.worldPlan.parcels.find(q=>q.id===id)).find(q=>q&&s.owned.includes(q.id));
+  if(ownedNeighbor&&!stakedOwned.has(ownedNeighbor.id)){
+   stakedOwned.add(ownedNeighbor.id);
+   const stake=candidateStake(p,ownedNeighbor);group.add(stake.group);targets.push(stake.hit);targetById.set(p.id,{marker:stake.group,hit:stake.hit,baseY:0});
+  }
+  continue;
+ }
  if(p.role==='road'||!candidates(s).some(q=>q.id===p.id))continue;
  const x=(p.coordinate.x+.5)*unit,z=(p.coordinate.y+.5)*unit;
  const marker=new THREE.Group();marker.name=`planning-pad:${p.id}`;marker.position.set(x,0,z);
@@ -106,9 +135,9 @@
  const roadPreview=new THREE.Mesh(new THREE.PlaneGeometry(unit,unit),new THREE.MeshBasicMaterial({color:0xf5af58,transparent:true,opacity:.53,side:THREE.DoubleSide,depthWrite:false}));
  roadPreview.rotation.x=-Math.PI/2;roadPreview.position.y=.16;roadPreview.visible=false;roadPreview.name='uncommitted-whole-parcel-road-spatial-preview';group.add(roadPreview);
  return {group,pickables,targets,targetById,
- setSelected(id){for(const [parcelId,target] of targetById){if(target.ghost)target.ghost.material=parcelId===id?selectedMat:ghostMat;target.plus.position.y=(target.baseY??.40)+(parcelId===id?.15:0);}},
+ setSelected(id){for(const [parcelId,target] of targetById){if(target.ghost)target.ghost.material=parcelId===id?selectedMat:ghostMat;if(target.plus)target.plus.position.y=(target.baseY??.40)+(parcelId===id?.15:0);if(target.marker&&target.hit)target.marker.scale.setScalar(parcelId===id?1.12:1);}},
  setRoadPreview(id){const p=s.worldPlan.parcels.find(q=>q.id===id&&s.owned.includes(q.id));roadPreview.visible=!!p;if(p)roadPreview.position.set((p.coordinate.x+.5)*unit,.16,(p.coordinate.y+.5)*unit);},
- dispose(){for(const m of pickables)m.geometry.dispose();for(const m of targets)m.geometry.dispose();for(const item of targetById.values())for(const o of item.plus.children)o.geometry.dispose();edgeGeo.dispose();ghostGeo.dispose();slabGeo.dispose();slabEdgeGeo.dispose();roadPreview.geometry.dispose();roadPreview.material.dispose();selectedMat.dispose();ghostMat.dispose();slabMat.dispose();slabEdgeMat.dispose();pickMaterial.dispose();borderMat.dispose();}
+ dispose(){for(const m of pickables)m.geometry.dispose();for(const m of targets)m.geometry.dispose();for(const item of targetById.values())for(const o of item.plus?.children??[])o.geometry.dispose();stakeRingGeo.dispose();stakePostGeo.dispose();stakeTipGeo.dispose();stakeTargetGeo.dispose();stakeMat.dispose();stakeDiamondMat.dispose();edgeGeo.dispose();ghostGeo.dispose();slabGeo.dispose();slabEdgeGeo.dispose();roadPreview.geometry.dispose();roadPreview.material.dispose();selectedMat.dispose();ghostMat.dispose();slabMat.dispose();slabEdgeMat.dispose();pickMaterial.dispose();borderMat.dispose();}
  };}
 function currentIslandFramingBounds(s, visualBounds){const unit=cellWorldUnit(s.worldPlan),p5=s.worldPlan.worldProfileId===P5_WORLD_PROFILE;
  const owned=s.worldPlan.parcels.filter(p=>p5?s.terrainSupport.includes(p.cell):s.owned.includes(p.id));if(!owned.length)return visualBounds.clone();
@@ -119,12 +148,14 @@
 function renderStats(root){let triangles=0,calls=0;const materials=new Set();root.traverse(o=>{const m=/** @type {THREE.InstancedMesh} */(o);if(!m.isMesh||!m.visible)return;const mats=Array.isArray(m.material)?m.material:[m.material];if(mats.every(x=>!x.visible))return;calls+=mats.filter(x=>x.visible).length;for(const mat of mats)if(mat.visible)materials.add(mat);triangles+=(m.geometry.index?m.geometry.index.count:m.geometry.getAttribute('position').count)/3*(m.isInstancedMesh?m.count:1);});return {triangles,drawCalls:calls,materials:materials.size};}
 export function createCityProjection(s,{shadows=false,failAt=null}={}){
  const cleanup=[];try{
- if(![8,16].includes(s.worldPlan.roadGrid.scale))throw Error('unsupported P1 grid scale; 050 uses 8, legacy P1/P3/P4 use 16');
+ if(![7,16].includes(s.worldPlan.roadGrid.scale))throw Error('unsupported P1 grid scale; 050 r2 uses 7, legacy P1/P3/P4 use 16');
  const t0=performance.now(),view=derivedView(s);const root=new THREE.Group();root.name='DDZ-BC84-P1';
  const island=terrainMesh(s);cleanup.push(()=>{island.geometry.dispose();island.material.dispose()});root.add(island);if(failAt==='terrain')throw Error('injected terrain build failure');
  const roads=roadSegments(s);cleanup.push(()=>roads.dispose());root.add(roads.group);
  const blocks=buildingBlocks(s);
- const city=buildCity({blocks,skinByBuilding:Object.fromEntries(Object.values(s.buildings).filter(b=>b.active).map(b=>[b.id,b.skin])),style:'B',seed:stableHash(s.worldPlan.seed+':decor'),traffic:0,ped:0,hallTier:2,shadows,ground:false,roadsFromHost:true,individualBuildings:['island-orthogonal-p1-roadspace-v4',P5_WORLD_PROFILE].includes(s.worldPlan.worldProfileId)});cleanup.push(()=>city.dispose());root.add(city.root);if(failAt==='city')throw Error('injected city build failure');
+ const city=buildCity({blocks,skinByBuilding:Object.fromEntries(Object.values(s.buildings).filter(b=>b.active).map(b=>[b.id,b.skin])),style:'B',seed:stableHash(s.worldPlan.seed+':decor'),traffic:0,ped:0,hallTier:2,shadows,ground:false,roadsFromHost:true,individualBuildings:['island-orthogonal-p1-roadspace-v4',P5_WORLD_PROFILE].includes(s.worldPlan.worldProfileId),individualMaxScale:s.worldPlan.worldProfileId===P5_WORLD_PROFILE?2:1});cleanup.push(()=>city.dispose());root.add(city.root);if(failAt==='city')throw Error('injected city build failure');
+ const envelopes=city.pickables.map(p=>p.object.userData?.realizedEnvelope).filter(e=>e&&Number.isFinite(e.w)&&Number.isFinite(e.d));
+ const buildingBounds=envelopes.length?{count:envelopes.length,minWidth:Math.min(...envelopes.map(e=>e.w)),maxWidth:Math.max(...envelopes.map(e=>e.w)),minDepth:Math.min(...envelopes.map(e=>e.d)),maxDepth:Math.max(...envelopes.map(e=>e.d)),maxHeight:Math.max(...envelopes.map(e=>e.h))}:null;
  // S40 pickable building proxies retain canonical VisualBuilding.id.
  const selector=selectorMeshes(s);cleanup.push(()=>selector.dispose());root.add(selector.group);const accents=skinAccents(s);cleanup.push(()=>accents.dispose());root.add(accents.group);const streetscape=buildStreetscape(s);cleanup.push(()=>streetscape.dispose());root.add(streetscape.group);
  const byId=new Map(city.pickables.map(p=>[p.blockId,p.object]));
@@ -134,7 +165,7 @@
  const buildMs=performance.now()-t0;
  let disposed=false;
  return {root,city,island,roads,selector,candidatePickables:selector.targets,roadSpacePickables:roads.roadSpacePickables,streetscape,bounds,framingBounds,buildingPickables:[...byId.values()],topology:topo,buildMs,
-  stats:{profile:s.worldPlan.worldProfileId,buildingCount:blocks.length,parcelCount:s.owned.length,buildingCells:s.worldPlan.parcels.filter(p=>p.role!=='road').length,ownedCells:s.owned.length,roadCellCount:s.worldPlan.parcels.filter(p=>p.role==='road').length,candidateTargets:selector.targets.length,candidateList:candidates(s).length,roadCells:s.roads.present.length,roadSpaces:roads.visualPlan.roadSpaces.length,sidewalkCells:roads.visualPlan.roadSpaces.reduce((n,u)=>n+u.sidewalkCells.length,0),contentUnits:city.stats.units,...renderStats(root),buildMs,placeholders:city.stats.placeholders},
+  stats:{profile:s.worldPlan.worldProfileId,buildingCount:blocks.length,parcelCount:s.owned.length,buildingCells:s.worldPlan.parcels.filter(p=>p.role!=='road').length,ownedCells:s.owned.length,roadCellCount:s.worldPlan.parcels.filter(p=>p.role==='road').length,candidateTargets:selector.targets.length,candidateList:candidates(s).length,roadCells:s.roads.present.length,roadSpaces:roads.visualPlan.roadSpaces.length,sidewalkCells:roads.visualPlan.roadSpaces.reduce((n,u)=>n+u.sidewalkCells.length,0),contentUnits:city.stats.units,buildingBounds,...renderStats(root),buildMs,placeholders:city.stats.placeholders},
   dispose(){if(disposed)return;disposed=true;for(const release of cleanup.reverse())release();root.removeFromParent();}
  };
  }catch(e){for(const release of cleanup.reverse())release();throw e;}
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/streetscape.js r2/project/src/bc84/p1/streetscape.js
--- project/src/bc84/p1/streetscape.js	2026-11-10 10:30:14.337324783 +0800
+++ r2/project/src/bc84/p1/streetscape.js	2026-11-10 14:06:22.094002011 +0800
@@ -4,22 +4,22 @@
 // Pure visual details. Every moving segment comes from committed RoadState.
 export function buildStreetscape(s){const group=new THREE.Group(),resources=[],owned=new Set(s.owned),roadSet=new Set(s.roads.present),taken=new Set(Object.values(s.buildings).filter(b=>b.active).flatMap(b=>b.cells));group.name='courtyards-plaza-and-legal-road-life';
  const make=(geo,color,count,name)=>{const mat=new THREE.MeshStandardMaterial({color,roughness:.88}),m=new THREE.InstancedMesh(geo,mat,count);m.name=name;group.add(m);resources.push(geo,mat);return m;};
- const isP5=s.worldPlan.worldProfileId.endsWith('-v5'),isCompact=s.worldPlan.worldProfileId.endsWith('-v3')||s.worldPlan.worldProfileId.endsWith('-v4'),scale=s.worldPlan.roadGrid.scale;
+ const isP5=s.worldPlan.worldProfileId.endsWith('-v6'),isCompact=s.worldPlan.worldProfileId.endsWith('-v3')||s.worldPlan.worldProfileId.endsWith('-v4'),scale=s.worldPlan.roadGrid.scale;
  const points=[];
  if(isP5){
   // Trees live on the paved sidewalk of open road cells, never inside a building cell.
   for(const p of s.worldPlan.parcels.filter(p=>p.role==='road'&&s.terrainSupport.includes(p.cell))){
    const walk=s.worldPlan.publicPlan.sidewalkByRoadCell[p.id]||[];
    // One street-tree cluster on the sidewalk edge, not an orchard on both sides of every road.
-   for(const [u,v] of [[5,2]]){const c=`${p.coordinate.x*scale+u},${p.coordinate.y*scale+v}`;if(walk.includes(c)&&!roadSet.has(c)&&!taken.has(c))points.push({x:(p.coordinate.x*scale+u+.5)*FINE_WORLD_UNIT,z:(p.coordinate.y*scale+v+.5)*FINE_WORLD_UNIT,core:false});}
+   for(const [u,v] of [[scale-3,2]]){const c=`${p.coordinate.x*scale+u},${p.coordinate.y*scale+v}`;if(walk.includes(c)&&!roadSet.has(c)&&!taken.has(c))points.push({x:(p.coordinate.x*scale+u+.5)*FINE_WORLD_UNIT,z:(p.coordinate.y*scale+v+.5)*FINE_WORLD_UNIT,core:false});}
   }
   // A green cell is a complete small landscape, not a single tiny object on a lawn:
   // paved park apron + a corner tree group fill the one-building-cell footprint.
   const parkLots=[];
   for(const b of Object.values(s.buildings).filter(b=>b.active&&b.category==='green')){
    const p=s.worldPlan.parcels.find(q=>q.id===b.parcelId);if(!p)continue;
-   parkLots.push({x:(p.coordinate.x*scale+4)*FINE_WORLD_UNIT,z:(p.coordinate.y*scale+4)*FINE_WORLD_UNIT});
-   points.push({x:(p.coordinate.x*scale+.5)*FINE_WORLD_UNIT,z:(p.coordinate.y*scale+7.5)*FINE_WORLD_UNIT,core:false});
+   parkLots.push({x:(p.coordinate.x*scale+scale/2)*FINE_WORLD_UNIT,z:(p.coordinate.y*scale+scale/2)*FINE_WORLD_UNIT});
+   points.push({x:(p.coordinate.x*scale+.5)*FINE_WORLD_UNIT,z:(p.coordinate.y*scale+scale-1.5)*FINE_WORLD_UNIT,core:false});
   }
   if(parkLots.length){const apron=make(new THREE.BoxGeometry(6*FINE_WORLD_UNIT,.035,6*FINE_WORLD_UNIT),0xc9c3a5,parkLots.length,'park-cell-apron');const pm=new THREE.Object3D();parkLots.forEach((q,i)=>{pm.position.set(q.x,.018,q.z);pm.updateMatrix();apron.setMatrixAt(i,pm.matrix);});}
  }else{for(const p of s.worldPlan.parcels.filter(p=>owned.has(p.id))){for(const [u,v]of (s.worldPlan.worldProfileId.endsWith('-v4')?[]:isCompact?[[0,0],[15,15]]:[[12,4],[4,12]])){const gx=p.coordinate.x*16+u,gz=p.coordinate.y*16+v;if(!isCompact&&!roadSet.has(`${gx},${gz}`)&&!taken.has(`${gx},${gz}`))points.push({x:(gx+.5)*FINE_WORLD_UNIT,z:(gz+.5)*FINE_WORLD_UNIT,core:p.id===s.worldPlan.boundary.entry&&u===12});}}}
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/bc84/p1/world.mjs r2/project/src/bc84/p1/world.mjs
--- project/src/bc84/p1/world.mjs	2026-11-10 09:39:58.411558420 +0800
+++ r2/project/src/bc84/p1/world.mjs	2026-11-10 14:14:54.387072275 +0800
@@ -50,10 +50,11 @@
 export function roadMask(s,cell){if(!s.roads.present.includes(cell))return 0;const a=roadEdges(s,cell),[x,y]=cell.split(',').map(Number);return (a.includes(`${x},${y-1}`)?1:0)|(a.includes(`${x+1},${y}`)?2:0)|(a.includes(`${x},${y+1}`)?4:0)|(a.includes(`${x-1},${y}`)?8:0);}
 export function buildingSpecs(parcel){if(parcel.profile5===true||parcel.layoutScale===P5_FINE_SCALE){
   if(parcel.role==='road')return [];
-  // One native-scale S40 unit per building cell; no multi-building template and no
-  // per-parcel road corridor.  The 6x6 footprint inside the 8x8 cell is 75% of the
-  // cell and leaves a one-cell yard/setback on every side.
-  return [{id:`p1:building:${parcel.id}:a`,footprint:{x:1,y:1,width:6,height:6},orientation:0}];}
+  // R2: one native S40 unit per building cell; no multi-building template and no
+  // per-parcel road corridor.  A 6x6 footprint at the cell edge is 86% of the 7x7
+  // cell; the renderer centers the uniformly fitted content, leaving a 0.3 setback
+  // (not the old 0.6).  The independent road cell remains completely separate.
+  return [{id:`p1:building:${parcel.id}:a`,footprint:{x:0,y:0,width:6,height:6},orientation:0}];}
  if(parcel.layoutScale===16 && parcel.profile4===true){return roadspaceSpecs(parcel);}
  if(parcel.layoutScale===16 && parcel.block!==undefined && parcel.profile3===true){return compactSpecs(parcel);}
  return [
@@ -85,8 +86,8 @@
 export function previewWholeParcelRoad(s,parcelId){
  const parcel=s.worldPlan.parcels.find(p=>p.id===parcelId);
  if(!parcel||!s.owned.includes(parcelId))return {status:'not-owned'};
- if(parcel.profile5||s.worldPlan.worldProfileId===P5_WORLD_PROFILE)return {status:'not-applicable',mode:'orthogonal-road-cells-v5',
-  reason:'050 的每个格子要么是完整公共道路格，要么是一格一栋建筑；不存在整地改道路预览。'};
+ if(parcel.profile5||s.worldPlan.worldProfileId===P5_WORLD_PROFILE)return {status:'not-applicable',mode:'orthogonal-road-cells-v6',
+  reason:'050 r2 的每个格子要么是完整公共道路格，要么是一格一栋建筑；不存在整地改道路预览。'};
  const scale=s.worldPlan.roadGrid.scale,[px,py]=parcel.cell.split(',').map(Number);
  if(!parcel.profile4){
  // Spatial-only candidate: widen the already-planned public corridors into a legible complete-road unit.
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/src/render/city/city-contract.ts r2/project/src/render/city/city-contract.ts
--- project/src/render/city/city-contract.ts	2026-11-08 14:26:27.000000000 +0800
+++ r2/project/src/render/city/city-contract.ts	2026-11-10 14:54:29.474179017 +0800
@@ -151,6 +151,10 @@
   readonly individualBuildings?: boolean;
   /** P4: canonical VisualBuildingId -> skin, tinted per native unit before merging. */
   readonly skinByBuilding?: Readonly<Record<string, string>>;
+  /** R2/050: allow a UNIFORM upscale of one native S40 unit up to this factor so a
+   * smaller independent cell can be filled without stretching or duplicating it.
+   * Default 1 preserves every legacy caller byte-for-byte. */
+  readonly individualMaxScale?: number;
 }
 
 /** 车/人/道具的实例数明细（HUD / 测试用；读的是当前生效的对象）。 */
@@ -640,6 +644,8 @@
       : {placements: [{x: blk.x, z: blk.z, row: blk.row, col: blk.col}], w: unit.footprint.w, d: unit.footprint.d, parts: 1};
     let maxH = 0;
     let mergedParts = 0;
+    let realizedW = 0;
+    let realizedD = 0;
     for (let i = 0; i < compound.placements.length; i++) {
       const placement = compound.placements[i];
       const part = i === 0 ? unit : buildUnitFor(cls, {...opts, x: placement.x, z: placement.z, row: placement.row, col: placement.col});
@@ -652,15 +658,21 @@
       part.group.position.x = placement.x;
       part.group.position.z = placement.z;
       part.group.rotation.y = blk.rot;
-      // Preserve proportions and the S40 native generator. Smaller independently
-      // owned 4x4 fine-grid footprints may require a UNIFORM fit, not a stretched
-      // mesh or multiple complete buildings under one owner. Car/ped geometry is unchanged.
+      // Preserve proportions and the S40 native generator. A smaller independent cell
+      // uses one UNIFORM fit (never a stretched mesh or multiple complete buildings).
+      // R2 permits a bounded upscale to fill the real 3.0 footprint; legacy callers
+      // default to maxScale=1, so R1/048 output remains unchanged.
+      const fit = Math.min(
+        Math.max(0.01, (blk.w - 0.12) / part.footprint.w),
+        Math.max(0.01, (blk.d - 0.12) / part.footprint.d),
+      );
       const unitScale = ctx.individualBuildings === true
-        ? Math.min(1, Math.max(0.01, (blk.w - 0.12) / part.footprint.w),
-                        Math.max(0.01, (blk.d - 0.12) / part.footprint.d))
+        ? Math.min(ctx.individualMaxScale ?? 1, Math.max(0.01, fit))
         : 1;
       part.group.scale.setScalar(unitScale);
       maxH = Math.max(maxH, part.footprint.h * unitScale);
+      realizedW = Math.max(realizedW, part.footprint.w * unitScale);
+      realizedD = Math.max(realizedD, part.footprint.d * unitScale);
       byKind[cls] = (byKind[cls] ?? 0) + mergeUnit(solid, glow, part, mats.glow, ctx.skinByBuilding?.[blk.id]);
       if (cls === 'civic' && !hall) hall = part.group;
       estTri += part.stats.triangles;
@@ -673,7 +685,10 @@
       continue;
     }
     unitHeights.set(blk.id, maxH);
-    hostEnvelopes.set(blk.id, {w: compound.w, d: compound.d, h: maxH, parts: mergedParts});
+    // Report the actual post-scale world envelope, not the legal slot or native footprint.
+    hostEnvelopes.set(blk.id, ctx.individualBuildings === true
+      ? {w: realizedW, d: realizedD, h: maxH, parts: mergedParts}
+      : {w: compound.w, d: compound.d, h: maxH, parts: mergedParts});
   }
 
   /* ---------- 3. 合并成大网格 ---------- */
@@ -764,8 +779,13 @@
     const proxy = new THREE.Mesh(hitGeo, hitMat);
     proxy.name = `city.pick.${blk.id}`;
     proxy.position.set(blk.x, SIDEWALK_Y + h / 2, blk.z);
-    proxy.scale.set(Math.max(0.6, blk.w - 0.3), h, Math.max(0.6, blk.d - 0.3));
     const realized = hostEnvelopes.get(blk.id);
+    // R2: the visible content can be wider than the old blk-0.3 legal proxy (3.3 vs 3.4-3.48).
+    // Make the tap proxy match the actual post-fit envelope; R1 has no individualMaxScale and
+    // its realized width still mirrors its native content, so its project copy is unaffected.
+    const proxyW = Math.max(0.6, realized?.w ?? (blk.w - 0.3));
+    const proxyD = Math.max(0.6, realized?.d ?? (blk.d - 0.3));
+    proxy.scale.set(proxyW, h, proxyD);
     proxy.userData = {
       blockId: blk.id,
       pickable: true,
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/test/bc84/p1/050-orthogonal-cells.test.mjs r2/project/test/bc84/p1/050-orthogonal-cells.test.mjs
--- project/test/bc84/p1/050-orthogonal-cells.test.mjs	2026-11-10 11:10:57.255598389 +0800
+++ r2/project/test/bc84/p1/050-orthogonal-cells.test.mjs	2026-11-10 14:22:15.810552283 +0800
@@ -31,7 +31,7 @@
 };
 const oneActive = (s, parcelId) => Object.values(s.buildings).filter(b => b.parcelId === parcelId && b.active);
 
-test('050 planning: road cells and building cells are disjoint; one 6x6 building minispec per building cell', () => {
+test('050 planning: road cells and building cells are disjoint; one 6x6-edge building minispec per building cell', () => {
   const p = p128();
   assert.equal(p.worldProfileId, ROADCELL_WORLD_PROFILE);
   assert.equal(p.roadGrid.scale, ROADCELL_SCALE);
@@ -43,17 +43,17 @@
   const building = p.parcels.find(x => x.role === 'building');
   assert.equal(road.category, null);
   assert.equal(building.category, 'residential');
-  assert.equal(building.layoutScale, 8, '050 cell is 8 fine cells / 4.8 world units');
+  assert.equal(building.layoutScale, 7, '050 r2 cell is 7 fine cells / 4.2 world units');
   assert.equal(new Set(p.parcels.map(x => x.id)).size, 128);
   assert.equal(new Set(p.parcels.map(x => x.cell)).size, 128);
   for (const b of p.parcels.filter(x => x.role === 'building')) {
     const specs = buildingSpecs(b);
     assert.equal(specs.length, 1, `${b.id} must expose exactly one main building`);
-    assert.deepEqual(specs[0].footprint, { x: 1, y: 1, width: 6, height: 6 });
+    assert.deepEqual(specs[0].footprint, { x: 0, y: 0, width: 6, height: 6 });
     assert.equal(specs[0].id, `p1:building:${b.id}:a`);
   }
   assert.deepEqual(buildingSpecs(road), []);
-  assert.equal(p.publicPlan.version, 'public-support-orthogonal-roadcells-v5');
+  assert.equal(p.publicPlan.version, 'public-support-orthogonal-roadcells-v6');
   assert.equal(p.publicPlan.carriageByRoadCell[road.id].length >= 16, true);
   assert.equal(p.roadGrid.defaultByParcel[road.id].length, p.publicPlan.carriageByRoadCell[road.id].length);
   assert.equal(new Set(p.publicPlan.roadCellIds).size, 56);
@@ -76,7 +76,7 @@
   // Every carriage cell is inside a road parcel; no building parcel has a default road.
   const ownerOfFine = (cell) => {
     const [x, y] = cell.split(',').map(Number);
-    return p.parcels.find(q => x >= q.coordinate.x * 8 && x < q.coordinate.x * 8 + 8 && y >= q.coordinate.y * 8 && y < q.coordinate.y * 8 + 8);
+    return p.parcels.find(q => x >= q.coordinate.x * 7 && x < q.coordinate.x * 7 + 8 && y >= q.coordinate.y * 7 && y < q.coordinate.y * 7 + 8);
   };
   for (const cell of s.publicSupport) {
     const q = ownerOfFine(cell);
@@ -146,11 +146,11 @@
     assert.equal(oneActive(st, target.id).length, 1, 'exactly one active main building in a building cell');
     const b = oneActive(st, target.id)[0];
     assert.equal(b.cells.length, 36);
-    assert.deepEqual(b.footprint, { x: 1, y: 1, width: 6, height: 6 });
+    assert.deepEqual(b.footprint, { x: 0, y: 0, width: 6, height: 6 });
     const q0 = st.worldPlan.parcels.find(x => x.id === target.id);
     assert.equal(st.terrainSupport.includes(q0.cell), true);
     assert.equal(st.roads.present.some(c => b.cells.includes(c)), false, 'building never contains road cells');
-    assert.equal(st.roads.present.every(c => { const [x, y] = c.split(',').map(Number); return st.worldPlan.parcels.some(q => q.role === 'road' && x >= q.coordinate.x * 8 && x < q.coordinate.x * 8 + 8 && y >= q.coordinate.y * 8 && y < q.coordinate.y * 8 + 8); }), true);
+    assert.equal(st.roads.present.every(c => { const [x, y] = c.split(',').map(Number); return st.worldPlan.parcels.some(q => q.role === 'road' && x >= q.coordinate.x * 7 && x < q.coordinate.x * 7 + 8 && y >= q.coordinate.y * 7 && y < q.coordinate.y * 7 + 8); }), true);
     assert.equal(JSON.stringify(st.buildings[b.id].footprint), JSON.stringify(b.footprint));
 
     const cat = effectiveCategory(st, q0);
@@ -204,7 +204,7 @@
     const opened = env.session.coordinator.initializeRoads(p5OpenRoadIds(st0.worldPlan, st0.owned));
     assert.equal(opened.status, 'committed');
     const building = st0.worldPlan.parcels.find(x => x.role === 'building' && st0.owned.includes(x.id));
-    const fine = `${building.coordinate.x * 8 + 2},${building.coordinate.y * 8 + 2}`;
+    const fine = `${building.coordinate.x * 7 + 2},${building.coordinate.y * 7 + 2}`;
     assert.equal(env.session.quote({ kind: 'road-place', cell: fine }).status, 'rejected');
     assert.equal(env.session.quote({ kind: 'road-delete', cell: fine }).status, 'rejected');
 
@@ -270,7 +270,7 @@
   const s = createP5State('namespace', 128, 0, P1_GROWTH_CONFIG);
   assert.match(s.worldManifest.worldId, /^p5:/);
   assert.equal(s.worldManifest.worldProfileId, ROADCELL_WORLD_PROFILE);
-  assert.equal(s.worldPlan.planningProfileVersion, 'p1-world-orthogonal-roadcells-5');
+  assert.equal(s.worldPlan.planningProfileVersion, 'p1-world-orthogonal-roadcells-6');
   assert.equal(s.worldPlan.worldProfileId, ROADCELL_WORLD_PROFILE);
   const p = s.worldPlan;
   for (const b of p.parcels.filter(x => x.role === 'building')) {
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/tools/bc84/p1/r2-acceptance.mjs r2/project/tools/bc84/p1/r2-acceptance.mjs
--- project/tools/bc84/p1/r2-acceptance.mjs	1970-01-01 08:00:00.000000000 +0800
+++ r2/project/tools/bc84/p1/r2-acceptance.mjs	2026-11-10 14:55:26.583905943 +0800
@@ -0,0 +1,323 @@
+// DDZ-BC84-050 r2 evidence: same-viewport/same-camera R1-vs-R2 initial/mid/full,
+// plus a real R2 buy -> upgrade -> conversion -> reload session and a full fixture.
+// This is a Web browser acceptance, NOT a WeChat real-device pass.
+import puppeteer from 'puppeteer-core';
+import fs from 'node:fs';
+import path from 'node:path';
+import crypto from 'node:crypto';
+import {fileURLToPath} from 'node:url';
+
+const PROJECT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..');
+const TASK = path.resolve(PROJECT, '..');
+function arg(name, fallback) {
+  const i = process.argv.indexOf('--' + name);
+  return i > 0 && process.argv[i + 1] ? process.argv[i + 1] : fallback;
+}
+const R1 = arg('r1', 'http://127.0.0.1:8069').replace(/\/+$/, '');
+const R2 = arg('r2', 'http://127.0.0.1:8070').replace(/\/+$/, '');
+const OUT = path.resolve(arg('out', path.join(TASK, 'evidence-r2')));
+const WIDTH = Number(arg('width', '1440')), HEIGHT = Number(arg('height', '900'));
+const MID_BUYS = Number(arg('mid-buys', '16'));
+fs.mkdirSync(OUT, {recursive: true});
+const stamp = new Date().toLocaleString('sv-SE', {timeZone: 'Asia/Shanghai', hour12: false}).replace(/[: ]/g, '-');
+const run = `050r2-${stamp}`;
+const logPath = path.join(OUT, `acceptance-${run}.log`);
+const lines = [];
+const log = (event, data = {}) => {
+  const row = {ts: new Date().toISOString(), event, ...data};
+  lines.push(JSON.stringify(row));
+  fs.writeFileSync(logPath, lines.join('\n') + '\n');
+  console.log(JSON.stringify(row));
+};
+const sleep = (ms) => new Promise(r => setTimeout(r, ms));
+const sha256 = (file) => crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');
+const CAM = {
+  initial: {theta: .78, phi: .98, radius: 52, target: [12, 2, 20]},
+  mid: {theta: .78, phi: 1.0, radius: 78, target: [18, 3, 17]},
+  full: {theta: .78, phi: 1.02, radius: 112, target: [36, 4, 18]},
+};
+const cameraPosition = (c) => [
+  c.target[0] + c.radius * Math.sin(c.phi) * Math.cos(c.theta),
+  c.target[1] + c.radius * Math.cos(c.phi),
+  c.target[2] + c.radius * Math.sin(c.phi) * Math.sin(c.theta),
+];
+
+const browser = await puppeteer.launch({
+  executablePath: '/usr/bin/chromium',
+  headless: true,
+  userDataDir: `/tmp/chrome-${run}`,
+  args: ['--no-sandbox', '--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'],
+});
+
+async function makePage(url) {
+  const page = await browser.newPage();
+  await page.setViewport({width: WIDTH, height: HEIGHT, deviceScaleFactor: 1});
+  const consoleLines = [];
+  page.on('console', m => { if (['error', 'warning'].includes(m.type())) consoleLines.push(`${m.type()}:${m.text()}`); });
+  page.on('pageerror', e => consoleLines.push(`pageerror:${e.message}`));
+  await page.goto(url, {waitUntil: 'domcontentloaded', timeout: 30000});
+  await page.waitForFunction(() => window.__P1_READY === true || window.__P1_ERROR, {timeout: 180000});
+  const error = await page.evaluate(() => window.__P1_ERROR || null);
+  if (error) throw new Error(`P1 boot error: ${error}`);
+  await page.waitForFunction(() => document.getElementById('boot')?.hidden === true, {timeout: 60000});
+  await sleep(900);
+  return {page, consoleLines};
+}
+async function state(page) { return page.evaluate(() => window.__P1.state); }
+async function stats(page) { return page.evaluate(() => window.__P1.projection()?.stats ?? null); }
+async function snap(page) { return page.evaluate(() => window.__P1.snapshot()); }
+async function idle(page) {
+  await page.waitForFunction(() => window.__P1 && window.__P1.phase === 'idle' && !window.__P1.busy && !window.__P1.pendingOp, {timeout: 120000});
+  await sleep(120);
+}
+async function hideChrome(page) {
+  await page.evaluate(() => {
+    const d = document.getElementById('dev'); if (d) d.hidden = true;
+    const t = document.getElementById('toast'); if (t) t.classList.remove('visible');
+  });
+}
+async function setCamera(page, cam) {
+  const pos = cameraPosition(cam);
+  await page.evaluate(({pos, target}) => {
+    const c = window.__P1.camera;
+    c.position.set(...pos);
+    c.lookAt(...target);
+    c.updateMatrixWorld(true);
+  }, {pos, target: cam.target});
+  await sleep(280);
+}
+async function shot(page, name, cam) {
+  await setCamera(page, cam);
+  const file = path.join(OUT, `${name}-${WIDTH}x${HEIGHT}.png`);
+  await page.screenshot({path: file});
+  const pose = await page.evaluate(() => {
+    const c = window.__P1.camera;
+    const dir = c.getWorldDirection(new c.position.constructor());
+    return {pos: c.position.toArray(), dir: dir.toArray(), quat: c.quaternion.toArray(), up: c.up.toArray(), rig: window.__P1.rig};
+  });
+  log('screenshot', {file, sha256: sha256(file), width: WIDTH, height: HEIGHT, camera: pose});
+  return file;
+}
+async function bestCandidateLabel(page) {
+  const rows = await page.$$eval('button.purchase-target:not(.owned)', els => els.map(e => e.textContent));
+  const s = await state(page);
+  const byId = new Map(s.worldPlan.parcels.map(p => [p.id, p]));
+  const owned = new Set(s.owned.map(id => { const p = byId.get(id); return `${p.coordinate.x},${p.coordinate.y}`; }));
+  const ownedCoords = [...owned].map(c => c.split(',').map(Number));
+  const score = (x, y) => {
+    let orth = 0, diag = 0, nearest = 999;
+    for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) if (owned.has(`${x + dx},${y + dy}`)) orth++;
+    for (const [dx, dy] of [[1, 1], [1, -1], [-1, 1], [-1, -1]]) if (owned.has(`${x + dx},${y + dy}`)) diag++;
+    for (const [ox, oy] of ownedCoords) nearest = Math.min(nearest, Math.abs(x - ox) + Math.abs(y - oy));
+    return orth * 1000 + diag * 100 - nearest;
+  };
+  let best = null;
+  for (const text of rows) {
+    const m = text.match(/\((\d+),(\d+)\)/);
+    if (!m) continue;
+    const x = Number(m[1]) - 1, y = Number(m[2]) - 1;
+    const v = score(x, y);
+    if (!best || v > best.v) best = {text, v};
+  }
+  return best?.text ?? null;
+}
+async function buyFirst(page) {
+  await idle(page).catch(() => {});
+  const before = await page.evaluate(() => ({
+    owned: window.__P1.state.owned.length,
+    buildings: Object.values(window.__P1.state.buildings).filter(b => b.active).length,
+  }));
+  const label = await bestCandidateLabel(page);
+  if (!label) return {status: 'no-candidate', before};
+  const clicked = await page.evaluate((text) => {
+    const btn = [...document.querySelectorAll('button.purchase-target:not(.owned)')].find(e => e.textContent === text);
+    if (!btn) return false;
+    btn.click();
+    return true;
+  }, label);
+  if (!clicked) return {status: 'candidate-detached', label, before};
+  await page.waitForFunction(() => {
+    const b = document.getElementById('confirm');
+    return b && !b.disabled && !b.textContent.includes('请选择');
+  }, {timeout: 20000});
+  const beforeClick = await page.evaluate(() => window.__P1.state.owned.length);
+  await page.click('#confirm');
+  await page.waitForFunction(n => window.__P1.state.owned.length > n, {timeout: 60000}, beforeClick);
+  await page.waitForFunction(n => Object.values(window.__P1.state.buildings).filter(b => b.active).length >= n, {timeout: 60000}, before.buildings + 1);
+  await idle(page);
+  return {status: 'bought', label, before, after: await page.evaluate(() => ({owned: window.__P1.state.owned.length, buildings: Object.values(window.__P1.state.buildings).filter(b => b.active).length, coins: window.__P1.state.balances.coins}))};
+}
+async function clickFirst(page, selector) {
+  const el = await page.$(selector);
+  if (!el) return null;
+  const text = await el.evaluate(e => e.textContent);
+  const disabled = await el.evaluate(e => !!e.disabled);
+  if (disabled) return {text, disabled: true};
+  await el.click();
+  return {text, disabled: false};
+}
+async function buyToMid(page) {
+  let bought = 0;
+  for (let i = 0; i < MID_BUYS; i++) {
+    const r = await buyFirst(page);
+    log('buy', {i, ...r});
+    if (r.status !== 'bought') break;
+    bought++;
+  }
+  await sleep(1800);
+  return bought;
+}
+async function metrics(page) {
+  const s = await state(page);
+  const p = await page.evaluate(() => {
+    const proj = window.__P1.projection();
+    const envs = (proj?.buildingPickables ?? []).map(o => o.userData?.realizedEnvelope).filter(e => e && Number.isFinite(e.w) && Number.isFinite(e.d));
+    return {stats: proj?.stats ?? null, envs, metrics: window.__P1.snapshot()?.metrics ?? null};
+  });
+  const envs = p.envs;
+  const bounds = envs.length ? {
+    count: envs.length,
+    minWidth: Math.min(...envs.map(e => e.w)), maxWidth: Math.max(...envs.map(e => e.w)),
+    minDepth: Math.min(...envs.map(e => e.d)), maxDepth: Math.max(...envs.map(e => e.d)),
+  } : null;
+  return {
+    owned: s.owned.length,
+    activeBuildings: Object.values(s.buildings).filter(b => b.active).length,
+    roadsPresent: s.roads.present.length,
+    checkpoint: s.checkpoint,
+    coins: s.balances.coins,
+    sharedU: {...s.sharedU},
+    worldProfileId: s.worldPlan.worldProfileId,
+    scale: s.worldPlan.roadGrid.scale,
+    cellCounts: {parcels: s.worldPlan.parcels.length, building: s.worldPlan.parcels.filter(q => q.role === 'building').length, road: s.worldPlan.parcels.filter(q => q.role === 'road').length},
+    renderedEnvelope: bounds,
+    stats: p.stats,
+    metrics: p.metrics,
+    candidateButtons: await page.$$eval('button.purchase-target:not(.owned)', els => els.length),
+  };
+}
+
+try {
+  const health1 = await (await fetch(`${R1}/__050_healthz`)).json();
+  const health2 = await (await fetch(`${R2}/__050r2_healthz`)).json();
+  const info2 = await (await fetch(`${R2}/__050r2_preview.json`)).json();
+  log('health', {r1: health1, r2: health2, r2Info: {task: info2.task, taskSha256: info2.taskSha256, port: info2.port, candidate: info2.candidate}});
+  if (health2.index !== health1.index) log('note', {message: 'R1/R2 index hashes differ (expected if R2 build changed only JS); same viewport/camera is still used'});
+
+  /* ---------- R2 primary real session: initial -> buys -> upgrade -> conversion -> reload ---------- */
+  const r2Seed = `${run}-r2-primary`;
+  const r2Page = await makePage(`${R2}/?dev&seed=${encodeURIComponent(r2Seed)}&size=128`);
+  await hideChrome(r2Page.page);
+  const r2Initial = await metrics(r2Page.page);
+  log('r2-initial', r2Initial);
+  await shot(r2Page.page, `r2-initial-${run}`, CAM.initial);
+
+  const r2Bought = await buyToMid(r2Page.page);
+  const r2Mid = await metrics(r2Page.page);
+  log('r2-mid', {bought: r2Bought, ...r2Mid});
+  await shot(r2Page.page, `r2-mid-${run}`, CAM.mid);
+
+  // Select an owned parcel and perform the real shared-U upgrade + user conversion.
+  const ownedBtn = await r2Page.page.$('button.purchase-target.owned');
+  if (ownedBtn) await ownedBtn.click();
+  await r2Page.page.waitForFunction(() => !document.getElementById('economy')?.hidden, {timeout: 20000}).catch(() => {});
+  await r2Page.page.waitForFunction(() => !window.__P1.busy, {timeout: 30000});
+  const beforeUpgrade = await r2Page.page.evaluate(() => ({...window.__P1.state.sharedU}));
+  const up = await clickFirst(r2Page.page, '#ecoUpgrade button');
+  let upgrade = {button: up, before: beforeUpgrade};
+  if (up && !up.disabled) {
+    await r2Page.page.waitForFunction(() => !document.getElementById('confirm')?.disabled, {timeout: 20000});
+    await r2Page.page.click('#confirm');
+    await idle(r2Page.page);
+    const after = await r2Page.page.evaluate(() => ({...window.__P1.state.sharedU}));
+    upgrade.after = after;
+    upgrade.checkpoint = (await state(r2Page.page)).checkpoint;
+    log('r2-upgrade', upgrade);
+    await sleep(800);
+    await shot(r2Page.page, `r2-upgraded-${run}`, CAM.mid);
+  } else log('r2-upgrade-skipped', upgrade);
+
+  const beforeConv = await r2Page.page.evaluate(() => ({...window.__P1.state.categoryOverrides}));
+  const conv = await clickFirst(r2Page.page, '#ecoConvert button:not([disabled])');
+  let conversion = {button: conv};
+  if (conv && !conv.disabled) {
+    await r2Page.page.waitForFunction(() => document.getElementById('confirm') && !document.getElementById('confirm').disabled, {timeout: 20000});
+    await r2Page.page.click('#confirm');
+    await r2Page.page.waitForFunction(before => Object.keys(window.__P1.state.categoryOverrides).length > Object.keys(before).length, {timeout: 60000}, beforeConv);
+    await idle(r2Page.page);
+    conversion.after = await r2Page.page.evaluate(() => ({...window.__P1.state.categoryOverrides}));
+    conversion.checkpoint = (await state(r2Page.page)).checkpoint;
+    log('r2-conversion', conversion);
+    await sleep(900);
+    await shot(r2Page.page, `r2-converted-${run}`, CAM.mid);
+  } else log('r2-conversion-skipped', conversion);
+
+  const beforeReload = await r2Page.page.evaluate(() => {
+    const s = window.__P1.state;
+    return {worldId: s.worldManifest.worldId, checkpoint: s.checkpoint, owned: s.owned.slice().sort(), sharedU: {...s.sharedU}, overrides: {...s.categoryOverrides},
+      buildings: Object.values(s.buildings).filter(b => b.active).map(b => ({id: b.id, parcelId: b.parcelId, skin: b.skin, category: b.category})).sort((a, b) => a.id.localeCompare(b.id))};
+  });
+  await r2Page.page.reload({waitUntil: 'domcontentloaded', timeout: 30000});
+  await r2Page.page.waitForFunction(() => window.__P1_READY === true || window.__P1_ERROR, {timeout: 180000});
+  await r2Page.page.waitForFunction(() => document.getElementById('boot')?.hidden === true, {timeout: 60000});
+  await sleep(1200);
+  const afterReload = await r2Page.page.evaluate(() => {
+    const s = window.__P1.state;
+    return {worldId: s.worldManifest.worldId, checkpoint: s.checkpoint, owned: s.owned.slice().sort(), sharedU: {...s.sharedU}, overrides: {...s.categoryOverrides},
+      buildings: Object.values(s.buildings).filter(b => b.active).map(b => ({id: b.id, parcelId: b.parcelId, skin: b.skin, category: b.category})).sort((a, b) => a.id.localeCompare(b.id))};
+  });
+  const core = x => JSON.stringify({worldId: x.worldId, owned: x.owned, sharedU: x.sharedU, overrides: x.overrides, buildings: x.buildings});
+  const same = core(beforeReload) === core(afterReload);
+  log('r2-reload', {same, checkpointBefore: beforeReload.checkpoint, checkpointAfter: afterReload.checkpoint, console: r2Page.consoleLines.slice(-20)});
+  if (!same) throw new Error('R2 reload did not restore the same world/owned/U/overrides/buildings');
+  await hideChrome(r2Page.page);
+  await shot(r2Page.page, `r2-reloaded-${run}`, CAM.mid);
+  await r2Page.page.close();
+
+  /* ---------- R1 comparison: same seed shape, same viewport/camera per stage ---------- */
+  const r1Seed = `${run}-r1-compare`;
+  const r1Page = await makePage(`${R1}/?dev&seed=${encodeURIComponent(r1Seed)}&size=128`);
+  await hideChrome(r1Page.page);
+  const r1Initial = await metrics(r1Page.page);
+  log('r1-initial', r1Initial);
+  await shot(r1Page.page, `r1-initial-${run}`, CAM.initial);
+  const r1Bought = await buyToMid(r1Page.page);
+  const r1Mid = await metrics(r1Page.page);
+  log('r1-mid', {bought: r1Bought, ...r1Mid});
+  await shot(r1Page.page, `r1-mid-${run}`, CAM.mid);
+  await r1Page.page.close();
+
+  /* ---------- full-city spatial fixtures (frozen; not a purchase ledger) ---------- */
+  const fullR2Seed = `${run}-r2-full-fixture`;
+  const fullR2 = await makePage(`${R2}/?dev&fixture=full&seed=${encodeURIComponent(fullR2Seed)}&size=128`);
+  await hideChrome(fullR2.page);
+  await fullR2.page.waitForFunction(() => Object.values(window.__P1.state.buildings).filter(b => b.active).length >= 72, {timeout: 180000});
+  await idle(fullR2.page).catch(() => {});
+  await sleep(800);
+  const r2Full = await metrics(fullR2.page);
+  log('r2-full', r2Full);
+  await shot(fullR2.page, `r2-full-${run}`, CAM.full);
+  log('r2-full-console', {console: fullR2.consoleLines.slice(-20)});
+  if (fullR2.consoleLines.some(x => x.includes('pageerror') || x.includes('error:'))) throw new Error('R2 full fixture console error');
+  await fullR2.page.close();
+
+  const fullR1Seed = `${run}-r1-full-fixture`;
+  const fullR1 = await makePage(`${R1}/?dev&fixture=full&seed=${encodeURIComponent(fullR1Seed)}&size=128`);
+  await hideChrome(fullR1.page);
+  await fullR1.page.waitForFunction(() => Object.values(window.__P1.state.buildings).filter(b => b.active).length >= 72, {timeout: 180000});
+  await idle(fullR1.page).catch(() => {});
+  await sleep(800);
+  const r1Full = await metrics(fullR1.page);
+  log('r1-full', r1Full);
+  await shot(fullR1.page, `r1-full-${run}`, CAM.full);
+  log('r1-full-console', {console: fullR1.consoleLines.slice(-20)});
+  await fullR1.page.close();
+
+  log('done', {run, out: OUT, log: logPath, screenshots: fs.readdirSync(OUT).filter(x => x.includes(run) && x.endsWith('.png')).sort()});
+} catch (error) {
+  log('fatal', {message: String(error), stack: error?.stack});
+  console.error(error);
+  process.exitCode = 1;
+} finally {
+  await browser.close();
+}
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/tools/bc84/p1/r2-spatial-audit.mjs r2/project/tools/bc84/p1/r2-spatial-audit.mjs
--- project/tools/bc84/p1/r2-spatial-audit.mjs	1970-01-01 08:00:00.000000000 +0800
+++ r2/project/tools/bc84/p1/r2-spatial-audit.mjs	2026-11-10 14:55:26.588246928 +0800
@@ -0,0 +1,72 @@
+// Reproducible R2 spatial audit. Requires the R2 preview server on 8070.
+// Reads the real browser state and rendered envelopes; writes only under r2/.
+import puppeteer from 'puppeteer-core';
+import fs from 'node:fs';
+import path from 'node:path';
+import {fileURLToPath} from 'node:url';
+
+const PROJECT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..');
+const TASK = path.resolve(PROJECT, '..');
+function arg(name, fallback) {
+  const i = process.argv.indexOf('--' + name);
+  return i > 0 && process.argv[i + 1] ? process.argv[i + 1] : fallback;
+}
+const BASE = arg('base', 'http://127.0.0.1:8070').replace(/\/+$/, '');
+const OUT = path.resolve(arg('out', path.join(TASK, 'evidence-r2', 'spatial-audit-final.json')));
+const WIDTH = Number(arg('width', '1280')), HEIGHT = Number(arg('height', '800'));
+const browser = await puppeteer.launch({
+  executablePath: '/usr/bin/chromium', headless: true,
+  args: ['--no-sandbox', '--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'],
+});
+const page = await browser.newPage();
+await page.setViewport({width: WIDTH, height: HEIGHT, deviceScaleFactor: 1});
+const logs = [];
+page.on('console', m => { if (['error', 'warning'].includes(m.type())) logs.push(`${m.type()}:${m.text()}`); });
+page.on('pageerror', e => logs.push(`pageerror:${e.message}`));
+await page.goto(`${BASE}/?dev&fixture=full&seed=r2-spatial-audit-final&size=128`, {waitUntil: 'domcontentloaded', timeout: 30000});
+await page.waitForFunction(() => window.__P1_READY === true || window.__P1_ERROR, {timeout: 180000});
+await page.waitForFunction(() => document.getElementById('boot')?.hidden === true, {timeout: 60000});
+await page.waitForFunction(() => Object.values(window.__P1.state.buildings).filter(b => b.active).length >= 72, {timeout: 120000});
+await new Promise(r => setTimeout(r, 900));
+const report = await page.evaluate(() => {
+  const s = window.__P1.state, plan = s.worldPlan, proj = window.__P1.projection();
+  const buildings = Object.values(s.buildings).filter(b => b.active);
+  const byParcel = new Map();
+  for (const b of buildings) { const a = byParcel.get(b.parcelId) || []; a.push(b.id); byParcel.set(b.parcelId, a); }
+  const roadParcels = plan.parcels.filter(x => x.role === 'road');
+  const inRoad = (c) => {
+    const [x, y] = c.split(',').map(Number);
+    return roadParcels.find(q => x >= q.coordinate.x * 7 && x < (q.coordinate.x + 1) * 7 && y >= q.coordinate.y * 7 && y < (q.coordinate.y + 1) * 7);
+  };
+  const intrusions = s.roads.present.filter(c => !inRoad(c));
+  let buildingRoadOverlap = 0;
+  for (const b of buildings) {
+    const q = plan.parcels.find(x => x.id === b.parcelId);
+    for (const c of q.cells ?? []) if (s.roads.present.includes(c)) buildingRoadOverlap++;
+  }
+  const envs = (proj?.buildingPickables ?? []).map(o => o.userData.realizedEnvelope).filter(Boolean);
+  const cell = 4.2, cellCount = plan.parcels.filter(x => x.role === 'building').length;
+  const envArea = envs.reduce((n, e) => n + e.w * e.d, 0);
+  return {
+    buildings: buildings.length, owned: s.owned.length, parcels: plan.parcels.length,
+    buildingParcels: cellCount, roadParcels: roadParcels.length,
+    uniqueBuildingParcels: byParcel.size,
+    badOne: [...byParcel].filter(([, ids]) => ids.length !== 1),
+    badRole: buildings.filter(b => plan.parcels.find(x => x.id === b.parcelId)?.role !== 'building').length,
+    roadPresent: s.roads.present.length, intrusions: intrusions.length, buildingRoadOverlap,
+    envs: envs.length, tooBig: envs.filter(e => e.w > cell || e.d > cell).length,
+    cell, cellArea: cell * cell, envArea: +envArea.toFixed(3),
+    envAreaPctOfCell: +(100 * envArea / (cell * cell * cellCount)).toFixed(2),
+    envAreaPctOfIsland: +(100 * envArea / (67.2 * 33.6)).toFixed(2),
+    envW: [Math.min(...envs.map(e => e.w)), Math.max(...envs.map(e => e.w))],
+    envD: [Math.min(...envs.map(e => e.d)), Math.max(...envs.map(e => e.d))],
+    roadCellFullFine: roadParcels.length * 7 * 7,
+    candidateList: proj?.stats?.candidateList,
+    console: [],
+  };
+});
+report.logs = logs;
+fs.mkdirSync(path.dirname(OUT), {recursive: true});
+fs.writeFileSync(OUT, JSON.stringify(report, null, 2) + '\n');
+console.log(JSON.stringify(report, null, 2));
+await browser.close();
diff -ruN '--exclude=node_modules' '--exclude=dist' '--exclude=.git' '--exclude=evidence-r2' '--exclude=*.log' '--exclude=preview-server.info.json' '--exclude=preview-server.pid' '--exclude=preview-*.pid' project/tools/bc84/p1/serve-preview-050r2.mjs r2/project/tools/bc84/p1/serve-preview-050r2.mjs
--- project/tools/bc84/p1/serve-preview-050r2.mjs	1970-01-01 08:00:00.000000000 +0800
+++ r2/project/tools/bc84/p1/serve-preview-050r2.mjs	2026-11-10 14:23:39.779184711 +0800
@@ -0,0 +1,112 @@
+// DDZ-BC84-050 r2 · 紧凑正交道路格候选只读预览服务（独立进程；不动 R1 8069/8061/8065）。
+// 只服务本树 dist/bc84-p1；GET/HEAD，无目录列表、无写接口。
+// 自描述：GET /__050r2_preview.json；健康：GET /__050r2_healthz
+// 启动：node tools/bc84/p1/serve-preview-050r2.mjs --port 8070 --bind 0.0.0.0
+import http from 'node:http';
+import fs from 'node:fs';
+import path from 'node:path';
+import crypto from 'node:crypto';
+import {fileURLToPath} from 'node:url';
+
+const PROJECT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..');
+const TASK_ROOT = path.resolve(PROJECT, '..');
+function arg(name, fallback) {
+  const i = process.argv.indexOf('--' + name);
+  return i > 0 && process.argv[i + 1] ? process.argv[i + 1] : fallback;
+}
+const DIR = path.resolve(arg('dir', path.join(PROJECT, 'dist/bc84-p1')));
+const PORT = Number(arg('port', '8070'));
+const BIND = arg('bind', '0.0.0.0');
+const STATE = TASK_ROOT;
+fs.mkdirSync(STATE, {recursive: true});
+
+const MIME = {
+  '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8',
+  '.mjs': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8',
+  '.json': 'application/json; charset=utf-8', '.map': 'application/json; charset=utf-8',
+  '.png': 'image/png', '.jpg': 'image/jpeg', '.svg': 'image/svg+xml', '.ico': 'image/x-icon',
+  '.txt': 'text/plain; charset=utf-8', '.wasm': 'application/wasm',
+};
+const sha256 = (buf) => crypto.createHash('sha256').update(buf).digest('hex');
+const fileHashSafe = (rel) => {
+  try { return sha256(fs.readFileSync(path.join(DIR, rel))); } catch { return null; }
+};
+const sourceHashSafe = (rel) => {
+  try { return sha256(fs.readFileSync(path.join(PROJECT, rel))); } catch { return null; }
+};
+const startedDate = new Date();
+const info = () => ({
+  task: 'DDZ-BC84-050 r2 · 紧凑正交道路格与一格一栋候选（非正式发布）',
+  taskFile: '/vol1/ai/projects/wyszz-new/frontend-rebuild-hm/tasks-out/DDZ-BC84-050/R2-TASK.md',
+  taskSha256: (() => { try { return sha256(fs.readFileSync(path.resolve(TASK_ROOT, '..', 'R2-TASK.md'))); } catch { return null; } })(),
+  pid: process.pid,
+  cwd: process.cwd(),
+  root: DIR,
+  port: PORT,
+  bind: BIND,
+  node: process.version,
+  started: startedDate.toISOString(),
+  startedBeijing: startedDate.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai', hour12: false}),
+  urls: [`http://100.114.191.104:${PORT}/`, `http://192.168.1.38:${PORT}/`, `http://127.0.0.1:${PORT}/`],
+  routes: {
+    initial32: `/?seed=050r2-preview-initial&size=32`,
+    mid96: `/?seed=050r2-preview-mid&size=96`,
+    full128Fixture: `/?dev&fixture=full&seed=050r2-preview-full&size=128`,
+    legacy048Entry: `/?city=048&seed=048-preview-initial&size=32`,
+    fixtureNote: 'full128 使用 dev fixture=full 预置全部建筑格，是空间测试夹具，不是真实购买流水；R2 的楼足迹为实际渲染 bounds。',
+  },
+  candidate: 'r2',
+  build: {
+    indexHtmlSha256: fileHashSafe('index.html'),
+    appEntrySha256: fileHashSafe('src/bc84/p1/app.mjs'),
+    webHostSha256: fileHashSafe('src/bc84/p1/host/web-host.mjs'),
+    modelSha256: sourceHashSafe('src/bc84/model.mjs'),
+    worldSha256: sourceHashSafe('src/bc84/p1/world.mjs'),
+    sceneSha256: sourceHashSafe('src/bc84/p1/scene.js'),
+    roadVisualSha256: sourceHashSafe('src/bc84/p1/road-visual.mjs'),
+    terrainSha256: sourceHashSafe('src/bc84/p1/terrain.js'),
+    cameraSha256: fileHashSafe('src/bc84/p1/host/camera.mjs'),
+    threeSha256: fileHashSafe('vendor/three/build/three.module.js'),
+  },
+  sourceCandidate: {
+    project: PROJECT,
+    dist: DIR,
+    tree: '独立 050-r2 树；R1 复制 + 7 fine-cell 紧凑格/6x6 建筑足迹/统一等比填充；R1 8069 保持',
+  },
+  limits: {methods: 'GET, HEAD only', writable: false, directoryListing: false},
+});
+
+function send(res, status, headers, body) {
+  res.writeHead(status, {'cache-control': 'no-store', ...headers});
+  res.end(body);
+}
+const server = http.createServer((req, res) => {
+  if (req.method !== 'GET' && req.method !== 'HEAD') return send(res, 405, {'content-type': 'text/plain'}, 'read-only preview: GET/HEAD only');
+  const rawUrl = req.url || '/';
+  const urlPath = decodeURIComponent(rawUrl.split('?')[0]);
+  if (urlPath === '/__050r2_preview.json' || urlPath === '/__050_preview.json') {
+    const body = JSON.stringify(info(), null, 2);
+    return send(res, 200, {'content-type': 'application/json; charset=utf-8'}, req.method === 'HEAD' ? undefined : body);
+  }
+  if (urlPath === '/__050r2_healthz' || urlPath === '/__050_healthz') {
+    return send(res, 200, {'content-type': 'application/json; charset=utf-8'}, JSON.stringify({ok: true, pid: process.pid, dir: DIR, index: fileHashSafe('index.html')}));
+  }
+  const rel = urlPath === '/' ? 'index.html' : urlPath.replace(/^\/+/, '');
+  const abs = path.resolve(DIR, rel);
+  if (!abs.startsWith(DIR + path.sep) && abs !== DIR) return send(res, 403, {'content-type': 'text/plain'}, 'forbidden');
+  fs.stat(abs, (error, stat) => {
+    if (error || !stat.isFile()) {
+      console.log(`${new Date().toISOString()} 404 ${rawUrl}`);
+      return send(res, 404, {'content-type': 'text/plain; charset=utf-8'}, 'not found');
+    }
+    const type = MIME[path.extname(abs).toLowerCase()] || 'application/octet-stream';
+    res.writeHead(200, {'content-type': type, 'content-length': stat.size, 'cache-control': 'no-store'});
+    if (req.method === 'HEAD') return res.end();
+    fs.createReadStream(abs).pipe(res);
+  });
+});
+server.listen(PORT, BIND, () => {
+  fs.writeFileSync(path.join(STATE, 'preview-server.pid'), String(process.pid));
+  fs.writeFileSync(path.join(STATE, 'preview-server.info.json'), JSON.stringify(info(), null, 2) + '\n');
+  console.log(JSON.stringify({listening: `http://${BIND}:${PORT}`, pid: process.pid, dir: DIR}, null, 2));
+});
