Skip to content

feat(telemetry): auto-link commits to beads via post-commit hook (bo-5em9)#25

Merged
scbrown merged 1 commit into
mainfrom
bo-5em9-autolink-hook
Jun 27, 2026
Merged

feat(telemetry): auto-link commits to beads via post-commit hook (bo-5em9)#25
scbrown merged 1 commit into
mainfrom
bo-5em9-autolink-hook

Conversation

@scbrown

@scbrown scbrown commented Jun 27, 2026

Copy link
Copy Markdown
Owner

bo-5em9 — auto-link beads→commits via git post-commit hook (telemetry Phase 0)

Closes the top-leverage gap in the feature↔code↔bug reconcile/predict loop (bo-yo9 / GH#9): bead lineage was only ever populated by a manual bobbin bead link, so it stayed sparse. Now the existing post-commit hook records lineage automatically.

Changes

  • New bobbin bead auto-link --commit HEAD subcommand. Resolves the bead id from the commit, then records one commit lineage row enriched with the same numstat / feature_id / symbol data as a manual link (reuses the bo-xrsy helpers).
  • Bead-id precedence: (a) Bead: <id> commit trailer → (b) parenthesized (bo-xxxx) in subject → (c) first bead-id token in subject → (d) branch name. No bead id → no row, exit 0.
  • Idempotent: skips if a commit row already exists for the (bead, sha) pair, so amend/rebase re-fires don't duplicate (no schema UNIQUE migration needed).
  • Failure-isolated: the hook backgrounds it and discards output (>/dev/null 2>&1 &); a missing bead / non-bobbin repo / git error never breaks the commit.
  • Hook section now also runs bobbin bead auto-link. bobbin hook status flags a stale (pre-auto-link) hook and nudges re-install.
  • Tests for id extraction/precedence + hook-section markers; cli/hook.md updated with the re-install note.

Test

  • cargo test --bin bobbin green locally (839 tests).
  • New unit tests: find_bead_id, parenthesized_bead_id, extract_bead_id_* (trailer/paren/subject/branch/none), git_hook_section_has_markers.

Notes

🤖 Generated with Claude Code

…5em9)

The git post-commit hook now runs `bobbin bead auto-link --commit HEAD`
alongside re-indexing, so bead->commit lineage is captured automatically
instead of relying on manual `bobbin bead link`. Without this the
reconcile/predict layers (bo-mu4m/bo-6i55) have no training data.

- New `bobbin bead auto-link` subcommand: resolves the bead id from the
  commit (Bead: trailer > parenthesized (bo-xxxx) > first subject token >
  branch name), then records one `commit` lineage row enriched with the
  same numstat / feature_id / symbol data as a manual link (reuses the
  bo-xrsy helpers).
- Idempotent: skips if a `commit` row already exists for the (bead, sha)
  pair, so amend/rebase re-fires do not duplicate.
- Failure-isolated: backgrounded + output-discarded in the hook; no bead
  id => no row, exit 0.
- `hook status` flags a stale (pre-auto-link) hook and nudges re-install.
- Tests for id extraction/precedence + hook section; docs updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y4bHA4rPftj9dPSwi7FvH
@scbrown
scbrown merged commit a86b74b into main Jun 27, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant