feat: add autonomous fiscal completion v1
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""Evidence-gated origin resolution; CST digits are never an origin source."""
|
||||
|
||||
|
||||
def resolve_origin(product_id: str, aggregate: dict, kb_facts: dict) -> dict:
|
||||
if aggregate.get("conflict_count", 0):
|
||||
status = "ORIGIN_CONFLICT"
|
||||
elif aggregate.get("strong_evidence") and aggregate.get("value") in {str(i) for i in range(9)}:
|
||||
status = "ORIGIN_CONFIRMED"
|
||||
else:
|
||||
status = "ORIGIN_NEEDS_EVIDENCE"
|
||||
return {
|
||||
"product_id": product_id,
|
||||
"status": status,
|
||||
"value": aggregate.get("value") if status == "ORIGIN_CONFIRMED" else None,
|
||||
"provenance": aggregate.get("provenance", []),
|
||||
"reason": "explicit supplier observations only; CST digit ignored",
|
||||
}
|
||||
Reference in New Issue
Block a user