Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2717,8 +2717,9 @@ function executionOnlyLimitation(value: string): boolean {
export function expectedReviewScopeStatement(value: string): boolean {
const describesExpectedScope = /\b(?:bounded(?: review)? scope|bounded review instructions?|review(?:ed)? (?:was |is )?bounded to|reviewed only the changed files?|limited to (?:the )?(?:supplied )?change set)\b/i.test(value)
&& /\b(?:changed files?|change set|supporting context|agent guidance|AGENTS\.md)\b/i.test(value);
const explicitlyDeniesMaterialLimitation = /\bno material limitations?\b/i.test(value);
const reportsMaterialConstraint = /\b(?:unable|could not|couldn't|missing|truncated|unavailable|uncertain|incomplete|not provided|not supplied|failed to inspect|relevant (?:dependency|file|context).{0,30}(?:not|missing|unavailable))\b/i.test(value);
return describesExpectedScope && !reportsMaterialConstraint;
return (describesExpectedScope || explicitlyDeniesMaterialLimitation) && !reportsMaterialConstraint;
}

export function trustedValidationFindings(task: JsonObject, receipts: JsonObject[]): JsonObject[] {
Expand Down
6 changes: 6 additions & 0 deletions tests/webhook-adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,12 @@ test("distinguishes expected bounded review scope from material limitations", ()
assert.equal(expectedReviewScopeStatement(
"High confidence; the review was bounded to the supplied changed files plus directly relevant supporting context, and no material limitation remains.",
), true);
assert.equal(expectedReviewScopeStatement(
"High confidence. The changed file is directly malformed, and the failure is independently corroborated by syntax checking; no material limitation.",
), true);
assert.equal(expectedReviewScopeStatement(
"No material limitation, but relevant dependency context was unavailable.",
), false);
assert.equal(expectedReviewScopeStatement(
"I reviewed only the changed file because relevant dependency context was unavailable.",
), false);
Expand Down
Loading