Skip to content

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

Closed
bohdansolovie wants to merge 2 commits into
JSONbored:mainfrom
bohdansolovie:feat/enrichment-debug-leftover-2015-v2
Closed

feat(enrichment): leftover console.log / debugger analyzer#3471
bohdansolovie wants to merge 2 commits into
JSONbored:mainfrom
bohdansolovie:feat/enrichment-debug-leftover-2015-v2

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 Python print() on added non-test lines
  • Reuse codeOnly string stripping so literals like "console.log('hi')" are not false positives
  • Restrict print() detection to .py/.pyi paths so method calls like document.print() are not flagged (Orb blocker on feat(enrichment): leftover console.log / debugger analyzer #3467)
  • 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, Python-only print, 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 2 commits July 5, 2026 10:34
…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>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 5, 2026 08:34
@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

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-05 08:35:45 UTC

9 files · 1 AI reviewer · 1 blocker · readiness 80/100 · CI green · clean

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/debug-leftover.ts:13 and review-enrichment/src/analyzers/debug-leftover.ts:25 will flag Python method calls such as `obj.print('x')` as debug leftovers because `\bprint\s*\(` still matches after `.`, so change the regex to require a non-property call boundary, for example `const PRINT_RE = /(?:^|[^\w.])print\s*\(/
  • `, or explain why Python method calls named `print` should be blocked. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
The change adds a local debug-leftover analyzer, wires it into registry/render/metadata/UI, and covers the main added-line scan path with focused tests. The registration and cap/test-file behavior are coherent, but the Python `print()` detector is not actually limited to bare calls even though the code comments and PR description claim that method-call false positives are avoided.

Blockers

  • review-enrichment/src/analyzers/debug-leftover.ts:13 and review-enrichment/src/analyzers/debug-leftover.ts:25 will flag Python method calls such as `obj.print('x')` as debug leftovers because `\bprint\s*\(` still matches after `.`, so change the regex to require a non-property call boundary, for example `const PRINT_RE = /(?:^|[^\w.])print\s*\(/;`, or explain why Python method calls named `print` should be blocked.
Nits — 3 non-blocking
  • nit: review-enrichment/test/debug-leftover.test.ts:22 only checks `document.print()` and `printer.print()` without a Python path, so it does not cover the real Python-only branch where the false positive occurs.
  • Add a regression test in review-enrichment/test/debug-leftover.test.ts for `detectDebugLeftover("obj.print('x')", "pkg/widget.py") === null` before adjusting `PRINT_RE`.
  • Consider adding the same non-property boundary for `CONSOLE_RE` in review-enrichment/src/analyzers/debug-leftover.ts:12 if the intended scope is truly bare global `console.*` rather than any property path ending in `.console.*`.

Why this is blocked

  • review-enrichment/src/analyzers/debug-leftover.ts:13 and review-enrichment/src/analyzers/debug-leftover.ts:25 will flag Python method calls such as `obj.print('x')` as debug leftovers because `\bprint\s*\(` still matches after `.`, so change the regex to require a non-property call boundary, for example `const PRINT_RE = /(?:^|[^\w.])print\s*\(/;`, or explain why Python method calls named `print` should be blocked.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #2015
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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 ❌ Blocking Repo-configured hard 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: not available
  • Official Gittensor activity: 287 PR(s), 9 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/debug-leftover.ts:13 and review-enrichment/src/analyzers/debug-leftover.ts:25 will flag Python method calls such as `obj.print('x')` as debug leftovers because `\bprint\s*\(` still matches after `.`, so change the regex to require a non-property call boundary, for example `const PRINT_RE = /(?:^|[^\w.])print\s*\(/;`, or explain why Python method calls named `print` should be blocked.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 5, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant