Files
archie/.beads/hooks/pre-commit
T
sam b4d0dd18db chore(beads): recover from v1.2.1 schema skew; move to a project-local Dolt
The accidental, untested beads v1.2.1 release migrated the schema from v53 to
v65 while the supported v1.2.2 binary expects v53, so bd refused to run. All
three databases on the shared server were affected, not just this one --
archie_core, ai_sdk and beads_global were each at v65.

Recovery per docs/RECOVERY-1.2.1.md (beads v1.2.2): rolled the schema cursor
back to v53 in each database and re-tracked the events table to restore
audit-event versioning. Issue data was not touched; 508 issues before and
after. Data the 1.2.1 release wrote into 1.2.x-only structures (work-lease
state, events-journal rows, provenance, storage_class markers) remains in the
database and is simply unused by the 1.1 line.

shared-server flips to false, so this project now runs its own Dolt server out
of .beads/dolt instead of sharing /home/sam/.beads/shared-server with ai_sdk
and beads_global. Note bd 1.2.2 has no "embeddeddolt" mode -- that layout
belongs to the older embedded builds; project-local server is the equivalent
today, and .beads/dolt is already gitignored.

Hooks were reinstalled: the installed set was still 1.2.1.

The rest of the config diff is bd reflowing the YAML indentation on write.
2026-08-21 23:54:42 +10:00

34 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
_bd_used_perl=0
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
elif command -v perl >/dev/null 2>&1; then
_bd_used_perl=1
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
else
echo >&2 "beads: hook 'pre-commit' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
bd hooks run pre-commit "$@"
_bd_exit=$?
fi
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ $_bd_exit -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.2.2 ---