Repository navigation
features deployment checks
Active contributors: Vassiliy Kuzenkov.
Deployment review checks a declared environment model and normalized infrastructure evidence. It does not infer the deployed version from Git, apply infrastructure, or treat a sound rollout plan as a completed rollout.
The default policy file is .sych/deploy.yaml, selected by policy.deployment_file. crates/sych-core/src/deploy.rs accepts an environment/owner plus sourced claims for initial image/source commit/schema phase/supported clients, rollout order, mixed versions, downtime, compatibility window, backfill, contract, recovery and observed state. Unknown fields are rejected; a claim with blank source is not known.
The transition matrix starts with seven reachable states. Only a sourced exclusion can remove one; sourced mixed_versions: false also excludes mixed apps.
| State | Required property |
|---|---|
old_app_expanded_schema |
Old readers/writers work |
mixed_apps |
Data, API and events work between versions |
old_frontend_new_backend |
Old client contract stays supported |
partial_backfill_concurrent_writes |
Fresh writes survive and both forms work |
backfill_retry |
Backfill is idempotent or resumable |
contract_phase |
Old path is no longer needed within its support window |
recovery_after_new_writes |
Recovery handles data written after the change |
Missing inputs are explicit: environment/owner, initial version, build-to-source link, rollout order, compatibility window, recovery and external consumers. Missing declarations do not make states inapplicable or block unrelated static review.
Generic migration rules match migration/migrate paths and SQL. crates/sych-core/src/migration/mod.rs binds each obligation to the matrix and source references:
| Rule | States | Specifically blocking owner gaps |
|---|---|---|
MIG-COMPAT |
Old app/expanded schema, mixed apps, old frontend/new backend | None of the named gaps blocks this rule by itself |
MIG-RESTART |
Partial backfill/concurrent writes, retry | None of the named gaps blocks this rule by itself |
MIG-CONTRACT |
Contract phase | Compatibility window, external consumers |
MIG-RECOVERY |
Recovery after new writes | Recovery path |
Other missing owner inputs remain limitations. When every state a rule covers is excluded with sources, it becomes NOT_APPLICABLE. A blocking missing declaration leaves UNKNOWN/DEPLOYMENT_INPUT_MISSING.
The normal mode is PLAN_REVIEW: judge order and mechanisms enforcing its preconditions. SUPPORTED means conditionally sound, not that backfill/drain happened. Only a sourced observed claim switches migration obligations to OBSERVED_TRANSITION, against that reported environment state.
SQL scanning extracts schema changes and the app adds bounded repository consumer references from both diff base and head, including earlier migrations. This shows old/new readers and writers but never proves external clients are absent. Database-engine locks, transaction behavior and framework/controller semantics are not supplied by a generic profile.
TF-CHANGE requires imported terraform show -json evidence bound to reviewed head. No plan, or only a stale plan, yields UNKNOWN/TERRAFORM_PLAN_MISSING; HCL text is not substituted for the plan.
The parser retains resource addresses/actions, replacement order, changed/unknown/sensitive attribute names, moved-from address and root explicit dependencies. It drops attribute values and keeps an input-variable digest. This is deliberate prompt/artifact minimization, not permission to store raw secret-bearing plans elsewhere.
Criteria enumerate destructive changes, up to 40 resources, and ask what preserves data or handles loss. Delete-before-create and create-before-delete remain distinct. A plan with no deletions/replacements says that explicitly; overflow is a limitation. Sych does not run Terraform plan/apply.
K8S-ROLLOUT requires head-bound rendered manifests; otherwise it stays UNKNOWN/K8S_MANIFESTS_MISSING. Normalization covers Deployment, StatefulSet, DaemonSet, Job, CronJob and Pod, retaining rollout structure such as selector mismatch, readiness, strategy, termination, persistent claims, secret/config reference names and hooks/deletion policy.
Environment values and Secret/ConfigMap data are not retained. Unsupported kinds remain limitations. Structural concerns become acceptance criteria, including missing readiness, Recreate downtime, persistent data and controller ordering.
Evidence stages are deliberately different:
-
rendered: structure only, no dry-run or runtime rollout observed. -
dry_run: API admission, not successful runtime rollout. -
runtime: live-state snapshot, evidence of this rollout only if captured after it.
Controller-specific ordering and environment inventory remain unknown. Report provenance follows Facts: a local file stays an author claim even when its commit binding is correct.
| Source | Change entry point |
|---|---|
crates/sych-core/src/deploy.rs |
Sourced claims, states, gaps and matrix evidence |
crates/sych-core/src/migration/mod.rs |
Rule-to-state/gap binding and evaluation modes |
crates/sych-core/src/migration/sql.rs |
Schema change extraction |
crates/sych-core/src/terraform.rs |
Plan-dependent obligations |
crates/sych-core/src/kubernetes.rs |
Rollout-dependent obligations and stages |
crates/sych-adapters/src/ci/terraform.rs |
Allowlisted plan normalization |
crates/sych-adapters/src/ci/kubernetes.rs |
Manifest normalization |
7 source files, 1 test file; ratio 0.143; 1 unique human author. Method: capability measurements. Scope is the seven source entries above plus crates/sych-core/tests/deploy.rs; inline parser tests count with their source file, not as extra test files.
Extend the model and migration binding together, test sourced exclusions/missing inputs, and update generated schemas for DTO changes. Infrastructure parser tests belong beside normalization, with integration coverage in the shared CI/review suites outside this narrow count. See Configuration and Testing.