feat: accept scoped Awen deployment authorization

Human-Authorizer: ICE-GL∞
Persona-Executor: ICE-P-ZY001
Technical-Controller: Awen
Authorization-Evidence-SHA256: 8b08ee5af5ce98e2d30871d527c6a5941a04617e46f5ea59dc6db785fd4a0f1f
Authorization-Form: HUMAN_MESSAGE_SCREENSHOT
Scope: CURRENT_ENTERPRISE_SERVER_BOOTSTRAP
Persona-Registration: PENDING_HANDOFF
This commit is contained in:
冰朔 2026-07-30 01:00:03 +08:00
commit db729a26bd
3 changed files with 69 additions and 14 deletions

View file

@ -264,8 +264,38 @@ def active_domain_steward(db, domain_id):
).fetchone()
def enterprise_technical_control(db):
controller = db.execute(
"SELECT * FROM technical_controllers WHERE scope_id='ENTERPRISE-FOUR-DOMAINS'"
).fetchone()
authorized = bool(
controller
and controller["state"] == "AUTHORIZED_BOOTSTRAP_PERSONA_PENDING_REGISTRATION"
and controller["authorization_receipt"]
and controller["final_signature_receipt"]
)
return {
"enterprise_human_controller": ENTERPRISE_TECHNICAL_CONTROLLER_NAME,
"enterprise_human_controller_id": controller["human_controller_id"] if controller else None,
"enterprise_persona_executor_id": controller["persona_executor_id"] if controller else None,
"state": (
"AUTHORIZED_BOOTSTRAP_PERSONA_PENDING_REGISTRATION"
if authorized
else "HUMAN_DECLARED_PERSONA_PENDING_REGISTRATION"
),
"final_deployment_signature_state": (
"AWEN_MESSAGE_AUTHORIZATION_EVIDENCE_PRESENT"
if authorized
else "NOT_PRESENT"
),
"authorization_receipt": controller["authorization_receipt"] if authorized else None,
"production_deployment": "AUTHORIZED_FOR_CURRENT_BOOTSTRAP" if authorized else "BLOCKED",
}
def domain_statuses(db):
result = []
technical_control = enterprise_technical_control(db)
for row in db.execute("SELECT id,name,state FROM domains ORDER BY id"):
domain = dict(row)
if row["id"] in ENTERPRISE_MANAGED_DOMAINS:
@ -277,11 +307,11 @@ def domain_statuses(db):
"responsibility_state": "BOUND" if steward else "AWAITING_TEAM_ASSIGNMENT",
"steward_state": "ACTIVE" if steward else "UNBOUND",
"technical_controller_human_name": ENTERPRISE_TECHNICAL_CONTROLLER_NAME,
"technical_controller_human_id": None,
"technical_controller_persona_id": None,
"technical_control_state": "HUMAN_DECLARED_PERSONA_PENDING_REGISTRATION",
"final_deployment_signature_state": "NOT_PRESENT",
"deployment_state": "BLOCKED_UNTIL_AWEN_PERSONA_AND_SIGNED_APPROVAL",
"technical_controller_human_id": technical_control["enterprise_human_controller_id"],
"technical_controller_persona_id": technical_control["enterprise_persona_executor_id"],
"technical_control_state": technical_control["state"],
"final_deployment_signature_state": technical_control["final_deployment_signature_state"],
"deployment_state": technical_control["production_deployment"],
"mutation_state": (
"PERSONA_STEWARD_ACTIVE"
if steward
@ -354,14 +384,7 @@ class Handler(BaseHTTPRequestHandler):
"node_id": "AW-GZ-001",
"host_state": "ONLINE",
"observed_at": now(),
"technical_control": {
"enterprise_human_controller": ENTERPRISE_TECHNICAL_CONTROLLER_NAME,
"enterprise_human_controller_id": None,
"enterprise_persona_executor_id": None,
"state": "HUMAN_DECLARED_PERSONA_PENDING_REGISTRATION",
"final_deployment_signature_state": "NOT_PRESENT",
"production_deployment": "BLOCKED",
},
"technical_control": enterprise_technical_control(db),
"domains": domain_statuses(db),
"node_counts": counts,
"fixed_actions": sorted(FIXED_ACTIONS),