[verified] Enforce delegation adoption at runtime consumers

This commit is contained in:
2026-10-11 07:11:40 +00:00
parent 9367d5a3a1
commit 6cb2317667
19 changed files with 1112 additions and 47 deletions
@@ -0,0 +1,34 @@
"""Executable consumer declaration contract wiring."""
from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parents[3]
class DelegationAdoptionContractTests(unittest.TestCase):
def test_common_runtime_contract_is_explicit(self):
text = (ROOT / 'harness/operations/repository-cache.md').read_text()
for token in ('require_adoption', 'expected_source', 'expected_stage',
'--no-delegated-evidence', '--delegation-adoption',
'spec-review', 'code-review', 'implementation-delivery',
'PASS receipt', 'sandbox'):
with self.subTest(token=token):
self.assertIn(token, text)
def test_each_consumer_skill_requires_runtime_declaration(self):
paths = (
'spec/skills/gitea-implementation-spec-review',
'impl/skills/gitea-issue-implementation',
'impl/skills/gitea-issue-rework',
'review/skills/gitea-code-review',
)
for path in paths:
text = (ROOT / 'harness/agents' / path / 'SKILL.md').read_text()
with self.subTest(path=path):
self.assertIn('require_adoption', text)
self.assertIn('mode', text)
self.assertIn('none', text)
self.assertIn('delegated', text)
self.assertIn('delegation-adoption-runtime-consumption', text)
if __name__ == '__main__':
unittest.main()