fix(ci): admit exact installed runner evidence in ownership preflight

This commit is contained in:
Hermes Agent committed 2026-10-24 16:31:29 +00:00
1 parent bfeb464bfb
commit ac0e14081a
2 files changed
+20 -1

No files matched your search

+7 -1
View File
@@ -6,6 +6,7 @@ Caller must serialize with deployment; never run alongside an editorial runner.
"""
import json
import os
import re
from pathlib import Path
import stat
@@ -20,7 +21,12 @@ def allowed(relative,isdir):
if relative in DIRS if isdir else relative in LEAVES:return True
# Runner-created state is limited to immediate regular files, never subtrees.
p=Path(relative)
return not isdir and str(p.parent) in STATE_ROOTS and p.name in ('lock','proposal.json')
if not isdir and str(p.parent) in STATE_ROOTS and p.name in ('lock','proposal.json'):return True
# Installed runner persists allowlisted timing evidence for task/run/profile.
# Admit only that exact immediate-file grammar, not arbitrary JSON or trees.
profiles='|'.join(re.escape(profile) for profile in PROFILES)
return not isdir and str(p.parent)=='editorial-v4/runner-state' and re.fullmatch(
r'[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}-[0-9a-f]{32}-(?:'+profiles+r')\.json',p.name) is not None
def scan(home,uid,gid):
if not home.is_absolute() or home.is_symlink():raise ValueError('Canonical home required')