unrip/.githooks/commit-msg
philipp fb547f24d9
All checks were successful
deploy / deploy (push) Successful in 48s
fix: scope inventory fetch by submission time window to prevent OOM
Instead of fetching up to 50k inventory snapshots (~442MB), scope the
query to only the time range of the current submission batch with a
15-minute buffer. For a typical 1-hour batch this drops from 50k rows
to ~300 rows, well within the 1280Mi pod memory limit.

The coalesced_at_idx on intent_inventory_snapshots covers the BETWEEN
clause so this remains efficient.

Proof: history-writer OOM kills from refreshQuoteOutcomes inventory fetch
Assumptions: 15min buffer covers the attribution window for all submissions
Still fake: heuristic gap outcomes may attribute trades imprecisely
2026-06-16 17:17:19 +02:00

39 lines
836 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
MSG_FILE="${1:-}"
if [[ -z "$MSG_FILE" || ! -f "$MSG_FILE" ]]; then
echo "commit-msg hook: missing commit message file" >&2
exit 1
fi
if git rev-parse -q --verify MERGE_HEAD >/dev/null 2>&1; then
exit 0
fi
missing=0
check_line() {
local pattern="$1"
local label="$2"
if ! grep -q "^${pattern}" "$MSG_FILE"; then
echo "missing required commit metadata: ${label}" >&2
missing=1
fi
}
check_line "Proof:" "Proof:"
check_line "Assumptions:" "Assumptions:"
check_line "Still fake:" "Still fake:"
if [[ "$missing" -ne 0 ]]; then
cat >&2 <<'EOF'
Required non-merge commit message body lines:
Proof: <which approved proof or charter this serves>
Assumptions: <key assumptions or constraints>
Still fake: <what remains mocked, unverified, or incomplete>
EOF
exit 1
fi