--- server-native/functional_front_policy.py +++ admission-v31/functional_front_policy.py @@ -20,7 +20,29 @@ def requires_qualified_front(request, entity): # A false optional flag must not override a role's semantic requirement. - return (bool(request.get('require_qualified_front')) + eid=entity.get('entity_id') + def explicit(row): + return (bool(row.get('require_qualified_front') or row.get('front_required')) + or any(row.get(key) for key in ('front_target_entity_id','front_target','facing_target_entity_id'))) + scoped=[row for key in ('furniture','entities') for row in request.get(key,[]) + if eid is not None and row.get('entity_id')==eid] + task_direction=any( + (eid is not None and (task.get('entity_id')==eid or task.get('subject')==eid + or task.get('subject_entity_id')==eid + or eid in task.get('entity_ids',[])) and explicit(task)) + or has_facing_relation({'relations':[task,*task.get('relations',[])]},entity) + for task in request.get('tasks',[])) + return (explicit(request) or explicit(entity) or any(explicit(row) for row in scoped) or any(entity.get(key) in DIRECTIONAL_ROLES - for key in ('role','binding_semantic_key','layout_slot_id')) - or has_facing_relation(request, entity)) + for key in ('role','category','binding_semantic_key','layout_slot_id', + 'furnishing_function','procedural_kind')) + or has_facing_relation(request, entity) or task_direction) + + +def direction_optional(request, entity): + """No semantic front is needed when the shared requirement policy says so. + + This is a requirement policy, not a symmetry or front verification claim. + Prepared source coordinates, units and identity remain mandatory. + """ + return not requires_qualified_front(request,entity) --- server-native/joint_layout.py +++ admission-v31/joint_layout.py @@ -65,9 +65,13 @@ return errors -def annotation_blocker_reason(candidate, evidence=None, attribute_reader=None): +def annotation_blocker_reason(candidate, evidence=None, attribute_reader=None, *, request=None, entity=None): """A current source-bound front can resolve an older direction-only label.""" blockers=list(candidate.get('annotation_replacement_blockers') or []) + if request is not None and entity is not None: + from functional_front_policy import direction_optional + if direction_optional(request,entity): + blockers=[reason for reason in blockers if reason!='placement_direction_unresolved'] if 'placement_direction_unresolved' in blockers and evidence is not None and attribute_reader is not None: # A successful consumer alone permits older certificate-free reviews. # Clearing a stale negative label requires the stronger current proof. @@ -900,7 +904,7 @@ elif require_support_obstacles and eid in surface_parents and not candidate.get('_support_obstacles'): reason='support_obstacle_geometry_unknown' elif any(value!='placement_direction_unresolved' for value in candidate.get('annotation_replacement_blockers',[])): - reason=annotation_blocker_reason(candidate) + reason=annotation_blocker_reason(candidate,request=attribute_request,entity=entity) elif not semantic_match(semantic_key(entity),candidate):reason='semantic_mismatch' elif not prepared_candidate(candidate):reason='measured_source_preparation_required' elif candidate.get('canonical_front_axis') not in ('+X','-X','+Y','-Y'):reason='functional_front_unknown' @@ -948,7 +952,8 @@ elif not reason and request.get('style'): reason='style_attribute_release_required' if not reason: - reason=annotation_blocker_reason(candidate,evidence,attribute_reader) + reason=annotation_blocker_reason(candidate,evidence,attribute_reader, + request=attribute_request,entity=entity) if not reason: reason=dimension_reason(semantic_key(entity),candidate) if not reason and collision_qualifier is not None: --- server-native/eligible_candidate_request.py +++ admission-v31/eligible_candidate_request.py @@ -5,6 +5,7 @@ from stage_checkpoint import HashMemo, atomic_json, fingerprint from functional_front_policy import requires_qualified_front +from joint_layout import annotation_blocker_reason from semantic_eligibility import candidate_suitability, source_semantic_evidence @@ -36,8 +37,8 @@ reason = 'source_hash_mismatch' elif not prepared_candidate(c): reason = 'source_preparation_required' - elif c.get('annotation_replacement_blockers'): - reason = 'annotation_blocker' + elif any(value!='placement_direction_unresolved' for value in c.get('annotation_replacement_blockers',[])): + reason = annotation_blocker_reason(c,request=request,entity=entity) elif c.get('runtime_material_fidelity_unverified'): reason = 'material_fidelity_unverified' elif c.get('canonical_front_axis') not in ('+X','-X','+Y','-Y'): @@ -51,6 +52,7 @@ reason = candidate_suitability(entity, c, request, source_evidence) if not reason and source_evidence: c = dict(c, source_semantic_evidence=source_evidence) + evidence=None if not reason and reader: evidence, reason = reader.consume(c, request, entity, verify_files=False) axis = ((evidence or {}).get('functional_front_resolution') or {}).get('effective_axis') @@ -58,6 +60,8 @@ c = dict(c, canonical_front_axis=axis) elif not reason and requires_qualified_front(request,entity): reason = 'functional_front_attribute_evidence_required' + if not reason: + reason = annotation_blocker_reason(c,evidence,reader,request=request,entity=entity) if not reason: reason = dimension_reason(role, c) if not reason and qualifier is not None: