footprint_writes.py python
21 lines 723 B
Raw
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83 chore(governance): sync handover+roadmap to 84db8c8 (drift:… Human 8 hours ago
1 """Footprint file writes with regime-specific modes (§K7.3.1 executable script)."""
2
3 from __future__ import annotations
4
5 import os
6 from pathlib import Path
7
8 from cli.atomic import WriteFailure, atomic_write_bytes
9 from cli.footprint import EXECUTABLE_FOOTPRINT_DESTINATIONS
10
11 FOOTPRINT_EXECUTABLE_MODE = 0o755
12
13
14 def write_footprint_bytes(path: Path, data: bytes, *, destination: str) -> None:
15 """Atomically write one footprint file; set mode ``0755`` for executable destinations."""
16 atomic_write_bytes(path, data)
17 if destination in EXECUTABLE_FOOTPRINT_DESTINATIONS:
18 try:
19 path.chmod(FOOTPRINT_EXECUTABLE_MODE)
20 except OSError as exc:
21 raise WriteFailure(path, exc) from exc
File History 1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199 fix(ISR): default require_independent_second_reviewer to require Human minor 7 hours ago