From 6e3d9b2fd2085eb6b2365c66c80199ba810fcd8c Mon Sep 17 00:00:00 2001 From: Natalie Date: Sat, 27 Jun 2026 06:00:28 -0400 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=94=8E=20session=20bootloader=20leaves=20a=20verifiable?= =?UTF-8?q?=20trace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hook left no trace, so 'did the bootloader fire this session?' was unverifiable. Now every fire (a) stamps the orientation header with 'bootloader fired ' (visible in-context) and (b) appends a line to .local/last-session-orient (gitignored breadcrumb) — so verification is one command: cat .local/last-session-orient. Answers the 'how do I know it bootloaded?' question deterministically. Co-Authored-By: Claude Opus 4.8 (1M context) --- tooling/claude/dot-claude/hooks/session-orient.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tooling/claude/dot-claude/hooks/session-orient.sh b/tooling/claude/dot-claude/hooks/session-orient.sh index fcd4df8c..01b99585 100755 --- a/tooling/claude/dot-claude/hooks/session-orient.sh +++ b/tooling/claude/dot-claude/hooks/session-orient.sh @@ -15,12 +15,17 @@ ROOT="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}" MODE="${1:-hook}" +STAMP="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -python3 - "$ROOT" "$MODE" <<'PY' 2>/dev/null || exit 0 +# Breadcrumb: every fire leaves a trace so "did the bootloader run this session?" is a one-line +# check — `cat .local/last-session-orient`. Gitignored (runtime artifact, never committed). +mkdir -p "$ROOT/.local" 2>/dev/null && printf '%s\t%s\n' "$STAMP" "$MODE" >> "$ROOT/.local/last-session-orient" 2>/dev/null + +python3 - "$ROOT" "$MODE" "$STAMP" <<'PY' 2>/dev/null || exit 0 import json, sys, os, subprocess from collections import Counter -root, mode = sys.argv[1], sys.argv[2] +root, mode, stamp = sys.argv[1], sys.argv[2], sys.argv[3] def sh(*a): try: @@ -70,7 +75,7 @@ lines.append( "where-code-goes → `code-layering.md` · current work → `.project/ROADMAP.md` + `.project/objectives/`." ) -body = "## 🧭 Session orientation (live snapshot)\n\n" + "\n".join(lines) + \ +body = f"## 🧭 Session orientation (live snapshot · bootloader fired {stamp})\n\n" + "\n".join(lines) + \ "\n\n_Snapshot at boot — grep/read to confirm before acting (verify, don't infer)._" if mode == "--human":