Repository navigation
Add risk windows, exposure series and trust-center projections (long tail, part 2) - #44
Merged
Merged
Conversation
Completion item 5 part 2 (the long tail) from the re-review (~/Documents/Testing/plans/2026-10-27-predictive-completion.md), which completes the plan. Per-issue risk windows: - New engine module slo.ts: an SLA window per severity (critical 7d, high 30, medium 90, low 180) with age, burn, state (ok/burning at 80%/ breached) and days-to-breach derived deterministically from createdAt. - Open issues expose it on read — GET /issues and /issues/:id compute it from the row, nothing stored — the list marks burning and breached findings and the Status card states the window. Two new trend series (snapshotTrends): - sloBurning: findings past 80% of their window, split by severity plus the breached count — derived from the open issues the snapshot already reads, no extra query. - exposedByType: internet-exposed vertices grouped by label — one bounded label-only read capped at 2000 with an explicit truncation flag, answering the cost objection with a bound instead of a skip. - Both flow through the trends route with sanitized samples (25-type cap, label-shaped keys) and appear on the Trends page. Trust-center projections: - While the reconciliation record is OK, the publishable response attaches compact series projections (metric id, per-day slope, confidence, basis/horizon, 30-day value) for open findings, backlog risk and SLO burn, sharing one forecaster with the trends route (extracted to services/trend-forecast.ts). - The sync layer maps fixed metric ids to reviewed public labels, drops unknown metrics and out-of-range values, and the sanitization tripwires still scan the whole fragment; the page renders "Where the posture is heading". STALE/MISSING publishes nothing; unreadable trends omit projections without failing the response. Why this is safe: every new number is derived from data already read (creation dates) or bounded by an explicit cap with a truncation flag; projections ride the existing publishable gate (OK only) and cross the sanitization tripwires, whose only public wording comes from fixed labels in the sync layer, never from an API response; no new write surface and no identifiers.
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 5, part 2 of 2 — this completes the predictive completion plan (
~/Documents/Testing/plans/2026-10-27-predictive-completion.md). 30 files, +847/−61.Per-issue risk windows
slo.ts: SLA window per severity (critical 7d, high 30, medium 90, low 180); age/burn/state/days-to-breach derived deterministically fromcreatedAtGET /issues,/issues/:id— nothing stored); list marks burning/breached, Status card states the windowTwo new trend series
sloBurning: findings past 80% of their window, by severity + breached count — derived from the open issues the snapshot already reads (no extra query)exposedByType: internet-exposed vertices by label — one bounded label-only read, cap 2000 + truncation flag (the cost objection answered by bound)Trust-center projections
OK, the publishable response attaches compact projections (metric id, per-day slope, confidence, basis/horizon, 30-day value) for open findings, backlog risk, SLO burn — one shared forecaster with the trends route (services/trend-forecast.ts)Why this is safe
Test plan
npx jest --runInBand— 20 projects / 1878 tests passed (new: SLO math + boundaries, runner sloBurning/exposure series, trends sample sanitizers, publishable projections gating + fail-closed, sync label mapping + junk rejection, render section, UI list/detail)npm run typecheck; full workspace lint;npm run format:checknpm run ci:build;npm run package:lambdas; terraform fmt unchanged; chart untouched