Skip to content

Commit 4835dbc

Browse files
os-zhuangclaude
andcommitted
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>
1 parent d28cc73 commit 4835dbc

4 files changed

Lines changed: 471 additions & 6 deletions

File tree

0 commit comments

Comments
 (0)