Repository navigation
fix(audit-engine): record not-evaluated page checks so carried pages score as in a full audit #2099 - #2170
Merged
Conversation
nc9
marked this pull request as ready for review
November 20, 2026 21:07
This was referenced Nov 20, 2026
…carried pages score as in a full audit #2099 Signed-off-by: Nik Cubrilovic <[email protected]>
…ore so CLI smart re-audits score carried pages as a full audit #2099 Signed-off-by: Nik Cubrilovic <[email protected]>
…and format #2099 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/carried-not-evaluated-2099
branch
from
November 21, 2026 11:16
d6696fc to
d4f8508
Compare
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.
Closes #2099 (option C, AC2 as reworded).
What changes
SitePageRecord.notEvaluated?: string[] | null(core-contracts): per page, theruleId|checkNamechecks the run that last crawled it could not evaluate there (e.g.perf/ttfbwith no timing data). Absent, null or empty reads as today.ruleId|*) entries are not recorded.countCarriedNotEvaluated(priorPages, carriedPageUrls)gives per rule the recorded (carried page, check) pairs. Because the record never overlaps rows, both the materialized path (buildScoringResultsFromMerged) and the chunked complete-store fold (cleanCarriedPasses) subtract that same count from the carried passes (rule total clamped at 0), using stored page rows alone. No further contract change.Acceptance criteria
tests/capped-rescore.test.ts"a 3-page re-run tallies perf/ttfb exactly as the full audit, as one POST and chunked" (single POST and both chunked drivers equal the full audit's tally, 45 passes) and the existing "a chunked publish stores every failing page..." now assertsttfbTally(afterChunked)equals the full audit's. Overall score tolerance stays at 1 with a comment naming info-only rules (pub#2167).Gates
packages/audit-engineandpackages/core-contracts:bun run typecheckclean (packages have no format/lint scripts; rootformat:checkandlintexit 0).bun run scripts/test-suites.ts --check: OK.tests/capped-rescore.test.ts: 35 pass, 0 fail.bun run scripts/test-suites.ts --run audit-engine: 2368 pass, 3 skip, 0 fail (247 files).bun run scripts/test-suites.ts --run rules: 12504 pass, 24 todo, 0 fail.bun scripts/changelog.ts check: OK.Notes
site_pagesneeds a nullable column written byupsertSitePagesand read bygetSitePages; an upsert without the field writes NULL. Until then the cloud store drops the field and scores as today. CLI local sqlite is unchanged (follows thecanonicalprecedent).Local sqlite store (a12e0c4)
The CLI's local smart re-audit (
runSmartAudits) now persists and reads the record too, so it scores carried pages exactly like the cloud.site_pages.not_evaluated TEXT, nullable JSON, migration 49 (SCHEMA_VERSION48 to 49) viaMIGRATIONSandrunMigrationsinpackages/crawler/src/storage/sqlite.ts. Also listed inSITE_PAGES_ALTER_COLUMNS, soreconcileColumnsre-adds it on a version-collided DB. Duplicate-column errors are swallowed, so it is idempotent.upsertSitePageswrites the JSON array, or NULL when absent (a full re-crawl clears an old record).getSitePagesselects named columns. NULL, malformed JSON or a non-string-array cell all read as nothing recorded, never a throw.runSmartAuditsreads the prior pages before the merge and passescountCarriedNotEvaluated(priorPages, carriedPageUrls)tobuildScoringResultsFromMerged.apps/cli/tests/audit/smart-audits-not-evaluated-2099.test.ts(6) covers:SELECT *by-name read work on a migrated DB.site_pagesinpages-alter-columns-guard.test.ts.test-suites.ts --checkpasses, as do both changelog checks. Suites:--run crawler1177 pass, 0 fail;--run audit-engine2369 pass, 0 fail;--run cli4579 pass, 0 fail.