Vitruvyan Docs
Update Manager System π
Last updated: Feb 20, 2026 14:30 UTC
Status: Phase 3 Complete β Package Manager implemented
CLI Command:vit update/vit upgrade(core) +vit install/vit remove(packages)
Architecture: Hybrid (Library + CLI, built-in to Core)
Overview
The Vitruvyan update system has two tiers:
| Tier | Commands | Scope |
|---|---|---|
| Core | vit update, vit upgrade, vit rollback | Sacred Orders, Graph, Conclave, Agents, Platform |
| Package | vit install, vit remove, vit list, vit search, vit info | Neural Engine, MCP, DSE, verticals |
π¦ See Package Manager System for full package management docs.
Objective π―
Define a distro-like update system for Vitruvyan Core:
- notify when updates are available π
- provide one command to upgrade βοΈ
- validate vertical compatibility before and after upgrade β
- auto-rollback on failure π
Expected outcome: zero Core forks across verticals and repeatable upgrades.
Architectural Decisions (Approved) β
Pattern: Industry-standard hybrid (apt/pip/dnf model)
- Library:
core.platform.update_manager.engine(business logic, testable) - CLI:
vitcommand (user interface, built-in) - Distribution: Single package (
pip install vitruvyan-coreincludes CLI)
Location: vitruvyan_core/core/platform/update_manager/
CLI Commands (apt-style, concise):
vit update= check for updates (likeapt update)vit upgrade= apply upgrade (likeapt upgrade)vit plan= show upgrade planvit rollback= revert to previous versionvit channel= switch stable/beta
Versioning:
- Git tags:
v1.0.0(stable),v1.1.0-beta.1(beta) - SemVer strict (MAJOR.MINOR.PATCH)
- Dual channels:
stable(production),beta(early access)
End State π§
When a vertical team runs:
the platform must:
- detect the latest Core release
- validate compatibility using vertical manifest + contracts version
- generate an upgrade plan (changes, risks, required tests)
- apply upgrade transactionally
- run vertical smoke tests
- confirm upgrade or automatically rollback
Non-Negotiable Principles π§±
- Verticals import only from
contracts, never from Core internals. - No Core release ships without compatibility checks.
- Every upgrade is traceable via audit logs and reports.
- Contract breaking changes require major version + deprecation policy.
Logical Architecture ποΈ
Main components:
Release Registry(GitHub Releases API + metadata)Compatibility Engine(version validation + manifest parsing)Update Manager CLI(vitcommand)Notification Engine(startup check + periodic polling)Safety Layer(git snapshot, smoke tests, rollback)Policy & Governance(contracts, versioning, deprecations)
Contract-Driven: All interactions governed by UPDATE_SYSTEM_CONTRACT_V1.md
1) Release Registry π¦
Source of truth for Core releases (start with GitHub Releases).
Minimum metadata per release:
- Core version
- supported contracts version
- channel (
stable,canary,lts) - machine-readable changelog
- artifact checksum
- migration notes
2) Compatibility Engine π§
Reads:
- release metadata
vertical_manifest.yaml
Outputs:
compatiblecompatible_with_warningsblocked
Common block reasons:
- Core version is outside supported range
- contracts major mismatch
- required capability no longer available
3) Update Manager CLI π οΈ
Command: vit (concise, apt-style)
Target commands:
vit updateβ check for updates (sync release registry)vit upgradeβ apply upgrade (with compatibility validation)vit planβ show upgrade plan (changes, risks, tests)vit rollbackβ revert to previous versionvit channel [stable|beta]β switch update channelvit statusβ show current version + available updates
Minimum behavior:
- human-readable output (tables, colors)
- CI-friendly exit codes (0=success, 1=blocked, 2=error)
- non-interactive mode (
--yes) for automation - JSON output mode (
--json) for programmatic usage
4) Notification Engine π
Minimum channels:
- notification on service startup
- scheduled periodic check
Optional channels:
- Slack/Webhook
- internal dashboard
5) Safety Layer π‘οΈ
During update apply:
- snapshot current state (commit/tag/deps/manifest)
- apply update
- execute minimal smoke suite
- auto-rollback + report on failure
6) Policy & Governance π
- Core SemVer
- separate Contracts versioning
- deprecation policy with support window
- release channel policy (
stable/canary/lts)
Implementation Tracklist π§
Phase 0 - Foundations (Week 1) π§±
Goal: lock base rules and data schema.
Tasks:
- Create contract:
docs/contracts/platform/UPDATE_SYSTEM_CONTRACT_V1.md- Manifest schema (vertical compliance)
- Smoke test interface (exit codes, timeout)
- Versioning policy (SemVer, breaking changes)
- Release metadata schema (JSON format)
- Extend
vertical_manifest.yamlwith compatibility fields - Create directory structure:
core/platform/update_manager/{engine,cli,tests}/ - Define initial compatibility matrix (core version β contracts version)
Deliverables:
UPDATE_SYSTEM_CONTRACT_V1.md(binding contract)- Updated
vertical_manifest.yamltemplate - Sample release metadata JSON
- Skeleton code structure (empty modules with docstrings)
Definition of Done:
- Contract approved by platform team
- Manifest schema validated (pytest schema test)
- One sample vertical using new schema (finance example)
- Directory structure created + committed
Phase 1 - Compatibility Engine (Week 2) π§
Goal: block risky upgrades before apply.
Tasks:
- Implement
engine/registry.py(GitHub Releases API client) - Implement
engine/compatibility.py(version range validation, SemVer parsing) - Implement
engine/models.py(dataclasses: Release, CompatibilityResult) - Implement
cli/commands/update.py(vit updatecommand) - Generate compatibility report (text + JSON formats)
Deliverables:
- Working
vit updatecommand - Compatibility report:
compatible,compatible_with_warnings,blocked - JSON output mode:
vit update --json - Unit tests:
tests/test_compatibility.py(100% coverage)
Definition of Done:
vit updateshows current version + latest available- Incompatible upgrades blocked with explicit reason
- All unit tests pass (pytest)
- Works with sample vertical (finance)
Phase 2 - Apply + Rollback (Weeks 3-4) π
GoImplement engine/planner.py (upgrade plan generation)
- Implement
engine/executor.py(git checkout, pip install, snapshot) - Implement
cli/commands/plan.py(vit plancommand) - Implement
cli/commands/upgrade.py(vit upgradecommand) - Implement
cli/commands/rollback.py(vit rollbackcommand) - Pre-upgrade snapshot (git tag:
pre-upgrade-<timestamp>) - Post-upgrade smoke tests (call vertical's
smoke_tests/run.sh) - Automatic rollback on failure
Deliverables:
- Working
vit upgradecommand (end-to-end flow) - Working
vit rollbackcommand - Upgrade audit log (
.vitruvyan/upgrade_history.json) - Functional tests:
tests/test_cli.py(E2E scenarios)
Definition of Done:
-
Compatible upgrade applies successfully + smoke tests pass
-
Failing smoke tests trigger automatic rollback
-
Rollback restores previous state (git + deps)
-
Audit log records all upgrade attempts
-
compatible update applies successfully
-
failing tests trigger automatic rollback
-
final state is consistent and verifiable
Phase 3 - CI/CD Gate (Week 5) π¦
Goal: prevent Core releases that break active verticals.
Tasks:
- multi-vertical compatibility CI pipeline
- PR/release gating rules
- compatibility report as CI artifact
Deliverables:
- updated CI pipeline
- release-blocking rule enabled
Definition of Done:
- incompatible release is automatically blocked
Phase 4 - Notification System (Week 6) π£
Goal: automatic update visibility for teams.
Tasks:
- notifications in
update check - scheduled update notifications
- (optional) Slack webhook
Deliverables:
- local notification + logs
- configurable notification channel
Definition of Done:
- vertical teams receive update alerts without manual polling
Phase 5 - Hardening & Governance (Weeks 7-8) π§°
Goal: production-grade reliability.
Tasks:
- full upgrade audit trail
- support window policy (N supported versions)
- rollback resilience tests
- incident runbook for failed upgrades
Deliverables:
- operational runbook
- pre/post-upgrade checklist
- vertical version status dashboard (minimal is fine)
Phase 0 (Foundations):
- Create
UPDATE_SYSTEM_CONTRACT_V1.md - Extend
vertical_manifest.yaml(compatibility fields) - Define
release_metadata.jsonschema - Create directory structure
core/platform/update_manager/
Phase 1 (Compatibility Engine):
- Implement
engine/registry.py(GitHub API) - Implement
engine/compatibility.py(version validation) - Implement
vit updatecommand - Generate JSON compatibility report
- Unit tests (compatibility logic)
Phase 2 (Apply + Rollback):
- Implement
engine/planner.py(upgrade plan) - Implement
engine/executor.py(apply/rollback) - Implement
vit upgradecommand - Implement
vit rollbackcommand - Create vertical smoke test template
- Add upgrade audit logging
Phase 3 (CI/CD Gate):
- Implement CI compatibility gate
- Multi-vertical test matrix
- Release blocking rules
Phase 4 (Notifications):
- Startup update check
- Periodic polling (configurable)
- Webhook notifications (optional)
Phase 5 (Hardening):
- Operational runbook
- Rollback resilience tests
- Version status dashboard
- implement
update apply - implement
update rollback - create vertical smoke test pack Developer workflow (vertical team):
Rollback flow (if issues found post-upgrade):
Standard Operating Flow (SOP) π
- vertical team runs
vitruvyan update check - if
compatible, runvitruvyan update plan - approve and run
vitruvyan update apply - platform executes smoke tests
- if pass, upgrade is confirmed
- if fail, rollback runs and ticket/report is generated
Main Risks & Mitigations β οΈ
MVP Path (3 weeks, immediate value):
- Phase 0 (Week 1): Foundations + contract
- Phase 1 (Week 1-2):
vit updateworking (read-only checks) - Phase 2 (Week 2-3):
vit upgrade+vit rollback(manual testing)
Production Hardening (additional 2-4 weeks): 4. Phase 3 (Week 4): CI gates (prevent breaking releases) 5. Phase 4 (Week 5): Notifications (proactive alerts) 6. Phase 5 (Week 6-7): Governance + runbooks
This sequence minimizes architectural risk before vertical expansion.
Quick-win milestone: After Week 2, vertical teams can run vit update to check compatibility (immediate safety net, even without auto-apply)
- Risk: unreliable rollback. Mitigation: atomic snapshot + recurring rollback drills.
Suggested Ownership π₯
- Platform/Core team: release registry, contracts, update manager
- Vertical teams: manifest, smoke tests, vertical compliance
- DevOps/SRE: CI gates, notifications, observability, runbooks
KPIs to Monitor π
- successful upgrades (%)
- mean time to upgrade (MTTU)
- rollback rate (%)
- incompatibilities caught pre-deploy
- post-upgrade incident count
Recommended Rollout Order πΊοΈ
- Phase 0 and Phase 1 first (breakage prevention)
- Phase 2 next (apply + rollback)
- Phase 3 before scaling vertical count
- Phase 4 and 5 for continuous operations
This sequence minimizes architectural risk before vertical expansion.
Implementation Progress π
Last updated: Feb 19, 2026 18:30 UTC
Current Phase: Phase 1 (Compatibility Engine)
Branch:feature/update-manager-vit-cli
β Phase 0 Complete (Feb 19, 2026)
Foundations + Contract
- Directory structure created:
vitruvyan_core/core/platform/update_manager/{engine,cli,tests}/ - Contract published:
docs/contracts/platform/UPDATE_SYSTEM_CONTRACT_V1.md(15 sections, binding)- P0 amendments applied (wildcard semantics, path resolution, checksum, dirty tree, audit trail)
- Manifest template extended:
docs/contracts/verticals/templates/vertical_manifest.yaml - Finance vertical example:
examples/verticals/finance/vertical_manifest.yaml+ smoke tests - Skeleton code: 13 Python modules with docstrings + NotImplementedError stubs
- Git commit:
089178e(40 files, +4655/-257 lines) - Contract v1.0.1:
3afc2db(P0 compliant)
Key Decisions:
- CLI command:
vit(apt-style, concise) - Architecture: Hybrid (Library + CLI, built-in to Core)
- Location:
vitruvyan_core/core/platform/update_manager/ - Versioning: Git tags strict SemVer (
v1.0.0,v1.1.0-beta.1) - Channels:
stable(production),beta(early access)
β Phase 1 Complete (Feb 19, 2026)
Compatibility Engine β Read-Only Check
Implemented modules:
-
engine/registry.py (GitHub Releases API client)
ReleaseRegistry.fetch_latest(channel)β fetch latest release from GitHubReleaseRegistry.fetch_all(channel)β fetch all releases (filtered by channel)ReleaseRegistry.verify_checksum(release)β verify Git commit SHAReleaseRegistry._parse_semver(version)β parse SemVer for sorting- Uses stdlib
urllib(zero external dependencies) - Pagination support (100 releases per request)
- Downloads
releases.jsonasset from GitHub Release - Filters by channel (
stable,beta) - Sorts by SemVer (descending)
-
engine/compatibility.py (Version matching + validation)
CompatibilityChecker.check(current, target, manifest)β validate compatibilityCompatibilityChecker._match_version(version, pattern, operator)β SemVer comparison (>=,<=,==)CompatibilityChecker._match_wildcard(version, pattern)β wildcard matching (1.x.xpermissive)CompatibilityChecker.parse_semver(version)β parse SemVer tupleCompatibilityChecker.check_contracts_major()β contracts version validation- Blocks incompatible upgrades (target < min or target > max)
- Returns
CompatibilityResult(compatible bool + blocking_reason)
-
cli/commands/update.py (
vit updatecommand)cmd_update(args)β main command logicget_current_version()β detect current Core version (3 strategies:__version__,git describe, fallback)find_vertical_manifest()β walk up directory tree to findvertical_manifest.yaml- Displays: current version, latest version, release date, changes (breaking/features/fixes)
- Compatibility check with vertical manifest (if found)
- Shows migration guide URL
- Next steps:
vit upgrade --channel stable - Format: Human-readable console output (emojis, colors)
-
cli/main.py (CLI entry point)
- Imports
register_update_commandfromcommands/update.py - Registers
vit updatesubcommand with argparse - Executes
args.func(args)pattern (command dispatch) - Logging configured (INFO level)
- Stub commands for Phase 2+ (upgrade, plan, rollback, channel, status)
- Imports
-
cli/formatters.py (Output formatters)
format_release_info(release)β format Release object for displayformat_compatibility_result(result)β format CompatibilityResultOutputFormatter.color(text, color)β ANSI colored output
-
pyproject.toml (Package configuration)
- Project metadata: name, version, description, authors, license
- Dependencies: pyyaml, pydantic, httpx, psycopg2, redis, qdrant-client, openai, langgraph
- Optional dependencies: dev (pytest, black, ruff, mypy), mcp (anthropic), monitoring (prometheus-client)
- CLI entry point:
vit = "vitruvyan_core.core.platform.update_manager.cli.main:cli_main" - Setuptools configuration: packages.find, pytest.ini_options
- Tool configuration: black, ruff, mypy
Implementation Details:
- Zero breaking changes: All code isolated in
core/platform/update_manager/ - Stdlib-first: Uses
urllib(norequestsdependency yet) - Error handling: NetworkError for GitHub API failures
- Timeout protection: 10-second timeout for network requests
- Graceful degradation: Falls back to "unknown" version if detection fails
- Vertical discovery: Walks up from CWD to Git repo root looking for
vertical_manifest.yaml
Testing Strategy (next):
- Unit tests:
tests/test_registry.py(mock GitHub API responses) - Unit tests:
tests/test_compatibility.py(wildcard matching, SemVer comparison) - Integration test:
tests/test_vit_update_e2e.py(actual GitHub API call) - Manual test:
pip install -e . && vit update --channel stable
Known Limitations (Phase 1):
- Current version detection: hardcoded fallback to "unknown" if
__version__andgit describefail - Contracts version: hardcoded to "1.0.0" (should read from Core metadata in Phase 2)
- No caching: GitHub API called on every
vit update(add cache in Phase 2) - No rate limit handling: Will fail after 60 requests/hour (unauthenticated)
- Manifest discovery: stops at Git repo root (could support custom paths)
π Phase 2 Next (Week 3)
Update Executor β Apply Upgrade
Modules to implement:
-
engine/planner.py (
UpgradePlanner)- Generate upgrade plan (changes, risks, tests)
- Estimate upgrade duration
- Check for breaking changes
- Validate prerequisites (clean working tree, sufficient disk space)
-
engine/executor.py (
UpgradeExecutor)- Execute upgrade transaction (git checkout, pip install)
- Create snapshot tag before upgrade
- Run vertical smoke tests
- Rollback on failure (restore snapshot)
- Write audit log entry
-
cli/commands/upgrade.py (
vit upgradecommand)- Interactive confirmation (show plan, ask consent)
- Non-interactive mode (
--yesflag) - Target version selection (
--target v1.2.0) - Progress indicators (spinner, percentage)
- Error reporting (detailed diagnostics)
-
cli/commands/plan.py (
vit plancommand)- Show upgrade plan without applying
- Risk assessment (breaking changes, migration complexity)
- Smoke test preview (timeout, exit codes)
-
cli/commands/rollback.py (
vit rollbackcommand)- Revert to previous version (snapshot tag)
- Restore dependencies (
requirements.txtsnapshot) - Update audit log
Timeline: Week 3 (Feb 20-26, 2026)
Definition of Done:
vit upgradeworking end-to-end (manual testing)vit rollbackrestores previous version- Smoke tests run automatically after upgrade
- Audit log created (
.vitruvyan/upgrade_history.json) - Integration tests pass (mocked GitHub API)
π Phase 3-5 (Weeks 4-7)
CI Gates, Notifications, Governance (see Masterplan sections above)
β Phase 2 Complete (Feb 19, 2026)
Update Executor β Apply Upgrade with Rollback
Implemented modules:
-
engine/planner.py (UpgradePlanner)
plan(from, to, release, manifest_path)β generates UpgradePlanvalidate_prerequisites()β blocks on dirty working tree (P0 contract)_check_clean_working_tree()βgit diff-index --quiet HEAD --_check_disk_space()β requires 100MB minimum_determine_tests(manifest_path)β discovers vertical smoke tests_estimate_downtime(breaking, tests)β base 30s + tests 60s/test + 20% buffer- PrerequisiteError: raised when dirty tree or insufficient disk space
-
engine/executor.py (UpgradeExecutor)
apply(plan, manifest_path)β executes full upgrade transactionrollback()β reverts to snapshot tagcreate_snapshot()β creates Git tagpre-upgrade-YYYYMMDD-HHMMSSrun_smoke_tests(manifest_path)β executes<vertical_root>/smoke_tests/run.sh_write_audit_log()β writes to.vitruvyan/upgrade_history.json(P0 contract)_checkout_version(version)βgit checkout v{version}_get_audit_log_path()β resolves to Git repo root (P0 contract)- Auto-rollback: triggers on smoke test failure or any exception
-
cli/commands/upgrade.py (
vit upgradecommand)- Interactive workflow:
- Fetch target release from GitHub (latest or
--target) - Compatibility check with vertical manifest
- Generate upgrade plan (planner)
- Display plan: changes (breaking/features/fixes), downtime estimate, smoke tests
- Confirmation prompt (skip with
--yes) - Execute upgrade (executor)
- Show snapshot tag for rollback
- Fetch target release from GitHub (latest or
- Flags:
--channel stable|beta,--target VERSION,--yes - Exit codes: 0 = success, 1 = error/rollback
- Interactive workflow:
-
cli/commands/plan.py (
vit plancommand)- Display upgrade plan without applying
- Sections:
- Timeline: estimated downtime + rollback strategy
- Changes: breaking/features/fixes (limit 5 each for readability)
- Smoke tests: list all discovered tests
- Risk assessment: HIGH/MEDIUM/LOW (based on breaking changes + tests)
- Next steps: suggests
vit upgradecommand - Required arg:
--target VERSION
-
cli/commands/rollback.py (
vit rollbackcommand)- Reverts to last upgrade snapshot
- Reads snapshot tag from
.vitruvyan/upgrade_history.json - Confirmation prompt
- Executes
git checkout {snapshot_tag} - Verifies with
git describe --tags
-
cli/main.py (CLI orchestration)
- Registered
upgrade,plan,rollbackcommands - Updated imports and help text
- Phase 2 complete marker
- Registered
Implementation Details:
- P0 contract compliance:
- Dirty tree blocking: zero tolerance (no
--forceoverride) - Audit log location: Git repo root
.vitruvyan/upgrade_history.json - Snapshot tags:
pre-upgrade-YYYYMMDD-HHMMSSformat
- Dirty tree blocking: zero tolerance (no
- Smoke tests:
- Location:
<vertical_root>/smoke_tests/run.sh(P0 contract) - Timeout: from manifest
smoke_tests_timeout(default 180s) - Exit codes: 0 = pass, 1 = fail, 2 = error
- Auto-rollback on failure
- Location:
- Audit log format:
-Graceful degradation:
- Disk space check: non-blocking (warning only)
- No smoke tests: non-blocking (warning: "risky upgrade")
- Latest version unknown: show warning, allow proceed
Known Limitations (Phase 2):
- pip install skipped: Requires Python venv management (Phase 3)
- requirements.txt snapshot: Not implemented (Phase 3)
- No channel command: Switching channels not yet implemented
- No status command: Current version + updates summary not yet implemented
- Git-only: Assumes Git repository (no tarball support yet)
Testing Performed:
- β
Manual test:
vit upgrade --help(arg parsing) - β
Manual test:
vit plan --help(arg parsing) - β
Manual test:
vit rollback --help(arg parsing) - β Prerequisite validation: dirty tree detection
- β
Snapshot creation:
pre-upgrade-*tag format - β Audit log: JSON write/read
- β οΈ End-to-end upgrade: requires GitHub release (Phase 3)
File Changes (commit cfb2169):
- 6 files changed, +1049/-47 lines
- New files:
upgrade.py,plan.py,rollback.py - Modified:
planner.py,executor.py,main.py
β Phase 3 Complete (Feb 19, 2026)
CI/CD Gates β Prevent Breaking Releases
Implemented modules:
-
ci/contract_validator.py (ContractValidator)
validate_manifest(manifest_path)β ValidationResultvalidate_multiple(paths)β List[ValidationResult]- Validation rules (UPDATE_SYSTEM_CONTRACT_V1 compliance):
- Required fields: domain_name, domain_version, status, compatibility, ownership
- Compatibility section: min/max_core_version, contracts_major, update_channel
- Ownership section: team, tech_lead, contact (email format)
- Version constraints: SemVer or wildcard (e.g., 1.x.x)
- Contracts major: must match Core version
- Update channel: "stable" or "beta"
- Smoke test timeout: 60-600 seconds (if provided)
discover_verticals(root_dir)β finds all vertical_manifest.yaml files- Validation checks:
- Schema compliance (required fields, types)
- min_core_version β€ max_core_version
- Smoke test existence (warning if missing)
- Smoke test executability (warning if not executable)
-
ci/pytest_integration.py (pytest markers & fixtures)
- Decorator:
@compatibility_test(marks tests for CI filtering) - Fixtures:
repo_root: Searches for Git root (.git/)vertical_manifests: Discovers all manifests (session scope)active_verticals: Filters status="active" manifestscontract_validator: Initialized ContractValidatorcompatibility_check_helper: Assertion helper (raises on invalid)
- Parametrization:
parametrize_verticals(metafunc)β runs tests once per vertical - Markers registration: compatibility, slow
- Decorator:
-
ci/release_blocker.py (ReleaseBlocker)
check_release(target_version)β BlockingReportcheck_manifest_compliance()β BlockingReport- Blocking reasons:
- INVALID_MANIFEST: schema violation
- INCOMPATIBLE_VERTICAL: version range mismatch
- CONTRACT_VIOLATION: compliance test failed
- NO_VERTICALS: no manifests found (suspicious)
- BlockingReport:
blocked: bool(True = block release)reason: BlockingReason(enum)details: str(error messages)failing_verticals: List[str](paths to failing manifests)total_verticals: intexit_code()β 0 (pass) | 1 (block)to_json()β JSON artifact for CI
- CLI entry point:
python -m vitruvyan_core.core.platform.update_manager.ci.release_blocker
-
.github/workflows/update_manager_ci.yml (GitHub Actions)
- Triggers:
- Pull requests (branches: main, develop)
- Release tags (
v*) - Manual dispatch (target_version input)
- Jobs:
- validate-manifests: Contract compliance check
- Runs:
release_blocker --check-compliance - Uploads:
compliance_report.jsonartifact - Blocks: if any manifest invalid
- Runs:
- check-compatibility: Version range validation (tags only)
- Extracts version from tag (
v1.2.0β1.2.0) - Runs:
release_blocker <version> - Uploads:
compatibility_report.jsonartifact - Comments on PR if blocked (reason, failing verticals)
- Blocks: if any vertical incompatible
- Extracts version from tag (
- run-compatibility-tests: Pytest suite
- Runs:
pytest -m compatibility - Uploads:
compatibility-tests.xml(JUnit format) - Blocks: if any test fails
- Runs:
- summary: Aggregates all job results
- Fails if any job failed
- validate-manifests: Contract compliance check
- Paths filter: Triggers only if Core or manifests changed
- Triggers:
-
tests/test_compatibility.py (8 compatibility tests)
test_all_manifests_valid: All manifests comply with contract βtest_active_verticals_have_required_fields: Active verticals valid βtest_version_constraints_valid: SemVer or wildcard format βtest_contracts_major_matches_core: Contracts version alignment βtest_smoke_tests_exist: Smoke tests present (warning if missing) βtest_update_channel_valid: Channel is "stable" or "beta" βtest_smoke_test_timeout_in_range: Timeout 60-600 seconds βtest_manifest_discovery_works: At least 1 manifest found βtest_vertical_manifest_individual: Parametrized test (1 per vertical)
-
tests/conftest.py (pytest configuration)
- Imports fixtures from
ci/pytest_integration.py - Registers markers:
compatibility,slow - Configures test parametrization
- Imports fixtures from
-
pytest.ini (global marker registration)
- Added:
compatibility: Update Manager compatibility tests (CI gates)
- Added:
Implementation Details:
- Wildcard matching:
1.x.xmatches any1.*.*(permissive, industry standard) - SemVer validation: Regex
^\d+\.\d+\.\d+(-[\w.]+)?$(supports pre-release) - Version comparison: Basic major.minor.patch ordering (wildcards β 999)
- Smoke test location:
<vertical_root>/smoke_tests/run.sh(P0 contract) - Manifest discovery paths:
examples/verticals/*/vertical_manifest.yamldomains/*/vertical_manifest.yaml
- CI artifacts retention: 30 days (tests), 90 days (compatibility reports)
Testing Performed:
- β
Manual:
python -m ...release_blocker --check-compliance- Result: 1 vertical compliant (finance), exit 0
- β
Manual:
python -m ...release_blocker 1.2.0- Result: Compatible (1.2.0 within 1.x.x), exit 0
- β
Manual:
python -m ...release_blocker 2.0.0- Result: Blocked (2.0.0 > 1.x.x), exit 1
- β
Pytest:
pytest -m compatibility- Result: 8/8 tests passed
- β ContractValidator: Finance vertical passes all checks
- β Wildcard matching: 1.x.x correctly matches 1.2.0, rejects 2.0.0
- β
Fixtures:
vertical_manifests,contract_validatorwork correctly
Known Limitations (Phase 3):
- No GitHub release test: Workflow not triggered yet (requires actual release tag)
- Single vertical: Only finance vertical exists (need more for matrix testing)
- No pre-release handling: Workflow doesn't distinguish stable/beta channels
- Comment posting: Requires GitHub token with PR write permissions
File Changes (commit c00d064):
- 8 files changed, +1187 lines
- New files (7):
.github/workflows/update_manager_ci.yml(172 lines)ci/__init__.py(20 lines)ci/contract_validator.py(325 lines)ci/pytest_integration.py(150 lines)ci/release_blocker.py(250 lines)tests/conftest.py(33 lines)tests/test_compatibility.py(175 lines)
- Modified (1):
pytest.ini(+1 marker)