Skip to content

fix(miner): label rejection-signaled aborts with the actual trigger reason - #6085

Merged
loopover-orb[bot] merged 4 commits into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-rejection-reason-6055
Jul 15, 2026
Merged

fix(miner): label rejection-signaled aborts with the actual trigger reason#6085
loopover-orb[bot] merged 4 commits into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-rejection-reason-6055

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • resolveRejectionSignaled now returns a trigger-specific reason string (ai_usage_policy_ban or own_submission_rejected) instead of a bare boolean, preserving backward compatibility for truthy checks.
  • attempt-cli.js uses the returned reason in audit-trail events and --json/human-readable output, fixing mislabeled own-rejection-history aborts.
  • Add regression tests for both trigger paths in miner-rejection-signal.test.ts and miner-attempt-cli.test.ts.

Closes #6055

Test plan

  • npx vitest run test/unit/miner-rejection-signal.test.ts test/unit/miner-attempt-cli.test.ts
  • CI green including validate-code and codecov/patch

RealDiligent and others added 3 commits July 15, 2026 16:23
…eason

resolveRejectionSignaled now returns a trigger-specific reason string
instead of a bare boolean, and attempt-cli uses it for audit-trail
events and CLI output so own-rejection-history blocks are no longer
mislabeled as ai_usage_policy_ban.

Closes JSONbored#6055

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

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.22%. Comparing base (00db6b7) to head (3935194).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6085   +/-   ##
=======================================
  Coverage   95.22%   95.22%           
=======================================
  Files         595      595           
  Lines       46998    47001    +3     
  Branches    15015    15015           
=======================================
+ Hits        44756    44759    +3     
  Misses       1493     1493           
  Partials      749      749           
Flag Coverage Δ
shard-1 43.95% <0.00%> (-0.08%) ⬇️
shard-2 36.54% <62.50%> (+0.06%) ⬆️
shard-3 31.90% <62.50%> (-0.05%) ⬇️
shard-4 31.98% <0.00%> (-1.05%) ⬇️
shard-5 32.67% <25.00%> (+1.16%) ⬆️
shard-6 44.69% <25.00%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/attempt-cli.js 97.93% <100.00%> (ø)
packages/loopover-miner/lib/rejection-signal.js 100.00% <100.00%> (ø)

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 15, 2026
@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-15 09:08:41 UTC

5 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR correctly fixes the mislabeling bug from #6055: resolveRejectionSignaled now returns a trigger-specific reason string instead of a bare boolean, and attempt-cli.js propagates that reason into audit-trail events and output messages instead of hardcoding ai_usage_policy_ban. Backward compatibility for a literal boolean true is handled via the `rejectionSignal === true ? REJECTION_REASON_AI_USAGE_POLICY_BAN : rejectionSignal` ternary in attempt-cli.js, and both trigger paths plus the legacy-boolean fallback are covered by new regression tests in both test files. The rejection-signal.d.ts type update (`false | RejectionSignaledReason | true`) is a bit loose but accurately reflects the runtime behavior.

Nits — 5 non-blocking
  • rejection-signal.d.ts:29 union type `false | RejectionSignaledReason | true` is redundant/confusing since `true` is only handled as a legacy compatibility shim in the CLI, not something resolveRejectionSignaled itself would return post-fix — consider a comment noting this is solely for the legacy-boolean compatibility path.
  • attempt-cli.js's ternary `rejectionSignal === true ? REJECTION_REASON_AI_USAGE_POLICY_BAN : rejectionSignal` silently coerces any other truthy non-reason value straight through as `reason`, so a caller-supplied garbage value would leak into audit logs unvalidated — minor, since the function's own return type doesn't produce that today.
  • miner-attempt-cli.test.ts's new tests are named/organized well but the legacy-boolean-mapping test (`REGRESSION (fix(miner): attempt-cli.js mislabels own-rejection-history aborts as ai_usage_policy_ban #6055): maps legacy boolean true...`) duplicates intent with the existing ai_usage_policy_ban test right above it — could be trimmed for conciseness.
  • In attempt-cli.js, consider extracting the reason-normalization logic into a small named helper (e.g. `normalizeRejectionReason`) so the `=== true` legacy-shim logic isn't inlined at the call site.
  • In rejection-signal.d.ts, add a short comment above the `Promise<false | RejectionSignaledReason | true>` return type clarifying that `true` is accepted only for backward-compat with pre-fix callers, since the implementation itself never returns bare `true`.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #6055
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 ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 352 registered-repo PR(s), 170 merged, 29 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 352 PR(s), 29 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff makes resolveRejectionSignaled return a trigger-specific reason string, updates attempt-cli.js to use that reason (with a backward-compatible fallback for a legacy boolean true) in both the audit-trail event and CLI output, fixes the stale 'documented gap' comment, and extends both test files to assert the correct reason for each trigger.

Review context
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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://gittensory.aethereal.dev/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.

@loopover-orb
loopover-orb Bot merged commit e6f20af into JSONbored:main Jul 15, 2026
16 checks passed
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.

fix(miner): attempt-cli.js mislabels own-rejection-history aborts as ai_usage_policy_ban

1 participant