Files
Jeffrey Emanuel b2ce17b317 feat(audit-2026-05-09): foundational beads cuu3f/yvv7r/waijq/8tgic + concurrent updates
Implements the first batch of audit-2026-05-09 completion-debt epic (vz9t8) work:

cuu3f (P3) — bead-ID commit-message convention:
- AGENTS.md gains "Commit-Message Convention" subsection documenting the
  (coding_agent_session_search-<id>) format.
- scripts/git-hooks/{pre-push.sh,install.sh} provides an opt-in warning hook.
- tests/agents_md_documents_commit_convention.rs (4 tests) pins the contract.
- scripts/tests/cuu3f_prepush_hook_e2e.sh exercises 4 hook scenarios.

yvv7r (P2 bug) — CASS_SIMD_DOT + CASS_PARALLEL_SEARCH rollback env vars:
- src/search/runtime_optimizations.rs introduces the OnceLock-cached toggle
  infrastructure with shared semantics for CASS_SIMD_DOT / CASS_PARALLEL_SEARCH /
  CASS_F16_PRECONVERT. Reads via dotenvy per AGENTS.md contract.
- src/lib.rs run_health surfaces runtime_optimizations object with simd_dot,
  parallel_search, preconvert_f16, config_source fields.
- tests/runtime_optimizations.rs (6 tests) verifies happy/error/edge paths
  via assert_cmd-spawned cass health --json.
- scripts/tests/yvv7r_rollback_envvars_e2e.sh (7 scenarios).

waijq (P2 bug) — CASS_F16_PRECONVERT env-toggle:
- Implementation shares the runtime_optimizations.rs module added by yvv7r.
- scripts/tests/waijq_f16_preconvert_e2e.sh (10 scenarios) verifies env-var
  parsing through cass health.

8tgic (P2 bug) — SIMD dot-product test suite:
- tests/simd_tests.rs (10 tests) covers FP-tolerance, random inputs (1000
  trials), and 7 edge cases (zeros, unit vectors, denormals, NaN, infinity,
  mismatched lengths, f16 variants).
- scripts/tests/8tgic_simd_tests_e2e.sh runs each test in isolation.

Concurrent-agent work in this commit (per AGENTS.md "treat changes from
parallel agents as your own"):
- src/lib.rs adds --max-results / --num-results / --top-k / -n flag-alias
  normalization (search/pack/sessions/context/analytics tools).
- README.md, docs/ROBOT_MODE.md, tests/cli_robot.rs, tests/golden/ updated
  to match the new alias surface.

(coding_agent_session_search-cuu3f)
(coding_agent_session_search-yvv7r)
(coding_agent_session_search-waijq)
(coding_agent_session_search-8tgic)
2026-05-09 03:38:20 -04:00

55 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# pre-push hook — warns when commits being pushed to main lack any bead-ID reference.
#
# Per coding_agent_session_search-cuu3f. The convention: when a commit closes (or
# substantially advances) a bead, append `(coding_agent_session_search-<short-id>)`
# to the commit subject. Multi-bead commits append all relevant IDs.
#
# Stand-alone bead-tracker commits (e.g. `br sync --flush-only`) do not need
# this prefix; the hook does NOT block, only warns.
#
# Install via scripts/git-hooks/install.sh.
set -euo pipefail
# Read the push specs from stdin: <local-ref> <local-sha> <remote-ref> <remote-sha>
# We only check pushes that target `refs/heads/main`.
remote="${1:-origin}"
url="${2:-}"
# Drain stdin into an array of lines.
while IFS=' ' read -r local_ref local_sha remote_ref remote_sha; do
[ -n "$local_ref" ] || continue
[ "$remote_ref" = "refs/heads/main" ] || continue
# Determine the commit range to inspect.
if [ "$remote_sha" = "0000000000000000000000000000000000000000" ]; then
# New branch on remote — inspect the local sha back to the merge-base.
range="$(git merge-base origin/main "$local_sha" 2>/dev/null || true)..$local_sha"
else
range="${remote_sha}..${local_sha}"
fi
[ -n "$range" ] || continue
# Count commits in range and how many reference a bead.
total=0
with_bead=0
while IFS= read -r subject; do
total=$((total + 1))
if printf '%s' "$subject" | grep -qE 'coding_agent_session_search-[a-z0-9_]+(\.[0-9]+)*'; then
with_bead=$((with_bead + 1))
fi
done < <(git log --format='%s' "$range" 2>/dev/null || true)
if [ "$total" -gt 0 ] && [ "$with_bead" -eq 0 ]; then
cat >&2 <<EOF
warning: pre-push: pushing $total commit(s) to $remote_ref but none reference a bead.
hint: per AGENTS.md "Commit-Message Convention", append (coding_agent_session_search-<id>) to commit subjects when closing a bead.
hint: stand-alone bead-tracker commits (br sync, etc.) and CI/dep bumps are exempt — push proceeds either way.
EOF
fi
done
exit 0