Skip to content

feat(reports): Remediation Activity kind (Phase C2)#658

Merged
remyluslosius merged 1 commit into
mainfrom
feat/reports-c2-remediation-activity
Jun 22, 2026
Merged

feat(reports): Remediation Activity kind (Phase C2)#658
remyluslosius merged 1 commit into
mainfrom
feat/reports-c2-remediation-activity

Conversation

@remyluslosius

Copy link
Copy Markdown
Contributor

Summary

Phase C2 adds the remediation report kind — an Operations read-model of remediation requests over a look-back window, the second Phase C delivery-spine kind.

What it does

  • Migration 0045 admits kind='remediation'.
  • The generate request 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:
    • summary is an exact aggregate by outcome (total / executed / rolled_back / failed / rejected / pending).
    • activities[] is one capped row per request (host, rule, status, mechanism, requester + reviewer usernames, requested/reviewed timestamps).
  • 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: the kind selector gains Remediation Activity; a Last 7 / 30 / 90 days period selector appears for that 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 / tests

  • api-reports v1.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-reports v1.10.0 (C-13 / AC-14 — source-inspection over the selector, period control, and RemediationBody).
  • gofmt/vet/build clean; go test ./internal/report/ green; tsc/eslint/prettier clean; full vitest 336 passed; specter check 112 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

  • gofmt / vet / build / go test
  • tsc / eslint / prettier / vitest (336)
  • specter check + structural coverage (100%)

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).
@github-actions github-actions Bot added documentation Improvements or additions to documentation frontend tests size/XL labels Jun 22, 2026
@remyluslosius remyluslosius merged commit 2ce3100 into main Jun 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend size/XL tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant