Hi All, I am facing a data question: when I use API “Get AI commit metrics”, I get the response, one record like below, totalLinesAdd < nonAiLinesAdded.
My unstanding is, normally " totalLinesAdd = AI lines added + nonAI lines added". So the total lines should >= nonAI Lines added.
Anyone has idea why (totalLinesAdd < nonAiLinesAdde) ?
The relationship between totalLinesAdded and nonAiLinesAdded is not a simple totalLinesAdded = AI + nonAI, which I understand can be confusing.
The current scoring algorithm excludes blank lines from totalLinesAdded to provide a more meaningful AI contribution percentage. However, nonAiLinesAdded tracks human-written lines separately and can include some of those blank lines when they appear between human-written code. This means nonAiLinesAdded can legitimately exceed totalLinesAdded in commits that contain many blank lines.
If you want to compute AI contribution, the most reliable approach is to use tabLinesAdded + composerLinesAdded for the AI portion, rather than deriving it from totalLinesAdded - nonAiLinesAdded.
For reference, here is the AI Code Tracking API documentation. Note that the API is currently in Alpha and field semantics may evolve.