Skip to content

fix(queue): stamp console.error payloads as level error - #7859

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
bohdansolovie:fix/queue-console-error-level-7806-v2
Jul 21, 2026
Merged

fix(queue): stamp console.error payloads as level error#7859
JSONbored merged 1 commit into
JSONbored:mainfrom
bohdansolovie:fix/queue-console-error-level-7806-v2

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Change 24 console.error(JSON.stringify({ level: "warn", ... })) call sites in the queue pipeline to level: "error" so Sentry severity matches the error sink.
  • Add a regression test that forbids reintroducing level: "warn" inside console.error payloads in those three files.

Closes #7806

Scope

  • src/queue/processors.ts, src/queue/slop-detection.ts, src/queue/ai-review-orchestration.ts
  • test/unit/queue-console-error-level.test.ts

Validation

  • vitest run test/unit/queue-console-error-level.test.ts
  • git diff --check origin/main...HEAD

Safety

  • Logging severity only; no control-flow or auth changes.

Made with Cursor

Twenty-four queue failure logs used console.error with an explicit
level:"warn", which made forwardStructuredLogToSentry treat real
failures as warnings. Align them with the sink and the other
console.error call sites in the same files.

Closes JSONbored#7806

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 21, 2026 15:13
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 21, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.80%. Comparing base (299c842) to head (cb04a4a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7859      +/-   ##
==========================================
- Coverage   91.37%   89.80%   -1.57%     
==========================================
  Files         729       91     -638     
  Lines       74694    24496   -50198     
  Branches    22795     4862   -17933     
==========================================
- Hits        68252    21999   -46253     
+ Misses       5396     2232    -3164     
+ Partials     1046      265     -781     
Flag Coverage Δ
shard-1 79.67% <100.00%> (+25.18%) ⬆️
shard-2 31.32% <0.00%> (-23.88%) ⬇️
shard-3 39.97% <0.00%> (-11.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/queue/ai-review-orchestration.ts 100.00% <ø> (ø)
src/queue/processors.ts 95.77% <100.00%> (ø)
src/queue/slop-detection.ts 100.00% <ø> (ø)

... and 638 files with indirect coverage changes

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

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-21 15:23:35 UTC

4 files · 1 AI reviewer · no blockers · CI green · unstable

⏸️ Suggested Action - Manual Review

Review summary
This is a mechanical, well-scoped fix that changes 24 console.error call sites across three queue-pipeline files from level:"warn" to level:"error" so Sentry severity matches the sink, directly addressing #7806. It adds a regression test parsing the three files for console.error blocks to forbid reintroducing level:"warn", which correctly guards the intended invariant. The change is logging-only with no control-flow impact, and the diff is internally consistent with its stated purpose.

Nits — 5 non-blocking
  • The regression test in test/unit/queue-console-error-level.test.ts uses a hand-rolled bracket-depth string parser instead of a simple regex or AST check, which is more code than needed for this purpose and could mis-handle edge cases like nested template literals with braces.
  • The failed 'Contributor trust' check is unrelated to code correctness and the branch is 2 commits behind default, so it's likely not caused by this diff's content.
  • Consider verifying the same level:"warn"/console.error pattern doesn't exist in other non-queue files if the goal is truly Sentry-severity consistency repo-wide, or scope the PR description to explicitly note it's queue-only by design.
  • The second test asserting slop-detection.ts contains a level:"error" ai_slop_failed payload is a reasonable representative smoke check, but could be merged with the first test to reduce file reads.
  • Consider using a simple regex like /console\.error\([^)]*level:\s*["']warn["']/ instead of the manual bracket-matching parser for readability, unless nested parens in payloads require the more robust approach.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7806
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 ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 64 registered-repo PR(s), 21 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 64 PR(s), 7 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff changes all 24 listed call sites from level:"warn" to level:"error" across the three specified files, matching the issue's exact requirement, and adds a regression test that scans for and forbids reintroducing level:"warn" inside console.error payloads plus asserts a representative site is level:"error".

Review context
  • Author: bohdansolovie
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 64 PR(s), 7 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@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.

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

@JSONbored
JSONbored merged commit 80eb9f3 into JSONbored:main Jul 21, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

24 console.error calls in the queue pipeline carry a mismatched level: "warn", downgrading real errors to Sentry warnings

2 participants