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 signature โ†’ +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

# From PyPI
pip install codedna

# Or with uv (faster)
uv pip install codedna

# Or from dev environment
git clone https://github.com/natureco-official/codedna.git
cd codedna
pip install -e .

โš ๏ธ Windows users: pip may warn "The script codedna.exe is installed in '...' which is not on PATH". To fix:

# One-time setup (PowerShell, current user only)
$env:Path += ";$env:LocalAppData\Python\pythoncore-3.14-64\Scripts"
# Make it permanent:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:LocalAppData\Python\pythoncore-3.14-64\Scripts", "User")

Then open a new PowerShell window and run codedna --version. macOS / Linux users don't need this โ€” pip installs to /usr/local/bin or ~/.local/bin, which is already on PATH.

Verify Installation

codedna --version   # should show "codedna 0.3.x"
codedna doctor      # full system health check

First Use (60 seconds)

# 1. Go to your Git repo
cd your-awesome-project

# 2. Initialize CodeDNA (creates git hook + DB)
codedna init

# 3. Scan the repo
codedna scan

# 4. See the last commit score
codedna status

# 5. See past commits
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                  # Create git hook + DB
codedna scan                  # Scan the repo
codedna status                # Last commit score
codedna history               # Past commits
codedna report                # Generate HTML report
codedna ai-compare            # AI tool comparison (Enterprise)

๐Ÿ›ก๏ธ Protection & Policies

codedna protect-add <path>    # Add protected module
codedna protect-remove <path> # Remove protection
codedna protect-list          # List protected modules
codedna protect-check <file>  # Is file protected?

๐Ÿ‘ฅ Team & Process

codedna onboarding            # Developer ramp-up (Team+)
codedna interview-start       # Start interview (Enterprise)
codedna interview-list        # List interviews
codedna interview-score       # Score interview
codedna bus-factor            # Ownership analysis (Team+)
codedna debt                  # Technical debt (Team+)
codedna sprint-olustur        # Create sprint
codedna sprint-sagligi         # Sprint health
codedna sprint-gecmisi         # Sprint history

๐ŸŒ Infrastructure

codedna serve                 # FastAPI REST (port 8000)
codedna dashboard             # Web dashboard (port 3000)
codedna pr-comment            # GitHub PR comment
codedna plan                  # Plan/license management
codedna plan demo pro         # 7-day demo Pro license
codedna natureco              # NatureCo CLI integration (Pro+)
codedna uninstall             # Remove hook

๐Ÿ”ง Utility

codedna doctor                # System health check
codedna reset                 # Reset (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

# Run all tests
pytest

# With coverage
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.3.3.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.3.3-py3-none-any.whl (82.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codedna-0.3.3.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.3.3.tar.gz
Algorithm Hash digest
SHA256 b13d5e3ea104542e40ec4a1e965d2ab77c6727698b9fdcd3232570737ee78f9d
MD5 22f6d39bc78095204fadebb88b8de86a
BLAKE2b-256 4603a1c776fcce93431211d7a65f69e179f393a82d2fcc8a1a1b10c1d073dbaa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codedna-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 82.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.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c92bc60819d4bb9f292989898c7dec88142cb0f43fbcc119eb71d17bfb66f968
MD5 6029ccf23e98bdc1860e7cba2789753f
BLAKE2b-256 65ae590b6318a325d95025f6c95b3b411584911d178a5e5bb110f9982e9db5e7

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