# yurakonoplya/unmark-checker architecture

> Architecture diagram of the GitHub repository yurakonoplya/unmark-checker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yurakonoplya/unmark-checker
- Repository: https://github.com/yurakonoplya/unmark-checker
- Video tour (about a minute): https://gitdiagram.com/yurakonoplya/unmark-checker/video

## Overview

unmark-checker is a local benchmark for measuring whether text-rewriting tools remove a keyed SynthID-class watermark, and what meaning, facts, and length are lost. Its main workflow generates or loads a marked sample, accepts a tool’s returned text, rejects unrelated output, scores watermark survival and rewrite costs, then reports the measurements. A separate matrix command aggregates recorded service runs. The graph reflects README-described capabilities and sampled module responsibilities; some CLI wiring and unsampled subsystems are documented but not fully visible in the excerpts.

Main entry points: [`src/unmark_checker/cli.py`](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/cli.py) (CLI commands), [`src/unmark_checker/kpi.py`](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/kpi.py) (Rewrite metrics), [`integrations/watermarks-remover/run.py`](https://github.com/yurakonoplya/unmark-checker/blob/main/integrations/watermarks-remover/run.py) (Remover adapter), [`src/unmark_checker/detector.py`](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/detector.py) (Key-aware detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Sample workflow"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_samples["Marked samples"]
  node_schemes["Scheme presets<br/>[schemes.py]"]
  node_watermark["Text generation<br/>[watermark.py]"]
  node_corpus["Human corpus<br/>[corpus.py]"]
end

subgraph group_scoring["Detection and metrics"]
  node_identity["Sample identity<br/>[identify.py]"]
  node_detector["Key-aware detector<br/>[detector.py]"]
  node_thresholds["Frozen outcomes<br/>[thresholds.py]"]
  node_kpi["Rewrite metrics<br/>[kpi.py]"]
  node_entities["Fact preservation<br/>[entities.py]"]
  node_embed["Meaning similarity<br/>[embed.py]"]
end

subgraph group_reporting["Results and comparison"]
  node_servicefiles["Service records"]
  node_matrix["Comparison matrix<br/>[matrix.py]"]
end

subgraph group_integration["Tool integration"]
  node_integrationrunner["Remover adapter<br/>[run.py]"]
end

node_user(("Tester"))
node_remover(("Rewrite tool"))
node_externalservice["Remover service"]

node_user -->|"runs commands"| node_cli
node_cli -->|"builds scheme"| node_schemes
node_cli -->|"generates text"| node_watermark
node_cli -->|"loads control text"| node_corpus
node_cli -->|"writes samples"| node_samples
node_user -->|"submits sample"| node_remover
node_remover -->|"returns text"| node_cli
node_cli -->|"checks overlap"| node_identity
node_cli -->|"scores watermark"| node_detector
node_detector -->|"builds processor"| node_watermark
node_cli -->|"uses outcomes"| node_thresholds
node_cli -->|"measures rewrite"| node_kpi
node_kpi -->|"checks entities"| node_entities
node_kpi -->|"compares meaning"| node_embed
node_cli -->|"reads records"| node_servicefiles
node_cli -->|"builds table"| node_matrix
node_matrix -->|"loads runs"| node_servicefiles
node_user -.->|"runs adapter"| node_integrationrunner
node_integrationrunner -.->|"calls service"| node_externalservice
node_integrationrunner -.->|"measures returned text"| node_cli

click node_cli "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/cli.py"
click node_samples "https://github.com/yurakonoplya/unmark-checker/tree/main/samples"
click node_schemes "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/schemes.py"
click node_watermark "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/watermark.py"
click node_corpus "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/corpus.py"
click node_identity "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/identify.py"
click node_detector "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/detector.py"
click node_thresholds "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/thresholds.py"
click node_kpi "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/kpi.py"
click node_entities "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/entities.py"
click node_embed "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/embed.py"
click node_servicefiles "https://github.com/yurakonoplya/unmark-checker/tree/main/results/services"
click node_matrix "https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/matrix.py"
click node_integrationrunner "https://github.com/yurakonoplya/unmark-checker/blob/main/integrations/watermarks-remover/run.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_samples,node_schemes,node_watermark,node_corpus toneBlue
class node_identity,node_detector,node_thresholds,node_kpi,node_entities,node_embed toneAmber
class node_servicefiles,node_matrix toneMint
class node_integrationrunner toneRose
class node_user,node_remover,node_externalservice toneIndigo
```

## Components

### Sample workflow

- [CLI commands](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/cli.py): `src/unmark_checker/cli.py`
- [Marked samples](https://github.com/yurakonoplya/unmark-checker/tree/main/samples): `samples`
- [Scheme presets](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/schemes.py): `src/unmark_checker/schemes.py`
- [Text generation](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/watermark.py): `src/unmark_checker/watermark.py`
- [Human corpus](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/corpus.py): `src/unmark_checker/corpus.py`

### Detection and metrics

- [Sample identity](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/identify.py): `src/unmark_checker/identify.py`
- [Key-aware detector](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/detector.py): `src/unmark_checker/detector.py`
- [Frozen outcomes](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/thresholds.py): `src/unmark_checker/thresholds.py`
- [Rewrite metrics](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/kpi.py): `src/unmark_checker/kpi.py`
- [Fact preservation](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/entities.py): `src/unmark_checker/entities.py`
- [Meaning similarity](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/embed.py): `src/unmark_checker/embed.py`

### Results and comparison

- [Service records](https://github.com/yurakonoplya/unmark-checker/tree/main/results/services): `results/services`
- [Comparison matrix](https://github.com/yurakonoplya/unmark-checker/blob/main/src/unmark_checker/matrix.py): `src/unmark_checker/matrix.py`

### Tool integration

- [Remover adapter](https://github.com/yurakonoplya/unmark-checker/blob/main/integrations/watermarks-remover/run.py): `integrations/watermarks-remover/run.py`

### Other components

- **Tester**
- **Rewrite tool**
- **Remover service**

## Connections

- Tester → CLI commands: runs commands
- CLI commands → Scheme presets: builds scheme
- CLI commands → Text generation: generates text
- CLI commands → Human corpus: loads control text
- CLI commands → Marked samples: writes samples
- Tester → Rewrite tool: submits sample
- Rewrite tool → CLI commands: returns text
- CLI commands → Sample identity: checks overlap
- CLI commands → Key-aware detector: scores watermark
- Key-aware detector → Text generation: builds processor
- CLI commands → Frozen outcomes: uses outcomes
- CLI commands → Rewrite metrics: measures rewrite
- Rewrite metrics → Fact preservation: checks entities
- Rewrite metrics → Meaning similarity: compares meaning
- CLI commands → Service records: reads records
- CLI commands → Comparison matrix: builds table
- Comparison matrix → Service records: loads runs
- Tester → Remover adapter: runs adapter
- Remover adapter → Remover service: calls service
- Remover adapter → CLI commands: measures returned text
