-----------------|
| Traditional Human-Only | 0% | 0% | High (Commit messages + mental model) | < 5 mins | Clear (Single author chain) |
| AI-Assisted (Claude Code) | 39% | 59% | Low (Ephemeral chat context) | 15-30 mins (requires full diff review) | Blurred (Human committer ≠ logic author) |
Key Findings:
- The "sweet spot" for AI-assisted development isn't legal ownership, but operational readiness. Code that passes tests but lacks retained design context becomes technical debt the moment it requires modification.
- Cognitive ownership is the true metric of authorship: if you cannot defend or debug a line of code at 2 AM, you do not own it, regardless of
git blame attribution.
- The accountability gap compounds during incidents. Without explicit design documentation, rollback decisions become guesswork rather than informed engineering.
Core Solution
The solution requires shifting from passive AI consumption to active accountability engineering. This involves implementing surgical attribution tracking, enforcing design-context commit conventions, and establishing cognitive ownership gates before merging.
1. AI Contribution Attribution Script
Use the following pipeline to quantify AI vs. human authorship across the repository and isolate business logic:
# Script para contar líneas por autor en el repo
# Excluye archivos generados automáticamente y node_modules
git log --format='%H' | while read commit; do
git show --stat "$commit" | tail -1
done
# Versión más quirúrgica: blame por archivo
git ls-files '*.ts' '*.tsx' | while read file; do
git blame --line-porcelain "$file" 2>/dev/null \
| grep '^author ' \
| sed 's/^author //'
done | sort | uniq -c | sort -rn
2. Baseline Attribution Results
# Resultado real — proyecto backend, 4.2k líneas de TypeScript
# (excluyendo package-lock, migrations autogeneradas y fixtures)
2587 Juan Torchia
1634 Claude (via Claude Code)
3. Core Logic Isolation
# Solo archivos de lógica de negocio (services/, handlers/, lib/)
git ls-files 'src/services/*.ts' 'src/handlers/*.ts' 'src/lib/*.ts' \
| while read file; do
git blame --line-porcelain "$file" 2>/dev/null \
| grep '^author '
done | sort | uniq -c | sort -rn
# Output:
# 412 Claude (via Claude Code)
# 289 Juan Torchia
4. The Accountability Gap in Practice
AI-generated code often implements correct patterns without preserving the decision rationale. Consider this retry handler:
// Este handler lo generó Claude Code en febrero
// Lo commiteé sin cambiarlo porque "funcionaba"
// Hoy no podría explicar por qué usa esta estrategia de retry
// sin leer el código de nuevo completo
export async function processEventWithRetry(
event: ProcessableEvent,
maxAttempts = 3
): Promise<ProcessResult> {
// Exponential backoff con jitter — ¿por qué jitter?
// ¿por qué esta fórmula específica? No lo sé de memoria.
const delay = (attempt: number) =>
Math.min(1000 * 2 ** attempt + Math.random() * 1000, 30000);
for (let attempt = 0; attempt < maxAttempts; attempt++) {
try {
return await processEvent(event);
} catch (err) {
if (attempt === maxAttempts - 1) throw err;
await sleep(delay(attempt));
}
}
throw new Error("unreachable");
}
5. Design-Context Commit Convention
Bridge the accountability gap by mandating explicit design documentation in commit messages:
# Formato que uso ahora para commits con código IA
git commit -m "feat: retry handler con exponential backoff
[IA-context] Le pedí a Claude Code una estrategia de retry
que tolerara thundering herd en workers concurrentes.
Elegí esta implementación sobre polling simple porque
el volumen de eventos puede subir a 500/min en pico.
Revisé: lógica de delay, manejo de errores no retryables.
No revisé en profundidad: edge cases de event ordering."
Pitfall Guide
- Committing Without Design Context: Accepting AI output without documenting the architectural rationale creates irreversible context loss. Best Practice: Enforce
[IA-context] blocks in commit messages that capture the prompt intent, selected tradeoffs, and review scope.
- Ignoring Complexity Cutoffs: Assuming passing tests equals maintainable code leads to unmanageable technical debt. Best Practice: Implement a "2-sentence explanation rule"—if you cannot verbally explain the implementation without re-reading the diff, do not commit until you understand it.
- Confusing Working Code with Understood Code: Functional output does not equal ownership. Cognitive ownership requires the ability to modify, debug, and defend the code under production pressure. Best Practice: Treat AI-generated code as third-party dependencies until you can independently trace its execution path and failure modes.
- Overlooking Open Source DCO Policies: Submitting AI-generated code to repositories requiring a Developer Certificate of Origin (DCO) violates contributor agreements. Best Practice: Verify project policies before contributing; organizations like the FSF and Linux kernel explicitly restrict AI-generated contributions due to attribution and licensing constraints.
- Relying Solely on Legal Frameworks: Assuming copyright or vendor indemnification covers operational risks is a false security model. Best Practice: Prioritize accountability chains, postmortem readiness, and cognitive ownership over legal ambiguity. The EU AI Act and emerging regulatory frameworks emphasize human-in-the-loop responsibility, not AI authorship.
Deliverables
- AI Code Accountability Blueprint: A structured framework mapping the 3-layer accountability model (comprehension, design memory, postmortem readiness) to engineering workflows, including review gates, attribution tracking, and incident response protocols.
- Pre-Commit & Postmortem Checklist: Validation steps to ensure cognitive ownership before merging AI-generated code, including complexity cutoff verification, design-context documentation, and 3 AM debug-readiness assessment.
- Configuration Templates:
.gitmessage template with mandatory [IA-context] sections
git blame attribution pipeline script for repository-wide AI contribution auditing
- Commit hook configuration for enforcing design documentation on AI-assisted changes