# CatchAI Text - Full Technical Context & System Specifications

> CatchAI Text is a privacy-first, free AI text detector and writing analysis workspace that operates locally in the browser.

CatchAI Text follows Jakob's Law of Internet User Experience, providing an immediately familiar document editor modeled on Grammarly and QuillBot. It provides transparent, 100% client-side stylometric verification (sentence burstiness, syntactic perplexity variance, Shannon entropy, and vocabulary richness) with zero server uploads, full FERPA and COPPA compliance, and local offline OCR.

## Architecture & Jakob's Law Design
- **Writing Editor Workspace**: Clean, distraction-free document canvas supporting Word (.docx), PDF, Markdown (.md), and plain text (.txt) ingestion up to 20MB.
- **Anchored Bottom Action Dock**: Positioned at the bottom of the editor canvas, providing live word count, character count, reading time estimation, and a high-contrast primary "Detect AI Text" action button.
- **Prominent Circular Confidence Gauge**: Visual confidence score delivering an instant Academic Integrity Verdict (e.g., "Likely Human-Written" vs "Likely AI-Generated") with calibrated false-positive safeguards.
- **Sentence-by-Sentence Explainable Highlights**: Visual color-coded breakdown highlighting human burstiness and syntactic variance versus low-entropy uniformity.
- **Diagnostic Metrics**: Deep forensics drawer providing Shannon entropy, Zipf's Law distribution fit, Herdan's C lexical diversity, and syntactic perplexity.

## Stylometric Extraction Engine
CatchAI Text extracts 10 core statistical stylometric features client-side in under 50ms:
1. **Sentence Length Burstiness Variance**: Standard deviation of clause and sentence lengths normalized by mean sentence length. Humans write with high burstiness; LLMs produce low burstiness.
2. **Shannon Unigram Entropy**: Information density and word predictability calculated across the token distribution.
3. **Zipf's Law Goodness-of-Fit**: Adherence of vocabulary frequencies to natural power-law distributions.
4. **Herdan's C Lexical Diversity**: Logarithmic Type-Token Ratio (log(V) / log(N)) measuring vocabulary breadth across document lengths.
5. **Syntactic Perplexity Variance**: Variance in grammatical complexity and punctuation pacing across paragraphs.
6. **Repetition Index**: Frequency of phrase and n-gram recycling common in machine-generated text.
7. **Punctuation Diversity**: Pacing distribution across commas, em-dashes, semicolons, and terminal periods.
8. **Clause Complexity**: Subordination and coordination ratio per sentence.
9. **Transition Density**: Proportion of formulaic transition signposts (e.g., "Furthermore", "In conclusion").
10. **Vocabulary Richness**: Ratio of rare and discipline-specific vocabulary relative to general domain corpora.

## Privacy & Compliance
- **100% Client-Side Execution**: All stylometric computations execute inside the user's browser sandbox using WebAssembly and pure TypeScript. Zero bytes of document text are sent to external servers for AI detection.
- **FERPA & COPPA Compliant**: Safe for educational institutions, K-12 schools, and universities. Student essays and confidential research papers remain completely private on the user's machine.
- **Offline OCR**: Optical character recognition is performed in-browser using Tesseract WebAssembly, ensuring photos of handwritten work or printed exams never leave the device.

## System Interfaces & Endpoints
- **Web App**: https://catchaitext.com/
- **OCR Studio**: https://catchaitext.com/#ocr
- **OpenAPI Schema**: https://catchaitext.com/openapi.json
- **AI Plugin**: https://catchaitext.com/.well-known/ai-plugin.json
- **WebMCP**: https://catchaitext.com/webmcp.js
- **XML Sitemap**: https://catchaitext.com/sitemap.xml
- **Primary Support**: catchaitext@gmail.com
- **Authors**: Awana Jonathan, Ogaga-Ochuko D. Oghoghome
