From 8a284a5ab7b1f48d26c26c8370555c4e2e9044f2 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Tue, 7 Jul 2026 20:12:18 -0700 Subject: [PATCH] chore(review): remove never-wired test-generation dead slice (#4108) GITTENSORY_REVIEW_TEST_GENERATION, the review.testGeneration manifest field, and their resolver/gate functions (resolveTestGenerationManifestToggle, isTestGenerationEnabled, shouldOfferTestGenerationSpec) had zero callers anywhere in the review pipeline -- the spec-attachment slice that was supposed to consume them was never built. Removes the whole orphaned surface plus its test file and the stale doc mentions in the example configs and docs pages. The live, ungated MCP test-generation tools (gittensory_generate_tests, boundary-test-generation) are untouched. --- .gittensory.yml.example | 15 ---------- .../src/routes/docs.privacy-security.tsx | 1 - apps/gittensory-ui/src/routes/docs.tuning.tsx | 6 ---- config/examples/gittensory.full.yml | 15 ---------- .../gittensory-engine/src/focus-manifest.ts | 23 ++------------- src/env.d.ts | 6 ---- src/review/test-generation.ts | 25 ----------------- src/signals/focus-manifest.ts | 15 ++-------- test/unit/config-templates.test.ts | 15 ---------- test/unit/focus-manifest.test.ts | 28 +------------------ test/unit/signals-coverage.test.ts | 2 +- test/unit/test-generation.test.ts | 22 --------------- worker-configuration.d.ts | 4 +-- wrangler.jsonc | 5 ---- 14 files changed, 9 insertions(+), 173 deletions(-) delete mode 100644 src/review/test-generation.ts delete mode 100644 test/unit/test-generation.test.ts diff --git a/.gittensory.yml.example b/.gittensory.yml.example index 7e3b499710..61782cebf8 100644 --- a/.gittensory.yml.example +++ b/.gittensory.yml.example @@ -484,15 +484,6 @@ review: # (CI green, gate passing, mergeable-clean, valid linked issue). SURFACE ONLY — never changes the decision. # auto_merge_summary: false - # Boundary-safe test-generation advisory (#1972, kill-switch config slice #2189). Bool | null. Default: - # null/false — byte-identical (no boundary scan runs at all). Requires the operator's - # GITTENSORY_REVIEW_TEST_GENERATION flag to be on AND this toggle. When both are on, a diff that touches a - # small, precise set of boundary-condition patterns (off-by-one array/index bounds, null/undefined branches, - # empty-collection checks) with NO test evidence anywhere in the PR gets an advisory finding plus a - # LOCAL-execution test-generation action spec (criteria/hints for your OWN agent to scaffold tests with — - # gittensory never writes or runs test code). - # test_generation: false - # Deterministic label suggestions (#2045). Each rule SUGGESTS a non-scoring label when a PR matches ALL of the # `when` criteria it sets (at least one is required): when_paths (any changed path matches a glob), title_contains, # description_contains (both case-insensitive). Suggestions are advisory; they are auto-applied only when the repo's @@ -913,12 +904,6 @@ settings: # # fallback for whatever it omits. Only takes effect when inline_comments is already on. Bool or null. # # Default: null/false. # finding_categories: false -# # When true, a diff touching a small, precise set of boundary-condition patterns (off-by-one array/index -# # bounds, null/undefined branches, empty-collection checks) with no test evidence in the PR gets an -# # advisory finding plus a LOCAL-execution test-generation action spec (criteria/hints only -- never -# # generated test code; your own agent scaffolds it). Also requires the operator flag -# # GITTENSORY_REVIEW_TEST_GENERATION. Bool or null. Default: null/false (byte-identical). -# test_generation: false # # How strictly a linked issue must actually be SATISFIED by the PR (distinct from linkedIssuePolicy, # # which only checks a link EXISTS). off = not evaluated; advisory = surface a finding; block = can # # become a hard blocker (confirmed-contributor-gated). This is the config knob only — parsed and diff --git a/apps/gittensory-ui/src/routes/docs.privacy-security.tsx b/apps/gittensory-ui/src/routes/docs.privacy-security.tsx index 56cdc748a3..6eb7ee1251 100644 --- a/apps/gittensory-ui/src/routes/docs.privacy-security.tsx +++ b/apps/gittensory-ui/src/routes/docs.privacy-security.tsx @@ -92,7 +92,6 @@ GITTENSORY_REVIEW_REPUTATION="true" # submitter-reputation spend co GITTENSORY_REVIEW_UNIFIED_COMMENT="true" # one in-place unified PR comment GITTENSORY_REVIEW_ENRICHMENT="true" # external analyzer registry (REES) findings GITTENSORY_REVIEW_INLINE_COMMENTS="true" # diff-anchored inline PR review comments -GITTENSORY_REVIEW_TEST_GENERATION="true" # boundary-safe test-gen action spec (contributor-run) GITTENSORY_REVIEW_FIX_HANDOFF="true" # machine-readable fix-handoff block (contributor-run) GITTENSORY_REVIEW_PLANNER="true" # @gittensory plan on-demand implementation plan GITTENSORY_REVIEW_SCREENSHOTS="true" # before/after visual capture for UI changes diff --git a/apps/gittensory-ui/src/routes/docs.tuning.tsx b/apps/gittensory-ui/src/routes/docs.tuning.tsx index 6b47af0cca..9162c6562e 100644 --- a/apps/gittensory-ui/src/routes/docs.tuning.tsx +++ b/apps/gittensory-ui/src/routes/docs.tuning.tsx @@ -183,12 +183,6 @@ function Tuning() { GITTENSORY_REVIEW_INLINE_COMMENTS — posts AI-review findings as inline diff-anchored PR review comments instead of (or alongside) the summary comment. Per-PR. -
  • - GITTENSORY_REVIEW_TEST_GENERATION — offers a boundary-safe local-write action - spec alongside a missing-test-evidence finding, describing what test cases should exist - for the repo's detected framework; the contributor's own agent scaffolds and runs the - tests locally. Per-PR. -
  • GITTENSORY_REVIEW_FIX_HANDOFF — renders a review finding as a structured, machine-readable "apply this fix" block for the contributor's own local agent to consume — diff --git a/config/examples/gittensory.full.yml b/config/examples/gittensory.full.yml index ac10a39870..e6d3414fef 100644 --- a/config/examples/gittensory.full.yml +++ b/config/examples/gittensory.full.yml @@ -497,15 +497,6 @@ review: # (CI green, gate passing, mergeable-clean, valid linked issue). SURFACE ONLY — never changes the decision. # auto_merge_summary: false - # Boundary-safe test-generation advisory (#1972, kill-switch config slice #2189). Bool | null. Default: - # null/false — byte-identical (no boundary scan runs at all). Requires the operator's - # GITTENSORY_REVIEW_TEST_GENERATION flag to be on AND this toggle. When both are on, a diff that touches a - # small, precise set of boundary-condition patterns (off-by-one array/index bounds, null/undefined branches, - # empty-collection checks) with NO test evidence anywhere in the PR gets an advisory finding plus a - # LOCAL-execution test-generation action spec (criteria/hints for your OWN agent to scaffold tests with — - # gittensory never writes or runs test code). - # test_generation: false - # Deterministic label suggestions (#2045). Each rule SUGGESTS a non-scoring label when a PR matches ALL of the # `when` criteria it sets (at least one is required): when_paths (any changed path matches a glob), title_contains, # description_contains (both case-insensitive). Suggestions are advisory; they are auto-applied only when the repo's @@ -926,12 +917,6 @@ settings: # # fallback for whatever it omits. Only takes effect when inline_comments is already on. Bool or null. # # Default: null/false. # finding_categories: false -# # When true, a diff touching a small, precise set of boundary-condition patterns (off-by-one array/index -# # bounds, null/undefined branches, empty-collection checks) with no test evidence in the PR gets an -# # advisory finding plus a LOCAL-execution test-generation action spec (criteria/hints only -- never -# # generated test code; your own agent scaffolds it). Also requires the operator flag -# # GITTENSORY_REVIEW_TEST_GENERATION. Bool or null. Default: null/false (byte-identical). -# test_generation: false # # How strictly a linked issue must actually be SATISFIED by the PR (distinct from linkedIssuePolicy, # # which only checks a link EXISTS). off = not evaluated; advisory = surface a finding; block = can # # become a hard blocker (confirmed-contributor-gated). This is the config knob only — parsed and diff --git a/packages/gittensory-engine/src/focus-manifest.ts b/packages/gittensory-engine/src/focus-manifest.ts index 2be9c9c754..dabb2129e8 100644 --- a/packages/gittensory-engine/src/focus-manifest.ts +++ b/packages/gittensory-engine/src/focus-manifest.ts @@ -430,17 +430,6 @@ export type FocusManifestReviewConfig = { * source, same display-only (never touches the AI prompt) shape. null/false (default, absent) = no chip = * byte-identical behavior. (#1955) */ effortScore: boolean | null; - /** `review.test_generation` (#1972, kill-switch config slice #2189): when true, a diff that touches a small, - * precise set of boundary-condition patterns (off-by-one array/index bounds, null/undefined branches, - * empty-collection checks — see `src/signals/boundary-test-generation.ts`) with NO test evidence anywhere in - * the PR gets an additional advisory finding plus a boundary-safe LOCAL-execution - * `gittensory_generate_tests` action spec (criteria/hints only, never generated test code — see - * `src/mcp/local-write-tools.ts`'s `buildTestGenSpec`). Also gated by the operator's - * `GITTENSORY_REVIEW_TEST_GENERATION` kill-switch (`src/review/test-generation.ts`'s - * `isTestGenerationEnabled`) — the caller ANDs both. Purely additive and deterministic; it never changes what - * `missingTestEvidence` already does. null/false (default, absent) ⇒ byte-identical behavior — no boundary - * scan runs and no spec is ever built. */ - testGeneration: boolean | null; /** `review.impact_map` (#2184, config slice of #1971): when true, gates BOTH the deterministic impact-map * computation (`computeImpactMap`, `src/review/impact-map.ts`) and its rendering as a compact section in * the unified review comment (#2185) / additive AI-review grounding context (#2186). Deterministic/display @@ -887,7 +876,7 @@ const EMPTY_MANIFEST: FocusManifest = { publicNotes: [], gate: { ...EMPTY_GATE_CONFIG }, settings: {}, - review: { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, testGeneration: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { ...EMPTY_MAX_FINDINGS_CONFIG }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }, + review: { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { ...EMPTY_MAX_FINDINGS_CONFIG }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }, features: { ...EMPTY_FEATURES_CONFIG }, contentLane: { ...EMPTY_CONTENT_LANE_CONFIG }, repoDocGeneration: { ...EMPTY_REPO_DOC_GENERATION_CONFIG }, @@ -917,7 +906,7 @@ function emptyManifest(source: FocusManifestSource, warnings: string[] = []): Fo warnings, gate: { ...EMPTY_GATE_CONFIG }, settings: {}, - review: { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, testGeneration: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { ...EMPTY_MAX_FINDINGS_CONFIG }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }, + review: { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { ...EMPTY_MAX_FINDINGS_CONFIG }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }, features: { ...EMPTY_FEATURES_CONFIG }, contentLane: { ...EMPTY_CONTENT_LANE_CONFIG }, repoDocGeneration: { ...EMPTY_REPO_DOC_GENERATION_CONFIG }, @@ -1921,7 +1910,7 @@ function parsePublicSafeText(value: JsonValue | undefined, field: string, warnin * throws; invalid/unsafe values are dropped with warnings. */ function parseReviewConfig(value: JsonValue | undefined, warnings: string[]): FocusManifestReviewConfig { - const empty: FocusManifestReviewConfig = { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, testGeneration: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { ...EMPTY_MAX_FINDINGS_CONFIG }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }; + const empty: FocusManifestReviewConfig = { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { ...EMPTY_MAX_FINDINGS_CONFIG }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }; if (value === undefined || value === null) return empty; if (typeof value !== "object" || Array.isArray(value)) { warnings.push(`Manifest field "review" must be a mapping; ignoring it.`); @@ -1963,7 +1952,6 @@ function parseReviewConfig(value: JsonValue | undefined, warnings: string[]): Fo const suggestions = normalizeOptionalBoolean(r.suggestions, "review.suggestions", warnings); const changedFilesSummary = normalizeOptionalBoolean(r.changed_files_summary, "review.changed_files_summary", warnings); const effortScore = normalizeOptionalBoolean(r.effort_score, "review.effort_score", warnings); - const testGeneration = normalizeOptionalBoolean(r.test_generation, "review.test_generation", warnings); const impactMap = normalizeOptionalBoolean(r.impact_map, "review.impact_map", warnings); const cultureProfile = normalizeOptionalBoolean(r.culture_profile, "review.culture_profile", warnings); const selftune = normalizeOptionalBoolean(r.selftune, "review.selftune", warnings); @@ -2005,7 +1993,6 @@ function parseReviewConfig(value: JsonValue | undefined, warnings: string[]): Fo suggestions !== null || changedFilesSummary !== null || effortScore !== null || - testGeneration !== null || impactMap !== null || cultureProfile !== null || selftune !== null || @@ -2034,7 +2021,6 @@ function parseReviewConfig(value: JsonValue | undefined, warnings: string[]): Fo aiModel, visual, linkedIssueSatisfaction, - testGeneration, enrichmentAnalyzers, profile, tone, @@ -2139,7 +2125,6 @@ function computeReviewConfigPresent(review: Omit { expect(reviewConfigToJson(on.review)).toEqual({ inline_comments_per_category: 2 }); }); - it("locks in review.test_generation via manifest parse + JSON round-trip and documents it in gittensory.full.yml (#2189)", () => { - // test_generation is a kill-switch that gates the boundary-safe test-generation advisory (#1972); it is NOT a - // review prompt override, so it is exercised through the manifest parse + reviewConfigToJson round-trip rather - // than resolveReviewPromptOverrides (which does not surface it). - const full = readConfigExample("gittensory.full.yml"); - expect(full).toMatch(/# test_generation:/); - expect(parseFocusManifest({}).review.testGeneration).toBeNull(); - const on = parseFocusManifest({ review: { test_generation: true } }); - expect(on.review.testGeneration).toBe(true); - expect(reviewConfigToJson(on.review)).toEqual({ test_generation: true }); - const off = parseFocusManifest({ review: { test_generation: false } }); - expect(off.review.testGeneration).toBe(false); - expect(reviewConfigToJson(off.review)).toEqual({ test_generation: false }); - }); - it("parses gittensory.minimal.yml with zero warnings and enables no agent actions", () => { const manifest = parseFocusManifestContent(readConfigExample("gittensory.minimal.yml"), "repo_file"); expect(manifest.warnings).toEqual([]); diff --git a/test/unit/focus-manifest.test.ts b/test/unit/focus-manifest.test.ts index fcef08492c..5c373d6a53 100644 --- a/test/unit/focus-manifest.test.ts +++ b/test/unit/focus-manifest.test.ts @@ -34,7 +34,6 @@ import { resolveReviewSelfHostAiModel, resolveReviewVisualConfig, repoDocGenerationConfigToJson, - resolveTestGenerationManifestToggle, resolveReviewMemoryManifestToggle, reviewConfigToJson, overlayReviewConfig, @@ -367,7 +366,6 @@ describe(".gittensory.yml.example field-exhaustiveness (#1670)", () => { suggestions: "suggestions:", changedFilesSummary: "changed_files_summary:", effortScore: "effort_score:", - testGeneration: "test_generation:", impactMap: "impact_map:", cultureProfile: "culture_profile:", selftune: "selftune:", @@ -802,7 +800,7 @@ describe("compileFocusManifestPolicy", () => { publicNotes: ["Keep PRs focused.", "Maximize your reward payout"], gate: { present: false, enabled: null, checkMode: null, pack: null, linkedIssue: null, duplicates: null, readinessMode: null, readinessMinScore: null, slopMode: null, slopMinScore: null, slopAiAdvisory: null, sizeMode: null, lockfileIntegrityMode: null, aiReviewMode: null, aiReviewByok: null, aiReviewProvider: null, aiReviewModel: null, aiReviewAllAuthors: null, aiReviewCloseConfidence: null, aiReviewCombine: null, aiReviewOnMerge: null, aiReviewReviewers: null, mergeReadiness: null, selfAuthoredLinkedIssue: null, linkedIssueSatisfaction: null, manifestPolicy: null, dryRun: null, firstTimeContributorGrace: null, premergeContentRecheck: null, requireFreshRebaseWindowMinutes: null, claMode: null, claConsentPhrase: null, claCheckRunName: null, claCheckRunAppSlug: null, expectedCiContexts: null }, settings: {}, - review: { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, testGeneration: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { blockers: null, nits: null }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }, + review: { present: false, footerText: null, note: null, fields: {}, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { blockers: null, nits: null }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { ...EMPTY_AUTO_REVIEW_CONFIG }, labelingRules: [], aiModel: { ...EMPTY_SELF_HOST_AI_MODEL_CONFIG }, visual: { ...EMPTY_VISUAL_CONFIG }, linkedIssueSatisfaction: null, sharedConfigSource: null }, features: { present: false, rag: null, reputation: null, unifiedComment: null, safety: null, grounding: null }, contentLane: { present: false, entryFileGlob: null, providerFileGlob: null, artifactGlob: null, collectionField: null, maxAppendedEntries: null, duplicateKeyFields: [], validatorId: null }, repoDocGeneration: { present: false, enabled: false, scope: ["agents"], allowOverwriteExisting: false, refreshIntervalDays: 7 }, @@ -3131,23 +3129,6 @@ describe("resolveReviewPathInstructions (#review-path-instructions)", () => { expect(bad.warnings.some((w) => /review\.effort_score.*must be a boolean/.test(w))).toBe(true); }); - it("parses review.test_generation (default OFF), marks present, round-trips, and warns on a non-boolean (#1972)", () => { - expect(parseFocusManifest({ review: { test_generation: true } }).review.testGeneration).toBe(true); - const on = parseFocusManifest({ review: { test_generation: true } }); - expect(on.review.present).toBe(true); // a test-generation-only manifest IS present - expect(parseFocusManifest({ review: reviewConfigToJson(on.review) }).review).toEqual(on.review); // survives round-trip - // Explicit false is retained (and marks present, since the maintainer set it). - const off = parseFocusManifest({ review: { test_generation: false } }); - expect(off.review.testGeneration).toBe(false); - expect(off.review.present).toBe(true); - // Absent ⇒ null (the byte-identical default), config not present. - expect(parseFocusManifest({ review: {} }).review.testGeneration).toBeNull(); - // A non-boolean is ignored with a warning. - const bad = parseFocusManifest({ review: { test_generation: "yes" } }); - expect(bad.review.testGeneration).toBeNull(); - expect(bad.warnings.some((w) => /review\.test_generation.*must be a boolean/.test(w))).toBe(true); - }); - it("parses review.impact_map (default OFF), marks present, round-trips, and warns on a non-boolean (#2184)", () => { expect(parseFocusManifest({ review: { impact_map: true } }).review.impactMap).toBe(true); const on = parseFocusManifest({ review: { impact_map: true } }); @@ -3230,13 +3211,6 @@ describe("resolveReviewPathInstructions (#review-path-instructions)", () => { expect(resolveReviewPromptOverrides(parseFocusManifest({})).inlineCommentsPerCategory).toBeNull(); }); - it("resolves review.test_generation's manifest toggle to a strict boolean (#2189)", () => { - expect(resolveTestGenerationManifestToggle(null)).toBe(false); // null manifest (load failure) ⇒ false - expect(resolveTestGenerationManifestToggle(parseFocusManifest({}))).toBe(false); // absent ⇒ false - expect(resolveTestGenerationManifestToggle(parseFocusManifest({ review: { test_generation: false } }))).toBe(false); - expect(resolveTestGenerationManifestToggle(parseFocusManifest({ review: { test_generation: true } }))).toBe(true); - }); - it("resolves review.memory's manifest toggle to a strict boolean (#2179)", () => { expect(resolveReviewMemoryManifestToggle(null)).toBe(false); // null manifest (load failure) ⇒ false expect(resolveReviewMemoryManifestToggle(parseFocusManifest({}))).toBe(false); // absent ⇒ false diff --git a/test/unit/signals-coverage.test.ts b/test/unit/signals-coverage.test.ts index 2d90a7a396..9ba69cdaa8 100644 --- a/test/unit/signals-coverage.test.ts +++ b/test/unit/signals-coverage.test.ts @@ -1138,7 +1138,7 @@ describe("signal coverage edge cases", () => { collisions: buildCollisionReport(directRepo.fullName, [], [currentPr]), preflight: buildPreflightResult({ repoFullName: directRepo.fullName, title: "Fix isolated issue", body: "Fixes #99", linkedIssues: [99] }, directRepo, [], [currentPr]), settings: gateSettings, - review: { present: true, footerText: "Reviewed by the Acme maintainer bot.", note: "Run npm test before pushing.", fields: { relatedWork: false }, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, testGeneration: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { blockers: null, nits: null }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { skipDrafts: null, ignoreAuthors: [], ignoreTitleKeywords: [], skipLabels: [], skipDocsOnly: null, maxAddedLines: 0, maxFiles: 0, baseBranches: [], autoPauseAfterReviewedCommits: null }, labelingRules: [], aiModel: { claudeModel: null, claudeEffort: null, codexModel: null, codexEffort: null, ollamaModel: null, openaiModel: null, openaiCompatibleModel: null, anthropicModel: null }, visual: { preview: { urlTemplate: null }, routes: { paths: [], maxRoutes: null }, themes: [], gif: false, enabled: null }, linkedIssueSatisfaction: null, sharedConfigSource: null }, + review: { present: true, footerText: "Reviewed by the Acme maintainer bot.", note: "Run npm test before pushing.", fields: { relatedWork: false }, enrichmentAnalyzers: {}, profile: null, tone: null, securityFocus: null, inlineComments: null, fixHandoff: null, autoMergeSummary: null, suggestions: null, changedFilesSummary: null, effortScore: null, impactMap: null, cultureProfile: null, selftune: null, reviewMemory: null, findingCategories: null, inlineCommentsPerCategory: null, minFindingSeverity: null, maxFindings: { blockers: null, nits: null }, commentVerbosity: null, pathInstructions: [], instructions: null, excludePaths: [], pathFilters: [], preMergeChecks: [], autoReview: { skipDrafts: null, ignoreAuthors: [], ignoreTitleKeywords: [], skipLabels: [], skipDocsOnly: null, maxAddedLines: 0, maxFiles: 0, baseBranches: [], autoPauseAfterReviewedCommits: null }, labelingRules: [], aiModel: { claudeModel: null, claudeEffort: null, codexModel: null, codexEffort: null, ollamaModel: null, openaiModel: null, openaiCompatibleModel: null, anthropicModel: null }, visual: { preview: { urlTemplate: null }, routes: { paths: [], maxRoutes: null }, themes: [], gif: false, enabled: null }, linkedIssueSatisfaction: null, sharedConfigSource: null }, aiReview: { notes: "The change is focused.\n\n**Nits (2)**\n- Add a test for the edge case.\n- Keep the validator helper scoped." }, }); expect(customizedComment).toContain("Reviewed by the Acme maintainer bot."); // custom footer lead diff --git a/test/unit/test-generation.test.ts b/test/unit/test-generation.test.ts deleted file mode 100644 index 79b4cde6e2..0000000000 --- a/test/unit/test-generation.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { isTestGenerationEnabled, shouldOfferTestGenerationSpec } from "../../src/review/test-generation"; - -describe("isTestGenerationEnabled (#2189)", () => { - it("is truthy-string gated and OFF by default", () => { - expect(isTestGenerationEnabled({})).toBe(false); - expect(isTestGenerationEnabled({ GITTENSORY_REVIEW_TEST_GENERATION: "true" })).toBe(true); - expect(isTestGenerationEnabled({ GITTENSORY_REVIEW_TEST_GENERATION: "on" })).toBe(true); - expect(isTestGenerationEnabled({ GITTENSORY_REVIEW_TEST_GENERATION: "false" })).toBe(false); - }); -}); - -describe("shouldOfferTestGenerationSpec (#2189)", () => { - const on = { GITTENSORY_REVIEW_TEST_GENERATION: "true" }; - it("requires BOTH gates: the per-repo manifest toggle AND the operator flag", () => { - expect(shouldOfferTestGenerationSpec(on, true)).toBe(true); - expect(shouldOfferTestGenerationSpec(on, false)).toBe(false); // manifest toggle off - expect(shouldOfferTestGenerationSpec(on, undefined)).toBe(false); // manifest toggle absent - expect(shouldOfferTestGenerationSpec({}, true)).toBe(false); // operator flag off - expect(shouldOfferTestGenerationSpec({}, false)).toBe(false); // both off - }); -}); diff --git a/worker-configuration.d.ts b/worker-configuration.d.ts index 24ad833367..1c8177255d 100644 --- a/worker-configuration.d.ts +++ b/worker-configuration.d.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -// Generated by Wrangler by running `wrangler types` (hash: 273aa035a633a16371217457cfc17ff6) +// Generated by Wrangler by running `wrangler types` (hash: 2c9ae2779b21d678e1d0399a18829278) // Runtime types generated with workerd@1.20260701.1 2026-05-28 nodejs_compat interface __BaseEnv_Env { DB: D1Database; @@ -19,7 +19,6 @@ interface __BaseEnv_Env { ADMIN_GITHUB_LOGINS: "JSONbored"; GITTENSORY_REVIEW_UNIFIED_COMMENT: "false"; GITTENSORY_REVIEW_INLINE_COMMENTS: "false"; - GITTENSORY_REVIEW_TEST_GENERATION: "false"; GITTENSORY_REVIEW_SAFETY: "false"; GITTENSORY_REVIEW_SCREENSHOTS: "false"; GITTENSORY_REVIEW_GROUNDING: "false"; @@ -89,7 +88,6 @@ declare namespace NodeJS { | "GITTENSORY_REVIEW_SAFETY" | "GITTENSORY_REVIEW_SCREENSHOTS" | "GITTENSORY_REVIEW_SELFTUNE" - | "GITTENSORY_REVIEW_TEST_GENERATION" | "GITTENSORY_REVIEW_UNIFIED_COMMENT" | "GITTENSORY_SWEEP_WATCHDOG" | "PUBLIC_API_ORIGIN" diff --git a/wrangler.jsonc b/wrangler.jsonc index 9f40294548..5d673cee9e 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -47,11 +47,6 @@ // the decision summary. Requires the repo in GITTENSORY_REVIEW_REPOS AND review.inline_comments in its // .gittensory.yml. Default OFF — flag-OFF the model is never asked for inline findings (byte-identical). "GITTENSORY_REVIEW_INLINE_COMMENTS": "false", - // Boundary-safe test generation (#2189, config slice of #1972): when a missing-test-evidence finding fires, - // also offer a gittensory_generate_tests local-write action spec (criteria supplied by gittensory, executed - // by the contributor's own agent). Requires the repo's .gittensory.yml to also set - // review.test_generation: true. Default OFF — flag-OFF no spec is ever built (byte-identical). - "GITTENSORY_REVIEW_TEST_GENERATION": "false", // Convergence (safety): run the ported safety scan in the review path — defang untrusted PR // title/body/diff before the AI reviewer sees it, and surface a secret-leak blocker from the diff. // Default OFF — flag-OFF keeps the review path byte-identical.