Add trusted auto-approval migration inventory

This commit is contained in:
2026-05-15 16:56:42 +02:00
parent a2c8ba9442
commit de8d184a4b
11 changed files with 381 additions and 3 deletions

View File

@@ -182,6 +182,40 @@ def test_list_quality_criteria_cli_writes_json(tmp_path):
)
def test_list_legacy_auto_approvals_cli_writes_json_inventory(tmp_path):
service = make_service(tmp_path)
source = write_repo(tmp_path)
repository = service.register_repository(name="Legacy CLI", url=str(source))
summary = service.analyze_repository(repository.id, use_llm_assistance=False)
service.trusted_auto_approve_candidate_graph(
repository.id,
summary.analysis_run.id,
allow_deprecated_migration_mode=True,
)
output_path = tmp_path / "legacy-auto-approvals.json"
exit_code = main(
[
"list-legacy-auto-approvals",
"--format",
"json",
"--output",
str(output_path),
"--database-path",
str(tmp_path / "registry.sqlite3"),
"--checkout-root",
str(tmp_path / "checkouts"),
]
)
records = json.loads(output_path.read_text(encoding="utf-8"))
assert exit_code == 0
assert records[0]["repository_id"] == repository.id
assert records[0]["repository_name"] == "Legacy CLI"
assert records[0]["analysis_run_id"] == summary.analysis_run.id
assert records[0]["current_approved_ability_count"] == 1
def test_self_assess_cli_exports_challenger_and_comparison(tmp_path):
source = write_repo(tmp_path)
golden_path = tmp_path / "golden.json"