feat(reports): Remediation Activity kind (Phase C2)#658
Merged
Conversation
Add the 'remediation' report kind: an Operations read-model of remediation
requests over a look-back window, the second Phase C delivery-spine kind.
- Migration 0045 admits kind='remediation'.
- GenerateRequest gains period_days (1..365, default 30, clamped);
Generate(kind=remediation) resolves [now-period_days, now] and freezes a
RemediationContent {period_from, period_to, summary, activities[]} over
remediation_requests filtered on requested_at, scoped to the in-scope
hosts. The summary is an exact aggregate by outcome (total, executed,
rolled_back, failed, rejected, pending); activities[] is one capped row
per request with requester/reviewer resolved to usernames.
- Faces: CSV is the full activity log (csvSafe-guarded), PDF is the bounded
one-page summary (counts + recent sample), JSON is the signed canonical
content. pdf/csv kind-dispatched; oscal_sar invalid for the kind.
- Frontend: kind selector gains 'Remediation Activity'; a Last 7/30/90 days
period selector shows for the kind and drives period_days; a kind-aware
RemediationBody renders the period + outcome summary + recent-activity
table; CSV-led with a PDF-summary secondary.
Spec: api-reports v1.13.0 (C-18 / AC-24), frontend-reports v1.10.0
(C-13 / AC-14). Go DB test (5-request window fixture) + frontend
source-inspection test; full suites green (report pkg, frontend 336,
specter 112 + 100% structural).
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
Phase C2 adds the
remediationreport kind — an Operations read-model of remediation requests over a look-back window, the second Phase C delivery-spine kind.What it does
kind='remediation'.period_days(1..365, default 30, clamped).Generate(kind=remediation)resolves[now - period_days, now]and freezes aRemediationContent {period_from, period_to, summary, activities[]}overremediation_requestsfiltered onrequested_at, scoped to the in-scope hosts:total / executed / rolled_back / failed / rejected / pending).csvSafe-guarded), PDF is the bounded one-page summary (counts + recent sample), JSON is the signed canonical content.pdf/csvkind-dispatched;oscal_sarinvalid for the kind.period_days; a kind-awareRemediationBodyrenders the period + outcome summary + recent-activity table; CSV-led with a PDF-summary secondary.Spec / tests
api-reportsv1.13.0 (C-18 / AC-24 — Go DB test over a 5-request window fixture; verifies the out-of-window request is excluded and the ~30-day period).frontend-reportsv1.10.0 (C-13 / AC-14 — source-inspection over the selector, period control, andRemediationBody).gofmt/vet/buildclean;go test ./internal/report/green;tsc/eslint/prettierclean; fullvitest336 passed;specter check112 specs + structural coverage 100%.Phase C sequencing
This is C2. The remaining slice is C3 — Scheduled dispatcher + email delivery, the product-design-heavy one I'll scope with you before building (recurrence semantics, delivery channels).
Validation