Skip to content

Ship CodeAtlas as a GitHub Action; lock down the dashboard API - #1

Merged
basartuncay merged 1 commit into
mainfrom
feat/github-action
Nov 9, 2026
Merged

basartuncay merged 1 commit into
mainfrom
feat/github-action

Conversation

@basartuncay

Copy link
Copy Markdown
Owner

What

  • GitHub Action (action.yml): uses: basartuncay/CodeAtlas@v1 runs the deterministic engine (no LLM, no API key) on the caller's repo. It writes top hotspots, cycles and high risks to the job summary, saves the JSON model, and can fail the build past a max-hotspot threshold. It installs only the engine workspace (~1 s, no Next.js).
  • CLI scripts/analyze.ts replaces self-analyze.ts: [path] --out --summary --max-hotspot --top. The rendering and gate logic live in the engine (renderSummary, evaluateQualityGate) and have tests.
  • Bug fix (churn): analyzing a subfolder (e.g. a monorepo package) reported 0 churn for every file, because git paths were root-relative. Now uses git log --relative. Also raised maxBuffer; the 1 MB default would crash on busy histories.
  • Security (web API): POST /api/analyze no longer accepts repoPath from the request body (that was an arbitrary filesystem read / git-in-any-directory primitive). The repo comes from CODEATLAS_REPO_PATH. Paid Claude runs are limited by a cooldown (CODEATLAS_ANALYZE_COOLDOWN_SECONDS, default 600), and concurrent clicks share one in-flight run.
  • CI: dogfoods the action (uses: ./) and adds a web lint step.

Verified

  • Engine 70 tests and llm-synthesis 9 tests pass; typecheck and lint pass.
  • Action install step tested in a clean clone. Analyzer run on another repo (Jarvis/hud), which surfaced the churn bug.
  • Dev server: a POST with {"repoPath":"/etc"} ignores the path and analyzes the configured repo; an invalid API key returns a clean 500.

After merge

Tag the action so @v1 resolves: git tag v1.0.0 && git tag v1 && git push origin v1.0.0 v1.

🤖 Generated with Claude Code

- action.yml: composite action that installs only the engine and runs the
  deterministic analysis on the caller's repo; writes a hotspot/cycle/risk
  report to the job summary, saves the JSON model, optional max-hotspot gate
- scripts/analyze.ts replaces self-analyze.ts: generic CLI (path, --out,
  --summary, --max-hotspot, --top); renderSummary/evaluateQualityGate in
  the engine with tests
- churn: use --relative so analyzing a subfolder (monorepo package) no
  longer reports zero churn; raise execFile maxBuffer for busy histories
- web API: drop client-supplied repoPath (arbitrary filesystem read on a
  public deployment); repo comes from CODEATLAS_REPO_PATH; paid runs are
  limited by a cooldown and share one in-flight run
- CI dogfoods the action (uses: ./) and lints the web package

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@basartuncay
basartuncay merged commit 388eea8 into main Nov 9, 2026
2 checks passed
@basartuncay
basartuncay deleted the feat/github-action branch November 9, 2026 12:20
basartuncay added a commit that referenced this pull request Nov 30, 2026
Ship CodeAtlas as a GitHub Action; lock down the dashboard API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant