#!/usr/bin/env bash
# pql: source .pql/hooks/post-merge
_pql_hook="$(git rev-parse --show-toplevel)/.pql/hooks/post-merge"; [ -f "$_pql_hook" ] && . "$_pql_hook"
# Post-merge hook (also fires after `git pull`). Folds in pql's planning logic;
# pql's own .pql/hooks installer is dead under core.hooksPath=.config/hooks.
#
# Replays any changelog files the merge brought in (idempotent, LWW — D-16) and
# re-syncs decisions from governance/*.md so the markdown-sourced half stays in
# step. Both are no-ops when nothing changed.
if command -v pql >/dev/null 2>&1; then
    pql plan import >/dev/null 2>&1 || true
    pql decisions sync >/dev/null 2>&1 || true
fi
