feat(telemetry): auto-link commits to beads via post-commit hook (bo-5em9)#25
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
bobbin bead auto-link --commit HEADsubcommand. Resolves the bead id from the commit, then records onecommitlineage row enriched with the same numstat /feature_id/ symbol data as a manual link (reuses the bo-xrsy helpers).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.commitrow already exists for the (bead, sha) pair, so amend/rebase re-fires don't duplicate (no schema UNIQUE migration needed).>/dev/null 2>&1 &); a missing bead / non-bobbin repo / git error never breaks the commit.bobbin bead auto-link.bobbin hook statusflags a stale (pre-auto-link) hook and nudges re-install.cli/hook.mdupdated with the re-install note.Test
cargo test --bin bobbingreen locally (839 tests).find_bead_id,parenthesized_bead_id,extract_bead_id_*(trailer/paren/subject/branch/none),git_hook_section_has_markers.Notes
bobbin hook install-git-hookis re-run (status flags this).Style check(Vale) failure is pre-existing doc debt, unrelated to this PR (per fix: clear bobbin bug backlog (bo-f61, bo-92t, bo-ewk, bo-b0nn, bo-ruuc) #22/feat(telemetry): extend bead_lineage — feature_id + numstat + symbols (bo-xrsy) #23/feat(config): surface context-assembly knobs to [context]/[feedback] (bo-qlfu) #24).🤖 Generated with Claude Code