32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from .base import WorkerAdapter
|
|
|
|
|
|
class HermesAdapter(WorkerAdapter):
|
|
worker_name = "hermes"
|
|
|
|
def capabilities(self) -> list[str]:
|
|
return ["architecture.review", "policy.review", "threat.model"]
|
|
|
|
def claim(self, task):
|
|
return {"worker": self.worker_name, "task_id": task.task_id, "status": "claimed"}
|
|
|
|
def execute(self, task, claim):
|
|
return {"worker": self.worker_name, "task_id": task.task_id, "status": "SHADOW_VERIFIED", "claim_id": claim.claim_id, "execution_mode": "shadow", "production_side_effects": False}
|
|
|
|
def heartbeat(self, claim):
|
|
return {"worker": self.worker_name, "claim_id": claim.claim_id, "status": "alive"}
|
|
|
|
def report_progress(self, claim, progress):
|
|
return {"worker": self.worker_name, "claim_id": claim.claim_id, "progress": progress}
|
|
|
|
def probe(self, claim):
|
|
return {"worker": self.worker_name, "claim_id": claim.claim_id, "status": claim.status}
|
|
|
|
def cancel(self, claim):
|
|
return {"worker": self.worker_name, "claim_id": claim.claim_id, "status": "cancelled"}
|
|
|
|
def collect_result(self, claim):
|
|
return {"worker": self.worker_name, "claim_id": claim.claim_id, "result": "not_collected"}
|