Repository navigation
Code Word Converter
This image supports the W-13 converter behind platform/wordconvert. It is not
wired to public upload/processing routes yet. Original DOCX and binary Word DOC
remain private sources; conversion never creates learner media or a test.
Build locally from this directory's narrow context:
docker build -t quizzivy-word-converter:development docker/word-converter
docker image inspect quizzivy-word-converter:development --format '{{.Id}}'The Go adapter requires the resulting immutable sha256:… image ID and uses
--pull=never. Record that ID with the rendition manifest. Rebuilding for package
security updates creates a new processing version; a mutable image tag is not a
runtime identity. Debian's supported Writer package supplies native legacy Word
filters. Runtime additions are LibreOffice Writer, Python UNO (explicit safe load
properties), Poppler (bounded page rasterization) and Liberation/DejaVu fonts.
No Python/UNO object is exposed to the API process or document text.
The adapter copies at most 25 MiB into a new 0700 disk job with 0600 input.
Native DOCX is inspected before conversion; normalized legacy DOCX is inspected
again before use. The source mount is read-only. The writable work and fallback
/tmp mounts are job-specific disk directories, never the host's /tmp or tmpfs.
No home directory, repository, credential file or Docker socket enters the container.
The converter runs as the worker's non-root UID with a read-only root filesystem, no capabilities, no-new-privileges, no network, one CPU, 512 MiB RAM with no extra swap, 64 processes, 256 file descriptors and a 128 MiB per-file ceiling. One fixed Docker name allocates a physical converter slot atomically across worker processes. An occupied slot returns busy; cleanup uses the invocation's journalled container ID or unique owner label and cannot kill another worker. Completed owned slots can be reclaimed after a crash. A crashed worker cannot start overlapping conversion containers just because its database lease expired.
The Go timeout/cancellation path force-removes its container. The image also has an independent 120-second process-group kill deadline, which remains effective if the host worker disappears. A disk watchdog cancels jobs exceeding 256 MiB or 4,096 entries. This is a polling threshold, not a filesystem quota. A cleanup failure retains the private job and reports an operator-action error rather than pretending cleanup succeeded. Broader orphan-file retention remains W-21/D-08 work.
UNO loads with MacroExecutionMode=NEVER_EXECUTE
and UpdateDocMode=NO_UPDATE.
An interaction handler aborts password/repair prompts. Do not replace this with a
bare --convert-to call that relies on a user's profile. Corrupt/locked inputs
fail without a successful empty result or a lossy text fallback.
The runtime emits a private PDF, at most 60 PNG pages (long edge at most 1,600 px),
and a normalized DOCX only for legacy input. The host checks allowed names,
sequence, regular-file status, byte totals, PNG decoding and native package safety;
os.Root confines artifact access. Total accepted artifacts are at most 128 MiB.
Results record source checksum, image ID, renderer version and artifact checksums.
Callers must Close the result after durable storage to remove transient files.
All renditions require layout review. Legacy normalization additionally requires conversion review. Font substitution, desktop layout differences, fields and other losses are not silently asserted equivalent to Microsoft Word. Page images are a comparison aid; they do not provide fabricated question bounding boxes. Original files and source answer annotations never become learner assets automatically.
Local command, using an existing private disk workspace and a new output directory:
GOMAXPROCS=2 go run ./cmd/word-convert \
-image sha256:THE_LOCAL_IMAGE_ID \
-work-dir /absolute/private/work \
-output /absolute/private/new-artifacts source.docxRun from server/. Output contains private source material and must stay outside
Git. The image is a runtime dependency, not a new Go module dependency. Production
capacity, real legacy-family fidelity, durable artifact wiring and retention remain
gates; these development limits are not an approved throughput promise.
Set TEST_WORD_CONVERTER_IMAGE to the local image ID and run:
go test -tags integration ./internal/platform/wordconvert/...Set TMPDIR and GOTMPDIR to a private disk directory for local checks. The suite
uses synthetic files and one container at a time. It covers real binary DOC
normalization/underlines, encrypted sources, PNG rendition, timeout/cancellation,
physical-slot collision/reclaim, disk limits and output confinement. A runtime
probe checks actual network reachability, mount writes, capabilities, cgroup limits
and disk-backed temporary mounts. Docker Desktop may create down tunnel devices;
network isolation is checked through routes, interface state and failed egress,
not an assumption that loopback is the only named device.
Generated from docker/word-converter/README.md. Edit that file in the repository; changes made on this page are overwritten.
Generated from the repository's documentation on every push to develop.
Start here
Product
Implementation plan
- 00 Architecture overview
- 10 Phase 0: Scaffold and contract
- 11 Phase 1: Auth, join, shells
- 12 Phase 2: Admin authoring
- 13 Phase 3: Assign and take
- 14 Phase 4: Grade and results
- 15 Phase 5: Hardening
- 16 Phase 4.5: The student at a desk
- 17 Word import: milestone plan
- 18 Word import: teacher workflow
- 19 Versioned content contract
- 20 Data model
- 30 Risk register
- 40 Open items
- 50 Non-functional requirements
- 60 Backend architecture
- 91 September 2026 issue remediation
- 92 Student layouts and interaction rules
Redesign (Phase R)
- 70 Redesign overview
- 71 R1: Foundations (v0.7.0)
- 72 R2: Access (v0.8.0)
- 73 R3: Student console (v0.9.0)
- 74 R4: Teacher workspace (v0.10.0)
- 74d D4: Deck update (v0.11.0)
- 74e E1: Moving a question across a group
- 75 R5: Admin console and email (v0.12.0)
- 76 R6: Question types and scoring (v0.13.0)
- 77 R7: Collaboration (v0.14.0)
- 78 R8: Schedule (v0.15.0)
- 79 R9: Insights (v0.16.0)
- 80 R10: Learn (v0.17.0)
- 81 R11: Landing, leads, v1.0 (v1.0.0)
Setup and operations
- CI
- Deploying
- DNS for quizzivy.com
- Google OAuth client
- Production operations
- Cloudflare R2 bucket
- Word import worker
- R4 rehearsal on a Neon branch
Design
Team
- Agent team
- Verification environment
- Team ledger
- R4 readiness
- R4 verification strategy
- T-R4.51 browser verification
Code READMEs