YachtMemory Phase 1D.2a - Manual run-history integration ========================================================== Design: - StayProcessingService.php remains unchanged/frozen. - Run history belongs to the caller/orchestration boundary. - DRY_RUN stays read-only and creates NO run-history row. - Manual APPLY creates RUNNING before service execution and finalizes COMPLETE or FAILED afterward. - stay_processing.enabled does NOT gate this manual diagnostic/admin CLI path. The later automatic runner will enforce that setting. Files: - replacement shared_dashboard/scripts/run_stay_processing.php - READ ONLY preflight verifier Install: unzip -o YachtMemory_StayProcessing_Phase1D2a_v1.zip Syntax: php -l shared_dashboard/scripts/run_stay_processing.php php -l shared_dashboard/scripts/verify_stay_processing_phase1d2a.php Preflight: php shared_dashboard/scripts/verify_stay_processing_phase1d2a.php Optional DRY RUN validation (must NOT add history): php shared_dashboard/scripts/run_stay_processing.php --vessel-id=1 --dry-run Then check: mysql -u admin -p yachtmemory_app -e \ "SELECT COUNT(*) AS run_rows FROM stay_processing_runs;" First real logged APPLY: php shared_dashboard/scripts/run_stay_processing.php --vessel-id=1 Then inspect: mysql -u admin -p yachtmemory_app -e \ "SELECT id,vessel_id,trigger_type,status,started_at,finished_at,reconciled_inserted,reconciled_updated,reconciled_unchanged,enrichment_selected,enrichment_complete,enrichment_retry,enrichment_claim_lost,error_message FROM stay_processing_runs ORDER BY id DESC LIMIT 5;" Expected healthy no-op: - CLI result mode APPLY - reconciliation: 0 inserted, 0 updated, 36 unchanged (assuming current baseline) - enrichment worker selected 0 - result contains run_id - exactly one new stay_processing_runs row - trigger_type MANUAL - status COMPLETE - counters mirror service result - enabled remains false