RAIA™ Specification

2.33 Asset Diary vs Person Diary — tbl_asset_diary + tbl_person_diary (ADR-293)

There are two diaries. One belongs to the property (asset_diary) — it tracks viewings, repairs, rent late. The other belongs to the person (person_diary) — it tracks rare life events that change the tenancy: death, divorce, a new baby, bankruptcy, job loss, power of attorney. The property diary is busy; the person diary is almost empty but legally critical. Never mix them up.

← Back to Developer Hub TEXTBOOK SPECIFICATION
🟢 In Plain English

There are two diaries. One belongs to the property (asset_diary) — it tracks viewings, repairs, rent late. The other belongs to the person (person_diary) — it tracks rare life events that change the tenancy: death, divorce, a new baby, bankruptcy, job loss, power of attorney. The property diary is busy; the person diary is almost empty but legally critical. Never mix them up.

The boundary between the property operational timeline and the person life-event log. Covers the tbl_diary → tbl_asset_diary rename, the new tbl_person_diary table, what goes where, who writes to each, and the V313 migration shape.

ADR-293 V313 Migration RLS Guarded HIGH Risk Append-Only
81k
Live rows in tbl_diary (renames to tbl_asset_diary)
~90
Files referencing tbl_diary that must be updated in the same PR
8
Allowlisted entry types on tbl_person_diary (death → legal_status)
0
UPDATE or DELETE policies — both diaries are append-only

ASSET DIARY vs PERSON DIARY 1. Asset Diary Property records Snapshots, documents 2. Person Diary Contact timeline Comms, activities 3. Cross-Ref Tenancy link Bi-directional lookup ASSET DIARY vs PERSON DIARY

Figure 1: ASSET DIARY vs PERSON DIARY pipeline diagram.

Section A Two Diaries, One Rule

Think of a letting agency like a hospital. Every building has a maintenance log — the boiler broke, the roof leaked, the tenant called about damp. Every patient has a medical chart — but only the big stuff goes on it: a major diagnosis, a surgery, a life-changing event. You would never write "patient sneezed" on the medical chart, and you would never write "boiler serviced" on it either.

RAIA (Real estate Artificial Intelligence Agent) works the same way. The asset diary is the building's maintenance log — busy, noisy, full of everyday operational events. The person diary is the patient's medical chart — quiet, sparse, but when something appears there it matters legally and changes how you handle the tenancy.

Asset Diary (tbl_asset_diary)
  • Belongs to the property
  • Viewings, inspections, maintenance, rent late, compliance checks
  • ~81,000 rows today — busy and operational
  • What staff see in the Property Diary drawer
  • Written by PaperClip after every event, plus import scripts
Person Diary (tbl_person_diary)
  • Belongs to the person (tenant, landlord, guarantor)
  • Death, divorce, baby, bankruptcy, job loss, power of attorney
  • Rare — maybe a handful of rows per person per year
  • What staff see in the Landlord centre "Life events" section
  • Written by staff manually, or by AI with a human approval gate
The One Rule

If it happened to the property, put it in the asset diary. If it happened to the person and it changes their legal or tenancy status, put it in the person diary. If it is just a fact about who they are (their CV, their preferences, their communication style), that is not a diary entry — it lives in tbl_persons.about or tbl_person_snapshots.

Section A What Goes Where — The Boundary Table

This table is the single source of truth for routing decisions. When in doubt, check here first.

What Happened Where It Goes Why
"Tenant called about boiler" tbl_asset_diary (MAINTENANCE) Asset-scoped operational event
"Tenant's husband died" tbl_person_diary (death) Person life event with tenancy impact
"Met at landlord meetup, price sensitive" tbl_persons.about / tbl_person_snapshots Relationship narrative, not an event
"Tenant pays late 3 times" tbl_asset_diary (RENT) + tbl_persons_behavioural_scorecards Operational fact + quantitative metric
"Tenant lost job" tbl_person_diary (employment_change) Referencing impact — material change
"Landlord prefers WhatsApp" tbl_persons.comm_preferred / scorecard Communication preference, not an event
"Tenant's baby born" tbl_person_diary (household_change) Occupancy/legal impact — new occupant

Section B Staff Workflow — When and How to Add Entries

Asset Diary — You Don't Write It, It Writes Itself

The asset diary is populated automatically. PaperClip processes every event (email, call, viewing, maintenance ticket) and writes a compressed human-readable entry. Staff do not manually add asset diary rows in normal operation. If you need to add a manual note, use the property drawer's note function — it will be ingested into the pipeline.

Person Diary — Manual Entry for Rare Events

The person diary is almost always written by hand. When you learn of a life event that affects the tenancy, you add it explicitly.

  1. 1
    Open the person centre

    Navigate to the landlord or tenant record. The person diary lives inside the person centre, not as a separate drawer.

  2. 2
    Find "Life events"

    Scroll to the section between "Communication scorecard" and "Personal information." It is collapsed by default if empty.

  3. 3
    Click "Add life event"

    A minimal modal opens: entry type dropdown, summary textarea, occurred_at date picker.

  4. 4
    Select the entry type

    Choose from the allowlist: death, divorce_separation, household_change, bankruptcy_iva, employment_change, power_of_attorney, legal_status. Use "other" only if nothing fits — it requires manual review.

  5. 5
    Write a 1–3 sentence summary

    Human-readable, factual, no speculation. Example: "Mr Smith passed away on 2026-07-15. Next of kin: daughter, contact pending."

  6. 6
    Save — entry is append-only

    Once saved, the entry cannot be edited or deleted. Corrections are new entries with type "other" and a note pointing to the original.

Section B Person Diary Entry Types — The Allowlist

Only these 8 values pass the CHECK constraint. Anything else is rejected at the database level.

Entry Type When to Use Example
death Tenant, landlord, or guarantor has died "Mr Smith passed away 2026-07-15. Probate solicitor contacted."
divorce_separation Marriage or partnership breakdown affecting tenancy "Tenants separating; one vacating, one remaining. New AST required."
household_change Baby, occupant moved in/out, household size changed "Baby born 2026-06-01. Occupancy now 3. No tenancy change needed."
bankruptcy_iva Bankruptcy, IVA, CCJ, debt relief order "Tenant declared bankruptcy 2026-05-20. Rent guarantee insurance notified."
employment_change Material employment change affecting referencing "Tenant lost job 2026-07-01. New employer TBC — flag for re-reference."
power_of_attorney PoA granted/revoked, capacity issues "LPA registered 2026-06-10. Daughter now acting for landlord."
legal_status Visa status, criminal conviction, other legal change "Tenant's visa renewed 2026-07-30. Right to Rent check updated."
other Does not fit above — rare, requires manual review "Tenant won lottery 2026-07-01. Wants to buy property. Flag for sales."

Section B Where You See Each Diary

Asset Diary — Property Drawer

Opens from any property card. Full operational timeline: viewings, maintenance, rent, compliance. Searchable, filterable by type. This is the busy diary you use daily.

Person Diary — Landlord Centre "Life events"

Inside the landlord centre, between "Communication scorecard" and "Personal information." Read-only timeline + "Add life event" button. Collapsed when empty. Tenant centre will follow the same pattern when built.

No Person Diary Drawer

There is intentionally no separate person diary drawer. The person diary is a section inside the person centre, keeping the UI surface area minimal (Bootstrapped Narrowness, CLAUDE.md §9).

Section C Schema — V313 Migration

Rename: tbl_diary → tbl_asset_diary

PostgreSQL table rename is metadata-only (atomic, no table rewrite). Indexes, triggers, and RLS policies must be renamed explicitly — they do not auto-rename.

-- V313__rename_tbl_diary_to_tbl_asset_diary.sql
BEGIN;

-- 1. Rename table
ALTER TABLE public.tbl_diary RENAME TO tbl_asset_diary;

-- 2. Rename indexes (PostgreSQL does NOT auto-rename)
ALTER INDEX idx_tbl_diary_asset_occurred    RENAME TO idx_tbl_asset_diary_asset_occurred;
ALTER INDEX idx_tbl_diary_org_occurred      RENAME TO idx_tbl_asset_diary_org_occurred;
ALTER INDEX idx_tbl_diary_asset_type        RENAME TO idx_tbl_asset_diary_asset_type;
ALTER INDEX idx_tbl_diary_source_ref        RENAME TO idx_tbl_asset_diary_source_ref;
ALTER INDEX idx_tbl_diary_summary_fts       RENAME TO idx_tbl_asset_diary_summary_fts;
ALTER INDEX idx_tbl_diary_location_occurred RENAME TO idx_tbl_asset_diary_location_occurred;
ALTER INDEX idx_tbl_diary_org_scope         RENAME TO idx_tbl_asset_diary_org_scope;

-- 3. Rename trigger
ALTER TRIGGER trg_tbl_diary_updated_at ON public.tbl_asset_diary
  RENAME TO trg_tbl_asset_diary_updated_at;

-- 4. Recreate RLS policies with new names
DROP POLICY IF EXISTS "org members can read own diary" ON public.tbl_asset_diary;
DROP POLICY IF EXISTS "org members can insert diary entries" ON public.tbl_asset_diary;

CREATE POLICY "org members can read own asset diary"
  ON public.tbl_asset_diary FOR SELECT
  USING (organisation_id = public.current_org_id());

CREATE POLICY "org members can insert asset diary entries"
  ON public.tbl_asset_diary FOR INSERT
  WITH CHECK (organisation_id = public.current_org_id());

COMMIT;

Create: tbl_person_diary

-- V313__create_tbl_person_diary.sql
CREATE TABLE public.tbl_person_diary (
  diary_id        UUID        PRIMARY KEY DEFAULT gen_random_uuid(),
  organisation_id UUID        NOT NULL REFERENCES public.tbl_organisations(organisation_id) ON DELETE CASCADE,
  person_id       UUID        NOT NULL REFERENCES public.tbl_persons(person_id) ON DELETE CASCADE,
  entry_type      TEXT        NOT NULL CHECK (entry_type IN (
    'death', 'divorce_separation', 'household_change', 'bankruptcy_iva',
    'employment_change', 'power_of_attorney', 'legal_status', 'other'
  )),
  summary         TEXT        NOT NULL,
  occurred_at     TIMESTAMPTZ NOT NULL DEFAULT now(),
  source          TEXT,                  -- 'manual' | 'conversation' | 'document' | 'import'
  source_ref      TEXT,                  -- dedup key: "<source>:<external_id>"
  metadata        JSONB,                 -- structured data (new_occupant_count, employer_name, etc.)
  event_id        UUID        REFERENCES public.tbl_events(event_id) ON DELETE SET NULL,
  created_at      TIMESTAMPTZ NOT NULL DEFAULT now(),
  created_by      UUID        REFERENCES public.tbl_persons(person_id) ON DELETE SET NULL
);

-- Indexes
CREATE INDEX idx_tbl_person_diary_person_occurred ON public.tbl_person_diary (person_id, occurred_at DESC);
CREATE INDEX idx_tbl_person_diary_org_occurred    ON public.tbl_person_diary (organisation_id, occurred_at DESC);
CREATE INDEX idx_tbl_person_diary_type            ON public.tbl_person_diary (person_id, entry_type, occurred_at DESC);
CREATE UNIQUE INDEX idx_tbl_person_diary_source_ref ON public.tbl_person_diary (source_ref) WHERE source_ref IS NOT NULL;
CREATE INDEX idx_tbl_person_diary_summary_fts     ON public.tbl_person_diary USING gin(to_tsvector('english', summary));

-- RLS
ALTER TABLE public.tbl_person_diary ENABLE ROW LEVEL SECURITY;

CREATE POLICY "org members can read own person diary"
  ON public.tbl_person_diary FOR SELECT
  USING (organisation_id = public.current_org_id());

CREATE POLICY "org members can insert person diary entries"
  ON public.tbl_person_diary FOR INSERT
  WITH CHECK (organisation_id = public.current_org_id());
Append-Only — No UPDATE, No DELETE

Neither diary has UPDATE or DELETE policies. Corrections are new entries. For tbl_person_diary, use entry_type='other' with a metadata.supersedes pointer to the original entry. This preserves the legal audit trail.

DIARY DATA MODEL Layer 1 tbl_asset_diary Property snapshots asset_ref FK Links to properties Layer 2 tbl_person_diary Contact timeline person_ref FK Links to persons Layer 3 Tenancy Join Cross-references Snapshot API REST endpoints Both diaries share the same snapshot-pattern but differ in primary entity

Section C Writer Rules — Who Writes What

Asset Diary Writers

  • PaperClip/Qwen — after event processing, compresses raw events into human-readable diary entries
  • Import scripts — bq-diary-import.cjs, slack-diary-import.cjs, bq-person-contact-import.cjs, landlord-backfill.cjs
  • Manual notes — staff add via property drawer note function; ingested into pipeline

Person Diary Writers

  • Manual entry — staff via person centre UI. source='manual', created_by=staff person_id
  • Conversation auto-extract — the conversation→about auto-writer may also insert a person_diary row for allowlisted types. Rules:
    • Only for allowlisted entry_type values
    • source='conversation', source_ref='conversation:<conversation_id>' (idempotent)
    • metadata includes {"conversation_id": "...", "extracted_by": "claude-sonnet-4-6", "confidence": 0.95}
    • Human gate: confidence < 0.90 → metadata.review_flag = true → staff review queue before appearing in timeline
    • The LLM never decides to write — it recommends; a programmatic gate on tbl_actions enqueues after staff approval (ADR-283 railway-first)
  • Document extract — future: death certificate, divorce decree uploaded → classification → insert. Not in V313 scope.

Section C API Reference

Endpoint Method Table Status
/api/properties/[id]/diary GET tbl_asset_diary Live — reads renamed table after V313
/api/persons/[id]/diary GET tbl_person_diary Future — route exists when person centre is built
/api/persons/[id]/diary POST tbl_person_diary Future — for manual staff entry

Section C AppSheet Migration — What Goes Where (and What Does NOT)

AppSheet Contact.Description and Contact.Notes migrate to different destinations. Neither goes into tbl_person_diary.

AppSheet Field Destination Rule
Contact.Description tbl_persons.about CV SSOT. Fill NULLs; append under --- if existing text.
Contact.Notes tbl_person_snapshots.snapshot_static Relationship narrative — static dossier layer (ADR-290).
Life events in free text tbl_person_diary (manual) If staff spot a life event during migration review, add it manually post-migration.

Section C Verification — Post-V313 Checks

-- 1. tbl_asset_diary exists, tbl_diary does not
SELECT tablename FROM pg_tables WHERE tablename IN ('tbl_diary', 'tbl_asset_diary');
-- expect: tbl_asset_diary only

-- 2. tbl_person_diary exists with correct shape
\d public.tbl_person_diary

-- 3. RLS enabled on both
SELECT tablename, rowsecurity FROM pg_tables
WHERE tablename IN ('tbl_asset_diary', 'tbl_person_diary');
-- expect: both true

-- 4. Entry type constraint works
INSERT INTO tbl_person_diary (organisation_id, person_id, entry_type, summary)
VALUES ('<org>', '<person>', 'boiler_complaint', 'test');
-- expect: CHECK constraint violation

FE verification:

  1. Property drawer loads diary entries (asset_diary).
  2. Landlord centre shows "Life events" section (empty state for new lead).
  3. Add life event modal inserts row, timeline updates.

ADR-293 Decision Summary

Architecture Decision Record — Conditional (Awaiting RedTeam)

ADR-293 renames tbl_diary to tbl_asset_diary (V313, metadata-only, ~81k rows, ~90 file references) and creates tbl_person_diary for rare life events with tenancy/legal impact. tbl_persons.about remains the CV SSOT. Risk tier: HIGH — Eugin approval required before production apply.

Decisions
  • Rename makes domain explicit — no ambiguity between asset and person events
  • Person diary is append-only, allowlisted, RLS-guarded
  • AppSheet Description → about; Notes → snapshot_static
  • Conversation auto-writer may insert person_diary with confidence gate + staff approval
Open Follow-ups
  • Tenant centre FE surface for person_diary
  • Document-triggered extraction (death certificate, divorce decree)
  • actor_person_id backfill on tbl_asset_diary (ADR-290 §9)
  • Person diary retention policy (GDPR — how long after tenancy end?)

References Internal Sources

This page is generated from the following internal specifications and decision records:

Source Type Relevance
ADR-293 — tbl_asset_diary Rename + tbl_person_diary Create Architecture Decision Record Primary source for this page. Defines the rename, the new table, boundary rules, writer rules, and V313 migration shape.
ADR-290 — Person Snapshot + Landlord Centre Architecture Decision Record Defines the two-layer relationship narrative (snapshot_static + live digest) and the conversation→about auto-writer that may also insert person_diary rows.
ADR-283 — Railway-First Gating Architecture Decision Record Establishes the programmatic gate on tbl_actions that enqueues writes after staff approval — the human-in-the-loop pattern for auto-extracted person_diary entries.
ADR-003 — Property Diary (Superseded) Architecture Decision Record Original property diary spec. Superseded by ADR-293 — the GCS Markdown diary was replaced by tbl_diary, now renamed tbl_asset_diary.
ADR-047 — tbl_diary Schema Architecture Decision Record Original schema for the table that is now tbl_asset_diary.
ADR-065 — location_id + scope Architecture Decision Record Added the scope column to tbl_diary. ADR-293 makes the asset/person boundary explicit at the table level instead.