Skip to content

Temper path likelihood by graph coverage freshness - #41

Merged
therandomsecurityguy merged 1 commit into
mainfrom
dac/predictive-freshness-tempering
Oct 28, 2026
Merged

therandomsecurityguy merged 1 commit into
mainfrom
dac/predictive-freshness-tempering

Conversation

@therandomsecurityguy

Copy link
Copy Markdown
Owner

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

  • Level, thresholds and grading move to packages/risk-engine/src/coverage.ts as 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)
  • The level scales the product: aging × 0.8, stale × 0.5, fresh × 1, and rides along in likelihoodFactors.coverage
  • unknown (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 confident

Threading

  • Rule runner resolves the level once per run (newest SUCCEEDED resource-inventory completion, bounded at 5000, failure-tolerant) and stamps metadata.coverageLevel on created/refreshed issues; direct runRule calls (tests) carry no level — unchanged behavior
  • Explorer tempers per-path likelihoods and returns the statement beside truncated; fix simulation tempers its worst-likelihood ranking

UI — 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

  • 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's coverage read is bounded and failure-tolerant (unknown, labelled, never a failed run)
  • No new IAM, endpoints, or storage; the API computes the same statement it already exposed

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:check
  • npm run ci:build; npm run package:lambdas smoke

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).
@therandomsecurityguy
therandomsecurityguy merged commit 82527b1 into main Oct 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant