fix(editorial): migrate exact CI ownership and fence failed research runs
Deploy Canina / deploy (push) Successful in 5m1s

This commit is contained in:
devops authored and devops committed 2026-10-24 10:28:30 +00:00
1 parent 01b6f1d3d7
commit f4add07780
10 files changed
+311 -11

No files matched your search

+6 -2
View File
@@ -108,8 +108,12 @@ def provision(sha, uid, gid):
home=Path(env.get('HERMES_HOME',''));safe(home)
if not any(home==Path(v['Destination']) or Path(v['Destination']) in home.parents for v in h['Mounts'] if v['Type'] in ('bind','volume')):raise ValueError('Persistent home required')
# Match the supervised Hermes/shim identity, NOT Docker Config.User (root).
# Existing root-owned installations fail closed; owner-reviewed CI migration
# is required rather than recursive chown of profiles or credentials.
# Preflight the exact reviewed migration in the container UID namespace.
identity=json.loads(docker('exec','canina-hermes','python3','-c',"import pwd,json; p=pwd.getpwnam('hermes'); print(json.dumps([p.pw_uid,p.pw_gid]))"))
if identity != [10000,10000]:raise ValueError('Canonical Hermes identity drift')
migration=Path(__file__).with_name('editorial-ownership.py').read_text()
migrate_code="import json,sys; p=json.load(sys.stdin); ns={'__name__':'ci_ownership'}; exec(compile(p['source'],'<ci-ownership>','exec'),ns); h=ns['Path'](p['home']); ns['migrate'](h,10000,10000,h/'.editorial-ownership-v1.json')"
docker('exec','--user','0:0','-i','canina-hermes','python3','-B','-c',migrate_code,data=json.dumps({'source':migration,'home':str(home)}))
source=Path(__file__).read_text()
payload=package(Path(__file__).resolve().parents[1]/'infra/hermes-editorial',sha)
code="import json,sys; p=json.load(sys.stdin); ns={'__name__':'editorial_stream'}; exec(compile(p['source'],'<ci-editorial>','exec'),ns); print(json.dumps(ns['install'](ns['Path'](p['home']),p['payload'])))"