session-end-closeout.sh bash
48 lines 1.1 KB
Raw
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83 chore(governance): sync handover+roadmap to 84db8c8 (drift:… Human 23 hours ago
1 #!/bin/sh
2 # sessionEnd hook — governance-sync dry-run summary + CURRENT NEXT (§LT.4.5, fail-open).
3
4 find_ok() {
5 if [ -n "$OVERSEER_OK" ] && [ -x "$OVERSEER_OK" ]; then
6 printf '%s\n' "$OVERSEER_OK"
7 return 0
8 fi
9 if [ -x "./cli/ok" ]; then
10 printf '%s\n' "./cli/ok"
11 return 0
12 fi
13 if command -v ok >/dev/null 2>&1; then
14 printf '%s\n' "ok"
15 return 0
16 fi
17 return 1
18 }
19
20 OK=$(find_ok) || {
21 printf '%s\n' '{"followup_message":"ok CLI not found"}'
22 exit 0
23 }
24
25 DRY=$("$OK" governance-sync --dry-run 2>&1) || DRY="$DRY"
26 NEXT=$("$OK" next 2>&1) || NEXT="$NEXT"
27
28 export LT_HOOK_DRY="$DRY"
29 export LT_HOOK_NEXT="$NEXT"
30
31 if command -v python3 >/dev/null 2>&1; then
32 python3 - <<'PY' || true
33 import json
34 import os
35
36 dry = os.environ.get("LT_HOOK_DRY", "").strip()
37 nxt = os.environ.get("LT_HOOK_NEXT", "").strip()
38 summary = dry.splitlines()[0] if dry else "governance-sync dry-run complete"
39 body = summary
40 if nxt:
41 body = f"{summary}\n\n{nxt}"
42 print(json.dumps({"followup_message": body}))
43 PY
44 else
45 printf '%s\n' '{"followup_message":"governance-sync dry-run (python3 unavailable)"}'
46 fi
47
48 exit 0
File History 1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199 fix(ISR): default require_independent_second_reviewer to require Human minor 22 hours ago