#!/usr/bin/env python3
import json
from pathlib import Path
root=Path(__file__).resolve().parents[1]
registry=json.loads((root/'payload/config/agents-registry.json').read_text())
ids=[a['id'] for a in registry['agents']]
assert len(ids)==len(set(ids))==6
assert 'marketing-boss' in ids and 'limbforge' in ids
assert 'ossiguard' not in ids
for aid in ids:
    manifest=json.loads((root/f'payload/agents/definitions/{aid}/agent.manifest.json').read_text())
    assert manifest['brain']['memoryIsolation']=='default'
    assert manifest['externalActionApprovalRequired'] is True
    assert (root/f'payload/agents/definitions/{aid}/SYSTEM_CONTRACT.md').is_file()
limb=json.loads((root/'payload/agents/definitions/limbforge/agent.manifest.json').read_text())
assert 'ossiguard' in limb['modules']
print('PASS: Agent registry and OssiGuard classification')
