Skip to content

feat(history): git-history context in the bundle (5.6)#39

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-5/step-5.6-git-history
Jul 15, 2026
Merged

feat(history): git-history context in the bundle (5.6)#39
officialCodeWork merged 1 commit into
developmentfrom
build/phase-5/step-5.6-git-history

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

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.

  • Per-file git log --follow via execFileSync — pure subprocess, no network.
  • Commits deduped across files, sorted newest-first by committer timestamp, capped at limit.
  • parsePrNumber pulls #NN out of merge (Merge pull request #38 …) and squash (… (#12)) subjects.
  • Any failure — not a repo, git missing, untracked path, empty file list — returns [], so the bundle degrades gracefully.

The bundle history section (default 5) is populated from the matched component's file plus its render subtree. BundleCommit gains an optional pr; 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

  • 6 packages build/typecheck clean; context-bundle drift gate green
  • unit tests: 187 pass (agent-sdk 19 incl. new history.test.ts with 5 tests, parser 119, core 46, vision 3)
  • eval: 265 pass · 0 fail · 0 xfail, gate OK

🤖 Generated with Claude Code

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>
@officialCodeWork
officialCodeWork merged commit bae972b into development Jul 15, 2026
1 check 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.

2 participants