Audit page: unified org-scoped timeline #1654

Closed
opened 2026-10-27 13:41:15 +00:00 by sam · 1 comment
Owner

Rework /settings/history into Audit: one server-filtered, cursor-paginated timeline over sys_audit (settings, access), identity_events, access_denials and runtime events; live tail via audit-head; CSV/JSON export; saved views; retention for observability events; redaction and missing audit writes on privilege paths. Plan: /home/sam/.claude/plans/https-archie-catlow-cloud-settings-histo-cryptic-whale.md


Imported from beads archie-core-wwhoz · GitHub #1879 · type epic · priority P1 · created 2026-10-25

Rework /settings/history into Audit: one server-filtered, cursor-paginated timeline over sys_audit (settings, access), identity_events, access_denials and runtime events; live tail via audit-head; CSV/JSON export; saved views; retention for observability events; redaction and missing audit writes on privilege paths. Plan: /home/sam/.claude/plans/https-archie-catlow-cloud-settings-histo-cryptic-whale.md --- _Imported from beads `archie-core-wwhoz` · GitHub #1879 · type epic · priority P1 · created 2026-10-25_
sam added the highepic labels 2026-10-27 13:41:15 +00:00
sam self-assigned this 2026-10-27 13:41:15 +00:00
Author
Owner

Triaged: no code change is needed for this. Issue #1654 (beads archie-core-wwhoz) is an epic that is already implemented and shipped in this repository — it landed in release 1.56.0 (2026-10-31), four days after the issue was filed, and the tree is now at 1.61.2. There is nothing left to build, and no design question outstanding.

Evidence, item by item against the issue body:

  • Unified org-scoped, server-filtered, cursor-paginated timeline: internal/infrastructure/postgres/queries/audit_feed.sql documents a parameterised UNION ALL over sys_audit (ranks 1 and 5), identity_events (rank 2), access_denials (rank 3) and runtime events (rank 4), with per-source filter pushdown and keyset cursors. Adapter at internal/infrastructure/postgres/auditfeed.go:35 (ListAudit with audit.Cursor, NextCursor).
  • Audit page replacing /settings/history: ui/src/audit/AuditPage.vue, routed at ui/src/router/index.ts:210 (/org/audit, nav label "Audit"), with /settings/history and /settings/audit redirecting to it (lines 411–412). Covering e2e checks already exist: audit-redirect.cjs, audit-filters.cjs, audit-runtime.cjs, audit-revert.cjs, audit-phone.cjs.
  • Live tail via audit-head: internal/webui/sse.go:91 publishes the audit-head topic; AuditPage.vue:110 subscribes; AuditHead query at audit_feed.sql:438.
  • CSV/JSON export: ui/src/audit/AuditExportMenu.vue (CSV and JSON), backed by the CountAudit export preflight at audit_feed.sql:451.
  • Saved views: ui/src/audit/audit.ts:465-497 (per-identity views in localStorage) with the round-trip check in e2e/checks/audit-views-export.cjs.
  • Retention for observability events: internal/infrastructure/postgres/audit_retention.go (PruneAuditEvents, records its own audit_retention/runtime_events sys_audit row), plus e2e/checks/audit-retention-live.cjs.
  • Redaction: every feed entry is redacted in auditfeed.go:168-251 via webhookguard.RedactPayload/RedactString, fail-closed on undecodable JSON; search_text deliberately excludes values.
  • Missing audit writes on privilege paths: access policy changes insert sys_audit rows (internal/infrastructure/postgres/queries/access.sql:63,90), and internal/domain/audit/audit.go:113 covers the audit coverage tables.

CHANGELOG.md:90 records it as shipped: "An org-scoped audit page with filters, a live tail, export and a retention setting; recorded access denials are kept for a set time and listed on their own page." (under 1.56.0.)

Not verified: the linked plan at /home/sam/.claude/plans/https-archie-catlow-cloud-settings-histo-cryptic-whale.md is outside /data/worktree and was not read, per the discovery scope. I also did not run the e2e suite; the claims above are from source, routing and changelog inspection.

Recommendation: close #1654 as already shipped. The only open judgement is whether the shipped saved views (client-side, per-identity localStorage) meet the intent of "saved views"; if the operator wants them server-side and shared per org, that is a new, smaller ticket, not this epic.

Triaged: no code change is needed for this. Issue #1654 (beads archie-core-wwhoz) is an epic that is already implemented and shipped in this repository — it landed in release 1.56.0 (2026-10-31), four days after the issue was filed, and the tree is now at 1.61.2. There is nothing left to build, and no design question outstanding. Evidence, item by item against the issue body: - Unified org-scoped, server-filtered, cursor-paginated timeline: `internal/infrastructure/postgres/queries/audit_feed.sql` documents a parameterised UNION ALL over sys_audit (ranks 1 and 5), identity_events (rank 2), access_denials (rank 3) and runtime `events` (rank 4), with per-source filter pushdown and keyset cursors. Adapter at `internal/infrastructure/postgres/auditfeed.go:35` (`ListAudit` with `audit.Cursor`, `NextCursor`). - Audit page replacing /settings/history: `ui/src/audit/AuditPage.vue`, routed at `ui/src/router/index.ts:210` (`/org/audit`, nav label "Audit"), with `/settings/history` and `/settings/audit` redirecting to it (lines 411–412). Covering e2e checks already exist: audit-redirect.cjs, audit-filters.cjs, audit-runtime.cjs, audit-revert.cjs, audit-phone.cjs. - Live tail via audit-head: `internal/webui/sse.go:91` publishes the `audit-head` topic; `AuditPage.vue:110` subscribes; `AuditHead` query at `audit_feed.sql:438`. - CSV/JSON export: `ui/src/audit/AuditExportMenu.vue` (CSV and JSON), backed by the `CountAudit` export preflight at `audit_feed.sql:451`. - Saved views: `ui/src/audit/audit.ts:465-497` (per-identity views in localStorage) with the round-trip check in `e2e/checks/audit-views-export.cjs`. - Retention for observability events: `internal/infrastructure/postgres/audit_retention.go` (`PruneAuditEvents`, records its own `audit_retention`/`runtime_events` sys_audit row), plus `e2e/checks/audit-retention-live.cjs`. - Redaction: every feed entry is redacted in `auditfeed.go:168-251` via `webhookguard.RedactPayload`/`RedactString`, fail-closed on undecodable JSON; search_text deliberately excludes values. - Missing audit writes on privilege paths: access policy changes insert sys_audit rows (`internal/infrastructure/postgres/queries/access.sql:63,90`), and `internal/domain/audit/audit.go:113` covers the audit coverage tables. CHANGELOG.md:90 records it as shipped: "An org-scoped audit page with filters, a live tail, export and a retention setting; recorded access denials are kept for a set time and listed on their own page." (under 1.56.0.) Not verified: the linked plan at /home/sam/.claude/plans/https-archie-catlow-cloud-settings-histo-cryptic-whale.md is outside /data/worktree and was not read, per the discovery scope. I also did not run the e2e suite; the claims above are from source, routing and changelog inspection. Recommendation: close #1654 as already shipped. The only open judgement is whether the shipped saved views (client-side, per-identity localStorage) meet the intent of "saved views"; if the operator wants them server-side and shared per org, that is a new, smaller ticket, not this epic.
sam closed this issue 2026-11-08 12:04:01 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1654