Skip to content

chore: sync core lib and CLAUDE.md from agent-core#10

Merged
avifenesh merged 1 commit intomainfrom
chore/sync-core-consult-20260314-225716
Mar 15, 2026
Merged

chore: sync core lib and CLAUDE.md from agent-core#10
avifenesh merged 1 commit intomainfrom
chore/sync-core-consult-20260314-225716

Conversation

@avifenesh
Copy link
Copy Markdown
Contributor

Automated sync of lib/ and CLAUDE.md from agent-core.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the core library by synchronizing it with the agent-core repository. The primary functional enhancement is the introduction of a robust Git history analysis capability, allowing for the collection and reporting of key repository health metrics. This integration expands the analytical tools available within the system, providing deeper insights into code evolution and team dynamics.

Highlights

  • New Git History Collector: A new module, lib/collectors/git.js, was added to collect comprehensive Git history analysis data. This collector leverages the agent-analyzer binary to extract metrics such as code hotspots, bus factor, AI attribution ratio, contributor statistics, and release information.
  • Integration into Main Collector: The newly introduced Git collector has been integrated into the main lib/collectors/index.js module. It is now part of the default collection options and its data is gathered when the collect function is invoked with the 'git' collector enabled.
  • Automated Sync: This pull request represents an automated synchronization of core library files and the CLAUDE.md documentation from the agent-core repository, ensuring consistency across projects.
Changelog
  • lib/collectors/git.js
    • Added a new module to collect Git history analysis data.
    • Implemented collectGitData function to run agent-analyzer and parse its output.
    • Extracted and structured various metrics including hotspots, contributors, bus factor, AI attribution, conventions, and release information.
    • Included error handling for cases where the agent-analyzer binary is unavailable or analysis fails.
  • lib/collectors/index.js
    • Imported the new git collector module.
    • Added git to the list of default collectors.
    • Integrated the git.collectGitData function call into the main collect function, conditionally executing it when 'git' is an enabled collector.
    • Exported the git collector and its collectGitData function for external use.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request syncs files from the agent-core repository, notably adding a new Git history collector. My review of the new lib/collectors/git.js file has identified a few areas for improvement. The new collectGitData function includes an adjustForAi option that is not used, its return object contains redundant data which could be confusing, and it relies on synchronous, blocking calls which could impact performance in an asynchronous environment. While I understand this is an automated sync, addressing these points would improve the quality of the code being integrated.

* @param {Object} [options={}] - Collection options
* @param {string} [options.cwd] - Repository path (default: process.cwd())
* @param {number} [options.top=20] - Number of hotspots to return
* @param {boolean} [options.adjustForAi=false] - Adjust bus factor for AI commits
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The adjustForAi option is defined in DEFAULT_OPTIONS and documented in the JSDoc for collectGitData, but it is never used within the function. This is misleading for consumers of this function who might expect it to have an effect. Please either implement the logic to adjust the bus factor for AI commits or remove this unused option.

Comment on lines +32 to +54
function collectGitData(options = {}) {
const opts = { ...DEFAULT_OPTIONS, ...options };
const cwd = opts.cwd || process.cwd();

try {
binary.ensureBinarySync();
} catch (err) {
return {
available: false,
error: `Binary not available: ${err.message}`
};
}

let map;
try {
const json = binary.runAnalyzer(['git-map', 'init', cwd]);
map = JSON.parse(json);
} catch (err) {
return {
available: false,
error: `Git analysis failed: ${err.message}`
};
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The collectGitData function uses synchronous, blocking calls like binary.ensureBinarySync() and binary.runAnalyzer(). These can block the Node.js event loop, especially ensureBinarySync which might download a binary from the network. If this code is used in a server or other non-blocking context, this could cause performance issues.

Consider converting collectGitData to an async function and using the asynchronous alternatives ensureBinary() and runAnalyzerAsync() which are available in lib/binary/index.js. This would require the calling function collect in lib/collectors/index.js to also become async and await the result.

Comment on lines +101 to +137
return {
available: true,
health: {
active: humanList.length > 0,
busFactor,
aiRatio: Math.round(aiRatio * 100) / 100,
totalCommits: allCommits,
totalContributors: humanList.length
},
hotspots,
contributors: humanList.slice(0, 10),
aiAttribution: {
ratio: Math.round(aiRatio * 100) / 100,
attributed: aiAttribution.attributed || 0,
heuristic: aiAttribution.heuristic || 0,
none: aiAttribution.none || 0,
tools: aiAttribution.tools || {}
},
busFactor,
conventions: {
style: conventions.style || null,
prefixes: conventions.prefixes || {},
scopes: conventions.scopes || {}
},
releaseInfo: {
tagCount: releases.tags ? releases.tags.length : 0,
lastRelease: releases.tags && releases.tags.length > 0
? releases.tags[releases.tags.length - 1]
: null,
cadence: releases.cadence || null
},
commitShape: {
typicalSize: commitShape.typicalSize || null,
filesPerCommit: commitShape.filesPerCommit || null,
mergeCount: commitShape.mergeCount || 0
}
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The returned object has some redundant properties. For example:

  • busFactor is present at the top level and also within the health object.
  • A rounded aiRatio is present in health.aiRatio and also in aiAttribution.ratio.

This duplication can be confusing for API consumers and might lead to inconsistencies. It would be better to have a single source of truth for each metric. Consider removing the duplicate properties to create a cleaner API.

@avifenesh avifenesh merged commit 0b61b53 into main Mar 15, 2026
8 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