feat(history): git-history context in the bundle (5.6)#39
Merged
Conversation
gitHistory(root, files, limit) in agent-sdk: per-file `git log --follow` (execFileSync, no network), commits deduped across files and sorted newest-first by committer time. parsePrNumber pulls `#NN` from merge/ squash subjects. Any failure — not a repo, git missing, untracked path — yields [] so the bundle degrades gracefully. The bundle `history` section (default 5 commits) is populated from the matched component's files plus its render subtree; BundleCommit gains an optional `pr` (context-bundle schema regenerated, drift gate green). Integration tests run against this repo's own history; PR parsing tested deterministically. 5 agent-sdk unit tests + a bundle-wiring test. eval 265/0/0, gate OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
TRACKER step 5.6 — Git history context (failure mode F5).
gitHistory(root, files, limit)in@coderadar/agent-sdk: the most recent commits touching the matched files.git log --followviaexecFileSync— pure subprocess, no network.limit.parsePrNumberpulls#NNout of merge (Merge pull request #38 …) and squash (… (#12)) subjects.gitmissing, untracked path, empty file list — returns[], so the bundle degrades gracefully.The bundle
historysection (default 5) is populated from the matched component's file plus its render subtree.BundleCommitgains an optionalpr; context-bundle schema regenerated, drift gate green.Accept
Integration tests run against this repo's own history (
TRACKER.md): returns tracked commits, abbreviated shas, and honors the limit; PR parsing is asserted deterministically; a bogus root returns[]. A parser-side bundle test confirms the wiring end-to-end.Verification
history.test.tswith 5 tests, parser 119, core 46, vision 3)🤖 Generated with Claude Code