# Dawid Czerwinski - Complete Architecture & Systems Specifications (llms-full.txt) > Comprehensive technical blueprints, schemas, and specifications for all 9 systems built by Dawid Czerwinski. --- ================================================================================ SYSTEM SPECIFICATION: BUSOS (ID: busos) Deep Link: https://czerwinskidawid.pl/#projects/busos ================================================================================ # National Transit Equity & Urban Gravity Platform (Urban Gravity Engine v9.1) ## 1. Project Mission & Analytical Scope The primary mission of this platform is to provide an empirical, high-fidelity quantification of the causal relationship between public transport accessibility and residential property values across **30 major Polish agglomerations**. By integrating high-resolution transit data (GTFS), comprehensive infrastructure context (OpenStreetMap), transactional real estate registries (RCN/GUGiK), and demographic grids (GUS NSP 2021), the system enables advanced modeling of Transit-Oriented Development (TOD) premiums and socio-economic equity. This platform is not merely a data aggregator; it is a **specialized spatial engineering engine** designed to eliminate "spatial noise". It solves fundamental data science challenges—such as preventing rural train stops from being evaluated like metropolitan hubs, stopping the "Gravity Fallacy" from erasing human populations, and preventing massive shopping malls from being outranked by 30 scattered park benches. It acts as a Digital Auditor of Urban Policy, revealing whether cities favor affluent districts or prioritize regional accessibility, while delivering completely clean, mathematically rigorous data sets (Parquet/GPKG) ready for Next.js mapping and deep econometric modeling. --- ## 2. Mathematical Architecture: Physics of the City (v13.0 - Rygor Tkanki Miejskiej) The most critical achievement of this platform is its custom-built **Urban Gravity Engine**, which relies on strict mathematical rules to simulate how humans move, choose services, and assign value to urban spaces. This is divided into three distinct phases: **Macro-Valuation**, **Calibrated Hybrid Clustering**, and **Dynamic Micro-Gravity Distribution**. ### A. Phase I: Macro-Valuation & Spatial Dissolve (Script 14) **1. The "Spatial Dissolve" Algorithm (v13.0):** To prevent artificial value inflation, the system unifies fragmented OSM complexes (e.g., a hospital with 15 pavilions) into a single analytical unit. * **Target:** Tier T0 (Mega Hubs) and T1 (National Magnets). * **Logic:** Buffers objects by 10m, dissolves by `name` and `tier`, and restores geometry. * **Result:** A 15-building campus is treated as **One Object** with summed area, preventing 15x weight multiplication. **2. The Balanced Tier Matrix (Urban Fabric Rescue):** Parks and religious sites are demoted to T6 to prioritize commercial/service density. * **T0 Mega Hubs:** 5,000,000 pts (Airports, Main Rail). * **T1 National Magnets:** 1,000,000 pts (Hospitals, University Campuses). * **T2 Strategic Hubs:** 250,000 pts (Malls, Commercial/Industrial Zones). * **T3 Local Cores:** 50,000 pts (High Schools, Theatres). * **T4 Daily Services:** 10,000 pts (Pharmacies, Banks, Convenience stores). * **T5 Specialized Gastro:** 2,500 pts (Restaurants, Hotels). * **T6 Micro Infra:** 100 pts (**Parks**, **Churches**, ATMs, Lockers). ### B. Phase II: Calibrated Hybrid Hub Agglomeration (Script 15) 1. **Semantic Phase:** Group by `norm_name` (150m threshold, `complete` linkage). 2. **Stitching Phase:** Merge different names (e.g. "Galeria Korona" and "IX Wieków") if centroids are within **100 meters**. ### C. Phase III: Dynamic Micro-Gravity Distribution (Script 15) **1. Dynamic Diminishing Returns (The High-Street Shield):** * **T0 / T1 (National Hubs):** Power = `0.2`. No floor. * **T2 (Strategic Hubs - Malls):** Power = `1.2`. **No floor** (Penalty falls to zero). * **T4 / T5 (Urban Fabric - Stores/Gastro):** Power = `1.0`. **20% RETENTION FLOOR** (Protects the High Street). * **T6 (Micro-Infra - Parks/Spam):** Power = `2.0`. **No floor** (Aggressively hits zero). **2. Shannon Entropy & Log-Normalized Z-Score:** `Local_Score = Z(log1p(infra)) * 0.35 + Z(log1p(transit)) * 0.35 + Z(log1p(pop)) * 0.15 + Z(log1p(market)) * 0.15` --- ## 3. System Architecture: The "Autonomous Hub" Model To ensure 100% scalability, data integrity, and parallel processing capabilities, the project utilizes a decentralized **City Hub** structure. Each of the 30 agglomerations is a self-contained operational unit located in `data/cities/{city_name}/`. This allows for independent processing, validation, and recovery without cross-contamination. * **`01_source/`**: The raw ingestion point for local GTFS feeds, regional OSM PBF extracts, and local RCN GML/WFS transactional files. * **`02_spatial/`**: Hardened, unified GeoPackage (GPKG) databases: * `stops.gpkg`: Validated transit nodes (Smart Stops). * `infrastructure.gpkg`: Multi-layer OSM data (points/polygons) strictly clipped to the city's transit zone. Preserves the full `all_tags` HSTORE. * `transactions.gpkg`: Unified real estate records with normalized `price_m2` and `lok_pow_uzyt` columns. * `population_250m.gpkg`: A localized, highly efficient demographic grid extracted from the massive national census file. * **`03_config/`**: Local intelligence layer containing `poi_valuation.json` (the city's specific "Gravity Price List" calculated by the Engine). * **`04_results/`**: Final analytical outputs, including the Stop DNA profiles (GPKG), raw Parquet matrices for frontend API delivery, and equity reports. --- ## 4. The Master Pipeline: 16 Steps to Perfection The system is fully automated and orchestrated via `orchestrator.py` (The "Pancerny" fault-tolerant runner). To rebuild the national dataset from scratch, the Orchestrator executes these numbered scripts sequentially from `scripts/pipeline/`. ### Phase 1: Environment & Spatial Isolation * **`00_init_environment.py`**: Validates the global directory structure, verifies CRS integrity across the workspace, and prepares the operational grid. * **`01_fetch_gtfs.py`**: Multi-threaded sync of 85+ Polish transit operators (ZTM, MPK, PKP). * **`02_collect_stops.py`**: Unifies Urban and Rail stops. Applies the crucial `normalize_name` regex function (stripping strings to raw alphanumeric core) to ensure perfect Agglomerative Clustering later. Identifies massive transport radii. * **`03_download_osm_pbf.py`**: Downloads the 2GB+ National OpenStreetMap binary (Geofabrik). * **`04_download_population.py`**: Ingests the National Census (GUS) 250m demographic grid and converts it to EPSG:2180. * **`05_extract_infrastructure.py`**: C++ Osmium + OGR high-performance pipeline. Clips the massive Poland PBF strictly to the 1.5km walking buffers of transit stops, saving massive amounts of RAM and disk space. * **`06_identify_rcn_teryt.py`**: Spatial intersection mapping transit hubs to specific administrative TERYT codes for real estate querying. ### Phase 2: Real Estate Hardening (RCN) * **`07_harvest_rcn_omnibus.py`**: Connects to the national WFS (GUGiK) to download vast XML troves of local real estate transactions. * **`08_fix_relational_data.py`**: Reconstructs broken, nested GML relationships (handling complex XLink pointers specific to Polish county databases like Łódź). * **`09_fix_suwalki_geometry.py`**: Global fallback algorithm restoring valid Point geometries for non-standard real estate multipolygons. * **`10_unify_schemas.py`**: Aggressive standardization of thousands of disjointed local RCN columns into a strict, unified economic format (price, area, date). * **`11_build_master_db.py`**: Concatenates all verified property records into the National Master Database (over 220,000 transactions). ### Phase 3: Urban Intelligence & The Gravity Engine * **`12_audit_data_quality.py`**: Mid-flight validation. Verifies coordinate validity, eliminates teleporting stops (0,0 coords), and audits schema compliance. * **`13_isolate_city_data.py`**: The "Splinter" process. Cuts the National Master DB and National Population grid into autonomous, localized GeoPackages per city, moving operations to the decentralized `data/cities/` architecture. * **`14_build_isc_valuation.py`**: **The Urban Intelligence Engine.** Parses the complex `all_tags` HSTORE of every building. Assigns Tiers (T0-T6) based on structural taxonomy (e.g., recognizing `uic_ref` to designate a National Rail Hub instead of just a generic station). Incorporates base city population logs and physical volume metrics to calculate the definitive Monetary Weight of every POI category in the city (`poi_valuation.json`). * **`15_compute_stop_dna.py`**: **The Grand Integrator.** * Merges Stops into Logical Hubs (`linkage='single'`, 150m). * Computes exact GTFS unique departures per hour without heavy drop_duplicate cloning (`nunique()`). * Dynamically maps the intelligence of Step 14 onto physical buildings. * Calculates highly optimized C-GEOS vectorized Euclidean distances to POIs. * Solves Huff Models strictly in-place (`.transform('sum')`) to prevent RAM Cartesian explosions (OOM). * Applies Tier-based Diminishing Returns and extracts 100% of the demographic grid. * Generates the unflattened, linear Local and National Z-Scores. * Exports ultra-lightweight `.parquet` matrices for Next.js UI integration and the final `stop_dna.gpkg` vectors. --- ## 5. Tooling & Auditing Suite (`scripts/tools/`) The platform enforces a "Verify, Then Trust" standard via rigorous auditing tools: * **`100_percent_dna_validator.py` (The Golden Auditor):** A massive, multi-threaded validation engine. It traverses the final `stop_dna.gpkg` for all cities, deduplicates logic hubs so reports reflect truth, validates statistical standard deviations (Z-Scores), audits population drift, and generates the massive `GOLDEN_DNA_AUDIT` Markdown reports. It ensures the Math is perfect before any map is rendered. * **`orchestrator.py`**: Not just a script, but the master commander of the pipeline. It handles parallel process streaming (running multiple cities on multiple CPU cores simultaneously), state management (`.pipeline_state.json`), failure resuming, and parameter parsing (e.g., `--cities kielce,krakow`). * **Utility Auditors:** `verify_isolation.py`, `generate_full_inventory.py`, `verify_final_pipeline.py`. --- ## 6. Technical Stack & Engineering Directives ### Stack: * **Language**: Python 3.12+ * **Core Libraries**: GeoPandas (C-GEOS), Pandas (NumPy vectorization), Shapely, scikit-learn (AgglomerativeClustering), pyarrow/fastparquet. * **Spatial Engines**: Osmium Tool (C++) for PBF clipping, GDAL/OGR 3.8+ (C++) for relational mapping. * **Databases / Formats**: OGC GeoPackage (GPKG) with R-Tree Spatial Indexing, Apache Parquet (for extreme frontend IO speed), H3 Hexagons. * **Coordinate Reference System**: EPSG:2180 (Poland CS92) strictly enforced for all distance and area physics. Exported to WGS84 (EPSG:4326) strictly at the end of the pipeline for Mapbox/Leaflet UI rendering. ### Development Directives (Senior Engineering Standard): 1. **C-Level Vectorization First**: Python `apply(lambda)` loops over massive spatial frames are banned. Distance calculations and gravity models must be reduced to flat arrays (e.g., `x.values`, `y.values`) or utilize native C bindings (`geometry.distance()`). 2. **No RAM Cartesian Explosions**: Complex `groupby.sum()` followed by `merge()` on multi-million row DataFrames are banned. Memory must be preserved using in-place operations like `.transform('sum')` and pre-join duplication pruning. 3. **Absolute RCA**: Every implementation failure undergoes a rigorous Root Cause Analysis. Solutions address the source of the problem (e.g., normalizing names in Step 02), rather than patching the symptoms downstream (in Step 15). 4. **Idempotency**: Pipeline scripts are designed to skip existing, valid data to ensure rapid recovery and low resource waste. Force updates are managed explicitly by the Orchestrator. --- ================================================================================ SYSTEM SPECIFICATION: JOBHUNT (ID: jobhunt) Deep Link: https://czerwinskidawid.pl/#projects/jobhunt ================================================================================ # JobHunt — Universal Multi-Profile Recruitment Pipeline & Automation Monorepo [![Architecture: Monorepo](https://img.shields.io/badge/Architecture-Monorepo%20Local--First-blue.svg)](file:///home/gzyms/Dev%20Projects/JobHunt) [![Stack: Node.js / Python / Docker / Next.js](https://img.shields.io/badge/Stack-Node.js%20%7C%20Python%20%7C%20Docker%20%7C%20Next.js-emerald.svg)](file:///home/gzyms/Dev%20Projects/JobHunt) [![AI Engine: Local-First Ollama & OpenRouter](https://img.shields.io/badge/AI%20Engine-Local--First%20Ollama%20%7C%20OpenRouter-orange.svg)](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/ai-provider.mjs) [![Diagnostics: 7-Tab Suite & E2E Trace](https://img.shields.io/badge/Diagnostics-7--Tab%20Suite%20%26%20E2E%20Trace-blueviolet.svg)](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/web/src/app/diagnostics/page.tsx) [![Maintenance: 1-Click Cleanup Suite](https://img.shields.io/badge/Maintenance-1--Click%20Cleanup-crimson.svg)](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/cleanup.mjs) [![Test Suite: 1570 Tests Passing](https://img.shields.io/badge/Tests-1570%20Passing-success.svg)](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/test-all.mjs) [![Typesetting: LaTeX pdflatex UTF-8](https://img.shields.io/badge/Typesetting-LaTeX%20pdflatex%20UTF--8-purple.svg)](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/templates/cv-template.tex) [![Providers: 28 Active Portals](https://img.shields.io/badge/Providers-28%20Active%20Portals-success.svg)](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/portals.yml) **JobHunt** is an enterprise-grade, privacy-first, multi-candidate automated recruitment operating system and monorepo. It manages the entire lifecycle of high-scale job application campaigns: from multithreaded portal scraping across 28 global and domestic providers with stealth WAF evasion, through local/cloud LLM evaluation and scoring rubrics, down to dynamic LaTeX CV tailoring with 3-tier caching, automated LinkedIn Easy Apply browser orchestration, 1-click maintenance cleanup, and Dockerized Gmail SLA status tracking. --- ## 1. Executive TL;DR & System Overview ### 1.1 What is JobHunt? JobHunt solves the friction, fatigue, and latency of running high-volume, hyper-targeted job application campaigns. Instead of relying on manual form submissions, generic untailored resumes, or slow manual scraping, JobHunt treats job hunting as a **distributed, deterministic data pipeline**. ``` [28 Job Portals / ATS Feeds] ──► [Stealth WAF Scraper] ──► [Pipeline Queue (data/pipeline.md)] │ ▼ [Docker Gmail SLA Monitor] ◄── [Selenium Easy Apply] ◄── [AI Evaluator & Scorecard (0-5)] │ ▲ │ ▼ │ ▼ [SQLite jobs.db] [Tailored LaTeX PDFs] ◄── [3-Tier Cache (L1/L2/L3)] ``` ### 1.2 Core Architectural Philosophies 1. **Local-First & Privacy Isolation:** All candidate identity profiles, master resumes (`cv.md`), evaluation reports, compiled PDFs, and database records live on local disk. No candidate data is shared across profiles or uploaded to proprietary third-party servers. 2. **Zero-AI for Metadata (Deterministic Data Flow Mandate):** URLs, company IDs, contract types, raw salary numbers (`__NEXT_DATA__` React Query dehydrated states), and job IDs are handled **100% deterministically** via structured parsers. AI is strictly isolated to qualitative analysis (matching experience against requirements, scorecard computation, and keyword rewriting). 3. **Anti-Fabrication & CV-First Prompting:** Resumes and cover letters are generated *exclusively* by reformulating verified achievements from candidate source-of-truth files (`cv.md`, `profile.yml`, `story-bank.md`). Skills and tech stacks outside the candidate's authentic background are strictly forbidden. 4. **Multi-Candidate & Dual-Track Separation:** Multiple job seekers and dual career tracks (e.g. IT Fullstack/AI vs Logistics/Operations) operate independently through isolated configuration directories in `profiles//` with instantaneous bidirectional write-back sync. 5. **Resilient AI Waterfall & 3-Tier Cache:** Seamless fallback from local Ollama instances (`gemma4:latest`) to cloud LLMs (OpenRouter) on HTTP 429 rate limits, backed by L1 (per-job), L2 (archetype), and L3 (component) caches enabling $<1\text{s}$ zero-shot PDF re-compilations. 6. **1-Click Maintenance & Zero Zombie Footprint:** Granular and bulk maintenance operations prune orphan processes, stale pipeline listings, temporary LaTeX junk, and cache drift with dark-mode native confirm modals. --- ### 1.3 Monorepo Subsystem Matrix | Subsystem / Module | Directory / Path | Tech Stack | Runtime / Port | Core Responsibilities | | :--- | :--- | :--- | :--- | :--- | | **`career-ops` Engine** | [`career-ops/`](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops) | Node.js (ESM), Playwright Chromium | CLI / Node 18+ | 28 portal providers, deduplicated scanning, LLM scorecard evaluation, LaTeX building, ATS repair engine. | | **`career-ops/web`** | [`career-ops/web/`](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/web) | Next.js 14 (App Router), React, Tailwind | HTTP `:3000` | Full command center UI: 11 views (`/`, `/pipeline`, `/jobs`, `/apply`, `/inbox`, `/cv`, `/profiles`, `/diagnostics`, `/explorer`, `/config`, `/jobs/[id]`). | | **AI Subsystem Core** | [`career-ops/ai-provider.mjs`](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/ai-provider.mjs) | OpenRouter REST, Ollama REST | Local / Cloud | Universal AI provider with local-first priority, fallback waterfall, JSON validation, and circuit breakers. | | **Diagnostics & Testing Suite** | [`career-ops/web/src/app/diagnostics`](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/web/src/app/diagnostics) | TypeScript, Node.js Test Harness | HTTP `:3000` & CLI | 7-tab diagnostics center (Portals, E2E Trace, CV Matrix, AI Providers, System, Suite Runner with 1570 tests, Maintenance & Storage). | | **1-Click Cleanup & Maintenance** | [`career-ops/cleanup.mjs`](file:///home/gzyms/Dev%20Projects/JobHunt/career-ops/cleanup.mjs) | Node.js, Next.js API, ConfirmModal | CLI & Web UI | Granular and bulk cleanup of runs, pipeline purge, LaTeX artifacts, orphaned cache, and Docker log rotation. | | **`Auto_job_applier_linkedIn`** | [`Auto_job_applier_linkedIn/`](file:///home/gzyms/Dev%20Projects/JobHunt/Auto_job_applier_linkedIn) | Python 3.10+, Selenium, BeautifulSoup | Python CLI | Automated LinkedIn Easy Apply application bot, answers database, session cookie handling, safety gate `pause_before_submit`. | | **`job-ops`** | [`job-ops/`](file:///home/gzyms/Dev%20Projects/JobHunt/job-ops) | Docker Compose, Node.js, SQLite | HTTP `:3005` (mapped from `:3001`) | Background container tracking recruiter emails, Gmail SLA compliance monitoring, and SQLite database `jobs.db`. | | **`profiles/` Engine** | [`profiles/`](file:///home/gzyms/Dev%20Projects/JobHunt/profiles) | Bash, YAML, Node.js | Local Filesystem | Dual-track candidate profile store (`dawid_czerwinski`, `dawid_czerwinski_logistics`), deployment scripts, and write-back sync. | | **Behavioral Intelligence** | [`ai-job-search/`](file:///home/gzyms/Dev%20Projects/JobHunt/ai-job-search) | Markdown, Python, LaTeX | Local Filesystem | 7-layer framework: candidate narrative, behavioral profile, writing style DNA, salary lookup, negotiation scripts, STAR story bank. | | **Root Orchestrator** | [`dev.sh`](file:///home/gzyms/Dev%20Projects/JobHunt/dev.sh) | Bash | Native CLI | Single unified command-line entrypoint to start, stop, monitor, and manage the entire monorepo process tree. | --- ### 1.4 60-Second Quickstart ```bash # 1. Start Next.js Command Center on http://localhost:3000 ./dev.sh start # 2. Start Docker Gmail SLA tracking container ./dev.sh docker-up # 3. Check system health and active profiles ./dev.sh status # 4. Run multi-threaded scraper across all 28 portals cd career-ops && npm run scan # 5. Evaluate pending listings with local Ollama LLM npm run ollama:eval -- --pipeline --limit 10 # 6. Compile tailored LaTeX CV variant for job #046 node notifications/cv-generator.mjs --job 46 --mode light # 7. Run automated test suite (1570 tests) npm test # 8. Run 1-click maintenance cleanup node cleanup.mjs --all ``` --- ### 1.5 Performance & Reliability Benchmarks * **LLM Evaluation Latency:** Reduced from **~45s to ~9.26s per job** (65% speedup) by prioritizing `cv.md` at the prompt start, moving machine-readable `---SCORE_SUMMARY---` blocks to the very top of output generation, and setting `repeat_penalty: 1.15` to eliminate generation loops. * **Zero-Shot PDF Re-compilation:** Re-rendering tailored PDFs from L1/L2 cache takes **$<1.0\text{s}$** without invoking AI models. * **Typesetting Stability:** Strict LaTeX preamble with `[utf8]{inputenc}`, `[T1]{fontenc}`, and explicit `\nopagebreak[4]` tags ensures **0 orphan headers, 0 page-break widows**, and 100% support for Polish diacritics (`ę`, `ą`, `ł`, `ó`, `ś`, `ć`, `ż`, `ź`, `ń`). * **Scraper Resiliency:** 28 active portal providers operating with `0 skipped — no provider matched` across domestic (Pracuj.pl, JustJoin.it, NoFluffJobs, SolidJobs) and international boards (Himalayas, Arbeitnow, WeWorkRemotely, RemoteOK, 4DayWeek, Arbeitsagentur, The Hub). * **Test Suite Coverage:** 1570 automated assertions executing across CV matrix tests, E2E pipeline simulation, system integration probes, and documentation integrity. --- ## 2. End-to-End System Topology & Data Flow ### 2.1 Master Architecture Topology ```mermaid graph TD %% LAYER 1: PROFILES & IDENTITY subgraph L1 ["1. Candidate Identity & Profiles Layer"] P_Dir["Candidate Profiles Store
(profiles/dawid_czerwinski/ & logistics/)"] P_UI["Web Profiles Hub
(/profiles)"] P_Sync["Profile Sync Engine
(profiles.ts / load-profile.sh)"] P_Active["Active Workspace Identity
(career-ops/cv.md & config/profile.yml)"] P_UI <-->|Bidirectional Write-Back| P_Dir P_Sync -->|Deploys to Workspace| P_Active end %% LAYER 2: SCRAPING & STEALTH WAF subgraph L2 ["2. Multithreaded Scraper & Stealth Engine (28 Providers)"] Scan_CLI["Scanner CLI
(scan.mjs)"] Portals_YAML["Portal Config & Geo Filters
(portals.yml)"] Providers["28 Native Providers
(providers/*.mjs)"] Playwright_WAF["Chromium Stealth Engine
(browser-extract.mjs)"] Dedupe_TSV["Deduplication History
(data/scan-history.tsv)"] Pipe_MD["Unprocessed Queue
(data/pipeline.md)"] Portals_YAML --> Scan_CLI P_Active -.->|Title/Geo Rules| Scan_CLI Scan_CLI --> Providers Providers --> Playwright_WAF Playwright_WAF -->|Check Seen URLs| Dedupe_TSV Playwright_WAF -->|Append Valid Listings| Pipe_MD end %% LAYER 3: AI EVALUATION & 3-TIER CACHE subgraph L3 ["3. AI Evaluation Waterfall & 3-Tier Cache"] Eval_CLI["Evaluator CLI
(ollama-eval.mjs / openrouter-runner.mjs)"] AI_Water["AI Waterfall Engine
(ai-provider.mjs)"] OpenRouter["Cloud Provider
(OpenRouter REST API)"] Ollama_Local["Local Engine
(Ollama gemma4:latest)"] Reports_MD["Markdown Reports
(reports/###-company-date.md)"] Debug_JSON["Raw Diagnostic Dumps
(reports/debug/###-dump.json)"] App_Tracker["Master Tracker
(data/applications.md)"] Cache_Store["3-Tier Cache Storage
(output/cv-cache/)"] Pipe_MD --> Eval_CLI P_Active --> Eval_CLI Eval_CLI --> AI_Water AI_Water -->|Primary Call| OpenRouter OpenRouter -.->|Fallback on HTTP 429/Timeout| Ollama_Local AI_Water --> Reports_MD AI_Water --> Debug_JSON AI_Water --> App_Tracker AI_Water --> Cache_Store end %% LAYER 4: AGENTIC CV GENERATION & LATEX subgraph L4 ["4. Agentic CV Generation & LaTeX Compilation"] CV_Engine["CV Generator Engine
(notifications/cv-generator.mjs)"] LaTeX_Tpl["A4 UTF-8 Template
(templates/cv-template.tex)"] LaTeX_Build["LaTeX Assembler & Compiler
(build-cv-latex.mjs / generate-latex.mjs)"] PDF_Out["Multi-Variant PDF Artifacts
(output/cv-###-company-mode.pdf)"] Cache_Store --> CV_Engine P_Active --> CV_Engine CV_Engine --> LaTeX_Tpl LaTeX_Tpl --> LaTeX_Build LaTeX_Build -->|pdflatex execution| PDF_Out end %% LAYER 5: INTERFACES, MAINTENANCE & AUTOMATION subgraph L5 ["5. Web Command Center, Maintenance, Easy Apply & SLA Tracking"] Web_Hub["Next.js Web UI
(http://localhost:3000)"] CV_Hub["Resume Hub (/cv)
Live PDF iFrame & Diffs"] Diag_Hub["Diagnostics Hub (/diagnostics)
7-Tab Testing Suite A-Z"] Jobs_Hub["Applications Tracker (/jobs)
Multi-Select & Batch Deletion"] Inbox_Hub["Inbox SLA Triage (/inbox)
Gmail Recruiter Matcher"] Cleanup_Suite["1-Click Cleanup Engine
(cleanup.mjs & ConfirmModal)"] LinkedIn_Bot["Selenium Easy Apply Bot
(Auto_job_applier_linkedIn)"] Docker_SLA["Docker Gmail SLA Monitor
(job-ops on :3005)"] SQLite_DB["Recruitment Database
(job-ops/jobs.db)"] PDF_Out --> CV_Hub Web_Hub --> CV_Hub Web_Hub --> Diag_Hub Web_Hub --> Jobs_Hub Web_Hub --> Inbox_Hub Web_Hub --> Cleanup_Suite Web_Hub --> LinkedIn_Bot LinkedIn_Bot -->|Submits Application| PDF_Out Docker_SLA --> SQLite_DB Web_Hub <-->|Live Query| SQLite_DB end ``` --- ### 2.2 Sub-Diagram 1: Multi-Provider Scraping & Anti-Bot Evasion ```mermaid sequenceDiagram autonumber participant CLI as Scanner (scan.mjs) participant Provider as Provider (e.g. pracuj.mjs) participant WAF as Playwright Chromium Stealth participant Target as Job Portal / ATS Server participant Pipe as Storage (pipeline.md) CLI->>Provider: Execute scan with location & keyword filters Provider->>WAF: Launch headless browser (--disable-blink-features=AutomationControlled) WAF->>Target: GET /praca with desktop Chrome headers (sec-ch-ua, accept-language) Target-->>WAF: Return HTML payload (with Cloudflare WAF clear) alt Dehydrated React Query State (__NEXT_DATA__) WAF->>Provider: Extract