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

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import json
import os
import sqlite3
import subprocess
import sys
import tempfile
@ -75,6 +76,7 @@ with tempfile.TemporaryDirectory() as temp:
"enterprise_persona_executor_id": None,
"state": "HUMAN_DECLARED_PERSONA_PENDING_REGISTRATION",
"final_deployment_signature_state": "NOT_PRESENT",
"authorization_receipt": None,
"production_deployment": "BLOCKED",
}
assert {domain["state"] for domain in status["domains"] if domain["id"] != "DOMAIN-FIFTH"} == {
@ -95,7 +97,7 @@ with tempfile.TemporaryDirectory() as temp:
domain["deployment_state"]
for domain in status["domains"]
if domain["id"] != "DOMAIN-FIFTH"
} == {"BLOCKED_UNTIL_AWEN_PERSONA_AND_SIGNED_APPROVAL"}
} == {"BLOCKED"}
assert all(
domain["human_steward_id"] is None and domain["persona_steward_id"] is None
for domain in status["domains"]
@ -109,6 +111,31 @@ with tempfile.TemporaryDirectory() as temp:
assert fifth["final_deployment_signature_state"] == "REQUIRED_PER_CHANGE"
assert status["node_counts"]["ACTIVE"] == 4
with sqlite3.connect(env["LIGHTHOUSE_DB"]) as db:
db.execute(
"""INSERT INTO technical_controllers
(scope_id, human_display_name, human_controller_id, persona_executor_id,
persona_public_key, runtime_node_id, authorization_receipt,
final_signature_receipt, state, registered_at)
VALUES (?, ?, NULL, NULL, NULL, NULL, ?, ?,
'AUTHORIZED_BOOTSTRAP_PERSONA_PENDING_REGISTRATION', ?)""",
(
"ENTERPRISE-FOUR-DOMAINS",
"Awen",
"sha256:test-awen-message",
"sha256:test-awen-message",
int(time.time()),
),
)
authorized = json.load(urllib.request.urlopen(BASE + "/v1/status"))
assert authorized["technical_control"]["production_deployment"] == "AUTHORIZED_FOR_CURRENT_BOOTSTRAP"
assert authorized["technical_control"]["authorization_receipt"] == "sha256:test-awen-message"
assert {
domain["deployment_state"]
for domain in authorized["domains"]
if domain["id"] != "DOMAIN-FIFTH"
} == {"AUTHORIZED_FOR_CURRENT_BOOTSTRAP"}
nodes = json.load(urllib.request.urlopen(BASE + "/v1/nodes"))["nodes"]
hosted = {node["domain_id"]: node for node in nodes}
assert set(hosted) == {"DOMAIN-MAIN", "DOMAIN-SUB", "DOMAIN-ZERO", "DOMAIN-ZS"}