RAIA™ (Real estate Artificial Intelligence Agent) OS Specification (ADR-061)

1.5.4 Autonomous Asset Lifecycle & Status Self-Healing Protocol

How RAIA™ (Real estate Artificial Intelligence Agent) OS continuously monitors, audits, and self-heals asset lifecycle status across five independent data vectors to eliminate human-in-the-loop errors.

STATUS: GATED-AUTO VERSION: V1.2.0 AUDIENCE: DEVELOPERS & COMPLIANCE DIRECTORS COMPLIANCE LEVEL: TIER 0-3
← Back to Developer Hub TEXTBOOK SPECIFICATION
RAIA™ (Real estate Artificial Intelligence Agent) Specification

How RAIA™ (Real estate Artificial Intelligence Agent) OS continuously monitors, audits, and self-heals asset lifecycle status across five independent data vectors to eliminate human-in-the-loop errors.

🧩 Section A: In Plain English

Autonomous Lifecycle Self-Healing

The RAIA (Real estate Artificial Intelligence Agent) OS continuously monitors, audits, and self-heals asset lifecycle status across five independent data vectors, eliminating human-in-the-loop errors and status drift.

1 The Human-in-the-Loop Challenge & Status Drift

In legacy systems, the lifecycle of a property asset is entirely dependent on manual human data entry. If a client-facing agent wins back a lost instruction, secures a new tenancy, or starts collecting rent, they must remember to manually open a CRM or AppSheet card and toggle the status from Lost to Instructed.

⚠️ Case Study: The "Flat 5 Great Newport Street" Regression

A human operator accidentally set the property status of Flat 5, 12 Great Newport Street (PR000533) as Lost during a spreadsheet migration on October 15, 2024. In reality, the property had an active, periodic tenancy running until August 13, 2026, with an agreed rent of £3,300 PCM.

Despite a background sync engine trying to restore the property to active, a strict, legacy database trigger (trg_enforce_lost_status) intercepted the update on every run and silently forced the status back to Lost based on the historic date. This caused the property to disappear from active maps and search bars—causing a massive data drift.

To prevent this, RAIA™ (Real estate Artificial Intelligence Agent) OS operates an Autonomous Status Self-Healing Loop. Instead of trusting manual status fields, the platform continuously queries and scores live operational activity, automatically promoting or healing properties back to active states whenever real-world action is detected.

2 The 5-Vector Status Validation Engine

Every night, the Asset Lifecycle & Drift Check Service (asset-lifecycle-drift-check.cjs) executes a full audit of all properties on record. It evaluates five independent commercial vectors to determine if a property is physically active:

Vector A: Rent Collection (automated bank reconciliation gateway API Match)

Is rent actively being collected?

The absolute ultimate measure of an active property is monetary movement. RAIA (Real estate Artificial Intelligence Agent) queries the nightly automated bank reconciliation gateway bank reconciliation table (tbl_rents) for the asset.

IF EXISTS(SELECT 1 FROM tbl_rents WHERE asset_id = ? AND amount_received > 0 AND received_date >= CURRENT_DATE - INTERVAL '45 days')
➔ FORCE asset_status = 'Instructed', asset_occupancy = 'Occupied', date_lost = NULL
Vector B: Tenancy Agreements (GCS & tbl_tenancies)

Is there an active tenancy agreement?

If there is an active, legally binding tenancy agreement stored in the database whose running dates cover the current day, the property is operationally active, regardless of any manual "Lost" setting.

IF EXISTS(SELECT 1 FROM tbl_tenancies WHERE asset_id = ? AND tenancy_status IN ('active', 'renewing', 'arrears', 'moving_out', 'deposit_return') AND start_date <= CURRENT_DATE AND (end_date IS NULL OR end_date >= CURRENT_DATE))
➔ FORCE asset_status = 'Instructed', date_lost = NULL

Repository Code

The live codebase implementation for this specification sits within the following repository folder:

xl p-5 hover:shadow-md transition-all"> Vector C: Tenant Referencing (tbl_referencing_checks)

Are prospective tenants going through referencing?

Properties with incoming applicants undergoing active vetting (referencing, credit scoring, ID checks) are strictly active on our pipeline and represent an upcoming tenancy.

IF EXISTS(SELECT 1 FROM tbl_referencing_checks rc JOIN tbl_tenancies t USING (tenancy_id) WHERE t.asset_id = ? AND rc.status IN ('pending', 'running', 'completed_pass') AND rc.created_at >= CURRENT_DATE - INTERVAL '30 days')
➔ FORCE asset_status = 'Instructed' (Prevents archiving during onboarding gaps)
Vector D: Active Advertising (vw_listings_rent / Portal Push)

Is the property currently advertised for let or sale?

If an asset is being actively pushed to dominant listing aggregator, incumbent property portal, or MoveHome via our automated feed manager (tbl_portal_send_log), the property status is forced to `Instructed`.

IF EXISTS(SELECT 1 FROM tbl_portal_send_log WHERE asset_id = ? AND action = 'send' AND status = 'success')
➔ FORCE asset_status = 'Instructed'
Vector E: Signed Management Agreement (tbl_services)

Signed Services

If there are active, signed services in tbl_services, the property is considered actively managed by RAIA™ (Real estate Artificial Intelligence Agent) OS.

IF EXISTS(SELECT 1 FROM tbl_services WHERE asset_id = ? AND service_status = 'signed' AND (end_date IS NULL OR end_date >= CURRENT_DATE))
➔ FORCE asset_status = 'Instructed'

The Auto-Healer Lifecycle Engine

Under **SJT Stage 11 (Audit Loop)**, RAIA™ (Real estate Artificial Intelligence Agent) OS runs a nightly reconciliation cron job. If any property has its status set to Lost but passes **any one** of the five active vectors, the system automatically triggers a healing transaction.

-- Nightly Auto-Healing SQL Script
UPDATE tbl_assets SET asset_status = 'Instructed', asset_occupancy = 'Occupied', date_lost = NULL, lost_reason = NULL
WHERE asset_status = 'Lost' AND asset_id IN (SELECT asset_id FROM tbl_tenancies WHERE tenancy_status = 'active');
🔧 Section C: Developer Guide

Architecture Details

The security architecture implements a defence-in-depth model with perimeter authentication, internal authorisation, data encryption, and audit logging at every layer. Access is gated through a two-gate system: Tailscale identity verification at the network level, followed by role-based access control within the application.

  • Core Component: Security gate guard and RBAC enforcement
  • Data Flow: Request → Tailscale Gate → Authentication → Authorisation → Audit Log → Response
  • Integration Points: Tailscale ACLs, Supabase Row-Level Security, session tokens, and audit log sinks

Configuration Reference

Key configuration parameters for this system:

Parameter Type Default Description
gate_enabled boolean true Enable Tailscale gate guard for all pages
allowed_hosts string[] dev.estateaigents.com, localhost Whitelist of permitted hostnames
session_ttl_minutes integer 60 Session token time-to-live
SECURITY ARCHITECTURE — DEFENCE IN DEPTH 1. NETWORK GATE Tailscale Identity Network-level Auth 🔐 Tailscale Gate 2. APPLICATION GATE RBAC Enforcement Session Validation 🛡️ Auth Layer 3. DATA GATE RLS & Encryption Audit Logging 🔒 Data Protection Defence-in-depth: network gate → application gate → data gate with audit logging at every layer Tailscale identity · Role-based access · Row-level security · Full audit trail Network / Identity Gate Application / Auth Layer Data / Encryption Layer Data flow →

Figure 2: Security architecture — component interaction and data flow.

Troubleshooting

Issue Cause Resolution
401 Unauthorized on tailnet Tailscale not running or wrong node Verify Tailscale is connected and node is authorised
Gate guard redirect loop Hostname not in allowed_hosts list Add hostname to the gate guard whitelist
Repo Reference RAIA

This component is part of the RAIA (Real estate Artificial Intelligence Agent) platform mono-repo. Implementation details, API contracts, and integration tests are available in the repository.