60 lines
1.5 KiB
Python
60 lines
1.5 KiB
Python
"""Independent acceptance agents.
|
|
|
|
Simulates independent roles: user representative and architecture reviewer.
|
|
They provide acceptance evidence, not implementation decisions.
|
|
"""
|
|
|
|
from dataclasses import dataclass, asdict
|
|
from datetime import datetime, timezone
|
|
from typing import Any
|
|
|
|
|
|
def utc_now():
|
|
return datetime.now(timezone.utc).isoformat()
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class AcceptanceReport:
|
|
agent: str
|
|
role: str
|
|
decision: str
|
|
evidence: list[str]
|
|
created_at: str = utc_now()
|
|
|
|
def to_dict(self):
|
|
return asdict(self)
|
|
|
|
|
|
class UserAcceptanceAgent:
|
|
def review(self, change: dict[str, Any]) -> AcceptanceReport:
|
|
checks = [
|
|
"user_requirement_match",
|
|
"user_workflow_validation",
|
|
"permission_visibility_check",
|
|
]
|
|
return AcceptanceReport(
|
|
"user-acceptance-agent",
|
|
"user_representative",
|
|
"pass" if change.get("user_facing") else "not_required",
|
|
checks,
|
|
)
|
|
|
|
|
|
class ArchitectureAcceptanceAgent:
|
|
def review(self, change: dict[str, Any]) -> AcceptanceReport:
|
|
checks = [
|
|
"architecture_consistency",
|
|
"scalability_review",
|
|
"security_boundary_review",
|
|
"operability_review",
|
|
]
|
|
return AcceptanceReport(
|
|
"architecture-review-agent",
|
|
"system_architect",
|
|
"pass" if change.get("architecture_impact") else "not_required",
|
|
checks,
|
|
)
|
|
|
|
|
|
__all__ = ["AcceptanceReport", "UserAcceptanceAgent", "ArchitectureAcceptanceAgent"]
|