Skip to content

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

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#10188
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 early-returned for any non-advisory
action, so a close/block gate degraded by the #9881 capture-unobtainable
check never appended a finding -- the degrade went completely silent even
though both call sites and the reason string claimed it was surfaced.
Thread captureUnobtainable through both evaluateScreenshotTableGate call
sites via a shared screenshotCaptureUnobtainableForHead helper so they
can't diverge, and only skip the finding when the action isn't advisory
AND enforcement wasn't degraded.

Closes #10060

…screenshot-table gate

maybeAddScreenshotTableAdvisoryFinding early-returned for any non-advisory
action, so a close/block gate degraded by the JSONbored#9881 capture-unobtainable
check never appended a finding -- the degrade went completely silent even
though both call sites and the reason string claimed it was surfaced.
Thread captureUnobtainable through both evaluateScreenshotTableGate call
sites via a shared screenshotCaptureUnobtainableForHead helper so they
can't diverge, and only skip the finding when the action isn't advisory
AND enforcement wasn't degraded.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 31, 2026 11:24
@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 11:40:52 UTC

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

🛑 Suggested Action - Fix Blockers

Review summary
This PR fixes a real silent-degrade bug: maybeAddScreenshotTableAdvisoryFinding previously early-returned for any non-advisory action, so a close/block gate degraded by the #9881 capture-unobtainable check never surfaced a finding despite call-site comments claiming it did. The fix threads captureUnobtainable through a shared screenshotCaptureUnobtainableForHead helper used at both evaluateScreenshotTableGate call sites so they can't diverge, and narrows the early-return to only skip when action isn't advisory AND enforcement wasn't degraded. The change is well-targeted, the guard logic is correct (evaluateScreenshotTableGate only sets enforcementDegradedReason when violated:true and captureUnobtainable was true, so a non-advisory action reaching past the guard is always the degraded case), and the new tests exercise both the shared helper and the wiring at the finding-append level including a same-facts planner check that no close/hold occurs.

Nits — 4 non-blocking
  • src/queue/processors.ts:8825-8831 — the `enforcementDegraded` check via `result.enforcementDegradedReason !== undefined` and the v8-ignore'd `result.reason ?? DEFAULT_SCREENSHOT_CONTRACT_MESSAGE` fallback rely on an invariant of evaluateScreenshotTableGate (reason is always set when violated) that lives in a different file — worth a one-line comment pointer or a type change so it can't silently drift.
  • The two CI failures (validate, validate-tests) show no detail and this branch is 4 commits behind default — plausibly caused by upstream drift rather than this diff, per BASE BRANCH STATUS.
  • Consider tightening the return type of evaluateScreenshotTableGate so `reason` is non-null when `violated: true`, eliminating the defensive v8-ignored fallback at src/queue/processors.ts:8827 entirely.
  • The JSDoc above screenshotCaptureUnobtainableForHead (processors.ts:8774) is a good pattern for documenting shared-fact functions — consider linking it explicitly from the two call sites via a short comment referencing the helper name, which the diff already does well at one site.

CI checks failing

  • validate
  • validate-tests

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: 130 registered-repo PR(s), 92 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 130 PR(s), 3 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR extends maybeAddScreenshotTableAdvisoryFinding to accept captureUnobtainable, changes the early-return to fire only when action isn't advisory AND enforcement wasn't degraded, and appends a warning finding combining the gate's reason with CAPTURE_UNOBTAINABLE_REASON on the degraded path, matching the issue's core requirement. It also adds a shared screenshotCaptureUnobtainableForHead helper

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: TypeScript
  • Official Gittensor activity: 130 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 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 <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.

🟩 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
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests)). 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 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

1 participant