@@ -14,6 +14,7 @@ import {
1414 createFreshTaskAttemptDirectory ,
1515 createConfig ,
1616 createFollowupReviewTask ,
17+ finalizeReviewResult ,
1718 githubRequestAllPages ,
1819 handleRequest ,
1920 inspectRepairDiff ,
@@ -1759,6 +1760,27 @@ test("trusted validation derives findings only from failures mapped to verified
17591760 assert . deepEqual ( trustedValidationFindings ( task , [ trustedValidationReceipt ( ) ] ) , [ ] ) ;
17601761} ) ;
17611762
1763+ test ( "trusted failed receipts replace model execution disclaimers without hiding substantive limitations" , ( ) => {
1764+ const root = mkdtempSync ( join ( tmpdir ( ) , "coven-finalize-review-" ) ) ;
1765+ const resultPath = join ( root , "result.json" ) ;
1766+ const result = completeReview ( ) ;
1767+ ( result . review as JsonObject ) . limitations = [
1768+ "I did not execute the test suite locally." ,
1769+ "The supplied patch for another changed file was truncated." ,
1770+ ] ;
1771+ writeFileSync ( resultPath , JSON . stringify ( result ) ) ;
1772+ const task = reviewTask ( "finalize-failed-receipt" ) ;
1773+ const finalPath = finalizeReviewResult ( resultPath , root , [ trustedValidationReceipt ( {
1774+ returncode : 1 ,
1775+ status : "failed" ,
1776+ output_summary : "/workspace/src/app.ts:12 validation failed" ,
1777+ } ) ] , task ) ;
1778+ const finalized = JSON . parse ( readFileSync ( finalPath , "utf8" ) ) as JsonObject ;
1779+ const review = finalized . review as JsonObject ;
1780+ assert . deepEqual ( review . limitations , [ "The supplied patch for another changed file was truncated." ] ) ;
1781+ assert . equal ( ( review . findings as JsonObject [ ] ) . length , 1 ) ;
1782+ } ) ;
1783+
17621784test ( "replaces runtime-authored test claims with trusted host receipts" , async ( ) => {
17631785 const stateDir = tempStateDir ( ) ;
17641786 const config = testConfig ( stateDir ) ;
0 commit comments