---
id: 02-audit-enum-amendment
epic: dsr-consent-and-cookie-banner
title: Audit action enum amendment (ADR-018)
type: technical-story
status: done
feature: core-shared
depends-on: [01-subject-linkage-types]
blocks: [03-core-consent-foundation, 06-core-dsr]
created: 2026-05-19T12:00:00Z
updated: 2026-05-19T10:29:21.283Z
---

## Goal

Extend the audit action enum with four new action types needed by consent and DSR, and amend ADR-018 to document the addition.

## Why

`core-consent`'s `IConsent.grant` / `IConsent.withdraw` emit `CONSENT_GRANT` / `CONSENT_WITHDRAW` for Art. 7 legal proof. `core-dsr`'s `IProcessingRestriction` emits `RESTRICT` / `UNRESTRICT` for Art. 18. Both optional cores must emit via `core-audit`'s existing channel; the action types must exist in `core-shared`'s enum before either optional core can be implemented.

## Done when

- The audit action enum in `core-shared/audit/` gains `CONSENT_GRANT`, `CONSENT_WITHDRAW`, `RESTRICT`, `UNRESTRICT`.
- `core-audit`'s `IAuditLog.record` accepts the new action types without type errors.
- `docs/guides/audit-and-compliance.md` is updated to list the new action types.
- `docs/decisions/ADR-018.md` gains an `## Amendments` section recording the date and the reason (consent + restriction events added for Epic B).
- `pnpm typecheck && pnpm lint && pnpm test && pnpm conformance && pnpm fallow:audit && pnpm coverage:diff` all pass.

## In scope

- Audit action enum extension (four new values) in `core-shared/audit/`.
- `core-audit` type update so `IAuditLog.record` is compatible with the new values (no new interface methods).
- `docs/guides/audit-and-compliance.md` update — "Six action types" wording amended to reflect the new count.
- ADR-018 amendment section.

## Out of scope

- New audit emission call sites (Stories 04 and 06 — they live in the optional-core implementations).
- `eraseSubject` flow changes — existing post-DSR-delete pseudonymization is unchanged.

## Tasks

- [x] Add `CONSENT_GRANT`, `CONSENT_WITHDRAW`, `RESTRICT`, `UNRESTRICT` to the audit action enum in `packages/core-shared/src/audit/` + update `core-audit`'s `IAuditLog` type to accept the new values + update `docs/guides/audit-and-compliance.md` with the new action types + add `## Amendments` section to `docs/decisions/ADR-018.md` recording the date and reason; all gates pass.
