Files
watermarks-remover/CONTRIBUTING.md
T
Guillaume Meyer (The Opinionated Man)andGitHub 55d4bdc9fc feat: split skill from service, add HTTP API and Docker distribution (#60)
* feat: split skill from service, add HTTP API and Docker distribution

The agent skill (skills/remove-ai-marks/) is now a code-free remote client:
all implementation moved to service/scripts/ and runs behind a stdlib HTTP
service (server.py) with /health, /capabilities, /inspect, /clean and a
dynamically generated OpenAPI 3.0.3 spec at /openapi.json.

- Move scripts/ and the backend Dockerfiles under service/
- server.py: JSON/base64 HTTP entrypoint with size caps, binary guard,
  atomic writes, loopback default, optional bearer auth
- Core Dockerfile (exiftool/qpdf/c2patool preinstalled) and a GHCR publish
  workflow for the core/markllm/markdiffusion images
- compose.yaml (wr-* services, harness/heavy profiles) + compose-check.sh
  to validate the running stack (exit code only)
- Fix markllm image build (tokenizers 0.22.2, CPU-only torch) and ctrlregen
  build (python:3.11 base for the 2023-era research pins)
- Fix markllm/markdiffusion harness images missing common.py at runtime

* docs: add .env.example and service configuration guide

* fix: disable chain-of-thought for openai-compatible Layer B rewrites

deepseek-v4-flash is a reasoning model: a one-line paraphrase burned 9,894
reasoning tokens (~100s) and hit the default timeout. Send
reasoning_effort=none by default for the openai-compatible backend
(--reasoning-effort / WATERMARKS_REWRITE_REASONING_EFFORT; 'off' omits the
parameter), cutting the same rewrite to ~1s / 12 tokens. Tested end-to-end
against api.deepseek.com.

* fix: sanitize client-supplied filename in HTTP service

CodeQL 'uncontrolled data in path expression' (server.py): a name like
'../../x' flowed into Path(tmpdir) / name, letting an upload escape the
request temp dir on write. Sanitize name to its basename in _decode_input
(_safe_name) and refuse any joined path whose parent is not the tmpdir at
the write sites (_tmp_path). Tests cover traversal names.

* chore: gitignore .env (contains local rewrite credentials)

* chore: deny-by-default gitignore and dockerignore; document compose env config

.gitignore and service/.dockerignore now exclude everything by default and
explicitly allow only what is publishable/needed: tracked source, docs,
tests, .github, and (for images) the service/scripts/ tree that every
Dockerfile COPYs. Root .dockerignore documents that all builds use service/
as context. README Configuration section now covers .env setup for docker
compose, host-side export for CLI runs, and the full variable table.
2026-08-14 15:42:48 -07:00

3.4 KiB

Contributing to watermarks-remover

Thanks for helping keep the skill accurate and the cleaners reliable. The project is a small Python skill (skills/remove-ai-marks/) plus tests — focused PRs land fastest.

Who can do what

Action Who
Open issues Anyone
Suggest a release Anyone (use the Release suggestion issue template)
Open pull requests Anyone (fork the repo)
Approve and merge pull requests Maintainer only (@guillaumemeyer)

main is protected. A change needs a pull request, a passing CI check (test), and an approving review from the code owner before merge. Only the maintainer can give that approval. Direct pushes to main are blocked for non-admins.

To suggest a release without a code change: open a Release suggestion issue.

Prerequisites

  • Python 3.10+ (stdlib only for the skill scripts; optional rewrite backends use HTTP to local Ollama / OpenAI-compatible endpoints)
  • From the repo root: python3 -m pytest -q should pass before you open a PR
  • Optional for manual file checks: c2patool, exiftool (PDF)

Layout

Path Role
skills/remove-ai-marks/SKILL.md Agent skill entry (workflow, ethics) — remote client over HTTP
skills/remove-ai-marks/references/ Vendors, mark classes, matrix, ethics
service/scripts/ Layer A/B hooks + image/container cleaners + server.py HTTP service
service/Dockerfile* Container images (core + optional backends)
compose.yaml Local full-stack bring-up
tests/ Pytest suite and fixtures
.github/workflows/ci.yml CI job test
.github/workflows/release-images.yml GHCR image publishing on v* tags

Layers (what to change where)

  1. Layer A (Unicode / format controls) — deterministic scripts under service/scripts/ (text_unicode.py, clean_text.py, inspect_text.py). Prefer tests with fixtures in tests/fixtures/.
  2. Layer B (statistical rewrite) — guidance in SKILL.md plus optional rewrite_text.py (print-prompt default; ollama / openai-compatible). No bundled model. Keep ethics-aware.
  3. Files (C2PA / EXIF / XMP / props)image_meta.py (PNG/JPEG), container_meta.py (SVG/PDF/DOCX/ODT/HTML/MD), unified inspect_file.py / clean_file.py. Preserve document body / pixels; strip provenance metadata only.

Checklist for a change

  • Behaviour matches SKILL.md / references/removal-matrix.md when relevant
  • Unit tests updated or added under tests/
  • python3 -m pytest -q passes
  • Docs updated (README and/or skill references) if user-facing behaviour changes
  • No drive-by refactors unrelated to the fix or feature

PR expectations

  • Stay focused and match existing style (stdlib-first scripts, clear CLI flags)
  • Do not commit secrets, private user files, or large binary fixtures unless needed and redacted
  • Respect references/ethics.md: this tool is for content the user owns

Questions? Open an issue describing the input type (text / image / document) and which layer failed or is missing.

Community