From 61bd85d2a404b6d09cbef5517442ec0777cf54cc Mon Sep 17 00:00:00 2001
From: JSONbored <49853598+JSONbored@users.noreply.github.com>
Date: Fri, 10 Jul 2026 16:01:26 -0700
Subject: [PATCH] feat(review): add improvementSignal converged-feature
activation
Config-as-code foundation for the PR improvement signal (#4738, sub-issue
of epic #4737): registers improvementSignal as a standard ConvergedFeatureKey
alongside rag/reputation/unifiedComment/safety/grounding/e2eTests, resolved
through the existing shared feature-activation core rather than a bespoke
wire file. Global default OFF via GITTENSORY_REVIEW_IMPROVEMENT_SIGNAL, with
a per-repo features.improvementSignal true/false/null override in
.gittensory.yml layered on top of that kill-switch, mirroring the e2eTests
plain-symmetric-override shape (no force-on/force-off asymmetry, since this
is a read-only advisory signal, not a security control).
This is activation wiring only -- no tier reads the resolved value yet;
sibling sub-issues build the deterministic, LLM, and panel behavior that
will gate on it.
---
.gittensory.yml.example | 20 +++++++-----
.../src/routes/docs.privacy-security.tsx | 1 +
apps/gittensory-ui/src/routes/docs.tuning.tsx | 7 +++++
config/examples/gittensory.full.yml | 20 +++++++-----
.../gittensory-engine/src/focus-manifest.ts | 9 ++++--
src/env.d.ts | 6 ++++
src/review/feature-activation.ts | 2 ++
src/review/improvement-signal-wire.ts | 19 ++++++++++++
test/unit/feature-activation.test.ts | 31 +++++++++++++++++++
test/unit/focus-manifest.test.ts | 3 +-
test/unit/improvement-signal-wiring.test.ts | 20 ++++++++++++
worker-configuration.d.ts | 4 ++-
wrangler.jsonc | 5 +++
13 files changed, 127 insertions(+), 20 deletions(-)
create mode 100644 src/review/improvement-signal-wire.ts
create mode 100644 test/unit/improvement-signal-wiring.test.ts
diff --git a/.gittensory.yml.example b/.gittensory.yml.example
index ab94e80503..c957198062 100644
--- a/.gittensory.yml.example
+++ b/.gittensory.yml.example
@@ -1102,14 +1102,17 @@ settings:
# auto_pause_after_reviewed_commits: 3
# Per-repo activation overrides for the converged review features that ship behind a deployment-wide
-# GITTENSORY_REVIEW_* env kill-switch (rag/reputation/unifiedComment/safety/grounding/e2eTests). Each key is
-# `true` (force on for this repo, subject to the env flag still being enabled), `false` (force off), or omitted
-# (falls back to the GITTENSORY_REVIEW_REPOS allowlist default -- an operator who sets nothing keeps today's
-# behavior). Exception: `safety` is force-on-only -- an untrusted repo-controlled `false` is treated as "no
-# opinion" rather than an active force-off (#2269), since a lower-trust actor must never be able to silently
-# defeat the operator's own security-hardening enablement. `e2eTests` (#4190) is a plain symmetric override
-# like rag/reputation/unifiedComment -- generating AI test content carries no security-hardening rationale to
-# protect from a repo-controlled override, so there's no force-on/force-off asymmetry here.
+# GITTENSORY_REVIEW_* env kill-switch (rag/reputation/unifiedComment/safety/grounding/e2eTests/improvementSignal).
+# Each key is `true` (force on for this repo, subject to the env flag still being enabled), `false` (force off),
+# or omitted (falls back to the GITTENSORY_REVIEW_REPOS allowlist default -- an operator who sets nothing keeps
+# today's behavior). Exception: `safety` is force-on-only -- an untrusted repo-controlled `false` is treated as
+# "no opinion" rather than an active force-off (#2269), since a lower-trust actor must never be able to silently
+# defeat the operator's own security-hardening enablement. `e2eTests` (#4190) and `improvementSignal` (#4738,
+# foundation phase of the #4737 PR-improvement-signal epic) are plain symmetric overrides like
+# rag/reputation/unifiedComment -- neither AI-generated test content nor a read-only advisory quality-delta
+# signal carries a security-hardening rationale to protect from a repo-controlled override, so there's no
+# force-on/force-off asymmetry for either. `improvementSignal` is activation wiring only for now -- no tier
+# reads the resolved value yet.
# features:
# rag: true
# reputation: false
@@ -1117,6 +1120,7 @@ settings:
# safety: true
# grounding: true
# e2eTests: false
+# improvementSignal: false
# Registry-review lane (#2435): lets a self-hosted maintainer point gittensory at their OWN structured
# registry (e.g. a subnet/plugin/package catalog) without a gittensory code change -- reviewing additions
diff --git a/apps/gittensory-ui/src/routes/docs.privacy-security.tsx b/apps/gittensory-ui/src/routes/docs.privacy-security.tsx
index f653ed75ff..56f89a509d 100644
--- a/apps/gittensory-ui/src/routes/docs.privacy-security.tsx
+++ b/apps/gittensory-ui/src/routes/docs.privacy-security.tsx
@@ -96,6 +96,7 @@ GITTENSORY_REVIEW_FIX_HANDOFF="true" # machine-readable fix-handoff
GITTENSORY_REVIEW_PLANNER="true" # @gittensory plan on-demand implementation plan
GITTENSORY_REVIEW_SCREENSHOTS="true" # before/after visual capture for UI changes
GITTENSORY_REVIEW_E2E_TESTS="true" # AI-generated E2E test coverage (needs features.e2eTests too)
+GITTENSORY_REVIEW_IMPROVEMENT_SIGNAL="true" # read-only PR quality-delta signal (activation only, no-op for now)
# Global (cron / endpoint) flags, not scoped by GITTENSORY_REVIEW_REPOS.
GITTENSORY_REVIEW_CONTINUOUS="true" # fleet-wide default: re-review on every push (else one-shot)
diff --git a/apps/gittensory-ui/src/routes/docs.tuning.tsx b/apps/gittensory-ui/src/routes/docs.tuning.tsx
index 7452eec78f..95e70ff981 100644
--- a/apps/gittensory-ui/src/routes/docs.tuning.tsx
+++ b/apps/gittensory-ui/src/routes/docs.tuning.tsx
@@ -138,6 +138,13 @@ function Tuning() {
needs its own features.e2eTests: true override in{" "}
.gittensory.yml before the feature is active for it. Per-PR.
+
GITTENSORY_REVIEW_IMPROVEMENT_SIGNAL — master kill-switch for the read-only,
+ advisory PR quality-delta signal (the positive-axis counterpart to the slop risk score).
+ Off by default; config-as-code activation only for now — no tier reads the resolved value
+ yet, so turning this on has no visible effect until a later release wires real behavior
+ behind it. Per-PR.
+ GITTENSORY_REVIEW_CONTINUOUS — fleet-wide default AI review re-trigger
cadence. Off by default (one-shot): AI-generated content (main review, slop advisory,
diff --git a/config/examples/gittensory.full.yml b/config/examples/gittensory.full.yml
index 1667cbb52c..9195afd831 100644
--- a/config/examples/gittensory.full.yml
+++ b/config/examples/gittensory.full.yml
@@ -1115,14 +1115,17 @@ settings:
# auto_pause_after_reviewed_commits: 3
# Per-repo activation overrides for the converged review features that ship behind a deployment-wide
-# GITTENSORY_REVIEW_* env kill-switch (rag/reputation/unifiedComment/safety/grounding/e2eTests). Each key is
-# `true` (force on for this repo, subject to the env flag still being enabled), `false` (force off), or omitted
-# (falls back to the GITTENSORY_REVIEW_REPOS allowlist default -- an operator who sets nothing keeps today's
-# behavior). Exception: `safety` is force-on-only -- an untrusted repo-controlled `false` is treated as "no
-# opinion" rather than an active force-off (#2269), since a lower-trust actor must never be able to silently
-# defeat the operator's own security-hardening enablement. `e2eTests` (#4190) is a plain symmetric override
-# like rag/reputation/unifiedComment -- generating AI test content carries no security-hardening rationale to
-# protect from a repo-controlled override, so there's no force-on/force-off asymmetry here.
+# GITTENSORY_REVIEW_* env kill-switch (rag/reputation/unifiedComment/safety/grounding/e2eTests/improvementSignal).
+# Each key is `true` (force on for this repo, subject to the env flag still being enabled), `false` (force off),
+# or omitted (falls back to the GITTENSORY_REVIEW_REPOS allowlist default -- an operator who sets nothing keeps
+# today's behavior). Exception: `safety` is force-on-only -- an untrusted repo-controlled `false` is treated as
+# "no opinion" rather than an active force-off (#2269), since a lower-trust actor must never be able to silently
+# defeat the operator's own security-hardening enablement. `e2eTests` (#4190) and `improvementSignal` (#4738,
+# foundation phase of the #4737 PR-improvement-signal epic) are plain symmetric overrides like
+# rag/reputation/unifiedComment -- neither AI-generated test content nor a read-only advisory quality-delta
+# signal carries a security-hardening rationale to protect from a repo-controlled override, so there's no
+# force-on/force-off asymmetry for either. `improvementSignal` is activation wiring only for now -- no tier
+# reads the resolved value yet.
# features:
# rag: true
# reputation: false
@@ -1130,6 +1133,7 @@ settings:
# safety: true
# grounding: true
# e2eTests: false
+# improvementSignal: false
# Registry-review lane (#2435): lets a self-hosted maintainer point gittensory at their OWN structured
# registry (e.g. a subnet/plugin/package catalog) without a gittensory code change -- reviewing additions
diff --git a/packages/gittensory-engine/src/focus-manifest.ts b/packages/gittensory-engine/src/focus-manifest.ts
index ab3f264e61..6e5c164210 100644
--- a/packages/gittensory-engine/src/focus-manifest.ts
+++ b/packages/gittensory-engine/src/focus-manifest.ts
@@ -218,8 +218,12 @@ export type CopycatGateMode = "off" | "warn" | "label" | "block";
// `review/selftune-wire.ts`. `e2eTests` (#4190, part of the #4189 E2E-test-generation epic) fits this shape
// exactly as a plain symmetric override — unlike `safety`/`grounding` it has no force-on-only or force-off-only
// floor/ceiling, since AI-generated test content carries no security-hardening or full-file-fetch rationale to
-// protect from a repo-controlled override.
-export const CONVERGED_FEATURE_KEYS = ["rag", "reputation", "unifiedComment", "safety", "grounding", "e2eTests"] as const;
+// protect from a repo-controlled override. `improvementSignal` (#4738, foundation phase of the #4737 PR-
+// improvement-signal epic) is likewise a plain symmetric override: it is a READ-ONLY advisory quality-delta
+// signal, not a security control, so a repo-level `false` behaves like any other plain override with no
+// floor/ceiling. This is activation wiring only -- no tier reads the resolved value yet (sibling sub-issues
+// #4739-#4746 build the deterministic/LLM/panel behavior that will gate on it).
+export const CONVERGED_FEATURE_KEYS = ["rag", "reputation", "unifiedComment", "safety", "grounding", "e2eTests", "improvementSignal"] as const;
export type ConvergedFeatureKey = (typeof CONVERGED_FEATURE_KEYS)[number];
/** Per-repo activation overrides for the converged review features (`features:` block). `true`/`false` force the
@@ -963,6 +967,7 @@ const EMPTY_FEATURES_CONFIG: FocusManifestFeaturesConfig = {
safety: null,
grounding: null,
e2eTests: null,
+ improvementSignal: null,
};
const EMPTY_CONTENT_LANE_CONFIG: FocusManifestContentLaneConfig = {
diff --git a/src/env.d.ts b/src/env.d.ts
index 5a1b8aff74..0d7a2c8661 100644
--- a/src/env.d.ts
+++ b/src/env.d.ts
@@ -276,6 +276,12 @@ declare global {
* E2E test coverage feature. Default OFF — unset/false the feature is never active for any repo regardless
* of a per-repo `features.e2eTests` override. */
GITTENSORY_REVIEW_E2E_TESTS?: string;
+ /** Convergence (improvementSignal, #4738, foundation phase of the #4737 epic): master kill-switch for the
+ * read-only, ADVISORY PR quality-delta signal (the positive-axis counterpart to slop.ts's risk score).
+ * This is config-as-code activation ONLY — no tier reads this flag yet; sibling sub-issues (#4739-#4746)
+ * build the deterministic/LLM/panel behavior that will gate on it. Default OFF — unset/false the feature
+ * is never active for any repo regardless of a per-repo `features.improvementSignal` override. */
+ GITTENSORY_REVIEW_IMPROVEMENT_SIGNAL?: string;
/** #one-shot-review-cadence: the operator's FLEET-WIDE default for AI review re-trigger cadence, consulted
* only when a repo's `.gittensory.yml review.auto_review.cadence` is unset (a per-repo value always wins
* regardless of this flag — see resolveAiReviewCadence). Default OFF (unset/false) ⇒ "one_shot": the
diff --git a/src/review/feature-activation.ts b/src/review/feature-activation.ts
index 885f0de643..58506c19f7 100644
--- a/src/review/feature-activation.ts
+++ b/src/review/feature-activation.ts
@@ -21,6 +21,7 @@
import { isConvergenceRepoAllowed } from "./cutover-gate";
import { isE2eTestGenerationEnabled } from "./e2e-test-gen-wire";
import { isGroundingEnabled } from "./grounding-wire";
+import { isImprovementSignalEnabled } from "./improvement-signal-wire";
import { isRagEnabled } from "./rag-wire";
import { isReputationEnabled } from "./reputation-wire";
import { isSafetyEnabled } from "./safety";
@@ -36,6 +37,7 @@ const FEATURE_GLOBAL_FLAG: Record