Skip to content

Fix CotabbyTests build broken by #499 (summarizer test scaffolding)#500

Merged
FuJacob merged 1 commit into
mainfrom
experimental/m2-fix-tests
Jun 1, 2026
Merged

Fix CotabbyTests build broken by #499 (summarizer test scaffolding)#500
FuJacob merged 1 commit into
mainfrom
experimental/m2-fix-tests

Conversation

@FuJacob
Copy link
Copy Markdown
Owner

@FuJacob FuJacob commented Jun 1, 2026

#499 deleted VisualContextSummarizing but ScreenshotContextGeneratorTests still referenced it via StubSummarizer, breaking the test-target compile (Cannot find type 'VisualContextSummarizing'). A local incremental build-for-testing falsely passed by not recompiling the unchanged test file; CI's clean build caught it. This removes the summarizer stubs + the three summary-path tests and keeps the OCR cap/sanitize + all-noise-unavailable tests (still satisfied by the normalizeRecognizedText pass after OCRTextHygiene). Un-breaks main.

Greptile Summary

Removes dead test scaffolding left over after PR #499 deleted VisualContextSummarizing — specifically the StubSummarizer class, StubSummarizerError, and three tests that exercised the summarizer code path, all of which would cause a compile error on a clean build.

  • StubSummarizer: VisualContextSummarizing and its Result enum are deleted; makeGenerator loses its summaryResult parameter to match the updated ScreenshotContextGenerator.init.
  • The three summarizer-path tests are removed (good summary wins, empty-summary fallback, thrown-error fallback); the two remaining tests — OCR cap/sanitize and all-noise-unavailable — continue to exercise the live pipeline and are unaffected.

Confidence Score: 5/5

Test-only deletion that removes code referencing a type that no longer exists; no production logic is touched.

The change is purely subtractive in the test target: dead stubs and the tests that relied on them are gone, and the two surviving tests still build against and exercise the current production initializer. Nothing is added that could introduce a regression.

No files require special attention.

Important Files Changed

Filename Overview
CotabbyTests/ScreenshotContextGeneratorTests.swift Removes StubSummarizer, StubSummarizerError, and three summarizer-path tests; trims makeGenerator signature to match the updated ScreenshotContextGenerator initializer. Two OCR tests remain intact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[generateContext] --> B[captureScreenshot]
    B --> C[textExtractor.extractText]
    C -->|noRecognizedText| D{windowTitle?}
    D -->|nil| E[throw .unavailable]
    D -->|exists| F[normalizeRecognizedText]
    F --> G{hasMeaningfulSignal?}
    G -->|no| E
    G -->|yes| H[boundedSummaryText → VisualContextExcerpt]
    C -->|success| I[OCRTextHygiene.clean]
    I --> J[normalizeRecognizedText]
    J --> K[boundedSummaryText]
    K --> L{hasMeaningfulSignal?}
    L -->|no| E
    L -->|yes| M[return VisualContextExcerpt]

    subgraph Tests["Remaining Tests (PR #500)"]
        T1[test_ocrTextIsCappedAndSanitized]
        T2[test_allNoiseOCRReturnsUnavailable]
    end

    subgraph Removed["Removed Tests (PR #500)"]
        R1[test_usesGoodSummaryWhenAvailable]
        R2[test_emptySummaryFallsBack]
        R3[test_thrownSummarizerErrorFallsBack]
    end
Loading

Reviews (1): Last reviewed commit: "Fix CotabbyTests build: drop summarizer ..." | Re-trigger Greptile

…#499)

#499 deleted the VisualContextSummarizing protocol but left ScreenshotContextGeneratorTests' StubSummarizer + summary-path tests referencing it, breaking the test-target build. (A local incremental build-for-testing skipped recompiling the unchanged test file and falsely passed; CI's clean build caught it.) Removes the summarizer stubs and the three summary-specific tests; keeps the OCR cap/sanitize and all-noise-unavailable tests, which the post-OCRTextHygiene normalizeRecognizedText path still satisfies.
@FuJacob FuJacob merged commit 78124f6 into main Jun 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant