fix: keep an absent DriftScore null instead of 0 - #330
Closed
vibgrate-team wants to merge 1 commit into
Closed
vibgrate-team wants to merge 1 commit into
vibgrate-team wants to merge 1 commit into
Conversation
An unscored scan stored DriftScore 0, which reads as no drift. Unmeasured components and an overall score with nothing to measure now stay null in the report and JSON. A computed score, including a real 0, is unchanged, and --drift-budget skips the comparison when the score is absent. Fixes #160 Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
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.
Summary
An unscored scan used to report DriftScore 0 and low risk — the same result as a fully current tree. A missing score now stays absent:
vg scan --format jsonand.vibgrate/scan_result.json) stores"score": nulland null component fields.riskLevelisnone, notlow.--drift-budgetand a configured drift budget skip the comparison when the score is absent and do not fail the scan. The CLI says the score is absent. A measured score over budget still fails.Fixes #160
Commands exercised
Before the change,
computeDriftScore([])returnedscore: 0andriskLevel: "low", and each component was drift 0 because a missing health value was filled in as 100 and inverted.After the change:
pnpm dev scan /tmp/absent-scan --format json --no-graph --no-local-artifacts --offline --quieton an empty directory prints"score": null, null components,"measured": [], and"riskLevel": "none". The progress line isComputing drift score · absent.pnpm dev scan /tmp/empty-pkg --format text --no-graph --no-local-artifacts --offline --drift-budget 0on apackage.jsonwith no runtime and no dependencies printsDriftScore: n/aandRuntime/Frameworks/Dependencies/EOL Risk: n/a, exits 0, and writesDriftScore is absent; --drift-budget was not applied.Checklist
pnpm testpasses (4906 tests)pnpm lintis clean (no new warnings)pnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)git commit -s, DCO)Notes for reviewers
Weights and the health-to-drift inversion are unchanged for components that were measured. Only the absent path changed: null stays null instead of being stored as drift 0.