Skip to content

17 · Intelligence — a system that thinks ahead

The owner's requirement: intelligence everywhere; the system smart and logical everywhere, keeping the larger picture in mind. This file turns that into rules. Intelligence is not a separate module or a chat box — it is how every screen behaves: it knows what matters now, what will go wrong next, and what the user should do about it.

Existing building blocks to reuse rather than duplicate: src/lib/financeIntelligence.ts, groupIntelligence.ts, passengerFlightIntelligence.ts, passengerHotelIntelligence.ts, financeCopilot.ts (+ supabase/functions/finance-copilot), packageCopilot.ts.

Principles

INT-001 · Intelligence is part of every screen

Status: DECIDED 2026-09-17 (owner requirement) · Owner: Management Every page answers three questions before the user asks: What needs my attention? (alerts, ranked) · What should I do next? (next best action with a one-click path) · Is anything inconsistent? (checks against the rest of the system). A new page or workflow is not complete until it has considered all three (checked in review, like permissions and confirmations).

INT-002 · Deterministic first, AI second

Status: PROPOSED · Owner: Engineering Anything that can be computed exactly from records — deadlines, balances, readiness, capacity, drift, duplicates — is computed by rules in the database or shared library code, tested, and cites the rule it implements. Language models are used only for language: summaries, drafting messages, reading documents (passport OCR), and answering questions from verified data. A model never produces a number, status or decision that the system then trusts.

INT-003 · Suggest, never act silently

Status: PROPOSED · Owner: Management The system may pre-fill, rank, suggest and warn. It never moves money, changes a booking, visa, ticket or inventory status, grants access or sends an external message on its own. Acting on a suggestion goes through the normal permission check and the confirmation dialog (UX-001); the audit record notes that the action came from a suggestion (source = suggestion:<INT id>). Exception: purely internal reminders and escalations defined by a rule (e.g. INC-003, AIR §21) may fire automatically. A second exception, decided by the owner on 30 Sep 2026: the booking reminder e-mails of COMM-010 go to customers and partners by themselves, once an administrator has switched them on (COMM-014).

INT-004 · Explain every signal

Status: PROPOSED · Owner: Engineering Every alert, score or suggestion shows why (the facts it used, with links to the records) and which rule raised it. Numbers link to the vouchers/rows that make them up ("explain this number"). A user can dismiss or snooze a signal with a reason; dismissals are recorded and reviewed (INT-030).

INT-005 · Same facts everywhere

Status: PROPOSED · Owner: Engineering A signal is computed once, in one place, and shown wherever it matters — staff screens, Customer 360, group board, role home, portals (in customer-appropriate wording), tour-leader app, notifications. Two screens never compute the same risk differently (same principle as JRN-001 for stages).

INT-006 · Respect permissions and privacy

Status: LAW (DPDP Act 2023) + PROPOSED detail · Owner: Management Signals only include data the viewer is allowed to see (ACC-013). Data sent to an external AI provider is minimised: no passport numbers, Aadhaar/PAN, phone, email, health details or bank details unless the feature strictly requires it and the purpose is recorded; prefer IDs and aggregates. Prompts and responses that contain personal data are not retained by the provider (zero-retention setting) and are logged internally with masking (AUD-020).

INT-007 · Measure usefulness

Status: PROPOSED · Owner: Management For each signal type the system records: raised, acted on, dismissed (with reason), and whether the predicted problem happened. Signals nobody acts on are tuned or removed; noise is treated as a defect.

Signal catalogue

Each entry: what is detected → where it appears → what the user can do. Build order follows PROGRAM waves.

Customer journey and bookings (JRN, LC, PAX)

INT-100 · Readiness risk per traveller and group

Status: PROPOSED · Owner: Operations From the readiness checklist (JRN-003): missing passport scan, passport expiring < 6 months after return, visa not submitted by the visa cut-off, unpaid balance near the payment deadline, no emergency contact, infant without guardian, woman under the mahram policy without a linked mahram, missing vaccination/insurance (HLT). Shown as a ranked "blocking departure" list on the group board, operations home and Customer 360; each item links to the fix.

INT-101 · Duplicate and conflict detection

Status: PROPOSED · Owner: Sales On create/edit: same passport or same name + date of birth already on another active booking or the same departure; one traveller in two groups with overlapping dates; a customer record likely duplicating another (phone/email/name similarity) → suggest merge (with confirmation). Also detects rooming conflicts (a male adult in a female room, infant without a guardian in the room).

INT-102 · Smart defaults

Status: PROPOSED · Owner: Sales Passenger type from date of birth on each flight date (PAX-003); child/infant price, bed and meal entitlements from the rules (PAX-010); guardian suggested from the family on the booking; group suggested from travel month and package; room type from party composition; payment schedule from the policy (PRC-010). Defaults are visible and editable, never hidden.

INT-103 · Next best action on every booking

Status: PROPOSED · Owner: Operations The booking header shows the single most important next step, derived from its stage and checklist (e.g. "Collect ₹42,000 due in 3 days", "Upload 2 passports", "Assign rooms — group rooming locks tomorrow").

Sales and partners (LC, PRC)

INT-110 · Lead and quotation follow-up

Status: PROPOSED · Owner: Sales Quotations near expiry, leads with no follow-up in N days, and customers whose group is filling up (seats left < threshold) are ranked on the sales home with suggested wording for a reminder (drafted by AI, sent only by a person).

INT-111 · Partner risk and opportunity

Status: PROPOSED · Owner: B2B Partner nearing credit limit, overdue statements, rising cancellation rate, unusual discount requests; partners whose bookings for a season are below last year's pace.

Inventory, airline and groups (INV, AIR)

INT-120 · Deadline radar

Status: PROPOSED (implements AIR §21–22) · Owner: Operations Name-list, deposit, ticketing, release, hotel rooming and visa deadlines at T-7/3/1/0 with the number of seats/rooms at risk and money at stake. Automatic internal escalation allowed (INT-003 exception). Enforced by: 20260920110100_inventory_hold_release_functions.sql (inventory_deadline_rows() — every airline-block, FIT and hold deadline with its rung, the seats at risk and the money at risk; fire_inventory_deadline_alerts() writes one InventoryDeadlineAlert row per rung, once, and escalate_inventory_deadline_alerts() passes an unacknowledged urgent rung to the escalation authority) + 20260920110300_inventory_deadline_dashboards.sql (dash_deadline_radar, dash_ticket_deadlines, dash_hold_expiry). Money at risk on a release deadline is the airline's own penalty from the AIR §20 bands, not a guess. Internal only. Hotel rooming and visa deadlines are not in this radar yet. No scheduler exists: the radar derives on read so nothing is missed, and the durable rungs are written when someone runs the ladder from /inventory/deadlines — see the scheduling note in the migration. UI: /inventory/deadlines, widget inv.deadline-radar; in the phone app Operations → Deadlines (inventory.view or tickets.view, the two rights dash_deadline_radar answers; apps/mobile/src/app/inventory/deadlines.tsx: the radar in AIR §21's buckets, the alerts, Acknowledge through acknowledge_inventory_deadline_alert with who and when recorded, Run the ladder with inventory.edit) and the week's count of unacknowledged deadlines on the Operations tab (app_operations_summary(), 20261008235000_app_operations.sql). Tests: supabase/tests/app_operations.sql, apps/mobile/src/lib/operations.test.ts.

INT-121 · Utilisation and release advice

Status: PROPOSED · Owner: Operations For each block/FIT/hotel allotment: sold vs held vs free against the release deadline and the booking pace of similar past departures → "release 6 seats by 20 Oct to avoid ₹1.8 L penalty" or "pace suggests the block will sell out — request 10 more". Shows the calculation. Enforced by: 20260920110300_inventory_deadline_dashboards.sql (dash_block_utilisation) — sold / held / free / requested-for-release / released per upcoming block against its next deadline, with a plain-language recommendation priced from the airline's penalty bands and the arithmetic shown alongside it (INT-004). Deterministic if/else, no model (INT-002). Where no penalty band is on file it says so rather than inventing a number. Booking pace of similar past departures is still missing, so "the block will sell out — request 10 more" is not offered yet; hotel allotments are not covered.

INT-122 · Group margin early warning

Status: PROPOSED · Owner: Management Committed cost (blocks, hotels, ground, visa) vs expected revenue per group as bookings, cancellations, FX and supplier changes happen; warns when margin drops below the target or a cost exceeds the rate sheet.

Visa and tickets (VISA, CXL)

INT-130 · Visa and ticket consistency

Status: PROPOSED · Owner: Operations Name on ticket ≠ passport; visa issued for a cancelled traveller; ticket issued for a traveller with no visa close to departure; cancelled passenger whose seat was not released or whose airline cancellation was never filed (CXL); refund received from airline with no ledger settlement.

Field operations and duty of care (FLD, INC, HLT)

INT-140 · Live trip watch

Status: PROPOSED · Owner: Operations Missed check-ins or headcount mismatch, flight delay affecting a transfer, hotel change not reflected in rooming, an elderly/special-needs traveller without a recent check-in, open Critical incident without an update within the response time (INC-003). Shown on the duty-of-care board and Customer 360.

INT-141 · Incident impact assistant

Status: PROPOSED · Owner: Operations When an incident is opened, list everything it touches: dependants (mahram/guardian), room-mates, flights, transfers, visa, insurance, money — each as a suggested checklist task. AI may draft family/consulate/insurer communications for a person to approve. Enforced by (partial): incident_impact_suggestions(passenger) (20260919130100_duty_of_care_incidents.sql) lists dependants (minors and, where the field exists, the guardian link), a possible mahram to review (PAX-022) and room-mates from the rooming assignments, each with a suggested task; the incident drawer shows them and "Add task" writes one checklist item after a confirmation. Suggestions never act on their own. Flights, transfers, visa, insurance and money are not covered yet; no AI drafting.

Finance (FIN, PRC, CXL)

INT-150 · Receivables and collection

Status: PROPOSED · Owner: Finance Suggest allocation of a receipt to the oldest dues of that customer/partner; rank overdue customers by amount × days × travel date proximity; propose reminder schedules; flag travel within N days with an unpaid balance before ticketing.

INT-151 · Bank and supplier matching

Status: PROPOSED · Owner: Finance Auto-match bank statement lines to approved receipts/payments by amount, date window, reference and payer name, with a confidence score; partial and split matches suggested; bank charges suggested as expense lines. A person confirms each match (bulk confirm allowed for high-confidence matches, still a confirmation).

INT-152 · Anomaly detection

Status: PROPOSED · Owner: Finance / Audit Duplicate payments (same party, amount, date window), refunds above paid amount or policy, back-dated or weekend/after-hours entries, round-amount manual journals, same person as maker and checker pattern attempts, vouchers posted to suspense, negative cash or bank balance, sudden change in a supplier's bank details, discounts above the limit (PRC-002), and ledger ↔ operational drift (AUD-010).

INT-153 · Cash-flow forecast

Status: PROPOSED · Owner: Finance Expected inflows from customer payment schedules and outflows from supplier deadlines (airline deposits/balances, hotel payments in SAR, visa fees), by week, in INR with FX exposure for foreign-currency liabilities; highlights weeks with a shortfall.

INT-154 · Tax and close assistant

Status: PROPOSED · Owner: Finance GST/TDS/TCS due dates with amounts computed from the books; missing PAN/GSTIN on parties who need them; period-close checklist with blockers (unapproved vouchers, unreconciled bank, pending refunds, unposted tour completions for revenue recognition FIN-001).

Management (all)

INT-160 · Daily brief

Status: PROPOSED · Owner: Management Each role home opens with a short brief generated from the signals above for that role's scope: what changed since yesterday, what is at risk, what needs a decision. Numbers come from the database; AI only writes the sentences (INT-002), and each sentence links to its source.

INT-161 · Ask the system

Status: PROPOSED · Owner: Engineering Natural-language search and questions ("which Umrah groups in October have unpaid balances over ₹1 L?") answered by calling permission-checked report functions and showing the rows used. If the question cannot be answered from available functions, it says so — it never guesses.

Governance

INT-030 · Signal review and thresholds

Status: PROPOSED (working defaults adopted 2026-09-18) · Owner: Management Monthly review of signal usefulness (INT-007) and dismissal reasons. Every threshold is a setting with a named owner, changed through a recorded setting change (UX-001), never in code. Working defaults:

Threshold Default Owner
Lead with no follow-up 3 days Sales Manager
Quotation expiring 7 days ahead Sales Manager
Seats left in a group ("filling up") 5 seats or 10% Operations Manager
Partner credit use warning 80% of limit B2B Manager
Departure window for readiness checks 30 days Operations Manager
Visa cut-off before departure 21 days Visa Officer
Payment due before departure 14 days Finance Manager
Back-dated voucher flag more than 3 days Finance Manager
Group margin warning below target by 2 percentage points CEO/GM
Cash floor ₹5,00,000 Finance Manager

"Season" for year-on-year comparisons is the Indian financial year (1 April – 31 March), so operating numbers line up with the statutory books; a group belongs to the season of its departure date. Where the business thinks in Hajj/Umrah seasons instead, the setting is changed once, here.

INT-031 · Tests

Status: PROPOSED · Owner: Engineering Every deterministic signal has tests named after its INT ID with a case that raises it and a case that must not. AI-backed features have a fixed evaluation set (questions → expected source rows) run before release.