fix: commit semantic repair changes

This commit is contained in:
2026-03-21 11:22:25 +03:00
parent 0900208c1a
commit abee05558f
272 changed files with 4603 additions and 1668 deletions

View File

@@ -1,11 +1,9 @@
# [DEF:backend.tests.services.clean_release.test_publication_service:Module]
# [DEF:TestPublicationService:Module]
# @RELATION: BELONGS_TO -> SrcRoot
# @COMPLEXITY: 5
# @SEMANTICS: tests, clean-release, publication, revoke, gate
# @PURPOSE: Define publication gate contracts over approved candidates and immutable publication records.
# @LAYER: Tests
# @RELATION: TESTS -> src.services.clean_release.publication_service
# @RELATION: TESTS -> src.services.clean_release.approval_service
# @RELATION: TESTS -> src.services.clean_release.repository
# @INVARIANT: Publish requires approval; revoke requires existing publication; republish after revoke is allowed as a new record.
from __future__ import annotations
@@ -21,6 +19,7 @@ from src.services.clean_release.repository import CleanReleaseRepository
# [DEF:_seed_candidate_with_passed_report:Function]
# @RELATION: BINDS_TO -> TestPublicationService
# @PURPOSE: Seed candidate/report fixtures for publication gate scenarios.
# @PRE: candidate_id and report_id are non-empty.
# @POST: Repository contains candidate and PASSED report.
@@ -57,6 +56,7 @@ def _seed_candidate_with_passed_report(
# [DEF:test_publish_without_approval_rejected:Function]
# @RELATION: BINDS_TO -> TestPublicationService
# @PURPOSE: Ensure publish action is blocked until candidate is approved.
# @PRE: Candidate has PASSED report but status is not APPROVED.
# @POST: publish_candidate raises PublicationGateError.
@@ -80,6 +80,7 @@ def test_publish_without_approval_rejected():
# [DEF:test_revoke_unknown_publication_rejected:Function]
# @RELATION: BINDS_TO -> TestPublicationService
# @PURPOSE: Ensure revocation is rejected for unknown publication id.
# @PRE: Repository has no matching publication record.
# @POST: revoke_publication raises PublicationGateError.
@@ -99,6 +100,7 @@ def test_revoke_unknown_publication_rejected():
# [DEF:test_republish_after_revoke_creates_new_active_record:Function]
# @RELATION: BINDS_TO -> TestPublicationService
# @PURPOSE: Ensure republish after revoke is allowed and creates a new ACTIVE record.
# @PRE: Candidate is APPROVED and first publication has been revoked.
# @POST: New publish call returns distinct publication id with ACTIVE status.
@@ -145,4 +147,4 @@ def test_republish_after_revoke_creates_new_active_record():
assert second.status == PublicationStatus.ACTIVE.value
# [/DEF:test_republish_after_revoke_creates_new_active_record:Function]
# [/DEF:backend.tests.services.clean_release.test_publication_service:Module]
# [/DEF:TestPublicationService:Module]