From 5d101c734c0aa7009724ff99bbda8075cd6d597a Mon Sep 17 00:00:00 2001 From: ethernet Date: Wed, 23 Sep 2026 17:51:29 -0400 Subject: [PATCH] fix(update): adopting a checkout git cannot identify writes the birth certificate again write_source_stamp now returns None for a tree git cannot identify, instead of raising. Blessed-checkout adoption still caught RuntimeError for its minimal-stamp fallback, so it wrote nothing, reported the root as adopted, and a read-only tree no longer reported itself unwritable. Branch on the None the function returns now. --- hermes_cli/post_update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hermes_cli/post_update.py b/hermes_cli/post_update.py index 16357da4f5..0fba70a6f8 100644 --- a/hermes_cli/post_update.py +++ b/hermes_cli/post_update.py @@ -206,18 +206,18 @@ def step_adopt_blessed_checkout(project_root: Path | None = None) -> dict: if not is_blessed: return {"ok": True, "skipped": "not-a-blessed-root"} - try: - from hermes_cli.source_stamp import write_source_stamp + from hermes_cli.source_stamp import write_source_stamp + try: # Full checkout identity when git can answer; the birth-certificate # minimum below only when it cannot (or the tree is read-only). - write_source_stamp(root) + identified = write_source_stamp(root) except OSError as exc: # A read-only tree (nix-like layouts without their own stamp) # must not crash the boot — it just stays unadopted. logger.debug("blessed-checkout adoption skipped (unwritable): %s", exc) return {"ok": True, "skipped": f"unwritable: {exc}"} - except RuntimeError: + if identified is None: # No derivable git identity: write the minimal birth certificate. stamp = { "schemaVersion": 2,