Skip to content

Config-driven gate rule: auto-close visual/frontend PRs missing a before/after screenshot table #2006

Description

@JSONbored

Config-driven gate rule: require a before/after screenshot table on visual/frontend PRs

Problem. UI/visual PRs without before/after screenshots are unreviewable at a glance and waste review cycles. We want a PR that changes UI to be auto-closed (with a clear reason) unless it includes a proper before/after screenshot table. This must be config-driven and opt-in per repo (per our modular-not-hardcoded rule) — not special-cased for any one repo.

Proposed setting (.gittensory.yml + dashboard parity)

gate:
  requireScreenshotTable:
    enabled: true            # default false
    whenLabels: [frontend, visual]   # only enforce when the PR carries one of these labels
    whenPaths: ["apps/ui/**", "src/**/*.tsx"]  # OR path-based trigger (either matches)
    action: close            # close | request-changes | comment

Detection (deterministic, no AI needed)

A PR "has a screenshot table" when its body contains a markdown table whose cells embed images (![...](...) or <img ...>), i.e. a | ... | table region with at least one image markup and at least one before + one after column/row marker. Reject when:

  • the PR is in scope (label or path match) AND
  • the body has no image-bearing markdown table, OR images are pasted outside any table (large inline images with no table), OR images are committed to the repo (added image files in the diff under the UI paths) rather than uploaded to the PR.

Action on violation

  • close: close the PR with a templated comment = the screenshot contract (the exact table template + rules) so the contributor can reopen/resubmit correctly.
  • Make the templated reason itself config-driven (a messages.screenshotContract override) so each repo can tune wording.

Interim (before the code feature ships)

The private per-repo review config on the VPS (/opt/gittensory/gittensory-config/JSONbored__metagraphed*/review/) is read live at review time — add the screenshot requirement to the review instructions there so the AI review at least flags non-compliant visual PRs immediately, while this deterministic auto-close rule is built.

Deliverables

  • gate.requireScreenshotTable config (yml + dashboard) resolved in the config layer (yml > DB > default off)
  • Deterministic detector (body markdown-table-with-images + committed-image-file check against the diff)
  • Scope match by label AND/OR path
  • close / request-changes / comment action + config-driven templated reason
  • Tests: in-scope + no-table → action; in-scope + valid table → pass; out-of-scope → ignored; images-outside-table → action; committed-image-file → action; both branches of every predicate
  • Docs: the contract template + the setting

maintainer-only. Requested for metagraphed-ui / the metagraphed monorepo (apps/ui), but must be generic.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions