Repository navigation
Releases
v0.5.0
What a consumer must do. Nothing. Both additions are new keys that every
earlier release refused, so no template that rendered before renders
differently. options.limits gains editorBytes; a host that passes a full
limits object needs no change, because absent limits take their defaults.
Added
$spread: a group of siblings per item, spliced flat (document builder,
owner-approved q_52d2323e, "repeating sections"), SPEC.md section 8.
{ "$each": "models", "$as": "model", "$spread": true, "$value": [ ... ] }
splices each element of$valueinto the parent array, per item, in order:
a page break, a heading, a lines table and a subtotal per pricing model.
Without it an array$valuerenders as nested arrays ([[4 blocks], [4 blocks]]), which fine-print refuses; a per-block$eachgives the wrong
order. Each element is an element of the PARENT array: matched by the
spread's own profile path, it may carry$if,$each, a splice or a spread,
and its$firstis the spread's, so "not before the first item" is
"$if": "!$first"(fancy-expr's negation is!; there is nonot). Same
bindings, iteration and output bounds as a splice; an element's directive
counts one more towarddirectiveDepth. Errors:$spreadother thantrue,
or without$value, isDIRECTIVE_INVALID; a non-array$valueis the new
DIRECTIVE_SPREAD_NOT_ARRAY.- The
editorenvelope key (document builder, owner-approved q_b83ac35f),
SPEC.md sections 2 and 10: an optional object holding a visual builder's own
source. Never read byinspect,validateData,renderorpreview, never
output, never changed. It is bounded by the newlimits.editorBytes(default
262144,TEMPLATE_EDITOR_TOO_LARGEat/editor) and no longer counts toward
templateBytes. A non-object isTEMPLATE_SHAPE. - An end-to-end test (
php/tests/QuoteSpreadFinePrintTest.php): conformance
rowtemplate/directives0033, a quote with two pricing models, is rendered
and written through fine-print, which validates it, lints it with no error
and reads back one page per model. - Sabotages S59-S68, T59-T68 and P59-P68 (
$spreadandeditor).
Changed
-
Tests: fancy-conformance pin moved from 0.45.0 to 0.55.0 in all three
legs. 0.54.0 adds the$spreadrows and 0.55.0 theeditorrows; no
existingtemplate/*row changed between 0.45.0 and 0.55.0. -
CI: the lab-certificate gate verifies against the lab's rotated key list.
The lab's first signing key is retired: certificates it already issued still
verify, and nothing new it signs ever can. Consumers do nothing. -
Releases need a lab-run certificate.
publish.ymlgains a read-only
lab-certificatejob that every publishing job needs: a tag is published only
when the fancy-labs lab has certified that exact version and commit. Consumers
do nothing; this changes how releases are cut, not what the package does. -
Docs:
AGENTS.mdis now the guide to using this package (install, its entries on the Fancy MCP catalog server, API essentials, traps), and it ships in the package. The contributor notes it held moved toCONTRIBUTING.md, andCLAUDE.mdis now a symlink to it. The README points to the MCP server and toAGENTS.md. No code changed; nothing to do.
v0.4.0
What a consumer must do. Nothing, unless your data can hold a band field
written literally. BREAKING: a value containing {section}, {sectionpages},
{author}, {title}, {filename}, {date} or {time} (with or without a
:FORMAT) in a band slot, or anywhere in a blocks band's run text, is now
VALUE_PAGE_FIELD, as {page} and {pages} already were. It was a live-field
injection before: a recipient named see {date} printed a date. Reword the value
or catch the error. Values with other braces are unchanged.
Added
profiles/fine-print.jsonallows tokens in the first and even band slots, and in
bands on apageBreak.page, following fine-print's mixed-page vocabulary. Page
geometry on a break stays closed to tokens.
Fixed
- Security:
VALUE_PAGE_FIELDmissed most of the tokens a writer resolves. It
checked{page}and{pages}alone, in all three legs, while last-word has written
{date},{author}and others as live Word fields since 0.16.0, and fine-print now
resolves{section}and more. - Security: a blocks band's run text was not
band-encoded, for either writer:
first match made it plaintext, so a user value{page}in a logo footer became
a live field with no error at all. Both profiles now match it first.
v0.3.0
Added
- Office files as templates (fancy-template#1; owner's rule "any file can
be a template"), SPEC.md section 12. PHP:Template::inspectFile($bytes, $options)returns the{{ placeholders }}in a.docx/.dotx,
.pptx/.potx/.ppsxor.xlsx/.xltxwith their locations
(/word/document.xml#p1,/xl/worksheets/sheet1.xml#B4) and the same issue
codes asinspect;Template::renderFile($bytes, $data, $options)fills them
IN PLACE and returns the new file. Every member without a token is copied as
its original zip record, byte for byte. A token Word split across runs is
found and filled: the value goes into the run holding{{(keeping its
formatting), the rest of the token is cut from the following runs, and no run
is removed. Values are XML-escaped; an xlsx value stays text (never a
formula, and a whole-token number stays a string). Declarations come as a
sidecar (options.variables, section 3's format), not document properties;
without them names are inferred. Read and filled: docx body, tables, text
boxes, headers, footers, footnotes, endnotes, comments; pptx slides, layouts,
masters, notes; xlsx shared and inline strings. A token in any other part is
TOKEN_FORBIDDEN_FIELD. - Hardening, matching last-word 0.13.0's template intake, refused with typed
codes:FILE_DOCTYPE(any part read),FILE_TOO_LARGE/FILE_TOO_MANY_ENTRIES
/FILE_ZIP_BOMB(options.fileLimits),FILE_PATH(traversal, absolute,
backslash, control characters, two spellings of one part),FILE_ENCRYPTED,
FILE_MACRO_ENABLED(refused, not passed through; a.docxcarrying a VBA
project too),FILE_ARCHIVE,FILE_XML,FILE_UNSUPPORTED;VALUE_XML_CHAR
for a value XML cannot carry. External relationships are never followed. - TypeScript
inspectFile/renderFileand Pythoninspect_file/
render_fileexist and throwFileTemplatesNotImplementedError
(codeFILE_NOT_IMPLEMENTED): loud, never a silent no-op. fixtures/files/: 19 files (hand-authored OOXML, a last-word docx, a
dark-slide pptx, hostile files) andcases.json, 30 hand-written rows in
fancy-conformance's case-table shape for the ports. SabotagesS42-S58.- Requirement:
ext-zipis now declared incomposer.json(holy-sheet and
last-word already require it). Nothing to do unless your PHP lacks it.
Changed
- Sabotage
S19now names the first of two identical guard lines in
Template.php(render);S57breaks the second (renderFile).
v0.2.0
Phase 6 of the plan: the TypeScript and Python legs, and the dark-slide and
holy-sheet profiles in all three. Nothing to do for a PHP consumer -- every
change to the PHP leg below either adds a profile or accepts a template the spec
always allowed; nothing that rendered before renders differently.
Added
-
The
$valuesplice (owner ruling 2026-10-27, "Agent: add $value
splice"), SPEC.md section 8:{"$each": "<path>", "$as": "<name>", "$value": <any JSON>}as an item of any array is replaced in place by one rendered copy
of$valueper element, so a holy-sheet ROW, a cell or a string in a list can
repeat.$valuerenders as if written at the element's position (a spliced
row's strings are still{ "value": s }), may contain directives under the
samedirectiveDepth, and counts towarditerationsandoutputNodeslike
$each.$valuewithout$eachisDIRECTIVE_INVALID; a non-$key beside
it is the newDIRECTIVE_SPLICE_KEY. Rows: fancy-conformance 0.36.0.
Implemented in all three legs (Inspector + Renderer). Against the 0.36.0
fixtures with the pre-splice code, all 24 new or changed rows failed in every
leg; with it, all 203 pass in every leg, 211/211 byte-identical across legs
(parity.php), 0% under--control, 60/60 through the real writers. The xlsx
corpus report now repeats its quarter rows with a splice instead of
addressing them by index. Nine sabotages per leg (S33-S41,T33-T41,
P33-P41):$valuewithout$each, a key beside it,directiveDepth
inside it, the splice object counting no node, one iteration counter for every
loop, the element's path for the profile, its top not being an element, a
null$valuestill splicing, and plain notes in the profile data. -
TypeScript leg,
@particle-academy/fancy-template(src/,tests/;
ESM + CJS + types via tsup). Same API as PHP:inspect,validateData,
render,preview,tokenize,TemplateError { code, path, variable }.
Written against SPEC.md, not against the PHP source. Depends on
@particle-academy/fancy-expr>=0.2.0 <2.0only. Scans UTF-8 bytes so the
token-length bound means what it means in PHP; every key read and write goes
through own-property helpers, so a template or data key spelled__proto__
orconstructoris only ever a key. -
Python leg,
fancy-template(python/, Python >= 3.11, typed). API in
snake_case (validate_data). Depends onfancy-expr>=0.2.0,<2.0only. Every
walk of unknown depth is iterative;boolis never a number; names, digits
and dates are ASCII-only; a hoststr/intsubclass is read through its base
type, so no host method runs. -
dark-slide and holy-sheet profiles, in all three legs: the
markup,
markdownandcellencodings. dark-slide values are CommonMark-escaped in
format: "markdown"content and entity-escaped informat: "html";
every holy-sheet string result is written{ "value": s }, so user data can
never become a formula. A whole-token number or boolean keeps its type, and so
does a valid date whose path is DECLAREDdate(SPEC.md section 9, clarified). -
All 203
template/*rows of fancy-conformance 0.36.0 pass in every leg,
none skipped. The fixture pin moved 0.35.0 -> 0.36.0 together in
composer.json (exact), package.json (^0.36.0) + package-lock.json, the
threePINNED_SUITE_VERSIONconstants and both CI checkout refs. -
Cross-leg parity (
php php/tests/parity.php): every fixture row and a
corpus of realistic templates (examples/: certificate, invoice with$each
line items, a deck with a repeated slide and repeated table rows, a regional
xlsx report) run through all three legs and compared byte for byte -- 203/203
against the expected column in each leg, 211/211 between the legs;--control
reports 0% on every column.--writersrenders the corpus through the real
writers (fine-print; last-word, dark-slide and holy-sheet in PHP, Node and
Python) and compares the extracted text: 60/60 files identical. -
scripts/sabotage.pycovers all three legs and fancy-expr's bounds in all
three of its languages: 134 sabotages (40 PHP, 42 TypeScript, 43 Python, 9
fancy-expr), each turning a suite red.S29/T29/P29("notes always
markdown-escaped") were retired with that rule. -
CI:
node,pythonandparityjobs. Publish: npm (Trusted Publishing,
provenance) and PyPI (build and publish split soid-token: writenever runs
build code), both behind the read-onlyguardjob and the changelog gate,
which now BLOCKS them. Both names need the owner's one-time bootstrap.
Changed
- dark-slide speaker notes are plain text (owner ruling 2026-10-27,
"Agent: notes are plain"), SPEC.md section 9: the profile'sslides.*.notes
istext, notmarkdown, so a value is no longer backslash-escaped there.
The PPTX writer writes notes as plain text and fancy-slides edits them in a
plain textarea, so the escape printed its backslashes in both. Unreleased
until now in every leg, so no consumer has the old behaviour. Row:
fancy-conformance 0.36.0template/profiles0104. - The PHP test that ran the 11
skip.phprows explicitly and asserted there
were 11 is replaced by one asserting notemplate/*row is skipped for PHP.
0.36.0 dropped the skips; the old test's own comment said to delete it then.
Fixed
PHP leg disagreements with SPEC.md, found by building the other two legs against
the spec. Each landed with a test that failed against the old code.
- A
$ifwritten BEFORE its$eachin the same object was refused as
DIRECTIVE_UNDECLARED: the binding was only created when the inspector
reached$eachin key order. Section 8 says$eachruns first. templateBytesskipped object keys spelled with digits ("10"), because PHP
decodes them as integer keys. Section 10 counts every key.maxLength/maxItemswritten3.0, andfancyTemplatewritten1.0,
were refused. Section 3 defines integer as an integral value, and JavaScript
cannot even tell3.0from3.
v0.1.0
Added
-
The conformance test asserts the installed fixture set equals the pinned
0.35.0 and that composer.json pins it exactly, so a moved fixture set fails
instead of being printed and passed..gitattributeskeeps every file LF, so
the in-source golden text matches on a Windows checkout too. -
SPEC.md, the normative specification of document templates: envelope,
variable declarations,{{ }}tokens, resolution, the fixed filter list,
$each/$as/$ifdirectives, per-writer profiles and the bounds. -
profiles/for fine-print, last-word (implemented) and dark-slide,
holy-sheet (data only; phase 6). -
The PHP leg:
Template::inspect,validateData,render,preview,
tokenize, throwingTemplateErrorwith a code, a JSON Pointer and a
variable path -- never a data value. Passes 169 of 169 runnable rows of the
seventemplate/*suites (11 rows are dark-slide/holy-sheet, skipped for PHP
in the fixtures with the reason stated). -
examples/certificate.fine-print.json: the default certificate, rendered
through fine-print 0.3.0 and read back in a golden test. -
scripts/sabotage.py: every bound and guard broken in turn; all 28 turn a
suite red.