Skip to content

feat(enrichment): leftover console.log / debugger analyzer#3472

Merged
loopover-orb[bot] merged 3 commits into
JSONbored:mainfrom
bohdansolovie:feat/enrichment-debug-leftover-2015-v3
Jul 5, 2026
Merged

feat(enrichment): leftover console.log / debugger analyzer#3472
loopover-orb[bot] merged 3 commits into
JSONbored:mainfrom
bohdansolovie:feat/enrichment-debug-leftover-2015-v3

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

Fixes #2015

  • Add DebugLeftoverFinding and a local debug-leftover analyzer that flags debugger;, bare console.* sinks, and bare Python print() on added non-test lines
  • Reuse codeOnly string stripping so literals like "console.log('hi')" are not false positives
  • Restrict print() to .py/.pyi and require (?<![\w.])print so method calls like obj.print() / document.print() are not flagged
  • Register debugLeftover in the analyzer registry with render/docs/metadata; skip test paths via isTestPath
  • Add review-enrichment/test/debug-leftover.test.ts covering detection, test-file skip, cap, method-call exclusions, and brief rendering

Test plan

  • cd review-enrichment && npm run build && node --test test/debug-leftover.test.ts test/analyzer-registry.test.ts
  • CI validate-code

Made with Cursor

bohdansolovie and others added 3 commits July 5, 2026 10:40
…ugger

Fixes JSONbored#2015 — flags plain debug leftovers in non-test source separately from secret-log.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid false positives on method calls like document.print().

Co-authored-by: Cursor <cursoragent@cursor.com>
Use (?<![\w.])print so obj.print() and document.print() are not flagged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 5, 2026 08:40
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 08:41:03 UTC

9 files · 1 AI reviewer · no blockers · readiness 62/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This adds a local debug-leftover analyzer, registers it consistently in the enrichment registry, metadata, UI analyzer list, render path, and tests the main detection and scan behavior. The implementation follows the existing diff-scanning pattern, caps findings, skips test paths, and avoids the most obvious string-literal and Python method-call false positives. I do not see a reachable correctness break in the provided diff.

Nits — 6 non-blocking
  • nit: review-enrichment/src/analyzers/debug-leftover.ts:15 matches `window.console.log(...)` and `globalThis.console.error(...)` even though the docs say "bare console sinks"; either tighten the wording or require the token not be preceded by a dot.
  • nit: review-enrichment/test/debug-leftover.test.ts:29 covers strings but not comments, so the intended behavior for `// console.log(...)` or `/* debugger; */` added lines is not pinned down here.
  • nit: review-enrichment/src/analyzers/debug-leftover.ts:18 relies on JavaScript lookbehind in `PRINT_RE`; CI passed, but this is worth keeping aligned with the runtime floor if the worker/node targets change.
  • review-enrichment/src/analyzers/debug-leftover.ts:15: If you mean truly bare console calls, change the regex to reject dotted receivers, for example `/(?<![\w.])console\s*\.\s*(?:log|debug|info|warn|error|trace|dir|table)\s*\(/`, or update the docs to say receiver-qualified console calls are included.
  • review-enrichment/test/debug-leftover.test.ts:29: Add one fixture for an added comment containing `console.log` or `debugger;` so future changes to `codeOnly` do not silently change this analyzer's false-positive profile.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2015
Related work ⚠️ 2 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 287 registered-repo PR(s), 177 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 287 PR(s), 9 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: bohdansolovie
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: Python, C++, JavaScript
  • Official Gittensor activity: 287 PR(s), 9 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (issue #2015, issue #2026)
  • Related work: Titles/paths share 7 meaningful terms. (issue #2015, issue #2027)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 5, 2026

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit a979552 into JSONbored:main Jul 5, 2026
7 checks passed
JSONbored added a commit that referenced this pull request Jul 5, 2026
…3472) (#3483)

Two independent plan-and-execute passes can evaluate the same PR head
(a webhook re-review racing a regate-repair/sweep pass): the loser of
the AI-review lock holds the PR for manual review (label + assign),
while the winner's own slower AI review later resolves cleanly and
stages approve/merge from a plan-time snapshot that predates the
hold. Neither the per-PR actuation lock nor the executor's freshness
guard checks the PR's live labels, so the hold was silently bypassed.

Add a live guard immediately before approve/merge that re-checks the
same freshness fetch for the configured manual-review label and
denies the action if it's present -- self-scoping to the same head
(a new commit already fails freshness first) with no new locking or
persistence required.

Closes #3482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(enrichment): leftover console.log / debugger analyzer

1 participant