From 1440adc1997d0a3f5097366f8cf058fb42d1e5b8 Mon Sep 17 00:00:00 2001 From: Kharec Date: Thu, 15 Oct 2026 17:54:11 +0200 Subject: [PATCH] docs: record why the translation engine lives in-tree A from-scratch CPU inference engine is the largest, riskiest part of the codebase and the least connected to screenwriting, so it deserves a written decision. It stays: the alternative (a ctranslate2/argos dependency, a plugin or a separate binary) buys a single menu item at the cost of cgo and per-distribution packaging, while the in-tree engine keeps the one-binary, offline, GPL-clean build. The package doc now says so, with the condition that should reopen the question (more language pairs). --- AGENTS.md | 3 ++- internal/marian/model.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 9925af8..ae8a642 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -62,7 +62,8 @@ internal/layout line wrapping + pagination (paper sizes, locked pages); internal/pdf hand-written PDF 1.4 writer, standard Courier fonts, zero dependencies internal/spell Hunspell .aff/.dic reader, checker (compounds too), suggestions, word scan internal/marian MarianMT (OPUS-MT) inference in pure Go: safetensors, SentencePiece unigram, - transformer encoder-decoder, beam search, verified download + transformer encoder-decoder, beam search, verified download. In-tree on + purpose (one binary, no cgo, offline by design): see the package doc. internal/translate French → English script translation: language detection, screenplay term tables, per-element rules, name protection, parallel sentence translation frontend/index.html app shell: header bar, navigator, paper, HUD, s diff --git a/internal/marian/model.go b/internal/marian/model.go index 07e6fd3..86057de 100644 --- a/internal/marian/model.go +++ b/internal/marian/model.go @@ -3,6 +3,18 @@ // plain Go: a SentencePiece tokenizer, the transformer encoder-decoder and // beam search. A model directory holds config.json, model.safetensors, // source.spm, target.spm and vocab.json. +// +// The engine lives in-tree on purpose. Plotzilla ships as one binary built +// with only the Go toolchain: a native runtime (ctranslate2, argos) would +// add cgo and per-distribution packaging, and a separate binary or plugin +// an install step, all for a single menu item. Translation is offline by +// design — an unpublished script never leaves the machine — and the model +// is data downloaded at runtime (Apache-2.0), so neither the "no +// third-party dependency" rule nor the GPL is affected. The screenplay +// conventions stay out of this package (internal/translate owns them) and +// the pipeline is covered by a synthetic tiny model and, on demand, the +// real one. If more language pairs are ever added, each with its own +// 300 MB download and quirks, reconsider a separate optional component. package marian import (