Skip to content

fix(engine): re-validate screenshot matrix evidence on re-push (#8866) - #9038

Merged
loopover-orb[bot] merged 3 commits into
JSONbored:mainfrom
andriypolanski:fix/8866-screenshot-matrix-staleness
Jul 26, 2026
Merged

fix(engine): re-validate screenshot matrix evidence on re-push (#8866)#9038
loopover-orb[bot] merged 3 commits into
JSONbored:mainfrom
andriypolanski:fix/8866-screenshot-matrix-staleness

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

PR body

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npx vitest run test/unit/screenshot-table-gate-engine.test.ts test/unit/screenshot-table-gate.test.ts -t "8866|matrix mode" — passed
  • npx vitest run test/unit/queue-3.test.ts -t "stale-screenshot-table-fix|#8866" — 2 passed
  • CI-scoped Codecov simulation: npx diff-cover coverage/lcov.info --compare-branch=origin/main --include-untracked100% patch lines
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

Narrow engine gate staleness fix; full test:ci left for the opener before push. Targeted engine + queue-3 tests cover the matrix stale/re-affirm/no-headSha paths.

Notes for reviewers / gate

  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • Does not touch site/, CNAME, **/lovable/**, or CHANGELOG.md.
  • No UI Evidence (backend-only).

andriy-polanski and others added 2 commits July 26, 2026 15:33
…ored#8866)

Reuse the presence-mode head-SHA/evidence-fingerprint checkpoint in matrix
mode so an unchanged matrix table cannot silently PASS after a new commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.88%. Comparing base (8444812) to head (0baf45a).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9038      +/-   ##
==========================================
- Coverage   93.88%   93.88%   -0.01%     
==========================================
  Files         809      809              
  Lines       80553    80560       +7     
  Branches    24436    24441       +5     
==========================================
+ Hits        75628    75631       +3     
  Misses       3560     3560              
- Partials     1365     1369       +4     
Flag Coverage Δ
backend 95.16% <100.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...oopover-engine/src/review/screenshot-table-gate.ts 100.00% <100.00%> (ø)
src/queue/processors.ts 95.72% <ø> (ø)

... and 1 file with indirect coverage changes

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

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 16:35:07 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This extracts the presence-mode staleness check (headSha/evidenceFingerprint correlation, originally #stale-screenshot-table-fix) into a shared `evidenceFreshnessForHead` helper and wires it into matrix mode too, closing the gap where a complete viewport/theme matrix satisfied on push #1 kept silently passing on later pushes with unchanged evidence. The refactor is a faithful behavior-preserving extraction for presence mode (the extracted logic is byte-identical to what was inlined before) and correctly reuses the same `presenceModeSatisfiedState` persistence/consumption path in `processors.ts` and `screenshotTablePresenceSatisfied` DB field for matrix mode, so no new schema/wiring is needed. Tests cover stale-reuse, re-affirm-with-new-URLs, and no-headSha-degrades-gracefully paths for matrix mode, mirroring the existing presence-mode test shapes, and the queue-3 integration test drives the real close path end-to-end across two pushes.

Nits — 5 non-blocking
  • The reused field name `presenceModeSatisfiedState`/`ScreenshotTablePresenceEvidence` now also represents matrix-mode checkpoints; a rename (e.g. `evidenceSatisfiedState`) would reduce confusion for future readers, though this is purely cosmetic since the JSDoc above it was updated to clarify the dual use.
  • screenshot-table-gate.ts has grown to ~463 lines per the external size-smell note; if this area keeps accumulating shared logic it may be worth splitting the matrix/presence evaluators into a submodule.
  • validate-code failed with no detail provided, and per BASE BRANCH STATUS this branch is 9 commits behind default — worth rebasing to rule out a stale-branch cause before assuming a real defect.
  • Consider renaming `presenceModeSatisfiedState` to something mode-neutral now that matrix mode also populates/consumes it, to avoid future readers assuming it's presence-only despite the updated comment.
  • Rebase onto the latest default branch to see if the undetailed validate-code failure clears, given the 9-commit drift noted in BASE BRANCH STATUS.

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 #8866
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: 200 registered-repo PR(s), 126 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 200 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff extracts a shared evidenceFreshnessForHead helper and wires it into the matrix branch of evaluateScreenshotTableGate exactly as requested, updates the doc comments to match reality, and adds both unit tests (engine-level) and a queue-3 regression test mirroring the presence-mode staleness test for matrix mode.

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Rust, Cuda, JavaScript, Kotlin, MDX, Scala
  • Official Gittensor activity: 200 PR(s), 22 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.

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(engine): screenshot-table matrix mode has no re-push staleness guard despite doc comment claiming otherwise

2 participants