fix(ops): address provenance gate review findings

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-13 16:12:55 +09:00
committed by Hermes Agent
co-authored by genichin
parent 8d9d627b1c
commit 619feff5f4
3 changed files with 18 additions and 5 deletions
+3 -2
View File
@@ -98,9 +98,10 @@ def _sha256_bytes(payload: bytes) -> str:
def _resolve_under(root: Path, relpath: str) -> Path | None:
candidate = (root / relpath).resolve()
resolved_root = root.resolve()
candidate = (resolved_root / relpath).resolve()
try:
candidate.relative_to(root)
candidate.relative_to(resolved_root)
return candidate
except ValueError:
return None