feat(ops): M8.8 World0 acknowledgment gate and host-loss recovery (ADR-0075)
Ratifies dev/stage RPO/RTO from measurements and keeps World0 launch blocked (policy-enforced) until acknowledged outcomes survive host loss in an independent failure domain. Adds in-place restore with an explicit rewind, barrier-based fencing of a superseded database, and promotion of stage-pinned digests only. dr-check.sh rehearses host loss in every PostgreSQL build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,10 @@ environment-isolation or World0-protection invariant is broken:
|
||||
cascade-delete finalizer, and each stays in its own environment;
|
||||
- the live Argo path (deploy/kubernetes/dev) holds no Namespace, Secret, quota or
|
||||
RBAC objects;
|
||||
- the cleanup tool refuses World0 before invoking kubectl.
|
||||
- the cleanup tool refuses World0 before invoking kubectl;
|
||||
- World0 launch stays blocked (ADR-0075): no workload targets World0 and its
|
||||
Application keeps an unresolved path; any image a World0 overlay pins must be
|
||||
the digest already pinned in stage (promotion, never a fresh build).
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
@@ -253,6 +256,31 @@ for path, doc in objects:
|
||||
if path.startswith('deploy/') and doc['kind'] in ('ClusterRole', 'ClusterRoleBinding', 'Role', 'RoleBinding'):
|
||||
check(False, f'{path}: AEvolution grants no Kubernetes RBAC')
|
||||
|
||||
# M8.8 World0 launch gate (ADR-0075). This host has no independent durable failure
|
||||
# domain, so an acknowledged death could be undone by host loss: World0 must not run
|
||||
# or acknowledge. Lifting this rule is itself the launch decision and needs its own
|
||||
# accepted ADR with host-loss RPO-0 evidence.
|
||||
workload_kinds = {'Deployment', 'StatefulSet', 'DaemonSet', 'Job', 'CronJob', 'Pod', 'ReplicaSet'}
|
||||
for path, doc in objects:
|
||||
in_world0 = doc['metadata'].get('namespace') == 'evolution-world0' or '/world0/' in path
|
||||
check(not (in_world0 and doc['kind'] in workload_kinds),
|
||||
f'{path}: World0 launch is blocked (ADR-0075); no {doc["kind"]} may target World0')
|
||||
if doc['kind'] == 'Application' and doc['metadata'].get('name') == 'aevolution-world0':
|
||||
check('REPLACE' in doc['spec'].get('source', {}).get('path', ''),
|
||||
f'{path}: the World0 Application must keep an unresolved path while launch is blocked')
|
||||
for component in ('region', 'stores'):
|
||||
check(not os.path.exists(os.path.join(ROOT, 'deploy', 'kubernetes', component, 'world0')),
|
||||
f'deploy/kubernetes/{component}/world0: World0 launch is blocked (ADR-0075)')
|
||||
# Promotion: World0 may only ever pin a digest that stage already runs.
|
||||
for directory, _, files in os.walk(os.path.join(ROOT, 'deploy', 'kubernetes')):
|
||||
rel = os.path.relpath(directory, ROOT).replace(os.sep, '/')
|
||||
if rel.endswith('/world0') and 'kustomization.yaml' in files:
|
||||
stage = rel[:-len('world0')] + 'stage/kustomization.yaml'
|
||||
staged = {(i.get('name'), i.get('digest')) for i in manifests.get(stage, [{}])[0].get('images', [])}
|
||||
for image in manifests[rel + '/kustomization.yaml'][0].get('images', []):
|
||||
check((image.get('name'), image.get('digest')) in staged,
|
||||
f'{rel}: {image.get("name")} must be promoted from {stage}, not pinned independently')
|
||||
|
||||
# The platform bundle: every rendered object is protected from prune and deletion.
|
||||
bundle = manifests.get(platform + '/cluster/kustomization.yaml', [{}])[0]
|
||||
check(bundle.get('commonAnnotations', {}).get('argocd.argoproj.io/sync-options') == 'Prune=false,Delete=false',
|
||||
|
||||
Reference in New Issue
Block a user