Repository navigation
Flag implausible scout reports and exclude them from analysis - #86
jackshim415 wants to merge 4 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🚅 Deployed to the lovat-pr-86 environment in lovat
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cd08a0172
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
What changed
Implausible scout reports can distort team averages, predictions, and exports. Add report reliability states with an
UNVERIFIEDdefault, automatically flag native and Dashboard uploads above 800 total points, and flag unverified reports whose scored-ball count exceeds their alliance's completed official score during match imports. Verified reports are protected from automatic flagging; user flags and bad reports are preserved.Computed analysis includes only verified and unverified reports, including raw SQL, nested report queries, timelines, CSV exports, and match results. The scouting lead management list retains every reliability state and exposes that state so flagged reports can still be inspected and deleted. Cached match refreshes check late uploads, and newly flagged reports invalidate analysis cache registrations so stale results are recalculated.
Also repair the website preview build: use the repository root in the PR environment and install the existing pinned Magnolia commit as an archive, avoiding npm Git dependency preparation failures. Add coverage for excluded report autonomous paths to satisfy the existing 100% per-file coverage requirement.
Areas affected
Shared database schema/migration and match import worker are also affected.
Contracts and data
Adds
ScoutReport.reliabilityand theReportReliabilityenum. Existing reports become unverified. Upload payloads remain compatible, and source-team/tournament predicates remain in place.Verification
packages/db:npm run db:validate,npm run build, andnpm run db:deployagainst a new disposable local database passed.apps/server:npm run build,npm run typecheck,npm run typecheck:test, andnpm testpassed (1,064 unit tests).apps/server:npm run test:integration -- test/analysisMetrics.integration.test.ts test/analysisCache.integration.test.tspassed with disposable PostgreSQL/Redis (113 tests).apps/server:npm run lintpassed with 80 existing warnings and no errors.apps/worker:npm run typecheckandLOVAT_DB_TEST=1 bun testpassed against the disposable database (57 tests)../scripts/check-structure.shandgit diff --checkpassed.Coverage includes the 800-point boundary, climb points, exclusion of feeding quantities, fresh and cached imports, alliance-specific scores, verified-report immunity, flagged/bad outliers in real database analysis, and invalidated Redis cache registrations.
Additional verification after the CI fixes: unit-only coverage passes all 1,069 tests at 100% after the review fixes; the full Server unit/integration coverage suite passed all 1,242 tests at 100% before those fixes; Website Node 20.19.6 clean
npm ci,npm run build,npm run check(0 errors, 13 warnings), andnpm run lint(0 errors, 19 warnings) pass.Deployment
Apply
20261018000000_add_report_reliabilitythrough the existing database migration owner before deploying the updated server and worker. Analysis cache keys move from v2 to v3; worker flagging invalidates registered analysis caches. The PR website environment now uses repository root/, Dockerfileapps/website/Dockerfile, and website/changelog watch paths. The Website preview deployed successfully and its/healthzreturnedok. Production hosting settings and environment variables are unchanged. Migration was applied locally only to a disposable database; the API preview also deployed successfully through its existing migration flow.