Skip to content

fix(queue): surface a finding when capture-unobtainable degrades the screenshot-table gate - #10157

Closed
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10060
Closed

fix(queue): surface a finding when capture-unobtainable degrades the screenshot-table gate#10157
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10060

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

fix(queue): surface a finding when capture-unobtainable degrades the screenshot-table gate

maybeAddScreenshotTableAdvisoryFinding always early-returned once the configured
action wasn't "advisory", so a close/block gate that #9881 degraded to advisory
enforcement never actually produced the advisory finding its own comments claimed
it would. The degrade was silently swallowed: no close, no hold, and no visible
notice for the maintainer either.

Thread captureUnobtainable into the finding builder and only skip it when the
action isn't advisory AND enforcement wasn't degraded. On a degraded gate, append
the finding with the maintainer-facing remedy alongside the gate's own reason.
Extract the headSha/visualCaptureUnobtainableSha conjunction into a shared helper
so the enforcement and advisory call sites can't evaluate the same fact differently.

Closes #10060

…screenshot-table gate

maybeAddScreenshotTableAdvisoryFinding always early-returned once the configured
action wasn't "advisory", so a close/block gate that JSONbored#9881 degraded to advisory
enforcement never actually produced the advisory finding its own comments claimed
it would. The degrade was silently swallowed: no close, no hold, and no visible
notice for the maintainer either.

Thread captureUnobtainable into the finding builder and only skip it when the
action isn't advisory AND enforcement wasn't degraded. On a degraded gate, append
the finding with the maintainer-facing remedy alongside the gate's own reason.
Extract the headSha/visualCaptureUnobtainableSha conjunction into a shared helper
so the enforcement and advisory call sites can't evaluate the same fact differently.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 31, 2026 09:52
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-31 10:40:55 UTC

2 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This threads the already-defined `captureUnobtainable` fact into `maybeAddScreenshotTableAdvisoryFinding` so a close/block gate degraded by #9881 now produces an advisory finding instead of vanishing silently, and factors the headSha/visualCaptureUnobtainableSha conjunction into a shared `screenshotCaptureUnobtainableForHead` helper used at both `evaluateScreenshotTableGate` call sites so they can't diverge. The early-return guard (`action !== "advisory" && !args.captureUnobtainable`) correctly lets only the degraded non-advisory path fall through, and `enforcementDegraded` is derived from `result.enforcementDegradedReason !== undefined` which matches `evaluateScreenshotTableGate`'s existing contract (per the reference excerpt, that field is only set on a violated+captureUnobtainable result). Test coverage is thorough and exercises the real call path (close/block/advisory × captureUnobtainable true/false), including a regression test pinned to the exact reported defect.

Nits — 5 non-blocking
  • codecov/patch is at 83.33% against a 99% target — worth checking which changed branch in `maybeAddScreenshotTableAdvisoryFinding` (e.g. the `enforcementDegraded === false` arm alongside `action === "advisory"`) is missing a direct test even though the overall behavior is well covered by the added suite.
  • src/queue/processors.ts:8772 — the long explanatory comment block above `maybeAddScreenshotTableAdvisoryFinding` is dense; consider trimming to just the non-obvious invariant (why `action !== "advisory"` reaching past the guard always means degraded) since the rest restates what the code already shows.
  • If patch coverage stays under target, add a direct assertion for the `enforcementDegraded` false/advisory-true branch distinct from the `captureUnobtainable: false` case already tested, to close the coverage gap explicitly.
  • Consider a short JSDoc line on `screenshotCaptureUnobtainableForHead` pointing readers to `evaluateScreenshotTableGate`'s `captureUnobtainable` param doc so the shared-invariant intent is discoverable from either side.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

CI checks failing

  • codecov/patch — 83.33% of diff hit (target 99.00%)

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 #10060
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ⚠️ 12/25 Preflight needs author follow-up before maintainer review.
Contributor workload ✅ 10/10 Author activity: 119 registered-repo PR(s), 82 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 119 PR(s), 3 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The diff extends maybeAddScreenshotTableAdvisoryFinding to accept captureUnobtainable, changes the early return to fire only when action isn't advisory AND enforcement wasn't degraded, appends a finding combining the gate's reason with CAPTURE_UNOBTAINABLE_REASON, and wires both call sites (3572 enforcement, 12119 advisory) through a shared screenshotCaptureUnobtainableForHead helper so they can't

Review context
  • Author: bitfathers94
  • 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: 119 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 3 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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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.

Decision record
  • action: hold · clause: success
  • config: 6cc06301946da318138766ca9195c1a9f3f1617b22ce0b6c06418110802c7f4c · pack: oss-anti-slop · ci: failed
  • note: diverted by the randomized close-audit holdout (calibration: randomized ε-holdout on would-close PRs with propensity logging #8831) — the deterministic pipeline would otherwise have closed this PR
  • record: 3e69895e7d9224141faec84483fc3c74d4a17e04c73e2d41c09dccaf266a2d5d (schema v6, head 2798e35)

🟩 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

@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 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.22%. Comparing base (9383b83) to head (2798e35).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/queue/processors.ts 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #10157       +/-   ##
===========================================
- Coverage   92.21%   81.22%   -10.99%     
===========================================
  Files         931      283      -648     
  Lines      114048    62218    -51830     
  Branches    27543     8242    -19301     
===========================================
- Hits       105165    50535    -54630     
- Misses       7584    11271     +3687     
+ Partials     1299      412      -887     
Flag Coverage Δ
backend 94.61% <83.33%> (-1.07%) ⬇️

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

Files with missing lines Coverage Δ
src/queue/processors.ts 94.61% <83.33%> (+<0.01%) ⬆️

... and 780 files with indirect coverage changes

@loopover-orb loopover-orb Bot added manual-review Gittensor contributor context and removed manual-review Gittensor contributor context labels Jul 31, 2026
@loopover-orb loopover-orb Bot added manual-review Gittensor contributor context and removed manual-review Gittensor contributor context labels Jul 31, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Failing CI, closing.

@JSONbored JSONbored closed this Jul 31, 2026
@loopover-orb loopover-orb Bot removed the manual-review Gittensor contributor context label Jul 31, 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.

gate(screenshot-table): surface the finding when capture-unobtainable degrades enforcement

2 participants