Prepare 0.2.0 Gate B pilot candidate
Build and verify web migration / verify (push) Has been cancelled
Build and verify web migration / verify (push) Has been cancelled
This commit is contained in:
@@ -34,7 +34,7 @@ def timestamp(value: object, field: str) -> dt.datetime:
|
||||
|
||||
def validate(record: object) -> None:
|
||||
require(isinstance(record, dict), "Approval record must be a JSON object.")
|
||||
require(record.get("schemaVersion") == 1, "Unsupported approval schema.")
|
||||
require(record.get("schemaVersion") == 2, "Unsupported approval schema; Gate B 0.2.0 requires schemaVersion 2.")
|
||||
gate = record.get("targetGate")
|
||||
require(gate in ("B", "C"), "targetGate must be B or C.")
|
||||
require(record.get("decision") == "approved", "Only an explicit approved decision passes validation.")
|
||||
@@ -83,6 +83,8 @@ def validate(record: object) -> None:
|
||||
require(isinstance(capacity, dict), "Capacity thresholds and observations are required.")
|
||||
require(re.fullmatch(r"[0-9a-f]{64}", str(capacity.get("reportSha256", ""))) is not None,
|
||||
"capacity.reportSha256 must identify the retained probe report.")
|
||||
require(re.fullmatch(r"[0-9a-f]{64}", str(capacity.get("hostMetricsSha256", ""))) is not None,
|
||||
"capacity.hostMetricsSha256 must identify the retained host metrics.")
|
||||
for observed, target in (("observedP95Ms", "targetP95Ms"), ("observedErrorRate", "targetErrorRate")):
|
||||
values = (capacity.get(observed), capacity.get(target))
|
||||
require(all(isinstance(value, (int, float)) and not isinstance(value, bool) for value in values)
|
||||
@@ -94,6 +96,21 @@ def validate(record: object) -> None:
|
||||
require(all(isinstance(value, int) and not isinstance(value, bool) for value in concurrency)
|
||||
and capacity["observedConcurrency"] >= capacity["targetConcurrency"] > 0,
|
||||
"Observed concurrency must meet the approved positive target.")
|
||||
for resource in ("Cpu", "Memory"):
|
||||
target = capacity.get(f"target{resource}HeadroomPercent")
|
||||
observed = capacity.get(f"observed{resource}HeadroomPercent")
|
||||
require(all(isinstance(value, (int, float)) and not isinstance(value, bool) for value in (target, observed))
|
||||
and 25 <= target <= observed <= 100,
|
||||
f"Observed {resource.lower()} headroom must meet the approved target of at least 25 percent.")
|
||||
|
||||
pilot = record.get("pilot")
|
||||
require(isinstance(pilot, dict), "A supervised pilot summary is required.")
|
||||
require(re.fullmatch(r"[0-9a-f]{64}", str(pilot.get("recordSha256", ""))) is not None,
|
||||
"pilot.recordSha256 must identify the retained pilot run record.")
|
||||
require(pilot.get("businessDaysObserved") == 5, "The pilot must cover exactly five business days.")
|
||||
require(pilot.get("hotelsObserved") == 1, "The Gate B pilot must cover exactly one hotel.")
|
||||
require(pilot.get("stopConditionsObserved") == 0, "A pilot with a stop condition cannot be approved.")
|
||||
require(pilot.get("unresolvedFindings") == 0, "All pilot findings must be resolved or explicitly contained.")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
||||
Reference in New Issue
Block a user