Initial commit: add .gitignore and README
This commit is contained in:
32
fusionagi/maa/layers/process_authority.py
Normal file
32
fusionagi/maa/layers/process_authority.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""Layer 5 — Manufacturing Process Authority."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class ProcessEligibilityResult(BaseModel):
|
||||
eligible: bool = Field(...)
|
||||
process_type: str = Field(...)
|
||||
reason: str | None = Field(default=None)
|
||||
|
||||
|
||||
class ProcessAuthority:
|
||||
"""Evaluates eligibility for additive, subtractive, hybrid."""
|
||||
|
||||
def process_eligible(
|
||||
self,
|
||||
design_ref: str,
|
||||
process_type: str,
|
||||
context: dict[str, Any] | None = None,
|
||||
) -> ProcessEligibilityResult:
|
||||
if not design_ref or not process_type:
|
||||
return ProcessEligibilityResult(
|
||||
eligible=False,
|
||||
process_type=process_type or "unknown",
|
||||
reason="design_ref and process_type required",
|
||||
)
|
||||
pt = process_type.lower()
|
||||
if pt not in ("additive", "subtractive", "hybrid"):
|
||||
return ProcessEligibilityResult(eligible=False, process_type=process_type, reason="Unknown process_type")
|
||||
return ProcessEligibilityResult(eligible=True, process_type=pt, reason=None)
|
||||
Reference in New Issue
Block a user