Record whether the empty-profile login launcher ran.
All checks were successful
CCR intake gate / gate (push) Successful in 1m12s
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 2s

The receipt stores only called, rejected, or opened. It does not store the address.

Assistant: grok
Assistant-Session: 01a198fa-fd27-7e41-a0a2-57355c3e4efd
This commit is contained in:
codex 2026-11-02 02:49:33 +01:00
parent c89ac18d24
commit 8cb5b13c77

View file

@ -56,11 +56,24 @@ def launch_argv(browser, profile_dir, url):
]
def stamp(result):
path = Path("/home/worsch/.local/state/railiance/receipts/operator-browser-last.txt")
try:
path.parent.mkdir(mode=0o700, parents=True, exist_ok=True)
path.write_text(result + "\n", encoding="utf-8")
os.chmod(path, 0o600)
except OSError:
return
def main():
stamp("called")
if len(sys.argv) != 2 or not allowed(sys.argv[1]):
stamp("rejected")
return 1
browser = browser_path()
if not browser:
stamp("no-browser")
return 1
profile = Path(tempfile.mkdtemp(prefix="operator-browser-"))
os.chmod(profile, 0o700)
@ -95,8 +108,13 @@ def main():
stderr=subprocess.DEVNULL,
timeout=20,
)
return int(opened.returncode != 0)
if opened.returncode != 0:
stamp("open-failed")
return 1
stamp("opened")
return 0
except (OSError, subprocess.SubprocessError):
stamp("open-failed")
return 1