Skip to content

Count circular deps and god objects from issue items - #90

Merged
braedonsaunders merged 1 commit into
mainfrom
cursor/snapshot-issue-item-counts-ca16
Aug 18, 2026
Merged

Count circular deps and god objects from issue items#90
braedonsaunders merged 1 commit into
mainfrom
cursor/snapshot-issue-item-counts-ca16

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

Fixes #89.

snapshotFromAnalysis() was counting matching issue objects, so circular and godObjects could only ever be 0 or 1. The analyzer emits one aggregate issue per kind; the real count lives on that issue’s items.length.

A repo with 5 circular-dependency groups therefore badged the same as a repo with 1. That number is what the SVG card HIDDEN COSTS panel, sparklines/trend arrows, and PR receipt dCirc diffs display.

Fix

Find the aggregate issue and use items.length. Missing / non-array items stay 0.

History call: fix in place, no rename. Existing state.json runs that already wrote 0 or 1 stay as written. New snapshots store the real counts. Sparklines/receipts may show a one-time jump on the first run after this change; that is the count becoming honest, not a sudden flood of new cycles.

Verified against 58ad9fe

The writeup’s 6-file markdown fixture does not produce circular issues on current main. Markdown cross-links are explicitly not import cycles (index.html around the circular-detection comment). I reproduced the counting bug with:

  • synthetic aggregate issues (3 Circular Dependencies / 2 Large Files)
  • a 6-file JS fixture of 3 independent import cycles (tests/fixtures/three-cycles/)
  • two files with 16+ functions for god objects

In each case data.issues had one aggregate with the real items length, and the old snapshot reported 1.

Tests

  • Unit: snapshot counts items.length, not issue objects; missing items → 0
  • Integration: the 3-cycle JS fixture cannot regress to 0/1
  • Integration: two large files snapshot as 2, not 1

Does not touch index.html, the public one-file app, or the in-flight code-cards work on cursor/code-cards-confirm-delete-bdff.

Open in Web Open in Cursor 

snapshotFromAnalysis treated Circular/Large issues as 0-or-1 presence
flags. The analyzer emits one aggregate issue per kind, so the real
count is items.length. History already written stays as-is; new
snapshots store the actual counts.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codeflow Ready Ready Preview Aug 18, 2026 12:10pm

Request Review

@braedonsaunders
braedonsaunders marked this pull request as ready for review August 18, 2026 12:11
@braedonsaunders

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 9ec2c67dc5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@braedonsaunders
braedonsaunders merged commit 4f0d944 into main Aug 18, 2026
5 checks passed
@braedonsaunders
braedonsaunders deleted the cursor/snapshot-issue-item-counts-ca16 branch August 24, 2026 01:06
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.

snapshotFromAnalysis reports circular-dependency/god-object presence (0 or 1), not the real count

2 participants