Skip to content

fix(staleness): collapse day + commit thresholds into a single issue - #34

Merged
theDakshJaitly merged 1 commit into
mex-memory:mainfrom
mvanhorn:fix/dedupe-stale-file-errors
Apr 21, 2026
Merged

fix(staleness): collapse day + commit thresholds into a single issue#34
theDakshJaitly merged 1 commit into
mex-memory:mainfrom
mvanhorn:fix/dedupe-stale-file-errors

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

checkStaleness returned two separate STALE_FILE issues when a file tripped both the day threshold (>=90d) and the commit threshold (>=200 commits). computeScore deducts per-issue, so the same underlying staleness cost the score 20 points instead of 10 (a file can drop from 100 to 0 off a single stale scaffold if other issues are also present).

This collapses the two signals into a single compound STALE_FILE issue using:

  • the higher of the two severities (error wins over warning), and
  • a combined message that preserves both data points ("...100 days...; ...250 commits...")

computeScore is unchanged -- the fix keeps the scoring layer pure and localized to the checker.

Test plan

  • 6 new unit tests in test/checkers.test.ts covering:
    • clean file (no issues)
    • only the day threshold tripped
    • both thresholds tripped -> one combined issue
    • warning + error thresholds -> error wins
    • both warnings -> stays warning
    • null git history -> no issues
  • Existing suite: 100/100 tests passing
  • npm run build clean
  • npx tsc --noEmit clean

Closes #31

When a file trips both the day threshold and the commit threshold,
checkStaleness returned two separate STALE_FILE issues for the same
underlying condition. computeScore then deducted per-issue, charging
the file twice for the same staleness (20 points instead of 10).

Collapse the two signals into a single STALE_FILE issue using the
higher severity and a combined message, so the score reflects one
staleness condition per file.

Fixes mex-memory#31
@theDakshJaitly

Copy link
Copy Markdown
Collaborator

Hey @mvanhorn , Sorry for the delay in review. got caught up in some stuff, will be done by tonight tho.
Also if you dont mind, can you give me some advice on how to grow the repo, I ofc am working on making mex better, working on really great stuff that I will put out in a new release.
Anyways, Thanks for contribution, will review it asap.

@theDakshJaitly
theDakshJaitly self-requested a review April 20, 2026 05:58
@mvanhorn

Copy link
Copy Markdown
Contributor Author

No rush on the review @theDakshJaitly — tonight works.

On growth: honestly it's tricky, you never know what people will latch onto. The stuff that's worked for me, roughly:

  • Build something people actually want. Obvious but easy to drift from — every feature should trace back to a user asking for it (not your intuition about what'd be cool).
  • Build in public. Post progress, demos, weird failures, what you learned. Low-stakes posting keeps the loop tight and surfaces people who care.
  • Talk to the users who already love it. Not the ones who bounced — the ones who came back. Figure out why they love it, then double down on that specific thing instead of trying to please everyone.

Rest is just shipping and staying consistent.

@theDakshJaitly

Copy link
Copy Markdown
Collaborator

Thanks @mvanhorn — really clean fix. Particularly appreciate that you kept the fix in the checker and left computeScore as a dumb sum; that's the right call and makes the scoring layer much easier to reason about. Tests cover the cases I'd have asked for.

Merging now. Thanks for closing out #31.

@theDakshJaitly
theDakshJaitly merged commit f2ba66f into mex-memory:main Apr 21, 2026
3 checks passed
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Appreciate the threshold consolidation.

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.

checkStaleness returns two independent STALE_FILE errors for a single stale file, causing double score penalty

2 participants