P08-03: 配置の通常操作受入
This commit is contained in:
+34
-2
@@ -134,6 +134,36 @@ def make(base, source, checker):
|
||||
rooms = 0
|
||||
|
||||
def snap(name):
|
||||
# Synthetic controls follow the same split as Runtime: stairs are
|
||||
# construction instances with infrastructure, never operational rooms.
|
||||
projections = []
|
||||
entities = []; connectors = []
|
||||
for f in runtime['construction']['facilities']:
|
||||
if f['definition_id'] != 'guest_stairs': continue
|
||||
f.update(rotation=0, layer=0, completed_at=360)
|
||||
fid = f['instance_id']; origin = f['origin']
|
||||
p = {k:copy.deepcopy(f[k]) for k in ('instance_id','definition_id','origin','source_job_id','rotation','layer','completed_at')}
|
||||
p.update(kind='guest_stairs', route_entity_id='infra.route:'+fid,
|
||||
connector_id='infra.connector:'+fid, cells=f['occupied_cells'], staff_only=False,
|
||||
pass_through=True, footprint=[1,1], definition_tags=['guest_access','movement','route_subslot','schema_facility_proxy','stairs','vertical_connector'])
|
||||
canonical = 'projection|'+''.join('%d:%s|' % (len(p[k]),p[k]) for k in ('instance_id','definition_id','kind','route_entity_id','connector_id','source_job_id'))
|
||||
canonical += 'layer=0|staff=0|pass=1|footprint=1,1|rotation=0|completed=360|'
|
||||
canonical += 'origin=%d,%d,%d|tags=' % tuple(origin)
|
||||
canonical += ''.join('%d:%s;' % (len(t),t) for t in p['definition_tags'])+'|cells='
|
||||
canonical += ''.join('%d,%d,%d;' % tuple(c) for c in p['cells'])
|
||||
p['record_fingerprint'] = hashlib.sha256(canonical.encode()).hexdigest()
|
||||
projections.append(p)
|
||||
entities.append({'entity_id':p['route_entity_id'],'category':'ROUTE','cells':p['cells']})
|
||||
connectors.append({'id':p['connector_id'],'from':origin,'to':[origin[0],origin[1]-1,origin[2]],
|
||||
'cost':150,'bidirectional':True,'access_id':'','enabled':True,'movement_type':'CONNECTOR',
|
||||
'dynamic_cost':0,'operational_state':'OPERATIONAL','cabin_capacity':8,'queue_capacity':256,
|
||||
'cabin_state':'IDLE','current_floor':origin[1],'travel_minutes_per_floor':1,'request_queue':[]})
|
||||
runtime['facility_infrastructure'] = {'projections':projections}
|
||||
runtime['spatial_subslots'] = {'entities':entities}
|
||||
route_cells = [c for p in projections for c in p['cells']]
|
||||
walkable = [[4,0,0]]+route_cells
|
||||
runtime['route_projection'] = {'base_walkable_cells':[[4,0,0]],'projected_route_cells':route_cells,'projected_walkable_cells':walkable}
|
||||
runtime['path'] = {'connectors':connectors,'vertical_walk_blockers':[], 'cell_traffic':[{'cell':c} for c in walkable]}
|
||||
put(folder/(name+'.json'), typed(model))
|
||||
(folder/(name+'.var')).write_bytes(json.dumps(model, sort_keys=True).encode())
|
||||
return name
|
||||
@@ -157,7 +187,8 @@ def make(base, source, checker):
|
||||
row['input_method'] = method
|
||||
if method != 'native_os': return
|
||||
requests = [{'action':'cell', 'world_cell':row['position']['world_cell'],
|
||||
'viewport':row['position']['viewport'], 'screen':row['position']['screen']}]
|
||||
'viewport':row['position']['viewport'], 'screen':row['position']['screen'],
|
||||
'viewport_to_screen':[1,0,0,1,0,0], 'guide_visible':False, 'guide_rect':[0,0,0,0]}]
|
||||
if row['id'] in ('unsupported','resume_overlap'):
|
||||
requests.append({'action':'load_menu'})
|
||||
if row['id'] == 'pan_zoom':
|
||||
@@ -235,7 +266,8 @@ def make(base, source, checker):
|
||||
job.update(state='COMPLETED', facility_instance_id=fid)
|
||||
facility = {'instance_id': fid, 'definition_id': definition, 'occupied_cells': cells, 'origin': cell[:], 'source_job_id': jid}
|
||||
runtime['construction']['facilities'].append(facility)
|
||||
runtime['facilities']['instances'].append(copy.deepcopy(facility))
|
||||
if definition != 'guest_stairs':
|
||||
runtime['facilities']['instances'].append(copy.deepcopy(facility))
|
||||
runtime['world']['occupancies'][-1]['entity_id'] = fid
|
||||
row['completed'] = snap('writer-'+label+'-completed')
|
||||
if 'after' not in row: row['after'] = snap('writer-'+label+'-after')
|
||||
|
||||
+26
-2
@@ -58,7 +58,26 @@ func annotate(row: Dictionary) -> void:
|
||||
func point(node: Control) -> Dictionary:
|
||||
var viewport: Vector2 = node.get_global_transform_with_canvas() * (node.size * 0.5)
|
||||
var screen: Vector2 = node.get_screen_transform() * (node.size * 0.5)
|
||||
return {"node": String(node.get_path()), "viewport": [viewport.x, viewport.y], "screen": [screen.x, screen.y], "window_id": node.get_window().get_window_id()}
|
||||
return {"node": String(node.get_path()), "viewport": [viewport.x, viewport.y], "screen": [screen.x, screen.y], "window_id": node.get_window().get_window_id(),
|
||||
"viewport_to_screen": affine(node.get_screen_transform() * node.get_global_transform_with_canvas().affine_inverse())}
|
||||
|
||||
func unsupported_cell() -> Vector3i:
|
||||
# Read-only selection: retain the production predicate and avoid the guide.
|
||||
var view: WorldPreview = main.world_preview
|
||||
var bounds: Dictionary = runtime.world_service.get_bounds()
|
||||
for y: int in range(4, int(bounds[&"max_y"]) + 1):
|
||||
for x: int in range(int(bounds[&"max_x"]) - 1, int(bounds[&"min_x"]) - 1, -1):
|
||||
var cell := Vector3i(x, y, 0)
|
||||
var local := view.cell_to_canvas(cell)
|
||||
var viewport := view.get_global_transform_with_canvas() * local
|
||||
if not Rect2(Vector2.ZERO, view.size).has_point(local):
|
||||
continue
|
||||
if main.opening_guide.visible and main.opening_guide.get_global_rect().has_point(viewport):
|
||||
continue
|
||||
if "UNSUPPORTED" in view.get_build_preview_report(cell).get("error_codes", []):
|
||||
return cell
|
||||
expect(false, "visible unsupported target outside opening guide")
|
||||
return Vector3i(4, 4, 0)
|
||||
|
||||
func setup() -> void:
|
||||
input_method = "native_os"
|
||||
@@ -125,9 +144,14 @@ func click(cell: Vector3i) -> Dictionary:
|
||||
var local := view.cell_to_canvas(cell)
|
||||
var viewport := view.get_global_transform_with_canvas() * local
|
||||
var screen := view.get_screen_transform() * local
|
||||
var mapping := affine(view.get_screen_transform() * view.get_global_transform_with_canvas().affine_inverse())
|
||||
var guide_rect: Rect2 = main.opening_guide.get_global_rect()
|
||||
observed_cell = null
|
||||
await request({"action": "cell", "world_cell": vector(cell), "viewport": [viewport.x, viewport.y],
|
||||
"screen": [screen.x, screen.y], "instructions": "Click this transformed world-cell center. If clipped, use normal zoom/pan first and request a new collection; never substitute fixed pixels."})
|
||||
"screen": [screen.x, screen.y], "viewport_to_screen": mapping,
|
||||
"guide_rect": [guide_rect.position.x, guide_rect.position.y, guide_rect.size.x, guide_rect.size.y],
|
||||
"guide_visible": main.opening_guide.visible,
|
||||
"instructions": "Click screen coordinates derived from viewport_to_screen (includes canvas stretch and window translation). Retain actual CUA coordinates and screenshots. If clipped or intercepted, recollect; never substitute fixed pixels."})
|
||||
var selected: Variant = observed_cell
|
||||
if not selected is Vector3i:
|
||||
# With no active build tool, the normal preview selects a facility.
|
||||
|
||||
Vendored
+6
-1
@@ -111,6 +111,8 @@ func click(cell: Vector3i) -> Dictionary:
|
||||
|
||||
func build(id: StringName, cell: Vector3i, label: String, expected: String = "") -> void:
|
||||
await choose(id)
|
||||
if label == "unsupported":
|
||||
cell = unsupported_cell()
|
||||
var report: Dictionary = main.world_preview.get_build_preview_report(cell)
|
||||
var before := capture(label + "-before")
|
||||
results.clear()
|
||||
@@ -132,6 +134,9 @@ func build(id: StringName, cell: Vector3i, label: String, expected: String = "")
|
||||
await complete_build(id)
|
||||
row["completed"] = capture(label + "-completed")
|
||||
|
||||
func unsupported_cell() -> Vector3i:
|
||||
return Vector3i(4, 4, 0)
|
||||
|
||||
func demolish(cell: Vector3i, label: String, cancel := false, expected := "") -> void:
|
||||
if not main.palette_scroll.visible:
|
||||
await button(main.palette_toggle_button)
|
||||
@@ -216,7 +221,7 @@ func diagnostic_budget() -> void:
|
||||
func writer() -> void:
|
||||
diagnostic_budget()
|
||||
await save_initial_fixture()
|
||||
await build(&"standard_room", Vector3i(-8, 4, 0), "unsupported", "UNSUPPORTED")
|
||||
await build(&"standard_room", Vector3i(4, 4, 0), "unsupported", "UNSUPPORTED")
|
||||
await build(&"reception", Vector3i(runtime.world_service.get_bounds()[&"max_x"], 0, 0), "out_of_bounds", "OUT_OF_BOUNDS")
|
||||
await build(&"reception", target, "supported_connected")
|
||||
await build(&"reception", target, "overlap", "OVERLAP")
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"raw_path": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p08-03-native-handler-r05/pair/reader-checkpoint.json",
|
||||
"raw_sha256": "304d97de8051d5e74c6e32c4482a3cb183b0172d7671088fdc40469cc3448c0d",
|
||||
"raw_bytes": 2120352,
|
||||
"compressed_path": "ROOT_R05_READER_CHECKPOINT.json.gz",
|
||||
"candidate": "4a17d0e0f589fa76d81f1d4630ec45c63bac21ab",
|
||||
"complete_raw_preserved": true,
|
||||
"scope": "actual native reader snapshot, not synthetic acceptance proof"
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user