Commit bd3b7f6
feat(audit): declarative field-change activity via trackHistory (ADR-0052 §5b) (#1948)
* feat(audit): declarative field-change activity via trackHistory (ADR-0052 §5b)
The activity writer already captures the field diff but renders a flat
"Updated <object>" summary. Add a per-field `trackHistory` flag (spec) and wire
the audit-writer to render tracked changes legibly — "Stage: Proposal → Closed
Won" — using the field label and select option labels. Opt-in per field (cf.
Salesforce Feed Tracking / ServiceNow field auditing / Dataverse column
auditing). Reintroduces the pruned `auditTrail` concept WITH a runtime consumer,
satisfying enforce-or-remove (ADR-0049).
Apps can now DECLARE their timeline instead of hand-coding hooks/flows that
insert sys_activity rows.
- spec: trackHistory?: boolean on the field schema
- plugin-audit: renderTrackedChangeSummary + getFieldDefs; update summary uses
it, falling back to the generic text when no tracked field changed
- tests: 2 new cases (renders label/option diff; falls back when untracked)
- docs: ADR-0052 §5b "Declarative activity, not per-app code"
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(spec): classify trackHistory as live in the liveness ledger
The liveness ratchet (ADR-0049) correctly flagged the new `trackHistory` field
property as undeclared surface. It has a runtime consumer
(plugin-audit audit-writers), so classify it `live` with evidence.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9ad1198 commit bd3b7f6
5 files changed
Lines changed: 476 additions & 6 deletions
File tree
- docs/adr
- packages
- plugins/plugin-audit/src
- spec
- liveness
- src/data
0 commit comments