[verified] Gate adoption of delegated evidence
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
"""Procedural consumer wiring is not proof of live agent execution."""
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
ROLES = [
|
||||
'agents/impl/skills/gitea-issue-implementation/SKILL.md',
|
||||
'agents/impl/skills/gitea-issue-rework/SKILL.md',
|
||||
'agents/spec/skills/gitea-implementation-spec-review/SKILL.md',
|
||||
'agents/review/skills/gitea-code-review/SKILL.md',
|
||||
]
|
||||
|
||||
|
||||
class DelegationEvidenceContractTests(unittest.TestCase):
|
||||
def test_consumers_require_gate_before_adoption(self):
|
||||
for path in ROLES:
|
||||
with self.subTest(path=path):
|
||||
text = (ROOT / path).read_text()
|
||||
for required in ['## Delegation evidence acceptance gate',
|
||||
'delegation_evidence.py', '위임 결과 채택 이전',
|
||||
'main이 독립적으로 고정한 context',
|
||||
'worker 자기 선언으로 context를 만들지 않는다']:
|
||||
self.assertIn(required, text)
|
||||
|
||||
def test_canonical_contract_names_cli_and_schema(self):
|
||||
text = (ROOT / 'operations/repository-cache.md').read_text()
|
||||
for required in ['### Delegation evidence acceptance preflight',
|
||||
'--bundle-root', '--context', '--result', '--git-dir',
|
||||
'gitea-agent.delegation-evidence-context/v1',
|
||||
'gitea-agent.delegation-evidence-result/v1']:
|
||||
self.assertIn(required, text)
|
||||
|
||||
def test_source_modes_and_coverage_limits_are_explicit(self):
|
||||
text = (ROOT / 'operations/repository-cache.md').read_text()
|
||||
for required in ['captured_worktree', 'base_revision', 'git_tree',
|
||||
'bundle에 없다는 이유로 repository 부재로 판정하지 않는다',
|
||||
'named symbol 존재는 assertion 검출력을 인증하지 않는다',
|
||||
'제품의 추가 evidence commit이나 전체 테스트 재실행 의무를 만들지 않는다']:
|
||||
self.assertIn(required, text)
|
||||
|
||||
def test_trusted_execution_catalog_and_failure_origin_limits(self):
|
||||
text = (ROOT / 'operations/repository-cache.md').read_text()
|
||||
for required in ['독립 실행 catalog', 'import·환경 오류는 RED로 인정하지 않는다',
|
||||
'허용 작업', '실제 command/output/exit와 실패 원인',
|
||||
'gate는 context의 신뢰성을 스스로 인증하지 않는다']:
|
||||
self.assertIn(required, text)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user