PRODUCTION TECHNICAL DOCUMENTATION

CoverCraft Architecture: From Naive GenAI to Evidence-Grounded Application Intelligence

An architectural deep dive into technical honesty, zero-hallucination trust boundaries, deterministic application-layer scoring, real-time web grounding, and Model Context Protocol (MCP) orchestration.

01

The High-Level Architectural Vision

Standard generative AI tools treat job applications as creative writing exercises. When a candidate uploads their resume and a target job description, conventional tools pass them as raw prompt text to an LLM with instructions like "Write an impressive cover letter highlighting why I am a 95% match."

In reality, hiring managers, senior engineering reviewers, and automated screening systems evaluate applications through the lens of verifiable evidence. CoverCraft was designed from the ground up to replace creative text generation with an Evidence-Backed Application Intelligence Topology.

🏛️ DIAGRAM 1: Evidence Layer & Isolation Boundary Topology

Strict Context Pipeline with Quarantined Ingestion

100%
Candidate Resume (Raw PDF/DOCX)Quarantined · 5MB Limit · Null-Byte SanitizedJob Description (Raw Text)Competency Vector Extractor · 10K Char CapLive Web Search (Tavily Search API)Grounding · Official Domains · Recent NewsTIER 1: IMMUTABLE SYSTEM INSTRUCTION & STRICT TRUST BOUNDARIES<user_resume> [Zero Hallucination Quarantine] · <job_description> · <verified_web_sources> [Citations Bound]TIER 2: DETERMINISTIC APPLICATION-LAYER ENGINE (Next.js Edge / Node)Mathematical Weighted Summation: (Strong×1.0 + Partial×0.6 + Transferable×0.4) / Total · Verbatim Quote VerificationEvidence Cover LetterJob Fit Radar & Donut4-Card Company DossierInterview Defense Ledger
Tip: Use zoom controls above or expand to inspect nodes on mobile/laptop.
02

The Naive AI Wrapper Fallacy vs. Enterprise Evidence Architecture

When software engineers evaluate generative AI products, the primary question is: "Is this an ungrounded prompt wrapper around an OpenAI or Gemini endpoint, or is there an authentic software and verification architecture?"

Architecture DimensionTypical Naive AI WrapperCoverCraft Enterprise Architecture
Match ScoringLLM asked to guess a percentage ("Match: 92%"). Non-deterministic, unrepeatable, hallucinates high scores.Deterministic formula computed in application layer. LLM only categorizes evidence; math is calculated in code.
Candidate ClaimsModel invents accomplishments ("Led team of 25", "Built scalable Kubernetes infra") not present in resume.Strict <user_resume> quarantine. Every claim must have a verbatim quote. Unsupported claims are flagged as HIGH RISK.
Company IntelGeneric flattery ("I admire your innovative culture and passion for excellence"). Stale training data cutoff.Real-time Tavily search engine integration. 4 structured cards with clickable [1], [2] citation pills to original web sources.
ATS AuditClaims proprietary ATS score (e.g., "94/100 ATS Score"), which is deceptive since no ATS exposes private scoring algorithms.Deterministic 6-point heuristic check (keyword density, format parseability, contact presence) with explicit technical disclaimer.
Tool TransparencyBlack box opaque spinner. No visibility into system prompts, tool calls, or failure fallbacks.Model Context Protocol (MCP) stream terminal. 6 registered tools logging execution events with expandable JSON schema payloads.
03

Context Isolation, Sanitization & Prompt Security

CoverCraft decouples prompt logic into isolated policy files stored in src/prompts/. The architecture enforces three distinct context layers:

Layer 1: Immutable Policy

System Instructions

Passed strictly into the LLM's systemInstruction parameter. Developer rules: Anti-flattery, strict evidence requirement, JSON schema enforcement.

Layer 2: Untrusted Data

XML Boundary Quarantine

Raw candidate resumes and job descriptions are treated as untrusted inputs. They are wrapped in explicit boundary tags: <user_resume> and <job_description>.

Layer 3: Schema Validation

Structured Output Enforcement

Enforces responseMimeType: "application/json". Raw unparseable text is rejected, preventing prompt injection bypasses.

🛡️ Document Ingestion & Sanitization Engine (/api/parse-resume)

Before parsing reaches the AI engine, uploaded files pass through a multi-stage security pipeline:

  • Strict 5 MB Size Gate: Files exceeding 5,242,880 bytes are rejected immediately at the HTTP boundary.
  • Multi-Format Parser: Native PDF extraction using pdf-parse on Uint8Array buffers; DOCX extraction using mammoth; raw UTF-8 text decoding for TXT.
  • Null-Byte & Control Character Stripping: Eradicates null bytes () and malicious control characters that cause buffer exploits or database parse errors.
  • Prompt Injection Heuristic Scanner: Automatically scans for adversarial injection patterns (e.g., "ignore all previous instructions", "system prompt:", "<|im_start|>") and flags suspicious documents with a security warning.
  • Character Quotas: Maximum 15,000 characters for resumes and 10,000 characters for job descriptions to prevent token exhaustion denial-of-service.
04

Technical Honesty: Deterministic Application-Layer Scoring

One of the most critical engineering decisions in CoverCraft is eliminating Black-Box LLM Score Hallucination. When an LLM is asked to output an overall fit percentage, it generates an impressionistic, non-reproducible number. CoverCraft removes scoring authority from the LLM entirely.

🏛️ DIAGRAM 2: Deterministic Scoring Flowchart

Categorical Classification to Mathematical Summation

100%
STEP 1: Target JD Requirements Parsed into Discrete Competencies (N Total)STRONG_MATCHWeight: 1.0xVerbatim Resume Quote RequiredPARTIAL_MATCHWeight: 0.6xRelated Tooling / Tech StackTRANSFERABLEWeight: 0.4xFoundational Adjacent CompetencyMISSINGWeight: 0.0xRequirement Honestly Framed as GapSTEP 2: Deterministic Calculation in Application Code (src/app/api/analyze/route.js)Score = Math.round( ((Strong × 1.0) + (Partial × 0.6) + (Transferable × 0.4) + (Missing × 0.0)) / Total × 100 )
Tip: Use zoom controls above or expand to inspect nodes on mobile/laptop.
⚡Interactive Live Calculator Demo: Test the Deterministic Equation
Calculated Coverage: 75% (7/8 Requirements)
Formula: ((5 × 1.0) + (1 × 0.6) + (1 × 0.4) + (1 × 0.0)) / 8 × 100 = 75%
05

Real-Time Web Grounding & The 4-Card Company Intel Dossier

Static LLMs suffer from knowledge cutoffs and cannot know a company's live hiring status, engineering priorities, or workplace reputation in 2026. CoverCraft integrates a deep real-time web retrieval and intelligence pipeline in src/app/api/research/route.js.

🌐 Tavily 8-Page Live Crawl

Deep multi-page crawl targeting company engineering, tech stack, and portal postings.

⚡ Jina AI Deep Reader

High-fidelity markdown scraping via r.jina.ai with zero JavaScript, cookie, or ad bloat.

🛡️ Vendor & Staffing Shield

Detects third-party staffing payrolls (C2H/agencies) with strict verbatim JD quotation proof.

🏛️ DIAGRAM 3: Tavily Search & 4-Card Synthesis Flowchart

Live Grounding to In-Text Interactive Citations

100%
Target Company + Role"Google DeepMind AI research 2026"Tavily Advanced Search EngineFallback: Gemini Google GroundingDeduplication & CategorizerOfficial · Research · News DomainsCARD 1: SNAPSHOT2-3 Sentence Mission ScaleTagged Sources CountIn-Text Citation Markers [1]CARD 2: ROLE SIGNALSTechnical Capability AreasAligned to Target Role"Why this matters" CalloutCARD 3: RECENT SIGNALSLatest 2026 AnnouncementsarXiv Papers & LaunchesDirect [Open &nearr;] External LinksCARD 4: CITED SOURCESDomain AttributionSnippet Verbatim QuotationsInteractive Modal Drawer
Tip: Use zoom controls above or expand to inspect nodes on mobile/laptop.
Interactive Citation Engine:

Whenever the model asserts a fact (e.g., "Google DeepMind developed the AMIE multi-agent clinical reasoning system [3]"), the citation token [3] is rendered as an interactive button. Clicking it opens a floating modal with the exact source title, category, relevance rating, snippet quote, and direct external URL.

06

Model Context Protocol (MCP) & Execution Transparency

CoverCraft implements the open Model Context Protocol (MCP) standard, exposing an extensible tool server in mcp-server/server.py and a streamable execution trace terminal in the frontend.

1. jd_analyzer

Extracts required competency vectors and separates hard technical prerequisites from nice-to-haves.

2. web_search

Executes real-time Tavily search queries for company developments and engineering initiatives.

3. source_filter

Deduplicates URLs, removes SEO noise, and classifies domains into Official, Research, or News.

4. company_intelligence

Synthesizes evidence-backed company dossier with explicit in-text citations.

5. evidence_validator

Claim Ledger gatekeeper: Quarantines statements inside <user_resume> boundary.

6. cover_letter_generator

Drafts 4-paragraph evidence-first cover letter using Gemini 3.5 with fallback to 3.8.

07

Adversarial Interview Defense Harness

Writing an impressive cover letter is only half the battle. If a candidate cannot defend the claims during a grueling technical or behavioral interview, the application fails. CoverCraft introduces an Adversarial Cross-Examination Engine (src/prompts/interview-defense.system.js).

Pre-Emptive Machine Cross-Examination

The model assumes the role of an adversarial senior interviewer interrogating every claim in the generated cover letter. For each potential vulnerability:

HIGH RISK

Skills marked as transferable or partial where the candidate lacks direct production tenure.

MEDIUM RISK

Quantified metrics that an interviewer will probe for architecture details and individual contribution.

LOW RISK

Well-established baseline qualifications verified by multiple resume projects.

08

Generative UI Architecture & Component Hydration

Legacy AI applications suffer from the "Markdown Wall" anti-pattern — returning unstructured text blocks that force users to copy-paste into an external editor. CoverCraft rejects this paradigm by implementing a full Generative UI Architecture. Instead of raw prose, the LLM emits structured telemetry payloads that the Next.js frontend dynamically compiles into interactive, stateful React components on the fly.

01Interactive In-Text Citation Badges

Footnote tags like [1] and [2] within the synthesized letter are not plain text. The client-side parser parses regex tokens and mounts clickable interactive badges that trigger an Evidence Drawer displaying domain attribution, publication dates, and verbatim source quotations.

02Human-in-the-Loop Approval Gate

Before synthesis begins, the pipeline renders live curation checkboxes across 4 intelligence cards. Users can inspect extracted Tavily search signals, veto any hallucinated or irrelevant company facts, and dictate exactly what evidence the letter synthesizer is permitted to cite.

03Editable Paragraph Accordion & Live PDF Engine

Generated paragraphs hydrate into individual modular sections with real-time word counting, inline rich-text editing, and instant LaTeX-formatted PDF compilation via react-to-print. Candidates can customize tone sentence-by-sentence with zero layout shift.

04Collapsible Adversarial Defense Flashcards

The interview defense harness generates reactive flashcards equipped with risk tier badges (HIGH, MEDIUM, LOW), recruiter psychological intent analysis, and expandable "Anchored Resume Proof" snippets so candidates can rehearse live interview answers before walking into the room.

⚡
Full Stack React 19 Client Hydration: Structured JSON schemas emitted by Gemini → Client-side state machine (step: approval_gate → generating → results) → Interactive Generative UI components. Zero page refreshes.
09

Codebase Audit & Technical Verification Directory

Every system, formula, boundary, and protocol described in this documentation maps directly to production code files in the repository:

System Prompts:
src/prompts/cover-letter.system.js
src/prompts/job-analysis.system.js
src/prompts/interview-defense.system.js
API Routes & Engine:
src/app/api/analyze/route.js
src/app/api/research/route.js
src/app/api/parse-resume/route.js
MCP Protocol Server:
mcp-server/server.py
mcp-server/requirements.txt
UI & Visualization Suite:
src/components/generator/ResultsPanel.jsx
src/components/generator/InputForm.jsx
Architect Spotlight · Featured by UptimeRobot
Read Official Feature Article↗

Engineered by Ambuj Kumar Tripathi

Ambuj's Cloud Environment: Up

Independent GenAI Engineer · Ex-British Telecom Automation · Gorakhpur, India

“The LLM is the least reliable part of your entire stack. That is why CoverCraft was engineered with deterministic ATS scoring, circuit breakers, and MCP tool verification instead of trusting raw generative models.”

Experience CoverCraft in Action

Upload your resume, analyze real job requirements, and inspect the live MCP trace.

Launch CoverCraft→