feat(lifecycle): resolve lifecycle status through one shared governance model (#80) - #170
Merged
ElliotSun merged 3 commits intoAug 14, 2026
Conversation
…ce model (#80) - Add authoritative LifecycleStatus enum and resolvers in semapact.lifecycle.status - Support canonical ODCS authority boundaries (root status for contract, customProperties for schemas/properties) - Enforce declared vs effective lifecycle and cascade inheritance down nested properties and items - Add fail-closed validation for unknown lifecycle statuses in ContractValidator - Align policy, merge_engine, evaluator, release, pipeline, and editor layers - Add documentation in docs/lifecycle_semantics.md and tests for resolver and effective scope matrix
…ource lifecycle - Safeguard resolve_contract_lifecycle and lifecycle_from_custom_properties against invalid inputs so validation outcomes block deterministically without unhandled ValueError - Ensure MergeEngine governance scope is strictly driven by the governed target contract, preventing draft/missing status on technical sources from bypassing conflict checks and auto-deprecation - Re-export allows_breaking_changes as a deprecated compatibility wrapper - Add comprehensive acceptance tests in tests/test_lifecycle_fail_closed_governance.py
…alidity enforcement
ElliotSun
marked this pull request as ready for review
August 14, 2026 07:29
ElliotSun
deleted the
80-resolve-lifecycle-status-through-one-shared-governance-model
branch
August 14, 2026 10:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #80.
Consolidates contract, schema, property, and nested property lifecycle resolution into a centralized, authoritative shared model in
semapact.lifecycle.status.Key Changes
semapact.lifecycle.status):LifecycleStatus(StrEnum)(DRAFT,ACTIVE,DEPRECATED,RETIRED).normalize_status(value)with case-insensitivity, whitespace trimming, andproposed -> DRAFTread-only interpretation alias.resolve_contract_lifecycle(contract): canonicalcontract.status-> fallbackcontract.customProperties.lifecycleStatus-> defaultDRAFT.resolve_declared_entity_lifecycle(entity):customProperties.lifecycleStatusonSchemaObject/SchemaProperty.resolve_schema_lifecycle(schema_obj, *, contract)&resolve_property_lifecycle(prop, *, parent_lifecycle): parent lifecycle inheritance where an inactive ancestor locks downstream child properties and items.is_active_contract,is_retired_contract,participates_in_breaking_checks,is_explicitly_deprecated.semapact.core.validator,evaluator.py):ContractValidatorchecks all lifecycle fields across contract, schemas, and recursive properties/items, flagging invalid statuses asValidationIssue.evaluate_governance_decision()andGovernanceService.merge_and_evaluate()deterministically evaluate toGovernanceDecision.BLOCKwithout unhandledValueErrorcrashes.semapact.lifecycle.merge_engine):policy.py,merge_engine.py,evaluator.py,release.py,pipeline.py, andeditor_semantics.py.allows_breaking_changesas a deprecated compatibility wrapper.docs/lifecycle_semantics.md.tests/test_lifecycle_status_resolver.py,tests/test_lifecycle_effective_scope_matrix.py, andtests/test_lifecycle_fail_closed_governance.py.Verification
uv run pytest-> 368 passeduv run ruff checkon modified modules -> All checks passeduv build-> Successfully built packages