semantics

This commit is contained in:
2026-05-26 09:30:41 +03:00
parent 948584865c
commit d5cf5f0cf7
622 changed files with 7949 additions and 5628 deletions

View File

@@ -1,7 +1,7 @@
# [DEF:test_candidate_manifest_services:Module]
# @RELATION: BELONGS_TO -> [SrcRoot:Module]
# #region test_candidate_manifest_services [C:2] [TYPE Module]
# @RELATION BINDS_TO -> [SrcRoot]
# @PURPOSE: Test lifecycle and manifest versioning for release candidates.
# @LAYER: Tests
# @LAYER Tests
from datetime import UTC, datetime
@@ -30,8 +30,8 @@ def db_session():
session.close()
# [DEF:test_candidate_lifecycle_transitions:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_candidate_lifecycle_transitions [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify release candidate allows legal status transitions and rejects forbidden back-transitions.
def test_candidate_lifecycle_transitions(db_session):
"""
@@ -59,11 +59,11 @@ def test_candidate_lifecycle_transitions(db_session):
candidate.transition_to(CandidateStatus.DRAFT)
# [/DEF:test_candidate_lifecycle_transitions:Function]
# #endregion test_candidate_lifecycle_transitions
# [DEF:test_manifest_versioning_and_immutability:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_manifest_versioning_and_immutability [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify manifest versions increment monotonically and older snapshots remain queryable.
def test_manifest_versioning_and_immutability(db_session):
"""
@@ -117,11 +117,11 @@ def test_manifest_versioning_and_immutability(db_session):
assert len(all_manifests) == 2
# [/DEF:test_manifest_versioning_and_immutability:Function]
# #endregion test_manifest_versioning_and_immutability
# [DEF:_valid_artifacts:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region _valid_artifacts [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Provide canonical valid artifact payload used by candidate registration tests.
def _valid_artifacts():
return [
@@ -134,11 +134,11 @@ def _valid_artifacts():
]
# [/DEF:_valid_artifacts:Function]
# #endregion _valid_artifacts
# [DEF:test_register_candidate_rejects_duplicate_candidate_id:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_register_candidate_rejects_duplicate_candidate_id [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify duplicate candidate_id registration is rejected by service invariants.
def test_register_candidate_rejects_duplicate_candidate_id():
repository = CleanReleaseRepository()
@@ -162,11 +162,11 @@ def test_register_candidate_rejects_duplicate_candidate_id():
)
# [/DEF:test_register_candidate_rejects_duplicate_candidate_id:Function]
# #endregion test_register_candidate_rejects_duplicate_candidate_id
# [DEF:test_register_candidate_rejects_malformed_artifact_input:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_register_candidate_rejects_malformed_artifact_input [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify candidate registration rejects artifact payloads missing required fields.
def test_register_candidate_rejects_malformed_artifact_input():
repository = CleanReleaseRepository()
@@ -183,11 +183,11 @@ def test_register_candidate_rejects_malformed_artifact_input():
)
# [/DEF:test_register_candidate_rejects_malformed_artifact_input:Function]
# #endregion test_register_candidate_rejects_malformed_artifact_input
# [DEF:test_register_candidate_rejects_empty_artifact_set:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_register_candidate_rejects_empty_artifact_set [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify candidate registration rejects empty artifact collections.
def test_register_candidate_rejects_empty_artifact_set():
repository = CleanReleaseRepository()
@@ -203,11 +203,11 @@ def test_register_candidate_rejects_empty_artifact_set():
)
# [/DEF:test_register_candidate_rejects_empty_artifact_set:Function]
# #endregion test_register_candidate_rejects_empty_artifact_set
# [DEF:test_manifest_service_rebuild_creates_new_version:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_manifest_service_rebuild_creates_new_version [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify repeated manifest build creates a new incremented immutable version.
def test_manifest_service_rebuild_creates_new_version():
repository = CleanReleaseRepository()
@@ -232,11 +232,11 @@ def test_manifest_service_rebuild_creates_new_version():
assert first.id != second.id
# [/DEF:test_manifest_service_rebuild_creates_new_version:Function]
# #endregion test_manifest_service_rebuild_creates_new_version
# [DEF:test_manifest_service_existing_manifest_cannot_be_mutated:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_manifest_service_existing_manifest_cannot_be_mutated [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify existing manifest snapshot remains immutable when rebuilding newer manifest version.
def test_manifest_service_existing_manifest_cannot_be_mutated():
repository = CleanReleaseRepository()
@@ -269,11 +269,11 @@ def test_manifest_service_existing_manifest_cannot_be_mutated():
assert rebuilt.id != created.id
# [/DEF:test_manifest_service_existing_manifest_cannot_be_mutated:Function]
# #endregion test_manifest_service_existing_manifest_cannot_be_mutated
# [DEF:test_manifest_service_rejects_missing_candidate:Function]
# @RELATION: BINDS_TO -> [test_candidate_manifest_services:Module]
# #region test_manifest_service_rejects_missing_candidate [C:2] [TYPE Function]
# @RELATION BINDS_TO -> [test_candidate_manifest_services]
# @PURPOSE: Verify manifest build fails with missing candidate identifier.
def test_manifest_service_rejects_missing_candidate():
repository = CleanReleaseRepository()
@@ -286,5 +286,5 @@ def test_manifest_service_rejects_missing_candidate():
)
# [/DEF:test_manifest_service_rejects_missing_candidate:Function]
# [/DEF:test_candidate_manifest_services:Module]
# #endregion test_manifest_service_rejects_missing_candidate
# #endregion test_candidate_manifest_services