@erclx/canon 4.73.0 → 4.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,3 +59,30 @@ done
59
59
  printf '\nšŸ“‹ %s archive candidate(s) on the board:\n%s\n' "$count" "$closed"
60
60
  printf 'Outcomes are marked on the branch, so each still needs its work confirmed\n'
61
61
  printf 'on main. Run /task-board, which checks that and sweeps the plan first.\n\n'
62
+
63
+ # The gitignored record folders live on one disk and nowhere else, and a merge
64
+ # is the event that changes them most. This runs on every merge rather than
65
+ # only on one that closes a task, since a review report and a memory entry
66
+ # both land on runs that archive nothing.
67
+ #
68
+ # Sits last so a slow or unreachable remote delays no candidate announcement,
69
+ # and inside an `if` so a push failing offline, or a machine that never ran
70
+ # the one-time setup, still leaves this hook exiting zero. Guarded by its own
71
+ # `command -v canon` check, since this file carries none above it.
72
+ if command -v canon >/dev/null 2>&1; then
73
+ if backup=$(canon records push --root "$root" --json 2>/dev/null); then
74
+ changed=$(printf '%s' "$backup" | sed -n 's/.*"changed":\([0-9][0-9]*\).*/\1/p')
75
+ if [ -n "$changed" ] && [ "$changed" != "0" ]; then
76
+ printf '\nšŸ—„ļø Backed up %s record path(s).\n\n' "$changed"
77
+ fi
78
+ else
79
+ reason=$(printf '%s' "$backup" | sed -n 's/.*"reason":"\([^"]*\)".*/\1/p')
80
+
81
+ # No records history on this machine, which is every checkout that never
82
+ # ran the one-time setup. Nothing to report.
83
+ if [ "$reason" != "no-repository" ]; then
84
+ printf '\nšŸ—„ļø Records not backed up: %s\n' "${reason:-unknown}"
85
+ printf 'Run canon records push when the remote is reachable.\n\n'
86
+ fi
87
+ fi
88
+ fi
@@ -34,11 +34,12 @@ case "$file_path" in
34
34
  esac
35
35
 
36
36
  # The board index covers the live folder alone. A shell pattern's wildcard
37
- # crosses a separator, so the guard above matches an archived task as well and
38
- # a regen fired on one would rebuild the index the archive was taken out of.
37
+ # crosses a separator, so the guard above matches an archived or declined task
38
+ # as well, and a regen fired on one would rebuild the index that task was
39
+ # taken out of.
39
40
  case "$file_path" in
40
- */.claude/tasks/index.md | */.claude/tasks/archive/*) exit 0 ;;
41
- */.canon/tasks/index.md | */.canon/tasks/archive/*) exit 0 ;;
41
+ */.claude/tasks/index.md | */.claude/tasks/archive/* | */.claude/tasks/declined/*) exit 0 ;;
42
+ */.canon/tasks/index.md | */.canon/tasks/archive/* | */.canon/tasks/declined/*) exit 0 ;;
42
43
  esac
43
44
 
44
45
  # The walk-up boundary has to come from the path, not from the session. Shared