you are a contract coder. please accept this brief and create a php personal productivity tool. first review this brief and ask for additional information before proceeding if there are errors in logic. this is to be used solely by myself so create minimalist easily read code that i can read and edit easily. Keep security and error capture and correction code to the bare minimum. Include good documentation on intent and outcomes of sections but not on trivial matters thaat i should know or can learn. Using the airline boarding pass based travel log - File in same dir ./iata_2026out.csv - The script must sort all rows chronologically by Date ascending before processing, as the raw CSV is in reverse chronological order. - Provided data is primarily captured by scanning boarding pass bar codes to iata_2026out.csv. Boarding pass scan has been supplemented and edited in iata_2026out.csv by manual edit as required to be to get perfect continuity. - The script should not attempt to fix or second-guess, just halt with error. - Cross-Year end Trips are not accounted, fake data entries will already be used to fix the logic - The first event of the year in the csv will fail the continuity test as the person appears without a an origin. this event and the inverse event at the end of the year may need to be defined exceptions. - The person choulr be counted as being there from Jan 01 at year beginning, and remaining to Dec 31 at year end - It is acknowledged that destinations of boarding passes may be wrong, consequential late/diverted flights will be edited in the raw data - Orphaned trips will be fixed by manual data edits Using passport jusistictions as defined in - file in same dir ./airports.csv (downloaded from https://ourairports.com/airports.csv) - For the purposes of this script, a passenger 'Enters' a jurisdiction based on the [Destination/Arrival] column of the CSV, and 'Exits' based on the [Origin/Departure] column of airports.csv. - When looking up jurisdictions in airports.csv, match the IATA code and filter for 'type' = 'large_airport' or 'medium_airport' to avoid false matches with closed facilities or heliports that might share an IATA code." (The columns the script needs to look at are iata_code and iso_country). STAGE !1 For the person "C", home base is HKG (hong kong) which can be treated like any other distination. - These figures are for tax and work limits reporting. "C" will end up with more than 365 declared days in a year. This is aggressive as the work rules are agressive. - Working Days at location come off the total days at location, so arrival/departure days are also deleted Multiple Flights in One Day means the it will be counted in both jurisdictions list for each passport jurisdiction visited by C Days spent in home base IS included 1. the total number of days within that jurisdiction including the days at both the beginning and the end of the visit 2. the total number of WORKING (excluding Saturday and Sunday days within that jurisditiction including the travel days at both the beginning and the end of the visit 3. Print a warning message when for showing jurisdictions where day are greater than 90 list for the person "K" for home base of HKG (Hong Kong) this is for purpose of HK social security requirements so trip length logic different 1. the total number of days within HKG excluding the travel day of departure and including the travel day of return For all calculations if they cannot be concluded logically or not give clear entry and exit matches for a jurisdiction, simply fail with a message referring to the error and suggest a data review. STAGE 2 After the script above has completed I will go on to use a run an API query to deepseek. Get list of Juristictions visited by "K" Add a sample query to seepseek api using key "dummykey" an the query "I am a Hong Kong Resident (not passport holder) travelling on an passport. Are there any news of significant changes to my entry requirements to "list of jurisdictions" that apply to me in the last 3 months"