Commit Graph
18 Commits
Author SHA1 Message Date
mozempk 164e8fcd3d docs: run-book for Mac setup, spike and commissioning 2026-08-27 12:28:03 +02:00
mozempk 2a91aea58e refactor: consolidate every Italian UI string into ui/strings.ts
Seven per-file tables moved: S.retouch, S.logo, S.social, S.tools, S.wiring,
DIRECTOR_WARNINGS, and doctor.ts's table merged into the existing S.doctor
(verified collision-free first). Each file keeps a local alias --
'export const R = S.retouch' -- so not one reference site changed, which is
what keeps a 250-line move reviewable.

DIRECTOR_WARNINGS stays a named export rather than a nested key: it is a table
of functions with its own Record<DirectorWarningCode, ...> type. The type is
pulled in with 'import type', erased at compile time, so no runtime cycle even
though director.ts imports S from here.

tsc proves the keys exist but not that they resolve at run time, so
tests/e2e/strings.mjs loads the modules through jiti and asserts real leaves
are non-empty and the warning functions still render Italian.

Also documented: pi needs Node >= 22.3 (pi-ai calls process.getBuiltinModule).

0 TODOs left in extensions/.
2026-08-27 12:25:29 +02:00
mozempk 8a62c7e60a fix: all six defects the renderer workflow left as 'minor'
Three were not minor.

contrast: the hero-bottom sample region covered the bottom 0.45 while the
band is content-driven up to 0.62 (0.80 landscape). The title's first line
could land on unmeasured bright sky with needs_scrim false. Region widened to
the worst-case band; landscape gets its own entry.

contrast: stdev was taken AFTER the RAW_MAX_EDGE lanczos downsample, which
averages away the exact signal it exists to detect. Measured: a 5000px
1px-cell checkerboard reported stdev 5.6 against a BUSY threshold of 48 -- a
maximally busy picture read as flat and got no scrim. Now taken from a
nearest-neighbour reduction (point-sampling preserves high-frequency
contrast): 117.5. Regression test in tests/e2e/oversized.mjs.

retouch: crop sized print formats from trim pixels, so A3 came out with no
bleed allowance. Now artTargetSize(); the too-small warning matches.

formats: A4+3mm was 2551 where the declared ceil policy and preflight both
say 2552 -- printPagePx and artResolution disagreed by a pixel.

lib.typ: crop marks were drawn flush to the trim corner, so a cut landing
inside the trim printed a tick on the delivered poster. They now stop short.

split: min-size was not rescaled with the word cap, collapsing fit()'s
bisection to a point and overflowing the block. Matches the other three.
2026-08-27 10:48:00 +02:00
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