feat(tasks): persist encrypted result handoff and recover received tasks
Add signed device-scoped task state/result endpoints and AES-GCM result outbox. Atomically claim original-message replies, reject cross-user/stale/expired tasks, preserve unknown platform receipts without blind replay, and retain ambiguous ciphertext for at most seven days. Maintain legacy synchronous compatibility and clarify stale deployment-plan diagnostics. Validation: ECS suite 227 passed/2 skipped, later outbox guards 12 passed, deployment diagnostics 54 passed. Real ECS/PostgreSQL/platform failure acceptance remains pending.
This commit is contained in:
@@ -472,7 +472,7 @@ def deployment_state(root,plan):
|
||||
raw = run(['docker','logs','--tail','100',entry['id']],optional=True)
|
||||
if raw is not None:
|
||||
print(' startup signals: '+(', '.join(log_signals(raw)) or 'no recognized error class; raw logs withheld'))
|
||||
print('STATE inspection only; no files, keys or containers changed. Do not retry activation before reviewing partial switch state.')
|
||||
print('STATE inspection only; no files, keys or containers changed. Healthy candidate services need no reactivation; inspect mixed/unhealthy states before further actions.')
|
||||
|
||||
|
||||
def check(root, plan, baseline=True, router_key_required=True):
|
||||
@@ -496,13 +496,13 @@ def check(root, plan, baseline=True, router_key_required=True):
|
||||
for name, old in plan["roles"].items():
|
||||
current = service(plan["project"],name,include_stopped=not baseline and name in {"connector","router"})
|
||||
if (baseline or name not in {"connector","router"}) and current["image"] != old["image"]:
|
||||
raise DeployError("running service image changed since preparation: "+name)
|
||||
raise DeployError("running service image changed since preparation: "+name+"; this plan may already be activated. Run state; do not rebuild or reactivate a healthy candidate")
|
||||
if not baseline and name in {"connector","router"}:
|
||||
allowed = {old['image']}
|
||||
if (root/'candidate.json').is_file():
|
||||
allowed.add(json.loads((root/'candidate.json').read_text(encoding='utf-8'))['image'])
|
||||
if current['image'] not in allowed:
|
||||
raise DeployError('unreviewed target image; refusing rollback: '+name)
|
||||
raise DeployError('unreviewed target image; selected parent plan does not match running '+name+'; use the latest successfully activated plan for a new update. No services changed')
|
||||
base = run(compose(plan)+["config","--format","json"],True)
|
||||
merged = run(compose(plan,root/"compose.broker.json")+["config","--format","json"],True)
|
||||
validate_overlay(base,merged,plan["candidate_image"],router_key_required=router_key_required)
|
||||
|
||||
Reference in New Issue
Block a user