Repository navigation
Temper path likelihood by graph coverage freshness - #41
Merged
Merged
Conversation
Completion item 3 from the re-review
(~/Documents/Testing/plans/2026-10-27-predictive-completion.md): an
account whose coverage is older than the collector cadence now scores
lower — deterministically and visibly — instead of silently confident.
- Coverage becomes the fifth likelihood factor. The level vocabulary,
thresholds and grading move to packages/risk-engine/src/coverage.ts
as the single source of truth (the API's coverage statements grade
with the same function); the level scales the product — aging x 0.8,
stale x 0.5 — and rides along in likelihoodFactors. unknown (nothing
collected yet, or a failed read) is deliberately NOT discounted: the
surfaces label it in words, so a fresh install is not punished while
a provably old graph can never look confident.
- The rule runner resolves the level once per run (newest SUCCEEDED
resource-inventory CollectionCoverage completion, bounded at 5000 and
failure-tolerant), passes it into every path likelihood and stamps
metadata.coverageLevel on issues it creates or refreshes. Direct
runRule calls (tests) carry no level, unchanged behavior.
- The attack-path explorer tempers its likelihoods the same way and now
returns the coverage statement beside `truncated`; the fix simulation
tempers its worst-likelihood ranking from the statement it already
computed.
- The UI finally states coverage where results appear: the explorer
shows the note under its results, the fix panel under the edge
ranking, the scenario card after a run, and the issue page labels the
graph coverage the issue was scored against ("— the path likelihood
is tempered down" for aging/stale). This also lands the display item
PR #39 described.
- API/UI types (CoverageLevel re-exported from the engine), tests for
grading boundaries, tempering math, runner tolerance and stamps, API
tempering, and each UI note; ARCHITECTURE/README/CHANGELOG.
Why this is safe: tempering is a deterministic function of evidence
already collected, only ever lowers a likelihood, and defaults to
unchanged behavior when no level is known; the runner read is bounded
and failure-tolerant (unknown, labelled, never a failed run).
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
Completion item 3 from the re-review (
~/Documents/Testing/plans/2026-10-27-predictive-completion.md): an account whose coverage is older than the collector cadence now scores lower — deterministically and visibly — instead of silently confident. 20 files, +519/−176.Likelihood gains its fifth factor: coverage
packages/risk-engine/src/coverage.tsas the single source of truth (the API's coverage statements from Label issues with independent-detector corroboration and state coverage #39 now grade with the same function — no drift)aging× 0.8,stale× 0.5,fresh× 1, and rides along inlikelihoodFactors.coverageunknown(nothing collected yet, or a failed read) is deliberately not discounted — surfaces label it in words, so a fresh install isn't punished while a provably old graph can never look confidentThreading
resource-inventorycompletion, bounded at 5000, failure-tolerant) and stampsmetadata.coverageLevelon created/refreshed issues; directrunRulecalls (tests) carry no level — unchanged behaviortruncated; fix simulation tempers its worst-likelihood rankingUI — coverage is stated where results appear: explorer note under results, fix panel note under the ranking, scenario card note after a run, and the issue page labels the scored graph ("— the path likelihood is tempered down" for aging/stale). This also lands the display PR #39 described.
Why this is safe
unknown, labelled, never a failed run)Test plan
npx jest --runInBand— 20 projects / 1823 tests passed (new: grading boundaries, tempering math incl. exact 0.125 case, runner grading/tolerance/stamps, API tempering via stale fixture, UI notes on explorer/fix panel/scenario/issue page)npm run typecheck; full workspace lint;npm run format:checknpm run ci:build;npm run package:lambdassmoke