YachtMemory Phase 1C.1c v1 - revision-aware Stay enrichment ============================================================ Basis ----- Full replacement of the uploaded, validated Phase 1B v1.1 src/services/StayEnrichmentWriter.php. Changes ------- - Reads the authoritative current revision from yachtmemory_derived.stays. - Reads stay_enrichment.stay_revision with existing enrichment values. - INSERT stores the current Stay revision. - Revision mismatch forces UPDATE, even if rounded enrichment values are identical. - UPDATE stores both current enrichment values and current Stay revision. - Equal revision + equal values remains UNCHANGED and performs no write. - Existing Phase 1B telemetry flattening and 3-decimal comparison semantics are retained. No SQL migration is included. Phase 1C.1a already created stay_enrichment.stay_revision. Test ---- Syntax first: php -l src/services/StayEnrichmentWriter.php php -l shared_dashboard/scripts/test_stay_enrichment_revision.php Dry run: php shared_dashboard/scripts/test_stay_enrichment_revision.php 1 Expected current real state: Stay #1-35: UNCHANGED, enrichment rev 1 -> 1 Stay #36: UPDATE, enrichment rev 1 -> 2 INSERT 0 | UPDATE 1 | UNCHANGED 35 Do not use --apply until the dry-run output has been reviewed.