Slice 6 of #788. Depends on #795. It can land in parallel with the screen slices.
Make the audit log show when an assistant took an action, rather than a person typing it.
The shape
ActorUserId and ActorEmail stay the human. That is a requirement, not a style choice. AGENTS.md #500 states that ICurrentUser is "an authorization input, not a label", and FlockScopeGuard reads its roles. The person authorized the action and remains the actor.
What this adds is provenance, the application that acted.
Why first-class columns rather than DetailsJson
AuditEvent already has a DetailsJson column, and using it would be cheaper. It was rejected because:
- Provenance is not a detail. It is who acted, which belongs beside the actor fields.
- It must be filterable. "Show me everything assistants did last month" is the question this exists to answer, and a JSON blob is not indexable for it.
The slice therefore adds two new columns on AuditEvents (application id and display name), a migration, and regenerated docs/schema/ in the same PR (#417).
Care needed
AuditEvents is the table this repo is most careful about. #508 gave it a monotonic Sequence ordering key, and #505 deliberately decided not to time-partition it. Read both before altering it. Adding columns is compatible with each, but the change must not disturb the ordering guarantees.
Surfacing
The existing audit UI should show the application. Today a row shows only the person's name even when an assistant acted, so an Owner reviewing history cannot tell a human typo from an assistant misfiring. This slice closes that gap.
Related
#272 (GDPR). This new dimension inherits the existing ActorEmail tension between erasure and pseudonymisation, because AuditEvent stores immutable snapshots and offers no way to change them.
Done when
An action performed through an assistant records both the human and the application, the audit UI shows it, and a user can filter on it.
Slice 6 of #788. Depends on #795. It can land in parallel with the screen slices.
Make the audit log show when an assistant took an action, rather than a person typing it.
The shape
ActorUserIdandActorEmailstay the human. That is a requirement, not a style choice.AGENTS.md#500 states thatICurrentUseris "an authorization input, not a label", andFlockScopeGuardreads its roles. The person authorized the action and remains the actor.What this adds is provenance, the application that acted.
Why first-class columns rather than
DetailsJsonAuditEventalready has aDetailsJsoncolumn, and using it would be cheaper. It was rejected because:The slice therefore adds two new columns on
AuditEvents(application id and display name), a migration, and regenerateddocs/schema/in the same PR (#417).Care needed
AuditEventsis the table this repo is most careful about. #508 gave it a monotonicSequenceordering key, and #505 deliberately decided not to time-partition it. Read both before altering it. Adding columns is compatible with each, but the change must not disturb the ordering guarantees.Surfacing
The existing audit UI should show the application. Today a row shows only the person's name even when an assistant acted, so an Owner reviewing history cannot tell a human typo from an assistant misfiring. This slice closes that gap.
Related
#272 (GDPR). This new dimension inherits the existing
ActorEmailtension between erasure and pseudonymisation, becauseAuditEventstores immutable snapshots and offers no way to change them.Done when
An action performed through an assistant records both the human and the application, the audit UI shows it, and a user can filter on it.