diff --git a/.beads/config.yaml b/.beads/config.yaml index cacea8944..eb4a293a2 100644 --- a/.beads/config.yaml +++ b/.beads/config.yaml @@ -54,17 +54,16 @@ # Disabled by default; enable only when an integration needs fresh .beads/issues.jsonl. # Use relative paths under .beads/ for JSONL import/export filenames. export: - auto: true - path: issues.jsonl - interval: 60s - # issues.jsonl is tracked (see .beads/.gitignore), so the export must be - # staged with the commit that triggers it. With git-add off, the 60s - # auto-export would leave a tracked file permanently dirty in git status - # and block rebases and checkouts until stashed. - git-add: true + auto: true + path: issues.jsonl + interval: 60s + # issues.jsonl is tracked (see .beads/.gitignore), so the export must be + # staged with the commit that triggers it. With git-add off, the 60s + # auto-export would leave a tracked file permanently dirty in git status + # and block rebases and checkouts until stashed. + git-add: true import: - path: issues.jsonl - + path: issues.jsonl # Integration settings (access with 'bd config get/set') # Non-secret keys (stored in the database): # - jira.url, jira.project @@ -74,10 +73,9 @@ import: # Secret keys (stored in this file but prefer env vars to avoid git exposure): # - linear.api_key → use LINEAR_API_KEY env var instead # - github.token → use GITHUB_TOKEN env var instead - sync.remote: "git+https://github.com/samcharles93/archie-core.git" dolt: - shared-server: true + shared-server: false auto-commit: "on" audit: enabled: true diff --git a/.beads/hooks/post-checkout b/.beads/hooks/post-checkout index d9912a2a5..c56039649 100755 --- a/.beads/hooks/post-checkout +++ b/.beads/hooks/post-checkout @@ -1,59 +1,33 @@ #!/usr/bin/env sh -# --- BEGIN BEADS INTEGRATION v1.2.1 --- +# --- 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} - case "$_bd_timeout" in - *[!0-9]*|'') _bd_timeout_invalid=1 ;; - *[1-9]*) _bd_timeout_invalid=0 ;; - *) _bd_timeout_invalid=1 ;; - esac - if [ "$_bd_timeout_invalid" -eq 1 ]; then - echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds" - _bd_timeout=300 - fi - _bd_timeout_backend=none - _bd_timeout_command= - for _bd_timeout_candidate in timeout gtimeout; do - if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then - if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then - case "$_bd_timeout_version" in - "timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;; - esac - fi - fi - done - if [ -n "$_bd_timeout_command" ]; then - _bd_timeout_backend=coreutils - if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run post-checkout "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=0 + if command -v timeout >/dev/null 2>&1; then + timeout "$_bd_timeout" bd hooks run post-checkout "$@" + _bd_exit=$? + elif command -v gtimeout >/dev/null 2>&1; then + gtimeout "$_bd_timeout" bd hooks run post-checkout "$@" + _bd_exit=$? elif command -v perl >/dev/null 2>&1; then - _bd_timeout_backend=perl - if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run post-checkout "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=1 + perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run post-checkout "$@" + _bd_exit=$? else echo >&2 "beads: hook 'post-checkout' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT" - if bd hooks run post-checkout "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + bd hooks run post-checkout "$@" + _bd_exit=$? fi - if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then + if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads" _bd_exit=0 fi - if [ "$_bd_exit" -eq 3 ]; then + if [ $_bd_exit -eq 3 ]; then echo >&2 "beads: database not initialized — skipping hook 'post-checkout'" _bd_exit=0 fi - if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi + if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi fi -# --- END BEADS INTEGRATION v1.2.1 --- +# --- END BEADS INTEGRATION v1.2.2 --- diff --git a/.beads/hooks/post-merge b/.beads/hooks/post-merge index 4d66a2fba..496f17508 100755 --- a/.beads/hooks/post-merge +++ b/.beads/hooks/post-merge @@ -1,59 +1,33 @@ #!/usr/bin/env sh -# --- BEGIN BEADS INTEGRATION v1.2.1 --- +# --- 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} - case "$_bd_timeout" in - *[!0-9]*|'') _bd_timeout_invalid=1 ;; - *[1-9]*) _bd_timeout_invalid=0 ;; - *) _bd_timeout_invalid=1 ;; - esac - if [ "$_bd_timeout_invalid" -eq 1 ]; then - echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds" - _bd_timeout=300 - fi - _bd_timeout_backend=none - _bd_timeout_command= - for _bd_timeout_candidate in timeout gtimeout; do - if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then - if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then - case "$_bd_timeout_version" in - "timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;; - esac - fi - fi - done - if [ -n "$_bd_timeout_command" ]; then - _bd_timeout_backend=coreutils - if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run post-merge "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=0 + if command -v timeout >/dev/null 2>&1; then + timeout "$_bd_timeout" bd hooks run post-merge "$@" + _bd_exit=$? + elif command -v gtimeout >/dev/null 2>&1; then + gtimeout "$_bd_timeout" bd hooks run post-merge "$@" + _bd_exit=$? elif command -v perl >/dev/null 2>&1; then - _bd_timeout_backend=perl - if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run post-merge "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=1 + perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run post-merge "$@" + _bd_exit=$? else echo >&2 "beads: hook 'post-merge' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT" - if bd hooks run post-merge "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + bd hooks run post-merge "$@" + _bd_exit=$? fi - if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then + if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads" _bd_exit=0 fi - if [ "$_bd_exit" -eq 3 ]; then + if [ $_bd_exit -eq 3 ]; then echo >&2 "beads: database not initialized — skipping hook 'post-merge'" _bd_exit=0 fi - if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi + if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi fi -# --- END BEADS INTEGRATION v1.2.1 --- +# --- END BEADS INTEGRATION v1.2.2 --- diff --git a/.beads/hooks/pre-commit b/.beads/hooks/pre-commit index 66d246cf1..b015c22f6 100755 --- a/.beads/hooks/pre-commit +++ b/.beads/hooks/pre-commit @@ -1,59 +1,33 @@ #!/usr/bin/env sh -# --- BEGIN BEADS INTEGRATION v1.2.1 --- +# --- 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} - case "$_bd_timeout" in - *[!0-9]*|'') _bd_timeout_invalid=1 ;; - *[1-9]*) _bd_timeout_invalid=0 ;; - *) _bd_timeout_invalid=1 ;; - esac - if [ "$_bd_timeout_invalid" -eq 1 ]; then - echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds" - _bd_timeout=300 - fi - _bd_timeout_backend=none - _bd_timeout_command= - for _bd_timeout_candidate in timeout gtimeout; do - if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then - if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then - case "$_bd_timeout_version" in - "timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;; - esac - fi - fi - done - if [ -n "$_bd_timeout_command" ]; then - _bd_timeout_backend=coreutils - if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run pre-commit "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _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_timeout_backend=perl - if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run pre-commit "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _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" - if bd hooks run pre-commit "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + bd hooks run pre-commit "$@" + _bd_exit=$? fi - if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then + 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 + 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 + if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi fi -# --- END BEADS INTEGRATION v1.2.1 --- +# --- END BEADS INTEGRATION v1.2.2 --- diff --git a/.beads/hooks/pre-push b/.beads/hooks/pre-push index 94191d78f..1d4c4cc22 100755 --- a/.beads/hooks/pre-push +++ b/.beads/hooks/pre-push @@ -1,59 +1,33 @@ #!/usr/bin/env sh -# --- BEGIN BEADS INTEGRATION v1.2.1 --- +# --- 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} - case "$_bd_timeout" in - *[!0-9]*|'') _bd_timeout_invalid=1 ;; - *[1-9]*) _bd_timeout_invalid=0 ;; - *) _bd_timeout_invalid=1 ;; - esac - if [ "$_bd_timeout_invalid" -eq 1 ]; then - echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds" - _bd_timeout=300 - fi - _bd_timeout_backend=none - _bd_timeout_command= - for _bd_timeout_candidate in timeout gtimeout; do - if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then - if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then - case "$_bd_timeout_version" in - "timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;; - esac - fi - fi - done - if [ -n "$_bd_timeout_command" ]; then - _bd_timeout_backend=coreutils - if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run pre-push "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=0 + if command -v timeout >/dev/null 2>&1; then + timeout "$_bd_timeout" bd hooks run pre-push "$@" + _bd_exit=$? + elif command -v gtimeout >/dev/null 2>&1; then + gtimeout "$_bd_timeout" bd hooks run pre-push "$@" + _bd_exit=$? elif command -v perl >/dev/null 2>&1; then - _bd_timeout_backend=perl - if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run pre-push "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=1 + perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run pre-push "$@" + _bd_exit=$? else echo >&2 "beads: hook 'pre-push' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT" - if bd hooks run pre-push "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + bd hooks run pre-push "$@" + _bd_exit=$? fi - if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then + if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads" _bd_exit=0 fi - if [ "$_bd_exit" -eq 3 ]; then + if [ $_bd_exit -eq 3 ]; then echo >&2 "beads: database not initialized — skipping hook 'pre-push'" _bd_exit=0 fi - if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi + if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi fi -# --- END BEADS INTEGRATION v1.2.1 --- +# --- END BEADS INTEGRATION v1.2.2 --- diff --git a/.beads/hooks/prepare-commit-msg b/.beads/hooks/prepare-commit-msg index 82c34c829..63a92261d 100755 --- a/.beads/hooks/prepare-commit-msg +++ b/.beads/hooks/prepare-commit-msg @@ -1,59 +1,33 @@ #!/usr/bin/env sh -# --- BEGIN BEADS INTEGRATION v1.2.1 --- +# --- 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} - case "$_bd_timeout" in - *[!0-9]*|'') _bd_timeout_invalid=1 ;; - *[1-9]*) _bd_timeout_invalid=0 ;; - *) _bd_timeout_invalid=1 ;; - esac - if [ "$_bd_timeout_invalid" -eq 1 ]; then - echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds" - _bd_timeout=300 - fi - _bd_timeout_backend=none - _bd_timeout_command= - for _bd_timeout_candidate in timeout gtimeout; do - if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then - if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then - case "$_bd_timeout_version" in - "timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;; - esac - fi - fi - done - if [ -n "$_bd_timeout_command" ]; then - _bd_timeout_backend=coreutils - if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run prepare-commit-msg "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=0 + if command -v timeout >/dev/null 2>&1; then + timeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@" + _bd_exit=$? + elif command -v gtimeout >/dev/null 2>&1; then + gtimeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@" + _bd_exit=$? elif command -v perl >/dev/null 2>&1; then - _bd_timeout_backend=perl - if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run prepare-commit-msg "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + _bd_used_perl=1 + perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run prepare-commit-msg "$@" + _bd_exit=$? else echo >&2 "beads: hook 'prepare-commit-msg' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT" - if bd hooks run prepare-commit-msg "$@"; then - _bd_exit=0 - else - _bd_exit=$? - fi + bd hooks run prepare-commit-msg "$@" + _bd_exit=$? fi - if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then + if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads" _bd_exit=0 fi - if [ "$_bd_exit" -eq 3 ]; then + if [ $_bd_exit -eq 3 ]; then echo >&2 "beads: database not initialized — skipping hook 'prepare-commit-msg'" _bd_exit=0 fi - if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi + if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi fi -# --- END BEADS INTEGRATION v1.2.1 --- +# --- END BEADS INTEGRATION v1.2.2 ---