diff --git a/config/roles/clan/zhos/agents_registry.yaml b/config/roles/clan/zhos/agents_registry.yaml new file mode 100644 index 00000000..085c5258 --- /dev/null +++ b/config/roles/clan/zhos/agents_registry.yaml @@ -0,0 +1,109 @@ +version: 1 +source_of_truth: clan.zhos +manager: + agent_id: spirit_orchestrator + aliases: [clan] + role: Spirit-Orchestrator + prompt_path: roles/clan/zhos/orchestrator.md + class: manager + default_visibility: incircle + max_parallel_group: + heavy: 1 + support: 1 + +constitution: + prompt_path: roles/clan/zhos/JOS_BASE.md + version: JOS-BASE-1.1 + +workers: + - agent_id: process + role: Agent-Process + prompt_path: roles/clan/zhos/process.md + class: heavy + triggers: [decision, circle, objections, harmonization] + allowed_outputs: [agenda_draft, decision_flow_draft, meeting_protocol, testimony_draft, action_plan] + default_visibility: incircle + - agent_id: privacy_sentinel + role: Agent-Privacy-Sentinel + prompt_path: roles/clan/zhos/privacy_sentinel.md + class: support + triggers: [sensitive_topic, export_intent, visibility_conflict] + allowed_outputs: [visibility_decision_draft, redaction_plan, sanitized_versions, export_payload_validation] + default_visibility: soulsafe + - agent_id: gate_policy + role: Agent-Gate-Policy + prompt_path: roles/clan/zhos/gate_policy.md + class: heavy + triggers: [access_change, grant_request, policy_eval] + allowed_outputs: [policy_draft, access_decision_draft, consent_requirements, audit_visibility_rules] + default_visibility: incircle + - agent_id: identity + role: Agent-Identity + prompt_path: roles/clan/zhos/identity.md + class: heavy + triggers: [step_up, recovery, did_vc] + allowed_outputs: [identity_flow_draft, did_vc_draft, recovery_policy_draft, rotation_policy_draft] + default_visibility: incircle + - agent_id: core_guardian + role: Agent-Core-Guardian + prompt_path: roles/clan/zhos/core_guardian.md + class: heavy + triggers: [core_change, constitution_change] + allowed_outputs: [core_change_draft, impact_report, compatibility_check, versioning_notes] + default_visibility: incircle + - agent_id: bridge + role: Agent-Bridge + prompt_path: roles/clan/zhos/bridge.md + class: heavy + triggers: [external_action, export] + allowed_outputs: [bridge_request_draft, payload_minimization_plan, execution_checklist] + default_visibility: incircle + - agent_id: gifts + role: Agent-Gifts + prompt_path: roles/clan/zhos/gifts.md + class: heavy + triggers: [gift_pool, allocation] + allowed_outputs: [gift_record_draft, allocation_proposal, pool_policy_draft] + default_visibility: incircle + - agent_id: sync + role: Agent-Sync + prompt_path: roles/clan/zhos/sync.md + class: heavy + triggers: [offline_import, merge_conflict, desync] + allowed_outputs: [offline_import_draft, sync_batch_manifest, merge_proposal, conflict_report] + default_visibility: incircle + - agent_id: audit_log + role: Agent-Audit-Log + prompt_path: roles/clan/zhos/audit_log.md + class: support + triggers: [policy_breach, integrity_metrics, slo] + allowed_outputs: [audit_policy_draft, event_schema_draft, integrity_report_draft, alert_rules_draft] + default_visibility: incircle + - agent_id: infra_health + role: Agent-Infra-Health + prompt_path: roles/clan/zhos/infra_health.md + class: support + triggers: [degradation, restore, infrastructure_incident] + allowed_outputs: [health_spec_draft, degradation_plan, backup_restore_plan, runbook] + default_visibility: incircle + - agent_id: research_scout + role: Agent-Research-Scout + prompt_path: roles/clan/zhos/research_scout.md + class: support + triggers: [external_facts, source_compare, fact_check] + allowed_outputs: [research_brief, source_list, comparison_table, citation_pack] + default_visibility: incircle + - agent_id: ritual_field + role: Agent-Ritual-Field + prompt_path: roles/clan/zhos/ritual_field.md + class: support + triggers: [field_pulse, ritual, deescalation] + allowed_outputs: [field_pulse_record_draft, practice_pack, script_draft, reminder_set] + default_visibility: incircle + - agent_id: memory + role: Agent-Memory + prompt_path: roles/clan/zhos/memory.md + class: support + triggers: [recall, summary, timeline] + allowed_outputs: [recall_summary, record_draft, testimony_draft, timeline, conflict_report] + default_visibility: incircle diff --git a/services/router/runtime_guard.py b/services/router/runtime_guard.py index f4034103..da7c9cad 100644 --- a/services/router/runtime_guard.py +++ b/services/router/runtime_guard.py @@ -123,14 +123,22 @@ class RuntimeGuard: ) def get_agent(self, agent_id: str) -> Optional[Dict[str, Any]]: + def _matches(entry: Dict[str, Any], requested_id: str) -> bool: + if entry.get("agent_id") == requested_id: + return True + aliases = entry.get("aliases") + if isinstance(aliases, list): + return requested_id in {str(a) for a in aliases} + return False + workers = self.registry.get("workers", []) if not isinstance(workers, list): return None for w in workers: - if isinstance(w, dict) and w.get("agent_id") == agent_id: + if isinstance(w, dict) and _matches(w, agent_id): return w mgr = self.registry.get("manager") - if isinstance(mgr, dict) and mgr.get("agent_id") == agent_id: + if isinstance(mgr, dict) and _matches(mgr, agent_id): return mgr return None