Skip to content

commit-time fallback writes h_ (known human) for lines no human was observed typing #2395

Open

Description

@BerkayClik

Environment: Git AI 1.7.5 (git-ai-macos-arm64, official release binary), macOS 26 arm64, git 2.54.0, daemon mode (trace2.eventTarget → daemon socket). Reproductions use a throwaway $HOME.

Spec. Git AI Standard v3.0.0, "Human Record Object": known-human attribution "represents lines that were explicitly observed being typed by a human in an IDE with the git-ai extension installed. This is distinct from 'untracked' lines (which have no attestation entry at all and whose provenance is unknown)."

Actual (1.7.5). attribution_recovery::recover_attribution ends with recover_remaining_as_known_human (src/authorship/attribution_recovery.rs:288, :709). It assigns all still-unattested committed lines to h_<sha256(committer)> whenever the note has no AI attestation or already has an h_ entry (should_recover_remaining_as_known_human, :737). The resulting key and humans record are byte-identical to those from a real KnownHuman checkpoint (src/daemon/checkpoint.rs:938). HumanRecord has only author, so consumers cannot tell the two apart.

Reproduction.

export HOME=$(mktemp -d); git-ai config set telemetry_oss off
git config --global trace2.eventTarget "af_unix:stream:$HOME/.git-ai/internal/daemon/trace2.sock"
git config --global trace2.eventNesting 0
git config --global user.name "Fixture Dev"; git config --global user.email [email protected]
git-ai bg restart
mkdir r && cd r && git init -q && echo base > base.txt && git add -A && git commit -qm base
printf 'one\ntwo\nthree\n' > notes.txt          # no checkpoint of any kind
git add -A && git commit -qm "unattested only"
git-ai await --timeout 30; git notes --ref=ai show HEAD

Output:

notes.txt
  h_4cad400a95f459 1-3
---
{ ..., "sessions": {}, "humans": { "h_4cad400a95f459": { "author": "Fixture Dev <[email protected]>" } } }

Running git-ai checkpoint mock_known_human h.txt before committing produces the same h_4cad400a95f459 key and record. In a commit with one KnownHuman-checkpointed file and one untouched file, both files get the same h_ key.

Expected. Either leave unobserved lines unattested (as the spec says), or record how the human attestation was obtained, e.g. humans.<id>.source: "known_human_checkpoint" | "commit_fallback" or a separate key prefix, so consumers can separate observed human edits from inferred ones.

Impact. Any tool that follows the spec reports unobserved code (scripts, unhooked agents, generated files) as human-written. Our tooling now counts every 1.7.5 h_ line as unknown.

(Edited: the original filing was cut off mid-code-block; the remainder had landed in #2396, which now holds a separate issue.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions