Skip to content

Add the FOG 1.6 Agent Activity page and the agentactivity.view permission - #212

Merged
fog-workflows[bot] merged 1 commit into
masterfrom
feat/agent-activity
Nov 17, 2026
Merged

fog-workflows[bot] merged 1 commit into
masterfrom
feat/agent-activity

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Closes #207. Map: #155. Follows #206 (PR #210).

What

  • GET /agent-activity shows the fog-agent enrollment events of each host, grouped by host, with the most recently active host first. It matches FOG 1.6 Agent Activity. It is a view over the audit trail, with no new collection.
  • POST /api/v1/agent-activity/summary returns one entry per host, from a native aggregation with an _id tie-break, at most 5000 hosts. A deleted host shows as its stored label plus " (deleted)".
  • POST /api/v1/agent-activity/host returns one host's rows, newest first, at most 500, with total and limit. A missing, non-string or empty hostId answers 400.
  • New permission stock.agentactivity.view, approved by Tom on 2026-11-17. It is separate from audit.view, because the audit trail discloses refusals and attempted user names. A role with only audit.view gets 403 here.
  • Agent Activity is added to the Logging group after Audit Log. The sidebar smoke check pins all three entries.

Rows

  • The page shows the agent.* audit rows that name a host. Today these are enrollments bound to a host, and renewals.
  • An enrollment with no host stays on the Audit Log page only.
  • agent.token rows also stay on the Audit Log page, because their subject is the token, not a host.

Beyond the brief

  • The toggle also collapses an expanded host back to its summary row.
  • The host answer carries limit, so the page does not hardcode 500.
  • The smoke enrollment code moved to tools/smoke/lib/agent-enroll.js. agent-admin.js sends the same payload as before.

Tests

  • npm test: 587 passing. npm run test:ui and npm run test:ui:prod: all checks pass.
  • New: test/integration/agent-activity-page.test.js and tools/smoke/checks/agent-activity.js. Each fails without the change.
    • The empty-hostId test failed with "got 200" before its fix.
    • The sidebar assertion and the page check were each run red.

Review

  • An executor built it on Sonnet.
  • Spec and standards reviews ran on Opus, two rounds each.
  • Round 1 found the empty-hostId leak, and it is fixed.
  • The last findings were comment fixes, and they are applied.

🤖 Generated with Claude Code

…tivity.view

Adds GET /agent-activity with POST /api/v1/agent-activity/summary and
/host: the fog-agent enrollment events of each host, grouped by host,
most recently active host first (1.6 AgentActivityManagement). A view
over the audit trail, no new collection.

- New permission stock.agentactivity.view (Tom approved 2026-11-17),
  separate from audit.view: agent rows are a different disclosure.
- Rows: agent.* audit rows of a non-empty host. An enrollment with no
  host, and agent.token rows (their subject is the token), stay on the
  Audit Log page. An empty hostId answers 400.
- Bounds as 1.6: 5000 hosts in the summary (native aggregation with an
  _id tie-break), 500 rows per host; the host answer carries total and
  limit for the "showing the newest N" note.
- RowGroup on hostId, no Scroller, fixed order. The toggle expands a
  host and collapses it back to its summary row.
- The smoke enrollment code is shared in tools/smoke/lib/agent-enroll.js.

Closes #207

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fog-workflows
fog-workflows Bot enabled auto-merge November 17, 2026 18:48
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit eac8f42 Nov 17, 2026
5 of 6 checks passed
@fog-workflows
fog-workflows Bot deleted the feat/agent-activity branch November 17, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the FOG 1.6 Agent Activity page and the agentactivity.view permission

1 participant