Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

12.1 KB
Raw Blame
{
  "repo": {
    "id": "<repo-id>",
    "name": "test-repo",
    "local_path": "<tmp>/test-repo",
    "default_branch": "main",
    "head_commit": null,
    "updated_at": "2026-09-02T12:00:00",
    "remote_url": "https://github.com/example/test-repo"
  },
  "stats": {
    "file_count": 4,
    "symbol_count": 14,
    "entry_point_count": 2,
    "doc_page_count": 2,
    "doc_prose_page_count": 1,
    "doc_coverage_pct": 70.0,
    "freshness_score": 50.0,
    "dead_export_count": 1,
    "hotspot_count": 2,
    "silo_count": 2,
    "module_count": 3,
    "total_nloc": 450,
    "deltas": {
      "average_health": null,
      "hotspot_health": null,
      "file_count": null
    }
  },
  "health": {
    "average_health": 4.5,
    "unanalysed_file_count": 1,
    "analysed_share": 0.5,
    "band": "needs_work",
    "hotspot_health": 4.5,
    "worst_performer_path": "src/core.py",
    "worst_performer_score": 4.5,
    "open_findings": 5,
    "finding_counts": {
      "inventory": 5,
      "in_scope": 5,
      "eligible": 0,
      "due": 0,
      "shown": 0,
      "excluded": {
        "not_judged": 5
      },
      "gated": 0
    },
    "gated": {},
    "maintainability_average": 5.5,
    "performance_average": 9.5,
    "performance_causes": {
      "now": 0,
      "production": 0,
      "all": 0,
      "per_10k_loc": 0.0
    },
    "worst_performance_path": "src/core.py",
    "worst_performance_score": 9.5,
    "severity_breakdown": {
      "critical": 0,
      "high": 4,
      "medium": 0,
      "low": 0
    },
    "defect_accuracy": null,
    "last_indexed_at": "2026-09-02T12:00:00+00:00",
    "snapshot_count": 0,
    "history": []
  },
  "languages": [
    {
      "language": "python",
      "file_count": 3
    },
    {
      "language": "typescript",
      "file_count": 1
    }
  ],
  "docs_config_languages": [],
  "attention": [
    {
      "id": "health-src/core.py",
      "type": "health_finding",
      "title": "src/core.py",
      "description": "2 findings \u00b7 9.5 deducted",
      "severity": "critical",
      "target_id": "src/core.py",
      "subtype": "god_class",
      "weight": 9.5
    },
    {
      "id": "security-1",
      "type": "security_finding",
      "title": "config/settings.py",
      "description": "aws_access_key",
      "severity": "high",
      "target_id": "config/settings.py",
      "subtype": "aws_access_key",
      "weight": 1.0
    },
    {
      "id": "security-2",
      "type": "security_finding",
      "title": "old/keys.py",
      "description": "hardcoded_secret in commit abcdef1",
      "severity": "high",
      "target_id": "old/keys.py",
      "subtype": "hardcoded_secret",
      "weight": 0.0
    },
    {
      "id": "refactor-ref1",
      "type": "refactoring",
      "title": "Engine.run",
      "description": "+1.8 health, M effort \u00b7 src/core.py",
      "severity": "medium",
      "target_id": "src/core.py",
      "subtype": "extract_method",
      "weight": 1.8
    },
    {
      "weight": 8.0,
      "id": "ungoverned-src/core.py",
      "type": "ungoverned_hotspot",
      "title": "src/core.py",
      "description": "High-churn file with no governing decision",
      "severity": "medium",
      "target_id": "src/core.py"
    },
    {
      "id": "drift-1",
      "type": "doc_drift",
      "title": "README.md",
      "description": "names a file that is not in the tree",
      "severity": "medium",
      "target_id": "README.md",
      "subtype": "missing_path",
      "weight": 0.95
    },
    {
      "weight": 8.0,
      "id": "proposed-dec1",
      "type": "proposed_decision",
      "title": "Keep the engine single-threaded",
      "description": "Decision recorded by hand, awaiting review",
      "severity": "medium",
      "target_id": "dec1"
    },
    {
      "id": "silo-src/core.py",
      "type": "knowledge_silo",
      "title": "src/core.py",
      "description": "90% single-owner concentration, 12 commits in 90d",
      "severity": "medium",
      "target_id": "src/core.py",
      "weight": 12.9
    },
    {
      "weight": 7.0,
      "id": "ungoverned-web/app.ts",
      "type": "ungoverned_hotspot",
      "title": "web/app.ts",
      "description": "High-churn file with no governing decision",
      "severity": "medium",
      "target_id": "web/app.ts"
    },
    {
      "id": "silo-src/util.py",
      "type": "knowledge_silo",
      "title": "src/util.py",
      "description": "90% single-owner concentration, 9 commits in 90d",
      "severity": "medium",
      "target_id": "src/util.py",
      "weight": 9.9
    },
    {
      "id": "silo-web/app.ts",
      "type": "knowledge_silo",
      "title": "web/app.ts",
      "description": "90% single-owner concentration, 6 commits in 90d",
      "severity": "medium",
      "target_id": "web/app.ts",
      "weight": 6.9
    },
    {
      "id": "security-3",
      "type": "security_finding",
      "title": "src/run.py",
      "description": "eval_call",
      "severity": "low",
      "target_id": "src/run.py",
      "subtype": "eval_call",
      "weight": 1.0
    },
    {
      "id": "health-src/util.py",
      "type": "health_finding",
      "title": "src/util.py",
      "description": "1 finding \u00b7 3.0 deducted",
      "severity": "low",
      "target_id": "src/util.py",
      "subtype": "nested_complexity",
      "weight": 3.0
    },
    {
      "id": "refactor-ref2",
      "type": "refactoring",
      "title": "src/util.py",
      "description": "+0.6 health \u00b7 src/util.py",
      "severity": "low",
      "target_id": "src/util.py",
      "subtype": "split_class",
      "weight": 0.6
    },
    {
      "id": "drift-2",
      "type": "doc_drift",
      "title": "docs/setup.md",
      "description": "missing_symbol no longer matches the tree",
      "severity": "low",
      "target_id": "docs/setup.md",
      "subtype": "missing_symbol",
      "weight": 0.5
    },
    {
      "id": "dead-dead1",
      "type": "dead_code",
      "title": "old_helper",
      "description": "Unreachable function (12 lines)",
      "severity": "low",
      "target_id": "src/legacy.py",
      "subtype": "unused_export",
      "weight": 0.9
    },
    {
      "id": "health-src/tiny.py",
      "type": "health_finding",
      "title": "src/tiny.py",
      "description": "1 finding \u00b7 0.4 deducted",
      "severity": "low",
      "target_id": "src/tiny.py",
      "subtype": "long_method",
      "weight": 0.4
    }
  ],
  "attention_summary": {
    "total": 18,
    "by_source": {
      "health_finding": 4,
      "security_finding": 3,
      "refactoring": 2,
      "doc_drift": 2,
      "dead_code": 1,
      "decisions": 3,
      "knowledge_silo": 3
    },
    "areas": [
      {
        "key": "security",
        "total": 3,
        "severity": "high",
        "detail": "2 in the working tree, 1 in git history",
        "lead": {
          "title": "config/settings.py",
          "description": "aws_access_key",
          "type": "security_finding",
          "target_id": "config/settings.py",
          "subtype": "aws_access_key",
          "severity": "high"
        }
      },
      {
        "key": "health",
        "total": 4,
        "severity": "critical",
        "detail": "",
        "lead": {
          "title": "src/core.py",
          "description": "2 findings \u00b7 9.5 deducted",
          "type": "health_finding",
          "target_id": "src/core.py",
          "subtype": "god_class",
          "severity": "critical"
        }
      },
      {
        "key": "refactoring",
        "total": 2,
        "severity": "medium",
        "detail": "",
        "lead": {
          "title": "Engine.run",
          "description": "+1.8 health, M effort \u00b7 src/core.py",
          "type": "refactoring",
          "target_id": "src/core.py",
          "subtype": "extract_method",
          "severity": "medium"
        }
      },
      {
        "key": "doc_drift",
        "total": 2,
        "severity": "medium",
        "detail": "",
        "lead": {
          "title": "README.md",
          "description": "names a file that is not in the tree",
          "type": "doc_drift",
          "target_id": "README.md",
          "subtype": "missing_path",
          "severity": "medium"
        }
      },
      {
        "key": "decisions",
        "total": 3,
        "severity": "medium",
        "detail": "1 awaiting review \u00b7 2 hotspots ungoverned",
        "lead": {
          "title": "src/core.py",
          "description": "High-churn file with no governing decision",
          "type": "ungoverned_hotspot",
          "target_id": "src/core.py",
          "subtype": null,
          "severity": "medium"
        }
      },
      {
        "key": "ownership",
        "total": 3,
        "severity": "medium",
        "detail": "",
        "lead": {
          "title": "src/core.py",
          "description": "90% single-owner concentration, 12 commits in 90d",
          "type": "knowledge_silo",
          "target_id": "src/core.py",
          "subtype": null,
          "severity": "medium"
        }
      },
      {
        "key": "dead_code",
        "total": 1,
        "severity": "low",
        "detail": "",
        "lead": {
          "title": "old_helper",
          "description": "Unreachable function (12 lines)",
          "type": "dead_code",
          "target_id": "src/legacy.py",
          "subtype": "unused_export",
          "severity": "low"
        }
      }
    ]
  },
  "onboarding_targets": [
    {
      "path": "src/util.py",
      "pagerank": 0.25,
      "doc_words": 0
    },
    {
      "path": "web/app.ts",
      "pagerank": 0.5,
      "doc_words": 2
    },
    {
      "path": "src/core.py",
      "pagerank": 0.4,
      "doc_words": 2
    }
  ],
  "top_hotspots": [
    {
      "file_path": "src/core.py",
      "commit_count_total": 40,
      "commit_count_90d": 12,
      "commit_count_30d": 4,
      "churn_percentile": 95.0,
      "temporal_hotspot_score": 3.0,
      "primary_owner": "Alice",
      "primary_owner_commit_pct": 0.9,
      "recent_owner_name": null,
      "recent_owner_commit_pct": null,
      "is_hotspot": true,
      "is_stable": false,
      "bus_factor": 0,
      "contributor_count": 0,
      "lines_added_90d": 0,
      "lines_deleted_90d": 0,
      "avg_commit_size": 0.0,
      "commit_categories": {},
      "merge_commit_count_90d": 0,
      "commit_count_capped": false,
      "age_days": 0,
      "last_commit_at": "2026-08-20T00:00:00Z",
      "change_entropy": 0.0,
      "change_entropy_pct": 0.0,
      "prior_defect_count": 0,
      "bug_magnet": false,
      "last_fix_at": null,
      "original_path": null,
      "accelerating": false,
      "rank": null
    },
    {
      "file_path": "web/app.ts",
      "commit_count_total": 20,
      "commit_count_90d": 6,
      "commit_count_30d": 2,
      "churn_percentile": 75.0,
      "temporal_hotspot_score": 1.0,
      "primary_owner": "Bob",
      "primary_owner_commit_pct": 0.9,
      "recent_owner_name": null,
      "recent_owner_commit_pct": null,
      "is_hotspot": true,
      "is_stable": false,
      "bus_factor": 0,
      "contributor_count": 0,
      "lines_added_90d": 0,
      "lines_deleted_90d": 0,
      "avg_commit_size": 0.0,
      "commit_categories": {},
      "merge_commit_count_90d": 0,
      "commit_count_capped": false,
      "age_days": 0,
      "last_commit_at": "2026-08-22T00:00:00Z",
      "change_entropy": 0.0,
      "change_entropy_pct": 0.0,
      "prior_defect_count": 0,
      "bug_magnet": false,
      "last_fix_at": null,
      "original_path": null,
      "accelerating": false,
      "rank": null
    }
  ],
  "recent_decisions": [
    {
      "id": "dec1",
      "title": "Keep the engine single-threaded",
      "status": "proposed",
      "source": "cli",
      "created_at": "2026-09-02T12:00:00",
      "staleness_score": 0.0
    }
  ],
  "savings": {
    "available": false
  },
  "explore": {
    "decisions": {
      "total": 1,
      "accepted": 0,
      "candidates": 1,
      "needs_review": 0
    },
    "refactoring": null,
    "ownership": {
      "sole_owned_files": 0
    },
    "security": {
      "total": 3,
      "source": 3,
      "source_high": 2,
      "elsewhere": 0
    },
    "coverage": null
  },
  "sync": {
    "last_sync_at": "2026-09-02T12:00:00",
    "last_resync_at": null,
    "last_sync_model": null,
    "active_job_id": null,
    "page_count": 2
  }
}