From 2a5d82b2500040c54862332f1132bbe49279bf33 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Fri, 10 Jul 2026 15:20:32 -0700 Subject: [PATCH] chore(review): deprecate gateCheckMode as a computed read-back value (#4618) gateCheckMode was a legacy shadow of reviewCheckMode (the actual check-run publish authority) kept alive only by dual-write sync code scattered across the DB layer, both settings-write API schemas, and the yml gate-config resolver. Reduce redundant config surface by making gateCheckMode a derived, read-only field everywhere: dropped from every write schema (maintainer dashboard PUT, internal full-replace POST), no longer an accepted upsertRepositorySettings input, and always recomputed from reviewCheckMode on read (DB row mapping, yml gate: block resolution, and the settings.gateCheckMode legacy yml key, which still parses for back-compat but now derives reviewCheckMode rather than the reverse). Also fixes a related latent bug: the yml gate: block only re-derived gateCheckMode when gate.enabled was set, so a manifest setting ONLY gate.checkMode could leave the back-compat display field silently stale. Updates the maintainer dashboard's "Review agent check" toggle to write reviewCheckMode directly instead of the deprecated field, and refreshes docs/README/CONTRIBUTING references accordingly. --- CONTRIBUTING.md | 2 +- README.md | 2 +- .../site/app-panels/maintainer-settings.tsx | 19 +- .../src/routes/docs.github-app.tsx | 17 +- .../src/routes/docs.how-reviews-work.tsx | 5 +- .../gittensory-engine/src/focus-manifest.ts | 5 + src/api/routes.ts | 27 +- src/db/repositories.ts | 22 +- src/services/maintainer-activation.ts | 3 +- src/signals/focus-manifest.ts | 11 +- src/types.ts | 7 +- test/integration/api.test.ts | 41 +- test/unit/focus-manifest.test.ts | 35 ++ .../linked-issue-satisfaction-run.test.ts | 3 + test/unit/maintainer-activation.test.ts | 1 - test/unit/parity-wire.test.ts | 1 + test/unit/queue.test.ts | 474 +++++++++--------- test/unit/repo-profile.test.ts | 2 +- ...ository-settings-review-check-mode.test.ts | 29 +- test/unit/routes-ai-byok.test.ts | 8 +- test/unit/safety.test.ts | 1 + 21 files changed, 373 insertions(+), 342 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b817c4de6..3c9a0eead0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -279,7 +279,7 @@ Config as code (`.gittensory.yml`) — every repository setting is controllable - **`settings:`** is a partial of the repository settings: any behaviour a maintainer can toggle in the dashboard can be set here as code — `commentMode`, `publicAudienceMode`, `publicSurface`, `checkRunMode`, - `gateCheckMode`, the gate-blocker modes, `autoLabelEnabled`, `gittensorLabel`, `requireLinkedIssue`, + `reviewCheckMode`, the gate-blocker modes, `autoLabelEnabled`, `gittensorLabel`, `requireLinkedIssue`, `backfillEnabled`, etc. - **`gate:`** is a friendly typed alias for the gate subset — `enabled` (on/off), `linkedIssue`, `duplicates`, `readiness: { mode, minScore }` (each `off | advisory | block`). diff --git a/README.md b/README.md index 8351f581f8..a22e3eabf7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Gittensory CI and gittensory review score, gate, and comment on pull requests. T **Check-run and comment surfaces, disambiguated** (a common point of confusion — these are three independent, separately-configured things, not layers of the same feature): -- **`Gittensory Orb Review Agent`** (`gate.*` / `settings.gateCheckMode` / `settings.reviewCheckMode`, off by default) — the authoritative GitHub Check Run carrying the gate's pass/fail verdict. This is the one worth making a required status check. +- **`Gittensory Orb Review Agent`** (`gate.*` / `settings.reviewCheckMode`, off by default) — the authoritative GitHub Check Run carrying the gate's pass/fail verdict. This is the one worth making a required status check. - **`Gittensory Context`** (`settings.checkRunMode` / `settings.checkRunDetailLevel`, off by default) — a separate, purely advisory Check Run. At its default `checkRunDetailLevel: minimal` it publishes no findings at all; even at `standard`/`deep` it only re-renders content already shown elsewhere. Never make this one required. - **Inline review comments** (`GITTENSORY_REVIEW_INLINE_COMMENTS` + `.gittensory.yml`'s `review.inline_comments`, off by both by default) — real, reply-able line-anchored PR review comment threads (CodeRabbit-style). This is the ONLY one of the three that posts an interactive per-line thread; the two check runs above never do. With `.gittensory.yml`'s `review.suggestions` also on, a precise line-anchored fix is additionally rendered as a one-click, committable GitHub suggested-change block. With `review.finding_categories` also on (off by default), each finding is additionally tagged with a category — security/correctness/performance/maintainability/tests/style — in both the inline comment label and the unified comment's "Finding categories" collapsible; a deterministic path/keyword fallback covers whatever the model omits. diff --git a/apps/gittensory-ui/src/components/site/app-panels/maintainer-settings.tsx b/apps/gittensory-ui/src/components/site/app-panels/maintainer-settings.tsx index 1fadbd9fed..0ec52cfa6f 100644 --- a/apps/gittensory-ui/src/components/site/app-panels/maintainer-settings.tsx +++ b/apps/gittensory-ui/src/components/site/app-panels/maintainer-settings.tsx @@ -21,7 +21,9 @@ type MaintainerSettings = { publicSurface: "off" | "comment_and_label" | "comment_only" | "label_only"; checkRunMode: "off" | "enabled"; checkRunDetailLevel: "minimal" | "standard" | "deep"; - gateCheckMode: "off" | "enabled"; + // #4618: gateCheckMode is deprecated (a computed read-back value only) -- reviewCheckMode is the real, + // writable authority for whether the review-agent check-run publishes. + reviewCheckMode: "required" | "visible" | "disabled"; gatePack: "gittensor" | "oss-anti-slop"; linkedIssueGateMode: GateMode; duplicatePrGateMode: GateMode; @@ -90,7 +92,7 @@ const EDITABLE_KEYS: Array = [ "publicSurface", "checkRunMode", "checkRunDetailLevel", - "gateCheckMode", + "reviewCheckMode", "gatePack", "linkedIssueGateMode", "duplicatePrGateMode", @@ -138,12 +140,15 @@ type FieldDef = SelectFieldDef | ToggleFieldDef | NumberFieldDef; const GATE_FIELDS: FieldDef[] = [ { - key: "gateCheckMode", + key: "reviewCheckMode", label: "Review agent check", kind: "select", + // "visible" (publishes but never required in branch protection) is deliberately not offered here -- + // this toggle keeps its historical off/enabled shape; set .gittensory.yml gate.checkMode: visible directly + // for that finer-grained mode. options: [ - ["off", "off"], - ["enabled", "enabled"], + ["disabled", "off"], + ["required", "enabled"], ], }, { @@ -373,8 +378,8 @@ export function MaintainerSettings({ reviewability }: { reviewability: Array<{ p

{settings ? ( - - gate {settings.gateCheckMode} + + gate {settings.reviewCheckMode === "disabled" ? "off" : "enabled"} ) : null} diff --git a/apps/gittensory-ui/src/routes/docs.github-app.tsx b/apps/gittensory-ui/src/routes/docs.github-app.tsx index 004ac0c161..76f4a43eef 100644 --- a/apps/gittensory-ui/src/routes/docs.github-app.tsx +++ b/apps/gittensory-ui/src/routes/docs.github-app.tsx @@ -166,13 +166,14 @@ GET /v1/installations/:id/repair`}

Gate modes

The deterministic gate is the heart of the gittensory review. Its master switch is{" "} - gateCheckMode (off / enabled); each dimension then - refines an already-enabled gate with a tri-state mode — off (not evaluated),{" "} - advisory (surfaced, never blocks), or block (can become a hard{" "} - Gittensory Orb Review Agent blocker). A configured blocker fails the gate - for any author identically — confirmed-Gittensor-contributor status does not change{" "} - who can be blocked; it's carried through only for on-chain scoring, a separate - concern from the gate's own merge/close decision. + reviewCheckMode (required / visible /{" "} + disabled); each dimension then refines an already-enabled gate with a tri-state + mode — off (not evaluated), advisory (surfaced, never blocks), or{" "} + block (can become a hard Gittensory Orb Review Agent blocker). + A configured blocker fails the gate for any author identically — + confirmed-Gittensor-contributor status does not change who can be blocked; it's + carried through only for on-chain scoring, a separate concern from the gate's own + merge/close decision.