diff --git a/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LEGACY-PARTS-LIBRARY.json b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LEGACY-PARTS-LIBRARY.json index f0d38ab..b2848c9 100644 --- a/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LEGACY-PARTS-LIBRARY.json +++ b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LEGACY-PARTS-LIBRARY.json @@ -4,6 +4,7 @@ "source_generation": "HLP-GEN-TOOL-ERA-0001", "state": "GREY_DISABLED_NON_NAVIGABLE", "ui": {"tone":"GREY","pointer_events":"NONE","open_action":"REJECT_OLD_ROUTE"}, + "rejected_paths": [{"path_id":"HLP-REJECTED-PATH-0001","path":"/Volumes/JZAO/铸渊-ICE-GL-ZY001/CODEX-DEV-20260913/hlp-git-foundation","label":"错误起点:传统工程先行,未从光湖原生语言底座诞生","state":"GREY_DISABLED_NON_NAVIGABLE","pointer_events":"NONE","open_action":"REJECTED_NON_NAVIGABLE","purification_item":"JCC-20260913T162231-590e862c","no_reuse":true}], "donor_module_ids": ["HLP-NATIVE-MOD-001","HLP-NATIVE-MOD-002","HLP-NATIVE-MOD-003","HLP-NATIVE-MOD-004","HLP-NATIVE-MOD-005","HLP-NATIVE-MOD-006","HLP-NATIVE-MOD-007","HLP-NATIVE-MOD-008","HLP-NATIVE-MOD-009","HLP-NATIVE-MOD-010","HLP-NATIVE-MOD-011","HLP-NATIVE-MOD-012","HLP-NATIVE-MOD-013","HLP-NATIVE-MOD-014","HLP-NATIVE-MOD-015","HLP-NATIVE-MOD-016","HLP-NATIVE-MOD-017","HLP-NATIVE-MOD-018"], "reuse_rule": "PERSONA_SELECTS_ONE_DONOR_PART_THEN_ASSIGN_NEW_LINE_NUMBER_REBUILD_TEST_REGISTER_AND_MOUNT", "old_path_execution": false diff --git a/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LWOS-PROJECT.json b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LWOS-PROJECT.json index 0320473..f434eba 100644 --- a/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LWOS-PROJECT.json +++ b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/HOLOLAKE-LWOS-PROJECT.json @@ -6,5 +6,8 @@ "sync_mode": "EVENT_DRIVEN_REQUIRED_AWAITING_RUNTIME", "project_tracker": "work-areas/HB-ZC-WORK-AREA-0001/production-lines/HLP-LWOS-RD-LINE-0001/PROJECT-TRACKER.json", "legacy_parts_library": "HOLOLAKE-LEGACY-PARTS-LIBRARY.json", + "path_router": "rejected_path_guard.py", + "path_router_required_for": ["OPEN", "ENTER", "REFERENCE_AS_DEVELOPMENT_SOURCE", "IMPORT_TO_PROJECT"], + "direct_path_bypass": "FORBIDDEN", "state": "TRACKER_REGISTERED_AWAITING_EVENT_RUNTIME" } diff --git a/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/rejected_path_guard.py b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/rejected_path_guard.py new file mode 100644 index 0000000..a3a1c69 --- /dev/null +++ b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/rejected_path_guard.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +import argparse, json +from pathlib import Path + +REGISTRY = Path(__file__).with_name('HOLOLAKE-LEGACY-PARTS-LIBRARY.json') + +def resolve(candidate): + requested = Path(candidate).expanduser().resolve(strict=False) + registry = json.loads(REGISTRY.read_text()) + for item in registry.get('rejected_paths', []): + blocked = Path(item['path']).resolve(strict=False) + if requested == blocked or blocked in requested.parents: + return {'outcome':'REJECTED','state':'REJECTED_NON_NAVIGABLE','path_id':item['path_id'],'ui_state':'GREY_DISABLED_NON_NAVIGABLE','pointer_events':'NONE','reference_allowed':False,'reason':item['label'],'purification_item':item['purification_item']} + return {'outcome':'PASS','state':'NOT_A_REJECTED_PATH','reference_allowed':True} + +if __name__ == '__main__': + parser=argparse.ArgumentParser(); parser.add_argument('path'); args=parser.parse_args() + result=resolve(args.path); print(json.dumps(result,ensure_ascii=False,indent=2)); raise SystemExit(2 if result['outcome']=='REJECTED' else 0) diff --git a/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/test_rejected_path_guard.py b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/test_rejected_path_guard.py new file mode 100644 index 0000000..b257be2 --- /dev/null +++ b/eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-ZERO-CORE-CONTROL-0001/smart-computer/test_rejected_path_guard.py @@ -0,0 +1,11 @@ +import importlib.util, pathlib, unittest +ROOT=pathlib.Path(__file__).parent +spec=importlib.util.spec_from_file_location('guard',ROOT/'rejected_path_guard.py'); guard=importlib.util.module_from_spec(spec); spec.loader.exec_module(guard) +class Tests(unittest.TestCase): + def test_rejected_root_and_child(self): + root='/Volumes/JZAO/铸渊-ICE-GL-ZY001/CODEX-DEV-20260913/hlp-git-foundation' + self.assertFalse(guard.resolve(root)['reference_allowed']) + self.assertFalse(guard.resolve(root+'/runtime-work')['reference_allowed']) + def test_current_root_allowed(self): + self.assertTrue(guard.resolve('/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main')['reference_allowed']) +if __name__=='__main__': unittest.main()