feat(trace): report the generated line totals of a session

Merged
JI
1d ago
+108-20

Chainloop Trace now reports, in the AI coding session evidence, the total lines that the agent edits of a session added and removed. The totals include the lines that never reached a commit. Two new fields in code_changes hold them: ai_generated_lines_added and ai_generated_lines_removed. Compare them with ai_lines_added and ai_lines_removed to see how much of the generated code the session kept.

The CLI already keeps these counts in the trace state (spec issue-3639, R-011). This PR does the follow-up that D-011 and the Non-goal of the spec defer: it reports the totals in the evidence. The change is additive, and a platform that does not know the fields keeps working (R-009). A session with no commit still sends no evidence, so it reports no totals.

This prepares the "Generated" stage of the AI code lifecycle view (PFM-7302).

AI disclosure: Claude Code assisted with this change.