test(mt#1263): Add runReview sanitize wiring integration tests#774
Open
minsky-ai[bot] wants to merge 1 commit into
Open
test(mt#1263): Add runReview sanitize wiring integration tests#774minsky-ai[bot] wants to merge 1 commit into
minsky-ai[bot] wants to merge 1 commit into
Conversation
Three end-to-end tests exercise runReview with mocked dependencies via mock.module() and a stub-container indirection pattern (property reassignment on const stubs object avoids both no-const-assign and no-jest-patterns lint): 1. stripped: submitReview receives sanitized.body not raw output.text; event parsed from stripped body; reason contains [cot-leakage: stripped] 2. errored: submitReview receives error-notice body; event forced to COMMENT; status=error with no review field; submitReview failure does not propagate 3. passthrough: submitReview receives raw output.text; no cot_leak_detected console.log emitted Mutation-test: replacing sanitized.body with output.text in review-worker.ts caused cases 1 and 2 to fail. Passthrough passes correctly because output.text IS the passthrough body. Mutation reverted before commit. Also adds allowInFiles exception for review-worker.test.ts in the no-global-module-mocks ESLint rule, since the reviewer service has no DI infrastructure and mock.module() is the only available test seam for runReview.
There was a problem hiding this comment.
Independent adversarial review (Chinese-wall)
Reviewer: minsky-reviewer[bot] via openai:gpt-5
Tier: unknown
reviewer-service error: chain-of-thought leakage detected
The upstream model emitted raw internal reasoning into the review body. The reviewer service sanitised the output but could not locate a valid Findings section to preserve, so the leaked content was discarded. The PR will receive a fresh review on the next commit. See docs/architecture/critic-constitution-reliability.md for details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds integration tests for the runReview sanitize wiring from mt#1212 / PR #758. Four end-to-end test cases cover the three SanitizeResult.action values through mock.module() stubs.
Key Changes
Testing
50/50 tests pass. Mutation test confirmed: replacing sanitized.body with output.text caused cases 1 and 2 to fail. Mutation reverted before commit.
Had Claude implement this; AI-authored code.