Repository navigation
fix(judge): fail closed when an evaluation has no project scope - #1569
Open
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Open
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Conversation
The judge resolved criteria against the global scope when a run arrived without a projectId, silently evaluating against the wrong criteria. In REST mode the evaluate endpoint now returns 400 and evaluateWorkspace throws before touching a provider. The report-generator also fails a report with no projectId instead of fetching a template from project "undefined". Fixes microsoft#1303. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Naveen Chatlapalli (1aifanatic)
requested review from
Cedric Vidal (cedricvidal) and
Wassim Chegham (manekinekko)
as code owners
October 26, 2026 13:58
This branch has not been deployed
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.
Fixes #1303.
The coder queue processor already fails fast on a request with no
projectId. This PR covers the two remaining fail-open paths from the issue:CRITERIA_API_URLset), an evaluation withoutprojectIdfell back to the global criteria provider and could silently score a run against the wrong criteria.POST /api/v1/evaluatenow returns 400 whenprojectIdis missing or not a non-empty string.evaluateWorkspacealso throws before consulting any provider, as defense in depth for in-process callers. The single-tenant filesystem provider ignoresprojectId, so it stays optional in local dev.projectIdnow fails with an explicit error instead of fetching/report-templates/<id>?projectId=undefinedand reporting a confusing "template not found".RequestDocument.projectIdis already non-optional in the shared types.Documented in
docs/architecture/criteria-provider.mdunder Project scoping.Validation:
pnpm exec vitest run apps/judge/src/judge-agent.test.ts apps/workers/report-generator/src/report-queue-processor.test.ts(21 passed, 4 new);tsc --noEmitforjudgeandreport-generator;git diff --check.🤖 Generated with Claude Code