feat(platform): Phase 551 moderation span metadata (v0.8.514)

Extend kick.member, timeout.member, and automod.setConfig span ends with
memberCount, activeTimeoutCount, and keywordCount for dev-log diagnostics.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 13:50:46 -04:00
co-authored by Cursor
parent 51f735b5e0
commit ac96778032
2 changed files with 11 additions and 2 deletions
+2
View File
@@ -183,6 +183,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
**v0.8.499 (Phase 536):** Compliance/audit spans extend — `audit.append`/`audit.export`/`compliance.snapshot` end metadata (`spanKind`, `activeChannelId`). UI compliance panel compositor wrappers, audit row `lastAuditRowId` + roving `tabindex`, clipboard compliance busy flags. Bundle: `npm run test:phase536-compliance`. See [COMPLIANCE.md](../../docs/COMPLIANCE.md), [AUDIT_LOG.md](../../docs/AUDIT_LOG.md).
**v0.8.514 (Phase 551):** Moderation spans extend — `kick.member` `memberCount`, `timeout.member` `activeTimeoutCount`, `automod.setConfig` `keywordCount`/`blockInvites`. UI split automod/ban/member panels; `.moderation-panel-live`/`.moderation-modal-live`; clipboard `moderationAutomodTogglesBusy`/`moderationTimeoutModalBusy`. Bundle: `npm run test:phase551-moderation`. See [MODERATION.md](../../docs/MODERATION.md).
**v0.8.498 (Phase 535):** Moderation/automod spans extend — `ban.member`/`kick.member`/`timeout.member`/`automod.*` end metadata (`spanKind`, `activeChannelId`). UI moderation panel compositor wrappers, ban/audit `aria-current=location`, clipboard moderation busy flags. Bundle: `npm run test:phase535-moderation`. See [MODERATION.md](../../docs/MODERATION.md).
**v0.8.513 (Phase 550):** Role/permission spans extend — `customRoleCount` on update/delete, `channelOverwriteCount`/`remainingOverwriteCount`. UI split role list + channel perm panels; `.roles-panel-live`/`.roles-modal-live`; clipboard `rolesListChromeBusy`/`rolesChannelPermControlsBusy`. ui-flow composer focus after delete/reorder role. Bundle: `npm run test:phase550-roles`. See [ROLES.md](../../docs/ROLES.md).
+9 -2
View File
@@ -8415,6 +8415,7 @@ class PearcordPlatform extends EventEmitter {
await this._audit('member.timeout', { guildId: this.guild.guild.id, targetId: userId })
this.guild.gossipTimeout(row)
this.emit('timeout', row)
const activeTimeouts = await this.moderation.listForGuild(this.guild.guild.id)
span.end({
userId,
guildId,
@@ -8424,7 +8425,8 @@ class PearcordPlatform extends EventEmitter {
until: row?.until || null,
durationMs: Number(durationMinutes) > 0 ? Number(durationMinutes) * 60000 : 0,
spanKind: 'timeout.member',
activeChannelId: this.activeChannelId
activeChannelId: this.activeChannelId,
activeTimeoutCount: activeTimeouts.length
})
return row
} catch (err) {
@@ -10040,6 +10042,9 @@ class PearcordPlatform extends EventEmitter {
enabled: !!config.enabled,
enabledChanged: partial.enabled !== undefined,
partialKeys: Object.keys(partial || {}).length,
keywordCount: (config.blockedKeywords || []).length,
blockInvites: config.blockInvites !== false,
maxMentions: config.maxMentions ?? null,
spanKind: 'automod.setConfig',
activeChannelId: this.activeChannelId
})
@@ -12697,6 +12702,7 @@ class PearcordPlatform extends EventEmitter {
await this._audit('member.kick', { guildId: payload.guildId, targetId: userId })
this.guild.gossipKick(payload)
this.emit('kick', payload)
const memberCount = (await this.guild.listMembers()).length
span.end({
userId,
guildId,
@@ -12704,7 +12710,8 @@ class PearcordPlatform extends EventEmitter {
reasonLen: String(reason || '').trim().length,
removedMember: true,
spanKind: 'kick.member',
activeChannelId: this.activeChannelId
activeChannelId: this.activeChannelId,
memberCount
})
return payload
} catch (err) {