fix(e2e): owner attestation required on laptop pairs only (STRA-312 rework)
BA decision after Train A QA (STRA-245 comment 9dcb717a, E2(2)): a server pair needs no owner attestation; a missing one is not a reason and a present one is ignored. validity.py now applies ATTESTATION_MISSING / OWNER only when --machine laptop. Two tests added for the server cases. Golden vectors are unchanged (all attestation vectors are laptop pairs). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
806774609e
commit
eb7fbf6f9d
@@ -148,6 +148,34 @@ class AcceptanceCommands(unittest.TestCase):
|
||||
self.assertEqual(got[2]["reasons"], ["ATTESTATION_MISSING"])
|
||||
self.assertEqual(got[2]["event"], "OWNER")
|
||||
|
||||
def test_ac6_server_pair_needs_no_attestation(self):
|
||||
# BA decision after Train A QA (comment 9dcb717a): E2(2) is laptop-only; a missing attestation on a server pair is no reason,
|
||||
# a present one is ignored (it neither voids nor validates).
|
||||
absent = {"present": False, "identifier": None, "time_utc": None}
|
||||
every_arm = dict((a, {"set": {"hardware.owner_attestation": absent}}) for a in ARMS)
|
||||
fx = Fixture(self, "server", [
|
||||
{"pair": 1, "arms": {}},
|
||||
{"pair": 2, "arms": {"ours": {"set": {"hardware.owner_attestation": absent}}}},
|
||||
{"pair": 3, "arms": every_arm},
|
||||
], expected={1: clean(), 2: clean(), 3: clean()})
|
||||
rc, out, err = fx.run()
|
||||
self.assertEqual(rc, 0, err)
|
||||
got = by_pair(out)
|
||||
for n in (1, 2, 3):
|
||||
self.assertEqual(got[n], {"pair": n, "valid": True, "reasons": [], "event": None}, n)
|
||||
|
||||
def test_ac6_server_pair_other_findings_still_apply_without_attestation(self):
|
||||
absent = {"present": False, "identifier": None, "time_utc": None}
|
||||
spec = pw(574.0, 575.0, 574.5, 600.0)
|
||||
spec["set"]["hardware.owner_attestation"] = absent
|
||||
arms = {"ours": spec}
|
||||
fx = Fixture(self, "server", [{"pair": 1, "arms": arms}], expected={1: clean(False, ["POWER"])})
|
||||
rc, out, err = fx.run()
|
||||
self.assertEqual(rc, 0, err)
|
||||
p = by_pair(out)[1]
|
||||
self.assertEqual(p["reasons"], ["POWER"])
|
||||
self.assertIsNone(p["event"])
|
||||
|
||||
def test_ac7_foreign_load_6_percent_flagged_4_percent_not(self):
|
||||
def fl(pct):
|
||||
return {"vanilla_default": {"set": {"hardware.foreign_load.samples":
|
||||
|
||||
@@ -16,6 +16,9 @@ INTERFACE v1
|
||||
exit 0 = result produced; 2 = ledger/manifest refusal (the offending run ids are named on stdout and stderr);
|
||||
3 = malformed input (also an incomplete pair or a command-line usage error).
|
||||
|
||||
Machine: the `--machine` argument (the same one that selects the E2(1) laptop/server power rules) also selects the E2(2) rule: the owner
|
||||
attestation is required on laptop pairs only (ATTESTATION_MISSING / OWNER); a server pair needs none and a present one is ignored.
|
||||
|
||||
Reason codes: POWER, WORKLOAD, CACHE, INFRASTRUCTURE, ATTESTATION_MISSING, FOREIGN_LOAD, COUNTABLE_MISMATCH.
|
||||
Events: RERUN (attributable infrastructure failure, build-id mismatch, vanilla failure not attributable up to the cap), OWNER (missing
|
||||
attestation, third non-attributable vanilla failure of a slot), FAIL (ours failure not attributable; the series stops FAILED).
|
||||
@@ -246,11 +249,12 @@ def derive_pair(number, recs, fails, machine, sched, arms):
|
||||
reasons, events = set(), []
|
||||
if _power_findings(machine, dict((a, r.get("power_sample_summary")) for a, r in recs.items())):
|
||||
reasons.add("POWER")
|
||||
for r in recs.values(): # E2(2): checked present, not measured
|
||||
att = get_path(r, "hardware.owner_attestation")
|
||||
if not isinstance(att, dict) or att.get("present") is not True:
|
||||
reasons.add("ATTESTATION_MISSING")
|
||||
events.append("OWNER")
|
||||
if machine == "laptop": # E2(2), BA decision after Train A QA (comment 9dcb717a): laptop pairs only; a server pair needs none and ignores one
|
||||
for r in recs.values(): # checked present, not measured
|
||||
att = get_path(r, "hardware.owner_attestation")
|
||||
if not isinstance(att, dict) or att.get("present") is not True:
|
||||
reasons.add("ATTESTATION_MISSING")
|
||||
events.append("OWNER")
|
||||
if _workload_findings(recs):
|
||||
reasons.add("WORKLOAD")
|
||||
if _cache_findings(recs, sched):
|
||||
|
||||
Reference in New Issue
Block a user