"""Recreate the authored Split H1 C01 input records. No source measurement implied."""
from pathlib import Path
import json

HERE=Path(__file__).resolve().parent
BASE='d88c6658de0439be2256b546e37bac03718b5ed6'
def write(name,data):
    (HERE/name).write_text(json.dumps(data,indent=2,ensure_ascii=False)+'\n')
def rect(x0,y0,x1,y1): return [[x0,y0],[x1,y0],[x1,y1],[x0,y1]]
def mass(mid,label,kind,bounds,z0,z1,hollow=False,**kw):
    return dict(id=mid,label=label,kind=kind,shell='hollow' if hollow else 'solid',footprint=rect(*bounds),z_base_m=z0,z_top_m=z1,**({'wall_thickness_m':.35} if hollow else {}),**kw)
def opening(fid,host,edge,level,offset,width,height,sill=0,use='portal'):
    return dict(id=fid,label=fid.replace('_',' '),type='opening',use=use,host=host,edge=edge,level_id=level,offset_m=offset,width_m=width,height_m=height,sill_m=sill)

levels=[]
zs=[0]+[round(8.8+i*4.4,3) for i in range(19)]+[round(95+i*4.4,3) for i in range(13)]
for i,z in enumerate(zs):
    levels.append(dict(level_id=f'L{i:02d}',floor_elevation_m=z,floor_to_floor_m=round(zs[i+1]-z,3) if i+1<len(zs) else 5.4,usable_clear_height_m=6.6 if i==0 else (6.0 if i==19 else 3.8),slab_thickness_m=.4,role='authored playable arrival' if i==0 else ('authored bridge/receiving datum' if i==19 else 'proposed closed/repeated floor datum; no interior authored'),applies_to='Floor assignment: both towers L00–L25; right tower only L26–L32. Left roof/crown envelope continues unoccupied from last left floor117.0 to roof124.8; no left L26 floor.'))

masses=[
 mass('LOBBY_L','Left arrival lobby / low arcade base','podium',(-52,-22,-18,18),0,7,True,levels=['L00'],needs_ground_entry=True),
 mass('BASE_R','Right base; interior reserved beyond visible threshold','podium',(18,-24,58,20),0,7,True,levels=['L00'],needs_ground_entry=True),
 mass('GROUND_GAP_APRON','Local proposed paving linking the two gap-facing thresholds; no site placement','paving',(-18,-10,18,10),-.4,0),
 mass('ARCADE_ROOF','Low rear arcade roof; not a second skybridge or public roof','canopy',(-18,10,18,18),5.8,7),
 mass('TOWER_L_LOWER','Shorter left blade envelope below gallery; solid proxy','tower',(-48,-18,-20,18),7,87.6),
 mass('LANDING_L','Left bridge floor with core approach','tower',(-48,-18,-20,18),88,95,True,levels=['L19']),
 mass('TOWER_L_UPPER','Shorter/slimmer upper tower silhouette proxy','tower',(-48,-18,-20,18),95,124.8),
 mass('TOWER_R_LOWER','Taller/broader right blade envelope below gallery; solid proxy','tower',(20,-20,54,20),7,87.6),
 mass('RECEIVING_R','Right receiving floor / integral lounge and overlook','tower',(20,-20,54,20),88,95,True,levels=['L19']),
 mass('TOWER_R_UPPER','Taller/broader upper tower silhouette proxy','tower',(20,-20,54,20),95,153.2),
 mass('BRIDGE_H1','Only elevated public crossing: enclosed gallery, flat floor','bridge',(-20,-6,20,6),88,94.4,True,levels=['L19'],connects=['LANDING_L','RECEIVING_R'])
]
features=[
 opening('D-L00-ENTRY','LOBBY_L',0,'L00',14.9,4.2,4.0,use='door'),
 opening('D-L00-GAP','LOBBY_L',1,'L00',18.9,4.2,4.0),
 opening('D-R00-ENTRY','BASE_R',0,'L00',17.9,4.2,4.0,use='door'),
 opening('D-R00-GAP','BASE_R',3,'L00',18.9,4.2,4.0),
 opening('P-L19-TOWER','LANDING_L',1,'L19',15.9,4.2,3.2),
 opening('P-L19-GALLERY','BRIDGE_H1',3,'L19',3.9,4.2,3.2),
 opening('P-R19-GALLERY','BRIDGE_H1',1,'L19',3.9,4.2,3.2),
 opening('P-R19-TOWER','RECEIVING_R',3,'L19',17.9,4.2,3.2),
 opening('W-L00-FRONT-A','LOBBY_L',0,'L00',1.5,11.8,5.8,.2,'window'),
 opening('W-L00-FRONT-B','LOBBY_L',0,'L00',20.7,11.8,5.8,.2,'window'),
 opening('W-L00-SIDE','LOBBY_L',3,'L00',2.0,34,5.8,.2,'window'),
 opening('W-R00-FRONT-A','BASE_R',0,'L00',1.5,14.8,5.8,.2,'window'),
 opening('W-R00-FRONT-B','BASE_R',0,'L00',23.7,14.8,5.8,.2,'window'),
 opening('W-L19-FRONT','LANDING_L',0,'L19',1.5,25,5.2,.4,'window'),
 opening('W-R19-FRONT','RECEIVING_R',0,'L19',1.5,31,5.2,.4,'window'),
 opening('W-R19-SIDE','RECEIVING_R',1,'L19',1.5,37,5.2,.4,'window'),
 opening('W-GALLERY-FRONT','BRIDGE_H1',0,'L19',1.5,37,5.2,.4,'window'),
 opening('W-GALLERY-REAR','BRIDGE_H1',2,'L19',1.5,37,5.2,.4,'window'),
 dict(id='PLANTING_ROOF',label='Scenic roof planting only; no public deck',type='reservation',footprint=rect(-17,-4.5,17,4.5),z_base_m=94.4,z_top_m=95.4,purpose='Separate planters, soil and drainage; technical loading and maintenance access not resolved'),
 dict(id='HAUNCH_ZONE',label='Curved underside development zone; not yet shaped structure',type='reservation',footprint=rect(-20,-6,20,6),z_base_m=83.5,z_top_m=87.6,purpose='Later designed arched ivory haunch; keep horizontal gallery floor at 88.0; not a second route'),
 dict(id='LEFT_LIFT',label='Left passenger lift reservation',type='reservation',footprint=rect(-40,8,-36.8,11.4),z_base_m=0,z_top_m=94.6,purpose='Proposed 2.2m cabin and 1.4m door; no operational lift or clear shaft generated'),
 dict(id='LEFT_STAIR',label='Left stair reservation',type='reservation',footprint=rect(-46,7,-40.2,15.8),z_base_m=0,z_top_m=94.6,purpose='Proposed 1.6m flight width in switchback stair; treads/landings/egress not authored by upstream schema'),
 dict(id='RIGHT_LIFT',label='Right lift/secondary egress reservation',type='reservation',footprint=rect(46,10,49.2,13.4),z_base_m=0,z_top_m=94.6,purpose='Far-core future egress/maintenance; first public route returns via left core')
]
rooms=[
 dict(room_id='SP-L00-LOBBY',name='Left arrival lobby',host='LOBBY_L',level_id='L00',floor_elevation_m=0,clear_height_m=6.6,clear_bounds_m=[-51.65,-21.65,-18.35,17.65],use_zone_m=[-49,-19,-21,3],zone_status='Open lobby with rear core proxy; use zone is not a partition',route_clear_width_m=3.0,material_keys=['CK_MAT_002_STONE_HONED','CK_MAT_001_MINERAL_IVORY','CK_MAT_004_BRONZE_CHAMPAGNE','CK_MAT_005_GLASS_LAGOON']),
 dict(room_id='SP-L19-LANDING',name='Left gallery landing and core approach',host='LANDING_L',level_id='L19',floor_elevation_m=88,clear_height_m=6.6,clear_bounds_m=[-47.65,-17.65,-20.35,17.65],use_zone_m=[-34,-6,-20.35,4],zone_status='Landing route adjoining solid core proxy',route_clear_width_m=3.0,material_keys=['CK_MAT_002_STONE_HONED','CK_MAT_001_MINERAL_IVORY','CK_MAT_004_BRONZE_CHAMPAGNE']),
 dict(room_id='SP-L19-GALLERY',name='Enclosed elevated gallery',host='BRIDGE_H1',level_id='L19',floor_elevation_m=88,clear_height_m=6.0,clear_bounds_m=[-19.65,-5.65,19.65,5.65],use_zone_m=[-17,-5.0,17,5.0],zone_status='One enclosed room / flat crossing datum; scenic roof inaccessible',route_clear_width_m=4.0,material_keys=['CK_MAT_002_STONE_HONED','CK_MAT_001_MINERAL_IVORY','CK_MAT_004_BRONZE_CHAMPAGNE','CK_MAT_005_GLASS_LAGOON']),
 dict(room_id='SP-L19-RECEIVING',name='Right receiving lounge / overlook',host='RECEIVING_R',level_id='L19',floor_elevation_m=88,clear_height_m=6.6,clear_bounds_m=[20.35,-19.65,53.65,19.65],use_zone_m=[29,-16,50,6],zone_status='Lounge is a furnishing zone within open receiving floor, not a new enclosed partition',route_clear_width_m=3.0,material_keys=['CK_MAT_002_STONE_HONED','CK_MAT_001_MINERAL_IVORY','CK_MAT_004_BRONZE_CHAMPAGNE','CK_MAT_005_GLASS_LAGOON','CK_MAT_006_TIMBER_WARM','CK_MAT_007_LINEN_PALE'])
]
data=dict(schema_version=2,contract_scope='production',status='PROPOSED_DESIGN_CANDIDATE_NOT_ISSUED',asset_id='PI-BLD-0002-V01',contract_revision='H1-C01-PROPOSED',shell_revision='H1-C01-PROPOSED',placement_id=None,frame_revision=None,units='metres',protocol_id='PI-PROT-BUILDING',protocol_revision='R05',coordinate_frame=dict(origin='Local center of the open tower gap at ground finished-floor datum; not a surveyed parcel origin',x='local right',y='local rear',front='negative Y',z='up',map_transform=None),value_provenance_default=dict(status='proposed',source='Split package author dimensional proposal for isolated design development; not perspective measurement',approval=None),measurement_metadata={'/coordinate_frame/map_transform':dict(status='unresolved',source=None,approval=None),'/player_camera_envelope':dict(status='unresolved',source='Await Quik actual character and camera',approval=None)},source_baseline=BASE,candidate=dict(topology='H1 single enclosed bridge with nonplayable planted roof',selection='author-selected working proposal; creator acceptance unrecorded',previous='CB00-STRUCTURE is preserved as a two-bridge alternative and is not inherited as geometry'),envelope=dict(foundation_width=110,foundation_depth=44,tower_width=None,tower_depth=None,total_height=153.2,roof_height=153.2,crown_height=None,exterior_wall_thickness=.35),level_schedule=levels,geometry=dict(masses=masses,cores=[dict(id='CORE_L',label='Solid left-core proxy; not traversable lift/stair',footprint=rect(-47,6,-34,17),z_base_m=0,z_top_m=94.6,serves_masses=['LOBBY_L','LANDING_L']),dict(id='CORE_R',label='Solid far-core proxy; future egress unresolved',footprint=rect(38,8,51,19),z_base_m=0,z_top_m=94.6,serves_masses=['BASE_R','RECEIVING_R'])],features=features,interfaces=[dict(id='IF-L-ENTRY',kind='entrance',point_m=[-35,-22,0],connects_to='external district approach unplaced',scope='proposed'),dict(id='IF-GALLERY-L',kind='portal',point_m=[-20,0,88],connects_to='LANDING_L / BRIDGE_H1',scope='proposed'),dict(id='IF-GALLERY-R',kind='portal',point_m=[20,0,88],connects_to='BRIDGE_H1 / RECEIVING_R',scope='proposed')]),core_and_structure=[dict(id='CORE_L',state='reserved / solid proxy',lift_car_clear_m=[2.2,2.2,2.6],lift_door_clear_m=[1.4,2.4],stair_clear_flight_width_m=1.6,stair_tread_depth_m=.3,stair_riser_target_m=.16,verification='All design assumptions. No stair count, structural design, fire/egress compliance or operating lift accepted.'),dict(id='BRIDGE_H1',span_between_host_faces_m=40,enclosure_width_m=12,floor_elevation_m=88,roof_top_m=94.4,roof_slab_m=.4,clear_height_m=6,structural_status='Support/bearing, movement, haunch structure, wind and planter loads unresolved; no engineering capacity claim')],entrance_clear_openings=[f for f in features if f['type']=='opening' and f['use'] in ['door','portal']],room_clear_dimensions=rooms,door_window_schedules=[f for f in features if f['type']=='opening'],player_camera_envelope=dict(capsule_radius_m=None,capsule_half_height_m=None,camera_clearance_m=None,test_build=None),measurement_source='Authored proposed dimensions; no site or image-derived metric calibration',drawing_files=[],approval=None,readiness=dict(design_candidate=True,design_ready=False,build_ready=False,engine_verified=False,reason='Upper gallery thresholds are authored. Vertical route is reserved, fins/curves are not modeled, independent review and actual engine checks remain open.'),unresolved_items=['Creator selection of H1 and this proposed scale remains open.','Map placement, orientation, district frame, foundation interface and real window context remain null/unverified.','Cores are solid proxies; no usable lift/stair is generated. Full ground-to-gallery traversal is therefore blocked in this candidate.','Upper tower bodies are solid extruded envelopes; curved blade/crown skins, stepped shoulder, façade floor rhythm and actual inaccessible floor construction require authored refinement.','Low arcade roof is a canopy, not a second skybridge; sculpted arches and bridge haunch remain design zones.','Structural/egress/maintenance systems, bridge movement/support and planting build-up need technical authoring.','Door swings, furniture collision, player/camera envelopes and engine performance require actual evidence.','Schema generation COMPLETE describes supported input geometry only; it is not build-ready or engine acceptance.'])
write('BUILDING_DIMENSIONS.json',data)
write('ROOM_SCHEDULE.json',dict(asset_id=data['asset_id'],revision=data['contract_revision'],status='proposed',rooms=rooms))
write('CAMERA_SCHEDULE.json',dict(asset_id=data['asset_id'],revision=data['contract_revision'],status='proposed saved camera specifications; render outputs have separate evidence',coordinate_frame=data['coordinate_frame'],cameras=[
 dict(id='SP-CAM-EXT-FRONT',name='Front overall',projection='perspective',location_m=[170,-235,120],target_m=[3,0,75],lens_mm=35,sensor_width_mm=36,resolution=[1600,1200]),
 dict(id='SP-CAM-EXT-REAR',name='Rear overall',projection='perspective',location_m=[-160,235,115],target_m=[3,0,75],lens_mm=35,sensor_width_mm=36,resolution=[1600,1200]),
 dict(id='SP-CAM-LOBBY',name='Arrival lobby toward core approach',projection='perspective',location_m=[-35,-18,1.65],target_m=[-35,5,2.0],lens_mm=24,sensor_width_mm=36,resolution=[1600,1000]),
 dict(id='SP-CAM-GALLERY',name='Gallery east toward receiving threshold',projection='perspective',location_m=[-15,-2,89.65],target_m=[25,0,89.65],lens_mm=24,sensor_width_mm=36,resolution=[1600,1000]),
 dict(id='SP-CAM-RECEIVING',name='Receiving lounge toward front glazing',projection='perspective',location_m=[25,-2,89.65],target_m=[43,-12,89.65],lens_mm=24,sensor_width_mm=36,resolution=[1600,1000]),
 dict(id='SP-CAM-RECEIVING-REVERSE',name='Receiving lounge reverse to gallery',projection='perspective',location_m=[46,-13,89.65],target_m=[20,0,89.65],lens_mm=24,sensor_width_mm=36,resolution=[1600,1000])]))
write('TOPOLOGY_DECISION.json',dict(id='SPLIT-H1-C01-TOPOLOGY',status='author-selected proposal; not creator accepted',baseline=BASE,asset_id=data['asset_id'],decision='One enclosed high gallery between unequal towers; flat route at 88m, scenic roof above. One low arcade canopy remains distinct.',source_hierarchy=[dict(path='docs/crown-key-design/R01/PI-BLD-0002-V01/DESIGN_DIRECTION.md',role='Latest H1 working direction'),dict(path='docs/crown-key-design/R01/PI-BLD-0002-V01/media/source-catalog-split.webp',role='Complete silhouette identity; no scale'),dict(path='project_sources/25-Twin-Blade-Towers-and-Garden-Bridge-4.png',role='Uploaded finish/detail reference; contains conflicting multiple-deck reading'),dict(path='docs/crown-key-production/R01/claude-pilot/split-complex/CANDIDATE_B_CONTRACT_PI-BLD-0002-V01.json',role='CB00 two-bridge structural alternative; preserved, not copied')],included=['Shorter/slimmer left, taller/broader right','One enclosed gallery crossing with a level floor','Scenic planted gallery roof without public access','Low arcade canopy and open central ground passage','Arrival lobby, gallery and integral receiving lounge/overlook'],excluded=['Independent upper public bridge deck','Pool or amenity deck','Second elevated public crossing','Named council/diplomacy/story location','Accepted site position or scale'],geometric_limits=['Extruded envelopes communicate proposed bounds, not finished curved sail silhouettes','Bridge haunch is a reserved design volume, not an engineered or curved modeled member','Full vertical access awaits actual stair/lift authoring'],reconciles_cb00=dict(retain=['Paired towers','Low base/arcade','Two core reservations','Explicit endpoint openings'],replace=['BRIDGE_LOWER + DECK_UPPER become BRIDGE_H1 only'],omit=['POOL','Public upper-deck route']),approval=None))
