Add built-in hard reject for projects with zero uploaded files
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

Projects with no files are now automatically rejected before AI
screening runs, regardless of whether a DOCUMENT_CHECK rule is
configured. This prevents the AI from incorrectly passing projects
that have no supporting documents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 22:31:46 +01:00
parent 04c54b6794
commit 1c68512598

View File

@@ -796,6 +796,19 @@ export async function executeFilteringRules(
let hasFailed = false
let hasFlagged = false
// Built-in hard check: projects with zero files always fail
const fileCount = project.files?.length ?? 0
if (fileCount === 0) {
ruleResults.push({
ruleId: '__builtin_zero_files',
ruleName: 'Required Documents Check',
ruleType: 'DOCUMENT_CHECK',
passed: false,
action: 'REJECT',
})
hasFailed = true
}
for (const rule of nonAiRules) {
let result: { passed: boolean; action: 'PASS' | 'REJECT' | 'FLAG' }
if (rule.ruleType === 'FIELD_BASED') {