Skip to content

feat(activity): human-readable titles for compliance/intelligence/audit legs (Phase 0)#616

Merged
remyluslosius merged 1 commit into
mainfrom
feat/activity-readable-legs
Jun 20, 2026
Merged

feat(activity): human-readable titles for compliance/intelligence/audit legs (Phase 0)#616
remyluslosius merged 1 commit into
mainfrom
feat/activity-readable-legs

Conversation

@remyluslosius

Copy link
Copy Markdown
Contributor

Phase 0 of the activity readability initiative (docs/engineering/activity_readability_plan.md).

The unified /api/v1/activity feed already built proper sentences for the
alert + monitoring legs, but handed the UI raw machine codes for the
other three. Now every leg emits a human title/summary, built in Go after
the single UNION (the one-Query property is preserved).

Leg Before After
Compliance CIS.6.1.1 rule catalog title + "Changed: now Fail"
Intelligence system.package.updated "Package updated" + "curl: 7.64 → 7.81" (from the detail JSONB)
Audit auth.login.failure + UUID "Anonymous failed to sign in"
  • Compliance title resolves via an injected RuleTitleFunc (nil-safe; falls
    back to the rule id). The transactions table keeps only the new status, so
    the summary says "now ", never a fake "X → Y".
  • Audit renders <actor> <predicate> from actor_label + an action map; the
    raw resource UUID is no longer in the headline.
  • Graceful fallback: an unmapped code humanizes structurally
    (dots → spaces) so a newly-added code can never leak as a raw dotted enum.

This makes /activity, the dashboard widget, and host-detail Recent Activity
readable immediately (they already render title/summary) — no frontend
change needed.

Verified live in the browser: every row is a sentence, no codes/UUIDs.

Spec: system-activity v1.2.0 (C-09, AC-24 unit / AC-25 fallback / AC-26
integration). Full activity suite + specter (111) green.

Note: the feed is dominated by scheduler.tick.dispatched (~7k rows) and
system.package.installed (~7k) — readable now, but a strong signal for
Phase 4 (grouping/dedup) and a taxonomy question (should scheduler ticks
be audit events at all?).

…it legs (Phase 0)

system-activity v1.2.0 (C-09, AC-24/25/26). First phase of the activity
readability initiative (docs/engineering/activity_readability_plan.md).

The unified feed built proper sentences for alerts + monitoring but handed
the UI raw machine codes for the other three legs. Now every leg emits a
human title/summary, built in Go after the single UNION (the one-Query
property is preserved):

- Compliance: rule_id -> catalog title via an injected RuleTitleFunc;
  summary 'Changed: now Fail' / 'First seen: Pass' (transactions retains
  only the new status, so no fake 'X -> Y').
- Intelligence: event_code -> description ('Package updated'); summary
  derived generically from the detail JSONB ('curl: 7.64 -> 7.81').
- Audit: '<actor> <predicate>' from actor_label + an action map
  ('alice@example.com created a host'); the resource UUID is no longer in
  the headline.

Unmapped codes humanize structurally (dots -> spaces) so a new code can
never leak as a raw dotted enum. Alert + monitoring legs unchanged.

This makes /activity, the dashboard widget, and host-detail Recent Activity
readable immediately (they already render title/summary).
@remyluslosius remyluslosius merged commit a549131 into main Jun 20, 2026
13 checks passed
@remyluslosius remyluslosius deleted the feat/activity-readable-legs branch June 20, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant