Commit Graph
15 Commits
Author SHA1 Message Date
mozempk aee92d284c cleanup: clear stale TODOs, tighten types, translate art-prompt hints
Every 'being written in parallel' / 'ASSUMED SIGNATURE' TODO is gone: each
referenced module now exists and each assumption was checked against it
rather than the comment simply deleted.

- logo/presets/retouch: renderer typed as the real Renderer contract instead
  of unknown / (...args: never[]).
- director: the ModelRegistry assumption is VERIFIED against the installed
  @earendil-works types (find() on ModelRegistry, getModel() on ModelRuntime).
- strings: the img2imgBug TODO had it backwards -- drawthings raises a graded
  message a static string cannot express, and this is the fallback.
- poster: an Italian hint was being spliced into an English art prompt, which
  degrades these models. New director.refineArtPrompt() folds the note in via
  the LLM and falls back to the old splice on any failure, so it can only
  improve on the previous behaviour. scrubArtPrompt still runs either way.

Remaining TODOs are one category only (Italian strings living in per-file
tables rather than ui/strings.ts) and are accurate, not stale.
2026-08-27 10:30:54 +02:00
mozempk 68a0cad747 feat: workflow hardening pass across render, commands and wiring
Verified after the expansion: 0 type errors, 35/35 template x fixture
renders, 7/7 contrast assertions, e2e green. The print-resolution guard now
fires in Italian on under-sized artwork.
2026-08-27 10:23:57 +02:00
mozempk c74b3c8b5e fix(render): satisfy the Renderer contract the commands declare
index.ts was written against assumed renderer signatures (render(req)) while
typst.ts exposed render(resolved, jobDir, outPath). It type-checked -- only
typeof === 'function' was ever asserted -- but would have failed at runtime.

typst.ts now exports the request-shaped render()/renderAllFormats() the
commands' Renderer interface declares; the low-level entry points are
renderOne()/renderFormats(). smartCrop() likewise adopts retouch.ts's richer
contract, returning the size read back from the written file.

Verified e2e: a3-portrait -> PNG+PDF, ig-story -> PNG, Italian progress.
2026-08-27 09:55:48 +02:00
mozempk 4191489995 docs: platform notes - macOS 13 vs 14 split, backend assumptions, issue #121 2026-08-27 09:52:24 +02:00
mozempk 756dd9994e feat(render): Typst renderer, contrast analysis and print pre-flight
render/typst.ts stages each job as a self-contained bundle (<job>/.typst/
lib.typ + template + resolved.json) and roots Typst there, so artwork living
outside the package is reachable and old jobs stay re-renderable. Paths are
root-relative throughout -- Typst resolves a leading / against --root, not
the filesystem.

render/contrast.ts measures the region behind the text with sharp and forces
a scrim on high variance even when mean luminance passes; verified with a
checkerboard that scores 5.45:1 contrast yet stdev 119.9.

render/preflight.ts checks TrimBox, embedded fonts, image dpi and structure,
degrading to 'non installato' rather than failing when a tool is absent.

E2E verified via jiti: TrimBox 297.0x420.0mm, font axes injected, bundle
staged. 0 type errors.
2026-08-27 09:50:22 +02:00
mozempk 0b29c1587d fix(backend): stale classifyImageRunFailure -> classifyRunFailure
Left behind by a rename; broke the img2img (issue #121) crash-detection
path. Typecheck back to 0 errors.
2026-08-27 09:42:01 +02:00
mozempk fd39886168 chore: npm scripts for typecheck/test/fonts; pin tsc as a devDependency 2026-08-27 09:34:11 +02:00
mozempk 5d27417c54 fix(render): resolve ink contrast per surface, not once per poster
templates/lib.typ gains WCAG luminance/contrast-ratio/ink-on and a
surface-aware palette-of(). framed and split place type on flat colour and
were inheriting an ink measured against the artwork, rendering white on
cream at 1.15:1. Now computed per surface: 18.34:1 on the regression
fixture. Accent held to the same bar with fallback to ink.

Adds tests/contrast-check.typ, run per fixture by the harness.
35/35 render combos and 7/7 contrast assertions pass.
2026-08-27 09:33:08 +02:00
mozempk aad8a7fbdf tests: surface-contrast regression fixture (dark art + light bg) 2026-08-27 09:28:26 +02:00
mozempk 5fabf5345f tests: fix root-relative spec path; document ink-surface blocker 2026-08-27 09:25:34 +02:00
mozempk cf7f0aa386 tests: root-relative fixture paths + synthetic artwork 2026-08-27 09:16:48 +02:00
mozempk ae7ffd55b1 tests: golden-file fixture harness (accents, overflow, missing blocks, landscape) 2026-08-27 09:16:26 +02:00
mozempk d2f3d9fda2 docs: README (Italian) and MIT licence with font carve-out 2026-08-27 09:06:58 +02:00
mozempk 2f7db0e4fd docs: record empirically verified Typst behaviour (0.15.1) 2026-08-27 09:06:23 +02:00
mozempk 5a76acdfbc Scaffold: package, contracts (DesignSpec, config, backend, font registry) 2026-08-27 08:58:57 +02:00