Skip to content

Chainloop Trace: AI/human line attribution that survives later human edits #3639

Open

Description

@jiparis

Problem

Chainloop Trace gives a wrong AI/human line split for a file when a human changes AI-written lines later. The CLI records AI line ranges at edit time and never updates them. It also adds up the diffs of all commits in a session.

Example: the AI writes 100 lines, then a human changes 20 of them. The correct split is 80 AI / 20 human.

Case CLI evidence today
Same session, same commit AI 100 / human 0
Same session, commit 2 not in the session AI 100 / human 0, commit 2 not recorded
Same session, commit 2 in the session AI 100 / human 20, AI removed 20
Different sessions, commit 2 in session B A: AI 100. B: human 20, human removed 20
Commit 2 in no session A: AI 100, commit 2 not recorded

Other gaps:

  • Every removed line in a file that the AI touched counts as an AI removal.
  • A commit with only part of the AI lines of a file retires the whole file. A later commit with the rest is not credited.
  • Renames, amend, rebase, and squash lose the line ranges.

Scope

  • A design spec in docs/specs/ that covers all five cases.
  • The CLI implementation in Chainloop Trace.
  • An update to the feature table and the compatibility matrix in the Trace README.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions