refactor: implement concrete Delivery responsibility dispositions

This commit is contained in:
jarvis-at-skic committed 2026-10-23 08:11:39 +00:00
1 parent b813e4c61d
commit f4b553a6e3
3 files changed
+60

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
[
"Stop when the policy cannot be loaded",
"presence only",
"never inspect, hash or measure",
"Reject unexpected redirects",
"not authority to administer accounts",
"separately verified delegation",
"Never persist"
]
+21
View File
@@ -0,0 +1,21 @@
"""Safeguard validation with negative mutation controls; no live operations."""
from pathlib import Path
import json,unittest
ROOT=Path(__file__).resolve().parents[1]
CLAUSES=json.loads((Path(__file__).parent/'contract.json').read_text())
def validate(text):
missing=[s for s in CLAUSES if s.lower() not in text.lower()]
if missing: raise ValueError(missing)
class Contract(unittest.TestCase):
def test_published_procedure_has_all_safeguards(self):
validate((ROOT/'SKILL.md').read_text())
def test_each_removed_safeguard_is_rejected(self):
text=(ROOT/'SKILL.md').read_text().lower()
for s in CLAUSES:
with self.subTest(s=s),self.assertRaises(ValueError):validate(text.replace(s.lower(),''))
def test_procedure_not_an_empty_router(self):
text=(ROOT/'SKILL.md').read_text()
self.assertIn('## Verification' if '## Verification' in text else 'verification',text)
self.assertTrue('Stop' in text or 'stop' in text or 'status unverified' in text)
self.assertTrue('## Procedure' in text or '## Failure-Repair Workflow' in text or '## Scope Status Vocabulary' in text)
if __name__=='__main__':unittest.main()