How kilopal/ghostmark works
GhostMark is a local-first toolkit for stripping AI provenance from text and files, with browser, CLI, and WASM interfaces. The main workflow accepts text or a file, dispatches to format-appropriate cleanup, and returns cleaned output; the eval harness can separately embed, score, and measure watermark-breaking. The README also describes browser AI rewriting, detection integrations, X-Ray scanning, and proofreading. Several of these capabilities are documented but their implementation wiring was not sampled, so those links are omitted or marked unverified.
Main entry points: App.tsx Web playground · main.rs CLI commands · wasm-worker.ts WASM worker · lib.rs WASM API
Components 16
User interfaces
- Browser extension
extension/popup.js - Web playground
playground/src/App.tsx - CLI commands
cli/src/main.rs - WASM worker
playground/src/wasm-worker.ts
Scrubbing engine
- WASM bindings
playground/src/pkg/ghostmark_wasm.js - WASM API
wasm/src/lib.rs - Text scrubbing
core/src/text_scrubber.rs
File cleanup
- Image metadata
core/src/image_stripper.rs - Document metadata
core/src/document_stripper.rs
Watermark analysis
- Watermark eval
core/src/eval.rs - X-Ray scanning
playground/src/App.tsx
AI and detection
- Local AI rewriting
playground/src/App.tsx - Ollama inference
cli/src/main.rs - Gemini detection API
- Anthropic detection API
Other components
- User
Connections 21
- User → Web playground: submits input
README.md - User → Browser extension: submits input
README.md - User → CLI commands: runs command
README.md - Web playground → WASM worker: dispatches work
- WASM worker → WASM bindings: calls bindings
playground/src/wasm-worker.ts - WASM bindings → WASM API: invokes WASM
- WASM API → Text scrubbing: uses engine
README.md - WASM API → Image metadata: uses engine
README.md - WASM API → Document metadata: uses engine
README.md - CLI commands → Text scrubbing: cleans text
cli/src/main.rs - CLI commands → Image metadata: cleans images
cli/src/main.rs - CLI commands → Document metadata: cleans documents
cli/src/main.rs - CLI commands → Watermark eval: runs evaluation
cli/src/main.rs - WASM worker → Watermark eval: runs evaluation
playground/src/wasm-worker.ts - WASM worker → Image metadata: strips image bytes
playground/src/wasm-worker.ts - WASM worker → Document metadata: strips file metadata
playground/src/wasm-worker.ts - Web playground → X-Ray scanning: scans files
README.md - Web playground → Local AI rewriting: rewrites text
playground/src/App.tsx - CLI commands → Ollama inference: requests inference
cli/src/main.rs - Web playground → Gemini detection API: checks watermark
README.md - Web playground → Anthropic detection API: checks watermark
README.md