Skip to content

feat: AI session provenance — link Claude Code session logs to traceability chain #127

@avrabe

Description

@avrabe

Context

Claude Code already logs complete session data: full conversation, every tool call, model ID (claude-opus-4-6), Claude Code version, timestamps, git branch, token usage, hooks. The files sit at ~/.claude/projects/*/.

rivet already traces requirement → artifact → test → evidence. sigil signs the output. The missing link: connecting the AI session that produced a commit to the traceability chain.

Proposal

  1. Commit hook that writes session metadata into git commit trailers:

    • Session ID
    • SHA-256 of the session .jsonl at time of commit
    • Model ID
    • Claude Code version
  2. rivet artifact type ai-session that references:

    • Commit SHA
    • Session hash
    • Model ID + version
    • Link to the requirement(s) the session addressed
  3. rivet audit subcommand (or extension of rivet validate) that checks:

    • Every AI-authored commit (Co-Authored-By header) has a corresponding ai-session artifact
    • Session hashes are present and consistent

What this is NOT

  • Not reproducibility — same prompt, different day, different output. Same as a human developer. We never logged which Stack Overflow answer or conversation led to an implementation either.
  • Not model internals — exact weights, sampling parameters, server-side updates are opaque. ISO 26262 tool qualification does not require verifying a compiler's source code. It requires verifying the output independently. The proofs handle that.

What this IS

Auditability. An assessor can see: this requirement was addressed in this session, by this model, producing this commit, verified by these proofs, signed by sigil.

Relates to

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