> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CE 60 contact history audit trail INTEGRATION

# CE-60: Contact Activity History and Audit Trail — Integration Contract

**Status:** ✅ Implemented (2026-05-17)
**Spec:** [CE-60 Contact Activity History and Audit Trail](../../../specs/ce/specs/CE-60-contact-activity-history-audit-trail.md)
**Last Updated:** 2026-05-16

***

## Purpose

CE-60 renders the **All History** timeline on a CE contact. Admission milestone rows MUST be derived from cross-core signals published when a lead becomes a resident (or equivalent milestone), not from direct queries against RH-owned tables.

***

## Consumers and publishers

| Role      | Core / feature     | Notes                                                                                                                                                    |
| --------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Consumer  | CE-60              | Subscribes to integration-layer or event projections for admission milestones                                                                            |
| Publisher | CE-29 / RH handoff | `ce_lead_converted_to_resident` and related CE–RH events (see CE-29 Integration, [CE-17 spec](../../../specs/ce/specs/CE-17-ce-rh-admission-handoff.md)) |
| Related   | CE-63              | Stage transition semantics; timeline stage rows primarily from CE-63                                                                                     |

***

## Contract rules

1. **No CE → RH SQL:** CE application code MUST NOT read RH schema tables. Use `@/platform` integration surfaces or documented event consumers only.
2. **Tenant isolation:** Every projected row carries `organization_id` consistent with the parent `ce_contacts` row.
3. **Minimum necessary:** Admission rows surface summary labels suitable for intake staff; PHI-heavy payloads remain in owning cores unless the user holds `ce.contacts.history.sensitive_view`.

***

## Canonical events (CE-60 consumes only)

| Event key                       | Publisher  | Payload highlights                                            | Status                                                      |
| ------------------------------- | ---------- | ------------------------------------------------------------- | ----------------------------------------------------------- |
| `ce_lead_converted_to_resident` | CE-29 path | `organization_id`, `contact_id`, `resident_id`, `occurred_at` | ✅ Registered in [EVENT\_CONTRACTS.md](./EVENT_CONTRACTS.md) |

CE-60 MUST NOT introduce a new cross-core event for admission milestones; the existing `ce_lead_converted_to_resident` event is the sole source of admission rows. If RH later needs to publish additional milestone types, a separate spec must register them in `EVENT_CONTRACTS.md` and `KnownEventName` before CE-60 consumes them.

***

## Testing expectations

* Integration tests assert CE-60 adapters never import `@/cores/rh/*` modules.
* Contract tests validate admission rows appear only when canonical events are present for the contact/org.

***

## References

* [CROSS\_CORE\_INTEGRATIONS.md](./CROSS_CORE_INTEGRATIONS.md) — CE-60 matrix row
* [PLATFORM\_INTEGRATION\_LAYERS.md](./PLATFORM_INTEGRATION_LAYERS.md)
* CE-60 implementation plan: `specs/ce/plans/CE-60-contact-activity-history-audit-trail-PLAN.md`
