feat(collab): launch JZAO-only HoloLake stage one
This commit is contained in:
parent
01e8c2ec5c
commit
1dd4a6a39e
17 changed files with 492 additions and 21 deletions
|
|
@ -15,6 +15,8 @@ CONTROL = ROOT / "eternal-lake-heart/heartbeat-core/office-building-current/cont
|
|||
REGISTRY = CONTROL / "HOST-REGISTRY.json"
|
||||
CONTRACT = CONTROL / "EVENT-CONTRACT.json"
|
||||
TASKS = CONTROL / "TASK-BOARD.json"
|
||||
DEVENV = CONTROL / "DEVELOPMENT-ENVIRONMENT.json"
|
||||
CLEANING = CONTROL / "CLEANING-HANDOFF.json"
|
||||
OFFICE_COMPUTER = ROOT / "eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-HOLOLAKE-0001/smart-computer/office_computer.py"
|
||||
MODEL_ROUTER = ROOT / "server-tools/persona-model-smart-router/openlux_router.py"
|
||||
|
||||
|
|
@ -195,6 +197,8 @@ def panel() -> dict[str, Any]:
|
|||
"autonomous_host_decisions": decisions[-40:],
|
||||
"invalid_events": scanned["invalid_events"],
|
||||
"event_count": len(events),
|
||||
"development_environment": load(DEVENV),
|
||||
"cleaning_handoff": load(CLEANING),
|
||||
"panel_persisted": False,
|
||||
"authority_granted": False,
|
||||
}
|
||||
|
|
@ -232,6 +236,7 @@ def mentions(development_id: str) -> dict[str, Any]:
|
|||
|
||||
def audit() -> dict[str, Any]:
|
||||
registry, contract, task_board = load(REGISTRY), load(CONTRACT), load(TASKS)
|
||||
devenv, cleaning = load(DEVENV), load(CLEANING)
|
||||
errors = []
|
||||
ids = [item["development_id"] for item in registry.get("hosts", [])]
|
||||
if ids != ["HLP-TDEV-CODEX-0001", "HLP-TDEV-ZCODE-0001", "HLP-TDEV-QWEN-0001", "HLP-TDEV-DOUBAO-0001"]:
|
||||
|
|
@ -242,6 +247,10 @@ def audit() -> dict[str, Any]:
|
|||
errors.append("TRANSPORT_TRUTH_MISMATCH")
|
||||
if task_board.get("shared_file_is_definition_not_live_mutation_target") is not True:
|
||||
errors.append("TASK_BOARD_MULTIWRITER_RISK")
|
||||
if any(not str(value).startswith("/Volumes/JZAO/") for value in [*devenv.get("source_roots", {}).values(), *devenv.get("generated_output_roots", {}).values()]):
|
||||
errors.append("DEVELOPMENT_ROOT_OUTSIDE_JZAO")
|
||||
if cleaning.get("direct_delete_allowed") is not False or cleaning.get("whole_disk_discovery") is not False:
|
||||
errors.append("CLEANING_HANDOFF_DESTRUCTIVE_OR_DISCOVERY_ENABLED")
|
||||
scanned = scan()
|
||||
if scanned["invalid_events"]:
|
||||
errors.append("INVALID_HOST_EVENTS_PRESENT")
|
||||
|
|
|
|||
|
|
@ -67,6 +67,14 @@ class MultipathConsoleTest(unittest.TestCase):
|
|||
self.assertTrue(any(item.startswith("AUTONOMOUS_DECISION_FIELDS_REQUIRED") for item in errors))
|
||||
self.assertIn("AUTONOMOUS_DECISION_BRAIN_READBACK_INVALID", errors)
|
||||
|
||||
def test_all_development_roots_are_on_jzao_and_cleanup_is_reviewed(self):
|
||||
panel = MODULE.panel()
|
||||
devenv = panel["development_environment"]
|
||||
roots = [*devenv["source_roots"].values(), *devenv["generated_output_roots"].values()]
|
||||
self.assertTrue(all(path.startswith("/Volumes/JZAO/") for path in roots))
|
||||
self.assertFalse(panel["cleaning_handoff"]["direct_delete_allowed"])
|
||||
self.assertFalse(panel["cleaning_handoff"]["whole_disk_discovery"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -4,6 +4,15 @@ from pathlib import Path
|
|||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
def normalize_channel_id(channel, rows):
|
||||
if channel is None:
|
||||
return None, 'NO_CHANNEL_PROVIDED'
|
||||
requested = str(channel).strip()
|
||||
matches = [item['id'] for item in rows if requested == item['id'] or requested in item.get('machine_aliases', [])]
|
||||
if len(matches) != 1:
|
||||
raise ValueError('UNKNOWN_OR_AMBIGUOUS_PRIVATE_CHANNEL')
|
||||
return matches[0], 'EXACT' if requested == matches[0] else 'MACHINE_ALIAS_NORMALIZED'
|
||||
|
||||
def load_channels(channel=None, root=ROOT):
|
||||
data = json.loads((root / 'routing/persona-channel-context-map.json').read_text())
|
||||
if data['map_id'] != 'ZY-PERSONA-CHANNEL-CONTEXT-001':
|
||||
|
|
@ -21,8 +30,8 @@ def load_channels(channel=None, root=ROOT):
|
|||
if profile['world_path'] != registered['world_path']:
|
||||
raise ValueError('CHANNEL_PATH_MISMATCH')
|
||||
item['world_path'] = profile['world_path']
|
||||
if channel is not None and channel not in {c['id'] for c in rows}:
|
||||
raise ValueError('UNKNOWN_PRIVATE_CHANNEL')
|
||||
return {**data, 'selected_channel': next((c for c in rows if c['id'] == channel), None),
|
||||
'selection_state': 'PERSONA_SELECTED' if channel else 'PERSONA_INTERPRETATION_REQUIRED',
|
||||
normalized, normalization_state = normalize_channel_id(channel, rows)
|
||||
return {**data, 'requested_channel': channel, 'normalized_channel': normalized, 'channel_normalization_state': normalization_state,
|
||||
'selected_channel': next((c for c in rows if c['id'] == normalized), None),
|
||||
'selection_state': 'PERSONA_SELECTED' if normalized else 'PERSONA_INTERPRETATION_REQUIRED',
|
||||
'authority_granted': False}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,17 @@ class ChannelContextTests(unittest.TestCase):
|
|||
for id in ['ICE-CH-HB001', 'ICE-CH-LB001', 'ICE-CH-ZC001', 'ICE-CH-DK001']:
|
||||
self.assertEqual(load_channels(id)['selected_channel']['id'], id)
|
||||
|
||||
def test_short_machine_aliases_normalize_before_architecture_agent(self):
|
||||
pairs = [('HB001','ICE-CH-HB001'), ('LB001','ICE-CH-LB001'), ('ZC001','ICE-CH-ZC001'), ('DK001','ICE-CH-DK001'), ('BT001','ICE-CH-BT001')]
|
||||
for alias, expected in pairs:
|
||||
value = load_channels(alias)
|
||||
self.assertEqual(value['normalized_channel'], expected)
|
||||
self.assertEqual(value['selected_channel']['id'], expected)
|
||||
self.assertEqual(value['channel_normalization_state'], 'MACHINE_ALIAS_NORMALIZED')
|
||||
|
||||
def test_public_and_unknown_not_silently_routed_private(self):
|
||||
for id in ['CH-ZERO-CORE-LPM', 'not-a-channel']:
|
||||
with self.assertRaisesRegex(ValueError, 'UNKNOWN_PRIVATE_CHANNEL'):
|
||||
with self.assertRaisesRegex(ValueError, 'UNKNOWN_OR_AMBIGUOUS_PRIVATE_CHANNEL'):
|
||||
load_channels(id)
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
||||
|
|
|
|||
|
|
@ -95,15 +95,16 @@ def load_context(host, intent, channel=None):
|
|||
architecture_mode = os.environ.get('PERSONA_ARCHITECTURE_OFFICIAL_MODE', 'verify')
|
||||
if architecture_mode not in {'verify', 'local-only'}:
|
||||
raise ValueError('PERSONA_ARCHITECTURE_OFFICIAL_MODE_INVALID')
|
||||
channel_context = load_channels(channel)
|
||||
selected_channel = channel_context['selected_channel']
|
||||
canonical_channel = selected_channel['id'] if selected_channel else None
|
||||
architecture_args = [
|
||||
sys.executable, str(ARCHITECTURE_AGENT), '--persona', topology['persona_id'],
|
||||
'--host', host_id, '--official-mode', architecture_mode, '--format', 'json'
|
||||
]
|
||||
if channel:
|
||||
architecture_args.extend(['--channel', channel])
|
||||
if canonical_channel:
|
||||
architecture_args.extend(['--channel', canonical_channel])
|
||||
architecture_perception = command_json(architecture_args, timeout=60)
|
||||
channel_context = load_channels(channel)
|
||||
selected_channel = channel_context['selected_channel']
|
||||
selected_channel_id = selected_channel['id'] if selected_channel else 'DYNAMIC_CHANNEL_PENDING_PERSONA_INTERPRETATION'
|
||||
intent_sha256 = hashlib.sha256(intent.encode('utf-8')).hexdigest()
|
||||
session_id = os.environ.get('CODEX_THREAD_ID') or os.environ.get('CODEX_SESSION_ID') or f'{host_id}:{current["current_day"]}:{intent_sha256[:16]}'
|
||||
|
|
|
|||
Loading…
Reference in a new issue