Files
gitea-agent/harness/tests/common/test_delegation_adoption_contract_docs.py
T

36 lines
1.5 KiB
Python

"""Executable consumer declaration contract wiring."""
from pathlib import Path
from harness.tests.common.impl_contract_docs import read_contract
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 = read_contract(ROOT / 'harness/agents' / path / 'SKILL.md')
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()