Skip to main content

AI Code Transparency Tool - detect AI-written code and measure developer understanding

Project description

๐Ÿงฌ CodeDNA โ€” AI Code Transparency Tool

Understand every line of code you commit. Is it really yours, or AI's?

Detect which code was written by AI, measure how well developers actually understand their commits, and map out "understanding debt" across your entire team.

PyPI version License: MIT Python 3.10+ GitHub stars

Quick Start โ€ข Features โ€ข Commands โ€ข Pricing โ€ข Docs


๐ŸŽฏ The Problem

In 2026, developers write 78% of their code with AI help (Copilot, Cursor, ChatGPT, Claude). The result?

  • ๐Ÿ˜ฐ "Understanding Debt" โ€” Code is committed, but no one actually knows how it works
  • ๐ŸšŒ Bus Factor = 1 โ€” Everyone uses the same AI, no one understands the codebase
  • ๐Ÿ’ฐ Technical Debt Explosion โ€” Without human review, AI-generated code decays fast
  • ๐Ÿ› Bug Multiplication โ€” 3 months later: "Who wrote this? I don't even know what it does"

CodeDNA solves this. Every commit is scored. Every developer is measured. Every team gets visibility.


โœจ Features

๐Ÿ” AI Detection (4-metric fingerprint)

CodeDNA uses 4 heuristics to detect AI-generated code:

Metric AI Signature Score
comment_ratio > 0.3 AI over-comments its code +0.20
avg_function_length > 50 AI produces large monolithic blocks +0.15
single_commit_ratio > 0.7 Bulk-paste commits are AI-red flag +0.30
High complexity + single commit AI imzasฤฑ โ†’ +0.25

Total > 0.50 โ†’ AI suspected. Combined with Tree-sitter AST analysis, this gives 80%+ accuracy.

๐Ÿ‘ค Developer Understanding Score

  • Interview-based โ€” Structured Q&A after each commit
  • AI-powered โ€” Generates questions about the code you just committed
  • Tracked over time โ€” See your understanding curve

๐ŸšŒ Bus Factor Analysis

  • Ownership tracking โ€” Who owns which file?
  • Risk identification โ€” Single points of failure
  • Refactoring suggestions โ€” "Pair X with Y on module Z"

๐Ÿ’ฐ Technical Debt Estimation

  • Cost in USD โ€” How much would it cost to fix this?
  • Trend over time โ€” Is debt increasing?
  • Prioritization โ€” What to fix first?

๐Ÿƒ Sprint Health

  • Velocity tracking โ€” Real commits vs. AI-assisted
  • Code review load โ€” Who reviews what?
  • Quality metrics โ€” Per-sprint scoring

๐Ÿค– AI Tool Comparison (Enterprise)

  • Copilot vs. Cursor vs. ChatGPT โ€” Which tool produces more debt?
  • Per-developer breakdown โ€” Who uses what?
  • Productivity vs. quality โ€” Real metrics

๐ŸŽฏ Interview Tool (Enterprise)

  • Auto-generates questions โ€” "What does this function do? Why?"
  • Records responses โ€” For HR and compliance
  • Exportable reports โ€” PDF/CSV

๐Ÿš€ Developer Onboarding

  • Ramp-up curve โ€” How long to productivity?
  • Mentor matching โ€” AI suggests pairs
  • First PR analysis โ€” What did they ship?

๐Ÿ›ก๏ธ Protected Modules

  • Mark critical files โ€” "AI may not touch auth/, payment/, security/"
  • Pre-commit hook โ€” Blocks AI-generated commits to protected areas
  • Override workflow โ€” With approval

๐Ÿ“Š Web Dashboard

  • Real-time metrics โ€” Live commit feed
  • Charts โ€” Time-series, breakdowns, comparisons
  • Multi-repo view โ€” All your projects in one place
  • Team analytics โ€” Who's growing, who's stagnating

๐Ÿ’ฌ Multi-Channel Support

  • Telegram bot โ€” /codedna scan from your phone
  • WhatsApp โ€” Slash-prefix commands
  • iMessage โ€” Direct Mac integration
  • Discord/Slack โ€” Webhook support

๐Ÿš€ Quick Start

Installation

# PyPI'den
pip install codedna

# Veya uv ile (daha hizli)
uv pip install codedna

# Veya gelistirme ortamindan
git clone https://github.com/natureco-official/codedna.git
cd codedna
pip install -e .

First Use (60 seconds)

# 1. Git repo'ya git
cd your-awesome-project

# 2. CodeDNA'yi baslat (git hook + DB olusturur)
codedna init

# 3. Repoyu tara
codedna scan

# 4. Son commit skorunu gor
codedna status

# 5. Gecmis commit'leri gor
codedna history

That's it. Every commit from now on is auto-analyzed.

Run the Dashboard (optional)

# Web dashboard (port 3000) + REST API (port 8000)
codedna dashboard

# Then open http://localhost:3000
# Login with your account or register new

๐Ÿ“‹ Commands (25 total)

๐Ÿ“Š Analysis & Reporting

codedna init                  # Git hook + DB olustur
codedna scan                  # Repoyu tara
codedna status                # Son commit skoru
codedna history               # Gecmis commit'ler
codedna report                # HTML rapor olustur
codedna ai-compare            # AI arac karsilastirmasi (Enterprise)

๐Ÿ›ก๏ธ Protection & Policies

codedna protect-add <path>    # Korunan modul ekle
codedna protect-remove <path> # Korumayi kaldir
codedna protect-list          # Korunan modulleri listele
codedna protect-check <file>  # Dosya korunuyor mu?

๐Ÿ‘ฅ Team & Process

codedna onboarding            # Gelistirici ramp-up (Team+)
codedna interview-start       # Mulakat baslat (Enterprise)
codedna interview-list        # Mulakatlari listele
codedna interview-score       # Mulakat skorla
codedna bus-factor            # Sahiplik analizi (Team+)
codedna debt                  # Teknik borc (Team+)
codedna sprint-olustur        # Sprint olustur
codedna sprint-sagligi         # Sprint sagligi
codedna sprint-gecmisi         # Sprint gecmisi

๐ŸŒ Infrastructure

codedna serve                 # FastAPI REST (port 8000)
codedna dashboard             # Web dashboard (port 3000)
codedna pr-comment            # GitHub PR yorumu
codedna plan                  # Plan/lisans yonetimi
codedna plan demo pro         # 7 gunluk demo Pro lisans
codedna natureco              # NatureCo CLI entegrasyonu (Pro+)
codedna uninstall             # Hook kaldir

๐Ÿ”ง Utility

codedna doctor                # Sistem saglik kontrolu
codedna reset                 # Sifirla (DANGEROUS)

๐Ÿ’Ž Pricing

Plan Price Repos Files/Scan History Dashboard Features
Free $0 1 50 7 days โŒ AI detection, local only
Pro โ‚บ400/mo โˆž โˆž 90 days โœ… + GitHub Actions, NatureCo CLI
Team โ‚บ800/mo โˆž โˆž 365 days โœ… + Bus Factor, Sprint, Onboarding
Enterprise โ‚บ1,650/mo โˆž โˆž โˆž โœ… + AI Compare, Interview Tool, SSO

Start with codedna plan demo pro to test Pro features for 7 days.

Payment via Lemon Squeezy โ€” TRY pricing for Turkish market, USD for global.


๐Ÿ”Œ Integrations

CI/CD

  • GitHub Actions โ€” Auto-comment on PR
  • GitLab CI โ€” Pipeline integration
  • Bitbucket Pipelines โ€” Snippets

Issue Trackers

  • Jira โ€” Story โ†’ commit mapping
  • Linear โ€” Issue tracking
  • GitHub Issues โ€” Auto-link

Notifications

  • Slack โ€” Real-time alerts
  • Discord โ€” Webhook support
  • Telegram โ€” Bot commands
  • Email โ€” Daily digest

AI Tools

  • GitHub Copilot โ€” Detection
  • Cursor โ€” Detection
  • ChatGPT/Claude โ€” Detection
  • Codeium โ€” Detection

๐Ÿ› ๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CLI (Python 7,000+ LOC)                                โ”‚
โ”‚  โ”œโ”€โ”€ Typer framework                                    โ”‚
โ”‚  โ”œโ”€โ”€ Tree-sitter parsers (Python, JS, TS, JSX, TSX)   โ”‚
โ”‚  โ”œโ”€โ”€ GitPython (commit analysis)                        โ”‚
โ”‚  โ”œโ”€โ”€ SQLite (local DB)                                  โ”‚
โ”‚  โ””โ”€โ”€ JWT (auth)                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ†“ HTTP
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  REST API (FastAPI)                                     โ”‚
โ”‚  โ”œโ”€โ”€ /auth (register, login, me)                        โ”‚
โ”‚  โ”œโ”€โ”€ /billing (checkout, webhook, subscription)        โ”‚
โ”‚  โ”œโ”€โ”€ /commits (list, scores)                            โ”‚
โ”‚  โ”œโ”€โ”€ /files (analysis)                                  โ”‚
โ”‚  โ””โ”€โ”€ /repo (bus-factor, debt, sprint)                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ†“ HTTP
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Web Dashboard (Next.js)                                โ”‚
โ”‚  โ”œโ”€โ”€ /dashboard (metrics)                               โ”‚
โ”‚  โ”œโ”€โ”€ /files (file list)                                 โ”‚
โ”‚  โ”œโ”€โ”€ /commits (commit history)                          โ”‚
โ”‚  โ”œโ”€โ”€ /bus-factor (ownership)                            โ”‚
โ”‚  โ”œโ”€โ”€ /debt (technical debt)                             โ”‚
โ”‚  โ”œโ”€โ”€ /sprints (sprint health)                            โ”‚
โ”‚  โ”œโ”€โ”€ /ai-compare (tool comparison)                       โ”‚
โ”‚  โ”œโ”€โ”€ /onboarding (developer ramp-up)                    โ”‚
โ”‚  โ”œโ”€โ”€ /protected (module list)                           โ”‚
โ”‚  โ”œโ”€โ”€ /interview (Q&A tool)                               โ”‚
โ”‚  โ”œโ”€โ”€ /settings/integrations                              โ”‚
โ”‚  โ””โ”€โ”€ /pricing (plan comparison)                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

3-Layer Stack

  1. CLI โ€” Terminal-first developers
  2. REST API โ€” Backend for dashboard + integrations
  3. Web Dashboard โ€” Manager/CTO view

๐Ÿ—๏ธ Tech Stack

Backend

  • Python 3.10+ โ€” Core language
  • Typer โ€” Modern CLI framework
  • FastAPI โ€” High-performance REST API
  • Tree-sitter โ€” Incremental parsing
  • GitPython โ€” Git repository access
  • SQLite โ€” Local database
  • bcrypt โ€” Password hashing
  • PyJWT โ€” Token management
  • Pydantic โ€” Data validation
  • uv โ€” Fast Python package manager

Frontend

  • Next.js 14+ โ€” React framework
  • TypeScript โ€” Type safety
  • Tailwind CSS โ€” Styling
  • i18n โ€” Multi-language (EN/TR)

Billing

  • Lemon Squeezy โ€” Merchant of Record
  • HMAC-SHA256 โ€” Webhook signature verification

DevOps

  • GitHub Actions โ€” CI/CD
  • CodeQL โ€” Security scanning
  • Dependabot โ€” Dependency updates
  • uv โ€” Python packaging

๐Ÿ”’ Security

  • โœ… HMAC-SHA256 webhook signature verification
  • โœ… bcrypt password hashing (cost factor 12)
  • โœ… JWT tokens with 7-day expiry
  • โœ… httpOnly + secure + sameSite cookies
  • โœ… CORS protection
  • โœ… SQL injection protection (parameterized queries)
  • โœ… Pydantic input validation
  • โœ… Rate limiting (FastAPI middleware)
  • โœ… HTTPS only in production
  • โœ… No telemetry โ€” Your code stays yours

๐ŸŒ Languages Supported

CodeDNA's Tree-sitter parsers support:

  • โœ… Python (.py)
  • โœ… JavaScript (.js)
  • โœ… TypeScript (.ts)
  • โœ… JSX (.jsx)
  • โœ… TSX (.tsx)

Coming soon: Go, Rust, Java, C#, Ruby, PHP


๐Ÿ“ฆ Project Structure

codedna/
โ”œโ”€โ”€ cli.py                  # 25 CLI commands
โ”œโ”€โ”€ api.py                  # FastAPI REST endpoints
โ”œโ”€โ”€ auth.py                 # JWT authentication
โ”œโ”€โ”€ plan.py                 # License/plan management
โ”œโ”€โ”€ db.py                   # SQLite database
โ”œโ”€โ”€ scorer.py               # AI risk scoring
โ”œโ”€โ”€ analyzer.py             # Code analysis
โ”œโ”€โ”€ ai_fingerprint.py       # AI detection
โ”œโ”€โ”€ bus_factor.py           # Ownership analysis
โ”œโ”€โ”€ tech_debt.py            # Technical debt
โ”œโ”€โ”€ sprint_health.py        # Sprint metrics
โ”œโ”€โ”€ survey.py               # Onboarding
โ”œโ”€โ”€ interview.py            # Q&A tool
โ”œโ”€โ”€ protection.py           # Module protection
โ”œโ”€โ”€ rate_limit.py           # API throttling
โ”œโ”€โ”€ onboarding.py           # Developer tracking
โ”œโ”€โ”€ integrations/
โ”‚   โ”œโ”€โ”€ lemonsqueezy.py     # Billing integration
โ”‚   โ””โ”€โ”€ github.py           # GitHub API
โ”œโ”€โ”€ dashboard/              # Next.js frontend
โ”‚   โ”œโ”€โ”€ app/                # 13 pages
โ”‚   โ”œโ”€โ”€ components/         # UI components
โ”‚   โ””โ”€โ”€ lib/                # Utilities
โ”œโ”€โ”€ tests/                  # Pytest suite
โ”œโ”€โ”€ pyproject.toml          # Python config
โ”œโ”€โ”€ README.md               # This file
โ”œโ”€โ”€ CHANGELOG.md            # Release notes
โ”œโ”€โ”€ LICENSE                 # MIT
โ”œโ”€โ”€ CONTRIBUTING.md         # How to contribute
โ””โ”€โ”€ SECURITY.md             # Security policy

๐Ÿงช Testing

# Tum testleri calistir
pytest

# Coverage ile
pytest --cov=codedna

# Specific test
pytest tests/test_ai_fingerprint.py

Test coverage: 80%+ across all modules.


๐Ÿ“š Documentation


๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Development Setup

git clone https://github.com/natureco-official/codedna.git
cd codedna
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

Code Style

  • Black for Python
  • Ruff for linting
  • ESLint + Prettier for TypeScript

๐Ÿ“œ License

MIT License โ€” see LICENSE file.

MIT License - Copyright (c) 2026 NatureCo

๐ŸŒŸ Acknowledgments

  • Tree-sitter โ€” For blazing-fast parsing
  • Typer โ€” For beautiful CLI
  • FastAPI โ€” For modern API framework
  • Lemon Squeezy โ€” For hassle-free billing
  • All our beta testers โ€” For feedback and bug reports

๐Ÿ’ฌ Community


๐Ÿ—บ๏ธ Roadmap

v0.3.0 (Q3 2026)

  • VSCode extension (real-time)
  • Go/Rust/Java support
  • Slack bot
  • Jira integration

v0.4.0 (Q4 2026)

  • Team analytics dashboard
  • AI coach (suggests learning resources)
  • Custom AI fingerprinting
  • Cloud sync (optional)

v1.0.0 (2027)

  • Self-hosted option
  • Enterprise SSO (SAML, OIDC)
  • SOC 2 compliance
  • Custom training data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codedna-0.2.26.tar.gz (5.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codedna-0.2.26-py3-none-any.whl (80.5 kB view details)

Uploaded Python 3

File details

Details for the file codedna-0.2.26.tar.gz.

File metadata

  • Download URL: codedna-0.2.26.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for codedna-0.2.26.tar.gz
Algorithm Hash digest
SHA256 d6a25dd916f11e07946109fc418982bc92a7942b5099a01db5c664114928a39d
MD5 e50c53dd77b1fc667eec94832f777bf9
BLAKE2b-256 e188e0e53709c64aa19bec1a5be9ba19a1cf6cf8824189e56a017f1095fb3cd9

See more details on using hashes here.

File details

Details for the file codedna-0.2.26-py3-none-any.whl.

File metadata

  • Download URL: codedna-0.2.26-py3-none-any.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for codedna-0.2.26-py3-none-any.whl
Algorithm Hash digest
SHA256 afabede0ca897d3afbbefb8df6cb60482137e5ad1bf7deeca7e1ef60e1c485b4
MD5 b92e6e955e9a5350bd2f10f41e2c2d89
BLAKE2b-256 e3bf661896c8ac7000db0adf588483bf53729b1a11d0d7b97c5f8b2c2a085a55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page