Context-Aware SmartBooking Protocol
- Recon First: ALWAYS scan
routes/andtests/BEFORE opening the browser. Codebase truth TRUMPS assumptions. - Persona Integrity: ALWAYS act as "Lex Luthor" (
config/identity.json). - Temporal Safety: ALWAYS calculate T+30 using
scripts/date_calculator.js. - Fiscal Safety: NEVER use real cards. DETECT gateway in code or UI; inject Sandbox creds (
config/payment_cards.json). - Resilience: NO
sleep(). Use Semantic Polling.
1. Codebase Reconnaissance (Grey Box Phase)
- Goal: Identify the Entry Point and Data Constraints by reading the code.
- Action:
- Locate Routes: Scan
routes/web.php,config/routes.rb, orapp/router.js.- Search: "booking", "checkout", "reserve", "cart".
- Extract: The concrete URL path (e.g.,
/tours/book/{id}).
- Inspect Models: Check
app/Models/orsrc/types/for validation rules.- If
Flighthasrequires_passport, Then PREPARE passport data. - If
Tourhaswaiver_required, Then EXPECT a signature pad.
- If
- Review Existing Tests: Peek at
tests/Featureorcypress/e2e.- Learn: What is the "Happy Path"? Are there specific query params needed?
- Locate Routes: Scan
2. Strategy Synthesis
- Target Definition:
- IF
target_urlis provided: USE it. - IF NOT: CONSTRUCT it from the Route Scan (e.g.,
localhost:8000/tours/1).
- IF
- Data Prep: Load
config/identity.json. MERGE with specific constraints found in CodeScan (e.g., "Add Passport Number" if model requires it).
3. Execution (Browser Phase)
- Navigate: Go to the Target URL.
- Detect & Adapt:
- Flight: "IATA", Plane icons. -> Route
MCI->IAD. TSA:01/01/1980/M. - Movie: "Showtime", Grid. -> Center-seek seat. Handle "Gap Error".
- Tour: "Guide", Cal. -> 1 Adult. Sign Waiver.
- Flight: "IATA", Plane icons. -> Route
- Smart Navigation (T+30):
- Locate Calendar.
- CLICK "Next" (
>) until T+30 month matches. - SELECT day.
4. Payment & Validation
- Gateway Detection (Code + UI):
- Code Check: Does
config/services.phpmentionstripe,paypal,razorpay? - UI Check: look for
iframeor redirect.
- Code Check: Does
- Injection:
- Stripe:
iframe__privateStripeFrame. Visa4242.... - PayPal: Login
config/identity.json(email/pwd). - Razorpay: Click "Success".
- Square: Zip
66632.
- Stripe:
Code-Guided Recovery
- 404 Not Found: IF Url fails, RECHECK
routes/for prefix (e.g.,/api/v1vs/v1). - Validation Error: IF form rejects input, GREP the error message in the codebase to find the specific regex validation rule (e.g.,
Regex('/^\d{10}$/')) and ADAPT input.
Modal Warfare
- Z-Index Overlays: Close popups ("Sign up", "Cookies").