"""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()